code cleanup, type hints, bugfixes, and #98 removal of support for mek 10.0 RTU peripherals
This commit is contained in:
@@ -315,7 +315,7 @@ function plc.comms(id, version, modem, local_port, server_port, reactor, rps, co
|
||||
|
||||
-- send an RPLC packet
|
||||
---@param msg_type RPLC_TYPES
|
||||
---@param msg string
|
||||
---@param msg table
|
||||
local function _send(msg_type, msg)
|
||||
local s_pkt = comms.scada_packet()
|
||||
local r_pkt = comms.rplc_packet()
|
||||
@@ -329,7 +329,7 @@ function plc.comms(id, version, modem, local_port, server_port, reactor, rps, co
|
||||
|
||||
-- send a SCADA management packet
|
||||
---@param msg_type SCADA_MGMT_TYPES
|
||||
---@param msg string
|
||||
---@param msg table
|
||||
local function _send_mgmt(msg_type, msg)
|
||||
local s_pkt = comms.scada_packet()
|
||||
local m_pkt = comms.mgmt_packet()
|
||||
|
||||
@@ -13,7 +13,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.8.2"
|
||||
local R_PLC_VERSION = "beta-v0.8.3"
|
||||
|
||||
local print = util.print
|
||||
local println = util.println
|
||||
|
||||
@@ -194,7 +194,7 @@ function threads.thread__main(smem, init)
|
||||
while not plc_state.shutdown do
|
||||
local status, result = pcall(public.exec)
|
||||
if status == false then
|
||||
log.fatal(result)
|
||||
log.fatal(util.strval(result))
|
||||
end
|
||||
|
||||
-- if status is true, then we are probably exiting, so this won't matter
|
||||
@@ -337,7 +337,7 @@ function threads.thread__rps(smem)
|
||||
while not plc_state.shutdown do
|
||||
local status, result = pcall(public.exec)
|
||||
if status == false then
|
||||
log.fatal(result)
|
||||
log.fatal(util.strval(result))
|
||||
end
|
||||
|
||||
if not plc_state.shutdown then
|
||||
@@ -412,7 +412,7 @@ function threads.thread__comms_tx(smem)
|
||||
while not plc_state.shutdown do
|
||||
local status, result = pcall(public.exec)
|
||||
if status == false then
|
||||
log.fatal(result)
|
||||
log.fatal(util.strval(result))
|
||||
end
|
||||
|
||||
if not plc_state.shutdown then
|
||||
@@ -460,7 +460,7 @@ function threads.thread__comms_rx(smem)
|
||||
-- received a packet
|
||||
-- handle the packet (setpoints passed to update burn rate setpoint)
|
||||
-- (plc_state passed to check if degraded)
|
||||
plc_comms.handle_packet(msg.message, setpoints, plc_state)
|
||||
plc_comms.handle_packet(msg.message, plc_state, setpoints)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -486,7 +486,7 @@ function threads.thread__comms_rx(smem)
|
||||
while not plc_state.shutdown do
|
||||
local status, result = pcall(public.exec)
|
||||
if status == false then
|
||||
log.fatal(result)
|
||||
log.fatal(util.strval(result))
|
||||
end
|
||||
|
||||
if not plc_state.shutdown then
|
||||
@@ -610,7 +610,7 @@ function threads.thread__setpoint_control(smem)
|
||||
while not plc_state.shutdown do
|
||||
local status, result = pcall(public.exec)
|
||||
if status == false then
|
||||
log.fatal(result)
|
||||
log.fatal(util.strval(result))
|
||||
end
|
||||
|
||||
if not plc_state.shutdown then
|
||||
|
||||
Reference in New Issue
Block a user