Commit b89fca81 authored by Jan Pospisil's avatar Jan Pospisil

when no bunches are provided, stay in high/low according to polarity

parent b081afdf
......@@ -2,7 +2,6 @@
# coding: utf8
# TODO:
# - when no bunches are provided, stay in high/low according to polarity
# - fixed sub-bunch period, just check (warning) against "real" input frequency
# - relax bunch boundary check, fix continuous pulses (25 ns puls in two subsequent bunches) -> constraint to the help
......@@ -24,9 +23,9 @@ def myFloat(s):
print("FFPG command line interface")
print("")
if len(sys.argv) is not 4 and len(sys.argv) < 8:
if len(sys.argv) is not 4 and len(sys.argv) < 7:
print "Usage:"
print " "+sys.argv[0]+" <fmcSlot (LUN)> <channel> <polarity> <pulseWidth> <pulseDelay> <triggerLatency> <bunches>"
print " "+sys.argv[0]+" <fmcSlot (LUN)> <channel> <polarity> <pulseWidth> <pulseDelay> <triggerLatency> [<bunches>]"
print " Sets and starts selected channel on selected FMC mezzanine"
print " or"
print " "+sys.argv[0]+" <fmcSlot (LUN)> <channel> stop"
......@@ -39,6 +38,8 @@ if len(sys.argv) is not 4 and len(sys.argv) < 8:
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, each 0-3563"
print " If no bunches are provided, no pulses will be generated, but generator will run."
print " Output will be in non-active state according to the <polarity>."
print ""
sys.exit()
......
......@@ -393,6 +393,13 @@ class Ffpg(object):
# configure pulse positions
for bunch in bunches:
self._ConfigurePulse(channel, (bunch * rfToBunchRatio)+pulseStartBit, (bunch * rfToBunchRatio)+pulseStopBit, 1)
# if there are no bunches configured, just maintain the right output level
if len(bunches) == 0:
if polarity == 1:
self._ConfigurePulse(channel, 0, 0, 1, 2) # only one reset bit
else:
self._ConfigurePulse(channel, 0, 0, 1, 1) # only one set bit
def SetClockFineDelay(self, fineDelay, current = 0, capacitors = 0):
"""
......
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