added auto_monitor forwarder to sls_info

This commit is contained in:
wakonig_k 2022-11-17 19:50:11 +01:00
parent 8c6a96ca2c
commit e0c0469795

View File

@ -1,5 +1,9 @@
from ophyd import Component as Cpt, DynamicDeviceComponent as Dcpt import time
from ophyd import Device, EpicsSignalRO
from ophyd import Component as Cpt
from ophyd import Device
from ophyd import DynamicDeviceComponent as Dcpt
from ophyd import EpicsSignalRO
class SLSOperatorMessages(Device): class SLSOperatorMessages(Device):
@ -12,6 +16,8 @@ class SLSOperatorMessages(Device):
class SLSInfo(Device): class SLSInfo(Device):
SUB_VALUE = "value"
_default_sub = SUB_VALUE
# eh_t02_avg_temperature = Cpt(EpicsSignalRO, "ILUUL-02AV:TEMP", auto_monitor=True) # eh_t02_avg_temperature = Cpt(EpicsSignalRO, "ILUUL-02AV:TEMP", auto_monitor=True)
# eh_t02_temperature_t0204_axis_16 = Cpt( # eh_t02_temperature_t0204_axis_16 = Cpt(
# EpicsSignalRO, "ILUUL-0200-EB104:TEMP", auto_monitor=True # EpicsSignalRO, "ILUUL-0200-EB104:TEMP", auto_monitor=True
@ -33,3 +39,12 @@ class SLSInfo(Device):
crane_usage = Cpt( crane_usage = Cpt(
EpicsSignalRO, "IBWKR-0101-QH10003:D01_H_D-WA", auto_monitor=True, string=True EpicsSignalRO, "IBWKR-0101-QH10003:D01_H_D-WA", auto_monitor=True, string=True
) )
def __init__(self, prefix="", *, name, **kwargs):
super().__init__(prefix, name=name, **kwargs)
self.ring_current.subscribe(self._emit_value)
def _emit_value(self, **kwargs):
timestamp = kwargs.pop("timestamp", time.time())
value = self.read()
self._run_subs(sub_type=self.SUB_VALUE, timestamp=timestamp, value=value, **kwargs)