fix(mo1-bragg): fix error upon fresh start, not yet working.

This commit is contained in:
gac-x01da
2025-05-01 14:55:46 +02:00
committed by appel_c
parent ae50cbdfd1
commit a8e7325f0f

View File

@@ -455,18 +455,17 @@ class Mo1Bragg(PSIDeviceBase, Mo1BraggPositioner):
Raises:
TimeoutError: If the scan message is not available after the timeout
"""
state = self.scan_control.scan_msg.get()
if state != target_state:
try:
self.wait_for_signal(self.scan_control.scan_msg, target_state, timeout=1)
except TimeoutError as exc:
logger.warning(
f"Resetting scan validation in stage for state: {ScanControlLoadMessage(state)}, "
f"Resetting scan validation in stage for state: {ScanControlLoadMessage(self.scan_control.scan_msg.get())}, "
f"retry .get() on scan_control: {ScanControlLoadMessage(self.scan_control.scan_msg.get())} and sleeping 1s"
)
self.scan_control.scan_val_reset.put(1)
# Sleep to ensure the reset is done
time.sleep(1)
try:
self.wait_for_signal(self.scan_control.scan_msg, target_state)
self.wait_for_signal(self.scan_control.scan_msg, target_state, timeout=4)
except TimeoutError as exc:
raise TimeoutError(
f"Timeout after {self.timeout_for_pvwait} while waiting for scan status,"