From 801fd99448e2c26b05b5ddd118a563e7b291c144 Mon Sep 17 00:00:00 2001 From: Mikayla Date: Thu, 7 Nov 2024 16:46:38 +0000 Subject: [PATCH] #571 still check for critical unit alarms and facility radiation when induction matrix is disconnected --- supervisor/facility_update.lua | 56 +++++++++++++++++----------------- supervisor/startup.lua | 2 +- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/supervisor/facility_update.lua b/supervisor/facility_update.lua index 658de99..f60fe06 100644 --- a/supervisor/facility_update.lua +++ b/supervisor/facility_update.lua @@ -545,38 +545,38 @@ function update.auto_safety() log.info(util.c("FAC: charge state of induction matrix entered acceptable range <= ", ALARM_LIMS.CHARGE_RE_ENABLE * 100, "%")) end - -- check for critical unit alarms - astatus.crit_alarm = false - for i = 1, #self.units do - local u = self.units[i] - - if u.has_alarm_min_prio(PRIO.CRITICAL) then - astatus.crit_alarm = true - break - end - end - - -- check for facility radiation - if #self.envd > 0 then - local max_rad = 0 - - for i = 1, #self.envd do - local envd = self.envd[i] - local e_db = envd.get_db() - if e_db.radiation_raw > max_rad then max_rad = e_db.radiation_raw end - end - - astatus.radiation = max_rad >= ALARM_LIMS.FAC_HIGH_RAD - else - -- don't clear, if it is true then we lost it with high radiation, so just keep alarming - -- operator can restart the system or hit the stop/reset button - end - -- system not ready, will need to restart GEN_RATE mode -- clears when we enter the fault waiting state astatus.gen_fault = self.mode == PROCESS.GEN_RATE and not self.units_ready else - astatus.matrix_dc = true + astatus.matrix_fault = true + end + + -- check for critical unit alarms + astatus.crit_alarm = false + for i = 1, #self.units do + local u = self.units[i] + + if u.has_alarm_min_prio(PRIO.CRITICAL) then + astatus.crit_alarm = true + break + end + end + + -- check for facility radiation + if #self.envd > 0 then + local max_rad = 0 + + for i = 1, #self.envd do + local envd = self.envd[i] + local e_db = envd.get_db() + if e_db.radiation_raw > max_rad then max_rad = e_db.radiation_raw end + end + + astatus.radiation = max_rad >= ALARM_LIMS.FAC_HIGH_RAD + else + -- don't clear, if it is true then we lost it with high radiation, so just keep alarming + -- operator can restart the system or hit the stop/reset button end if (self.mode ~= PROCESS.INACTIVE) and (self.mode ~= PROCESS.SYSTEM_ALARM_IDLE) then diff --git a/supervisor/startup.lua b/supervisor/startup.lua index a8ebb91..2011059 100644 --- a/supervisor/startup.lua +++ b/supervisor/startup.lua @@ -22,7 +22,7 @@ local supervisor = require("supervisor.supervisor") local svsessions = require("supervisor.session.svsessions") -local SUPERVISOR_VERSION = "v1.5.11" +local SUPERVISOR_VERSION = "v1.5.12" local println = util.println local println_ts = util.println_ts