| 31 | |
| 32 | |
| 33 | class WndLoadQuantitativeCalibration(SecondaryWindow): |
| 34 | signal_quantitative_calibration_changed = Signal() |
| 35 | |
| 36 | def __init__(self, *, gpc, gui_vars): |
| 37 | super().__init__() |
| 38 | |
| 39 | # Global processing classes |
| 40 | self.gpc = gpc |
| 41 | # Global GUI variables (used for control of GUI state) |
| 42 | self.gui_vars = gui_vars |
| 43 | |
| 44 | self.initialize() |
| 45 | |
| 46 | def initialize(self): |
| 47 | self.table_header_display_names = False |
| 48 | |
| 49 | self.setWindowTitle("PyXRF: Load Quantitative Calibration") |
| 50 | self.setMinimumWidth(750) |
| 51 | self.setMinimumHeight(400) |
| 52 | self.resize(750, 600) |
| 53 | |
| 54 | self.pb_load_calib = QPushButton("Load Calibration ...") |
| 55 | self.pb_load_calib.clicked.connect(self.pb_load_calib_clicked) |
| 56 | |
| 57 | self._changes_exist = False |
| 58 | self._auto_update = True |
| 59 | self.cb_auto_update = QCheckBox("Auto") |
| 60 | self.cb_auto_update.setCheckState(Qt.Checked if self._auto_update else Qt.Unchecked) |
| 61 | self.cb_auto_update.stateChanged.connect(self.cb_auto_update_state_changed) |
| 62 | |
| 63 | self.pb_update_plots = QPushButton("Update Plots") |
| 64 | self.pb_update_plots.clicked.connect(self.pb_update_plots_clicked) |
| 65 | |
| 66 | self.grp_current_scan = QGroupBox("Parameters of Currently Processed Scan") |
| 67 | |
| 68 | self._distance_to_sample = 0.0 |
| 69 | self.le_distance_to_sample = LineEditExtended() |
| 70 | le_dist_validator = DoubleValidator() |
| 71 | le_dist_validator.setBottom(0) |
| 72 | self.le_distance_to_sample.setValidator(le_dist_validator) |
| 73 | self._set_distance_to_sample() |
| 74 | self.le_distance_to_sample.editingFinished.connect(self.le_distance_to_sample_editing_finished) |
| 75 | self.le_distance_to_sample.focusOut.connect(self.le_distance_to_sample_focus_out) |
| 76 | |
| 77 | hbox = QHBoxLayout() |
| 78 | hbox.addWidget(QLabel("Distance-to-sample:")) |
| 79 | hbox.addWidget(self.le_distance_to_sample) |
| 80 | hbox.addStretch(1) |
| 81 | self.grp_current_scan.setLayout(hbox) |
| 82 | |
| 83 | self.eline_rb_exclusive = [] # Holds the list of groups of exclusive radio buttons |
| 84 | self._setup_tab_widget() |
| 85 | |
| 86 | vbox = QVBoxLayout() |
| 87 | |
| 88 | hbox = QHBoxLayout() |
| 89 | hbox.addWidget(self.pb_load_calib) |
| 90 | hbox.addStretch(1) |