-
Notifications
You must be signed in to change notification settings - Fork 37
Convert ADOdin to FastCS-Odin #1158
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
Changes from all commits
23c40af
8ae58b0
1bcf3d6
3faa00c
3dba270
5ce215d
94c7a40
cd67dab
451f853
5d61dec
010a7b0
33aa723
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,13 +1,13 @@ | ||||||
| from ophyd_async.core import ( | ||||||
| AsyncStatus, | ||||||
| PathProvider, | ||||||
| SignalR, | ||||||
| StandardDetector, | ||||||
| TriggerInfo, | ||||||
| ) | ||||||
| from ophyd_async.epics.odin import Odin, OdinWriter | ||||||
| from ophyd_async.fastcs.core import fastcs_connector | ||||||
| from ophyd_async.fastcs.odin import OdinHdfIO, OdinWriter | ||||||
|
|
||||||
| from ._eiger_controller import EigerController | ||||||
| from ._eiger_io import EigerDriverIO | ||||||
| from ._eiger_io import EigerDetectorIO, EigerMonitorIO, EigerStreamIO | ||||||
|
|
||||||
|
|
||||||
| class EigerDetector(StandardDetector): | ||||||
|
|
@@ -16,28 +16,28 @@ class EigerDetector(StandardDetector): | |||||
| _controller: EigerController | ||||||
| _writer: OdinWriter | ||||||
|
|
||||||
| stale_parameters: SignalR[bool] | ||||||
| monitor: EigerMonitorIO | ||||||
| stream: EigerStreamIO | ||||||
| detector: EigerDetectorIO | ||||||
| od: OdinHdfIO | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
As mentioned in previous review, |
||||||
|
|
||||||
| def __init__( | ||||||
| self, | ||||||
| prefix: str, | ||||||
| path_provider: PathProvider, | ||||||
| drv_suffix="-EA-EIGER-01:", | ||||||
| hdf_suffix="-EA-EIGER-01:OD:", | ||||||
| odin_nodes: int = 4, | ||||||
| name="", | ||||||
| ): | ||||||
| self.drv = EigerDriverIO(prefix + drv_suffix) | ||||||
| self.odin = Odin(prefix + hdf_suffix, nodes=odin_nodes) | ||||||
| # Need to do this first so the type hints are filled in | ||||||
| connector = fastcs_connector(self, prefix) | ||||||
|
|
||||||
| super().__init__( | ||||||
| EigerController(self.drv), | ||||||
| EigerController(self.detector), | ||||||
| OdinWriter( | ||||||
| path_provider, | ||||||
| self.odin, | ||||||
| self.drv.detector.bit_depth_image, | ||||||
| self.od, | ||||||
| self.detector.bit_depth_image, | ||||||
| ), | ||||||
| name=name, | ||||||
| connector=connector, | ||||||
| ) | ||||||
|
|
||||||
| @AsyncStatus.wrap | ||||||
| async def prepare(self, value: TriggerInfo) -> None: | ||||||
| await super().prepare(value) | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,20 @@ | ||
| from ophyd_async.core import ( | ||
| PathProvider, | ||
| StandardDetector, | ||
| ) | ||
| from ophyd_async.epics.odin import Odin, OdinWriter | ||
| from ophyd_async.core import Device, PathProvider, StandardDetector | ||
| from ophyd_async.fastcs.core import fastcs_connector | ||
| from ophyd_async.fastcs.jungfrau._controller import JungfrauController | ||
| from ophyd_async.fastcs.jungfrau._signals import JungfrauDriverIO | ||
| from ophyd_async.fastcs.odin import OdinWriter | ||
| from ophyd_async.fastcs.odin._odin_io import FrameProcessorIO, MetaWriterIO | ||
|
|
||
|
|
||
| # TODO: Delete this duplicate device, once FastCS Jungfrau | ||
| # has top level 'detector' and 'odin', after which, follow | ||
| # EigerDetector as an example of correct structure | ||
| class OdinHdfIO(Device): | ||
|
Comment on lines
+9
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This duplicate Consider creating a GitHub issue to track this technical debt if one doesn't already exist. |
||
| fp: FrameProcessorIO | ||
| mw: MetaWriterIO | ||
|
|
||
| def __init__(self, uri: str, name: str = ""): | ||
| super().__init__(name=name, connector=fastcs_connector(self, uri)) | ||
|
|
||
|
|
||
| class Jungfrau(StandardDetector[JungfrauController, OdinWriter]): | ||
|
|
@@ -16,14 +26,13 @@ def __init__( | |
| path_provider: PathProvider, | ||
| drv_suffix: str, | ||
| hdf_suffix: str, | ||
| odin_nodes: int, | ||
| name="", | ||
| ): | ||
| self.drv = JungfrauDriverIO(prefix + drv_suffix) | ||
| self.odin = Odin(prefix + hdf_suffix, nodes=odin_nodes) | ||
| self.odin = OdinHdfIO(prefix + hdf_suffix) | ||
| writer = OdinWriter( | ||
| path_provider, | ||
| self.odin, | ||
| self.odin, # type: ignore | ||
| self.drv.bit_depth, | ||
| ) | ||
| controller = JungfrauController(self.drv) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| __all__ = [] | ||
| from ._odin_io import OdinHdfIO, OdinWriter | ||
|
|
||
| __all__ = ["OdinHdfIO", "OdinWriter"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this
odinrather thanod?