mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
bugfix for RTU re-formed detection
This commit is contained in:
parent
d4ae18eee7
commit
afb3b0957e
@ -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 = "beta-v0.9.6"
|
||||
local RTU_VERSION = "beta-v0.9.7"
|
||||
|
||||
local rtu_t = types.rtu_t
|
||||
|
||||
|
@ -341,10 +341,11 @@ function threads.thread__unit_comms(smem, unit)
|
||||
util.nop()
|
||||
end
|
||||
|
||||
|
||||
-- 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 (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
|
||||
local iface = ppm.get_iface(unit.device)
|
||||
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)
|
||||
end
|
||||
end
|
||||
|
||||
unit.formed = is_formed
|
||||
end
|
||||
|
||||
-- check for termination request
|
||||
|
Loading…
Reference in New Issue
Block a user