Skip to content

Commit

Permalink
Merge pull request #294 from MikaylaFischler/devel
Browse files Browse the repository at this point in the history
2023.07.19 Hotfix
  • Loading branch information
MikaylaFischler authored Jul 19, 2023
2 parents 8f7d7c3 + def02a9 commit bdbb307
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 21 deletions.
2 changes: 1 addition & 1 deletion coordinator/startup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ local sounder = require("coordinator.sounder")

local apisessions = require("coordinator.session.apisessions")

local COORDINATOR_VERSION = "v0.21.1"
local COORDINATOR_VERSION = "v0.21.2"

local println = util.println
local println_ts = util.println_ts
Expand Down
2 changes: 2 additions & 0 deletions coordinator/ui/pgi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ function pgi.delete_pkt_entry(session_id)
if not success then
log.error(util.c("PGI: failed to delete PKT entry (", result, ")"), true)
end
else
log.debug(util.c("PGI: tried to delete unknown PKT entry ", session_id))
end
end

Expand Down
2 changes: 1 addition & 1 deletion graphics/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ local flasher = require("graphics.flasher")

local core = {}

core.version = "1.0.1"
core.version = "1.0.2"

core.flasher = flasher
core.events = events
Expand Down
16 changes: 9 additions & 7 deletions graphics/element.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ function element.new(args, child_offset_x, child_offset_y)
p_window = nil, ---@type table
position = { x = 1, y = 1 }, ---@type coordinate_2d
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 = {},
mt = {}
}
Expand Down Expand Up @@ -352,13 +353,14 @@ function element.new(args, child_offset_x, child_offset_y)

local child_element = child.get()

if key == nil then
table.insert(protected.children, child_element)
return #protected.children
else
protected.children[key] = child_element
return key
local id = key ---@type string|integer|nil
if id == nil then
id = self.next_id
self.next_id = self.next_id + 1
end

protected.children[id] = child_element
return id
end

