diff --git a/hyperspy_gui_traitsui/hyperspy_extension.yaml b/hyperspy_gui_traitsui/hyperspy_extension.yaml index 927e0ab..a001b25 100644 --- a/hyperspy_gui_traitsui/hyperspy_extension.yaml +++ b/hyperspy_gui_traitsui/hyperspy_extension.yaml @@ -60,4 +60,7 @@ GUI: function: microscope_parameters_EDS_SEM hyperspy.microscope_parameters_EDS_TEM: module: hyperspy_gui_traitsui.microscope_parameters - function: microscope_parameters_EDS_TEM \ No newline at end of file + function: microscope_parameters_EDS_TEM + hyperspy.EELSModel.estimate_and_set_coreloss_edge_onset: + module: hyperspy_gui_traitsui.model + function: estimate_and_set_coreloss_edge_onset_traitsui diff --git a/hyperspy_gui_traitsui/model.py b/hyperspy_gui_traitsui/model.py index 14cd46c..797084b 100644 --- a/hyperspy_gui_traitsui/model.py +++ b/hyperspy_gui_traitsui/model.py @@ -25,3 +25,26 @@ def fit_component_tratisui(obj, **kwargs): handler=ComponentFitHandler, ) return obj, {"view": fit_component_view} + + +class EstimateAndSetCorelossEdgeOnsetHandler(SpanSelectorInSignal1DHandler): + + def fit(self, info): + """Handles the **Apply** button being clicked. + + """ + obj = info.object + obj._set_onset_fired() + return + + +@add_display_arg +def estimate_and_set_coreloss_edge_onset_traitsui(obj, **kwargs): + estimate_and_set_coreloss_edge_onset_view = tu.View( + tu.Item('percent_position', show_label=True,), + tu.Item('only_current', show_label=True,), + buttons=[OurFitButton, OurCloseButton], + title='Set edge onset', + handler=EstimateAndSetCorelossEdgeOnsetHandler, + ) + return obj, {"view": estimate_and_set_coreloss_edge_onset_view}