mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
commit
bdbb3071b3
@ -22,7 +22,7 @@ local sounder = require("coordinator.sounder")
|
|||||||
|
|
||||||
local apisessions = require("coordinator.session.apisessions")
|
local apisessions = require("coordinator.session.apisessions")
|
||||||
|
|
||||||
local COORDINATOR_VERSION = "v0.21.1"
|
local COORDINATOR_VERSION = "v0.21.2"
|
||||||
|
|
||||||
local println = util.println
|
local println = util.println
|
||||||
local println_ts = util.println_ts
|
local println_ts = util.println_ts
|
||||||
|
@ -52,6 +52,8 @@ function pgi.delete_pkt_entry(session_id)
|
|||||||
if not success then
|
if not success then
|
||||||
log.error(util.c("PGI: failed to delete PKT entry (", result, ")"), true)
|
log.error(util.c("PGI: failed to delete PKT entry (", result, ")"), true)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
log.debug(util.c("PGI: tried to delete unknown PKT entry ", session_id))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ local flasher = require("graphics.flasher")
|
|||||||
|
|
||||||
local core = {}
|
local core = {}
|
||||||
|
|
||||||
core.version = "1.0.1"
|
core.version = "1.0.2"
|
||||||
|
|
||||||
core.flasher = flasher
|
core.flasher = flasher
|
||||||
core.events = events
|
core.events = events
|
||||||
|
@ -71,7 +71,8 @@ function element.new(args, child_offset_x, child_offset_y)
|
|||||||
p_window = nil, ---@type table
|
p_window = nil, ---@type table
|
||||||
position = { x = 1, y = 1 }, ---@type coordinate_2d
|
position = { x = 1, y = 1 }, ---@type coordinate_2d
|
||||||
bounds = { x1 = 1, y1 = 1, x2 = 1, y2 = 1 }, ---@class element_bounds
|
bounds = { x1 = 1, y1 = 1, x2 = 1, y2 = 1 }, ---@class element_bounds
|
||||||
next_y = 1,
|
next_y = 1, -- next child y coordinate
|
||||||
|
next_id = 0, -- next child ID
|
||||||
subscriptions = {},
|
subscriptions = {},
|
||||||
mt = {}
|
mt = {}
|
||||||
}
|
}
|
||||||
@ -352,13 +353,14 @@ function element.new(args, child_offset_x, child_offset_y)
|
|||||||
|
|
||||||
local child_element = child.get()
|
local child_element = child.get()
|
||||||
|
|
||||||
if key == nil then
|
local id = key ---@type string|integer|nil
|
||||||
table.insert(protected.children, child_element)
|
if id == nil then
|
||||||
return #protected.children
|
id = self.next_id
|
||||||
else
|
self.next_id = self.next_id + 1
|
||||||
protected.children[key] = child_element
|
|
||||||
return key
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
protected.children[id] = child_element
|
||||||
|
return id
|
||||||
end
|
end
|
||||||
|
|
||||||
-- remove a child element
|
-- remove a child element
|
||||||
|
File diff suppressed because one or more lines are too long
@ -30,7 +30,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 = "v1.5.4"
|
local RTU_VERSION = "v1.5.5"
|
||||||
|
|
||||||
local RTU_UNIT_TYPE = types.RTU_UNIT_TYPE
|
local RTU_UNIT_TYPE = types.RTU_UNIT_TYPE
|
||||||
local RTU_UNIT_HW_STATE = databus.RTU_UNIT_HW_STATE
|
local RTU_UNIT_HW_STATE = databus.RTU_UNIT_HW_STATE
|
||||||
|
@ -308,7 +308,9 @@ function threads.thread__comms(smem)
|
|||||||
|
|
||||||
-- thread loop
|
-- thread loop
|
||||||
while true do
|
while true do
|
||||||
-- check for messages in the message queue
|
local handle_start = util.time()
|
||||||
|
|
||||||
|
-- check for messages in the message queue while not shut down
|
||||||
while comms_queue.ready() and not rtu_state.shutdown do
|
while comms_queue.ready() and not rtu_state.shutdown do
|
||||||
local msg = comms_queue.pop()
|
local msg = comms_queue.pop()
|
||||||
|
|
||||||
@ -324,10 +326,16 @@ function threads.thread__comms(smem)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- quick yield
|
-- max 100ms spent processing queue
|
||||||
util.nop()
|
if util.time() - handle_start > 100 then
|
||||||
|
log.warning("comms thread exceeded 100ms queue process limit")
|
||||||
|
break
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- quick yield
|
||||||
|
util.nop()
|
||||||
|
|
||||||
-- check for termination request
|
-- check for termination request
|
||||||
if rtu_state.shutdown then
|
if rtu_state.shutdown then
|
||||||
rtu_comms.close(rtu_state)
|
rtu_comms.close(rtu_state)
|
||||||
@ -414,6 +422,12 @@ function threads.thread__unit_comms(smem, unit)
|
|||||||
util.nop()
|
util.nop()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- check for termination request
|
||||||
|
if rtu_state.shutdown then
|
||||||
|
log.info("rtu unit thread exiting -> " .. short_name)
|
||||||
|
break
|
||||||
|
end
|
||||||
|
|
||||||
-- check if multiblock is still formed if this is a multiblock
|
-- check if multiblock is still formed if this is a multiblock
|
||||||
if unit.is_multiblock and (util.time_ms() - last_f_check > 250) then
|
if unit.is_multiblock and (util.time_ms() - last_f_check > 250) then
|
||||||
local is_formed = unit.device.isFormed()
|
local is_formed = unit.device.isFormed()
|
||||||
@ -507,12 +521,6 @@ function threads.thread__unit_comms(smem, unit)
|
|||||||
-- update hw status
|
-- update hw status
|
||||||
databus.tx_unit_hw_status(unit.uid, unit.hw_state)
|
databus.tx_unit_hw_status(unit.uid, unit.hw_state)
|
||||||
|
|
||||||
-- check for termination request
|
|
||||||
if rtu_state.shutdown then
|
|
||||||
log.info("rtu unit thread exiting -> " .. short_name)
|
|
||||||
break
|
|
||||||
end
|
|
||||||
|
|
||||||
-- delay before next check
|
-- delay before next check
|
||||||
last_update = util.adaptive_delay(COMMS_SLEEP, last_update)
|
last_update = util.adaptive_delay(COMMS_SLEEP, last_update)
|
||||||
end
|
end
|
||||||
|
@ -60,6 +60,8 @@ function pgi.delete_rtu_entry(session_id)
|
|||||||
if not success then
|
if not success then
|
||||||
log.error(util.c("PGI: failed to delete RTU entry (", result, ")"), true)
|
log.error(util.c("PGI: failed to delete RTU entry (", result, ")"), true)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
log.debug(util.c("PGI: tried to delete unknown RTU entry ", session_id))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -87,6 +89,8 @@ function pgi.delete_pdg_entry(session_id)
|
|||||||
if not success then
|
if not success then
|
||||||
log.error(util.c("PGI: failed to delete PDG entry (", result, ")"), true)
|
log.error(util.c("PGI: failed to delete PDG entry (", result, ")"), true)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
log.debug(util.c("PGI: tried to delete unknown PDG entry ", session_id))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ local supervisor = require("supervisor.supervisor")
|
|||||||
|
|
||||||
local svsessions = require("supervisor.session.svsessions")
|
local svsessions = require("supervisor.session.svsessions")
|
||||||
|
|
||||||
local SUPERVISOR_VERSION = "v0.20.3"
|
local SUPERVISOR_VERSION = "v0.20.4"
|
||||||
|
|
||||||
local println = util.println
|
local println = util.println
|
||||||
local println_ts = util.println_ts
|
local println_ts = util.println_ts
|
||||||
|
Loading…
Reference in New Issue
Block a user