Skip to content

Commit

Permalink
Move plugins from child classes to parent classes
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaruland committed May 3, 2024
1 parent 1924fd9 commit 8f1f5b2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
6 changes: 1 addition & 5 deletions src/ophyd_async/epics/areadetector/drivers/ad_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
2 changes: 0 additions & 2 deletions src/ophyd_async/epics/areadetector/writers/nd_file_hdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,4 @@ 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")
super().__init__(prefix, name)
7 changes: 7 additions & 0 deletions src/ophyd_async/epics/areadetector/writers/nd_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand All @@ -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)


Expand Down

0 comments on commit 8f1f5b2

Please sign in to comment.