provide setup for MLZ_Amagnet to be used @PSI soon
Also implement lots of fixes and improvements. fixes: #3381 Change-Id: Ibe6664da00756ae5813b90f190295045808b2ff0
This commit is contained in:
@ -21,6 +21,8 @@
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
from PyQt4.QtGui import QMainWindow, QInputDialog, QTreeWidgetItem, QMessageBox
|
||||
from PyQt4.QtCore import pyqtSignature as qtsig, QObject, pyqtSignal
|
||||
|
||||
@ -91,7 +93,7 @@ class MainWindow(QMainWindow):
|
||||
try:
|
||||
self._addNode(host)
|
||||
except Exception as e:
|
||||
print e
|
||||
print(e)
|
||||
|
||||
@qtsig('')
|
||||
def on_actionAdd_SEC_node_triggered(self):
|
||||
@ -108,11 +110,11 @@ class MainWindow(QMainWindow):
|
||||
'Connecting to %s failed!' % host, str(e))
|
||||
|
||||
def on_validateCheckBox_toggled(self, state):
|
||||
print "validateCheckBox_toggled", state
|
||||
print("validateCheckBox_toggled", state)
|
||||
|
||||
def on_visibilityComboBox_activated(self, level):
|
||||
if level in ['user', 'admin', 'expert']:
|
||||
print "visibility Level now:", level
|
||||
print("visibility Level now:", level)
|
||||
|
||||
def on_treeWidget_currentItemChanged(self, current, previous):
|
||||
if current.type() == ITEM_TYPE_NODE:
|
||||
|
@ -21,38 +21,13 @@
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
from PyQt4.QtGui import QWidget, QLabel, QMessageBox, QCheckBox
|
||||
from __future__ import print_function
|
||||
|
||||
from PyQt4.QtGui import QWidget, QLabel, QPushButton as QButton, QLineEdit, QMessageBox, QCheckBox, QSizePolicy
|
||||
from PyQt4.QtCore import pyqtSignature as qtsig, Qt, pyqtSignal
|
||||
|
||||
from secop.gui.util import loadUi
|
||||
|
||||
|
||||
class ParameterButtons(QWidget):
|
||||
setRequested = pyqtSignal(str, str, str) # module, parameter, target
|
||||
|
||||
def __init__(self,
|
||||
module,
|
||||
parameter,
|
||||
initval='',
|
||||
readonly=True,
|
||||
parent=None):
|
||||
super(ParameterButtons, self).__init__(parent)
|
||||
loadUi(self, 'parambuttons.ui')
|
||||
|
||||
self._module = module
|
||||
self._parameter = parameter
|
||||
|
||||
self.currentLineEdit.setText(str(initval))
|
||||
if readonly:
|
||||
self.setPushButton.setEnabled(False)
|
||||
self.setLineEdit.setEnabled(False)
|
||||
else:
|
||||
self.setLineEdit.returnPressed.connect(
|
||||
self.on_setPushButton_clicked)
|
||||
|
||||
def on_setPushButton_clicked(self):
|
||||
self.setRequested.emit(self._module, self._parameter,
|
||||
self.setLineEdit.text())
|
||||
from secop.gui.params import ParameterView
|
||||
|
||||
|
||||
class ParameterGroup(QWidget):
|
||||
@ -79,7 +54,7 @@ class ParameterGroup(QWidget):
|
||||
self._row += 1
|
||||
|
||||
def on_toggle_clicked(self):
|
||||
print "ParameterGroup.on_toggle_clicked"
|
||||
print("ParameterGroup.on_toggle_clicked")
|
||||
if self.paramGroupBox.isChecked():
|
||||
for w in self._widgets:
|
||||
w.show()
|
||||
@ -122,6 +97,9 @@ class ModuleCtrl(QWidget):
|
||||
if group is not None:
|
||||
allGroups.add(group)
|
||||
paramsByGroup.setdefault(group, []).append(param)
|
||||
# enforce reading initial value if not already in cache
|
||||
if param not in initValues:
|
||||
self._node.getParameter(self._module, param)
|
||||
|
||||
groupWidgets = {} # groupname -> CheckBoxWidget for (un)folding
|
||||
|
||||
@ -137,9 +115,12 @@ class ModuleCtrl(QWidget):
|
||||
|
||||
# check if there is a param of the same name too
|
||||
if group in params:
|
||||
datatype = self._node.getProperties(
|
||||
self._module, group).get(
|
||||
'datatype', None)
|
||||
# yes: create a widget for this as well
|
||||
labelstr, buttons = self._makeEntry(
|
||||
param, initValues[param].value, nolabel=True, checkbox=checkbox, invert=True)
|
||||
param, initValues[param].value, datatype=datatype, nolabel=True, checkbox=checkbox, invert=True)
|
||||
checkbox.setText(labelstr)
|
||||
|
||||
# add to Layout (yes: ignore the label!)
|
||||
@ -150,11 +131,19 @@ class ModuleCtrl(QWidget):
|
||||
row += 1
|
||||
|
||||
# loop over all params and insert and connect
|
||||
for param in paramsByGroup[param]:
|
||||
if param == group:
|
||||
for param_ in paramsByGroup[param]:
|
||||
if param_ == group:
|
||||
continue
|
||||
if param_ not in initValues:
|
||||
initval = None
|
||||
print("Warning: %r not in initValues!" % param_)
|
||||
else:
|
||||
initval = initValues[param_].value
|
||||
datatype = self._node.getProperties(
|
||||
self._module, param_).get(
|
||||
'datatype', None)
|
||||
label, buttons = self._makeEntry(
|
||||
param, initValues[param].value, checkbox=checkbox, invert=False)
|
||||
param_, initval, checkbox=checkbox, invert=False)
|
||||
|
||||
# add to Layout
|
||||
self.paramGroupBox.layout().addWidget(label, row, 0)
|
||||
@ -166,18 +155,43 @@ class ModuleCtrl(QWidget):
|
||||
# or is named after a group (otherwise its created above)
|
||||
props = self._node.getProperties(self._module, param)
|
||||
if props.get('group', param) == param:
|
||||
datatype = self._node.getProperties(
|
||||
self._module, param).get(
|
||||
'datatype', None)
|
||||
label, buttons = self._makeEntry(
|
||||
param, initValues[param].value)
|
||||
param, initValues[param].value, datatype=datatype)
|
||||
|
||||
# add to Layout
|
||||
self.paramGroupBox.layout().addWidget(label, row, 0)
|
||||
self.paramGroupBox.layout().addWidget(buttons, row, 1)
|
||||
row += 1
|
||||
|
||||
# also populate properties
|
||||
self._propWidgets = {}
|
||||
props = self._node.getModuleProperties(self._module)
|
||||
row = 0
|
||||
for prop in sorted(props):
|
||||
label = QLabel(prop + ':')
|
||||
label.setFont(self._labelfont)
|
||||
label.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Preferred)
|
||||
|
||||
# make 'display' label
|
||||
view = QLabel(str(props[prop]))
|
||||
view.setFont(self.font())
|
||||
view.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
|
||||
view.setWordWrap(True)
|
||||
|
||||
self.propertyGroupBox.layout().addWidget(label, row, 0)
|
||||
self.propertyGroupBox.layout().addWidget(view, row, 1)
|
||||
row += 1
|
||||
|
||||
self._propWidgets[prop] = (label, view)
|
||||
|
||||
def _makeEntry(
|
||||
self,
|
||||
param,
|
||||
initvalue,
|
||||
datatype=None,
|
||||
nolabel=False,
|
||||
checkbox=None,
|
||||
invert=False):
|
||||
@ -194,8 +208,12 @@ class ModuleCtrl(QWidget):
|
||||
if checkbox and not invert:
|
||||
labelstr = ' ' + labelstr
|
||||
|
||||
buttons = ParameterButtons(
|
||||
self._module, param, initvalue, props['readonly'])
|
||||
buttons = ParameterView(
|
||||
self._module,
|
||||
param,
|
||||
datatype=datatype,
|
||||
initvalue=initvalue,
|
||||
readonly=props['readonly'])
|
||||
buttons.setRequested.connect(self._set_Button_pressed)
|
||||
|
||||
if description:
|
||||
@ -243,5 +261,4 @@ class ModuleCtrl(QWidget):
|
||||
def _updateValue(self, module, parameter, value):
|
||||
if module != self._module:
|
||||
return
|
||||
|
||||
self._paramWidgets[parameter][1].currentLineEdit.setText(str(value[0]))
|
||||
self._paramWidgets[parameter][1].updateValue(str(value[0]))
|
||||
|
@ -24,11 +24,12 @@
|
||||
import pprint
|
||||
import json
|
||||
|
||||
from PyQt4.QtGui import QWidget, QTextCursor, QFont, QFontMetrics
|
||||
from PyQt4.QtCore import pyqtSignature as qtsig, Qt
|
||||
from PyQt4.QtGui import QWidget, QTextCursor, QFont, QFontMetrics, QLabel, QPushButton, QLineEdit, QMessageBox, QCheckBox, QSizePolicy
|
||||
from PyQt4.QtCore import pyqtSignature as qtsig, Qt, pyqtSignal
|
||||
|
||||
from secop.gui.util import loadUi
|
||||
from secop.protocol.errors import SECOPError
|
||||
from secop.datatypes import StringType, EnumType
|
||||
|
||||
|
||||
class NodeCtrl(QWidget):
|
||||
@ -44,6 +45,9 @@ class NodeCtrl(QWidget):
|
||||
self.protocolVersionLabel.setText(self._node.protocolVersion)
|
||||
self._clearLog()
|
||||
|
||||
# now populate modules tab
|
||||
self._init_modules_tab()
|
||||
|
||||
@qtsig('')
|
||||
def on_sendPushButton_clicked(self):
|
||||
msg = self.msgLineEdit.text().strip()
|
||||
@ -118,3 +122,172 @@ class NodeCtrl(QWidget):
|
||||
# due to monospace)
|
||||
result = self.logTextBrowser.width() / fontMetrics.width('a')
|
||||
return result
|
||||
|
||||
def _init_modules_tab(self):
|
||||
self._moduleWidgets = []
|
||||
layout = self.scrollAreaWidgetContents.layout()
|
||||
labelfont = self.font()
|
||||
labelfont.setBold(True)
|
||||
row = 0
|
||||
for modname in sorted(self._node.modules):
|
||||
modprops = self._node.getModuleProperties(modname)
|
||||
baseclass = modprops['interface']
|
||||
description = modprops['interface']
|
||||
unit = self._node.getProperties(modname, 'value').get('unit', '')
|
||||
|
||||
if unit:
|
||||
labelstr = '%s (%s):' % (modname, unit)
|
||||
else:
|
||||
labelstr = '%s:' % (modname,)
|
||||
label = QLabel(labelstr)
|
||||
label.setFont(labelfont)
|
||||
|
||||
if baseclass == 'Driveable':
|
||||
widget = DriveableWidget(self._node, modname, self)
|
||||
elif baseclass == 'Readable':
|
||||
widget = ReadableWidget(self._node, modname, self)
|
||||
else:
|
||||
widget = QLabel('Unsupported Interfaceclass %r' % baseclass)
|
||||
|
||||
if description:
|
||||
widget.setToolTip(description)
|
||||
|
||||
layout.addWidget(label, row, 0)
|
||||
layout.addWidget(widget, row, 1)
|
||||
|
||||
row += 1
|
||||
self._moduleWidgets.extend((label, widget))
|
||||
|
||||
|
||||
class ReadableWidget(QWidget):
|
||||
|
||||
def __init__(self, node, module, parent=None):
|
||||
super(ReadableWidget, self).__init__(parent)
|
||||
self._node = node
|
||||
self._module = module
|
||||
|
||||
params = self._node.getProperties(self._module, 'value')
|
||||
datatype = params.get('datatype', StringType())
|
||||
self._is_enum = isinstance(datatype, EnumType)
|
||||
|
||||
loadUi(self, 'modulebuttons.ui')
|
||||
|
||||
# populate comboBox, keeping a mapping of Qt-index to EnumValue
|
||||
if self._is_enum:
|
||||
self._map = {} # maps QT-idx to name/value
|
||||
self._revmap = {} # maps value/name to QT-idx
|
||||
for idx, (val, name) in enumerate(
|
||||
sorted(datatype.entries.items())):
|
||||
self._map[idx] = (name, val)
|
||||
self._revmap[name] = idx
|
||||
self._revmap[val] = idx
|
||||
self.targetComboBox.addItem(name, val)
|
||||
|
||||
self._init_status_widgets()
|
||||
self._init_current_widgets()
|
||||
self._init_target_widgets()
|
||||
|
||||
self._node.newData.connect(self._updateValue)
|
||||
|
||||
def _get(self, pname, fallback=Ellipsis):
|
||||
params = self._node.queryCache(self._module)
|
||||
if pname in params:
|
||||
return params[pname].value
|
||||
try:
|
||||
return self._node.getParameter(self._module, pname)
|
||||
except Exception:
|
||||
self.log.exception()
|
||||
if fallback is not Ellipsis:
|
||||
return fallback
|
||||
raise
|
||||
|
||||
def _init_status_widgets(self):
|
||||
self.update_status(self._get('status', (999, '<not supported>')))
|
||||
# XXX: also connect update_status signal to LineEdit ??
|
||||
|
||||
def update_status(self, status, qualifiers={}):
|
||||
self.statusLineEdit.setText(str(status))
|
||||
# may change meaning of cmdPushButton
|
||||
|
||||
def _init_current_widgets(self):
|
||||
self.update_current(self._get('value', ''))
|
||||
|
||||
def update_current(self, value, qualifiers={}):
|
||||
self.currentLineEdit.setText(str(value))
|
||||
|
||||
def _init_target_widgets(self):
|
||||
# Readable has no target: disable widgets
|
||||
self.targetLineEdit.setHidden(True)
|
||||
self.targetComboBox.setHidden(True)
|
||||
self.cmdPushButton.setHidden(True)
|
||||
|
||||
def update_target(self, target, qualifiers={}):
|
||||
pass
|
||||
|
||||
def target_go(self, target):
|
||||
try:
|
||||
self._node.setParameter(self._module, 'target', target)
|
||||
except Exception as e:
|
||||
QMessageBox.warning(self.parent(), 'Operation failed', str(e))
|
||||
|
||||
def _updateValue(self, module, parameter, value):
|
||||
if module != self._module:
|
||||
return
|
||||
if parameter == 'status':
|
||||
self.update_status(*value)
|
||||
elif parameter == 'value':
|
||||
self.update_current(*value)
|
||||
elif parameter == 'target':
|
||||
self.update_target(*value)
|
||||
|
||||
|
||||
class DriveableWidget(ReadableWidget):
|
||||
|
||||
def _init_target_widgets(self):
|
||||
params = self._node.getProperties(self._module, 'target')
|
||||
if self._is_enum:
|
||||
# EnumType: disable Linedit
|
||||
self.targetLineEdit.setHidden(True)
|
||||
else:
|
||||
# normal types: disable Combobox
|
||||
self.targetComboBox.setHidden(True)
|
||||
target = self._get('target', None)
|
||||
if target:
|
||||
if isinstance(target, list) and isinstance(target[1], dict):
|
||||
self.update_target(target[0])
|
||||
else:
|
||||
self.update_target(target)
|
||||
|
||||
def update_current(self, value, qualifiers={}):
|
||||
if self._is_enum:
|
||||
self.currentLineEdit.setText(self._map[self._revmap[value]][0])
|
||||
else:
|
||||
self.currentLineEdit.setText(str(value))
|
||||
|
||||
def update_target(self, target, qualifiers={}):
|
||||
if self._is_enum:
|
||||
# update selected item
|
||||
if target in self._revmap:
|
||||
self.targetComboBox.setCurrentIndex(self._revmap[target])
|
||||
else:
|
||||
print(
|
||||
"%s: Got invalid target value %r!" %
|
||||
(self._module, target))
|
||||
else:
|
||||
self.targetLineEdit.setText(str(target))
|
||||
|
||||
def on_cmdPushButton_clicked(self, toggle=False):
|
||||
if toggled:
|
||||
return
|
||||
if self._is_enum:
|
||||
self.on_targetComboBox_activated()
|
||||
else:
|
||||
self.on_targetLineEdit_returnPressed()
|
||||
|
||||
def on_targetLineEdit_returnPressed(self):
|
||||
self.target_go(self.targetLineEdit.text())
|
||||
|
||||
def on_targetComboBox_activated(self, stuff=''):
|
||||
if isinstance(stuff, (str, unicode)):
|
||||
return
|
||||
self.target_go(self._map[self.targetComboBox.currentIndex()][0])
|
||||
|
182
secop/gui/params/__init__.py
Normal file
182
secop/gui/params/__init__.py
Normal file
@ -0,0 +1,182 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# *****************************************************************************
|
||||
# Copyright (c) 2015-2016 by the authors, see LICENSE
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation; either version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
# details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# Module authors:
|
||||
# Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
|
||||
#
|
||||
# *****************************************************************************
|
||||
|
||||
from PyQt4.QtGui import QWidget, QLabel, QPushButton as QButton, QLineEdit, QMessageBox, QCheckBox, QSizePolicy
|
||||
from PyQt4.QtCore import pyqtSignature as qtsig, Qt, pyqtSignal
|
||||
|
||||
from secop.gui.util import loadUi
|
||||
from secop.datatypes import *
|
||||
|
||||
|
||||
class ParameterWidget(QWidget):
|
||||
setRequested = pyqtSignal(str, str, str) # module, parameter, target
|
||||
cmdRequested = pyqtSignal(str, str, list) # module, command, args
|
||||
|
||||
def __init__(self,
|
||||
module,
|
||||
paramcmd,
|
||||
datatype=None,
|
||||
initvalue=None,
|
||||
readonly=True,
|
||||
parent=None):
|
||||
super(ParameterWidget, self).__init__(parent)
|
||||
self._module = module
|
||||
self._paramcmd = paramcmd
|
||||
self._datatype = datatype
|
||||
self._readonly = readonly
|
||||
|
||||
self._load_ui(initvalue)
|
||||
|
||||
def _load_ui(self, initvalue):
|
||||
# load ui file, set initvalue to right widget
|
||||
pass
|
||||
|
||||
def updateValue(self, valuestr):
|
||||
# async !
|
||||
pass
|
||||
|
||||
|
||||
class GenericParameterWidget(ParameterWidget):
|
||||
|
||||
def _load_ui(self, initvalue):
|
||||
# using two QLineEdits for current and target value
|
||||
loadUi(self, 'parambuttons.ui')
|
||||
|
||||
if self._readonly:
|
||||
self.setPushButton.setEnabled(False)
|
||||
self.setLineEdit.setEnabled(False)
|
||||
else:
|
||||
self.setLineEdit.returnPressed.connect(
|
||||
self.on_setPushButton_clicked)
|
||||
self.updateValue(str(initvalue))
|
||||
|
||||
def on_setPushButton_clicked(self):
|
||||
self.setRequested.emit(self._module, self._paramcmd,
|
||||
self.setLineEdit.text())
|
||||
|
||||
def updateValue(self, valuestr):
|
||||
self.currentLineEdit.setText(valuestr)
|
||||
|
||||
|
||||
class EnumParameterWidget(GenericParameterWidget):
|
||||
|
||||
def _load_ui(self, initvalue):
|
||||
# using two QLineEdits for current and target value
|
||||
loadUi(self, 'parambuttons_select.ui')
|
||||
|
||||
# transfer allowed settings from datatype to comboBoxes
|
||||
self._map = {} # maps index to enumstring
|
||||
self._revmap = {} # maps enumstring to index
|
||||
index = 0
|
||||
for data, entry in sorted(self._datatype.entries.items()):
|
||||
self.setComboBox.addItem(entry, data)
|
||||
self._map[index] = entry
|
||||
self._revmap[entry] = index
|
||||
self._revmap[data] = index
|
||||
index += 1
|
||||
if self._readonly:
|
||||
self.setLabel.setEnabled(False)
|
||||
self.setComboBox.setEnabled(False)
|
||||
self.setLabel.setHidden(True)
|
||||
self.setComboBox.setHidden(True)
|
||||
else:
|
||||
self.setComboBox.activated.connect(self.on_setPushButton_clicked)
|
||||
|
||||
self.updateValue(str(initvalue))
|
||||
|
||||
def on_setPushButton_clicked(self):
|
||||
self.setRequested.emit(
|
||||
self._module, self._paramcmd, str(
|
||||
self._datatype.reversed[
|
||||
self._map[
|
||||
self.setComboBox.currentIndex()]]))
|
||||
|
||||
def updateValue(self, valuestr):
|
||||
try:
|
||||
self.currentLineEdit.setText(
|
||||
self._datatype.entries.get(
|
||||
int(valuestr), valuestr))
|
||||
except ValueError:
|
||||
self.currentLineEdit.setText('undefined Value: %r' % valuestr)
|
||||
|
||||
|
||||
class GenericCmdWidget(ParameterWidget):
|
||||
|
||||
def _load_ui(self, initvalue):
|
||||
# using two QLineEdits for current and target value
|
||||
loadUi(self, 'cmdbuttons.ui')
|
||||
|
||||
self.cmdLineEdit.setText('')
|
||||
self.cmdLineEdit.setEnabled(self.datatype.argtypes is not None)
|
||||
self.cmdLineEdit.returnPressed.connect(
|
||||
self.on_cmdPushButton_clicked)
|
||||
|
||||
def on_cmdPushButton_clicked(self):
|
||||
# wait until command complete before retrying
|
||||
self.cmdPushButton.setEnabled(False)
|
||||
self.cmdRequested.emit(
|
||||
self._module,
|
||||
self._paramcmd,
|
||||
self._datatype.from_string(
|
||||
self.cmdLineEdit.text()))
|
||||
|
||||
def updateValue(self, valuestr):
|
||||
# open dialog and show value, if any.
|
||||
# then re-activate the command button
|
||||
self.cmdPushButton.setEnabled(True)
|
||||
|
||||
|
||||
def ParameterView(module,
|
||||
paramcmd,
|
||||
datatype=None,
|
||||
initvalue=None,
|
||||
readonly=True,
|
||||
parent=None):
|
||||
# depending on datatype returns an initialized widget fit for display and
|
||||
# interaction
|
||||
|
||||
if datatype is not None:
|
||||
if datatype.IS_COMMAND:
|
||||
return GenericCmdWidget(
|
||||
module,
|
||||
paramcmd, # name of command
|
||||
datatype,
|
||||
initvalue, # not used for comands
|
||||
readonly, # not used for commands
|
||||
parent)
|
||||
if isinstance(datatype, EnumType):
|
||||
return EnumParameterWidget(
|
||||
module,
|
||||
paramcmd, # name of parameter
|
||||
datatype,
|
||||
initvalue,
|
||||
readonly,
|
||||
parent)
|
||||
|
||||
return GenericParameterWidget(
|
||||
module,
|
||||
paramcmd, # name of parameter
|
||||
datatype,
|
||||
initvalue,
|
||||
readonly,
|
||||
parent)
|
60
secop/gui/ui/cmdbuttons.ui
Normal file
60
secop/gui/ui/cmdbuttons.ui
Normal file
@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>730</width>
|
||||
<height>33</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="horizontalSpacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Arguments:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="cmdLineEdit">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>256</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="cmdPushButton">
|
||||
<property name="text">
|
||||
<string>Go</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -29,6 +29,9 @@
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QComboBox" name="visibilityComboBox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>user</string>
|
||||
@ -61,6 +64,9 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="validateCheckBox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Validate locally</string>
|
||||
</property>
|
||||
@ -104,7 +110,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1228</width>
|
||||
<height>23</height>
|
||||
<height>33</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
|
79
secop/gui/ui/modulebuttons.ui
Normal file
79
secop/gui/ui/modulebuttons.ui
Normal file
@ -0,0 +1,79 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>748</width>
|
||||
<height>74</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="leftMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLineEdit" name="currentLineEdit">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>256</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="targetLineEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="targetComboBox"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="cmdPushButton">
|
||||
<property name="text">
|
||||
<string>Go</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="3">
|
||||
<widget class="QLineEdit" name="statusLineEdit">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -6,53 +6,15 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>230</width>
|
||||
<height>195</height>
|
||||
<width>257</width>
|
||||
<height>162</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">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<italic>false</italic>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Module name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="moduleNameLabel">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<item row="4" column="0">
|
||||
<widget class="QGroupBox" name="paramGroupBox">
|
||||
<property name="title">
|
||||
<string>Parameters:</string>
|
||||
@ -76,44 +38,7 @@
|
||||
</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>
|
||||
<item row="4" column="0">
|
||||
<widget class="QGroupBox" name="propertyGroupBox">
|
||||
<property name="title">
|
||||
<string>Properties:</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<item row="6" column="0">
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@ -126,6 +51,54 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QGroupBox" name="propertyGroupBox">
|
||||
<property name="title">
|
||||
<string>Properties:</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3"/>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<italic>false</italic>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Module name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="moduleNameLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>18</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QGroupBox" name="commandGroupBox">
|
||||
<property name="title">
|
||||
<string>Commands:</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5"/>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
|
@ -85,49 +85,91 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="msgLineEdit"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>>>></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="sendPushButton">
|
||||
<property name="text">
|
||||
<string>Send</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QPushButton" name="clearPushButton">
|
||||
<property name="text">
|
||||
<string>Clear</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="4">
|
||||
<widget class="QTextBrowser" name="logTextBrowser">
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="consoleTab">
|
||||
<attribute name="title">
|
||||
<string>Console</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="logTextBrowser">
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Sans'; font-size:11pt; font-weight:400; font-style:normal;">
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</style></head><body style=" font-family:'Noto Sans'; font-size:12pt; font-weight:400; font-style:normal;">
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:11pt;"><br /></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="clearPushButton">
|
||||
<property name="text">
|
||||
<string>Clear</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="msgLineEdit"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>>>></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QPushButton" name="sendPushButton">
|
||||
<property name="text">
|
||||
<string>Send</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="modulesTab">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Modules</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>610</width>
|
||||
<height>324</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5"/>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>730</width>
|
||||
<height>33</height>
|
||||
<height>39</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -36,25 +36,15 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Current: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Set: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="targetValueComboBox"/>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QComboBox" name="comboBox_2"/>
|
||||
<widget class="QComboBox" name="setComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
@ -69,6 +59,30 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="currentLabel">
|
||||
<property name="text">
|
||||
<string>Current: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="setLabel">
|
||||
<property name="text">
|
||||
<string>Set: </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="currentLineEdit">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
|
Reference in New Issue
Block a user