Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move areaDetector plugins from child classes to parent classes #286

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/ophyd_async/epics/areadetector/drivers/ad_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
set_and_wait_for_value,
)

from ...signal.signal import epics_signal_rw
from ..utils import ImageMode, ad_r, ad_rw
from ..writers.nd_plugin import NDArrayBase

Expand Down Expand Up @@ -43,16 +42,10 @@ 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,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)
8 changes: 8 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,12 @@ 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.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")
# There is no _RBV for this one
self.wait_for_plugins = epics_signal_rw(bool, prefix + "WaitForPlugins")
super().__init__(name)


Expand All @@ -23,6 +29,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