Commit 1d0cfdde authored by Theodor-Adrian Stana's avatar Theodor-Adrian Stana

sw: Added crate turn-on/turn-off

parent 988a6672
iso.3.6.1.4.1.37968.1.1.5.2.1.3.1 = INTEGER: 15100
iso.3.6.1.4.1.37968.1.1.5.2.1.3.2 = INTEGER: 15100
iso.3.6.1.4.1.37968.1.1.5.2.1.3.3 = INTEGER: 0
iso.3.6.1.4.1.37968.1.1.5.2.1.3.4 = INTEGER: 0
......@@ -69,8 +69,7 @@ sys.path.append('.')
##-------------------------------------------------------------------------------------------------
def men_is_on():
on = 0
subprocess.call("shell/get-fan-speeds", shell=True, stdout=sys.stdout, \
stderr=sys.stderr)
subprocess.call("cd shell; ./get-fan-speeds", shell=True, stdout=fnull, stderr=fnull)
try:
btxt = tuple(open("log/fan-speeds","r"))
for i in range(1,len(btxt)):
......@@ -112,7 +111,7 @@ def men_off():
if tmo > 10:
print "FATAL ERROR: VME Crate: Unable to switch OFF"
sys.exit(1)
time.sleep(10)
time.sleep(1)
##-------------------------------------------------------------------------------------------------
## Main "method" of PTS
......@@ -127,8 +126,7 @@ if __name__ == '__main__':
# Clear the log dir (if any) and (re-)create it to store log and info files
subprocess.call("rm -rf ./log; mkdir log; chmod 777 log", shell=True, stdout=fnull, stderr=fnull)
print "---Turn off ELMA!!"
#men_off()
men_off()
# Scan the first barcode
while True:
......@@ -163,8 +161,7 @@ if __name__ == '__main__':
ok = raw_input("--> Please type 'ok' to continue: ")
print "\n"
print "---Turn on ELMA!!"
#men_on()
men_on()
print "Loading FPGA bitstream..."
ret = subprocess.call("cd boot; ./program", shell=True, stdout=fnull, stderr=fnull)
......@@ -186,11 +183,11 @@ if __name__ == '__main__':
else:
time.sleep(1)
# # ... power-cycle the crate
# print "VME Crate power-cycle..."
# men_off()
# time.sleep(5)
# men_on()
# ... power-cycle the crate
print "VME crate power-cycle..."
men_off()
time.sleep(5)
men_on()
time.sleep(5)
......@@ -214,8 +211,7 @@ if __name__ == '__main__':
# We're done, turn off the VME crate
print "\nTesting completed!"
print "---Turn off ELMA!!"
#men_off()
men_off()
# Finally, print anything that went wrong throughout the test programs by grepping the log and info files and
# exit when the user desires.
......
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