#333 always set emergency coolant state

This commit is contained in:
Mikayla Fischler 2023-08-27 13:42:25 -04:00
parent 2ed28cf74d
commit 37f8b85924
2 changed files with 7 additions and 8 deletions

View File

@ -21,7 +21,7 @@ local supervisor = require("supervisor.supervisor")
local svsessions = require("supervisor.session.svsessions") local svsessions = require("supervisor.session.svsessions")
local SUPERVISOR_VERSION = "v1.0.1" local SUPERVISOR_VERSION = "v1.0.2"
local println = util.println local println = util.println
local println_ts = util.println_ts local println_ts = util.println_ts

View File

@ -793,12 +793,10 @@ function logic.handle_redstone(self)
local enable_emer_cool = self.plc_cache.rps_status.low_cool or local enable_emer_cool = self.plc_cache.rps_status.low_cool or
(self.auto_engaged and self.db.annunciator.CoolantLevelLow and is_active(self.alarms.ReactorOverTemp)) (self.auto_engaged and self.db.annunciator.CoolantLevelLow and is_active(self.alarms.ReactorOverTemp))
if not self.plc_cache.rps_trip then -- don't turn off emergency coolant on sufficient coolant level since it might drop again
-- can't turn off on sufficient coolant level since it might drop again
-- turn off once system is OK again -- turn off once system is OK again
-- if auto control is engaged, alarm check will SCRAM on reactor over temp so that's covered -- if auto control is engaged, alarm check will SCRAM on reactor over temp so that's covered
self.valves.emer_cool.close() if not self.plc_cache.rps_trip then
-- set turbines to not dump steam -- set turbines to not dump steam
for i = 1, #self.turbines do for i = 1, #self.turbines do
local session = self.turbines[i] ---@type unit_session local session = self.turbines[i] ---@type unit_session
@ -816,8 +814,6 @@ function logic.handle_redstone(self)
self.emcool_opened = false self.emcool_opened = false
elseif enable_emer_cool or self.emcool_opened then elseif enable_emer_cool or self.emcool_opened then
self.valves.emer_cool.open()
-- set turbines to dump excess steam -- set turbines to dump excess steam
for i = 1, #self.turbines do for i = 1, #self.turbines do
local session = self.turbines[i] ---@type unit_session local session = self.turbines[i] ---@type unit_session
@ -845,6 +841,9 @@ function logic.handle_redstone(self)
self.emcool_opened = true self.emcool_opened = true
end end
-- set valve state always
if self.emcool_opened then self.valves.emer_cool.open() else self.valves.emer_cool.close() end
end end
return logic return logic