nqrduck_spectrometer.view#
View for the Spectrometer Module. Careful - this is not the base class for the spectrometer submodules, but the view for the spectrometer module itself.
Classes
|
The view for the spectrometer module. |
- class nqrduck_spectrometer.view.SpectrometerView(*args: Any, **kwargs: Any)#
The view for the spectrometer module. This class is responsible for displaying the spectrometer module in the main window.
It contains the menu buttons for the different spectrometers and the stacked widget that shows the different spectrometer views.
- Parameters:
module (Module) – The spectrometer module that this view belongs to
This method creates the menu entry for the spectrometer module. It creates a menu item for each spectrometer that is available.
- on_active_spectrometer_changed(module)#
This method is called when the active spectrometer is changed.
It changes the active view in the stacked widget to the one that was just activated.
- Parameters:
module (BaseSpectrometer) – The spectrometer module that was just activated
This method is called when a menu button is clicked.
It changes the active spectrometer to the one that was clicked. It also unchecks all other menu buttons.
- Parameters:
spectrometer_name (str) – The name of the spectrometer that was clicked
- on_spectrometer_added(module)#
This method changes the active spectrometer to the one that was just added.
- Parameters:
module (BaseSpectrometer) – The spectrometer module that was just added
- on_spectrometer_widget_changed(module)#
This method is called when a new spectrometer widget is added to the module.
It adds the widget to the stacked widget and sets it as the current widget.
- Parameters:
module (BaseSpectrometer) – The spectrometer module that was just added