예제 #1
0
    def __init__(self,
                 parent=None,
                 state=None,
                 settings=None,
                 name="BIOSANS",
                 data_proxy=None):
        super(SANSInstrumentWidget, self).__init__(parent,
                                                   state,
                                                   settings,
                                                   data_proxy=data_proxy)

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

        self._summary = SummaryFrame(self)
        self.initialize_content()
        self._layout.addWidget(self._summary)

        self._masked_detectors = []

        if state is not None:
            self.set_state(state)
        else:
            instr = ReductionOptions()
            instr.instrument_name = name
            self.set_state(instr)

        # General GUI settings
        if settings is None:
            settings = GeneralSettings()
        self._settings = settings
        # Connect do UI data update
        self._settings.data_updated.connect(self._data_updated)
예제 #2
0
    def __init__(self, parent=None, state=None, settings=None, data_type=None, ui_class=None, data_proxy=None):
        QtGui.QWidget.__init__(self, parent)

        self._layout = QtGui.QHBoxLayout()
        self.setLayout(self._layout)
        if ui_class is not None:
            self._content = ui_class(self)
            self._layout.addWidget(self._content)

        # Data filter for file dialog
        self._data_type="Data files (*.xml)"
        if data_type is not None:
            self._data_type = data_type

        # General GUI settings
        if settings is None:
            settings = GeneralSettings()
        self._settings = settings

        if ui_class is not None:
            self.setLayout(self._layout)
            self.initialize_content()

        self._instrument_view = None
        self._data_set_viewed = ''

        self._data_proxy = data_proxy
        self._in_mantidplot = IS_IN_MANTIDPLOT and self._data_proxy is not None

        self._is_running = True
예제 #3
0
    def __init__(self, parent=None, state=None, settings=None):
        super(StitcherWidget, self).__init__(parent, state, settings)

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

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

        # General GUI settings
        if settings is None:
            settings = GeneralSettings()
        self._settings = settings

        # Connect do UI data update
        self._settings.data_updated.connect(self._data_updated)

        self._low_q_data = None
        self._medium_q_data = None
        self._high_q_data = None

        # Flag to know when a field has been modified by hand
        self._low_q_modified = False
        self._medium_q_modified = False
        self._high_q_modified = False

        self._referenceID = 0

        self._graph = "StitchedData"
        self._output_dir = self._settings.data_output_dir
        self._stitcher = None
        self._plotted = False
예제 #4
0
    def __init__(self,
                 parent=None,
                 state=None,
                 settings=None,
                 catalog_cls=None):
        super(SANSCatalogWidget, self).__init__(parent, state, settings)

        self._catalog_cls = catalog_cls

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

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

        # General GUI settings
        if settings is None:
            settings = GeneralSettings()
        self._settings = settings

        # Connect do UI data update
        self._settings.data_updated.connect(self._data_updated)
예제 #5
0
    def __init__(self,
                 parent=None,
                 state=None,
                 settings=None,
                 catalog_cls=None):
        super(SANSCatalogWidget, self).__init__(parent, state, settings)

        self._catalog_cls = catalog_cls

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

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

        # General GUI settings
        if settings is None:
            settings = GeneralSettings()
        self._settings = settings

        # Connect do UI data update
        self._settings.data_updated.connect(self._data_updated)
예제 #6
0
    def __init__(self, parent=None, state=None, settings=None):
        super(RemoteJobsWidget, self).__init__(parent, state, settings)

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

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

        # General GUI settings
        if settings is None:
            settings = GeneralSettings()
        self._settings = settings
예제 #7
0
    def __init__(self,
                 parent=None,
                 state=None,
                 settings=None,
                 name="EQSANS",
                 data_type=None,
                 data_proxy=None):
        super(SANSInstrumentWidget, self).__init__(parent,
                                                   state,
                                                   settings,
                                                   data_type=data_type,
                                                   data_proxy=data_proxy)

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

        self._summary = SummaryFrame(self)
        self.initialize_content()
        self._layout.addWidget(self._summary)

        self._masked_detectors = []

        if state is not None:
            self.set_state(state)
        else:
            instr = ReductionOptions()
            instr.instrument_name = name
            self.set_state(instr)

        # General GUI settings
        if settings is None:
            settings = GeneralSettings()
        self._settings = settings
        # Connect do UI data update
        self._settings.data_updated.connect(self._data_updated)
