def update_gui(self): """will update widgets such as TOF auto/manual""" _row_selected = self.row_selected if self.is_row_selected_checked(_row_selected): _big_table_data = self.parent.big_table_data _lconfig = _big_table_data[_row_selected, 2] if bool(_lconfig.tof_auto_flag): self.parent.ui.dataTOFautoMode.setChecked(True) else: self.parent.ui.dataTOFmanualMode.setChecked(True) o_auto_tof_range = AutoTofRangeRadioButtonHandler( parent=self.parent) o_auto_tof_range.setup() o_auto_tof_range.radio_button_handler()
def manual_tof_range_line_edit_validation(self): o_auto_tof_range = AutoTofRangeRadioButtonHandler(parent = self) o_auto_tof_range.setup() o_auto_tof_range.line_edit_validation()
def auto_tof_range_radio_button(self): o_auto_tof_range = AutoTofRangeRadioButtonHandler(parent = self) o_auto_tof_range.setup() o_auto_tof_range.radio_button_handler()
def closeEvent(self, event=None): [lowres1, lowres2, lowresFlag] = self.retrieveLowRes() [tof1, tof2, peak1, peak2, back1, back2, backFlag] = self.retrieveTofPeakBack() tof_auto_switch = self.ui.tof_auto_flag.isChecked() big_table_data = self.parent.big_table_data _data = big_table_data[self.row, self.col] _data.peak = [str(peak1), str(peak2)] _data.back = [str(back1), str(back2)] _data.back_flag = backFlag _data.tof_range_auto = [ self.auto_min_tof * 1000, self.auto_max_tof * 1000 ] _data.tof_range = [ self.manual_min_tof * 1000, self.manual_max_tof * 1000 ] _data.tof_range_manual = _data.tof_range _data.tof_range_auto_flag = tof_auto_switch _data.tof_auto_flag = tof_auto_switch _data.low_res = [str(lowres1), str(lowres2)] _data.low_res_flag = lowresFlag big_table_data[self.row, self.col] = _data if self.is_row_with_highest_q: _clock1 = self.ui.clock1.value() _clock2 = self.ui.clock2.value() _clocking = [str(_clock1), str(_clock2)] _data = big_table_data[0, 0] index = 0 while (_data is not None): _data.clocking = _clocking big_table_data[index, 0] = _data _data = big_table_data[index + 1, 0] index += 1 self.parent.ui.dataPrimFromValue.setValue(_clock1) self.parent.ui.dataPrimToValue.setValue(_clock2) self.parent.big_table_data = big_table_data # tof o_gui_utility = GuiUtility(parent=self.parent) o_gui_utility.set_auto_tof_range_radio_button(status=tof_auto_switch) self.parent.ui.TOFmanualFromValue.setText("%.2f" % tof1) self.parent.ui.TOFmanualToValue.setText("%.2f" % tof2) if self.data_type == 'data': self.parent.ui.dataPeakFromValue.setValue(peak1) self.parent.ui.dataPeakToValue.setValue(peak2) self.parent.ui.dataBackFromValue.setValue(back1) self.parent.ui.dataBackToValue.setValue(back2) self.parent.ui.dataBackgroundFlag.setChecked(backFlag) #self.parent.data_peak_and_back_validation(False) self.parent.ui.dataBackFromLabel.setEnabled(backFlag) self.parent.ui.dataBackFromValue.setEnabled(backFlag) self.parent.ui.dataBackToLabel.setEnabled(backFlag) self.parent.ui.dataBackToValue.setEnabled(backFlag) self.parent.ui.dataLowResFromValue.setValue(lowres1) self.parent.ui.dataLowResToValue.setValue(lowres2) self.parent.ui.dataLowResFromLabel.setEnabled(lowresFlag) self.parent.ui.dataLowResFromValue.setEnabled(lowresFlag) self.parent.ui.dataLowResToLabel.setEnabled(lowresFlag) self.parent.ui.dataLowResToValue.setEnabled(lowresFlag) else: self.parent.ui.normPeakFromValue.setValue(peak1) self.parent.ui.normPeakToValue.setValue(peak2) self.parent.ui.normBackFromValue.setValue(back1) self.parent.ui.normBackToValue.setValue(back2) self.parent.ui.normBackgroundFlag.setChecked(backFlag) #self.parent.norm_peak_and_back_validation(False) self.parent.ui.normBackFromLabel.setEnabled(backFlag) self.parent.ui.normBackFromValue.setEnabled(backFlag) self.parent.ui.normBackToLabel.setEnabled(backFlag) self.parent.ui.normBackToValue.setEnabled(backFlag) self.parent.ui.normLowResFromValue.setValue(lowres1) self.parent.ui.normLowResToValue.setValue(lowres2) self.parent.ui.normLowResFromLabel.setEnabled(lowresFlag) self.parent.ui.normLowResFromValue.setEnabled(lowresFlag) self.parent.ui.normLowResToLabel.setEnabled(lowresFlag) self.parent.ui.normLowResToValue.setEnabled(lowresFlag) DisplayPlots(parent=self.parent, row=self.row, is_data=self.is_data, plot_yt=True, plot_yi=True, plot_it=True, plot_ix=True, refresh_reduction_table=False) if not tof_auto_switch: o_auto_tof_range = AutoTofRangeRadioButtonHandler( parent=self.parent) o_auto_tof_range.setup() o_auto_tof_range.line_edit_validation()
def closeEvent(self, event = None): [lowres1, lowres2, lowresFlag] = self.retrieveLowRes() [tof1, tof2, peak1, peak2, back1, back2, backFlag]= self.retrieveTofPeakBack() tof_auto_switch = self.ui.tof_auto_flag.isChecked() big_table_data = self.parent.big_table_data _data = big_table_data[self.row, self.col] _data.peak = [str(peak1), str(peak2)] _data.back = [str(back1), str(back2)] _data.back_flag = backFlag _data.tof_range_auto = [self.auto_min_tof * 1000, self.auto_max_tof * 1000] _data.tof_range = [self.manual_min_tof * 1000, self.manual_max_tof * 1000] _data.tof_range_manual = _data.tof_range _data.tof_range_auto_flag = tof_auto_switch _data.tof_auto_flag = tof_auto_switch _data.low_res = [str(lowres1), str(lowres2)] _data.low_res_flag = lowresFlag big_table_data[self.row, self.col] = _data if self.is_row_with_highest_q: _clock1 = self.ui.clock1.value() _clock2 = self.ui.clock2.value() _clocking = [str(_clock1), str(_clock2)] _data = big_table_data[0, 0] index = 0 while (_data is not None): _data.clocking = _clocking big_table_data[index, 0] = _data _data = big_table_data[index+1, 0] index += 1 self.parent.ui.dataPrimFromValue.setValue(_clock1) self.parent.ui.dataPrimToValue.setValue(_clock2) self.parent.big_table_data = big_table_data # tof o_gui_utility = GuiUtility(parent = self.parent) o_gui_utility.set_auto_tof_range_radio_button(status = tof_auto_switch) self.parent.ui.TOFmanualFromValue.setText("%.2f" %tof1) self.parent.ui.TOFmanualToValue.setText("%.2f" %tof2) if self.data_type == 'data': self.parent.ui.dataPeakFromValue.setValue(peak1) self.parent.ui.dataPeakToValue.setValue(peak2) self.parent.ui.dataBackFromValue.setValue(back1) self.parent.ui.dataBackToValue.setValue(back2) self.parent.ui.dataBackgroundFlag.setChecked(backFlag) #self.parent.data_peak_and_back_validation(False) self.parent.ui.dataBackFromLabel.setEnabled(backFlag) self.parent.ui.dataBackFromValue.setEnabled(backFlag) self.parent.ui.dataBackToLabel.setEnabled(backFlag) self.parent.ui.dataBackToValue.setEnabled(backFlag) self.parent.ui.dataLowResFromValue.setValue(lowres1) self.parent.ui.dataLowResToValue.setValue(lowres2) self.parent.ui.dataLowResFromLabel.setEnabled(lowresFlag) self.parent.ui.dataLowResFromValue.setEnabled(lowresFlag) self.parent.ui.dataLowResToLabel.setEnabled(lowresFlag) self.parent.ui.dataLowResToValue.setEnabled(lowresFlag) else: self.parent.ui.normPeakFromValue.setValue(peak1) self.parent.ui.normPeakToValue.setValue(peak2) self.parent.ui.normBackFromValue.setValue(back1) self.parent.ui.normBackToValue.setValue(back2) self.parent.ui.normBackgroundFlag.setChecked(backFlag) #self.parent.norm_peak_and_back_validation(False) self.parent.ui.normBackFromLabel.setEnabled(backFlag) self.parent.ui.normBackFromValue.setEnabled(backFlag) self.parent.ui.normBackToLabel.setEnabled(backFlag) self.parent.ui.normBackToValue.setEnabled(backFlag) self.parent.ui.normLowResFromValue.setValue(lowres1) self.parent.ui.normLowResToValue.setValue(lowres2) self.parent.ui.normLowResFromLabel.setEnabled(lowresFlag) self.parent.ui.normLowResFromValue.setEnabled(lowresFlag) self.parent.ui.normLowResToLabel.setEnabled(lowresFlag) self.parent.ui.normLowResToValue.setEnabled(lowresFlag) DisplayPlots(parent = self.parent, row = self.row, is_data = self.is_data, plot_yt = True, plot_yi = True, plot_it = True, plot_ix = True, refresh_reduction_table = False) if not tof_auto_switch: o_auto_tof_range = AutoTofRangeRadioButtonHandler(parent = self.parent) o_auto_tof_range.setup() o_auto_tof_range.line_edit_validation()
def manual_tof_range_line_edit_validation(self): o_auto_tof_range = AutoTofRangeRadioButtonHandler(parent=self) o_auto_tof_range.setup() o_auto_tof_range.line_edit_validation()
def auto_tof_range_radio_button(self): o_auto_tof_range = AutoTofRangeRadioButtonHandler(parent=self) o_auto_tof_range.setup() o_auto_tof_range.radio_button_handler()