Resulable besim handof so recompiling model does not give second besim window

This commit is contained in:
2026-08-02 12:05:08 +02:00
parent 4b565edb5c
commit c8373c3423
6 changed files with 150 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ from bedit_gui.documents import Document
from bedit_gui.services import simulation_files
from bedit_gui.services.application_logging import get_logger
from bedit_gui.services.simulation_loader import component_choices
from bedit_gui.services.simulation_handoff import send_simulation_handoff
from bedit_gui.simulation_models import CompiledModel, SimulationRoot
from bedit_gui.views.main_window import MainWindow
from bedit_simulation import ModelBuildResult, compile_component_sync
@@ -24,6 +25,8 @@ Launcher = Callable[[Path, CompiledModel], bool]
def _launch_simulator(path: Path, compiled_model: CompiledModel) -> bool:
if send_simulation_handoff(path, compiled_model):
return True
arguments = ["-m", "bedit_gui.simulation_application", "--handoff", "--model-name", compiled_model.model_name, "--executable", compiled_model.executable, "--working-directory", compiled_model.working_directory, str(path)]
launched = QProcess.startDetached(sys.executable, arguments)
return launched[0] if isinstance(launched, tuple) else bool(launched)