|
1 | | -from pathlib import PurePath |
2 | | -from ophyd.epics_motor import EpicsMotor |
3 | | -from ophyd_async.core import PathProvider, StaticPathProvider, UUIDFilenameProvider |
4 | 1 | from ophyd_async.epics.adsimdetector import SimDetector |
5 | 2 |
|
6 | | -from dodal.device_manager import DeviceManager |
| 3 | +from dodal.common.beamlines.beamline_utils import ( |
| 4 | + device_factory, |
| 5 | + get_path_provider, |
| 6 | +) |
7 | 7 | from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline |
8 | 8 | from dodal.common.beamlines.device_helpers import DET_SUFFIX, HDF5_SUFFIX |
9 | 9 | from dodal.devices.motors import XThetaStage |
|
63 | 63 |
|
64 | 64 | """ |
65 | 65 |
|
66 | | -devices = DeviceManager() |
67 | | - |
68 | | - |
69 | | -@devices.fixture |
70 | | -def path_provider() -> PathProvider: |
71 | | - return StaticPathProvider(UUIDFilenameProvider(), PurePath("/")) |
72 | 66 |
|
73 | | - |
74 | | -@devices.factory(timeout=2, mock=False) |
| 67 | +@device_factory() |
75 | 68 | def stage() -> XThetaStage: |
76 | 69 | return XThetaStage( |
77 | 70 | f"{PREFIX.beamline_prefix}-MO-SIMC-01:", x_infix="M1", theta_infix="M2" |
78 | 71 | ) |
79 | 72 |
|
80 | 73 |
|
81 | | -@devices.factory(timeout=2) |
82 | | -def det(path_provider: PathProvider) -> SimDetector: |
| 74 | +@device_factory() |
| 75 | +def det() -> SimDetector: |
83 | 76 | return SimDetector( |
84 | 77 | f"{PREFIX.beamline_prefix}-DI-CAM-01:", |
85 | | - path_provider=path_provider, |
| 78 | + path_provider=get_path_provider(), |
86 | 79 | drv_suffix=DET_SUFFIX, |
87 | 80 | fileio_suffix=HDF5_SUFFIX, |
88 | 81 | ) |
89 | | - |
90 | | - |
91 | | -@devices.v1_init(factory=EpicsMotor, prefix=f"{PREFIX.beamline_prefix}-MO-SIMC-01:M1") |
92 | | -def old_motor(motor: EpicsMotor): |
93 | | - # arbitrary post-init configuration |
94 | | - motor.settle_time = 12 |
0 commit comments