From 23dd8c11e0aa21fafec0f501901fb489a1371812 Mon Sep 17 00:00:00 2001 From: gac-x01da Date: Thu, 17 Oct 2024 07:02:06 +0200 Subject: [PATCH] Update of state names --- debye_bec/devices/nidaq.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/debye_bec/devices/nidaq.py b/debye_bec/devices/nidaq.py index 8bf15d0..618277d 100644 --- a/debye_bec/devices/nidaq.py +++ b/debye_bec/devices/nidaq.py @@ -25,10 +25,10 @@ class NidaqState(int, enum.Enum): """ Possible States of the NIDAQ backend""" DISABLED = 0 STANDBY = 1 - PRERUN = 2 - ACQUIRING = 3 - STOPPED = 4 - ERRORSTOP = 5 + STAGE = 2 + KICKOFF = 3 + ACQUIRE = 4 + UNSTAGE = 5 class ScanRates(int, enum.Enum): """ Sampling Rate options for the backend, in kHZ and MHz""" @@ -121,13 +121,13 @@ class NIDAQCustomMixin(CustomDetectorMixin): self.parent.scan_type.set(ScanType.TRIGGERED).wait() # TODO, not working with scan_duration 0 for the moment to be fixed once solved self.parent.scan_duration.set(999999).wait() - self.parent.arm.set(1).wait() - if not self.wait_for_signals(signal_conditions=[(self.parent.state.get, NidaqState.PRERUN)], + self.parent.stage_call.set(1).wait() + if not self.wait_for_signals(signal_conditions=[(self.parent.state.get, NidaqState.STAGE)], timeout = self.timeout_wait_for_signal, check_stopped=True, ): - raise NidaqError(f"Device {self.parent.name} has not been reached in state PRERUN, current state {NidaqState(self.parent.state.get())}") - self.parent.trigger_call.set(1).wait() + raise NidaqError(f"Device {self.parent.name} has not been reached in state STAGE, current state {NidaqState(self.parent.state.get())}") + self.parent.kickoff_call.set(1).wait() logger.info(f"Device {self.parent.name} was staged: {NidaqState(self.parent.state.get())}") def on_pre_scan(self) -> None: @@ -136,11 +136,11 @@ class NIDAQCustomMixin(CustomDetectorMixin): The NIDAQ should go into Acquiring mode. """ if not self._check_if_scan_name_is_valid(): return None - if not self.wait_for_signals(signal_conditions=[(self.parent.state.get, NidaqState.ACQUIRING)], + if not self.wait_for_signals(signal_conditions=[(self.parent.state.get, NidaqState.KICKOFF)], timeout = self.timeout_wait_for_signal, check_stopped=True, ): - raise NidaqError(f"Device {self.parent.name} failed to reach state ACQUIRING during pre scan, current state {NidaqState(self.parent.state.get())}") + raise NidaqError(f"Device {self.parent.name} failed to reach state KICKOFF during pre scan, current state {NidaqState(self.parent.state.get())}") logger.info(f"Device {self.parent.name} ready to take data after pre_scan: {NidaqState(self.parent.state.get())}") def on_unstage(self) -> None: @@ -174,8 +174,8 @@ class NIDAQ(PSIDetectorBase): enable_compression = Cpt(EpicsSignal, suffix="NIDAQ-EnableRLE", kind=Kind.config) - trigger_call = Cpt(EpicsSignal, suffix="NIDAQ-Trigger", kind=Kind.config) - arm = Cpt(EpicsSignal, suffix="NIDAQ-Arm", kind = Kind.config) + kickoff_call = Cpt(EpicsSignal, suffix="NIDAQ-Kickoff", kind=Kind.config) + stage_call = Cpt(EpicsSignal, suffix="NIDAQ-Stage", kind = Kind.config) state = Cpt(EpicsSignal, suffix="NIDAQ-FSMState", kind= Kind.config) server_status = Cpt(EpicsSignalRO, suffix="NIDAQ-ServerStatus", kind=Kind.config) compression_ratio = Cpt(EpicsSignalRO, suffix="NIDAQ-CompressionRatio", kind=Kind.config)