overdue update
This commit is contained in:
4
base.py
4
base.py
@@ -398,7 +398,7 @@ class BaseWindow(QMainWindow):
|
||||
|
||||
self.logging = logging
|
||||
#self.logging.basicConfig(filename=self.stdlog_dest, level=logging.DEBUG)
|
||||
self.logging.basicConfig(level=logging.DEBUG)
|
||||
self.logging.basicConfig(level=logging.NOTSET)
|
||||
self.logger = self.logging.getLogger(__name__)
|
||||
self.logger.info("Logging activated")
|
||||
|
||||
@@ -533,7 +533,7 @@ class BaseWindow(QMainWindow):
|
||||
self.mainwindow.setMinimumWidth(SLS_CENTRAL_WIDGET_MINIMUM_WIDTH)
|
||||
|
||||
self.setCentralWidget(self.mainwindow)
|
||||
self.show_log_message(MsgSeverity.INFO, _pymodule, _line(),
|
||||
self.show_log_message(MsgSeverity.INFO.name, _pymodule, _line(),
|
||||
"Application configured")
|
||||
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ class UserMode(IntEnum):
|
||||
OPERATION = 1
|
||||
EXPERT = 2
|
||||
SIMULATION = 3
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
655
guiframe.py
655
guiframe.py
@@ -6,8 +6,10 @@ import inspect
|
||||
import os
|
||||
import re
|
||||
|
||||
#import matplotlib
|
||||
from matplotlib.backends.backend_qt5agg import (
|
||||
FigureCanvasQTAgg, NavigationToolbar2QT as NavigationToolbar)
|
||||
#matplotlib.use('Agg')
|
||||
|
||||
from qtpy.QtCore import QSize, Qt, Slot
|
||||
from qtpy.QtGui import (
|
||||
@@ -17,10 +19,12 @@ from qtpy.QtWidgets import (
|
||||
QCheckBox, QComboBox, QDoubleSpinBox, QFrame, QGridLayout, QGroupBox,
|
||||
QHBoxLayout, QLabel, QLineEdit, QPushButton, QRadioButton, QSpinBox,
|
||||
QStackedWidget, QTabBar, QTabWidget, QToolButton, QVBoxLayout, QWidget)
|
||||
from caqtwidgets.pvwidgets import (CAQLabel, CAQTableWidget, QMessageWidget,
|
||||
QHLine, QVLine)
|
||||
from caqtwidgets.pvwidgets import (
|
||||
CAQLabel, CAQTableWidget, QMessageWidget, QHLine, QVLine)
|
||||
|
||||
from apps4ops.bdbase.enumkind import Facility, MsgSeverity, UserMode
|
||||
|
||||
|
||||
from pyqtacc.bdbase.enumkind import Facility, MsgSeverity, UserMode
|
||||
|
||||
_pymodule = os.path.basename(__file__)
|
||||
_appversion = "1.0.0"
|
||||
@@ -43,12 +47,19 @@ def _line():
|
||||
class GUIFrame(QWidget):
|
||||
""" GUI Class
|
||||
"""
|
||||
def __init__(self, parent, has_optics=True, has_procedure=True):
|
||||
def __init__(self, parent, has_optics=True, has_procedure="Vertical"):
|
||||
#super(GUIFrame, self).__init__()
|
||||
super().__init__()
|
||||
self.parent = parent
|
||||
self.has_optics = has_optics
|
||||
self.has_procedure = has_procedure
|
||||
|
||||
if isinstance(has_procedure, bool):
|
||||
self.has_procedure = has_procedure
|
||||
self.orientation_procedure = 'Vertical'
|
||||
else:
|
||||
self.has_procedure = True
|
||||
self.orientation_procedure = has_procedure
|
||||
|
||||
self.appname = parent.appname
|
||||
self.facility = parent.facility
|
||||
self.settings = parent.settings
|
||||
@@ -98,7 +109,7 @@ class GUIFrame(QWidget):
|
||||
self.msg_severity_qcolor = parent.msg_severity_qcolor
|
||||
self.msg_severity = MsgSeverity
|
||||
self.font_gui = QFont("sans serif")
|
||||
self.font_gui.setPointSize(11)
|
||||
self.font_gui.setPointSize(10)
|
||||
self.font_pts10 = QFont("sans serif")
|
||||
self.font_pts10.setPointSize(10)
|
||||
self.central_tab_widget = QTabWidget()
|
||||
@@ -111,7 +122,7 @@ class GUIFrame(QWidget):
|
||||
self.measurement_tab_wgt = QTabWidget(self.measurement_wgt)
|
||||
self.measurement_tab_wgt.setMinimumWidth(480)
|
||||
|
||||
self.operator_wgt = QWidget(self.measurement_tab_wgt)
|
||||
self.operator_wgt = QWidget() #(self.measurement_tab_wgt)
|
||||
self.expert_wgt = QWidget(self.measurement_tab_wgt)
|
||||
|
||||
self.results_wgt = QWidget()
|
||||
@@ -132,7 +143,7 @@ class GUIFrame(QWidget):
|
||||
if "GUI" in self.settings.data:
|
||||
self.results_tab_wgt_titles = self.settings.data[
|
||||
"GUI"]["subResultsTabTitle"]
|
||||
|
||||
|
||||
self.sub_results_wgt = [None] * len(self.results_tab_wgt_titles)
|
||||
self.sub_results_layout = [None] * len(self.results_tab_wgt_titles)
|
||||
|
||||
@@ -164,14 +175,170 @@ class GUIFrame(QWidget):
|
||||
self.expert_wgt_grid.setHorizontalSpacing(0)
|
||||
self.expert_wgt_grid.setVerticalSpacing(2)
|
||||
|
||||
self.init_central_tab_widget()
|
||||
if "GUITree" in self.settings.data:
|
||||
self.init_central_tab_widget_tree()
|
||||
else:
|
||||
self.init_central_tab_widget()
|
||||
self.enter_input_parameters()
|
||||
|
||||
|
||||
def init_central_tab_widget_tree(self): #_from_config(self):
|
||||
self.central_tab_widget.setFont(self.font_gui)
|
||||
|
||||
_margin = 4
|
||||
|
||||
|
||||
if "GUITree" in self.settings.data:
|
||||
|
||||
key_list = list(self.settings.data["GUITree"].keys())
|
||||
|
||||
self.level1_wgt = [None] * len(key_list)
|
||||
self.level1_tab_wgt = [None] * len(key_list)
|
||||
self.level2_wgt = {}
|
||||
self.level2_tab_wgt = {}
|
||||
self.level3_wgt = {}
|
||||
self.level3_tab_wgt = {}
|
||||
|
||||
qw7 = {}
|
||||
qw7_tab = {}
|
||||
|
||||
for i, title in enumerate(key_list):
|
||||
self.level1_wgt[i] = QWidget()
|
||||
self.level1_wgt[i].title = title
|
||||
|
||||
self.level1_tab_wgt[i] = QTabWidget() #self.level1_wgt[i])
|
||||
self.level1_tab_wgt[i].setMinimumWidth(480)
|
||||
self.level1_tab_wgt[i].setFont(self.font_gui)
|
||||
|
||||
|
||||
#layout = QGridLayout() #self.level1_wgt[i])
|
||||
#layout.setAlignment(Qt.AlignLeft | Qt.AlignTop)
|
||||
#layout.setSpacing(50)
|
||||
#layout.setContentsMargins(9,9,9,9)
|
||||
#layout.addWidget(self.level1_wgt[i])
|
||||
|
||||
#self.central_tab_widget.addTab(self.level1_wgt[i], title)
|
||||
|
||||
key_list2 = list(self.settings.data["GUITree"][title])
|
||||
self.level2_wgt[i] = [None] * len(key_list2)
|
||||
self.level2_tab_wgt[i] = [None] * len(key_list2)
|
||||
qw7[i] = [None] * len(key_list2)
|
||||
qw7_tab[i] = [None] * len(key_list2)
|
||||
|
||||
self.level3_wgt[i] = [None] * len(key_list2)
|
||||
self.level3_tab_wgt[i] = [None] * len(key_list2)
|
||||
for j, title2 in enumerate(key_list2):
|
||||
|
||||
|
||||
key_list3 = (self.settings.data["GUITree"][title][title2])
|
||||
|
||||
is_plot = False
|
||||
if isinstance(key_list3, list):
|
||||
len_key_list3 = len(key_list3)
|
||||
self.level3_wgt[i][j] = [None] * len_key_list3
|
||||
self.level3_tab_wgt[i][j] = [None] * len_key_list3
|
||||
elif isinstance(key_list3, dict):
|
||||
|
||||
if 'link' in key_list3:
|
||||
#get link
|
||||
link = key_list3['link']
|
||||
key_list3 = (self.settings.data[link]["subResultsTabTitle"])
|
||||
if isinstance(key_list3, list):
|
||||
is_plot = True
|
||||
len_key_list3 = len(key_list3)
|
||||
self.level3_wgt[i][j] = [None] * len_key_list3
|
||||
self.level3_tab_wgt[i][j] = [None] * len_key_list3
|
||||
else:
|
||||
len_key_list3 = 0
|
||||
else:
|
||||
len_key_list3 = 0
|
||||
|
||||
else:
|
||||
len_key_list3 = 0
|
||||
print("length", len_key_list3)
|
||||
|
||||
|
||||
|
||||
self.level2_wgt[i][j] = QWidget() #self.level1_wgt[i])
|
||||
self.level2_wgt[i][j].title2 = title2
|
||||
self.level2_wgt[i][j].setFont(self.font_gui)
|
||||
#layout = QGridLayout()#self.level2_wgt[i][j])
|
||||
#layout.setAlignment(Qt.AlignLeft | Qt.AlignTop)
|
||||
#layout.setSpacing(50)
|
||||
#layout.setContentsMargins(9,9,9,9)
|
||||
#layout.addWidget(self.level2_wgt[i][j])
|
||||
#Attaching the correct object to QTabWidget is crucuial!
|
||||
if not is_plot:
|
||||
self.level2_tab_wgt[i][j] = QTabWidget(self.level2_wgt[i][j])
|
||||
else:
|
||||
self.level2_tab_wgt[i][j] = QTabWidget(self.results_wgt)
|
||||
self.level2_tab_wgt[i][j].setMinimumWidth(480)
|
||||
self.level2_tab_wgt[i][j].setFont(self.font_gui)
|
||||
|
||||
|
||||
for k in range (0, len_key_list3):
|
||||
if not is_plot:
|
||||
title3 = key_list3[k]
|
||||
self.level3_wgt[i][j][k] = QWidget(self.level2_wgt[i][j])
|
||||
self.level3_wgt[i][j][k].title3 = title3
|
||||
self.level3_wgt[i][j][k].setFont(self.font_gui)
|
||||
|
||||
#self.level3_tab_wgt[i][j][k] = QTabWidget(self.level3_wgt[i][j][k])
|
||||
#self.level3_tab_wgt[i][j][k].setMinimumWidth(480)
|
||||
#self.level3_tab_wgt[i][j][k].setFont(self.font_gui)
|
||||
|
||||
##layout3 = QGridLayout() #self.level1_wgt[i])
|
||||
#layout3.addWidget(self.level3_tab_wgt[i][j][k])
|
||||
##layout3.addWidget(QLabel("TEST"))
|
||||
##layout3.setContentsMargins(9,9,9,9)
|
||||
#self.level3_wgt[i][j][k].setLayout(layout3)
|
||||
self.level2_tab_wgt[i][j].addTab(self.level3_wgt[i][j][k], title3)
|
||||
|
||||
if not is_plot:
|
||||
self.level1_tab_wgt[i].addTab(self.level2_wgt[i][j], title2)
|
||||
else:
|
||||
self.level1_tab_wgt[i].addTab(self.results_wgt, title2)
|
||||
layout2 = QGridLayout() #self.level1_wgt[i])
|
||||
layout2.addWidget(self.level2_tab_wgt[i][j])
|
||||
layout2.addWidget(QFrame()) #Add to stop streching of Measurement Tab
|
||||
#layout2.addWidget(QLabel("TEST"))
|
||||
layout2.setContentsMargins(_margin, _margin, _margin, _margin)
|
||||
self.level2_wgt[i][j].setLayout(layout2)
|
||||
|
||||
|
||||
layout = QGridLayout() #self.level1_wgt[i])
|
||||
layout.addWidget(self.level1_tab_wgt[i])
|
||||
self.level1_wgt[i].setLayout(layout)
|
||||
|
||||
layout.setContentsMargins(_margin, _margin, _margin, _margin)
|
||||
|
||||
self.central_tab_widget.addTab(self.level1_wgt[i], title)
|
||||
|
||||
|
||||
|
||||
#if "GUI" in self.settings.data:
|
||||
#self.central_tab_widget.addTab(
|
||||
## self.level1_tab_wgt[1].addTab(
|
||||
## self.results_wgt, self.settings.data["GUI"]["resultsTabTitle"])
|
||||
|
||||
self.central_tab_widget.addTab(self.log_wgt, "Log")
|
||||
|
||||
|
||||
self.operator_wgt = self.level3_wgt[0][0][0]
|
||||
self.expert_wgt = self.level3_wgt[0][0][1]
|
||||
self.measurement_tab_wgt = self.level2_tab_wgt[0][0]
|
||||
self.measurement_wgt = self.level2_wgt[0][0]
|
||||
|
||||
def init_central_tab_widget(self):
|
||||
""" Add tabs to central widget
|
||||
"""
|
||||
self.central_tab_widget.setFont(self.font_gui)
|
||||
self.central_tab_widget.addTab(self.measurement_wgt, "Measurement")
|
||||
|
||||
#if "GUITree" in self.settings.data:
|
||||
# tab = list(self.settings.data["GUITree"].keys())[0]
|
||||
# self.central_tab_widget.addTab(self.measurement_wgt, tab)
|
||||
|
||||
if "GUI" in self.settings.data:
|
||||
self.central_tab_widget.addTab(
|
||||
self.results_wgt, self.settings.data["GUI"]["resultsTabTitle"])
|
||||
@@ -188,8 +355,11 @@ class GUIFrame(QWidget):
|
||||
def init_results_tab_wgt(self):
|
||||
""" Add canvas tabs for plots/results
|
||||
"""
|
||||
self.results_tab_wgt.setFont(self.font_gui)
|
||||
|
||||
|
||||
self.results_tab_wgt.setFont(self.font_gui)
|
||||
|
||||
|
||||
for i, (wgt, subtitle) in enumerate(zip(self.sub_results_wgt,
|
||||
self.results_tab_wgt_titles)):
|
||||
|
||||
@@ -205,9 +375,10 @@ class GUIFrame(QWidget):
|
||||
|
||||
top_widget.setLayout(top_layout)
|
||||
self.results_tab_wgt.addTab(top_widget, subtitle)
|
||||
|
||||
|
||||
|
||||
self.results_layout.addWidget(self.results_tab_wgt)
|
||||
|
||||
|
||||
|
||||
def show_log_message(self, severity=None, pymodule="", lineno=0, message="",
|
||||
options=None):
|
||||
@@ -241,18 +412,25 @@ class GUIFrame(QWidget):
|
||||
def analysis_procedure_group(self):
|
||||
""" Procedure group box
|
||||
"""
|
||||
if 'V' in self.orientation_procedure.upper():
|
||||
_width = 208
|
||||
_height = 196
|
||||
else:
|
||||
_width = 508
|
||||
_height = 106
|
||||
|
||||
group_box = QGroupBox("Procedure")
|
||||
group_box.setObjectName("OUTER")
|
||||
hbox = QVBoxLayout()
|
||||
hbox.addLayout(self.create_analysis_wgt())
|
||||
hbox.setContentsMargins(9, 19, 9, 9)
|
||||
hbox.setSpacing(5)
|
||||
hbox.setAlignment(Qt.AlignTop | Qt.AlignHCenter)
|
||||
group_box.setMaximumWidth(208)
|
||||
group_box.setMinimumHeight(196)
|
||||
vbox = QVBoxLayout()
|
||||
vbox.addLayout(self.create_analysis_wgt())
|
||||
vbox.setContentsMargins(9, 19, 9, 9)
|
||||
vbox.setSpacing(5)
|
||||
vbox.setAlignment(Qt.AlignTop | Qt.AlignHCenter)
|
||||
group_box.setMaximumWidth(_width)
|
||||
group_box.setMinimumHeight(_height)
|
||||
group_box.setFont(self.font_gui)
|
||||
group_box.setAlignment(Qt.AlignTop | Qt.AlignHCenter)
|
||||
group_box.setLayout(hbox)
|
||||
group_box.setLayout(vbox)
|
||||
return group_box
|
||||
|
||||
def optics_groupbox(self):
|
||||
@@ -620,7 +798,8 @@ class GUIFrame(QWidget):
|
||||
self, start_title="Start", start_action=None,
|
||||
start_tooltip="Start measurement and analysis procedure",
|
||||
abort_title="Abort", abort_action=None,
|
||||
abort_tooltip="Abort procedure at next break point"):
|
||||
abort_tooltip="Abort procedure at next break point",
|
||||
orientation="Vertical"):
|
||||
|
||||
if start_action is None:
|
||||
start_action = self.parent.start_analysis_thread
|
||||
@@ -633,7 +812,9 @@ class GUIFrame(QWidget):
|
||||
abort_tooltip)
|
||||
|
||||
self.save_all_wgt = self.save_all_group()
|
||||
grid = QVBoxLayout()
|
||||
|
||||
grid = QVBoxLayout() if 'V' in self.orientation_procedure.upper() else QHBoxLayout()
|
||||
|
||||
grid.addWidget(self.start_wgt)
|
||||
grid.addWidget(self.abort_wgt)
|
||||
grid.addWidget(self.save_all_wgt)
|
||||
@@ -943,6 +1124,7 @@ class GUIFrame(QWidget):
|
||||
self.input_parameters["debug"] = False
|
||||
return self.checkbox_wgt(key="debug", tooltip=tooltip, hline=hline)
|
||||
|
||||
|
||||
def checkbox_simulation(self, hline="NONE"):
|
||||
def on_change(state):
|
||||
if bool(state):
|
||||
@@ -1073,23 +1255,18 @@ class GUIFrame(QWidget):
|
||||
def canvas_update(self, fig_data, idx=0):
|
||||
#place figures in a list
|
||||
|
||||
|
||||
|
||||
self.parent.clear_screenshot()
|
||||
self.multiple_figure_dict = fig_data
|
||||
|
||||
for i, key in enumerate(self.multiple_figure_dict.keys()):
|
||||
self.canvas_fig_dict[i] = key
|
||||
|
||||
|
||||
for i, (canvas, nav, wgt, layout, key) in enumerate(
|
||||
zip(self.canvas, self.nav,
|
||||
self.sub_results_wgt,
|
||||
self.sub_results_layout,
|
||||
self.multiple_figure_dict.keys())):
|
||||
|
||||
|
||||
|
||||
if canvas is not None:
|
||||
layout.removeWidget(canvas)
|
||||
canvas.deleteLater()
|
||||
@@ -1448,7 +1625,7 @@ class GUIFrame(QWidget):
|
||||
emboss()
|
||||
self.prepare_qcheckbox(line, value, link, title, inner_key)
|
||||
line.stateChanged.connect(check_cb)
|
||||
line.stateChanged.emit(bool(value))
|
||||
line.stateChanged.emit(bool(value))
|
||||
elif "QComboBox" in wgt_type:
|
||||
line = QComboBox()
|
||||
label = add_label()
|
||||
@@ -1472,7 +1649,7 @@ class GUIFrame(QWidget):
|
||||
start_idx = 0
|
||||
rblist[start_idx].setChecked(True)
|
||||
rblist[start_idx].toggled.emit(True)
|
||||
|
||||
|
||||
icol = 0
|
||||
icolspan = 3
|
||||
if label:
|
||||
@@ -1494,7 +1671,8 @@ class GUIFrame(QWidget):
|
||||
itab += 1
|
||||
qtab_widget.qtab_widget_dict = qtab_widget_dict
|
||||
|
||||
meas_label = QLabel(text)
|
||||
|
||||
meas_label = QLabel()
|
||||
meas_label.setFixedHeight(24)
|
||||
meas_label.setFont(self.font_pts10)
|
||||
meas_label.setContentsMargins(5, 0, 0, 0)
|
||||
@@ -1515,14 +1693,29 @@ class GUIFrame(QWidget):
|
||||
qtab_widget.setCurrentIndex(_default_idx)
|
||||
qtab_widget.currentChanged.emit(_default_idx)
|
||||
|
||||
|
||||
final_wgt = QWidget()
|
||||
final_lo = QGridLayout()
|
||||
|
||||
final_lo.addWidget(meas_label, 0, 0, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
final_lo.addWidget(meas_line, 0, 2, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
qHLine = QHLine()
|
||||
qHLine.setFixedHeight(10)
|
||||
final_lo.addWidget(qHLine, 1, 0, 1, 4)
|
||||
final_lo.addWidget(qtab_widget, 2, 0, 1, 4, Qt.AlignHCenter | Qt.AlignVCenter)
|
||||
#final_lo.setSpacing(0)
|
||||
final_wgt.setLayout(final_lo)
|
||||
|
||||
|
||||
'''
|
||||
wgt_grid.addWidget(meas_label, irow, 0, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(meas_line, irow, 2, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
qHLine = QHLine()
|
||||
qHLine.setFixedHeight(10)
|
||||
wgt_grid.addWidget(qHLine, irow+1, 0, 1, 4)
|
||||
wgt_grid.addWidget(qtab_widget, irow+2, 0, 1, 4, Qt.AlignHCenter | Qt.AlignVCenter)
|
||||
|
||||
return qtab_widget
|
||||
'''
|
||||
return final_wgt #qtab_widget #
|
||||
|
||||
|
||||
def pv_stacked_wgt(self, pvlist, title, default_value, key, object_name):
|
||||
@@ -1654,7 +1847,6 @@ class GUIFrame(QWidget):
|
||||
if flag:
|
||||
grid.addWidget(radio, irow, 0)
|
||||
|
||||
|
||||
if monitor:
|
||||
ql = QLabel(radiobutton_title[0])
|
||||
ql.setFont(self.font_pts10)
|
||||
@@ -1764,10 +1956,8 @@ class GUIFrame(QWidget):
|
||||
|
||||
if monitor:
|
||||
radio_buddy_text_dict[radiobutton_list[0]] = monitor_pv
|
||||
|
||||
if read:
|
||||
radio_buddy_text_dict[radiobutton_list[1]] = read_pv
|
||||
|
||||
if manual:
|
||||
radio_buddy_text_dict[radiobutton_list[2]] = manual_wgt
|
||||
|
||||
@@ -1779,12 +1969,25 @@ class GUIFrame(QWidget):
|
||||
|
||||
return group_box, radiobutton_list
|
||||
|
||||
|
||||
def input_wgt_logging(self, irow, wgt_grid):
|
||||
tooltip = "Select logging level, CRITICAL=50, NOTSET=0"
|
||||
value = ['CRITICAL', 'ERROR', 'WARNING', 'INFO', 'DEBUG', 'NOTSET']
|
||||
label = QLabel("Logging level:")
|
||||
label.setFixedHeight(24)
|
||||
label.setFont(self.font_pts10)
|
||||
label.setContentsMargins(5, 0, 0, 0)
|
||||
return self.input_wgt_qcombobox(label, "loggingLevel", value, irow, wgt_grid)
|
||||
|
||||
|
||||
def input_wgt_qcombobox(self, label, key, value, irow, wgt_grid):
|
||||
suggested = "WW"
|
||||
if key in self.settings.data["Expert"].keys():
|
||||
top_key = "Expert"
|
||||
elif key in self.settings.data["Parameters"].keys():
|
||||
top_key = "Parameters"
|
||||
else:
|
||||
top_key = "Expert"
|
||||
|
||||
def combo_cb(new_text):
|
||||
self.input_parameters[key] = new_text
|
||||
@@ -1802,25 +2005,45 @@ class GUIFrame(QWidget):
|
||||
param_width = max(fm.width(str(value_for_width)), fm.width(suggested))
|
||||
line.setFixedWidth(param_width + 56)
|
||||
line.setObjectName("Write")
|
||||
|
||||
|
||||
if "layout" in self.settings.data[top_key][key]['data']:
|
||||
if "VERT" in self.settings.data[top_key][key]['data'][
|
||||
'layout'].upper():
|
||||
if key in self.settings.data[top_key]:
|
||||
if "layout" in self.settings.data[top_key][key]['data']:
|
||||
if "VERT" in self.settings.data[top_key][key]['data'][
|
||||
'layout'].upper():
|
||||
box = QVBoxLayout()
|
||||
label.setAlignment(Qt.AlignBottom)
|
||||
else:
|
||||
box = QHBoxLayout()
|
||||
label.setAlignment(Qt.AlignCenter)
|
||||
else:
|
||||
box = QVBoxLayout()
|
||||
label.setAlignment(Qt.AlignBottom)
|
||||
else:
|
||||
box = QHBoxLayout()
|
||||
label.setAlignment(Qt.AlignCenter)
|
||||
else:
|
||||
box = QVBoxLayout()
|
||||
label.setAlignment(Qt.AlignBottom)
|
||||
box = QHBoxLayout()
|
||||
label.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
|
||||
box.setAlignment(Qt.AlignCenter)
|
||||
|
||||
box.addWidget(label)
|
||||
box.addWidget(line)
|
||||
|
||||
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
b = self.grid_loc[1]
|
||||
c = self.grid_loc[2]
|
||||
d = self.grid_loc[3]
|
||||
else:
|
||||
a = irow
|
||||
b = 0
|
||||
c = 1
|
||||
d = 3
|
||||
|
||||
wgt_grid.addLayout(box, irow, 0, 1, 3, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
|
||||
return line
|
||||
if 'loggingLevel' not in key:
|
||||
wgt_grid.addLayout(box, a, b, c, d,
|
||||
Qt.AlignLeft | Qt.AlignVCenter)
|
||||
|
||||
return box if 'loggingLevel' in key else line
|
||||
|
||||
def input_wgt_qradiobutton(self, key, value, irow, wgt_grid):
|
||||
def on_radiobutton_change(new_value):
|
||||
@@ -1862,7 +2085,20 @@ class GUIFrame(QWidget):
|
||||
for rb in rblist:
|
||||
rb.toggled.connect(on_radiobutton_change)
|
||||
|
||||
wgt_grid.addWidget(line, irow, 0, 1, 4, Qt.AlignLeft)
|
||||
|
||||
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
b = self.grid_loc[1]
|
||||
c = self.grid_loc[2]
|
||||
d = self.grid_loc[3]
|
||||
else:
|
||||
a = irow
|
||||
b = 0
|
||||
c = 1
|
||||
d = 4
|
||||
|
||||
wgt_grid.addWidget(line, a, b, c, d, Qt.AlignLeft)
|
||||
|
||||
_idx=0
|
||||
|
||||
@@ -1904,7 +2140,8 @@ class GUIFrame(QWidget):
|
||||
|
||||
col_wdt = 4
|
||||
try:
|
||||
orientation = self.settings.data[top_key][key]["data"]["orientation"]
|
||||
orientation = self.settings.data[top_key][key]["data"][
|
||||
"orientation"]
|
||||
orientation = Qt.RightToLeft if "RightToLeft" in orientation \
|
||||
else Qt.LeftToRight
|
||||
line.setLayoutDirection(orientation)
|
||||
@@ -1912,7 +2149,20 @@ class GUIFrame(QWidget):
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
wgt_grid.addWidget(line, irow, 0, 1, col_wdt, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
b = self.grid_loc[1]
|
||||
c = self.grid_loc[2]
|
||||
d = self.grid_loc[3]
|
||||
else:
|
||||
a = irow
|
||||
b = 0
|
||||
c = 1
|
||||
d = col_wdt
|
||||
|
||||
wgt_grid.addWidget(line, a, b, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
|
||||
|
||||
|
||||
return line
|
||||
|
||||
@@ -1927,30 +2177,74 @@ class GUIFrame(QWidget):
|
||||
fm = QFontMetricsF(line.font())
|
||||
param_width = max(fm.width(str(value)), fm.width(suggested))
|
||||
line.setMaximumWidth(param_width + 40)
|
||||
wgt_grid.addWidget(line, irow, 0, 1, 4)
|
||||
|
||||
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
b = self.grid_loc[1]
|
||||
c = self.grid_loc[2]
|
||||
d = self.grid_loc[3]
|
||||
else:
|
||||
a = irow
|
||||
b = 0
|
||||
c = 1
|
||||
d = 4
|
||||
wgt_grid.addWidget(line, a, b, c, d)
|
||||
|
||||
|
||||
return line
|
||||
|
||||
def input_wgt_qlineread(self, key, value, label, irow, wgt_grid):
|
||||
def line_cb(new_value):
|
||||
self.parent.input_parameters[key] = new_value
|
||||
#print("NEW VALUE FROM BASE GUI FRAME", new_value)
|
||||
suggested = "WW"
|
||||
line = QLineEdit()
|
||||
line.setObjectName("Read")
|
||||
line.setText(str(value)) #"{0: 3.1f}".format(value))
|
||||
line.setFixedHeight(24)
|
||||
line.setFixedHeight(26)
|
||||
line.textChanged.connect(line_cb)
|
||||
#line.textEdited.connect(line_cb)
|
||||
line.textChanged.emit(str(value))
|
||||
|
||||
|
||||
line.setAlignment(Qt.AlignRight | Qt.AlignBottom)
|
||||
line.setStyleSheet("QLabel{text-align: right}")
|
||||
fm = QFontMetricsF(line.font())
|
||||
param_width = max(fm.width(str(value)), fm.width(suggested))
|
||||
extra_width = 22 if len(str(value)) < 16 else 26
|
||||
line.setFixedWidth(param_width + extra_width)
|
||||
|
||||
|
||||
try:
|
||||
w =self.settings.data["Parameters"][key]["data"]["width"]
|
||||
line.setFixedWidth(w)
|
||||
except KeyError:
|
||||
fm = QFontMetricsF(line.font())
|
||||
param_width = max(fm.width(str(value)), fm.width(suggested))
|
||||
extra_width = 22 if len(str(value)) < 16 else 26
|
||||
line.setFixedWidth(param_width + extra_width)
|
||||
|
||||
qframe_buffer = QFrame()
|
||||
qframe_buffer.setFixedWidth(3)
|
||||
wgt_grid.addWidget(label, irow, 0, 1, 1, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(qframe_buffer, irow, 1, 1, 1, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(line, irow, 2, 1, 1, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
|
||||
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
b = self.grid_loc[1]
|
||||
c = self.grid_loc[2]
|
||||
d = self.grid_loc[3]
|
||||
else:
|
||||
a = irow
|
||||
b = 0
|
||||
c = 1
|
||||
d = 1
|
||||
|
||||
wgt_grid.addWidget(label, a, b, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(qframe_buffer, a, b+1, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(line, a, b+2, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
#wgt_grid.addWidget(label, irow, self.input_wgt_grid_column, 1, 1,
|
||||
# Qt.AlignLeft | Qt.AlignVCenter)
|
||||
#wgt_grid.addWidget(qframe_buffer, irow, self.input_wgt_grid_column+1,
|
||||
# 1, 1, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
#wgt_grid.addWidget(line, irow, self.input_wgt_grid_column+2, 1, 1,
|
||||
# Qt.AlignLeft | Qt.AlignVCenter)
|
||||
|
||||
return line
|
||||
|
||||
@@ -1970,9 +2264,23 @@ class GUIFrame(QWidget):
|
||||
extra_width = 22 if len(str(value)) < 16 else 26
|
||||
line.setFixedWidth(param_width + extra_width)
|
||||
|
||||
|
||||
wgt_grid.addWidget(label, irow, 0, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(line, irow, 2, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
b = self.grid_loc[1]
|
||||
c = self.grid_loc[2]
|
||||
d = self.grid_loc[3]
|
||||
else:
|
||||
a = irow
|
||||
b = 0
|
||||
c = 1
|
||||
d = 2
|
||||
|
||||
wgt_grid.addWidget(label, a, b, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(line, a, b+2, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
|
||||
#wgt_grid.addWidget(label, irow, self.input_wgt_grid_column, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
#wgt_grid.addWidget(line, irow, self.input_wgt_grid_column+2, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
|
||||
return line
|
||||
|
||||
@@ -2004,9 +2312,22 @@ class GUIFrame(QWidget):
|
||||
fm = QFontMetricsF(line.font())
|
||||
param_width = max(fm.width(str(decimal)), fm.width(suggested))
|
||||
line.setMaximumWidth(param_width + 40)
|
||||
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
b = self.grid_loc[1]
|
||||
c = self.grid_loc[2]
|
||||
d = self.grid_loc[3]
|
||||
else:
|
||||
a = irow
|
||||
b = 0
|
||||
c = 1
|
||||
d = 2
|
||||
|
||||
wgt_grid.addWidget(label, irow, 0, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(line, irow, 2, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(label, a, b, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(line, a, b+2, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
#wgt_grid.addWidget(label, irow, self.input_wgt_grid_column, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
#wgt_grid.addWidget(line, irow, self.input_wgt_grid_column+2, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
|
||||
return line
|
||||
|
||||
@@ -2037,8 +2358,23 @@ class GUIFrame(QWidget):
|
||||
param_width = max(fm.width(str(max_val)), fm.width(suggested))
|
||||
line.setMaximumWidth(param_width + 40)
|
||||
|
||||
wgt_grid.addWidget(label, irow, 0, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(line, irow, 2, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
b = self.grid_loc[1]
|
||||
c = self.grid_loc[2]
|
||||
d = self.grid_loc[3]
|
||||
else:
|
||||
a = irow
|
||||
b = 0
|
||||
c = 1
|
||||
d = 2
|
||||
|
||||
wgt_grid.addWidget(label, a, b, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(line, a, b+2, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
|
||||
#wgt_grid.addWidget(label, irow, self.input_wgt_grid_column, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
#wgt_grid.addWidget(line, irow, self.input_wgt_grid_column+2, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
|
||||
return line
|
||||
|
||||
@@ -2049,9 +2385,27 @@ class GUIFrame(QWidget):
|
||||
qframe_bottom = QFrame()
|
||||
qframe_bottom.setFixedHeight(3)
|
||||
|
||||
wgt_grid.addWidget(qframe_top, irow, 0, 1, 4)
|
||||
wgt_grid.addWidget(stacked_wgt, irow+1, 0, 1, 4)
|
||||
wgt_grid.addWidget(qframe_bottom, irow+2, 0, 1, 4)
|
||||
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
b = self.grid_loc[1]
|
||||
c = self.grid_loc[2]
|
||||
d = self.grid_loc[3]
|
||||
else:
|
||||
a = irow
|
||||
b = 0
|
||||
c = 1
|
||||
d = 4
|
||||
|
||||
wgt_grid.addWidget(qframe_top, a, b, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(stacked_wgt, a+1, b, c+3, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(qframe_bottom, a+2, b, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
|
||||
#wgt_grid.addWidget(qframe_top, irow, self.input_wgt_grid_column, 1, 4)
|
||||
#wgt_grid.addWidget(stacked_wgt, irow+1,
|
||||
# self.input_wgt_grid_column, 5, 4)
|
||||
#wgt_grid.addWidget(qframe_bottom, irow+2,
|
||||
# self.input_wgt_grid_column, 1, 4)
|
||||
|
||||
return stacked_wgt
|
||||
|
||||
@@ -2062,30 +2416,91 @@ class GUIFrame(QWidget):
|
||||
qframe_bottom = QFrame()
|
||||
qframe_bottom.setFixedHeight(3)
|
||||
|
||||
wgt_grid.addWidget(qframe_top, irow, 0, 1, 4)
|
||||
wgt_grid.addWidget(stacked_wgt, irow+1, 0, 1, 4)
|
||||
wgt_grid.addWidget(qframe_bottom, irow+2, 0, 1, 4)
|
||||
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
b = self.grid_loc[1]
|
||||
c = self.grid_loc[2]
|
||||
d = self.grid_loc[3]
|
||||
else:
|
||||
a = irow
|
||||
b = 0
|
||||
c = 1
|
||||
d = 4
|
||||
|
||||
|
||||
wgt_grid.addWidget(qframe_top, a, b, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(stacked_wgt, a+1, b, c+3, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(qframe_bottom, a+2, b, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
|
||||
#wgt_grid.addWidget(qframe_top, irow, self.input_wgt_grid_column, 1, 4)
|
||||
#wgt_grid.addWidget(stacked_wgt, irow+1,
|
||||
# self.input_wgt_grid_column, 1, 4)
|
||||
#wgt_grid.addWidget(qframe_bottom, irow+2,
|
||||
# self.input_wgt_grid_column, 1, 4)
|
||||
|
||||
return stacked_wgt
|
||||
|
||||
def input_wgt_qhline(self, irow, wgt_grid):
|
||||
qHLine = QHLine()
|
||||
qHLine.setFixedHeight(10)
|
||||
wgt_grid.addWidget(qHLine, irow, 0, 1, 4)
|
||||
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
b = self.grid_loc[1]
|
||||
c = self.grid_loc[2]
|
||||
d = self.grid_loc[3]
|
||||
else:
|
||||
a = irow
|
||||
b = 0
|
||||
c = 1
|
||||
d = 4
|
||||
wgt_grid.addWidget(qHLine, a, b, c, d)
|
||||
#wgt_grid.addWidget(qHLine, irow, self.input_wgt_grid_column, 1, 4)
|
||||
|
||||
def input_wgt_qvline(self, irow, wgt_grid):
|
||||
qVLine = QVLine()
|
||||
|
||||
qVLine.setFixedWidth(20)
|
||||
print("ROW COUNT =======================================", wgt_grid.rowCount())
|
||||
qVLine.setFixedHeight(17 * wgt_grid.rowCount())
|
||||
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
b = self.grid_loc[1]
|
||||
c = self.grid_loc[2]
|
||||
d = self.grid_loc[3]
|
||||
else:
|
||||
a = irow
|
||||
b = 0
|
||||
c = 1
|
||||
d = 4
|
||||
|
||||
wgt_grid.addWidget(qVLine, a, b, c, d)
|
||||
|
||||
#wgt_grid.addWidget(qVLine, irow, self.input_wgt_grid_column, 1, 4)
|
||||
|
||||
def input_wgt_frame(self, irow, wgt_grid):
|
||||
qFrame = QFrame()
|
||||
qFrame.setFixedHeight(10)
|
||||
wgt_grid.addWidget(qFrame, irow, 0, 1, 4)
|
||||
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
b = self.grid_loc[1]
|
||||
c = self.grid_loc[2]
|
||||
d = self.grid_loc[3]
|
||||
else:
|
||||
a = irow
|
||||
b = 0
|
||||
c = 1
|
||||
d = 4
|
||||
wgt_grid.addWidget(qHLine, a, b, c, d)
|
||||
|
||||
#wgt_grid.addWidget(qFrame, irow, self.input_wgt_grid_column, 1, 4)
|
||||
|
||||
|
||||
def input_wgt(self, buddy, label, key, value, irow=0, wgt_grid=None,):
|
||||
|
||||
if "QVLINE" in buddy:
|
||||
print("QVLine", label, key, value)
|
||||
|
||||
|
||||
if wgt_grid is None:
|
||||
wgt_grid = self.input_wgt_grid
|
||||
|
||||
@@ -2131,17 +2546,21 @@ class GUIFrame(QWidget):
|
||||
elif buddy == "QHLine".upper():
|
||||
self.input_wgt_qhline(irow, wgt_grid)
|
||||
|
||||
elif buddy == "QVLine".upper():
|
||||
self.input_wgt_qvline(irow, wgt_grid)
|
||||
|
||||
elif buddy == "QFrame".upper():
|
||||
self.input_wgt_qframe(irow, wgt_grid)
|
||||
|
||||
elif buddy == "QTabWidget".upper():
|
||||
#print("buddy/label", buddy, label, key, value, flush=True)
|
||||
line = self.qtab_wgt(key, irow, wgt_grid)
|
||||
|
||||
wgt_grid.addWidget(line, irow, 0, 1, 4,
|
||||
Qt.AlignLeft | Qt.AlignVCenter)
|
||||
else:
|
||||
wgt_list = ["QCheckBox", "QComboBox", "QDoubleSpinBox", "QFrame",
|
||||
"QHLine", "QLabel", "QLineEdit", "QLineRead",
|
||||
"QRadioButton", "QSpinBox", "QTabWidget",
|
||||
"QRadioButton", "QSpinBox", "QTabWidget","QVLine",
|
||||
"QPhaseStackedWidget", "QEnergyStackedWidget"]
|
||||
print("Widget {0} is not Supported".format(buddy))
|
||||
print("Supported widgets are: {0}".format(wgt_list))
|
||||
@@ -2183,20 +2602,40 @@ class GUIFrame(QWidget):
|
||||
flag = self.settings.data["Parameters"][key]["flag"]
|
||||
if buddy == "NONE":
|
||||
return False
|
||||
elif buddy not in ["QHLINE", "QFRAME"] and not flag:
|
||||
elif buddy not in ["QHLINE", "QVLINE", "QFRAME"] and not flag:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
|
||||
|
||||
##in_j = 0
|
||||
|
||||
for (key, val), label in zip(self.all_input_parameters.items(),
|
||||
self.all_input_labels.values()):
|
||||
buddy = self.settings.data[
|
||||
"Parameters"][key]["data"]["widget"].upper()
|
||||
j = self.input_wgt_grid.rowCount()
|
||||
##if j > 4:
|
||||
## self.input_wgt_grid_column = 6
|
||||
## in_j += 1
|
||||
##else:
|
||||
## in_j = j
|
||||
#if buddy != "NONE":
|
||||
self.grid_loc = None
|
||||
if "useGrid" in self.settings.data:
|
||||
if self.settings.data["useGrid"]:
|
||||
if 'grid' in self.settings.data["Parameters"][key]["data"]:
|
||||
self.grid_loc = self.settings.data["Parameters"][key]["data"]["grid"]
|
||||
|
||||
|
||||
if draw_widget(buddy):
|
||||
self.input_wgt(buddy=buddy, label=label, key=key, value=val,
|
||||
irow=j, wgt_grid=self.input_wgt_grid)
|
||||
|
||||
##if j == 4:
|
||||
## in_j = 1
|
||||
##self.input_wgt_grid.setHorizontalSpacing(10)
|
||||
self.operator_parameters_group.layout().addLayout(self.input_wgt_grid)
|
||||
self.operator_parameters_group.setMinimumHeight(INPUT_PARAMETERS_HEIGHT)
|
||||
|
||||
@@ -2214,14 +2653,19 @@ class GUIFrame(QWidget):
|
||||
row_count = 0
|
||||
|
||||
if self.has_procedure:
|
||||
lo.addWidget(self.analysis_procedure_group(), row_count, 1)
|
||||
|
||||
if 'V' in self.orientation_procedure.upper():
|
||||
lo.addWidget(self.analysis_procedure_group(), row_count, 1, 1, 1)
|
||||
else:
|
||||
lo.addWidget(self.analysis_procedure_group(), lo.rowCount(), 0, 1, 1)
|
||||
|
||||
#Centers input parameters group box
|
||||
lo.setAlignment(Qt.AlignHCenter | Qt.AlignTop)
|
||||
lo.setHorizontalSpacing(20)
|
||||
lo.setVerticalSpacing(40)
|
||||
lo.setVerticalSpacing(10)
|
||||
self.operator_wgt.setLayout(lo)
|
||||
|
||||
|
||||
|
||||
|
||||
#expert
|
||||
self.expert_parameters_group = self.expert_parameters_groupbox()
|
||||
@@ -2229,6 +2673,12 @@ class GUIFrame(QWidget):
|
||||
for (key, val), label in zip(self.all_expert_parameters.items(),
|
||||
self.all_expert_labels.values()):
|
||||
|
||||
self.grid_loc = None
|
||||
if "useGrid" in self.settings.data:
|
||||
if self.settings.data["useGrid"]:
|
||||
if 'grid' in self.settings.data["Expert"][key]["data"]:
|
||||
self.grid_loc = self.settings.data["Expert"][key]["data"]["grid"]
|
||||
|
||||
buddy = self.settings.data[
|
||||
"Expert"][key]["data"]["widget"].upper()
|
||||
j = self.expert_wgt_grid.rowCount()
|
||||
@@ -2275,20 +2725,39 @@ class GUIFrame(QWidget):
|
||||
self.expert_parameters_group.layout().addWidget(
|
||||
self.checkbox_keepImages())
|
||||
|
||||
|
||||
|
||||
|
||||
##self.expert_parameters_group.layout().addWidget(QHLine())
|
||||
#hbox2.addWidget(self.checkbox_debug(hline="None"))
|
||||
#hbox2.addWidget(self.checkbox_simulation(hline="None"))
|
||||
|
||||
hbox2 = QHBoxLayout()
|
||||
hbox2.addWidget(self.checkbox_debug(hline="None"))
|
||||
hbox2.addWidget(self.checkbox_simulation(hline="None"))
|
||||
self.expert_parameters_group.layout().addLayout(hbox2)
|
||||
_matches = ["debug", "debugLevel", "simulation"]
|
||||
match = False
|
||||
|
||||
#if "debug" in self.parent.input_parameters.keys():
|
||||
# self.expert_parameters_group.layout().addWidget(
|
||||
# self.checkbox_debug(hline="TOP"))
|
||||
for tag in _matches:
|
||||
if any([x in tag for x in self.parent.input_parameters.keys()]):
|
||||
match = True
|
||||
break
|
||||
|
||||
#if "simulation" in self.parent.input_parameters.keys():
|
||||
# self.expert_parameters_group.layout().addWidget(
|
||||
# self.checkbox_simulation(hline="BOTTOM"))
|
||||
if match:
|
||||
hbox2 = QHBoxLayout()
|
||||
|
||||
if "debug" in self.parent.input_parameters.keys():
|
||||
hbox2.addWidget(self.checkbox_debug(hline="None"))
|
||||
#self.expert_parameters_group.layout().addWidget(
|
||||
# self.checkbox_debug(hline="TOP"))
|
||||
|
||||
if "simulation" in self.parent.input_parameters.keys():
|
||||
hbox2.addWidget(self.checkbox_simulation(hline="None"))
|
||||
#self.expert_parameters_group.layout().addWidget(
|
||||
# self.checkbox_simulation(hline="BOTTOM"))
|
||||
|
||||
self.expert_parameters_group.layout().addLayout(hbox2)
|
||||
|
||||
|
||||
self.expert_parameters_group.layout().addLayout(
|
||||
self.input_wgt_logging(self.expert_wgt_grid.rowCount(), self.expert_wgt_grid))
|
||||
|
||||
self.expert_parameters_group.layout().addWidget(QHLine())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user