Ejemplo n.º 1
0
    def __init__(self,
                 parent=None,
                 state=None,
                 settings=None,
                 data_type=None,
                 data_proxy=None):
        super(SampleDataWidget, self).__init__(parent,
                                               state,
                                               settings,
                                               data_type,
                                               data_proxy=data_proxy)

        class DataFrame(QtGui.QFrame, ui.sans.ui_hfir_sample_data.Ui_Frame):
            def __init__(self, parent=None):
                QtGui.QFrame.__init__(self, parent)
                self.setupUi(self)

        self._content = DataFrame(self)
        self._layout.addWidget(self._content)
        self.initialize_content()

        if state is not None:
            self.set_state(state)
        else:
            m = SampleData()
            self.set_state(m)

        self._last_direct_state = None
        self._last_spreader_state = None
Ejemplo n.º 2
0
    def __init__(self,
                 parent=None,
                 state=None,
                 settings=None,
                 data_type=None,
                 data_proxy=None):
        super(SampleDataWidget, self).__init__(parent,
                                               state,
                                               settings,
                                               data_type,
                                               data_proxy=data_proxy)

        class DataFrame(QFrame):
            def __init__(self, parent=None):
                QFrame.__init__(self, parent)
                self.ui = load_ui(__file__,
                                  '../../../ui/sans/hfir_sample_data.ui',
                                  baseinstance=self)

        self._content = DataFrame(self)
        self._layout.addWidget(self._content)
        self.initialize_content()

        if state is not None:
            self.set_state(state)
        else:
            m = SampleData()
            self.set_state(m)

        self._last_direct_state = None
        self._last_spreader_state = None
Ejemplo n.º 3
0
    def get_state(self):
        """
            Returns an object with the state of the interface
        """
        m = SampleData()

        m.transmission = util._check_and_get_float_line_edit(self._content.transmission_edit)
        m.transmission_spread = util._check_and_get_float_line_edit(self._content.dtransmission_edit)
        m.sample_thickness = util._check_and_get_float_line_edit(self._content.thickness_edit)

        m.calculate_transmission = self._content.calculate_chk.isChecked()
        m.theta_dependent = self._content.theta_dep_chk.isChecked()
        m.dark_current = self._content.dark_current_edit.text()

        m.calculation_method=self._method_box.get_state()

        # Data file
        m.data_files = self._get_data_files()

        return m