-- remove a child element
Expand Down
2 changes: 1 addition & 1 deletion install_manifest.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"versions": {"installer": "v1.7d", "bootloader": "0.2", "comms": "2.1.2", "graphics": "1.0.1", "lockbox": "1.0", "reactor-plc": "v1.5.5", "rtu": "v1.5.4", "supervisor": "v0.20.2", "coordinator": "v0.21.0", "pocket": "alpha-v0.5.2"}, "files": {"system": ["initenv.lua", "startup.lua"], "common": ["scada-common/ppm.lua", "scada-common/comms.lua", "scada-common/psil.lua", "scada-common/rsio.lua", "scada-common/constants.lua", "scada-common/mqueue.lua", "scada-common/tcd.lua", "scada-common/crash.lua", "scada-common/log.lua", "scada-common/types.lua", "scada-common/util.lua", "scada-common/network.lua"], "graphics": ["graphics/element.lua", "graphics/events.lua", "graphics/flasher.lua", "graphics/core.lua", "graphics/elements/listbox.lua", "graphics/elements/textbox.lua", "graphics/elements/displaybox.lua", "graphics/elements/pipenet.lua", "graphics/elements/rectangle.lua", "graphics/elements/div.lua", "graphics/elements/multipane.lua", "graphics/elements/tiling.lua", "graphics/elements/colormap.lua", "graphics/elements/indicators/alight.lua", "graphics/elements/indicators/icon.lua", "graphics/elements/indicators/power.lua", "graphics/elements/indicators/rad.lua", "graphics/elements/indicators/state.lua", "graphics/elements/indicators/light.lua", "graphics/elements/indicators/vbar.lua", "graphics/elements/indicators/led.lua", "graphics/elements/indicators/coremap.lua", "graphics/elements/indicators/data.lua", "graphics/elements/indicators/ledpair.lua", "graphics/elements/indicators/hbar.lua", "graphics/elements/indicators/trilight.lua", "graphics/elements/indicators/ledrgb.lua", "graphics/elements/controls/switch_button.lua", "graphics/elements/controls/spinbox_numeric.lua", "graphics/elements/controls/hazard_button.lua", "graphics/elements/controls/push_button.lua", "graphics/elements/controls/radio_button.lua", "graphics/elements/controls/multi_button.lua", "graphics/elements/controls/tabbar.lua", "graphics/elements/controls/checkbox.lua", "graphics/elements/controls/sidebar.lua", "graphics/elements/animations/waiting.lua"], "lockbox": ["lockbox/init.lua", "lockbox/LICENSE", "lockbox/kdf/pbkdf2.lua", "lockbox/util/bit.lua", "lockbox/util/array.lua", "lockbox/util/stream.lua", "lockbox/util/queue.lua", "lockbox/digest/sha2_224.lua", "lockbox/digest/sha1.lua", "lockbox/digest/sha2_256.lua", "lockbox/digest/md5.lua", "lockbox/mac/hmac.lua"], "reactor-plc": ["reactor-plc/renderer.lua", "reactor-plc/threads.lua", "reactor-plc/databus.lua", "reactor-plc/plc.lua", "reactor-plc/config.lua", "reactor-plc/startup.lua", "reactor-plc/panel/front_panel.lua", "reactor-plc/panel/style.lua"], "rtu": ["rtu/renderer.lua", "rtu/threads.lua", "rtu/rtu.lua", "rtu/databus.lua", "rtu/modbus.lua", "rtu/config.lua", "rtu/startup.lua", "rtu/panel/front_panel.lua", "rtu/panel/style.lua", "rtu/dev/sps_rtu.lua", "rtu/dev/envd_rtu.lua", "rtu/dev/boilerv_rtu.lua", "rtu/dev/redstone_rtu.lua", "rtu/dev/sna_rtu.lua", "rtu/dev/imatrix_rtu.lua", "rtu/dev/dynamicv_rtu.lua", "rtu/dev/turbinev_rtu.lua"], "supervisor": ["supervisor/renderer.lua", "supervisor/databus.lua", "supervisor/supervisor.lua", "supervisor/unit.lua", "supervisor/config.lua", "supervisor/startup.lua", "supervisor/unitlogic.lua", "supervisor/facility.lua", "supervisor/panel/pgi.lua", "supervisor/panel/front_panel.lua", "supervisor/panel/style.lua", "supervisor/panel/components/rtu_entry.lua", "supervisor/panel/components/pdg_entry.lua", "supervisor/session/coordinator.lua", "supervisor/session/svqtypes.lua", "supervisor/session/pocket.lua", "supervisor/session/svsessions.lua", "supervisor/session/rtu.lua", "supervisor/session/plc.lua", "supervisor/session/rsctl.lua", "supervisor/session/rtu/boilerv.lua", "supervisor/session/rtu/dynamicv.lua", "supervisor/session/rtu/txnctrl.lua", "supervisor/session/rtu/unit_session.lua", "supervisor/session/rtu/turbinev.lua", "supervisor/session/rtu/envd.lua", "supervisor/session/rtu/imatrix.lua", "supervisor/session/rtu/sps.lua", "supervisor/session/rtu/qtypes.lua", "supervisor/session/rtu/sna.lua", "supervisor/session/rtu/redstone.lua"], "coordinator": ["coordinator/coordinator.lua", "coordinator/renderer.lua", "coordinator/iocontrol.lua", "coordinator/sounder.lua", "coordinator/config.lua", "coordinator/startup.lua", "coordinator/process.lua", "coordinator/ui/dialog.lua", "coordinator/ui/pgi.lua", "coordinator/ui/style.lua", "coordinator/ui/layout/main_view.lua", "coordinator/ui/layout/unit_view.lua", "coordinator/ui/layout/front_panel.lua", "coordinator/ui/components/reactor.lua", "coordinator/ui/components/pkt_entry.lua", "coordinator/ui/components/process_ctl.lua", "coordinator/ui/components/unit_overview.lua", "coordinator/ui/components/boiler.lua", "coordinator/ui/components/unit_detail.lua", "coordinator/ui/components/imatrix.lua", "coordinator/ui/components/turbine.lua", "coordinator/session/pocket.lua", "coordinator/session/apisessions.lua"], "pocket": ["pocket/pocket.lua", "pocket/renderer.lua", "pocket/config.lua", "pocket/coreio.lua", "pocket/startup.lua", "pocket/ui/main.lua", "pocket/ui/style.lua", "pocket/ui/components/conn_waiting.lua", "pocket/ui/pages/turbine_page.lua", "pocket/ui/pages/reactor_page.lua", "pocket/ui/pages/home_page.lua", "pocket/ui/pages/unit_page.lua", "pocket/ui/pages/boiler_page.lua"]}, "depends": {"reactor-plc": ["system", "common", "graphics", "lockbox"], "rtu": ["system", "common", "graphics", "lockbox"], "supervisor": ["system", "common", "graphics", "lockbox"], "coordinator": ["system", "common", "graphics", "lockbox"], "pocket": ["system", "common", "graphics", "lockbox"]}, "sizes": {"manifest": 5789, "system": 1991, "common": 98474, "graphics": 147714, "lockbox": 34900, "reactor-plc": 95833, "rtu": 105477, "supervisor": 335329, "coordinator": 231949, "pocket": 37639}}
{"versions": {"installer": "v1.7d", "bootloader": "0.2", "comms": "2.1.2", "graphics": "1.0.1", "lockbox": "1.0", "reactor-plc": "v1.5.5", "rtu": "v1.5.5", "supervisor": "v0.20.3", "coordinator": "v0.21.1", "pocket": "alpha-v0.5.2"}, "files": {"system": ["initenv.lua", "startup.lua"], "common": ["scada-common/ppm.lua", "scada-common/comms.lua", "scada-common/psil.lua", "scada-common/rsio.lua", "scada-common/constants.lua", "scada-common/mqueue.lua", "scada-common/tcd.lua", "scada-common/crash.lua", "scada-common/log.lua", "scada-common/types.lua", "scada-common/util.lua", "scada-common/network.lua"], "graphics": ["graphics/element.lua", "graphics/events.lua", "graphics/flasher.lua", "graphics/core.lua", "graphics/elements/listbox.lua", "graphics/elements/textbox.lua", "graphics/elements/displaybox.lua", "graphics/elements/pipenet.lua", "graphics/elements/rectangle.lua", "graphics/elements/div.lua", "graphics/elements/multipane.lua", "graphics/elements/tiling.lua", "graphics/elements/colormap.lua", "graphics/elements/indicators/alight.lua", "graphics/elements/indicators/icon.lua", "graphics/elements/indicators/power.lua", "graphics/elements/indicators/rad.lua", "graphics/elements/indicators/state.lua", "graphics/elements/indicators/light.lua", "graphics/elements/indicators/vbar.lua", "graphics/elements/indicators/led.lua", "graphics/elements/indicators/coremap.lua", "graphics/elements/indicators/data.lua", "graphics/elements/indicators/ledpair.lua", "graphics/elements/indicators/hbar.lua", "graphics/elements/indicators/trilight.lua", "graphics/elements/indicators/ledrgb.lua", "graphics/elements/controls/switch_button.lua", "graphics/elements/controls/spinbox_numeric.lua", "graphics/elements/controls/hazard_button.lua", "graphics/elements/controls/push_button.lua", "graphics/elements/controls/radio_button.lua", "graphics/elements/controls/multi_button.lua", "graphics/elements/controls/tabbar.lua", "graphics/elements/controls/checkbox.lua", "graphics/elements/controls/sidebar.lua", "graphics/elements/animations/waiting.lua"], "lockbox": ["lockbox/init.lua", "lockbox/LICENSE", "lockbox/kdf/pbkdf2.lua", "lockbox/util/bit.lua", "lockbox/util/array.lua", "lockbox/util/stream.lua", "lockbox/util/queue.lua", "lockbox/digest/sha2_224.lua", "lockbox/digest/sha1.lua", "lockbox/digest/sha2_256.lua", "lockbox/digest/md5.lua", "lockbox/mac/hmac.lua"], "reactor-plc": ["reactor-plc/renderer.lua", "reactor-plc/threads.lua", "reactor-plc/databus.lua", "reactor-plc/plc.lua", "reactor-plc/config.lua", "reactor-plc/startup.lua", "reactor-plc/panel/front_panel.lua", "reactor-plc/panel/style.lua"], "rtu": ["rtu/renderer.lua", "rtu/threads.lua", "rtu/rtu.lua", "rtu/databus.lua", "rtu/modbus.lua", "rtu/config.lua", "rtu/startup.lua", "rtu/panel/front_panel.lua", "rtu/panel/style.lua", "rtu/dev/sps_rtu.lua", "rtu/dev/envd_rtu.lua", "rtu/dev/boilerv_rtu.lua", "rtu/dev/redstone_rtu.lua", "rtu/dev/sna_rtu.lua", "rtu/dev/imatrix_rtu.lua", "rtu/dev/dynamicv_rtu.lua", "rtu/dev/turbinev_rtu.lua"], "supervisor": ["supervisor/renderer.lua", "supervisor/databus.lua", "supervisor/supervisor.lua", "supervisor/unit.lua", "supervisor/config.lua", "supervisor/startup.lua", "supervisor/unitlogic.lua", "supervisor/facility.lua", "supervisor/panel/pgi.lua", "supervisor/panel/front_panel.lua", "supervisor/panel/style.lua", "supervisor/panel/components/rtu_entry.lua", "supervisor/panel/components/pdg_entry.lua", "supervisor/session/coordinator.lua", "supervisor/session/svqtypes.lua", "supervisor/session/pocket.lua", "supervisor/session/svsessions.lua", "supervisor/session/rtu.lua", "supervisor/session/plc.lua", "supervisor/session/rsctl.lua", "supervisor/session/rtu/boilerv.lua", "supervisor/session/rtu/dynamicv.lua", "supervisor/session/rtu/txnctrl.lua", "supervisor/session/rtu/unit_session.lua", "supervisor/session/rtu/turbinev.lua", "supervisor/session/rtu/envd.lua", "supervisor/session/rtu/imatrix.lua", "supervisor/session/rtu/sps.lua", "supervisor/session/rtu/qtypes.lua", "supervisor/session/rtu/sna.lua", "supervisor/session/rtu/redstone.lua"], "coordinator": ["coordinator/coordinator.lua", "coordinator/renderer.lua", "coordinator/iocontrol.lua", "coordinator/sounder.lua", "coordinator/config.lua", "coordinator/startup.lua", "coordinator/process.lua", "coordinator/ui/dialog.lua", "coordinator/ui/pgi.lua", "coordinator/ui/style.lua", "coordinator/ui/layout/main_view.lua", "coordinator/ui/layout/unit_view.lua", "coordinator/ui/layout/front_panel.lua", "coordinator/ui/components/reactor.lua", "coordinator/ui/components/pkt_entry.lua", "coordinator/ui/components/process_ctl.lua", "coordinator/ui/components/unit_overview.lua", "coordinator/ui/components/boiler.lua", "coordinator/ui/components/unit_detail.lua", "coordinator/ui/components/imatrix.lua", "coordinator/ui/components/turbine.lua", "coordinator/session/pocket.lua", "coordinator/session/apisessions.lua"], "pocket": ["pocket/pocket.lua", "pocket/renderer.lua", "pocket/config.lua", "pocket/coreio.lua", "pocket/startup.lua", "pocket/ui/main.lua", "pocket/ui/style.lua", "pocket/ui/components/conn_waiting.lua", "pocket/ui/pages/turbine_page.lua", "pocket/ui/pages/reactor_page.lua", "pocket/ui/pages/home_page.lua", "pocket/ui/pages/unit_page.lua", "pocket/ui/pages/boiler_page.lua"]}, "depends": {"reactor-plc": ["system", "common", "graphics", "lockbox"], "rtu": ["system", "common", "graphics", "lockbox"], "supervisor": ["system", "common", "graphics", "lockbox"], "coordinator": ["system", "common", "graphics", "lockbox"], "pocket": ["system", "common", "graphics", "lockbox"]}, "sizes": {"manifest": 5789, "system": 1991, "common": 98474, "graphics": 147714, "lockbox": 34900, "reactor-plc": 95833, "rtu": 105774, "supervisor": 335453, "coordinator": 232175, "pocket": 37639}}
2 changes: 1 addition & 1 deletion rtu/startup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,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 = "v1.5.4"
local RTU_VERSION = "v1.5.5"

