GUI Utilities

B-ASIC GUI utilities.

This module contains GUI classes that have a general use and are not strictly related to either the Block Diagram GUI or Scheduler GUI.

gui_utils.decorators module

b_asic.gui_utils.decorators.decorate_class(decorator)
b_asic.gui_utils.decorators.handle_error(fn)

gui_utils.about_window module

class b_asic.gui_utils.about_window.AboutWindow(window)

About window.

b_asic.gui_utils.about_window.show_about_window()

Simply show the about window.

gui_utils.color_button module

Qt button for use in preference dialogs, selecting color.

class b_asic.gui_utils.color_button.ColorButton(color: QColor, *args, **kwargs)

Button to select color.

Parameters:
colorQColor

The initial color of the button.

*args, **kwargs

Additional arguments are passed to QPushButton.

property color

Current color.

mousePressEvent(self, e: QMouseEvent | None)
pick_color()

Show color-picker dialog to select color.

set_color(color: QColor)

Set new color.

gui_utils.plot_window module

PlotWindow is a window in which simulation results are plotted.

class b_asic.gui_utils.plot_window.PlotWindow(sim_result: Mapping[ResultKey, Sequence[int | float | complex]], sfg_name: str | None = None)

Dialog for plotting the result of a simulation.

Parameters:
sim_resultdict

Simulation results of the form obtained from results.

sfg_namestr, optional

The name of the SFG.

parentoptional

The parent window.

b_asic.gui_utils.plot_window.start_simulation_dialog(sim_results: Dict[str, List[complex]], sfg_name: str | None = None)

Display the simulation results window.

Parameters:
sim_resultsdict

Simulation results of the form obtained from results.

sfg_namestr, optional

The name of the SFG.