Launching of simulation application
This commit is contained in:
@@ -16,7 +16,7 @@ from bedit_gui.commands.rename_component_command import RenameComponentCommand
|
||||
from bedit_gui.commands.rename_document_command import RenameDocumentCommand
|
||||
from bedit_gui.commands.simulation_database_command import ChangeSimulationDatabaseCommand
|
||||
from bedit_gui.commands.component_command import AddEmptyEquationComponent, AddEmptyGraphComponent, DeleteComponent, PasteComponents
|
||||
from bedit_gui.models import Icon, IconDatabase, SimulationDatabase
|
||||
from bedit_gui.models import Icon, IconDatabase, Simulation, SimulationDatabase
|
||||
from bedit_gui.services import document_files
|
||||
|
||||
|
||||
@@ -131,6 +131,10 @@ class Document(QObject):
|
||||
def simulation_database(self) -> SimulationDatabase:
|
||||
return self.stored_simulation_database() or SimulationDatabase()
|
||||
|
||||
def active_simulation(self) -> Simulation | None:
|
||||
database = self.simulation_database()
|
||||
return database.simulations.get(database.active_simulation) if database.active_simulation is not None else None
|
||||
|
||||
def change_simulation_database(self, database: SimulationDatabase) -> None:
|
||||
if database != self.stored_simulation_database():
|
||||
self.undo_stack.push(ChangeSimulationDatabaseCommand(self, database))
|
||||
|
||||
Reference in New Issue
Block a user