Skip to content

Commit e14259d

Browse files
committed
Move device_manager to new module
Instead of burying it amongst the beamlines.
1 parent 8c539d9 commit e14259d

File tree

3 files changed

+32
-6
lines changed

3 files changed

+32
-6
lines changed

src/dodal/beamlines/adsim.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from ophyd_async.core import PathProvider, StaticPathProvider, UUIDFilenameProvider
44
from ophyd_async.epics.adsimdetector import SimDetector
55

6-
from dodal.beamlines.dm_demo import DeviceManager
6+
from dodal.device_manager import DeviceManager
77
from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
88
from dodal.common.beamlines.device_helpers import DET_SUFFIX, HDF5_SUFFIX
99
from dodal.devices.motors import XThetaStage

src/dodal/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from ophyd_async.plan_stubs import ensure_connected
1111

1212
from dodal.beamlines import all_beamline_names, module_name_for_beamline
13-
from dodal.beamlines.dm_demo import DeviceManager
13+
from dodal.device_manager import DeviceManager
1414
from dodal.common.beamlines.beamline_utils import set_path_provider
1515
from dodal.utils import AnyDevice, filter_ophyd_devices, make_all_devices
1616

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ def build(
184184
)
185185
if devices.errors:
186186
# TODO: NotBuilt?
187+
print(devices.errors)
187188
raise Exception("??? build")
188189
else:
189190
if connect_immediately:
@@ -674,6 +675,23 @@ def unknown():
674675
return "unknown device"
675676

676677

678+
@devices.factory
679+
def one(): ...
680+
681+
682+
@devices.factory
683+
def two(one): ...
684+
685+
686+
@devices.factory
687+
def three(one, two): ...
688+
689+
690+
@devices.factory
691+
def four(one, two, three):
692+
return 4
693+
694+
677695
others = DeviceManager()
678696

679697

@@ -746,9 +764,17 @@ def old_motor(motor: EpicsMotor, foo: int = 42):
746764

747765
# print(base_x())
748766

749-
res = devices.build_all(fixtures={"path_provider": "nt_path_provider"})
750-
print(res)
751-
conn = res.connect()
752-
print(conn)
767+
# res = devices.build_all(fixtures={"path_provider": "nt_path_provider"})
768+
# print(res)
769+
# conn = res.connect()
770+
# print(conn)
771+
772+
# res = four.build()
773+
# print(res)
753774

754775
# devices.build_devices(circ_1, circ_2)
776+
777+
# print(old_motor.dependencies)
778+
print(old_motor.build(mock=False))
779+
780+
# res = others.build_all()

0 commit comments

Comments
 (0)