#153 facility alarm acknowledge button

This commit is contained in:
Mikayla Fischler
2023-02-07 18:44:34 -05:00
parent 678dafa62f
commit 07ee792163
11 changed files with 55 additions and 32 deletions

View File

@@ -233,6 +233,9 @@ function coordinator.new_session(id, in_queue, out_queue, facility)
else
log.debug(log_header .. "CRDN auto start (with configuration) packet length mismatch")
end
elseif cmd == FAC_COMMANDS.ACK_ALL_ALARMS then
facility.ack_all()
_send(SCADA_CRDN_TYPES.FAC_CMD, { cmd, true })
else
log.debug(log_header .. "CRDN facility command unknown")
end

View File

@@ -556,6 +556,14 @@ function facility.new(num_reactors, cooling_conf)
end
end
-- ack all alarms on all reactor units
function public.ack_all()
for i = 1, #self.units do
local u = self.units[i] ---@type reactor_unit
u.ack_all()
end
end
-- stop auto control
function public.auto_stop()
self.mode = PROCESS.INACTIVE