Skip to content

Commit 0bb8647

Browse files
Duplicate nonblocking AD functionality from nslsii package
1 parent aa2457f commit 0bb8647

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ classifiers = [
1313
"Programming Language :: Python :: 3.11",
1414
]
1515
description = "Ophyd devices and other utils that could be used across DLS beamlines"
16-
dependencies = ["ophyd", "bluesky", "pyepics", "pydantic", "nslsii"]
16+
dependencies = ["ophyd", "bluesky", "pyepics", "pydantic"]
1717
dynamic = ["version"]
1818
license.file = "LICENSE"
1919
readme = "README.rst"

src/dodal/devices/areadetector/adutils.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,35 @@
1-
from nslsii.ad33 import CamV33Mixin
1+
from ophyd import Component as Cpt
2+
from ophyd import EpicsSignal, EpicsSignalRO
23
from ophyd.areadetector.cam import AreaDetectorCam
34
from ophyd.areadetector.filestore_mixins import FileStoreHDF5, FileStoreIterativeWrite
45
from ophyd.areadetector.plugins import HDF5Plugin
56

67

7-
class SynchronisedAdDriverBase(AreaDetectorCam, CamV33Mixin):
8+
class SynchronisedAdDriverBase(AreaDetectorCam):
89
"""
910
Base Ophyd device to control an AreaDetector driver and
1011
syncrhonise it on other AreaDetector plugins, even non-blocking ones.
1112
"""
1213

14+
adcore_version = Cpt(EpicsSignalRO, "ADCoreVersion_RBV", string=True, kind="config")
15+
driver_version = Cpt(EpicsSignalRO, "DriverVersion_RBV", string=True, kind="config")
16+
wait_for_plugins = Cpt(EpicsSignal, "WaitForPlugins", string=True, kind="config")
17+
1318
def stage(self, *args, **kwargs):
1419
# Makes the detector allow non-blocking AD plugins but makes Ophyd use
1520
# the AcquireBusy PV to determine when an acquisition is complete
1621
self.ensure_nonblocking()
1722
return super().stage(*args, **kwargs)
1823

24+
def ensure_nonblocking(self):
25+
self.stage_sigs["wait_for_plugins"] = "Yes"
26+
for c in self.parent.component_names:
27+
cpt = getattr(self.parent, c)
28+
if cpt is self:
29+
continue
30+
if hasattr(cpt, "ensure_nonblocking"):
31+
cpt.ensure_nonblocking()
32+
1933

2034
class Hdf5Writer(HDF5Plugin, FileStoreHDF5, FileStoreIterativeWrite):
2135
""" """

0 commit comments

Comments
 (0)