Exemplo n.º 1
0
    def __init__(self, view, load):
        self.view = view
        self.load = load
        self.thread = None
        # set data
        self.getWorkspaceNames()
        # connect
        self.view.maxEntButtonSignal.connect(self.handleMaxEntButton)
        self.view.cancelSignal.connect(self.cancel)

        self.phase_table_observer = GenericObserver(self.update_phase_table_options)
        self.calculation_finished_notifier = GenericObservable()
        self.calculation_started_notifier = GenericObservable()
    def __init__(self, view, model, context):
        """
        :param view: A reference to the QWidget object for plotting
        :param model: A refence to a model which contains the plotting logic
        :param context: A reference to the Muon context object
        """
        self._view = view
        self._model = model
        self.context = context
        self._view.on_plot_button_clicked(self.handle_data_updated)
        self._view.on_rebin_options_changed(
            self.handle_use_raw_workspaces_changed)
        self._view.on_plot_type_changed(self.handle_plot_type_changed)

        self.input_workspace_observer = GenericObserver(self.handle_data_updated)
        self.fit_observer = GenericObserver(self.handle_fit_completed)
        self.group_pair_observer = GenericObserver(self.handle_group_pair_to_plot_changed)
        self.plot_type_observer = GenericObserver(self.handle_group_pair_to_plot_changed)
        self.rebin_options_set_observer = GenericObserver(self.handle_rebin_options_set)
        self.plot_type_changed_notifier = GenericObservable()

        self._force_redraw = False
        if self.context._frequency_context:
            for ext in FREQUENCY_EXTENSIONS.keys():
                self._view.addItem(FREQ_PLOT_TYPE+FREQUENCY_EXTENSIONS[ext])
            self._view.addItem(FREQ_PLOT_TYPE+"All")
        self.instrument_observer = GenericObserver(self.handle_instrument_changed)
        self.keep = False
Exemplo n.º 3
0
    def __init__(self,
                 view,
                 model,
                 grouping_table_widget=None,
                 pairing_table_widget=None):
        self._view = view
        self._model = model

        self.grouping_table_widget = grouping_table_widget
        self.pairing_table_widget = pairing_table_widget

        # Synchronize the two tables
        self._view.on_grouping_table_changed(
            self.pairing_table_widget.update_view_from_model)
        self._view.on_pairing_table_changed(
            self.grouping_table_widget.update_view_from_model)

        self._view.set_description_text(self.text_for_description())
        self._view.on_add_pair_requested(self.add_pair_from_grouping_table)
        self._view.on_clear_grouping_button_clicked(self.on_clear_requested)
        self._view.on_load_grouping_button_clicked(
            self.handle_load_grouping_from_file)
        self._view.on_save_grouping_button_clicked(
            self.handle_save_grouping_file)
        self._view.on_default_grouping_button_clicked(
            self.handle_default_grouping_button_clicked)

        # monitors for loaded data changing
        self.loadObserver = GroupingTabPresenter.LoadObserver(self)
        self.instrumentObserver = GroupingTabPresenter.InstrumentObserver(self)

        # notifiers
        self.groupingNotifier = GroupingTabPresenter.GroupingNotifier(self)
        self.grouping_table_widget.on_data_changed(self.group_table_changed)
        self.pairing_table_widget.on_data_changed(self.pair_table_changed)
        self.enable_editing_notifier = GroupingTabPresenter.EnableEditingNotifier(
            self)
        self.disable_editing_notifier = GroupingTabPresenter.DisableEditingNotifier(
            self)
        self.calculation_finished_notifier = GenericObservable()

        self.guessAlphaObserver = GroupingTabPresenter.GuessAlphaObserver(self)
        self.pairing_table_widget.guessAlphaNotifier.add_subscriber(
            self.guessAlphaObserver)
        self.message_observer = GroupingTabPresenter.MessageObserver(self)
        self.gui_variables_observer = GroupingTabPresenter.GuiVariablesChangedObserver(
            self)
        self.enable_observer = GroupingTabPresenter.EnableObserver(self)
        self.disable_observer = GroupingTabPresenter.DisableObserver(self)

        self.update_view_from_model_observer = GenericObserver(
            self.update_view_from_model)
Exemplo n.º 4
0
 def __init__(self, view, alg, load):
     self.view = view
     self.alg = alg
     self.load = load
     self.thread = None
     # set data
     self.getWorkspaceNames()
     # connect
     self.view.tableClickSignal.connect(self.tableClicked)
     self.view.buttonSignal.connect(self.handleButton)
     self.view.phaseCheckSignal.connect(self.phaseCheck)
     self.calculation_finished_notifier = GenericObservable()
     self.view.setup_raw_checkbox_changed(self.handle_use_raw_data_changed)
    def __init__(self, view, model):
        self._view = view
        self._model = model

        self._view.on_grouppair_selection_changed(
            self.handle_grouppair_selector_changed)

        self._view.on_alpha_changed(self.handle_user_changes_alpha)

        self._view.on_summed_periods_changed(self.handle_periods_changed)
        self._view.on_subtracted_periods_changed(self.handle_periods_changed)

        self.pairAlphaNotifier = HomeGroupingWidgetPresenter.PairAlphaNotifier(
            self)
        self.selected_group_pair_changed_notifier = GenericObservable()