#173 dump excess steam on opening emergency coolant

This commit is contained in:
Mikayla Fischler 2023-02-25 14:11:40 -05:00
parent 523ac91c3b
commit fbb992ff12
8 changed files with 43 additions and 17 deletions

View File

@ -19,7 +19,7 @@ local iocontrol = require("coordinator.iocontrol")
local renderer = require("coordinator.renderer")
local sounder = require("coordinator.sounder")
local COORDINATOR_VERSION = "v0.11.3"
local COORDINATOR_VERSION = "v0.11.4"
local print = util.print
local println = util.println

View File

@ -238,7 +238,7 @@ local function init(parent, id)
local rcs_tags = Div{parent=rcs,width=2,height=14,x=29,y=9}
local c_flt = IndicatorLight{parent=rcs_annunc,label="RCS Hardware Fault",colors=cpair(colors.yellow,colors.gray)}
local c_emg = TriIndicatorLight{parent=rcs_annunc,label="Emergency Coolant",c1=colors.gray,c2=colors.white,c3=colors.yellow}
local c_emg = TriIndicatorLight{parent=rcs_annunc,label="Emergency Coolant",c1=colors.gray,c2=colors.white,c3=colors.green}
local c_cfm = IndicatorLight{parent=rcs_annunc,label="Coolant Feed Mismatch",colors=cpair(colors.yellow,colors.gray)}
local c_brm = IndicatorLight{parent=rcs_annunc,label="Boil Rate Mismatch",colors=cpair(colors.yellow,colors.gray)}
local c_sfm = IndicatorLight{parent=rcs_annunc,label="Steam Feed Mismatch",colors=cpair(colors.yellow,colors.gray)}

View File

@ -3,9 +3,9 @@
"bootloader": "0.2",
"comms": "1.4.0",
"reactor-plc": "v0.12.1",
"rtu": "v0.12.1",
"supervisor": "v0.13.1",
"coordinator": "v0.11.3",
"rtu": "v0.12.2",
"supervisor": "v0.13.2",
"coordinator": "v0.11.4",
"pocket": "alpha-v0.0.0"
},
"files": {
@ -183,8 +183,8 @@
"lockbox": 100797,
"reactor-plc": 75545,
"rtu": 83090,
"supervisor": 269955,
"coordinator": 179370,
"supervisor": 271106,
"coordinator": 179369,
"pocket": 335
}
}

View File

@ -47,7 +47,7 @@ function turbinev_rtu.new(turbine)
unit.connect_input_reg(turbine.getEnergyFilledPercentage)
-- holding registers --
unit.connect_holding_reg(turbine.setDumpingMode, turbine.getDumpingMode)
unit.connect_holding_reg(turbine.getDumpingMode, turbine.setDumpingMode)
return unit.interface()
end

View File

@ -25,7 +25,7 @@ local sna_rtu = require("rtu.dev.sna_rtu")
local sps_rtu = require("rtu.dev.sps_rtu")
local turbinev_rtu = require("rtu.dev.turbinev_rtu")
local RTU_VERSION = "v0.12.1"
local RTU_VERSION = "v0.12.2"
local RTU_UNIT_TYPE = types.RTU_UNIT_TYPE

View File

@ -14,7 +14,7 @@ local svsessions = require("supervisor.session.svsessions")
local config = require("supervisor.config")
local supervisor = require("supervisor.supervisor")
local SUPERVISOR_VERSION = "v0.13.1"
local SUPERVISOR_VERSION = "v0.13.2"
local print = util.print
local println = util.println

View File

@ -523,7 +523,7 @@ function unit.new(reactor_id, num_boilers, num_turbines)
---@nodiscard
---@return integer lim_br100
function public.a_get_effective_limit()
if not self.db.control.ready or self.db.control.degraded or self.plc_cache.rps_trip then
if (not self.db.control.ready) or self.db.control.degraded or self.plc_cache.rps_trip then
self.db.control.br100 = 0
return 0
else

View File

@ -1,16 +1,20 @@
local const = require("scada-common.constants")
local log = require("scada-common.log")
local rsio = require("scada-common.rsio")
local types = require("scada-common.types")
local util = require("scada-common.util")
local const = require("scada-common.constants")
local log = require("scada-common.log")
local rsio = require("scada-common.rsio")
local types = require("scada-common.types")
local util = require("scada-common.util")
local plc = require("supervisor.session.plc")
local plc = require("supervisor.session.plc")
local qtypes = require("supervisor.session.rtu.qtypes")
local TRI_FAIL = types.TRI_FAIL
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 IO = rsio.IO
local PLC_S_CMDS = plc.PLC_S_CMDS
@ -754,16 +758,38 @@ function logic.handle_redstone(self)
-- if auto control is engaged, alarm check will SCRAM on reactor over temp so that's covered
self.valves.emer_cool.close()
-- set turbines to not dump steam
for i = 1, #self.turbines do
local session = self.turbines[i] ---@type unit_session
local turbine = session.get_db() ---@type turbinev_session_db
if turbine.state.dumping_mode ~= DUMPING_MODE.IDLE then
session.get_cmd_queue().push_data(TBV_RTU_S_DATA.SET_DUMP_MODE, DUMPING_MODE.IDLE)
end
end
if self.db.annunciator.EmergencyCoolant > 1 and self.emcool_opened then
log.info(util.c("UNIT ", self.r_id, " emergency coolant valve closed"))
log.info(util.c("UNIT ", self.r_id, " turbines set to not dump steam"))
end
self.emcool_opened = false
elseif enable_emer_cool or self.emcool_opened then
self.valves.emer_cool.open()
-- set turbines to dump excess steam
for i = 1, #self.turbines do
local session = self.turbines[i] ---@type unit_session
local turbine = session.get_db() ---@type turbinev_session_db
if turbine.state.dumping_mode ~= DUMPING_MODE.DUMPING_EXCESS then
session.get_cmd_queue().push_data(TBV_RTU_S_DATA.SET_DUMP_MODE, DUMPING_MODE.DUMPING_EXCESS)
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"))
end
self.emcool_opened = true