From c43ca4aaa86ea7636e0c2073d58d66fab871b184 Mon Sep 17 00:00:00 2001 From: gac-x01da Date: Tue, 11 Mar 2025 17:34:04 +0100 Subject: [PATCH] fix (mo1-bragg): fix code after test with hardware at the beamline --- debye_bec/devices/mo1_bragg/mo1_bragg.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/debye_bec/devices/mo1_bragg/mo1_bragg.py b/debye_bec/devices/mo1_bragg/mo1_bragg.py index 80eac66..1c743af 100644 --- a/debye_bec/devices/mo1_bragg/mo1_bragg.py +++ b/debye_bec/devices/mo1_bragg/mo1_bragg.py @@ -325,10 +325,10 @@ class Mo1Bragg(PSIDeviceBase, Mo1BraggPositioner): timeout = self.timeout_for_pvwait start_time = time.time() while time.time() - start_time < timeout: - if self.stopped is True: - raise DeviceStopError(f"Device {self.name} was stopped while waiting for signal") if signal.get() == value: return None + if self.stopped is True: # Should this check be optional or configurable?! + raise DeviceStopError(f"Device {self.name} was stopped while waiting for signal") time.sleep(0.1) # If we end up here, the status did not resolve raise TimeoutError( @@ -442,10 +442,14 @@ class Mo1Bragg(PSIDeviceBase, Mo1BraggPositioner): def _update_scan_parameter(self): """Get the scan_info parameters for the scan.""" + for key, value in self.scan_info.msg.request_inputs["inputs"].items(): + if hasattr(self.scan_parameter, key): + setattr(self.scan_parameter, key, value) for key, value in self.scan_info.msg.request_inputs["kwargs"].items(): if hasattr(self.scan_parameter, key): setattr(self.scan_parameter, key, value) + def _check_scan_msg(self, target_state: ScanControlLoadMessage) -> None: """Check if the scan message is gettting available