#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