From 81e6d9340e46ce18ae6242719f37448f29f4f01f Mon Sep 17 00:00:00 2001 From: Ana Clara Oliveira Date: Mon, 21 Nov 2022 13:15:31 -0300 Subject: [PATCH 1/5] PSMon.FIX: fix QS filter in sips2filters --- pyqt-apps/siriushla/as_ps_diag/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'}, From 151ccbe4b334f44b6053691724676b7a69460aa0 Mon Sep 17 00:00:00 2001 From: Ana Clara Oliveira Date: Mon, 21 Nov 2022 14:37:15 -0300 Subject: [PATCH 2/5] Update version to 0.77.1 --- pyqt-apps/siriushla/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 19a93dad2839b3934652e137f993b8a794a3f3c3 Mon Sep 17 00:00:00 2001 From: Rafael Lyra Date: Tue, 22 Nov 2022 10:42:45 -0300 Subject: [PATCH 3/5] LINAC Screens: Fix Position buttons and chart rotation --- pyqt-apps/siriushla/li_di_scrns/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyqt-apps/siriushla/li_di_scrns/main.py b/pyqt-apps/siriushla/li_di_scrns/main.py index 6c4ac6210..14e6c6711 100644 --- a/pyqt-apps/siriushla/li_di_scrns/main.py +++ b/pyqt-apps/siriushla/li_di_scrns/main.py @@ -181,7 +181,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) @@ -284,7 +284,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 From 4f3aaf0f7611e9cee87697dfb6dd9cdf6c3adf0a Mon Sep 17 00:00:00 2001 From: Rafael Lyra Date: Tue, 22 Nov 2022 11:19:34 -0300 Subject: [PATCH 4/5] LINAC MPS: TimePlot problem --- pyqt-apps/siriushla/li_rf_llrf/widgets.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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) From 77c4ba81c2461c902925d22aa40eaf4c40080b3d Mon Sep 17 00:00:00 2001 From: Rafael Lyra Date: Tue, 22 Nov 2022 16:52:00 -0300 Subject: [PATCH 5/5] LINAC Screens: Fix Active Screen selection --- pyqt-apps/scripts/sirius-hla-li-rf-llrf.py | 2 +- pyqt-apps/siriushla/li_di_scrns/main.py | 47 +++++++++++----------- 2 files changed, 25 insertions(+), 24 deletions(-) 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/li_di_scrns/main.py b/pyqt-apps/siriushla/li_di_scrns/main.py index 14e6c6711..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 ''' @@ -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)