Persist manual control and pump states
This commit is contained in:
@@ -461,6 +461,21 @@ class Reactor:
|
||||
if health:
|
||||
self.health_monitor.load_snapshot(health)
|
||||
LOGGER.info("Reactor state restored from %s", filepath)
|
||||
# Back-fill pump state lists for compatibility.
|
||||
if not plant.primary_pumps or len(plant.primary_pumps) < 2:
|
||||
plant.primary_pumps = [
|
||||
PumpState(active=self.primary_pump_active, flow_rate=plant.primary_loop.mass_flow_rate / 2, pressure=plant.primary_loop.pressure)
|
||||
for _ in range(2)
|
||||
]
|
||||
if not plant.secondary_pumps or len(plant.secondary_pumps) < 2:
|
||||
plant.secondary_pumps = [
|
||||
PumpState(
|
||||
active=self.secondary_pump_active,
|
||||
flow_rate=plant.secondary_loop.mass_flow_rate / 2,
|
||||
pressure=plant.secondary_loop.pressure,
|
||||
)
|
||||
for _ in range(2)
|
||||
]
|
||||
if len(plant.turbines) < len(self.turbines):
|
||||
ambient = constants.ENVIRONMENT_TEMPERATURE
|
||||
while len(plant.turbines) < len(self.turbines):
|
||||
|
||||
Reference in New Issue
Block a user