fix: add sleep to ddg2 for pre_scan to be ready for triggers

This commit is contained in:
gac-x12sa
2025-07-16 14:21:41 +02:00
committed by appel_c
parent 4812323e4b
commit 909f0d2c96
2 changed files with 8 additions and 3 deletions

View File

@@ -103,6 +103,14 @@ class DDG2(PSIDeviceBase, DelayGeneratorCSAXS):
burst_pulse_width = exp_time - DEFAULT_READOUT_TIMES["ab"]
self.set_delay_pairs(channel="ab", delay=0, width=burst_pulse_width)
self.burst_enable(count=frames_per_trigger, delay=0, period=exp_time)
def on_pre_scan(self):
"""
The delay generator occasionally needs a bit extra time to process all
commands from stage. Therefore, we introduce here a short sleep
"""
# Delay Generator occasionaly needs a bit extra time to process all commands, sleep 50ms
time.sleep(0.05)
def on_trigger(self) -> DeviceStatus | StatusBase | None:
"""

View File

@@ -140,7 +140,6 @@ class StatusBitsCompareStatus(SubscriptionStatus):
name = 'no object received'
else:
name=obj.name
logger.info(f"Receive update for {name} with value {value}")
if any((STATUSBITS(value) & state) == state for state in self._raise_states):
self.set_exception(
ValueError(
@@ -149,7 +148,6 @@ class StatusBitsCompareStatus(SubscriptionStatus):
)
return False
if self._add_delay !=0:
logger.info(f"Sleeping for {self._add_delay} for {name}")
time.sleep(self._add_delay)
return (STATUSBITS(value) & self._value) == self._value
@@ -671,7 +669,6 @@ class DelayGeneratorCSAXS(Device):
raise ValueError(
f"Length of width {len(width)} must match length of channel {len(channel)}."
)
logger.info(f"setting widths of channels {channel} to {width}")
for ii, ch in enumerate(channel):
delay_channel = getattr(self, ch)
delay_channel.width.put(width[ii])