예제 #8
0
    def __init__(self, instrument=None, instrument_list=None):
        QtGui.QMainWindow.__init__(self)

        if REDUCTION_WARNING:
            message = "The reduction application has problems starting:\n\n"
            message += WARNING_MESSAGE
            QtGui.QMessageBox.warning(self, "WARNING", message)

        # Application settings
        settings = QtCore.QSettings()

        # Name handle for the instrument
        if instrument is None:
            instrument = unicode(settings.value("instrument_name", ''))
            if instrument_list is not None and instrument not in instrument_list:
                instrument = None

        self._instrument = instrument
        self._facility = None

        # List of allowed instrument
        self._instrument_list = instrument_list

        # Reduction interface
        self._interface = None

        # Recent files
        self._recent_files = settings.value("recent_files", [])
        if self._recent_files is None:  # An empty list saved to QSettings comes back as 'None'
            self._recent_files = []

        # Folder to open files in
        self._last_directory = unicode(settings.value("last_directory", '.'))
        self._last_export_directory = unicode(settings.value("last_export_directory", '.'))

        # Current file name
        self._filename = None

        # Cluster credentials and options
        self._cluster_details_set = False
        self._number_of_nodes = 1
        self._cores_per_node = 16
        self._compute_resources = ['Fermi']
        if IS_IN_MANTIDPLOT \
        and hasattr(ConfigService.Instance().getFacility(), "computeResources"):
            self._compute_resources = ConfigService.Instance().getFacility().computeResources()

        # Internal flag for clearing all settings and restarting the application
        self._clear_and_restart = False

        # General settings shared by all widgets
        self.general_settings = GeneralSettings(settings)

        self.setupUi(self)

        # Event connections
        if not IS_IN_MANTIDPLOT:
            self.reduce_button.hide()
        self.cluster_button.hide()
        self.connect(self.export_button, QtCore.SIGNAL("clicked()"), self._export)
        self.connect(self.reduce_button, QtCore.SIGNAL("clicked()"), self.reduce_clicked)
        self.connect(self.save_button, QtCore.SIGNAL("clicked()"), self._save)
        self.connect(self.interface_chk, QtCore.SIGNAL("clicked(bool)"), self._interface_choice)

        self.interface_chk.setChecked(self.general_settings.advanced)

        # Of the widgets that are part of the application, one is the ApplicationWindow.
        # The ApplicationWindow will send a shutting_down() signal when quitting,
        # after which we should close this window.
        # Note: there is no way to identify which Widget is the ApplicationWindow.
        for w in QtCore.QCoreApplication.instance().topLevelWidgets():
            self.connect(w, QtCore.SIGNAL("shutting_down()"), self.close)

        self.general_settings.progress.connect(self._progress_updated)
    def __init__(self, instrument=None, instrument_list=None):
        QMainWindow.__init__(self)
        self.ui = load_ui(__file__, 'ui/reduction_main.ui', baseinstance=self)

        if STARTUP_WARNING:
            message = "The reduction application has problems starting:\n\n"
            message += STARTUP_WARNING
            QMessageBox.warning(self, "WARNING", message)

        # Application settings
        settings = QSettings()

        # Name handle for the instrument
        if instrument is None:
            instrument = unicode(settings.value("instrument_name", ''))
            if instrument_list is not None and instrument not in instrument_list:
                instrument = None

        self._instrument = instrument
        self._facility = None

        # List of allowed instrument
        self._instrument_list = instrument_list

        # Reduction interface
        self._interface = None

        # Recent files
        self._recent_files = settings.value("recent_files", [])
        if self._recent_files is None:  # An empty list saved to QSettings comes back as 'None'
            self._recent_files = []

        # Folder to open files in
        self._last_directory = unicode(settings.value("last_directory", '.'))
        self._last_export_directory = unicode(
            settings.value("last_export_directory", '.'))

        # Current file name
        self._filename = None

        # Cluster credentials and options
        self._cluster_details_set = False
        self._number_of_nodes = 1
        self._cores_per_node = 16
        self._compute_resources = ['Fermi']
        if CAN_REDUCE and hasattr(ConfigService.Instance().getFacility(),
                                  "computeResources"):
            self._compute_resources = ConfigService.Instance().getFacility(
            ).computeResources()

        # Internal flag for clearing all settings and restarting the application
        self._clear_and_restart = False

        # General settings shared by all widgets
        self.general_settings = GeneralSettings(settings)

        # Event connections
        if not CAN_REDUCE:
            self.reduce_button.hide()
        self.export_button.clicked.connect(self._export)
        self.reduce_button.clicked.connect(self.reduce_clicked)
        self.save_button.clicked.connect(self._save)
        self.interface_chk.clicked.connect(self._interface_choice)

        self.interface_chk.setChecked(self.general_settings.advanced)

        self.general_settings.progress.connect(self._progress_updated)