gui_widgets
gui_widgets.GUIController
- class gui_widgets.GUIController.GUIController(input_form: InputForm, result_view: ResultView)[source]
Bases:
objectController class connecting the InputForm and ResultView components.
It handles the coordination between GUI inputs and backend simulation logic, and updates the result view based on calculated data.
- calculate_and_show() None[source]
Run the simulation using input parameters and update the result view.
This method: - Retrieves parameters from the input form - Runs the simulation via the forward() function - Extracts results (resonance frequency, Q-factor, absorption area) - Passes result data to the result view for plotting and display
On failure, a critical QMessageBox is shown.
- Parameters:
None
- Returns:
None
gui_widgets.inputForm
- class gui_widgets.inputForm.InputForm[source]
Bases:
QWidgetUser interface component for inputting resonator configuration parameters.
This form includes user inputs for: - Geometry (cylinder or cuboid) - Aperture (form, amount, dimensions, damping) - Boundary conditions (inner/outer endings) - Environmental conditions (temperature, humidity) - Loading configuration files (JSON)
- result_view
Reference to the result view for accessing selected axes.
- Type:
- add_enum_combobox(label: str, trait_name: str, layout) QComboBox[source]
Create a QComboBox filled with enum values from a given trait.
- Parameters:
label (str) – Label shown next to the combobox.
trait_name (str) – Name of the trait to extract enum values from.
layout (QFormLayout) – Layout to which the row will be added.
- Returns:
The created and populated combobox.
- Return type:
QComboBox
- get_inputs() dict | None[source]
Collect and validate all user inputs to build the simulation input dictionary.
- Parameters:
None
- Returns:
- A dictionary with geometry, aperture, environmental, and plot parameters,
or None if input validation failed.
- Return type:
dict | None
- load_from_json_file() None[source]
Load simulation parameters from a JSON file and update all form fields accordingly. :param None:
- Returns:
None
- toggle_damping_input(state: int) None[source]
Enable or disable the damping coefficient input based on the checkbox state.
- Parameters:
state (int) – Qt.Checked (2) oder Qt.Unchecked (0)
- Returns:
None
gui_widgets.resultView
- class gui_widgets.resultView.ResultView[source]
Bases:
QWidgetVisual component for displaying the simulation results in the GUI.
This widget includes: - Dropdowns to control the X and Y axes of the plot - A Matplotlib plot with toolbar - Labels showing computed quantities such as resonance frequency, Q-factor,
peak absorption area, and impedance components.
- show_results(f0: float, data: dict, q_factor: float = None, a_max: float = None) None[source]
Update the plot and display numerical results.
- Parameters:
f0 (float) – Resonance frequency in Hz
data (dict) – Dict with ‘x’ and ‘y’ arrays (based on dropdown selection)
q_factor (float | None) – Optional Q-factor
a_max (float | None) – Optional maximum absorption area [m²]
- Returns:
None