bugfix for RTU re-formed detection
This commit is contained in:
@@ -25,7 +25,7 @@ local sna_rtu = require("rtu.dev.sna_rtu")
|
|||||||
local sps_rtu = require("rtu.dev.sps_rtu")
|
local sps_rtu = require("rtu.dev.sps_rtu")
|
||||||
local turbinev_rtu = require("rtu.dev.turbinev_rtu")
|
local turbinev_rtu = require("rtu.dev.turbinev_rtu")
|
||||||
|
|
||||||
local RTU_VERSION = "beta-v0.9.6"
|
local RTU_VERSION = "beta-v0.9.7"
|
||||||
|
|
||||||
local rtu_t = types.rtu_t
|
local rtu_t = types.rtu_t
|
||||||
|
|
||||||
|
|||||||
@@ -341,10 +341,11 @@ function threads.thread__unit_comms(smem, unit)
|
|||||||
util.nop()
|
util.nop()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- check if multiblock is still formed if this is a multiblock
|
-- check if multiblock is still formed if this is a multiblock
|
||||||
if (type(unit.formed) == "boolean") and (util.time() - last_f_check > 1000) then
|
if (type(unit.formed) == "boolean") and (util.time() - last_f_check > 1000) then
|
||||||
if (not unit.formed) and unit.device.isFormed() then
|
local is_formed = unit.device.isFormed()
|
||||||
|
|
||||||
|
if (not unit.formed) and is_formed then
|
||||||
-- newly re-formed
|
-- newly re-formed
|
||||||
local iface = ppm.get_iface(unit.device)
|
local iface = ppm.get_iface(unit.device)
|
||||||
if iface then
|
if iface then
|
||||||
@@ -394,6 +395,8 @@ function threads.thread__unit_comms(smem, unit)
|
|||||||
log.error("failed to get interface of previously connected RTU unit " .. detail_name, true)
|
log.error("failed to get interface of previously connected RTU unit " .. detail_name, true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
unit.formed = is_formed
|
||||||
end
|
end
|
||||||
|
|
||||||
-- check for termination request
|
-- check for termination request
|
||||||
|
|||||||
Reference in New Issue
Block a user