#102 #21 auto control loop with induction matrix and unit alarm checks and handling

This commit is contained in:
Mikayla Fischler
2023-02-07 00:32:50 -05:00
parent 1100051585
commit 1d3a1672c8
15 changed files with 327 additions and 133 deletions

View File

@@ -387,6 +387,19 @@ function plc.rps_init(reactor, is_formed)
if not quiet then log.info("RPS: reset") end
end
-- reset the automatic and timeout trip flags, then clear trip if that was the trip cause
function public.auto_reset()
self.state[state_keys.automatic] = false
self.state[state_keys.timeout] = false
if self.trip_cause == rps_status_t.automatic or self.trip_cause == rps_status_t.timeout then
self.trip_cause = rps_status_t.ok
self.tripped = false
end
log.info("RPS: auto reset")
end
return public
end
@@ -808,6 +821,10 @@ function plc.comms(id, version, modem, local_port, server_port, reactor, rps, co
-- reset the RPS status
rps.reset()
_send_ack(packet.type, true)
elseif packet.type == RPLC_TYPES.RPS_AUTO_RESET then
-- reset automatic SCRAM and timeout trips
rps.auto_reset()
_send_ack(packet.type, true)
elseif packet.type == RPLC_TYPES.AUTO_BURN_RATE then
-- automatic control requested a new burn rate
if (packet.length == 3) and (type(packet.data[1]) == "number") and (type(packet.data[3]) == "number") then

View File

@@ -14,7 +14,7 @@ local config = require("reactor-plc.config")
local plc = require("reactor-plc.plc")
local threads = require("reactor-plc.threads")
local R_PLC_VERSION = "beta-v0.10.4"
local R_PLC_VERSION = "beta-v0.10.5"
local print = util.print
local println = util.println

View File

@@ -266,6 +266,7 @@ function threads.thread__main(smem, init)
-- this thread cannot be slept because it will miss events (namely "terminate" otherwise)
if not plc_state.shutdown then
log.info("main thread restarting now...")
---@diagnostic disable-next-line: param-type-mismatch
util.push_event("clock_start")
end
end