Exemplo n.º 1
0
    def __init__(self, context, parent):
        self.inst_view = InstrumentWidgetView(parent)
        self.grp_view = HomeGroupingWidgetView(parent)
        self.run_info_view = HomeRunInfoWidgetView(parent)
        self.plot_view = HomePlotWidgetView(parent)

        # keep a handle to the presenters of sub-widgets
        self.instrument_widget = InstrumentWidgetPresenter(self.inst_view,
                                                           InstrumentWidgetModel(context=context))
        self.group_widget = HomeGroupingWidgetPresenter(self.grp_view, HomeGroupingWidgetModel(context=context))
        self.run_info_widget = HomeRunInfoWidgetPresenter(self.run_info_view,
                                                          HomeRunInfoWidgetModel(context=context))
        self.plot_widget = HomePlotWidgetPresenter(self.plot_view, HomePlotWidgetModel(), context)
        self.home_tab_view = HomeTabView(parent=parent,
                                         widget_list=[self.inst_view,
                                                      self.grp_view,
                                                      self.plot_view,
                                                      self.run_info_view])
        self.home_tab_model = HomeTabModel(context=context)
        self.home_tab_widget = HomeTabPresenter(self.home_tab_view, self.home_tab_model,
                                                subwidgets=[self.instrument_widget,
                                                            self.group_widget,
                                                            self.plot_widget,
                                                            self.run_info_widget])

        context.update_view_from_model_notifier.add_subscriber(self.home_tab_widget.update_view_from_model_observer)
Exemplo n.º 2
0
    def __init__(self, context, parent):
        self.inst_view = InstrumentWidgetView(parent)
        self.grp_view = HomeGroupingWidgetView(parent)
        self.plot_view = HomePlotWidgetView(parent)
        self.run_info_view = HomeRunInfoWidgetView(parent)

        # keep a handle to the presenters of sub-widgets
        self.instrument_widget = InstrumentWidgetPresenter(
            self.inst_view, InstrumentWidgetModel(muon_data=context))
        self.group_widget = HomeGroupingWidgetPresenter(
            self.grp_view, HomeGroupingWidgetModel(muon_data=context))
        self.plot_widget = HomePlotWidgetPresenter(self.plot_view,
                                                   HomePlotWidgetModel())
        self.run_info_widget = HomeRunInfoWidgetPresenter(
            self.run_info_view, HomeRunInfoWidgetModel(muon_data=context))

        self.home_tab_view = HomeTabView(parent=parent,
                                         widget_list=[
                                             self.inst_view, self.grp_view,
                                             self.plot_view, self.run_info_view
                                         ])
        self.home_tab_model = HomeTabModel(muon_data=context)
        self.home_tab_widget = HomeTabPresenter(self.home_tab_view,
                                                self.home_tab_model,
                                                subwidgets=[
                                                    self.instrument_widget,
                                                    self.group_widget,
                                                    self.plot_widget,
                                                    self.run_info_widget
                                                ])
Exemplo n.º 3
0
    def setUp(self):
        self._qapp = mock_widget.mockQapp()
        self.obj = QtGui.QWidget()
        self.view = HomePlotWidgetView(self.obj)
        self.model = HomePlotWidgetModel()
        self.presenter = HomePlotWidgetPresenter(self.view, self.model)

        self.view.warning_popup = mock.MagicMock()
Exemplo n.º 4
0
    def setUp(self):
        self.context = mock.MagicMock()
        self.plotting_window_model = mock.MagicMock()
        self.view = mock.MagicMock()
        self.model = mock.MagicMock()
        self.workspace_list = ['MUSR62260; Group; bottom; Asymmetry; MA',
                               'MUSR62261; Group; bottom; Asymmetry; MA']

        self.presenter = HomePlotWidgetPresenter(self.view, self.model, self.context)
        self.presenter.get_plot_title = mock.MagicMock(return_value='MUSR62260-62261 bottom')
    def setUp(self):
        self.context = setup_context(True)
        self.plotting_window_model = mock.MagicMock()
        self.view = mock.MagicMock()
        self.model = mock.MagicMock()
        self.workspace_list = [
            'MUSR62260; Group; bottom; Asymmetry; FD',
            'MUSR62261; Group; bottom; Asymmetry; FD',
            'FFT; Re MUSR62260; Group; fwd; Asymmetry; FD; Im MUSR62260; Group; fwd; Asymmetry; FD_Im'
            'FFT; Re MUSR62260; Group; fwd; Asymmetry; FD; Im MUSR62260; Group; fwd; Asymmetry; FD_Re'
            'FFT; Re MUSR62260; Group; fwd; Asymmetry; FD; Im MUSR62260; Group; fwd; Asymmetry; FD_mod'
            'MUSR62260_raw_data FD; MaxEnt'
        ]

        self.presenter = HomePlotWidgetPresenter(self.view, self.model,
                                                 self.context)
        self.presenter.get_plot_title = mock.MagicMock(
            return_value='MUSR62260-62261 bottom')