Show boron and measured power on dashboard

This commit is contained in:
Codex Agent
2025-11-28 20:54:08 +01:00
parent 5469f142a7
commit c0b97cbe6b

View File

@@ -425,6 +425,8 @@ class ReactorDashboard:
("Rod Mode", "AUTO" if not self.reactor.control.manual_control else "MANUAL"), ("Rod Mode", "AUTO" if not self.reactor.control.manual_control else "MANUAL"),
("Setpoint", f"{self.reactor.control.setpoint_mw:7.0f} MW"), ("Setpoint", f"{self.reactor.control.setpoint_mw:7.0f} MW"),
("Reactivity", f"{state.core.reactivity_margin:+.4f}"), ("Reactivity", f"{state.core.reactivity_margin:+.4f}"),
("Boron", f"{state.boron_ppm:7.1f} ppm"),
("P(meas)", f"{self._measured_power(state):6.1f} MW"),
], ],
) )
left_y = self._draw_section( left_y = self._draw_section(
@@ -800,6 +802,14 @@ class ReactorDashboard:
enthalpy_kjkg = (constants.STEAM_LATENT_HEAT / 1_000.0) enthalpy_kjkg = (constants.STEAM_LATENT_HEAT / 1_000.0)
return (enthalpy_kjkg * mass_flow) / 1_000.0 return (enthalpy_kjkg * mass_flow) / 1_000.0
def _measured_power(self, state: PlantState) -> float:
ctl = getattr(self, "reactor", None)
if ctl and getattr(ctl, "control", None):
filtered = getattr(ctl.control, "_filtered_power_mw", 0.0)
if filtered > 0.0:
return filtered
return state.core.power_output_mw
def _desired_throttle(self, turbine_state) -> float: def _desired_throttle(self, turbine_state) -> float:
if not self.reactor.turbines: if not self.reactor.turbines:
return 0.0 return 0.0