#315 switch off dynamic tank fill mode if emergency coolant is required

This commit is contained in:
Mikayla Fischler
2023-08-20 22:56:51 -04:00
parent a92f182156
commit 504ee0594f
3 changed files with 61 additions and 17 deletions

View File

@@ -10,11 +10,13 @@ local qtypes = require("supervisor.session.rtu.qtypes")
local RPS_TRIP_CAUSE = types.RPS_TRIP_CAUSE
local TRI_FAIL = types.TRI_FAIL
local CONTAINER_MODE = types.CONTAINER_MODE
local DUMPING_MODE = types.DUMPING_MODE
local PRIO = types.ALARM_PRIORITY
local ALARM_STATE = types.ALARM_STATE
local TBV_RTU_S_DATA = qtypes.TBV_RTU_S_DATA
local DTV_RTU_S_DATA = qtypes.DTV_RTU_S_DATA
local IO = rsio.IO
@@ -826,6 +828,16 @@ function logic.handle_redstone(self)
end
end
-- make sure dynamic tanks are allowing outflow
for i = 1, #self.tanks do
local session = self.tanks[i] ---@type unit_session
local tank = session.get_db() ---@type dynamicv_session_db
if tank.state.container_mode == CONTAINER_MODE.FILL then
session.get_cmd_queue().push_data(DTV_RTU_S_DATA.SET_CONT_MODE, CONTAINER_MODE.BOTH)
end
end
if self.db.annunciator.EmergencyCoolant > 1 and not self.emcool_opened then
log.info(util.c("UNIT ", self.r_id, " emergency coolant valve opened"))
log.info(util.c("UNIT ", self.r_id, " turbines set to dump excess steam"))