Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 73b187b5a8 | |||
| 532e81f165 | |||
| 4babb18676 | |||
| e7118162d4 | |||
| 425c8125d2 | |||
| aeb7e2907f | |||
| b17b3200fc | |||
| aa31b65750 | |||
| 886f7e0972 | |||
| 5fb1d9fe5b | |||
| fcca4f08d4 | |||
| ce700a0c14 | |||
| ac9d3b3e22 | |||
| fd212a441d |
64
base.py
64
base.py
@@ -565,7 +565,13 @@ class BaseWindow(QMainWindow):
|
||||
from pyqtacc.sls.sendelogsls import QSendToELOG
|
||||
elif self.facility == Facility.HIPA:
|
||||
from pyqtacc.hipa.guiheader import GUIHeader
|
||||
from pyqtacc.hipa.sendeloghipa import QSendToELOG
|
||||
from pyqtacc.hipa.sendeloghipa import QSendToELOG
|
||||
elif self.facility == Facility.PROSCAN:
|
||||
from pyqtacc.proscan.guiheader import GUIHeader
|
||||
from pyqtacc.proscan.sendelogproscan import QSendToELOG
|
||||
elif self.facility == Facility.ESS:
|
||||
from pyqtacc.ess.guiheader import GUIHeader
|
||||
from pyqtacc.ess.sendelogess import QSendToELOG
|
||||
|
||||
self.gui_header = GUIHeader(self, user_mode=self.user_mode,
|
||||
extended=extended)
|
||||
@@ -791,10 +797,16 @@ class BaseWindow(QMainWindow):
|
||||
#_qsize = exit_toolbar.iconSize()
|
||||
#print("qsize", _qsize)
|
||||
true_list = [self.autopost_epics, self.autopost_hdf, self.autopost_elog]
|
||||
exit_toolbar.setIconSize(QSize(true_list.count(True)*30+10, 24))
|
||||
#exit_toolbar.setIconSize(_qsize)
|
||||
self.add_actions(exit_toolbar, (save_all_action, "Space", None, "Space",
|
||||
quit_action))
|
||||
|
||||
if true_list.count(True) > 1:
|
||||
exit_toolbar.setIconSize(QSize(true_list.count(True)*30+10, 24))
|
||||
#exit_toolbar.setIconSize(_qsize)
|
||||
self.add_actions(exit_toolbar, (
|
||||
save_all_action, "Space", None, "Space", quit_action))
|
||||
else:
|
||||
self.add_actions(exit_toolbar, (quit_action,))
|
||||
|
||||
|
||||
|
||||
|
||||
def combine_save_icons(self): #epics=False, hdf=False, elog=False):
|
||||
@@ -1999,6 +2011,12 @@ class BaseWindow(QMainWindow):
|
||||
elif facility == Facility.HIPA:
|
||||
from pyqtacc.qrc_resources.facility.hipa.pyrcc5 import qrc_resources
|
||||
print("FACILITY HIPA")
|
||||
elif facility == Facility.PROSCAN:
|
||||
from pyqtacc.qrc_resources.facility.proscan.pyrcc5 import qrc_resources
|
||||
print("FACILITY PROSCAN")
|
||||
elif facility == Facility.ESS:
|
||||
from pyqtacc.qrc_resources.facility.ess.pyrcc5 import qrc_resources
|
||||
print("FACILITY ESS")
|
||||
else:
|
||||
print("Unknown Facility; assuming SLS")
|
||||
from pyqtacc.qrc_resources.facility.sls.pyrcc5 import qrc_resources
|
||||
@@ -2050,7 +2068,8 @@ class BaseWindow(QMainWindow):
|
||||
<p style='color:black; font-weight:bold;
|
||||
font-size:20px; margin-right:22px;'>
|
||||
This message will self-destruct in {1} seconds<br></p>
|
||||
""".format(appname, round(delay)), Qt.AlignCenter | Qt.AlignTop)
|
||||
""".format(appname, round(delay)),
|
||||
Qt.AlignmentFlag(Qt.AlignCenter|Qt.AlignTop))
|
||||
width = 860 + (len(appname)-10)*15
|
||||
height = 220
|
||||
self.splash_screen.resize(width, height)
|
||||
@@ -2104,7 +2123,8 @@ class BaseWindow(QMainWindow):
|
||||
{1:>2} second{2} remaining<br></p>
|
||||
""".format(self.splash_appname, seconds_remaining, sec_str)
|
||||
|
||||
self.splash_screen.showMessage(mess, Qt.AlignCenter|Qt.AlignTop)
|
||||
self.splash_screen.showMessage(
|
||||
mess, Qt.AlignmentFlag(Qt.AlignCenter|Qt.AlignTop))
|
||||
self.processEvents()
|
||||
#print(val, seconds_remaining)
|
||||
|
||||
@@ -2117,7 +2137,7 @@ class BaseWindow(QMainWindow):
|
||||
def initialize_finished(self, myapp):
|
||||
self.splash_timer.stop()
|
||||
self.splash_progressbar.setValue(100)
|
||||
time.sleep(1.5)
|
||||
time.sleep(0.4)
|
||||
#app.processEvents()
|
||||
self.splash_screen.showMessage(
|
||||
"""
|
||||
@@ -2130,7 +2150,8 @@ class BaseWindow(QMainWindow):
|
||||
Ready....
|
||||
|
||||
<br></p>
|
||||
""".format(self.splash_appname), Qt.AlignCenter | Qt.AlignTop)
|
||||
""".format(self.splash_appname),
|
||||
Qt.AlignmentFlag(Qt.AlignCenter | Qt.AlignTop))
|
||||
self.splash_screen.finish(myapp)
|
||||
|
||||
|
||||
@@ -2139,10 +2160,21 @@ class BaseWindow(QMainWindow):
|
||||
operation: str = "channel access",
|
||||
pv_list: list = None, status_list: list = None,
|
||||
line: int = _line()):
|
||||
|
||||
if None in (pv_list, status_list):
|
||||
|
||||
if pv_list is None:
|
||||
return
|
||||
|
||||
check_stat = False
|
||||
if status_list is None:
|
||||
check_stat = True
|
||||
elif None in status_list:
|
||||
check_stat = True
|
||||
if check_stat:
|
||||
for i, (pv, stat) in enumerate(zip(pv_list, status_list)):
|
||||
if stat is None:
|
||||
status_list[i] = self.cafe.getStatus(pv)
|
||||
|
||||
|
||||
brk = ("------------------------------------------------------" +
|
||||
"------------------------------------------------------")
|
||||
self.trigger_log_message.emit(
|
||||
@@ -2151,7 +2183,7 @@ class BaseWindow(QMainWindow):
|
||||
options = {}
|
||||
|
||||
for i, (pv, stat) in enumerate(zip(pv_list, status_list)):
|
||||
if stat == self.cyca.ICAFE_NORMAL:
|
||||
if stat != self.cyca.ICAFE_NORMAL:
|
||||
mess = "Error in '{0}' for element [{1}], {2}.".format(
|
||||
operation, i, pv)
|
||||
options['statusCode'] = (
|
||||
@@ -2170,14 +2202,18 @@ class BaseWindow(QMainWindow):
|
||||
self.trigger_log_message.emit(
|
||||
MsgSeverity.INFO.name, pymodule, line, mess, {})
|
||||
|
||||
return status_list
|
||||
|
||||
|
||||
def check_status(self, pymodule: str = _pymodule,
|
||||
operation: str = "channel access",
|
||||
pv: str = None, stat: int = None,
|
||||
line: int =_line()):
|
||||
|
||||
if None in (pv, status):
|
||||
if not pv:
|
||||
return
|
||||
if stat == None:
|
||||
stat = self.cafe.getStatus(pv)
|
||||
|
||||
if stat != self.cyca.ICAFE_NORMAL:
|
||||
mess = "Error in '{0}' for {1}.".format(operation, pv)
|
||||
@@ -2188,3 +2224,5 @@ class BaseWindow(QMainWindow):
|
||||
options['statusInfo'] = self.cafe.getStatusInfo(stat)
|
||||
self.trigger_log_message.emit(
|
||||
MsgSeverity.WARN.name, pymodule, line, mess, options)
|
||||
|
||||
return stat
|
||||
|
||||
@@ -19,6 +19,8 @@ class Facility(IntEnum):
|
||||
SwissFEL = 1
|
||||
SLS = 2
|
||||
HIPA = 3
|
||||
PROSCAN = 4
|
||||
ESS = 5
|
||||
|
||||
class MsgSeverity(IntEnum):
|
||||
""" For use with message logger
|
||||
|
||||
333
guiframe.py
333
guiframe.py
@@ -118,7 +118,8 @@ class GUIFrame(QWidget):
|
||||
self.measurement_wgt = QWidget()
|
||||
#self.measurement_layout = QHBoxLayout(self.measurement_wgt)
|
||||
self.measurement_layout = QGridLayout(self.measurement_wgt)
|
||||
self.measurement_layout.setAlignment(Qt.AlignLeft | Qt.AlignTop)
|
||||
self.measurement_layout.setAlignment(
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignTop))
|
||||
self.measurement_layout.setSpacing(50)
|
||||
self.measurement_tab_wgt = QTabWidget(self.measurement_wgt)
|
||||
self.measurement_tab_wgt.setMinimumWidth(480)
|
||||
@@ -127,13 +128,22 @@ class GUIFrame(QWidget):
|
||||
self.expert_wgt = QWidget(self.measurement_tab_wgt)
|
||||
|
||||
self.results_wgt = QWidget()
|
||||
self.results_layout = QHBoxLayout(self.results_wgt)
|
||||
self.results_tab_wgt = QTabWidget(self.results_wgt)
|
||||
if "GUI" in self.settings.data:
|
||||
self.results_layout = QHBoxLayout(self.results_wgt)
|
||||
self.results_tab_wgt = QTabWidget(self.results_wgt)
|
||||
else:
|
||||
self.results_layout = QGridLayout()
|
||||
self.results_tab_wgt = QTabWidget()
|
||||
|
||||
self.results_wgt_2 = QWidget()
|
||||
self.results_layout_2 = QHBoxLayout(self.results_wgt_2)
|
||||
self.results_tab_wgt_2 = QTabWidget(self.results_wgt_2)
|
||||
|
||||
|
||||
if "GUI2" in self.settings.data:
|
||||
self.results_layout_2 = QHBoxLayout(self.results_wgt_2)
|
||||
self.results_tab_wgt_2 = QTabWidget(self.results_wgt_2)
|
||||
else:
|
||||
self.results_layout_2 = QGridLayout()
|
||||
self.results_tab_wgt_2 = QTabWidget()
|
||||
|
||||
self.slicing_group = QGroupBox("Screen: Slicing")
|
||||
self.good_region_group = QGroupBox("Good Region")
|
||||
|
||||
@@ -403,6 +413,9 @@ class GUIFrame(QWidget):
|
||||
if "GUI" in self.settings.data:
|
||||
self.central_tab_widget.addTab(
|
||||
self.results_wgt, self.settings.data["GUI"]["resultsTabTitle"])
|
||||
elif "IOC" in self.settings.data:
|
||||
self.central_tab_widget.addTab(
|
||||
self.results_wgt, self.settings.data["IOC"]["resultsTabTitle"])
|
||||
self.central_tab_widget.addTab(self.log_wgt, "Log")
|
||||
|
||||
def init_measurement_tab_wgt(self):
|
||||
@@ -416,7 +429,7 @@ class GUIFrame(QWidget):
|
||||
def init_results_tab_wgt(self):
|
||||
""" Add canvas tabs for plots/results
|
||||
"""
|
||||
|
||||
|
||||
self.results_tab_wgt.setFont(self.font_gui)
|
||||
|
||||
for i, (wgt, subtitle) in enumerate(zip(self.sub_results_wgt,
|
||||
@@ -509,11 +522,11 @@ class GUIFrame(QWidget):
|
||||
vbox.addLayout(self.create_analysis_wgt())
|
||||
vbox.setContentsMargins(9, 19, 9, 9)
|
||||
vbox.setSpacing(5)
|
||||
vbox.setAlignment(Qt.AlignTop | Qt.AlignHCenter)
|
||||
vbox.setAlignment(Qt.AlignmentFlag(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.setAlignment(Qt.AlignmentFlag(Qt.AlignTop|Qt.AlignHCenter))
|
||||
group_box.setLayout(vbox)
|
||||
return group_box
|
||||
|
||||
@@ -525,7 +538,8 @@ class GUIFrame(QWidget):
|
||||
self.optics_group.setMaximumWidth(208)
|
||||
self.optics_group.setMaximumHeight(220)
|
||||
self.optics_group.setFont(self.font_gui)
|
||||
self.optics_group.setAlignment(Qt.AlignTop | Qt.AlignHCenter)
|
||||
self.optics_group.setAlignment(
|
||||
Qt.AlignmentFlag(Qt.AlignTop|Qt.AlignHCenter))
|
||||
self.optics_group.setAlignment(Qt.AlignCenter)
|
||||
self.optics_group.setLayout(self.create_optics_layout())
|
||||
self.optics_group.table = None
|
||||
@@ -544,7 +558,7 @@ class GUIFrame(QWidget):
|
||||
self.output_parameters_group_box.setObjectName("OUTER")
|
||||
vbox = QVBoxLayout()
|
||||
vbox.setContentsMargins(9, 19, 9, 9)
|
||||
vbox.setAlignment(Qt.AlignTop | Qt.AlignHCenter)
|
||||
vbox.setAlignment(Qt.AlignmentFlag(Qt.AlignTop|Qt.AlignHCenter))
|
||||
keys = self.settings.data["Results"].keys()
|
||||
max_str_len = 4
|
||||
for key in keys:
|
||||
@@ -589,8 +603,8 @@ class GUIFrame(QWidget):
|
||||
self.output_parameters_group_box.setMaximumWidth(300)
|
||||
#self.output_parameters_group_box.setMaximumHeight(400)
|
||||
self.output_parameters_group_box.setFont(self.font_gui)
|
||||
self.output_parameters_group_box.setAlignment(Qt.AlignTop |
|
||||
Qt.AlignHCenter)
|
||||
self.output_parameters_group_box.setAlignment(
|
||||
Qt.AlignmentFlag(Qt.AlignTop|Qt.AlignHCenter))
|
||||
|
||||
qf = QFrame()
|
||||
qf.setFixedHeight(35)
|
||||
@@ -612,12 +626,12 @@ class GUIFrame(QWidget):
|
||||
group_box.setObjectName("OUTER")
|
||||
hbox = QVBoxLayout()
|
||||
hbox.setContentsMargins(9, 19, 9, 9)
|
||||
hbox.setAlignment(Qt.AlignTop | Qt.AlignHCenter)
|
||||
hbox.setAlignment(Qt.AlignmentFlag(Qt.AlignTop|Qt.AlignHCenter))
|
||||
group_box.setContentsMargins(0, 0, 0, 0)
|
||||
group_box.setMinimumWidth(200)
|
||||
group_box.setMaximumHeight(400)
|
||||
group_box.setFont(self.font_gui)
|
||||
group_box.setAlignment(Qt.AlignTop | Qt.AlignHCenter)
|
||||
group_box.setAlignment(Qt.AlignmentFlag(Qt.AlignTop|Qt.AlignHCenter))
|
||||
group_box.setLayout(hbox)
|
||||
return group_box
|
||||
|
||||
@@ -699,7 +713,7 @@ class GUIFrame(QWidget):
|
||||
wgt.setSingleStep(step)
|
||||
fm = QFontMetricsF(wgt.font())
|
||||
param_width = max(fm.width(str(decimal)), fm.width(suggested))
|
||||
wgt.setMaximumWidth(param_width + 40)
|
||||
wgt.setMaximumWidth(int(param_width + 40))
|
||||
wgt.valueChanged.connect(callback)
|
||||
wgt.setValue(start_val)
|
||||
wgt.valueChanged.emit(start_val)
|
||||
@@ -734,7 +748,7 @@ class GUIFrame(QWidget):
|
||||
wgt.setSingleStep(step)
|
||||
fm = QFontMetricsF(wgt.font())
|
||||
param_width = max(fm.width(str(decimal)), fm.width(suggested))
|
||||
wgt.setMaximumWidth(param_width + 40)
|
||||
wgt.setMaximumWidth(int(param_width + 40))
|
||||
wgt.valueChanged.connect(cb)
|
||||
wgt.setValue(start_val)
|
||||
wgt.valueChanged.emit(start_val)
|
||||
@@ -778,7 +792,7 @@ class GUIFrame(QWidget):
|
||||
|
||||
fm = QFontMetricsF(wgt.font())
|
||||
param_width = max(fm.width(str(value_for_width)), fm.width(suggested))
|
||||
wgt.setFixedWidth(param_width + 50)
|
||||
wgt.setFixedWidth(int(param_width + 50))
|
||||
|
||||
self.line_sender_dict[key] = wgt
|
||||
|
||||
@@ -803,12 +817,13 @@ class GUIFrame(QWidget):
|
||||
|
||||
self.save_all_wgt = self.save_all_group()
|
||||
|
||||
grid = QVBoxLayout() if 'V' in self.orientation_procedure.upper() else QHBoxLayout()
|
||||
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)
|
||||
grid.setAlignment(Qt.AlignLeft | Qt.AlignTop)
|
||||
grid.setAlignment(Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignTop))
|
||||
|
||||
return grid
|
||||
|
||||
@@ -1013,12 +1028,12 @@ class GUIFrame(QWidget):
|
||||
hbox = QVBoxLayout()
|
||||
hbox.addWidget(self.post_measurement_save_button())
|
||||
hbox.setContentsMargins(9, 19, 9, 9)
|
||||
hbox.setAlignment(Qt.AlignTop | Qt.AlignHCenter)
|
||||
hbox.setAlignment(Qt.AlignmnetFlag(Qt.AlignTop|Qt.AlignHCenter))
|
||||
group_box.setContentsMargins(0, 0, 0, 0)
|
||||
group_box.setFixedWidth(208)
|
||||
group_box.setMaximumHeight(130)
|
||||
group_box.setFont(self.font_gui)
|
||||
group_box.setAlignment(Qt.AlignTop | Qt.AlignHCenter)
|
||||
group_box.setAlignment(Qt.AlignmnetFlag(Qt.AlignTop|Qt.AlignHCenter))
|
||||
group_box.setLayout(hbox)
|
||||
return group_box
|
||||
|
||||
@@ -1033,7 +1048,8 @@ class GUIFrame(QWidget):
|
||||
self.save_all_group_box.setMaximumWidth(160)
|
||||
self.save_all_group_box.setFixedHeight(60)
|
||||
self.save_all_group_box.setFont(self.font_gui)
|
||||
self.save_all_group_box.setAlignment(Qt.AlignTop | Qt.AlignHCenter)
|
||||
self.save_all_group_box.setAlignment(
|
||||
Qt.AlignmentFlag(Qt.AlignTop|Qt.AlignHCenter))
|
||||
self.save_all_group_box.setLayout(hbox)
|
||||
return self.save_all_group_box
|
||||
|
||||
@@ -1041,7 +1057,6 @@ class GUIFrame(QWidget):
|
||||
def image_parameters_group(self):
|
||||
self.pipeline_group_box = QGroupBox("Image Pipeline Expert")
|
||||
|
||||
|
||||
box = QHBoxLayout()
|
||||
box.setSpacing(10)
|
||||
try:
|
||||
@@ -1134,7 +1149,7 @@ class GUIFrame(QWidget):
|
||||
layout.addWidget(scale, 1, 1)
|
||||
layout.addWidget(lab_orientation, 2, 0, 1, 2, Qt.AlignBottom)
|
||||
layout.addWidget(self.slice_orientation, 3, 0, 1, 2,
|
||||
Qt.AlignTop | Qt.AlignRight)
|
||||
Qt.AlignmentFlag(Qt.AlignTop|Qt.AlignRight))
|
||||
self.slicing_group.setLayout(layout)
|
||||
|
||||
layout_top = QGridLayout()
|
||||
@@ -1148,9 +1163,9 @@ class GUIFrame(QWidget):
|
||||
|
||||
layout_top.addLayout(box, 1, 0, 1, 2)
|
||||
layout_top.addWidget(self.good_region_group, 2, 0, 1, 1,
|
||||
Qt.AlignHCenter | Qt.AlignTop)
|
||||
Qt.AlignmentFlag(Qt.AlignHCenter|Qt.AlignTop))
|
||||
layout_top.addWidget(self.slicing_group, 2, 1, 1, 1,
|
||||
Qt.AlignCenter | Qt.AlignTop)
|
||||
Qt.AlignmentFlag(Qt.AlignCenter|Qt.AlignTop))
|
||||
layout_top.setHorizontalSpacing(8)
|
||||
self.pipeline_group_box.setLayout(layout_top)
|
||||
self.pipeline_group_box.setFixedHeight(200)
|
||||
@@ -1268,15 +1283,13 @@ class GUIFrame(QWidget):
|
||||
print("KeyError in guiframe.py; def checkbox_simulation:", error)
|
||||
text = "Simulation"
|
||||
|
||||
checkbox = QCheckBox(text)
|
||||
checkbox.setObjectName("Simulation")
|
||||
checkbox.setToolTip(
|
||||
self.simulation_checkbox = QCheckBox(text)
|
||||
self.simulation_checkbox.setObjectName("Simulation")
|
||||
self.simulation_checkbox.setToolTip(
|
||||
"Dry-run only; does not write to EPICS Process Variables")
|
||||
checkbox.setFont(self.font_gui)
|
||||
#checkbox.setStyleSheet(
|
||||
#"QCheckBox::indicator::checked {width=85px; height: 85px;};")
|
||||
|
||||
checkbox.stateChanged.connect(on_change)
|
||||
self.simulation_checkbox.setFont(self.font_gui)
|
||||
|
||||
self.simulation_checkbox.stateChanged.connect(on_change)
|
||||
|
||||
checked_value = Qt.Unchecked
|
||||
if "simulation" in self.parent.input_parameters.keys():
|
||||
@@ -1287,9 +1300,9 @@ class GUIFrame(QWidget):
|
||||
"value"]:
|
||||
checked_value = Qt.Checked
|
||||
|
||||
checkbox.setCheckState(checked_value)
|
||||
self.simulation_checkbox.setCheckState(checked_value)
|
||||
|
||||
layout.addWidget(checkbox, row_wgt, 0)
|
||||
layout.addWidget(self.simulation_checkbox, row_wgt, 0)
|
||||
layout.addWidget(QFrame(), row_wgt, 1, 1, 2)
|
||||
if hline == "BOTTOM":
|
||||
layout.addWidget(QHLine(), row_wgt+1, 0, 1, 3)
|
||||
@@ -1302,7 +1315,7 @@ class GUIFrame(QWidget):
|
||||
arrow_button_widget = QWidget() #self.plot_widget[i])
|
||||
layout = QHBoxLayout()
|
||||
layout.setContentsMargins(0, 0, 0, 0)
|
||||
layout.setAlignment(Qt.AlignLeft|Qt.AlignTop)
|
||||
layout.setAlignment(Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignTop))
|
||||
button_left = QToolButton(arrow_button_widget)
|
||||
button_left.setArrowType(Qt.LeftArrow)
|
||||
button_left.clicked.connect(self.on_toggle_left)
|
||||
@@ -1479,11 +1492,11 @@ class GUIFrame(QWidget):
|
||||
line.setObjectName("Read")
|
||||
line.setFixedHeight(24)
|
||||
line.setText(str(value))
|
||||
line.setAlignment(Qt.AlignRight | Qt.AlignBottom)
|
||||
line.setAlignment(Qt.AlignmentFlag(Qt.AlignRight|Qt.AlignBottom))
|
||||
line.setStyleSheet("QLabel{text-align: right}")
|
||||
fm = QFontMetricsF(line.font())
|
||||
param_width = fm.maxWidth() * (len(str(value))*0.5) + 20
|
||||
line.setMaximumWidth(param_width)
|
||||
line.setMaximumWidth(int(param_width))
|
||||
|
||||
def prepare_qlineedit(self, line, value, link, title, key):
|
||||
has_min = False
|
||||
@@ -1538,11 +1551,8 @@ class GUIFrame(QWidget):
|
||||
line.setFixedHeight(24)
|
||||
line.setText(str(value))
|
||||
fm = QFontMetricsF(line.font())
|
||||
#param_width = fm.width(str(value))
|
||||
#extra_width = 22 if len(str(value)) < 16 else 26
|
||||
#line.setFixedWidth(param_width + extra_width)
|
||||
param_width = fm.maxWidth() * (len(str(value))*0.5) + 20
|
||||
line.setMaximumWidth(param_width)
|
||||
line.setMaximumWidth(int(param_width))
|
||||
return line
|
||||
|
||||
def prepare_qspinbox(self, line, value, link, title, key):
|
||||
@@ -1557,7 +1567,7 @@ class GUIFrame(QWidget):
|
||||
line.setAlignment(Qt.AlignRight) #required
|
||||
fm = QFontMetricsF(line.font())
|
||||
param_width = fm.maxWidth() * (len(str(max_val)) + 0.2)
|
||||
line.setMaximumWidth(param_width)
|
||||
line.setMaximumWidth(int(param_width))
|
||||
return line
|
||||
|
||||
def prepare_qdoublespinbox(self, line, value, link, title, key):
|
||||
@@ -1573,8 +1583,8 @@ class GUIFrame(QWidget):
|
||||
line.setValue(value)
|
||||
line.setAlignment(Qt.AlignRight) #required
|
||||
fm = QFontMetricsF(line.font())
|
||||
param_width = fm.maxWidth() * (len(str(max_val))) # + len(str(step)))
|
||||
line.setMaximumWidth(param_width)
|
||||
param_width = fm.maxWidth() * (len(str(max_val)))
|
||||
line.setMaximumWidth(int(param_width))
|
||||
return line
|
||||
|
||||
def prepare_qcombobox(self, line, value, link, title, key):
|
||||
@@ -1584,8 +1594,8 @@ class GUIFrame(QWidget):
|
||||
line.setObjectName("Write")
|
||||
value_for_width = max(value, key=len)
|
||||
fm = QFontMetricsF(line.font())
|
||||
param_width = fm.maxWidth() * (len(str(value_for_width)) * 0.5) # + len(str(step)))
|
||||
line.setFixedWidth(param_width)
|
||||
param_width = fm.maxWidth() * (len(str(value_for_width)) * 0.5)
|
||||
line.setFixedWidth(int(param_width))
|
||||
|
||||
return line
|
||||
|
||||
@@ -1610,7 +1620,7 @@ class GUIFrame(QWidget):
|
||||
widget = QWidget()
|
||||
layout = QGridLayout()
|
||||
layout.setContentsMargins(5, 0, 5, 20)
|
||||
widget.setMaximumWidth(len(value)*100)
|
||||
widget.setMaximumWidth(int(len(value)*100))
|
||||
|
||||
target_list = value
|
||||
color_list = ["#894961", "teal", "darkblue"]
|
||||
@@ -1745,6 +1755,7 @@ class GUIFrame(QWidget):
|
||||
tab_height +=32
|
||||
wgt_type = param["data"]["widget"]
|
||||
text = param["data"]["text"]
|
||||
|
||||
if "value" in param["data"]:
|
||||
value = param["data"]["value"]
|
||||
elif "link" in param["data"]:
|
||||
@@ -1757,7 +1768,7 @@ class GUIFrame(QWidget):
|
||||
bottom_leaf = self.settings.data[link_list[0]]
|
||||
for link_item in link_list[1:]:
|
||||
bottom_leaf = bottom_leaf[link_item]
|
||||
value = bottom_leaf
|
||||
value = bottom_leaf
|
||||
|
||||
label = None
|
||||
def add_label():
|
||||
@@ -1830,10 +1841,10 @@ class GUIFrame(QWidget):
|
||||
icolspan = 3
|
||||
if label:
|
||||
lo.addWidget(label, _irow, icol, _irowspan, 1,
|
||||
Qt.AlignLeft | Qt.AlignVCenter)
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
icol += 1
|
||||
lo.addWidget(line, _irow, icol, _irowspan, icolspan,
|
||||
Qt.AlignLeft | Qt.AlignVCenter)
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
#print(title, tab)
|
||||
#print(key, line, icolumn, wgt_type, text, flush=True)
|
||||
_irow += 1
|
||||
@@ -1858,11 +1869,8 @@ class GUIFrame(QWidget):
|
||||
meas_line.setObjectName("Read")
|
||||
|
||||
fm = QFontMetricsF(meas_line.font())
|
||||
#param_width = fm.width(longest_title)
|
||||
#extra_width = 22 if len(str(value)) < 15 else 28
|
||||
#meas_line.setFixedWidth(param_width + extra_width)
|
||||
param_width = fm.maxWidth() * len(longest_title)
|
||||
meas_line.setMaximumWidth(param_width*0.5)
|
||||
meas_line.setMaximumWidth(int(param_width*0.5))
|
||||
|
||||
qtab_widget.setContentsMargins(0, 40, 0, 0)
|
||||
qtab_widget.currentChanged.connect(on_tab_change)
|
||||
@@ -1874,24 +1882,19 @@ class GUIFrame(QWidget):
|
||||
final_wgt = QWidget()
|
||||
final_lo = QGridLayout()
|
||||
final_wgt.setContentsMargins(0, 0, 0, 0)
|
||||
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)
|
||||
final_lo.addWidget(meas_label, 0, 0, 1, 2,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
final_lo.addWidget(meas_line, 0, 2, 1, 2,
|
||||
Qt.AlignmentFlag(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.AlignLeft | Qt.AlignVCenter)
|
||||
#final_lo.setSpacing(0)
|
||||
final_lo.addWidget(qtab_widget, 2, 0, 1, 4,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
|
||||
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 final_wgt #qtab_widget #
|
||||
|
||||
|
||||
@@ -2034,14 +2037,14 @@ class GUIFrame(QWidget):
|
||||
ql = QLabel(radiobutton_title[0])
|
||||
ql.setFont(self.font_pts10)
|
||||
ql.setFixedHeight(self.widget_height)
|
||||
ql.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
|
||||
ql.setAlignment(Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
grid.addWidget(ql, 0, 1)
|
||||
|
||||
if manual:
|
||||
ql = QLabel(radiobutton_title[2])
|
||||
ql.setFont(self.font_pts10)
|
||||
ql.setFixedHeight(self.widget_height)
|
||||
ql.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
|
||||
ql.setAlignment(Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
grid.addWidget(ql, 2, 1)
|
||||
|
||||
def mon_cb(handle, pvname, pvdata):
|
||||
@@ -2056,7 +2059,8 @@ class GUIFrame(QWidget):
|
||||
monitor_pv = CAQLabel(self, pv_name=pv, monitor_callback=mon_cb,
|
||||
show_units=True)
|
||||
|
||||
monitor_pv.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
|
||||
monitor_pv.setAlignment(
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
monitor_pv.setFont(self.font_pts10)
|
||||
monitor_pv.setFixedHeight(self.widget_height)
|
||||
monitor_pv.setFixedWidth(122)
|
||||
@@ -2065,10 +2069,7 @@ class GUIFrame(QWidget):
|
||||
if read:
|
||||
read_pv = CAQLabel(self, pv_name=pv, pv_within_daq_group=True,
|
||||
color_mode="static", show_units=True)
|
||||
read_pv.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
|
||||
#read_pv.setObjectName("Readback")
|
||||
#read_pv.setProperty("static", True)
|
||||
#read_pv.setStyleSheet('background-color: rgb(255, 255,223)')
|
||||
read_pv.setAlignment(Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
read_pv.setFont(self.font_pts10)
|
||||
init_value = self.cafe.getCache(pv)
|
||||
|
||||
@@ -2115,26 +2116,27 @@ class GUIFrame(QWidget):
|
||||
manual_wgt = QLineEdit(str(manual_value))
|
||||
manual_wgt.setObjectName("WriteCenter")
|
||||
manual_wgt.textChanged.connect(update_manual_value)
|
||||
manual_wgt.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
|
||||
manual_wgt.setAlignment(
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
manual_wgt.setFixedHeight(self.widget_height)
|
||||
manual_wgt.setFixedWidth(74)
|
||||
grid.addWidget(manual_wgt, 2, 2)
|
||||
ql = QLabel(self.cafe.getUnits(pv))
|
||||
ql.setFont(self.font_pts10)
|
||||
ql.setFixedHeight(self.widget_height)
|
||||
ql.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
|
||||
ql.setAlignment(Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
grid.addWidget(ql, 2, 3)
|
||||
|
||||
grid.setContentsMargins(5, 10, 5, 0)
|
||||
#grid.setContentsMargins(9, 15, 9, 0)
|
||||
grid.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
|
||||
grid.setAlignment(Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
grid.setVerticalSpacing(2)
|
||||
grid.setHorizontalSpacing(4)
|
||||
group_box.setContentsMargins(0, 0, 0, 0)
|
||||
group_box.setMaximumWidth(280)
|
||||
group_box.setMaximumHeight(320)
|
||||
group_box.setFont(self.font_pts10)
|
||||
group_box.setAlignment(Qt.AlignTop | Qt.AlignHCenter)
|
||||
group_box.setAlignment(Qt.AlignmentFlag(Qt.AlignTop|Qt.AlignHCenter))
|
||||
group_box.setLayout(grid)
|
||||
|
||||
if monitor:
|
||||
@@ -2190,7 +2192,7 @@ class GUIFrame(QWidget):
|
||||
|
||||
fm = QFontMetricsF(line.font())
|
||||
param_width = max(fm.width(str(value_for_width)), fm.width(suggested))
|
||||
line.setFixedWidth(param_width + 56)
|
||||
line.setFixedWidth(int(param_width + 56))
|
||||
line.setObjectName("Write")
|
||||
|
||||
|
||||
@@ -2208,7 +2210,7 @@ class GUIFrame(QWidget):
|
||||
label.setAlignment(Qt.AlignBottom)
|
||||
else:
|
||||
box = QHBoxLayout()
|
||||
label.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
|
||||
label.setAlignment(Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
box.setAlignment(Qt.AlignCenter)
|
||||
|
||||
box.addWidget(label)
|
||||
@@ -2228,7 +2230,7 @@ class GUIFrame(QWidget):
|
||||
|
||||
if 'loggingLevel' not in key:
|
||||
wgt_grid.addLayout(box, a, b, c, d,
|
||||
Qt.AlignLeft | Qt.AlignVCenter)
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
|
||||
return box if 'loggingLevel' in key else line
|
||||
|
||||
@@ -2364,11 +2366,11 @@ class GUIFrame(QWidget):
|
||||
line = QLabel()
|
||||
line.setText(str(value)) #"{0: 3.1f}".format(value))
|
||||
line.setFixedHeight(24)
|
||||
line.setAlignment(Qt.AlignRight | Qt.AlignBottom)
|
||||
line.setAlignment(Qt.AlignmentFlag(Qt.AlignRight|Qt.AlignBottom))
|
||||
line.setStyleSheet("QLabel{text-align: right}")
|
||||
fm = QFontMetricsF(line.font())
|
||||
param_width = max(fm.width(str(value)), fm.width(suggested))
|
||||
line.setMaximumWidth(param_width + 40)
|
||||
line.setMaximumWidth(int(param_width + 40))
|
||||
|
||||
|
||||
if self.grid_loc:
|
||||
@@ -2399,7 +2401,7 @@ class GUIFrame(QWidget):
|
||||
#line.textEdited.connect(line_cb)
|
||||
line.textChanged.emit(str(value))
|
||||
|
||||
line.setAlignment(Qt.AlignRight | Qt.AlignBottom)
|
||||
line.setAlignment(Qt.AlignmentFlag(Qt.AlignRight|Qt.AlignBottom))
|
||||
line.setStyleSheet("QLabel{text-align: right}")
|
||||
|
||||
try:
|
||||
@@ -2409,7 +2411,7 @@ class GUIFrame(QWidget):
|
||||
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)
|
||||
line.setFixedWidth(int(param_width + extra_width))
|
||||
|
||||
qframe_buffer = QFrame()
|
||||
qframe_buffer.setFixedWidth(3)
|
||||
@@ -2426,25 +2428,18 @@ class GUIFrame(QWidget):
|
||||
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)
|
||||
|
||||
wgt_grid.addWidget(label, a, b, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
wgt_grid.addWidget(qframe_buffer, a, b+1, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
wgt_grid.addWidget(line, a, b+2, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
return line
|
||||
|
||||
def input_wgt_qlineedit(self, key, value, label, irow, wgt_grid):
|
||||
def line_cb(new_value):
|
||||
self.parent.input_parameters[key] = new_value
|
||||
|
||||
|
||||
self.parent.input_parameters[key] = new_value
|
||||
line = QLineEdit()
|
||||
|
||||
line.setObjectName("Write")
|
||||
line.setFixedHeight(24)
|
||||
line.textEdited.connect(line_cb)
|
||||
@@ -2452,9 +2447,8 @@ class GUIFrame(QWidget):
|
||||
fm = QFontMetricsF(line.font())
|
||||
param_width = fm.width(str(value))
|
||||
extra_width = 22 if len(str(value)) < 16 else 26
|
||||
line.setFixedWidth(param_width + extra_width)
|
||||
|
||||
|
||||
line.setFixedWidth(int(param_width + extra_width))
|
||||
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
b = self.grid_loc[1]
|
||||
@@ -2466,11 +2460,10 @@ class GUIFrame(QWidget):
|
||||
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)
|
||||
wgt_grid.addWidget(label, a, b, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
wgt_grid.addWidget(line, a, b+2, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
|
||||
return line
|
||||
|
||||
@@ -2508,7 +2501,7 @@ class GUIFrame(QWidget):
|
||||
line.setSingleStep(step)
|
||||
fm = QFontMetricsF(line.font())
|
||||
param_width = max(fm.width(str(decimal)), fm.width(suggested))
|
||||
line.setMaximumWidth(param_width + 40)
|
||||
line.setMaximumWidth(int(param_width + 40))
|
||||
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
@@ -2521,11 +2514,10 @@ class GUIFrame(QWidget):
|
||||
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)
|
||||
|
||||
wgt_grid.addWidget(label, a, b, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft | Qt.AlignVCenter))
|
||||
wgt_grid.addWidget(line, a, b+2, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft | Qt.AlignVCenter))
|
||||
return line
|
||||
|
||||
|
||||
@@ -2553,9 +2545,8 @@ class GUIFrame(QWidget):
|
||||
line.setSingleStep(step)
|
||||
fm = QFontMetricsF(line.font())
|
||||
param_width = max(fm.width(str(max_val)), fm.width(suggested))
|
||||
line.setMaximumWidth(param_width + 40)
|
||||
|
||||
|
||||
line.setMaximumWidth(int(param_width + 40))
|
||||
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
b = self.grid_loc[1]
|
||||
@@ -2567,11 +2558,10 @@ class GUIFrame(QWidget):
|
||||
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)
|
||||
wgt_grid.addWidget(label, a, b, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft | Qt.AlignVCenter))
|
||||
wgt_grid.addWidget(line, a, b+2, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft | Qt.AlignVCenter))
|
||||
|
||||
return line
|
||||
|
||||
@@ -2582,7 +2572,6 @@ class GUIFrame(QWidget):
|
||||
qframe_bottom = QFrame()
|
||||
qframe_bottom.setFixedHeight(3)
|
||||
|
||||
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
b = self.grid_loc[1]
|
||||
@@ -2594,15 +2583,14 @@ class GUIFrame(QWidget):
|
||||
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, a, b, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft | Qt.AlignVCenter))
|
||||
wgt_grid.addWidget(stacked_wgt, a+1, b, c+3, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft | Qt.AlignVCenter))
|
||||
wgt_grid.addWidget(qframe_bottom, a+2, b, c, d,
|
||||
Qt.AlignmentFlag(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
|
||||
|
||||
@@ -2626,16 +2614,14 @@ class GUIFrame(QWidget):
|
||||
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)
|
||||
wgt_grid.addWidget(qframe_top, a, b, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft | Qt.AlignVCenter))
|
||||
wgt_grid.addWidget(stacked_wgt, a+1, b, c+3, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft | Qt.AlignVCenter))
|
||||
wgt_grid.addWidget(qframe_bottom, a+2, b, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft | Qt.AlignVCenter))
|
||||
|
||||
|
||||
return stacked_wgt
|
||||
|
||||
def input_wgt_qhline(self, irow, wgt_grid):
|
||||
@@ -2653,14 +2639,14 @@ class GUIFrame(QWidget):
|
||||
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)
|
||||
|
||||
qVLine.setFixedHeight(17 * wgt_grid.rowCount())
|
||||
qVLine.setFixedHeight(int(17 * wgt_grid.rowCount()))
|
||||
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
@@ -2674,8 +2660,7 @@ class GUIFrame(QWidget):
|
||||
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()
|
||||
@@ -2693,8 +2678,6 @@ class GUIFrame(QWidget):
|
||||
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,):
|
||||
|
||||
@@ -2832,7 +2815,8 @@ class GUIFrame(QWidget):
|
||||
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"]
|
||||
self.grid_loc = self.settings.data[
|
||||
"Parameters"][key]["data"]["grid"]
|
||||
|
||||
|
||||
if draw_widget(buddy):
|
||||
@@ -2848,7 +2832,8 @@ class GUIFrame(QWidget):
|
||||
|
||||
lo = QGridLayout()
|
||||
lo.setContentsMargins(9, 19, 9, 9)
|
||||
lo.addWidget(self.operator_parameters_group, 0, 0, 4, 1, alignment=Qt.AlignTop)
|
||||
lo.addWidget(self.operator_parameters_group, 0, 0, 4, 1,
|
||||
alignment=Qt.AlignTop)
|
||||
#if random.randint(1, 10) > 9:
|
||||
# lo.addWidget(self.create_analysis_wgt(), 0, 1)
|
||||
#else:
|
||||
@@ -2860,19 +2845,19 @@ class GUIFrame(QWidget):
|
||||
|
||||
if self.has_procedure:
|
||||
if 'V' in self.orientation_procedure.upper():
|
||||
lo.addWidget(self.analysis_procedure_group(), row_count, 1, 1, 1)
|
||||
lo.addWidget(
|
||||
self.analysis_procedure_group(), row_count, 1, 1, 1)
|
||||
else:
|
||||
lo.addWidget(self.analysis_procedure_group(), lo.rowCount(), 0, 1, 1)
|
||||
lo.addWidget(
|
||||
self.analysis_procedure_group(), lo.rowCount(), 0, 1, 1)
|
||||
|
||||
#Centers input parameters group box
|
||||
lo.setAlignment(Qt.AlignHCenter | Qt.AlignTop)
|
||||
lo.setAlignment(Qt.AlignmentFlag(Qt.AlignHCenter|Qt.AlignTop))
|
||||
lo.setHorizontalSpacing(20)
|
||||
lo.setVerticalSpacing(10)
|
||||
self.operator_wgt.setLayout(lo)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#expert
|
||||
self.expert_parameters_group = self.expert_parameters_groupbox()
|
||||
|
||||
@@ -2883,7 +2868,8 @@ class GUIFrame(QWidget):
|
||||
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"]
|
||||
self.grid_loc = self.settings.data[
|
||||
"Expert"][key]["data"]["grid"]
|
||||
|
||||
buddy = self.settings.data[
|
||||
"Expert"][key]["data"]["widget"].upper()
|
||||
@@ -2895,7 +2881,8 @@ class GUIFrame(QWidget):
|
||||
#Add expert parameters to input_parameters
|
||||
self.input_parameters.update(self.expert_parameters)
|
||||
|
||||
#Need to emit radio button here as input_parameters is overwritten by sel.expoert_parameters
|
||||
#Need to emit radio button here as input_parameters is
|
||||
#overwritten by sel.expoert_parameters
|
||||
#which give a list [Gasusian and FWMH]
|
||||
if self.radiobutton:
|
||||
self.radiobutton[0].toggled.emit(True)
|
||||
@@ -2931,11 +2918,6 @@ 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"))
|
||||
|
||||
_matches = ["debug", "debugLevel", "simulation"]
|
||||
match = False
|
||||
|
||||
@@ -2949,19 +2931,17 @@ class GUIFrame(QWidget):
|
||||
|
||||
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.input_wgt_logging(self.expert_wgt_grid.rowCount(),
|
||||
self.expert_wgt_grid))
|
||||
|
||||
self.expert_parameters_group.layout().addWidget(QHLine())
|
||||
|
||||
@@ -2969,8 +2949,9 @@ class GUIFrame(QWidget):
|
||||
|
||||
lo = QGridLayout()
|
||||
lo.setContentsMargins(9, 19, 9, 9)
|
||||
lo.addWidget(self.expert_parameters_group, 0, 0, 1, 1, alignment=Qt.AlignTop)
|
||||
lo.setAlignment(Qt.AlignHCenter | Qt.AlignTop)
|
||||
lo.addWidget(self.expert_parameters_group, 0, 0, 1, 1,
|
||||
alignment=Qt.AlignTop)
|
||||
lo.setAlignment(Qt.AlignmentFlag(Qt.AlignHCenter|Qt.AlignTop))
|
||||
lo.setHorizontalSpacing(20)
|
||||
self.expert_wgt.setLayout(lo)
|
||||
|
||||
@@ -3013,12 +2994,6 @@ class GUIFrame(QWidget):
|
||||
|
||||
layout.addWidget(radio, 1, _width*i+1, 1, _width, Qt.AlignCenter)
|
||||
|
||||
#_qf = QFrame()
|
||||
#_qf.setFixedWidth(10)
|
||||
#layout.addWidget(_qf, 1, layout.columnCount())
|
||||
|
||||
#self.radiobutton[start_idx].setChecked(True)
|
||||
#self.radiobutton[start_idx].toggled.emit(True)
|
||||
|
||||
layout.addWidget(QHLine(), 2, 0, 1, layout.columnCount())
|
||||
|
||||
@@ -3069,7 +3044,8 @@ class GUIFrame(QWidget):
|
||||
pv_dict[_title] = self.branches[i]['magnets']
|
||||
|
||||
self.table_layout = QGridLayout()
|
||||
self.table_layout.setAlignment(Qt.AlignCenter | Qt.AlignTop)
|
||||
self.table_layout.setAlignment(
|
||||
Qt.AlignmentFlag(Qt.AlignHCenter|Qt.AlignTop))
|
||||
self.table_tab_wgt = QTabWidget()
|
||||
self.table_tab_wgt.setFixedWidth(600)
|
||||
self.table_tab_wgt.tabBar().setShape(QTabBar.TriangularNorth)
|
||||
@@ -3093,9 +3069,10 @@ class GUIFrame(QWidget):
|
||||
self.table_tab_wgt.currentChanged.connect(on_table_tab_changed)
|
||||
self.table_layout.addWidget(self.table_tab_wgt, 0, 0)
|
||||
|
||||
#self.line_sender_dict['tableTabIdx'] = self.table_tab_wgt
|
||||
self.table_layout.setContentsMargins(0, 27, 0, 0)
|
||||
|
||||
self.table_tab_wgt.currentChanged.emit(0)
|
||||
|
||||
return self.table_layout #tab_wgt
|
||||
|
||||
|
||||
|
||||
32
setup_version
Normal file
32
setup_version
Normal file
@@ -0,0 +1,32 @@
|
||||
#to be executed from top directory
|
||||
#create a directory with version number given below.
|
||||
mkdir -p v1.7.0
|
||||
cd v1.7.0
|
||||
mkdir -p apps4ops
|
||||
mkdir -p caqtwidgets
|
||||
mkdir -p common
|
||||
ln -s apps4ops pyqtacc
|
||||
cd apps4ops
|
||||
mkdir -p bdbase
|
||||
mkdir -p qrc_resources
|
||||
mkdir -p sf
|
||||
mkdir -p sls
|
||||
mkdir -p hipa
|
||||
cd bdbase
|
||||
git clone git@gitlab.psi.ch:pyqtacc/bdbase.git .
|
||||
cd ../qrc_resources
|
||||
git clone git@gitlab.psi.ch:pyqtacc/qrc_resources.git .
|
||||
cd ../sf
|
||||
git clone git@gitlab.psi.ch:pyqtacc/sf.git .
|
||||
cd ../sls
|
||||
git clone git@gitlab.psi.ch:pyqtacc/sls.git .
|
||||
cd ../hipa
|
||||
git clone git@gitlab.psi.ch:pyqtacc/hipa.git .
|
||||
cd ../../
|
||||
mkdir -p common
|
||||
cd common
|
||||
git clone git@gitlab.psi.ch:pyqtacc/common.git .
|
||||
cd ../
|
||||
cd caqtwidgets
|
||||
git clone git@gitlab.psi.ch:cafe/caqtwidgets.git .
|
||||
cd ../../
|
||||
12
utils.py
12
utils.py
@@ -10,3 +10,15 @@ def _line():
|
||||
int: Current line number.
|
||||
"""
|
||||
return currentframe().f_back.f_lineno
|
||||
|
||||
|
||||
def line_no():
|
||||
"""Macro to return the current line number.
|
||||
|
||||
The current line number within the file is used when
|
||||
reporting messages to the message logging window.
|
||||
|
||||
Returns:
|
||||
int: Current line number.
|
||||
"""
|
||||
return currentframe().f_back.f_lineno
|
||||
|
||||
Reference in New Issue
Block a user