A widget for configuring Wavelength-specific settings, primarily the preferred start frequency.
More...
#include <wavelength_settings_widget.h>
|
| void | SetupUi () |
| | Creates and arranges all the UI elements (labels, inputs, layouts) for the widget. Sets up the frequency value input field with a validator and the unit selection combo box.
|
| |
| bool | ValidateFrequencyInput (double &hz) |
| | Validates the frequency value and unit entered by the user. Checks if the value is a positive number, within the unit's limit (<= 999.9), and if the resulting frequency in Hz is within the global limits (>= 130 Hz, <= 999.9 MHz). Displays warning messages for invalid input.
|
| |
A widget for configuring Wavelength-specific settings, primarily the preferred start frequency.
This widget provides UI elements (line edit, combo box) to allow the user to set their preferred starting frequency when searching for available wavelengths. It includes input validation to ensure the frequency is within acceptable limits (130 Hz to 999.9 MHz). It interacts with the WavelengthConfig singleton to load and save this setting.
◆ WavelengthSettingsWidget()
| WavelengthSettingsWidget::WavelengthSettingsWidget |
( |
QWidget * | parent = nullptr | ) |
|
|
explicit |
◆ ~WavelengthSettingsWidget()
| WavelengthSettingsWidget::~WavelengthSettingsWidget |
( |
| ) |
|
|
overridedefault |
◆ LoadSettings()
| void WavelengthSettingsWidget::LoadSettings |
( |
| ) |
const |
Loads the current preferred start frequency from WavelengthConfig and updates the UI elements. Converts the stored frequency (in Hz) to an appropriate unit (Hz, kHz, MHz) for display.
◆ SaveSettings()
| void WavelengthSettingsWidget::SaveSettings |
( |
| ) |
|
Validates the frequency input and saves the preferred start frequency back to WavelengthConfig. Converts the user input (value and unit) back to Hz before saving. Displays warnings if input is invalid.
◆ SetupUi()
| void WavelengthSettingsWidget::SetupUi |
( |
| ) |
|
|
private |
Creates and arranges all the UI elements (labels, inputs, layouts) for the widget. Sets up the frequency value input field with a validator and the unit selection combo box.
◆ ValidateFrequencyInput()
| bool WavelengthSettingsWidget::ValidateFrequencyInput |
( |
double & | hz | ) |
|
|
private |
Validates the frequency value and unit entered by the user. Checks if the value is a positive number, within the unit's limit (<= 999.9), and if the resulting frequency in Hz is within the global limits (>= 130 Hz, <= 999.9 MHz). Displays warning messages for invalid input.
- Parameters
-
| [out] | hz | The validated frequency converted to Hertz if validation succeeds. |
- Returns
- True if the input is valid, false otherwise.
◆ config_
◆ frequency_unit_combo_
| QComboBox* WavelengthSettingsWidget::frequency_unit_combo_ |
|
private |
Combo box for selecting the unit (Hz, kHz, MHz) of the preferred frequency.
◆ frequency_value_edit_
| QLineEdit* WavelengthSettingsWidget::frequency_value_edit_ |
|
private |
Input field for the numerical value of the preferred frequency.
◆ language_combo_
| QComboBox* WavelengthSettingsWidget::language_combo_ |
|
private |
Combo box for selecting the application language.
◆ translator_
The documentation for this class was generated from the following files: