#126 fixed RTU builds not being sent to coordinator at the correct times

This commit is contained in:
Mikayla Fischler 2022-11-14 21:43:02 -05:00
parent 9761228b8e
commit 7c39e8c72b
2 changed files with 14 additions and 7 deletions

View File

@ -7,6 +7,7 @@ local util = require("scada-common.util")
local svqtypes = require("supervisor.session.svqtypes")
-- supervisor rtu sessions (svrs)
local unit_session = require("supervisor.session.rtu.unit_session")
local svrs_boilerv = require("supervisor.session.rtu.boilerv")
local svrs_envd = require("supervisor.session.rtu.envd")
local svrs_imatrix = require("supervisor.session.rtu.imatrix")
@ -202,9 +203,6 @@ function rtu.new_session(id, in_queue, out_queue, advertisement, facility_units)
break
end
end
-- report build changed
self.out_q.push_command(svqtypes.SV_Q_CMDS.BUILD_CHANGED)
end
-- mark this RTU session as closed, stop watchdog
@ -419,9 +417,9 @@ function rtu.new_session(id, in_queue, out_queue, advertisement, facility_units)
self.periodics.last_update = util.time()
----------------------------------------------
-- pass MODBUS packets on to main out queue --
----------------------------------------------
--------------------------------------------
-- process RTU session handler out queues --
--------------------------------------------
for _ = 1, self.modbus_q.length() do
-- get the next message
@ -429,7 +427,16 @@ function rtu.new_session(id, in_queue, out_queue, advertisement, facility_units)
if msg ~= nil then
if msg.qtype == mqueue.TYPE.PACKET then
-- handle a packet
_send_modbus(msg.message)
elseif msg.qtype == mqueue.TYPE.COMMAND then
-- handle instruction
local cmd = msg.message
if cmd == unit_session.RTU_US_CMDS.BUILD_CHANGED then
self.out_q.push_command(svqtypes.SV_Q_CMDS.BUILD_CHANGED)
end
elseif msg.qtype == mqueue.TYPE.DATA then
-- instruction with body
end
end
end

View File

@ -14,7 +14,7 @@ local svsessions = require("supervisor.session.svsessions")
local config = require("supervisor.config")
local supervisor = require("supervisor.supervisor")
local SUPERVISOR_VERSION = "beta-v0.7.6"
local SUPERVISOR_VERSION = "beta-v0.7.7"
local print = util.print
local println = util.println