gui_widgets

gui_widgets.GUIController

class gui_widgets.GUIController.GUIController(input_form: InputForm, result_view: ResultView)[source]

Bases: object

Controller 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: QWidget

User 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:

ResultView

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

update_inputs(shape: str) None[source]

Show or hide input fields depending on selected geometry shape.

Parameters:

shape (str) – The selected shape (‘Cylinder’ or ‘Cuboid’).

Returns:

None

update_opening(shape: str) None[source]

Show or hide aperture dimension inputs depending on aperture type.

Parameters:

shape (str) – The selected aperture form (‘tube’ or ‘slit’).

Returns:

None

gui_widgets.resultView

class gui_widgets.resultView.ResultView[source]

Bases: QWidget

Visual 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

update_plot() None[source]

Re-render the plot when axis selections change.

Only works if results have already been shown at least once.

Parameters:

None

Returns:

None

Module contents