Show xenon/iodine inventories on dashboard

This commit is contained in:
Codex Agent
2025-11-23 19:48:02 +01:00
parent ba4505701a
commit 70608efdc8
2 changed files with 13 additions and 5 deletions

View File

@@ -548,15 +548,14 @@ class ReactorDashboard:
inventory = state.core.fission_product_inventory or {}
particles = state.core.emitted_particles or {}
lines: list[tuple[str, str]] = []
def fmt(symbol: str, label: str) -> tuple[str, str]:
qty = inventory.get(symbol, 0.0)
def fmt(symbol: str, label: str, qty: float) -> tuple[str, str]:
threshold = constants.KEY_POISON_THRESHOLDS.get(symbol)
flag = " !" if threshold is not None and qty >= threshold else ""
return (f"{label}{flag}", f"{qty:9.2e}")
lines.append(fmt("Xe", "Xe (xenon)"))
lines.append(fmt("Sm", "Sm (samarium)"))
lines.append(fmt("I", "I (iodine)"))
lines.append(fmt("Xe", "Xe (xenon)", getattr(state.core, "xenon_inventory", 0.0)))
lines.append(fmt("Sm", "Sm (samarium)", inventory.get("Sm", 0.0)))
lines.append(fmt("I", "I (iodine)", getattr(state.core, "iodine_inventory", 0.0)))
lines.append(("Neutrons (src)", f"{particles.get('n', 0.0):9.2e}"))
lines.append(("Gammas", f"{particles.get('gamma', 0.0):9.2e}"))
lines.append(("Alphas", f"{particles.get('alpha', 0.0):9.2e}"))