def setUp(self): self._qapp = mock_widget.mockQapp() # Store an empty widget to parent all the views, and ensure they are deleted correctly self.obj = QtGui.QWidget() self.context = MuonDataContext() self.context.instrument = 'EMU' self.data = MuonLoadData() self.view = LoadRunWidgetView(self.obj) self.model = LoadRunWidgetModel(self.data, self.context) self.presenter = LoadRunWidgetPresenter(self.view, self.model) self.view.warning_popup = mock.Mock() self.presenter.set_current_instrument("EMU") patcher = mock.patch('Muon.GUI.Common.load_run_widget.load_run_model.load_utils') self.addCleanup(patcher.stop) self.load_utils_patcher = patcher.start() self.load_utils_patcher.exception_message_for_failed_files.return_value = ''
def __init__(self, muon_data=MuonDataContext()): self._data = muon_data self._data.gui_variables['RebinType'] = 'None'
def __init__(self, muon_data=MuonDataContext()): self._data = muon_data
def __init__(self, parent=None): super(FrequencyAnalysisGui, self).__init__(parent) self.setFocusPolicy(QtCore.Qt.StrongFocus) try: check_facility() except AttributeError as error: self.warning_popup(error.args[0]) # initialise the data storing classes of the interface self.loaded_data = MuonLoadData() self.context = MuonDataContext(load_data=self.loaded_data) # construct all the widgets. self.load_widget = LoadWidget(self.loaded_data, self.context, self) self.grouping_tab_widget = GroupingTabWidget(self.context) self.home_tab = HomeTabWidget(self.context, self) freq_context = FrequencyContext(self.context) self.transform = TransformWidget(load=freq_context, parent=self) self.setup_tabs() self.help_widget = HelpWidget() central_widget = QtGui.QWidget() vertical_layout = QtGui.QVBoxLayout() vertical_layout.addWidget(self.load_widget.load_widget_view) vertical_layout.addWidget(self.tabs) vertical_layout.addWidget(self.help_widget.view) central_widget.setLayout(vertical_layout) self.setCentralWidget(central_widget) self.setWindowTitle("Frequency Domain Analysis version 2.0") self.home_tab.group_widget.pairAlphaNotifier.add_subscriber( self.grouping_tab_widget.group_tab_presenter.loadObserver) self.grouping_tab_widget.group_tab_presenter.groupingNotifier.add_subscriber( self.home_tab.home_tab_widget.groupingObserver) self.context.instrumentNotifier.add_subscriber( self.home_tab.home_tab_widget.instrumentObserver) self.context.instrumentNotifier.add_subscriber( self.load_widget.load_widget.instrumentObserver) self.context.instrumentNotifier.add_subscriber( self.grouping_tab_widget.group_tab_presenter.instrumentObserver) self.load_widget.load_widget.loadNotifier.add_subscriber( self.home_tab.home_tab_widget.loadObserver) self.load_widget.load_widget.loadNotifier.add_subscriber( self.grouping_tab_widget.group_tab_presenter.loadObserver) self.load_widget.load_widget.loadNotifier.add_subscriber( self.transform.LoadObserver) self.grouping_tab_widget.group_tab_presenter.groupingNotifier.add_subscriber( self.transform.GroupPairObserver) self.context.instrumentNotifier.add_subscriber( self.transform.instrumentObserver)
def __init__(self, data=MuonDataContext()): self._data = data
def setUp(self): self.context = MuonDataContext() self.context.instrument = 'EMU' self.model = LoadRunWidgetModel(MuonLoadData(), self.context)