#349 F_ALARM_ANY rsio output added

This commit is contained in:
Mikayla
2023-10-04 21:26:07 +00:00
parent ef6fdaa3ac
commit 24d190921d
5 changed files with 51 additions and 45 deletions

View File

@@ -746,18 +746,21 @@ function facility.new(num_reactors, cooling_conf)
-- handle facility ack
if self.io_ctl.digital_read(IO.F_ACK) then public.ack_all() end
-- update facility alarm output (check if emergency+ alarms are active)
local has_alarm = false
-- update facility alarm outputs
local has_prio_alarm, has_any_alarm = false, false
for i = 1, #self.units do
local u = self.units[i] ---@type reactor_unit
local u = self.units[i] ---@type reactor_unit
if u.has_alarm_min_prio(PRIO.EMERGENCY) then
has_alarm = true
has_prio_alarm, has_any_alarm = true, true
break
elseif u.has_alarm_min_prio(PRIO.TIMELY) then
has_any_alarm = true
end
end
self.io_ctl.digital_write(IO.F_ALARM, has_alarm)
self.io_ctl.digital_write(IO.F_ALARM, has_prio_alarm)
self.io_ctl.digital_write(IO.F_ALARM_ANY, has_any_alarm)
end
----------------

View File

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