From 34c4abb42aeaa817e1e7031e2f9e1ee1ef38f26b Mon Sep 17 00:00:00 2001 From: Juan Marulanda Date: Fri, 3 May 2024 12:08:50 -0400 Subject: [PATCH] Move plugins from child classes to parent classes --- src/ophyd_async/epics/areadetector/drivers/ad_base.py | 6 +----- src/ophyd_async/epics/areadetector/writers/nd_file_hdf.py | 2 -- src/ophyd_async/epics/areadetector/writers/nd_plugin.py | 7 +++++++ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/ophyd_async/epics/areadetector/drivers/ad_base.py b/src/ophyd_async/epics/areadetector/drivers/ad_base.py index b42a45f66b..6e768a93d3 100644 --- a/src/ophyd_async/epics/areadetector/drivers/ad_base.py +++ b/src/ophyd_async/epics/areadetector/drivers/ad_base.py @@ -43,16 +43,12 @@ class DetectorState(str, Enum): class ADBase(NDArrayBase): def __init__(self, prefix: str, name: str = "") -> None: # Define some signals - self.acquire = ad_rw(bool, prefix + "Acquire") self.acquire_time = ad_rw(float, prefix + "AcquireTime") self.num_images = ad_rw(int, prefix + "NumImages") self.image_mode = ad_rw(ImageMode, prefix + "ImageMode") - self.array_counter = ad_rw(int, prefix + "ArrayCounter") - self.array_size_x = ad_r(int, prefix + "ArraySizeX") - self.array_size_y = ad_r(int, prefix + "ArraySizeY") self.detector_state = ad_r(DetectorState, prefix + "DetectorState") # There is no _RBV for this one - self.wait_for_plugins = epics_signal_rw(bool, prefix + "WaitForPlugins") + super().__init__(prefix, name=name) diff --git a/src/ophyd_async/epics/areadetector/writers/nd_file_hdf.py b/src/ophyd_async/epics/areadetector/writers/nd_file_hdf.py index 9689bc4678..5bc3360e79 100644 --- a/src/ophyd_async/epics/areadetector/writers/nd_file_hdf.py +++ b/src/ophyd_async/epics/areadetector/writers/nd_file_hdf.py @@ -34,7 +34,5 @@ def __init__(self, prefix: str, name="") -> None: self.lazy_open = ad_rw(bool, prefix + "LazyOpen") self.capture = ad_rw(bool, prefix + "Capture") self.flush_now = epics_signal_rw(bool, prefix + "FlushNow") - self.array_size0 = ad_r(int, prefix + "ArraySize0") - self.array_size1 = ad_r(int, prefix + "ArraySize1") self.xml_file_name = ad_rw(str, prefix + "XMLFileName") super().__init__(prefix, name) diff --git a/src/ophyd_async/epics/areadetector/writers/nd_plugin.py b/src/ophyd_async/epics/areadetector/writers/nd_plugin.py index 815c2a8e0d..5c56f040b6 100644 --- a/src/ophyd_async/epics/areadetector/writers/nd_plugin.py +++ b/src/ophyd_async/epics/areadetector/writers/nd_plugin.py @@ -15,6 +15,11 @@ class NDArrayBase(Device): def __init__(self, prefix: str, name: str = "") -> None: self.unique_id = ad_r(int, prefix + "UniqueId") self.nd_attributes_file = epics_signal_rw(str, prefix + "NDAttributesFile") + self.acquire = ad_rw(bool, prefix + "Acquire") + self.wait_for_plugins = epics_signal_rw(bool, prefix + "WaitForPlugins") + self.array_size_x = ad_r(int, prefix + "ArraySizeX") + self.array_size_y = ad_r(int, prefix + "ArraySizeY") + self.array_counter = ad_rw(int, prefix + "ArrayCounter") super().__init__(name) @@ -23,6 +28,8 @@ def __init__(self, prefix: str, name: str = "") -> None: self.nd_array_port = ad_rw(str, prefix + "NDArrayPort") self.enable_callback = ad_rw(Callback, prefix + "EnableCallbacks") self.nd_array_address = ad_rw(int, prefix + "NDArrayAddress") + self.array_size0 = ad_r(int, prefix + "ArraySize0") + self.array_size1 = ad_r(int, prefix + "ArraySize1") super().__init__(prefix, name)