Commit be556c4c authored by Matthieu Cattin's avatar Matthieu Cattin

For test03 add print to log if test is ok, move error print to the end (after stdio redirection).

parent 93690ffe
...@@ -48,7 +48,7 @@ def main (default_directory='.'): ...@@ -48,7 +48,7 @@ def main (default_directory='.'):
sys.stdin = sys.__stdin__; sys.stdin = sys.__stdin__;
# Initialize error variable, disable triggers and make sure no acquisition is running # Initialize error variable, disable triggers and make sure no acquisition is running
error = 0 error = [0, 0]
fmc.set_trig_config(1, 0, 0, 0, 0, 0, 0) fmc.set_trig_config(1, 0, 0, 0, 0, 0, 0)
fmc.stop_acq() fmc.stop_acq()
...@@ -67,8 +67,7 @@ def main (default_directory='.'): ...@@ -67,8 +67,7 @@ def main (default_directory='.'):
if (ask == "N"): if (ask == "N"):
# LED ON fail # LED ON fail
print("One or both LEDs not switching ON. Check for soldering or connection problem, grounded control line.") errors[0] += 1
errors += 1
############################################################################ ############################################################################
# Test LEDs OFF # Test LEDs OFF
...@@ -85,16 +84,21 @@ def main (default_directory='.'): ...@@ -85,16 +84,21 @@ def main (default_directory='.'):
if (ask == "N"): if (ask == "N"):
# LED OFF fail # LED OFF fail
print("One or both LEDs not switching OFF. Check for short-cut.") error[0] += 1
error += 1
# Standard in/out redirection # Standard in/out redirection
sys.stdout = tmp_stdout; sys.stdout = tmp_stdout;
sys.stdin = tmp_stdin; sys.stdin = tmp_stdin;
# Check if an error occured during LED test # Check if an error occured during LED test
if (error != 0): if (error != [0]*2):
if(error[0] != 0):
print("One or both LEDs not switching ON. Check for soldering or connection problem, grounded control line.")
if(error[1] != 0):
print("One or both LEDs not switching OFF. Check for short-cut.")
raise PtsError('An error occured during LEDs test, check log for details.') raise PtsError('An error occured during LEDs test, check log for details.')
else:
print('LEDs are working ok.')
if __name__ == '__main__' : if __name__ == '__main__' :
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment