From 06ffca03ee38eedb6ac2c47e5f142dcf6a8defa6 Mon Sep 17 00:00:00 2001 From: gac-x07mb Date: Tue, 15 Oct 2024 16:56:57 +0200 Subject: [PATCH] correct another editing error in phoenix_trigger.py --- phoenix_bec/devices/phoenix_trigger.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/phoenix_bec/devices/phoenix_trigger.py b/phoenix_bec/devices/phoenix_trigger.py index 3b50690..f9e2cd6 100644 --- a/phoenix_bec/devices/phoenix_trigger.py +++ b/phoenix_bec/devices/phoenix_trigger.py @@ -46,6 +46,9 @@ class SAMPLING(int, enum.Enum): """ + RUNNING = 0 + DONE = 1 + class PhoenixTriggerSetup(CustomDetectorMixin): """ @@ -78,6 +81,7 @@ class PhoenixTriggerSetup(CustomDetectorMixin): def on_unstage(self) -> None: """On unstage actions which are executed upon unstaging the device""" + self.on_stop() def on_trigger(self) -> DeviceStatus: @@ -88,7 +92,8 @@ class PhoenixTriggerSetup(CustomDetectorMixin): falcon = self.parent.device_manager.devices.get("falcon_nohdf5", None) # get device timeout = 1 if falcon is not None: - # TODO Check that falcon.state.get() == 1 is the correct check. --> When is the falcon acquiring, this assumes 1? + # TODO Check that falcon.state.get() == 1 is the correct check. + # --> When is the falcon acquiring, this assumes 1? if not self.wait_for_signals([(falcon.state.get, 1)], timeout=timeout): raise PhoenixTriggerError( @@ -110,7 +115,8 @@ class PhoenixTriggerSetup(CustomDetectorMixin): # the devices config softwareTrigger=True is set. # In ScanBase, the _at_each_point function calls # self.stubs.wait(wait_type="trigger", group="trigger", wait_time=self.exp_time) - # which ensures that the DeviceStatus object resolves before continuing, i.e. DeviceStatus.done = True + # which ensures that the DeviceStatus object resolves before continuing, + # i.e. DeviceStatus.done = True status = self.wait_with_status( signal_conditions=[(self.parent.smpl_done.get, SAMPLING.DONE)], @@ -118,9 +124,11 @@ class PhoenixTriggerSetup(CustomDetectorMixin): check_stopped=True, ) - # explanation of last line (self.parent.smpl_done.get, SAMPLINGDONE.DONE) creates a tuple which defines a + # explanation of last line (self.parent.smpl_done.get, SAMPLINGDONE.DONE) + # creates a tuple which defines a # condition, which is tested in self.wait_with_status, here it tests for : - # (self.parent.smpl_done.get() == SAMPLINGDONE.DONE), where SAMPLINGDONE.DONE =1, as set in code above + # (self.parent.smpl_done.get() == SAMPLINGDONE.DONE), + # where SAMPLINGDONE.DONE =1, as set in code above # As this is in mixing class (PhoenixtriggerSetup), parent.sample_done is defined in # main class as smpl_done = Cpt(EpicsSignalRO, "SMPL-DONE", kind=Kind.config) @@ -148,7 +156,9 @@ class PhoenixTrigger(PSIDetectorBase): """ Class for PHOENIX TTL hardware trigger: 'X07MB-OP2:' - This device is used to trigger communicate with an ADC card that creates TTL signals to trigger cameras and detectors at Phoenix. + This device is used to trigger communicate with an ADC card + that creates TTL signals to trigger cameras and detectors at Phoenix. + """ ##################################################################