pySimBlocks.gui.widgets.toolbar_view

class pySimBlocks.gui.widgets.toolbar_view.ToolBarView(saver: ProjectSaver, runner: SimulationRunner, project_controller: ProjectController)[source]

Bases: QToolBar

Application toolbar providing save, run, plot, and add-on actions.

saver

Service used to persist the project to disk.

runner

Service used to launch a simulation.

project_controller

Controller coordinating model and view mutations.

sofa_service

Service managing SOFA-specific operations.

sofa_action

Toolbar action for opening the SOFA dialog.

on_save() None[source]

Save the project and clear the dirty flag.

on_export_project() None[source]

Prompt to save if dirty, then export the project.

on_open_display_yaml() None[source]

Open the YAML viewer dialog for the current project.

on_open_simulation_settings() None[source]

Open the simulation settings dialog.

on_run_sim() None[source]

Run the simulation with a busy progress dialog.

discard_plot_dialog() None[source]

Destroy the plot window (e.g. after loading another project).

on_plot_logs() None[source]

Open or restore the plot dialog if simulation logs are available.

set_running(running: bool) None[source]

Enable or disable all toolbar actions based on the running state.

Parameters:

running – True to disable all actions, False to re-enable them.

refresh_sofa_button() None[source]

Show or hide the SOFA toolbar button based on project contents.

on_open_sofa_dialog() None[source]

Open the SOFA dialog if SOFA prerequisites are satisfied.

staticMetaObject = PySide6.QtCore.QMetaObject("ToolBarView" inherits "QToolBar": )