diff --git a/pyqt-apps/scripts/sirius-hla-li-rf-llrf.py b/pyqt-apps/scripts/sirius-hla-li-rf-llrf.py index f90af9a55..13f22526e 100755 --- a/pyqt-apps/scripts/sirius-hla-li-rf-llrf.py +++ b/pyqt-apps/scripts/sirius-hla-li-rf-llrf.py @@ -20,7 +20,7 @@ app = SiriusApplication() window = create_window_from_widget( LLRFMain, title='LI LLRF', is_main=True, - withscroll=True, min_width=105, min_height=55, + withscroll=True, min_width=90, min_height=45, icon=_qta.icon( 'mdi.waves', color=_util.get_appropriate_color('LI'))) app.open_window( diff --git a/pyqt-apps/siriushla/VERSION b/pyqt-apps/siriushla/VERSION index 4a7076db0..548a9079f 100644 --- a/pyqt-apps/siriushla/VERSION +++ b/pyqt-apps/siriushla/VERSION @@ -1 +1 @@ -0.77.0 +0.77.1 diff --git a/pyqt-apps/siriushla/as_ps_diag/util.py b/pyqt-apps/siriushla/as_ps_diag/util.py index 83a56f88e..c71691c0c 100644 --- a/pyqt-apps/siriushla/as_ps_diag/util.py +++ b/pyqt-apps/siriushla/as_ps_diag/util.py @@ -30,7 +30,7 @@ 'dev': '(CH|CV|QS)'}, 'Trims': {'sec': 'SI', 'sub': '[0-2][0-9].*', 'dev': 'Q(F|D|[1-4]).*'}, - 'QS': {'sec': 'SI', 'sub': '[0-2][0-9].*', 'dev': 'QS'}, + 'QS': {'sec': 'SI', 'sub': '[0-2][0-9](M|C).*', 'dev': 'QS'}, 'PM': {'sec': 'SI', 'sub': '.*', 'dev': '(Inj|Eje).*'}, 'FCH': {'sec': 'SI', 'sub': '.*', 'dev': 'FCH'}, 'FCV': {'sec': 'SI', 'sub': '.*', 'dev': 'FCV'}, diff --git a/pyqt-apps/siriushla/li_di_scrns/main.py b/pyqt-apps/siriushla/li_di_scrns/main.py index 6c4ac6210..90160c088 100644 --- a/pyqt-apps/siriushla/li_di_scrns/main.py +++ b/pyqt-apps/siriushla/li_di_scrns/main.py @@ -3,13 +3,14 @@ from qtpy.QtCore import Qt from qtpy.QtGui import QPixmap from qtpy.QtWidgets import QGroupBox, QHBoxLayout, QVBoxLayout, \ - QWidget, QLabel, QGridLayout, QRadioButton, QStackedWidget, \ + QWidget, QLabel, QGridLayout, QStackedWidget, \ QSizePolicy -from pydm.widgets import PyDMPushButton, PyDMImageView, PyDMLineEdit +from pydm.widgets import PyDMPushButton, PyDMImageView, PyDMLineEdit, \ + enum_button import qtawesome as qta from ..util import get_appropriate_color from ..widgets import SiriusMainWindow, PyDMLedMultiChannel, \ - SiriusWaveformPlot, SiriusLabel, SiriusSpinbox + SiriusWaveformPlot, SiriusLabel, SiriusSpinbox, SiriusConnectionSignal from .util import DEVICES, SCREENS_PANEL, SCREENS_INFO, HEADER, \ GRAPH, SCREEN from .motorBtn import MotorBtn @@ -40,15 +41,13 @@ def __init__(self, prefix='', parent=None): self.stack_graphs = QStackedWidget() self._setupUi() - def radioBtnClick(self): + def radioBtnClick(self, value): ''' Action on radio button change ''' - radio_button = self.sender() - if radio_button.isChecked(): - self.selected_device = radio_button.device - device_index = DEVICES.index(self.selected_device) - self.stack_screens.setCurrentIndex(device_index) - self.stack_screen.setCurrentIndex(device_index) - self.stack_graphs.setCurrentIndex(device_index) + self.selected_device = DEVICES[value] + device_index = DEVICES.index(self.selected_device) + self.stack_screens.setCurrentIndex(device_index) + self.stack_screen.setCurrentIndex(device_index) + self.stack_graphs.setCurrentIndex(device_index) def getPvName(self, device, pv_name): ''' Build PV name ''' @@ -87,14 +86,16 @@ def setWidgetType(self, wid_type, device, pv_name, label='', value=0): widget.setFixedHeight(20) return widget - def getRadioBtn(self, device): - ''' Get the one radio button ''' - radio_button = QRadioButton(device) - radio_button.device = device - radio_button.toggled.connect(self.radioBtnClick) - if device == DEVICES[0]: - radio_button.setChecked(True) - return radio_button + def selectionItem(self, channel): + '''Build a selection widget''' + selector = enum_button.PyDMEnumButton( + init_channel=self.prefix + self.device_name+":"+channel) + self.active_screen = SiriusConnectionSignal( + self.prefix + self.device_name+":"+channel) + self.active_screen.new_value_signal[int].connect( + self.radioBtnClick) + selector.widgetType = 1 + return selector def setBasicInfo(self, device, label, pv_name): ''' Build one basic information Component ''' @@ -181,7 +182,7 @@ def setSingleScrn(self, device): image_wid = PyDMImageView( image_channel=self.getPvName(device, SCREEN['Screen']['data']), width_channel=self.getPvName(device, SCREEN['Screen']['width'])) - + image_wid.readingOrder = image_wid.ReadingOrder.Clike ss_vlay.addWidget(image_wid, 5) ss_vlay.addLayout(self.setScrnInfo(device), 1) @@ -206,10 +207,6 @@ def setPanelInfo(self, device, layout, row): pv_name = 'MOTOR' + ":" count = 0 - layout.addWidget( - self.getRadioBtn(device), - row, count, alignment=Qt.AlignCenter) - count += 1 for item in range(0, len(pv_list)): if item == 0: @@ -246,6 +243,10 @@ def setScrnPanel(self): am_glay = self.setScrnHeader(am_glay) row = 1 + am_glay.addWidget( + self.selectionItem('PRF:OPI'), + row, 0, 5, 1, + alignment=Qt.AlignCenter) for device in DEVICES: am_glay = self.setPanelInfo( device, am_glay, row) @@ -284,7 +285,7 @@ def setScrnSelection(self, selection_info, device): PyDMPushButton( init_channel=self.getPvName( device, 'MOTOR:' + pv_name), - label=label)) + label=label, pressValue=0)) widget.setLayout(ms_vlay) widget.setTitle("Position") return widget diff --git a/pyqt-apps/siriushla/li_rf_llrf/widgets.py b/pyqt-apps/siriushla/li_rf_llrf/widgets.py index 2f7a748d7..f38f644d8 100644 --- a/pyqt-apps/siriushla/li_rf_llrf/widgets.py +++ b/pyqt-apps/siriushla/li_rf_llrf/widgets.py @@ -192,7 +192,7 @@ def _setupui(self): lay1 = QGridLayout() self.setLayout(lay1) - graph = SiriusWaveformPlot(self) + graph = SiriusTimePlot(self) graph.setObjectName('graph') graph.setStyleSheet('#graph {min-height: 15em; min-width: 20em;}') graph.maxRedrawRate = 2 @@ -238,12 +238,11 @@ def _setupui(self): y_channel=chname, name='Data', color='red', - redraw_mode=2, lineStyle=1, lineWidth=3, symbol='o', symbolSize=10) - graph.addChannel(**opts) + graph.addYChannel(**opts) lay1.addWidget(graph, 0, 0)