Exemple #1
0
    def __init__(self, context, parent):
        self.fitting_tab_view = FittingTabView(parent)
        self.fitting_tab_model = FittingTabModel(context)
        self.fitting_tab_presenter = FittingTabPresenter(self.fitting_tab_view, self.fitting_tab_model, context)

        self.fitting_tab_view.set_slot_for_select_workspaces_to_fit(self.fitting_tab_presenter.handle_select_fit_data_clicked)
        self.fitting_tab_view.set_slot_for_display_workspace_changed(self.fitting_tab_presenter.handle_display_workspace_changed)
        self.fitting_tab_view.set_slot_for_display_workspace_changed(self.fitting_tab_presenter.handle_plot_guess_changed)
        self.fitting_tab_view.set_slot_for_simul_fit_by_changed(self.fitting_tab_presenter.handle_fit_by_changed)
        self.fitting_tab_view.set_slot_for_simul_fit_specifier_changed(self.fitting_tab_presenter.handle_fit_specifier_changed)
        self.fitting_tab_view.set_slot_for_use_raw_changed(self.fitting_tab_presenter.handle_use_rebin_changed)
        self.fitting_tab_view.set_slot_for_fit_type_changed(self.fitting_tab_presenter.handle_fit_type_changed)
        self.fitting_tab_view.set_slot_for_fit_button_clicked(self.fitting_tab_presenter.handle_fit_clicked)
        self.fitting_tab_view.set_slot_for_start_x_updated(self.fitting_tab_presenter.handle_start_x_updated)
        self.fitting_tab_view.set_slot_for_end_x_updated(self.fitting_tab_presenter.handle_end_x_updated)
        self.fitting_tab_view.set_slot_for_fit_options_changed(self.fitting_tab_presenter.update_model_from_view)

        self.fitting_tab_view.function_browser.functionStructureChanged.connect(
            self.fitting_tab_presenter.handle_function_structure_changed)
        self.fitting_tab_view.function_browser.functionStructureChanged.connect(
            self.fitting_tab_presenter.handle_plot_guess_changed)
        self.fitting_tab_view.function_name_line_edit.textChanged.connect(
            self.fitting_tab_presenter.handle_fit_name_changed_by_user)
        self.fitting_tab_view.undo_fit_button.clicked.connect(self.fitting_tab_presenter.handle_undo_fit_clicked)
        context.update_view_from_model_notifier.add_subscriber(self.fitting_tab_presenter.update_view_from_model_observer)
        self.fitting_tab_view.tf_asymmetry_mode_checkbox.stateChanged.connect(self.fitting_tab_presenter.handle_tf_asymmetry_mode_changed)
        self.fitting_tab_view.plot_guess_checkbox.stateChanged.connect(self.fitting_tab_presenter.handle_plot_guess_changed)
        self.fitting_tab_view.function_browser.parameterChanged.connect(self.fitting_tab_presenter.handle_function_parameter_changed)
        self.fitting_tab_view.function_browser.parameterChanged.connect(self.fitting_tab_presenter.handle_plot_guess_changed)
