def __init__(self, parent=None, state=None, settings=None, data_type=None): super(SampleSetupWidget, self).__init__(parent, state, settings, data_type=data_type) class SamSetFrame(QFrame): def __init__(self, parent=None): QFrame.__init__(self, parent) self.ui = load_ui(__file__, '../../../ui/inelastic/dgs_sample_setup.ui', baseinstance=self) self._content = SamSetFrame(self) self._instrument_name = settings.instrument_name self._facility_name = settings.facility_name self._livebuttonwidget = None if IS_IN_MANTIDPLOT: self._swap_in_mwrunfiles_widget() self._layout.addWidget(self._content) self.initialize_content() if state is not None: self.set_state(state) else: self.set_state(SampleSetupScript(self._instrument_name))
def get_state(self): """ Returns an object with the state of the interface """ s = SampleSetupScript(self._instrument_name) s.sample_file = self._content.sample_edit.text() if IS_IN_MANTIDPLOT: s.live_button = self._content.sample_edit.liveButtonIsChecked() s.output_wsname = self._content.output_ws_edit.text() s.detcal_file = self._content.detcal_edit.text() s.incident_energy_guess = self._content.ei_guess_edit.text() s.use_ei_guess = self._content.use_ei_guess_chkbox.isChecked() s.tzero_guess = util._check_and_get_float_line_edit(self._content.tzero_guess_edit) s.monitor1_specid = int(self._content.monitor1_specid_edit.text()) s.monitor2_specid = int(self._content.monitor2_specid_edit.text()) s.rebin_et = self._content.et_range_box.isChecked() s.et_range_low = self._content.etr_low_edit.text() s.et_range_width = self._content.etr_width_edit.text() s.et_range_high = self._content.etr_high_edit.text() s.et_is_distribution = self._content.et_is_distribution_cb.isChecked() s.hardmask_file = self._content.hardmask_edit.text() s.grouping_file = self._content.grouping_edit.text() s.show_workspaces = self._content.show_workspaces_cb.isChecked() s.savedir = self._content.savedir_edit.text() return s
def get_state(self): """ Returns an object with the state of the interface """ s = SampleSetupScript(self._instrument_name) s.sample_file = self._content.sample_edit.text() if IS_IN_MANTIDPLOT: s.live_button = self._content.sample_edit.liveButtonIsChecked() s.output_wsname = self._content.output_ws_edit.text() s.detcal_file = self._content.detcal_edit.text() s.incident_energy_guess = self._content.ei_guess_edit.text() s.use_ei_guess = self._content.use_ei_guess_chkbox.isChecked() s.tzero_guess = util._check_and_get_float_line_edit( self._content.tzero_guess_edit) s.monitor1_specid = self._content.monitor1_specid_edit.text() s.monitor2_specid = self._content.monitor2_specid_edit.text() s.rebin_et = self._content.et_range_box.isChecked() s.et_range_low = self._content.etr_low_edit.text() s.et_range_width = self._content.etr_width_edit.text() s.et_range_high = self._content.etr_high_edit.text() s.et_is_distribution = self._content.et_is_distribution_cb.isChecked() s.hardmask_file = self._content.hardmask_edit.text() s.grouping_file = self._content.grouping_edit.text() s.show_workspaces = self._content.show_workspaces_cb.isChecked() s.savedir = self._content.savedir_edit.text() return s