diff --git a/ophyd_devices/__init__.py b/ophyd_devices/__init__.py index 05c9b20..d67e40f 100644 --- a/ophyd_devices/__init__.py +++ b/ophyd_devices/__init__.py @@ -3,5 +3,5 @@ from .galil.galil_ophyd import GalilMotor from .npoint.npoint import NPointAxis from .rt_lamni import RtLamniMotor from .sim.sim import SynAxisMonitor, SynAxisOPAAS, SynFlyer, SynSignalRO, SynSLSDetector -from .sls_devices.sls_devices import BeamlineInfo, SLSOperatorMessages +from .sls_devices.sls_devices import SLSInfo, SLSOperatorMessages from .smaract.smaract_ophyd import SmaractMotor diff --git a/ophyd_devices/sls_devices/sls_devices.py b/ophyd_devices/sls_devices/sls_devices.py index aa00cc6..3bbd103 100644 --- a/ophyd_devices/sls_devices/sls_devices.py +++ b/ophyd_devices/sls_devices/sls_devices.py @@ -1,36 +1,24 @@ -from ophyd import Component as Cpt +from ophyd import Component as Cpt, DynamicDeviceComponent as Dcpt from ophyd import Device, EpicsSignalRO class SLSOperatorMessages(Device): - message1 = Cpt(EpicsSignalRO, f"ACOAU-ACCU:OP-MSG1", auto_monitor=True) - message_date1 = Cpt(EpicsSignalRO, f"ACOAU-ACCU:OP-DATE1", auto_monitor=True) - message2 = Cpt(EpicsSignalRO, f"ACOAU-ACCU:OP-MSG2", auto_monitor=True) - message_date2 = Cpt(EpicsSignalRO, f"ACOAU-ACCU:OP-DATE2", auto_monitor=True) - message3 = Cpt(EpicsSignalRO, f"ACOAU-ACCU:OP-MSG3", auto_monitor=True) - message_date3 = Cpt(EpicsSignalRO, f"ACOAU-ACCU:OP-DATE3", auto_monitor=True) - message4 = Cpt(EpicsSignalRO, f"ACOAU-ACCU:OP-MSG4", auto_monitor=True) - message_date4 = Cpt(EpicsSignalRO, f"ACOAU-ACCU:OP-DATE4", auto_monitor=True) - message5 = Cpt(EpicsSignalRO, f"ACOAU-ACCU:OP-MSG5", auto_monitor=True) - message_date5 = Cpt(EpicsSignalRO, f"ACOAU-ACCU:OP-DATE5", auto_monitor=True) + messages_info = { + f"message{i}": (EpicsSignalRO, f"ACOAU-ACCU:OP-MSG{i}", {}) for i in range(1, 6) + } + messages = Dcpt(messages_info) + date_info = {f"message{i}": (EpicsSignalRO, f"ACOAU-ACCU:OP-DATE{i}", {}) for i in range(1, 6)} + date = Dcpt(date_info) -# class SLSOperatorMessages(Device): -# pass - -# for i in range(5): -# setattr(SLSOperatorMessages, f"message{i}", Cpt(EpicsSignalRO, f"ACOAU-ACCU:OP-MSG{i}", auto_monitor=True)) -# setattr(SLSOperatorMessages, f"message_date{i}", Cpt(EpicsSignalRO, f"ACOAU-ACCU:OP-DATE{i}", auto_monitor=True)) - - -class BeamlineInfo(Device): - eh_t02_avg_temperature = Cpt(EpicsSignalRO, "ILUUL-02AV:TEMP", auto_monitor=True) - eh_t02_temperature_t0204_axis_16 = Cpt( - EpicsSignalRO, "ILUUL-0200-EB104:TEMP", auto_monitor=True - ) - eh_t02_temperature_t0205_axis_18 = Cpt( - EpicsSignalRO, "ILUUL-0200-EB105:TEMP", auto_monitor=True - ) +class SLSInfo(Device): + # eh_t02_avg_temperature = Cpt(EpicsSignalRO, "ILUUL-02AV:TEMP", auto_monitor=True) + # eh_t02_temperature_t0204_axis_16 = Cpt( + # EpicsSignalRO, "ILUUL-0200-EB104:TEMP", auto_monitor=True + # ) + # eh_t02_temperature_t0205_axis_18 = Cpt( + # EpicsSignalRO, "ILUUL-0200-EB105:TEMP", auto_monitor=True + # ) operation = Cpt(EpicsSignalRO, "ACOAU-ACCU:OP-MODE.VAL", auto_monitor=True) injection_mode = Cpt(EpicsSignalRO, "ALIRF-GUN:INJ-MODE", auto_monitor=True) current_threshold = Cpt(EpicsSignalRO, "ALIRF-GUN:CUR-LOWLIM", auto_monitor=True) @@ -40,3 +28,5 @@ class BeamlineInfo(Device): orbit_feedback_mode = Cpt(EpicsSignalRO, "ARIDI-BPM:OFB-MODE", auto_monitor=True) fast_orbit_feedback = Cpt(EpicsSignalRO, "ARIDI-BPM:FOFBSTATUS-G", auto_monitor=True) ring_current = Cpt(EpicsSignalRO, "ARIDI-PCT:CURRENT", auto_monitor=True) + machine_status = Cpt(EpicsSignalRO, "ACOAU-ACCU:OP-MODE", auto_monitor=True) + crane_usage = Cpt(EpicsSignalRO, "IBWKR-0101-QH10003:D01_H_D-WA", auto_monitor=True)