nqrduck_spectrometer.settings#
Settings for the different spectrometers.
Classes
|
A setting that is a Boolean. |
|
A setting that is a Float. |
|
A setting that is an IP address. |
|
A setting that is an Integer. |
|
A setting that is a numerical value. |
|
A setting that is a selection from a list of options. |
|
A setting for the spectrometer is a value that is the same for all events in a pulse sequence. |
|
A setting that is a string. |
- class nqrduck_spectrometer.settings.BooleanSetting(*args: Any, **kwargs: Any)#
A setting that is a Boolean.
- Parameters:
name (str) – The name of the setting
default – The default value of the setting
description (str) – A description of the setting
- get_widget()#
Return a widget for the setting.
This returns a QCheckBox widget.
- Returns:
A QCheckBox widget that can be used to change the setting.
- Return type:
QCheckBox
- property value#
The value of the setting. In this case, a bool.
- class nqrduck_spectrometer.settings.FloatSetting(*args: Any, **kwargs: Any)#
A setting that is a Float.
- Parameters:
name (str) – The name of the setting
default – The default value of the setting
description (str) – A description of the setting
min_value – The minimum value of the setting
max_value – The maximum value of the setting
spin_box – A tuple with two booleans that determine if a spin box is used if the second value is True, a slider will be created as well.
- on_state_updated(state, text)#
Update the value of the setting.
- Parameters:
state (bool) – The state of the input (valid or not).
text (str) – The new value of the setting.
- property value#
The value of the setting. In this case, a float.
- class nqrduck_spectrometer.settings.IPSetting(*args: Any, **kwargs: Any)#
A setting that is an IP address.
- Parameters:
name (str) – The name of the setting
default – The default value of the setting
description (str) – A description of the setting
- property value#
The value of the setting. In this case, an IP address.
- class nqrduck_spectrometer.settings.IntSetting(*args: Any, **kwargs: Any)#
A setting that is an Integer.
- Parameters:
name (str) – The name of the setting
default – The default value of the setting
description (str) – A description of the setting
min_value – The minimum value of the setting
max_value – The maximum value of the setting
spin_box – A tuple with two booleans that determine if a spin box is used if the second value is True, a slider will be created as well.
- on_state_updated(state, text)#
Update the value of the setting.
- Parameters:
state (bool) – The state of the input (valid or not).
text (str) – The new value of the setting.
- property value#
The value of the setting. In this case, an int.
- class nqrduck_spectrometer.settings.NumericalSetting(*args: Any, **kwargs: Any)#
A setting that is a numerical value.
It can additionally have a minimum and maximum value.
- description_limit_info(description: str, min_value, max_value) str#
Updates the description with the limits of the setting if there are any.
- Parameters:
description (str) – The description of the setting.
min_value – The minimum value of the setting.
max_value – The maximum value of the setting.
- Returns:
The description of the setting with the limits.
- Return type:
str
- class nqrduck_spectrometer.settings.SelectionSetting(*args: Any, **kwargs: Any)#
A setting that is a selection from a list of options.
- Parameters:
name (str) – The name of the setting
options (list) – A list of options to choose from
default – The default value of the setting
description (str) – A description of the setting
- get_widget()#
Return a widget for the setting.
This returns a QComboBox widget.
- Returns:
A QComboBox widget that can be used to change the setting.
- Return type:
QComboBox
- property value#
The value of the setting. In this case, a string.
- class nqrduck_spectrometer.settings.Setting(*args: Any, **kwargs: Any)#
A setting for the spectrometer is a value that is the same for all events in a pulse sequence.
E.g. the Transmit gain or the number of points in a spectrum.
- Parameters:
name (str) – The name of the setting
description (str) – A description of the setting
default – The default value of the setting
- name#
The name of the setting
- Type:
str
- description#
A description of the setting
- Type:
str
- value#
The value of the setting
- widget#
The widget that is used to change the setting
- get_setting()#
Return the value of the setting.
- Returns:
The value of the setting.
- get_widget()#
Return a widget for the setting.
The default widget is simply a QLineEdit. This method can be overwritten by subclasses to return a different widget.
- Returns:
A QLineEdit widget that can be used to change the setting.
- Return type:
QLineEdit
- on_value_changed(value)#
This method is called when the value of the setting is changed.
- Parameters:
value (str) – The new value of the setting.
- class nqrduck_spectrometer.settings.StringSetting(*args: Any, **kwargs: Any)#
A setting that is a string.
- Parameters:
name (str) – The name of the setting
default – The default value of the setting
description (str) – A description of the setting
- property value#
The value of the setting. In this case, a string.