gui: show parameter properties again

* parameter properties shown with own button
* for now as a popup window

Change-Id: If3b51eb66a759c207591f1341126557f2c6e4a3d
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/30748
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Alexander Zaft <a.zaft@fz-juelich.de>
This commit is contained in:
Alexander Zaft 2023-03-22 15:17:45 +01:00 committed by Markus Zolliker
parent 67bbe9d9a5
commit 087a5ef476
3 changed files with 60 additions and 48 deletions

View File

@ -123,6 +123,7 @@ class AnimatedLabelHandthrough(QWidget):
class ModuleWidget(QWidget):
plot = pyqtSignal(str)
plotAdd = pyqtSignal(str)
paramDetails = pyqtSignal(str, str)
def __init__(self, node, name, parent=None):
super().__init__(parent)
loadUi(self, 'modulewidget.ui')
@ -285,7 +286,7 @@ class ModuleWidget(QWidget):
l.addWidget(nameLabel, row,0,1,1)
l.addWidget(display, row,1,1,5)
l.addWidget(unitLabel, row,6)
self._addPlotButtons(param, row)
self._addButtons(param, row)
def _addRWParam(self, param, row):
props = self._node.getProperties(self._name, param)
@ -316,9 +317,9 @@ class ModuleWidget(QWidget):
l.addWidget(inputEdit, row,4,1,2)
l.addWidget(unitLabel2, row,6,1,1)
l.addWidget(submitButton, row, 7)
self._addPlotButtons(param, row)
self._addButtons(param, row)
def _addPlotButtons(self, param, row):
def _addButtons(self, param, row):
if param == 'status':
return
plotButton = QToolButton()
@ -328,17 +329,24 @@ class ModuleWidget(QWidget):
plotAddButton.setIcon(QIcon(':/icons/plot-add'))
plotAddButton.setToolTip('Plot With...')
detailsButton= QToolButton()
detailsButton.setIcon(QIcon(':/icons/plot-add'))
detailsButton.setToolTip('show parameter details')
plotButton.clicked.connect(lambda: self.plot.emit(param))
plotAddButton.clicked.connect(lambda: self.plotAdd.emit(param))
detailsButton.clicked.connect(lambda: self.showParamDetails(param))
self._addbtns.append(plotAddButton)
plotAddButton.setDisabled(True)
self._paramWidgets[param].append(plotButton)
self._paramWidgets[param].append(plotAddButton)
self._paramWidgets[param].append(detailsButton)
l = self.moduleDisplay.layout()
l.addWidget(plotButton, row, 8)
l.addWidget(plotAddButton, row, 9)
l.addWidget(detailsButton, row, 10)
def _addCommands(self, startrow):
cmdicons = {
@ -401,6 +409,9 @@ class ModuleWidget(QWidget):
for group in self._groups:
self._setGroupHidden(group, show)
def showParamDetails(self, param):
self.paramDetails.emit(self._name, param)
def _button_pressed(self, param):
target = self._paramInputs[param].text()
try:

View File

@ -148,12 +148,14 @@ class NodeWidget(QWidget):
self.plotParam(module, param))
widget.plotAdd.connect(lambda param, module=module:
self._plotPopUp(module, param))
widget.paramDetails.connect(self.showDetailedParam)
widget.showDetails(self.detailed)
self.noPlots.connect(widget.plotsPresent)
self._modules[module] = widget
self._detailedParams[module] = {}
for param in node.getParameters(module):
view = ParameterView(node, module, param)
view.setWindowTitle('%s:%s:%s - Properties' % (self._node.equipmentId, module, param))
self._detailedParams[module][param] = view
viewLayout.addWidget(widget)
@ -208,6 +210,9 @@ class NodeWidget(QWidget):
if settings.value('highlightanimation', True, bool):
widget.triggerAnimation()
def showDetailedParam(self, module, param):
self._detailedParams[module][param].show()
def _treeContextMenu(self, pos):
index = self.tree.indexAt(pos)
if not index.isValid():

View File

@ -6,56 +6,68 @@
<rect>
<x>0</x>
<y>0</y>
<width>100</width>
<height>100</height>
<width>387</width>
<height>190</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<widget class="QLabel" name="paramNameLabel">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
<underline>true</underline>
</font>
</property>
<property name="text">
<string>Parameter name:</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:12pt; font-weight:600; text-decoration: underline;&quot;&gt;TextLabel&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="paramNameLabel">
<property name="text">
<string>TextLabel</string>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QGroupBox" name="propertyGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Properties</string>
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
@ -76,22 +88,6 @@
</layout>
</widget>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>