Skip to content

Commit

Permalink
Merge pull request #576 from lnls-sirius/fix-bugs
Browse files Browse the repository at this point in the history
Fix bugs
  • Loading branch information
anacso17 authored Nov 22, 2022
2 parents 741a9f2 + 77c4ba8 commit 54c27bd
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion pyqt-apps/scripts/sirius-hla-li-rf-llrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion pyqt-apps/siriushla/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.77.0
0.77.1
2 changes: 1 addition & 1 deletion pyqt-apps/siriushla/as_ps_diag/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
Expand Down
51 changes: 26 additions & 25 deletions pyqt-apps/siriushla/li_di_scrns/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 '''
Expand Down Expand Up @@ -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 '''
Expand Down Expand Up @@ -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)

Expand All @@ -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:
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions pyqt-apps/siriushla/li_rf_llrf/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)


Expand Down

0 comments on commit 54c27bd

Please sign in to comment.