feat: add realtime dashboard control

This commit is contained in:
Andrii Prokhorov
2025-11-21 17:22:02 +02:00
parent 15f2930b0c
commit 146e8fd26b
4 changed files with 201 additions and 1 deletions

View File

@@ -75,8 +75,20 @@ def main() -> None:
sim = ReactorSimulation(reactor, timestep=5.0, duration=duration, realtime=realtime)
load_path = os.getenv("FISSION_LOAD_STATE")
save_path = os.getenv("FISSION_SAVE_STATE")
dashboard_mode = os.getenv("FISSION_DASHBOARD", "0") == "1"
if load_path:
sim.start_state = reactor.load_state(load_path)
if dashboard_mode:
from .dashboard import ReactorDashboard
dashboard = ReactorDashboard(
reactor,
start_state=sim.start_state,
timestep=sim.timestep,
save_path=save_path,
)
dashboard.run()
return
try:
if realtime:
LOGGER.info("Running in real-time mode (Ctrl+C to stop)...")