"""Timing widgets."""
import qtawesome as qta
from pydm.widgets import PyDMPushButton
from siriuspy.envars import VACA_PREFIX
from siriuspy.namesys import SiriusPVName
from siriuspy.search import LLTimeSearch as _LLTimeSearch
from ..widgets import PyDMStateButton, PyDMLed, SiriusLedAlert
EVG_NAME = _LLTimeSearch.get_evg_name()
[docs]
class EVGContinuousLed(PyDMLed):
"""EVG Continuous Led."""
def __init__(self, parent=None, prefix=VACA_PREFIX):
"""Init."""
pref_dev = SiriusPVName(EVG_NAME).substitute(prefix=prefix)
color_list = 7*[self.LightGreen, ]
color_list[0] = self.DarkGreen # Initializing
color_list[1] = self.DarkGreen # Stopped
color_list[4] = self.Yellow # Preparing Continuous
color_list[6] = self.Yellow # Restarting Continuous
super().__init__(
parent=parent,
init_channel=pref_dev.substitute(propty_name='STATEMACHINE'),
color_list=color_list)
[docs]
class EVGInjectionLed(PyDMLed):
"""EVG Injection Led."""
def __init__(self, parent=None, prefix=VACA_PREFIX):
"""Init."""
pref_dev = SiriusPVName(EVG_NAME).substitute(prefix=prefix)
color_list = 7*[self.DarkGreen, ]
color_list[3] = self.LightGreen # Injection
color_list[5] = self.Yellow # Preparing Injection
super().__init__(
parent=parent,
init_channel=pref_dev.substitute(propty_name='STATEMACHINE'),
color_list=color_list)
[docs]
class EVGUpdateEvtLed(SiriusLedAlert):
"""EVG Update Events Led."""
def __init__(self, parent=None, prefix=VACA_PREFIX):
"""Init."""
pref_dev = SiriusPVName(EVG_NAME).substitute(prefix=prefix)
super().__init__(
parent=parent,
init_channel=pref_dev.substitute(propty='EvtSyncStatus-Mon'))
self.setOffColor(self.Red)
self.setOnColor(self.LightGreen)