Commit 4dfb431b authored by Jan Pospisil's avatar Jan Pospisil

floats in arguments

parent 8672b76f
......@@ -2,7 +2,6 @@
# coding: utf8
# TODO:
# - floats in arguments
# - bunch assert (0-3563)
# - when no bunches are provided, stay in high/low according to polarity
# - fixed sub-bunch period, just check (warning) against "real" input frequency
......@@ -16,7 +15,13 @@ def myInt(s):
return int(s)
except:
return None
def myFloat(s):
try:
return float(s)
except:
return None
print("FFPG command line interface")
print("")
......@@ -31,9 +36,9 @@ if len(sys.argv) is not 4 and len(sys.argv) < 8:
print " <fmcSlot (LUN)> - 0 | 1"
print " <channel> - 1 | 2"
print " <polarity> - 0 | 1"
print " <pulseWidth> - positive number in [ns]"
print " <pulseDelay> - non-negative number in [ns]"
print " <triggerLatency> - non-negative number in [ns], or -1 (calibration disabled)"
print " <pulseWidth> - positive float number in [ns]"
print " <pulseDelay> - non-negative float number in [ns]"
print " <triggerLatency> - non-negative float number in [ns], or -1 (calibration disabled)"
print " <bunches> - space separated list of bunch numbers"
print ""
sys.exit()
......@@ -44,9 +49,9 @@ if sys.argv[3] == "stop":
polarity = "stop"
else:
polarity = myInt(sys.argv[3])
pulseWidth = myInt(sys.argv[4])
pulseDelay = myInt(sys.argv[5])
triggerLatency = myInt(sys.argv[6])
pulseWidth = myFloat(sys.argv[4])
pulseDelay = myFloat(sys.argv[5])
triggerLatency = myFloat(sys.argv[6])
bunches = []
for i in range(7, len(sys.argv)):
bunches.append(myInt(sys.argv[i]))
......
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