overdue
This commit is contained in:
2
base.py
2
base.py
@@ -7,8 +7,8 @@ import getpass
|
||||
import h5py
|
||||
import inspect
|
||||
import platform
|
||||
import re
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import time
|
||||
|
||||
|
||||
38
guiframe.py
38
guiframe.py
@@ -87,6 +87,8 @@ class GUIFrame(QWidget):
|
||||
self.line_sender_dict = {}
|
||||
self.radio_stack_dict = {}
|
||||
self.stack_radiolist_dict = {}
|
||||
self.stacked_wgt_dict = {}
|
||||
self.current_stacked_wgt_dict = {}
|
||||
|
||||
self.msg_severity_qcolor = parent.msg_severity_qcolor
|
||||
self.msg_severity = MsgSeverity
|
||||
@@ -136,6 +138,8 @@ class GUIFrame(QWidget):
|
||||
self.start_wgt_text = "Start"
|
||||
self.save_all_wgt = QWidget()
|
||||
|
||||
self.slice_orientation = "vertical" #horizontal/vertical for SATMA02
|
||||
|
||||
self.init_measurement_tab_wgt()
|
||||
self.init_results_tab_wgt()
|
||||
|
||||
@@ -453,7 +457,7 @@ class GUIFrame(QWidget):
|
||||
key="slices", label="No. Slices:", start_val=21)
|
||||
lab_scale, scale = self.create_label_qspinbox(
|
||||
key="slicingScale", label="Scale:")
|
||||
lab_orientation, orientation = self.create_label_qcombobox(
|
||||
lab_orientation, self.slice_orientation = self.create_label_qcombobox(
|
||||
key="orientation", label="Orientation:",
|
||||
values=["vertical", "horizontal"])
|
||||
|
||||
@@ -464,7 +468,7 @@ class GUIFrame(QWidget):
|
||||
layout.addWidget(lab_scale, 1, 0)
|
||||
layout.addWidget(scale, 1, 1)
|
||||
layout.addWidget(lab_orientation, 2, 0, 1, 2, Qt.AlignBottom)
|
||||
layout.addWidget(orientation, 3, 0, 1, 2, Qt.AlignTop | Qt.AlignRight)
|
||||
layout.addWidget(self.slice_orientation, 3, 0, 1, 2, Qt.AlignTop | Qt.AlignRight)
|
||||
slicing.setLayout(layout)
|
||||
|
||||
layout_top = QGridLayout()
|
||||
@@ -975,16 +979,21 @@ class GUIFrame(QWidget):
|
||||
self.cafe.setGetActionWhenMonitorPolicy(
|
||||
pv, self.cyca.GET_FROM_CACHE)
|
||||
|
||||
stack_list = []
|
||||
|
||||
for pv, head, val, obj in zip(pvlist, title, default_value,
|
||||
object_name):
|
||||
stack, radiobutton_list = self.pv_selector_wgt(
|
||||
title=head, key=key, pv=pv, manual_value=val)
|
||||
self.stack_radiolist_dict[stack] = radiobutton_list
|
||||
|
||||
stack_list.append(stack)
|
||||
stack.setObjectName(obj)
|
||||
stack.style().polish(stack)
|
||||
stacked_widget.addWidget(stack)
|
||||
|
||||
stacked_widget.setMaximumHeight(220)
|
||||
self.stacked_wgt_dict[stacked_widget] = stack_list
|
||||
return stacked_widget
|
||||
|
||||
def pv_energy_stacked_wgt(self):
|
||||
@@ -1033,10 +1042,25 @@ class GUIFrame(QWidget):
|
||||
radiobutton_title = ["Monitor", "Update", "Manual"]
|
||||
radiobutton_flag = [monitor, read, manual]
|
||||
radiobutton_list = [None] * len(radiobutton_title)
|
||||
pv_local = pv
|
||||
|
||||
def cb_pv_selector(value):
|
||||
value_str = radio_buddy_text_dict[self.sender()].text()
|
||||
|
||||
#print("cb_pv_selector", value_str)
|
||||
#Find which group the radio button belongs to:
|
||||
#Find which stack the group belongs to:
|
||||
#Set this to the current stack?
|
||||
|
||||
for k, v in self.stack_radiolist_dict.items():
|
||||
if self.sender() in v:
|
||||
#get groupbox from key
|
||||
for k2, v2 in self.stacked_wgt_dict.items():
|
||||
if k in v2:
|
||||
self.current_stacked_wgt_dict[k2] = pv_local
|
||||
#print("Current STACK FOUND")
|
||||
|
||||
|
||||
self.radio_stack_dict[self.sender()] = value
|
||||
|
||||
if not value_str:
|
||||
@@ -1088,8 +1112,16 @@ class GUIFrame(QWidget):
|
||||
ql.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
|
||||
grid.addWidget(ql, 2, 1)
|
||||
|
||||
|
||||
def mon_cb(handle, pvname, pvdata):
|
||||
monitor_pv.py_monitor_callback(handle, pvname, pvdata)
|
||||
if pvname in self.current_stacked_wgt_dict.values():
|
||||
self.input_parameters[key] = pvdata.value[0]
|
||||
|
||||
|
||||
if monitor:
|
||||
monitor_pv = CAQLabel(self, pv_name=pv, show_units=True)
|
||||
monitor_pv = CAQLabel(self, pv_name=pv, monitor_callback=mon_cb,
|
||||
show_units=True)
|
||||
monitor_pv.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
|
||||
monitor_pv.setFont(self.font_pts10)
|
||||
monitor_pv.setFixedHeight(self.widget_height)
|
||||
|
||||
Reference in New Issue
Block a user