Skip to content

Commit 4b81e70

Browse files
committed
Ensure initial_trigger_time is not modified when using the internal
IntermediateDevice with a direct clockline trigger.
1 parent 1b7ca5a commit 4b81e70

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

labscript_devices/PrawnDO/labscript_devices.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,25 @@ def __init__(self, name,
215215

216216
self.BLACS_connection = com_port
217217

218+
self._initial_trigger_time = 0
219+
220+
# following three defs ensure initial_trigger_time is not modified
221+
# when directly triggered from a clockline using an internal IntermediateDevice
222+
@property
223+
def initial_trigger_time(self):
224+
return self._initial_trigger_time
225+
226+
@initial_trigger_time.setter
227+
def initial_trigger_time(self, value):
228+
if value != 0 and hasattr(self, "__intermediate"):
229+
raise LabscriptError("You cannot set the initial trigger time when the PrawnDO is directly triggered by a clockline")
230+
self._initial_trigger_time = value
231+
232+
def set_initial_trigger_time(self, *args, **kwargs):
233+
if hasattr(self, "__intermediate"):
234+
raise LabscriptError("You cannot set the initial trigger time when the PrawnDO is directly triggered by a clockline")
235+
return super().set_initial_trigger_time(*args, **kwargs)
236+
218237
def add_device(self, device):
219238

220239
if isinstance(device, _PrawnDOPseudoclock):

0 commit comments

Comments
 (0)