Skip to content

Commit ae5fd9f

Browse files
committed
Allow passthrough of other kwargs in DDS gate DigitalOut specification.
In particular, this allows for the digital gate to have inverted logic.
1 parent de6fb95 commit ae5fd9f

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

labscript/labscript.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2799,7 +2799,7 @@ def __init__(self, name, parent_device, connection, digital_gate={}, freq_limits
27992799
digital_gate (dict, optional): Configures a digital output to use as an enable/disable
28002800
gate for the output. Should contain keys `'device'` and `'connection'`
28012801
with arguments for the `parent_device` and `connection` for instantiating
2802-
the :obj:`DigitalOut`.
2802+
the :obj:`DigitalOut`. All other (optional) keys are passed as kwargs.
28032803
freq_limits (tuple, optional): `(lower, upper)` limits for the
28042804
frequency of the output
28052805
freq_conv_class (:obj:`labscript_utils:labscript_utils.unitconversions`, optional):
@@ -2851,8 +2851,10 @@ def __init__(self, name, parent_device, connection, digital_gate={}, freq_limits
28512851
self.phase = AnalogQuantity(self.name + '_phase', self, 'phase', phase_limits, phase_conv_class, phase_conv_params)
28522852

28532853
self.gate = None
2854-
if 'device' in digital_gate and 'connection' in digital_gate:
2855-
self.gate = DigitalOut(name + '_gate', digital_gate['device'], digital_gate['connection'])
2854+
if 'device' in digital_gate and 'connection' in digital_gate:
2855+
dev = digital_gate.pop('device')
2856+
conn = digital_gate.pop('connection')
2857+
self.gate = DigitalOut(name + '_gate', dev, conn, **digital_gate)
28562858
# Did they only put one key in the dictionary, or use the wrong keywords?
28572859
elif len(digital_gate) > 0:
28582860
raise LabscriptError('You must specify the "device" and "connection" for the digital gate of %s.' % (self.name))
@@ -2980,7 +2982,7 @@ def __init__(self,name,parent_device,connection,digital_gate = {},freq_limits =
29802982
digital_gate (dict, optional): Configures a digital output to use as an enable/disable
29812983
gate for the output. Should contain keys `'device'` and `'connection'`
29822984
with arguments for the `parent_device` and `connection` for instantiating
2983-
the :obj:`DigitalOut`.
2985+
the :obj:`DigitalOut`. All other (optional) keys are passed as kwargs.
29842986
freq_limits (tuple, optional): `(lower, upper)` limits for the
29852987
frequency of the output
29862988
freq_conv_class (:obj:`labscript_utils:labscript_utils.unitconversions`, optional):
@@ -3030,8 +3032,10 @@ def __init__(self,name,parent_device,connection,digital_gate = {},freq_limits =
30303032
self.amplitude = StaticAnalogQuantity(self.name+'_amp',self,'amp',amp_limits,amp_conv_class,amp_conv_params)
30313033
self.phase = StaticAnalogQuantity(self.name+'_phase',self,'phase',phase_limits,phase_conv_class,phase_conv_params)
30323034

3033-
if 'device' in digital_gate and 'connection' in digital_gate:
3034-
self.gate = DigitalOut(self.name+'_gate',digital_gate['device'],digital_gate['connection'])
3035+
if 'device' in digital_gate and 'connection' in digital_gate:
3036+
dev = digital_gate.pop('device')
3037+
conn = digital_gate.pop('connection')
3038+
self.gate = DigitalOut(name + '_gate', dev, conn, **digital_gate)
30353039
# Did they only put one key in the dictionary, or use the wrong keywords?
30363040
elif len(digital_gate) > 0:
30373041
raise LabscriptError('You must specify the "device" and "connection" for the digital gate of %s.'%(self.name))

0 commit comments

Comments
 (0)