Position in gridlayout for measurement_wgt_tab is now configurable from client json file
This commit is contained in:
12
base.py
12
base.py
@@ -263,7 +263,7 @@ class BaseWindow(QMainWindow):
|
||||
self.parent.add_to_hdf(dataH5, proc=True, raw=True)
|
||||
self.parent.hdf_save_completed = True
|
||||
|
||||
_mess = "Processed data saved to {}".format(
|
||||
_mess = "Data saved to {}".format(
|
||||
self.parent.hdf_filename)
|
||||
self.parent.trigger_log_message.emit(
|
||||
MsgSeverity.INFO.name, _pymodule, _line(), _mess,
|
||||
@@ -379,13 +379,17 @@ class BaseWindow(QMainWindow):
|
||||
def run(self):
|
||||
"""Run thread
|
||||
"""
|
||||
print("RUN IN BASE CLASS", flush=True)
|
||||
print("RUN ANLYSIS THREAD FROM WITHIN IN BASE CLASS", flush=True)
|
||||
|
||||
#Reset all_data fro parent
|
||||
self.parent.all_data = None
|
||||
|
||||
all_dict = self.analysis_procedure.measure_and_analyze(
|
||||
self.input_parameters)
|
||||
|
||||
|
||||
|
||||
# Emit results
|
||||
if all_dict:
|
||||
if all_dict is not None:
|
||||
self.trigger_thread_event.emit(all_dict)
|
||||
mess = self.messages['success']
|
||||
self.parent.trigger_log_message.emit(
|
||||
|
||||
27
guiframe.py
27
guiframe.py
@@ -421,10 +421,24 @@ class GUIFrame(QWidget):
|
||||
def init_measurement_tab_wgt(self):
|
||||
""" Add tabs to measurement widget
|
||||
"""
|
||||
row_idx = 0
|
||||
column_idx = 0
|
||||
no_rows = 1
|
||||
no_columns = 1
|
||||
try:
|
||||
layout_parameters = self.settings.data["MeasurementGridLayout"]
|
||||
row_idx = layout_parameters[0]
|
||||
column_idx = layout_parameters[1]
|
||||
no_rows = layout_parameters[2]
|
||||
no_columns = layout_parameters[3]
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
self.measurement_tab_wgt.setFont(self.font_gui)
|
||||
self.measurement_tab_wgt.addTab(self.operator_wgt, "Operator")
|
||||
self.measurement_tab_wgt.addTab(self.expert_wgt, "Expert")
|
||||
self.measurement_layout.addWidget(self.measurement_tab_wgt, 0, 0)
|
||||
self.measurement_layout.addWidget(
|
||||
self.measurement_tab_wgt, row_idx, column_idx, no_rows, no_columns)
|
||||
|
||||
def init_results_tab_wgt(self):
|
||||
""" Add canvas tabs for plots/results
|
||||
@@ -1878,7 +1892,7 @@ class GUIFrame(QWidget):
|
||||
qtab_widget.setCurrentIndex(_default_idx)
|
||||
qtab_widget.currentChanged.emit(_default_idx)
|
||||
|
||||
|
||||
|
||||
final_wgt = QWidget()
|
||||
final_lo = QGridLayout()
|
||||
final_wgt.setContentsMargins(0, 0, 0, 0)
|
||||
@@ -1895,7 +1909,7 @@ class GUIFrame(QWidget):
|
||||
final_wgt.setLayout(final_lo)
|
||||
|
||||
|
||||
return final_wgt #qtab_widget #
|
||||
return final_wgt, qtab_widget #
|
||||
|
||||
|
||||
def pv_stacked_wgt(self, pvlist, title, default_value, key, object_name):
|
||||
@@ -2691,6 +2705,7 @@ class GUIFrame(QWidget):
|
||||
label.setContentsMargins(5, 0, 0, 0)
|
||||
|
||||
line = None
|
||||
qtab = None
|
||||
|
||||
#Add callbacksand actions
|
||||
if buddy == "QComboBox".upper():
|
||||
@@ -2734,7 +2749,7 @@ class GUIFrame(QWidget):
|
||||
|
||||
elif buddy == "QTabWidget".upper():
|
||||
#print("buddy/label", buddy, label, key, value, flush=True)
|
||||
line = self.qtab_wgt(key, irow, wgt_grid)
|
||||
line, qtab = self.qtab_wgt(key, irow, wgt_grid)
|
||||
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
@@ -2758,7 +2773,9 @@ class GUIFrame(QWidget):
|
||||
print("Supported widgets are: {0}".format(wgt_list))
|
||||
pass
|
||||
|
||||
if line is not None:
|
||||
if qtab is not None:
|
||||
self.line_sender_dict[key] = qtab
|
||||
elif line is not None:
|
||||
self.line_sender_dict[key] = line
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user