local RTU_UNIT_TYPE = types.RTU_UNIT_TYPE
local RTU_UNIT_HW_STATE = databus.RTU_UNIT_HW_STATE
Expand Down
26 changes: 17 additions & 9 deletions rtu/threads.lua
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,9 @@ function threads.thread__comms(smem)

-- thread loop
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
local msg = comms_queue.pop()

Expand All @@ -324,10 +326,16 @@ function threads.thread__comms(smem)
end
end

-- quick yield
util.nop()
-- max 100ms spent processing queue
if util.time() - handle_start > 100 then
log.warning("comms thread exceeded 100ms queue process limit")
break
end
end

-- quick yield
util.nop()

-- check for termination request
if rtu_state.shutdown then
rtu_comms.close(rtu_state)
Expand Down Expand Up @@ -414,6 +422,12 @@ function threads.thread__unit_comms(smem, unit)
util.nop()
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
if unit.is_multiblock and (util.time_ms() - last_f_check > 250) then
local is_formed = unit.device.isFormed()
Expand Down Expand Up @@ -507,12 +521,6 @@ function threads.thread__unit_comms(smem, unit)
-- update hw status
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
last_update = util.adaptive_delay(COMMS_SLEEP, last_update)
end
Expand Down
4 changes: 4 additions & 0 deletions supervisor/panel/pgi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ function pgi.delete_rtu_entry(session_id)
if not success then
log.error(util.c("PGI: failed to delete RTU entry (", result, ")"), true)
end
else
log.debug(util.c("PGI: tried to delete unknown RTU entry ", session_id))
end
end

Expand Down Expand Up @@ -87,6 +89,8 @@ function pgi.delete_pdg_entry(session_id)
if not success then
log.error(util.c("PGI: failed to delete PDG entry (", result, ")"), true)
end
else
log.debug(util.c("PGI: tried to delete unknown PDG entry ", session_id))
end
end

Expand Down
2 changes: 1 addition & 1 deletion supervisor/startup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ local supervisor = require("supervisor.supervisor")

local svsessions = require("supervisor.session.svsessions")

local SUPERVISOR_VERSION = "v0.20.3"
local SUPERVISOR_VERSION = "v0.20.4"

local println = util.println
local println_ts = util.println_ts
Expand Down

0 comments on commit bdbb307

Please sign in to comment.