Exemple #2
0
    def __init__(self, context, parent):
        is_frequency_domain = isinstance(context,
                                         FrequencyDomainAnalysisContext)
        fitting_options = FREQUENCY_DOMAIN_ANALYSIS_FITTING_OPTIONS if is_frequency_domain\
            else MUON_ANALYSIS_FITTING_OPTIONS

        self.fitting_tab_view = FittingTabView(
            simultaneous_item_list=fitting_options,
            is_frequency_domain=is_frequency_domain,
            parent=parent)
        self.fitting_tab_model = FittingTabModel(context)
        self.fitting_tab_presenter = FittingTabPresenter(
            self.fitting_tab_view, self.fitting_tab_model, context)

        self.fitting_tab_view.set_slot_for_select_workspaces_to_fit(
            self.fitting_tab_presenter.handle_select_fit_data_clicked)
        self.fitting_tab_view.set_slot_for_display_workspace_changed(
            self.fitting_tab_presenter.handle_display_workspace_changed)
        self.fitting_tab_view.set_slot_for_display_workspace_changed(
            self.fitting_tab_presenter.handle_plot_guess_changed)
        self.fitting_tab_view.set_slot_for_simul_fit_by_changed(
            self.fitting_tab_presenter.handle_fit_by_changed)
        self.fitting_tab_view.set_slot_for_simul_fit_specifier_changed(
            self.fitting_tab_presenter.handle_fit_specifier_changed)
        self.fitting_tab_view.set_slot_for_use_raw_changed(
            self.fitting_tab_presenter.handle_use_rebin_changed)
        self.fitting_tab_view.set_slot_for_fit_type_changed(
            self.fitting_tab_presenter.handle_fit_type_changed)
        self.fitting_tab_view.set_slot_for_fit_button_clicked(
            self.fitting_tab_presenter.handle_fit_clicked)
        self.fitting_tab_view.set_slot_for_start_x_updated(
            self.fitting_tab_presenter.handle_start_x_updated)
        self.fitting_tab_view.set_slot_for_end_x_updated(
            self.fitting_tab_presenter.handle_end_x_updated)
        self.fitting_tab_view.set_slot_for_minimiser_changed(
            self.fitting_tab_presenter.handle_minimiser_changed)
        self.fitting_tab_view.set_slot_for_evaluation_type_changed(
            self.fitting_tab_presenter.handle_evaluation_type_changed)

        self.fitting_tab_view.function_browser.functionStructureChanged.connect(
            self.fitting_tab_presenter.handle_function_structure_changed)
        self.fitting_tab_view.function_browser.functionStructureChanged.connect(
            self.fitting_tab_presenter.handle_plot_guess_changed)
        self.fitting_tab_view.function_name_line_edit.textChanged.connect(
            self.fitting_tab_presenter.handle_fit_name_changed_by_user)
        self.fitting_tab_view.undo_fit_button.clicked.connect(
            self.fitting_tab_presenter.handle_undo_fit_clicked)
        context.update_view_from_model_notifier.add_subscriber(
            self.fitting_tab_presenter.update_view_from_model_observer)
        self.fitting_tab_view.tf_asymmetry_mode_checkbox.stateChanged.connect(
            self.fitting_tab_presenter.handle_tf_asymmetry_mode_changed)
        self.fitting_tab_view.plot_guess_checkbox.stateChanged.connect(
            self.fitting_tab_presenter.handle_plot_guess_changed)
        self.fitting_tab_view.function_browser.parameterChanged.connect(
            self.fitting_tab_presenter.handle_function_parameter_changed)
    def __init__(self, context, parent):
        self.fitting_tab_view = FittingTabView(parent)
        self.fitting_tab_model = FittingTabModel()

        self.fitting_tab_presenter = FittingTabPresenter(self.fitting_tab_view, self.fitting_tab_model, context)

        self.fitting_tab_view.simul_fit_radio.toggled.connect(self.fitting_tab_presenter.clear_and_reset_gui_state)
        self.fitting_tab_view.set_slot_for_select_workspaces_to_fit(self.fitting_tab_presenter.handle_select_fit_data_clicked)
        self.fitting_tab_view.set_slot_for_display_workspace_changed(self.fitting_tab_presenter.handle_display_workspace_changed)
        self.fitting_tab_view.set_slot_for_use_raw_changed(self.fitting_tab_presenter.handle_use_rebin_changed)
        self.fitting_tab_view.set_slot_for_fit_type_changed(self.fitting_tab_presenter.handle_fit_type_changed)
        self.fitting_tab_view.set_slot_for_fit_button_clicked(self.fitting_tab_presenter.handle_fit_clicked)
        self.fitting_tab_view.set_slot_for_start_x_updated(self.fitting_tab_presenter.handle_start_x_updated)
        self.fitting_tab_view.set_slot_for_end_x_updated(self.fitting_tab_presenter.handle_end_x_updated)
        self.fitting_tab_view.function_browser.functionStructureChanged.connect(self.fitting_tab_presenter.clear_fit_information)