Commit 9855959c authored by Matthieu Cattin's avatar Matthieu Cattin

LED test modified to independently check the LEDs and add switch OFF test.

parent f80799c6
......@@ -41,27 +41,99 @@ def main (default_directory='.'):
spec = rr.Gennum() # bind to the SPEC board
fmc = fmc_adc.CFmcAdc100Ms(spec)
fmc.trig_led(1)
fmc.acq_led(1)
ask = "";
# Standard in/out temporary redirection
tmp_stdout = sys.stdout;
sys.stdout = sys.__stdout__;
tmp_stdin = sys.stdin;
sys.stdin = sys.__stdin__;
# Initialize error variable
errors = [0, 0, 0, 0]
############################################################################
# Test TRIG LED ON
fmc.trig_led(1)
fmc.acq_led(0)
ask = "";
while ((ask != "Y") and (ask != "N")) :
print "-------------------------------------------------------------"
ask = raw_input("Is the front panel LED TRIG switched ON? [Y/N]")
ask = ask.upper()
#print "-------------------------------------------------------------"
print " "
if (ask == "N"):
# TRIG LED ON fail
errors[0] = 1
############################################################################
# Test TRIG 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 TRIG switched OFF? [Y/N]")
ask = ask.upper()
#print "-------------------------------------------------------------"
print " "
if (ask == "N"):
# TRIG 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("Are the front panel LEDs (TRIG and ACQ) switched ON? [Y/N]")
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;
if (ask == "N") :
# Check for errors in LED tests
if (errors != ([0] * 4)):
if(errors[0] == 1):
print("TRIG LED not switching ON. Check for soldering or connection problem.")
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).")
raise PtsError("There is a problem with the LEDs");
fmc.trig_led(0)
fmc.acq_led(0)
if __name__ == '__main__' :
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