Commit ce74dfb8 authored by Matthieu Cattin's avatar Matthieu Cattin

Test the two LEDs together.

parent 9d450bda
......@@ -48,92 +48,54 @@ def main (default_directory='.'):
sys.stdin = sys.__stdin__;
# Initialize error variable, disable triggers and make sure no acquisition is running
errors = [0, 0, 0, 0]
errors = [0, 0]
fmc.set_trig_config(1, 0, 0, 0, 0, 0, 0)
fmc.stop_acq()
############################################################################
# Test TRIG LED ON
# Test LEDs ON
fmc.trig_led(1)
fmc.acq_led(0)
fmc.acq_led(1)
ask = "";
while ((ask != "Y") and (ask != "N")) :
print "-------------------------------------------------------------"
ask = raw_input("Is the front panel LED TRIG switched ON? [Y/N]")
ask = raw_input("Are the front panel LEDs (TRIG and ACQ) switched ON? [Y/N]")
ask = ask.upper()
#print "-------------------------------------------------------------"
print " "
if (ask == "N"):
# TRIG LED ON fail
# LED ON fail
errors[0] = 1
############################################################################
# Test TRIG LED OFF
# Test LEDs OFF
fmc.trig_led(0)
fmc.acq_led(0)
ask = "";
while ((ask != "Y") and (ask != "N")) :
print "-------------------------------------------------------------"
ask = raw_input("Is the front panel LED TRIG switched OFF? [Y/N]")
ask = raw_input("Are the front panel LEDs (TRIG and ACQ) switched OFF? [Y/N]")
ask = ask.upper()
#print "-------------------------------------------------------------"
print " "
if (ask == "N"):
# TRIG LED OFF fail
# LED OFF fail
errors[1] = 1
############################################################################
# Test ACQ LED ON
fmc.trig_led(0)
fmc.acq_led(1)
ask = "";
while ((ask != "Y") and (ask != "N")) :
print "-------------------------------------------------------------"
ask = raw_input("Is the front panel LED ACQ switched ON? [Y/N]")
ask = ask.upper()
#print "-------------------------------------------------------------"
print " "
if (ask == "N"):
# ACQ LED ON fail
errors[2] = 1
############################################################################
# Test ACQ LED OFF
fmc.trig_led(0)
fmc.acq_led(0)
ask = "";
while ((ask != "Y") and (ask != "N")) :
print "-------------------------------------------------------------"
ask = raw_input("Is the front panel LED ACQ switched OFF? [Y/N]")
ask = ask.upper()
#print "-------------------------------------------------------------"
print " "
if (ask == "N"):
# ACQ LED OFF fail
errors[3] = 1
# Standard in/out redirection
sys.stdout = tmp_stdout;
sys.stdin = tmp_stdin;
# Check for errors in LED tests
if (errors != ([0] * 4)):
if (errors != ([0] * 2)):
if(errors[0] == 1):
print("TRIG LED not switching ON. Check for soldering or connection problem.")
print("One or both LEDs not switching ON. Check for soldering or connection problem, grounded control line.")
if(errors[1] == 1):
print("TRIG LED not switching OFF. Check for short-cut (grounded control line).")
if(errors[2] == 1):
print("ACQ LED not switching ON. Check for soldering or connection problem.")
if(errors[3] == 1):
print("ACQ LED not switching OFF. Check for short-cut (grounded control line).")
print("One or both LEDs not switching OFF. Check for short-cut.")
raise PtsError("There is a problem with the LEDs");
......
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