mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
#214 log level cleanup
This commit is contained in:
parent
fee54db43e
commit
2371a75130
@ -515,7 +515,7 @@ function coordinator.comms(version, modem, sv_port, sv_listen, api_listen, range
|
||||
elseif packet.type == SCADA_CRDN_TYPE.UNIT_STATUSES then
|
||||
-- update statuses
|
||||
if not iocontrol.update_unit_statuses(packet.data) then
|
||||
log.error("received invalid UNIT_STATUSES packet")
|
||||
log.debug("received invalid UNIT_STATUSES packet")
|
||||
end
|
||||
elseif packet.type == SCADA_CRDN_TYPE.UNIT_CMD then
|
||||
-- unit command acknowledgement
|
||||
@ -551,7 +551,7 @@ function coordinator.comms(version, modem, sv_port, sv_listen, api_listen, range
|
||||
log.debug("SCADA_CRDN unit command ack packet length mismatch")
|
||||
end
|
||||
else
|
||||
log.warning("received unknown SCADA_CRDN packet type " .. packet.type)
|
||||
log.debug("received unknown SCADA_CRDN packet type " .. packet.type)
|
||||
end
|
||||
else
|
||||
log.debug("discarding SCADA_CRDN packet before linked")
|
||||
@ -606,11 +606,11 @@ function coordinator.comms(version, modem, sv_port, sv_listen, api_listen, range
|
||||
end
|
||||
elseif est_ack == ESTABLISH_ACK.COLLISION then
|
||||
if self.last_est_ack ~= est_ack then
|
||||
log.info("supervisor connection denied due to collision")
|
||||
log.warning("supervisor connection denied due to collision")
|
||||
end
|
||||
elseif est_ack == ESTABLISH_ACK.BAD_VERSION then
|
||||
if self.last_est_ack ~= est_ack then
|
||||
log.info("supervisor comms version mismatch")
|
||||
log.warning("supervisor comms version mismatch")
|
||||
end
|
||||
else
|
||||
log.debug("SCADA_MGMT establish packet reply (len = 1) unsupported")
|
||||
|
@ -19,7 +19,7 @@ local iocontrol = require("coordinator.iocontrol")
|
||||
local renderer = require("coordinator.renderer")
|
||||
local sounder = require("coordinator.sounder")
|
||||
|
||||
local COORDINATOR_VERSION = "v0.12.6"
|
||||
local COORDINATOR_VERSION = "v0.12.7"
|
||||
|
||||
local println = util.println
|
||||
local println_ts = util.println_ts
|
||||
|
@ -774,8 +774,10 @@ function plc.comms(id, version, modem, local_port, server_port, range, reactor,
|
||||
-- print a log message to the terminal as long as the UI isn't running
|
||||
local function println_ts(message) if not plc_state.fp_ok then util.println_ts(message) end end
|
||||
|
||||
local l_port = packet.scada_frame.local_port()
|
||||
|
||||
-- handle packets now that we have prints setup
|
||||
if packet.scada_frame.local_port() == local_port then
|
||||
if l_port == local_port then
|
||||
-- check sequence number
|
||||
if self.r_seq_num == nil then
|
||||
self.r_seq_num = packet.scada_frame.seq_num()
|
||||
@ -1040,6 +1042,8 @@ function plc.comms(id, version, modem, local_port, server_port, range, reactor,
|
||||
-- should be unreachable assuming packet is from parse_packet()
|
||||
log.error("illegal packet type " .. protocol, true)
|
||||
end
|
||||
else
|
||||
log.debug("received packet on unconfigured channel " .. l_port, true)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -18,7 +18,7 @@ local plc = require("reactor-plc.plc")
|
||||
local renderer = require("reactor-plc.renderer")
|
||||
local threads = require("reactor-plc.threads")
|
||||
|
||||
local R_PLC_VERSION = "v1.1.7"
|
||||
local R_PLC_VERSION = "v1.1.8"
|
||||
|
||||
local println = util.println
|
||||
local println_ts = util.println_ts
|
||||
|
@ -313,7 +313,7 @@ function rtu.comms(version, modem, local_port, server_port, range, conn_watchdog
|
||||
pkt = mgmt_pkt.get()
|
||||
end
|
||||
else
|
||||
log.error("illegal packet type " .. s_pkt.protocol(), true)
|
||||
log.debug("illegal packet type " .. s_pkt.protocol(), true)
|
||||
end
|
||||
end
|
||||
|
||||
@ -379,7 +379,7 @@ function rtu.comms(version, modem, local_port, server_port, range, conn_watchdog
|
||||
else
|
||||
-- unit ID out of range?
|
||||
reply = modbus.reply__gw_unavailable(packet)
|
||||
log.error("received MODBUS packet for non-existent unit")
|
||||
log.debug("received MODBUS packet for non-existent unit")
|
||||
end
|
||||
|
||||
public.send_modbus(reply)
|
||||
@ -447,7 +447,7 @@ function rtu.comms(version, modem, local_port, server_port, range, conn_watchdog
|
||||
public.send_advertisement(units)
|
||||
else
|
||||
-- not supported
|
||||
log.warning("received unsupported SCADA_MGMT message type " .. packet.type)
|
||||
log.debug("received unsupported SCADA_MGMT message type " .. packet.type)
|
||||
end
|
||||
else
|
||||
log.debug("discarding non-link SCADA_MGMT packet before linked")
|
||||
|
@ -25,7 +25,7 @@ local sna_rtu = require("rtu.dev.sna_rtu")
|
||||
local sps_rtu = require("rtu.dev.sps_rtu")
|
||||
local turbinev_rtu = require("rtu.dev.turbinev_rtu")
|
||||
|
||||
local RTU_VERSION = "v0.13.3"
|
||||
local RTU_VERSION = "v0.13.4"
|
||||
|
||||
local RTU_UNIT_TYPE = types.RTU_UNIT_TYPE
|
||||
|
||||
|
@ -410,7 +410,7 @@ function coordinator.new_session(id, in_queue, out_queue, timeout, facility)
|
||||
_send(SCADA_CRDN_TYPE.FAC_BUILDS, { facility.get_build(cmd.val.type == RTU_UNIT_TYPE.IMATRIX) })
|
||||
end
|
||||
else
|
||||
log.warning(log_header .. "unsupported data command received in in_queue (this is a bug)")
|
||||
log.error(log_header .. "unsupported data command received in in_queue (this is a bug)", true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -273,7 +273,7 @@ function plc.new_session(id, reactor_id, in_queue, out_queue, timeout)
|
||||
if pkt.length == 1 then
|
||||
return pkt.data[1]
|
||||
else
|
||||
log.warning(log_header .. "RPLC ACK length mismatch")
|
||||
log.debug(log_header .. "RPLC ACK length mismatch")
|
||||
return nil
|
||||
end
|
||||
end
|
||||
@ -295,7 +295,7 @@ function plc.new_session(id, reactor_id, in_queue, out_queue, timeout)
|
||||
if pkt.scada_frame.protocol() == PROTOCOL.RPLC then
|
||||
-- check reactor ID
|
||||
if pkt.id ~= reactor_id then
|
||||
log.warning(log_header .. "RPLC packet with ID not matching reactor ID: reactor " .. reactor_id .. " != " .. pkt.id)
|
||||
log.warning(log_header .. "discarding RPLC packet with ID not matching reactor ID: reactor " .. reactor_id .. " != " .. pkt.id)
|
||||
return
|
||||
end
|
||||
|
||||
@ -633,7 +633,7 @@ function plc.new_session(id, reactor_id, in_queue, out_queue, timeout)
|
||||
_send(RPLC_TYPE.RPS_AUTO_RESET, {})
|
||||
end
|
||||
else
|
||||
log.warning(log_header .. "unsupported command received in in_queue (this is a bug)")
|
||||
log.error(log_header .. "unsupported command received in in_queue (this is a bug)", true)
|
||||
end
|
||||
elseif message.qtype == mqueue.TYPE.DATA then
|
||||
-- instruction with body
|
||||
@ -680,7 +680,7 @@ function plc.new_session(id, reactor_id, in_queue, out_queue, timeout)
|
||||
end
|
||||
end
|
||||
else
|
||||
log.warning(log_header .. "unsupported data command received in in_queue (this is a bug)")
|
||||
log.error(log_header .. "unsupported data command received in in_queue (this is a bug)", true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -14,7 +14,7 @@ local svsessions = require("supervisor.session.svsessions")
|
||||
local config = require("supervisor.config")
|
||||
local supervisor = require("supervisor.supervisor")
|
||||
|
||||
local SUPERVISOR_VERSION = "v0.14.4"
|
||||
local SUPERVISOR_VERSION = "v0.14.5"
|
||||
|
||||
local println = util.println
|
||||
local println_ts = util.println_ts
|
||||
|
@ -327,7 +327,7 @@ function supervisor.comms(version, num_reactors, cooling_conf, modem, dev_listen
|
||||
log.debug("illegal packet type " .. protocol .. " on coordinator listening channel")
|
||||
end
|
||||
else
|
||||
log.warning("received packet on unconfigured channel " .. l_port)
|
||||
log.debug("received packet on unconfigured channel " .. l_port, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user