#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 SUPERVISOR_VERSION = "v1.0.1"
local SUPERVISOR_VERSION = "v1.0.2"
local println = util.println
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
(self.auto_engaged and self.db.annunciator.CoolantLevelLow and is_active(self.alarms.ReactorOverTemp))
-- don't turn off emergency coolant on sufficient coolant level since it might drop 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 not self.plc_cache.rps_trip then
-- can't turn off on sufficient coolant level since it might drop 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
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
@ -816,8 +814,6 @@ function logic.handle_redstone(self)
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
@ -845,6 +841,9 @@ function logic.handle_redstone(self)
self.emcool_opened = true
end
-- set valve state always
if self.emcool_opened then self.valves.emer_cool.open() else self.valves.emer_cool.close() end
end
return logic