diff --git a/coordinator/startup.lua b/coordinator/startup.lua index c0addf1..a95b30c 100644 --- a/coordinator/startup.lua +++ b/coordinator/startup.lua @@ -4,23 +4,23 @@ require("/initenv").init_env() -local crash = require("scada-common.crash") -local log = require("scada-common.log") -local ppm = require("scada-common.ppm") -local tcallbackdsp = require("scada-common.tcallbackdsp") -local util = require("scada-common.util") +local crash = require("scada-common.crash") +local log = require("scada-common.log") +local ppm = require("scada-common.ppm") +local tcd = require("scada-common.tcd") +local util = require("scada-common.util") -local core = require("graphics.core") +local core = require("graphics.core") -local config = require("coordinator.config") -local coordinator = require("coordinator.coordinator") -local iocontrol = require("coordinator.iocontrol") -local renderer = require("coordinator.renderer") -local sounder = require("coordinator.sounder") +local config = require("coordinator.config") +local coordinator = require("coordinator.coordinator") +local iocontrol = require("coordinator.iocontrol") +local renderer = require("coordinator.renderer") +local sounder = require("coordinator.sounder") -local apisessions = require("coordinator.session.apisessions") +local apisessions = require("coordinator.session.apisessions") -local COORDINATOR_VERSION = "v0.15.6" +local COORDINATOR_VERSION = "v0.15.7" local println = util.println local println_ts = util.println_ts @@ -334,7 +334,7 @@ local function main() apisessions.check_all_watchdogs(param1) -- notify timer callback dispatcher - tcallbackdsp.handle(param1) + tcd.handle(param1) end elseif event == "modem_message" then -- got a packet diff --git a/coordinator/ui/components/processctl.lua b/coordinator/ui/components/processctl.lua index 7e0016a..eaeb8ab 100644 --- a/coordinator/ui/components/processctl.lua +++ b/coordinator/ui/components/processctl.lua @@ -1,4 +1,4 @@ -local tcd = require("scada-common.tcallbackdsp") +local tcd = require("scada-common.tcd") local util = require("scada-common.util") local iocontrol = require("coordinator.iocontrol") diff --git a/graphics/elements/animations/waiting.lua b/graphics/elements/animations/waiting.lua index 9dc089f..286c82e 100644 --- a/graphics/elements/animations/waiting.lua +++ b/graphics/elements/animations/waiting.lua @@ -1,6 +1,6 @@ -- Loading/Waiting Animation Graphics Element -local tcd = require("scada-common.tcallbackdsp") +local tcd = require("scada-common.tcd") local element = require("graphics.element") diff --git a/graphics/elements/controls/hazard_button.lua b/graphics/elements/controls/hazard_button.lua index 6ffe74d..4745f4f 100644 --- a/graphics/elements/controls/hazard_button.lua +++ b/graphics/elements/controls/hazard_button.lua @@ -1,6 +1,6 @@ -- Hazard-bordered Button Graphics Element -local tcd = require("scada-common.tcallbackdsp") +local tcd = require("scada-common.tcd") local util = require("scada-common.util") local core = require("graphics.core") diff --git a/graphics/elements/controls/push_button.lua b/graphics/elements/controls/push_button.lua index 564ad3c..e6f4920 100644 --- a/graphics/elements/controls/push_button.lua +++ b/graphics/elements/controls/push_button.lua @@ -1,6 +1,6 @@ -- Button Graphics Element -local tcd = require("scada-common.tcallbackdsp") +local tcd = require("scada-common.tcd") local core = require("graphics.core") local element = require("graphics.element") diff --git a/graphics/elements/controls/sidebar.lua b/graphics/elements/controls/sidebar.lua index b3221b3..d43317a 100644 --- a/graphics/elements/controls/sidebar.lua +++ b/graphics/elements/controls/sidebar.lua @@ -1,6 +1,6 @@ -- Sidebar Graphics Element -local tcd = require("scada-common.tcallbackdsp") +local tcd = require("scada-common.tcd") local core = require("graphics.core") local element = require("graphics.element") diff --git a/graphics/elements/listbox.lua b/graphics/elements/listbox.lua index 87a274d..e37a772 100644 --- a/graphics/elements/listbox.lua +++ b/graphics/elements/listbox.lua @@ -1,6 +1,6 @@ -- Scroll-able List Box Display Graphics Element -local tcd = require("scada-common.tcallbackdsp") +local tcd = require("scada-common.tcd") local core = require("graphics.core") local element = require("graphics.element") diff --git a/graphics/flasher.lua b/graphics/flasher.lua index 0a3d9ea..520fba7 100644 --- a/graphics/flasher.lua +++ b/graphics/flasher.lua @@ -2,7 +2,7 @@ -- Indicator Light Flasher -- -local tcd = require("scada-common.tcallbackdsp") +local tcd = require("scada-common.tcd") local flasher = {} diff --git a/install_manifest.json b/install_manifest.json index a2f4b51..249b201 100644 --- a/install_manifest.json +++ b/install_manifest.json @@ -1 +1 @@ -{"versions": {"installer": "v1.2", "bootloader": "0.2", "comms": "1.4.1", "reactor-plc": "v1.3.6", "rtu": "v1.2.6", "supervisor": "v0.16.6", "coordinator": "v0.15.6", "pocket": "alpha-v0.3.6"}, "files": {"system": ["initenv.lua", "startup.lua"], "common": ["scada-common/crypto.lua", "scada-common/ppm.lua", "scada-common/comms.lua", "scada-common/psil.lua", "scada-common/tcallbackdsp.lua", "scada-common/rsio.lua", "scada-common/constants.lua", "scada-common/mqueue.lua", "scada-common/crash.lua", "scada-common/log.lua", "scada-common/types.lua", "scada-common/util.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/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/cipher/aes128.lua", "lockbox/cipher/aes256.lua", "lockbox/cipher/aes192.lua", "lockbox/cipher/mode/ofb.lua", "lockbox/cipher/mode/cbc.lua", "lockbox/cipher/mode/ctr.lua", "lockbox/cipher/mode/cfb.lua", "lockbox/mac/hmac.lua", "lockbox/padding/ansix923.lua", "lockbox/padding/pkcs7.lua", "lockbox/padding/zero.lua", "lockbox/padding/isoiec7816.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/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/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/style.lua", "coordinator/ui/layout/main_view.lua", "coordinator/ui/layout/unit_view.lua", "coordinator/ui/components/reactor.lua", "coordinator/ui/components/processctl.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/api.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"], "rtu": ["system", "common", "graphics"], "supervisor": ["system", "common"], "coordinator": ["system", "common", "graphics"], "pocket": ["system", "common", "graphics"]}, "sizes": {"manifest": 5775, "system": 1991, "common": 91102, "graphics": 144082, "lockbox": 100797, "reactor-plc": 95896, "rtu": 100988, "supervisor": 310851, "coordinator": 197544, "pocket": 36338}} \ No newline at end of file +{"versions": {"installer": "v1.2", "bootloader": "0.2", "comms": "1.4.1", "reactor-plc": "v1.3.7", "rtu": "v1.2.7", "supervisor": "v0.16.7", "coordinator": "v0.15.7", "pocket": "alpha-v0.3.7"}, "files": {"system": ["initenv.lua", "startup.lua"], "common": ["scada-common/crypto.lua", "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"], "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/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/cipher/aes128.lua", "lockbox/cipher/aes256.lua", "lockbox/cipher/aes192.lua", "lockbox/cipher/mode/ofb.lua", "lockbox/cipher/mode/cbc.lua", "lockbox/cipher/mode/ctr.lua", "lockbox/cipher/mode/cfb.lua", "lockbox/mac/hmac.lua", "lockbox/padding/ansix923.lua", "lockbox/padding/pkcs7.lua", "lockbox/padding/zero.lua", "lockbox/padding/isoiec7816.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/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/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/style.lua", "coordinator/ui/layout/main_view.lua", "coordinator/ui/layout/unit_view.lua", "coordinator/ui/components/reactor.lua", "coordinator/ui/components/processctl.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/api.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"], "rtu": ["system", "common", "graphics"], "supervisor": ["system", "common"], "coordinator": ["system", "common", "graphics"], "pocket": ["system", "common", "graphics"]}, "sizes": {"manifest": 5766, "system": 1991, "common": 91039, "graphics": 144028, "lockbox": 100797, "reactor-plc": 95846, "rtu": 101207, "supervisor": 310842, "coordinator": 197505, "pocket": 36280}} \ No newline at end of file diff --git a/pocket/startup.lua b/pocket/startup.lua index 50862d1..32d4737 100644 --- a/pocket/startup.lua +++ b/pocket/startup.lua @@ -4,20 +4,20 @@ require("/initenv").init_env() -local crash = require("scada-common.crash") -local log = require("scada-common.log") -local ppm = require("scada-common.ppm") -local tcallbackdsp = require("scada-common.tcallbackdsp") -local util = require("scada-common.util") +local crash = require("scada-common.crash") +local log = require("scada-common.log") +local ppm = require("scada-common.ppm") +local tcd = require("scada-common.tcd") +local util = require("scada-common.util") -local core = require("graphics.core") +local core = require("graphics.core") -local config = require("pocket.config") -local coreio = require("pocket.coreio") -local pocket = require("pocket.pocket") -local renderer = require("pocket.renderer") +local config = require("pocket.config") +local coreio = require("pocket.coreio") +local pocket = require("pocket.pocket") +local renderer = require("pocket.renderer") -local POCKET_VERSION = "alpha-v0.3.6" +local POCKET_VERSION = "alpha-v0.3.7" local println = util.println local println_ts = util.println_ts @@ -145,7 +145,7 @@ local function main() else -- a non-clock/main watchdog timer event -- notify timer callback dispatcher - tcallbackdsp.handle(param1) + tcd.handle(param1) end elseif event == "modem_message" then -- got a packet diff --git a/reactor-plc/startup.lua b/reactor-plc/startup.lua index 3e8861b..812ed45 100644 --- a/reactor-plc/startup.lua +++ b/reactor-plc/startup.lua @@ -18,7 +18,7 @@ local plc = require("reactor-plc.plc") local renderer = require("reactor-plc.renderer") local threads = require("reactor-plc.threads") -local R_PLC_VERSION = "v1.3.6" +local R_PLC_VERSION = "v1.3.7" local println = util.println local println_ts = util.println_ts diff --git a/reactor-plc/threads.lua b/reactor-plc/threads.lua index 8dbea6d..b9c986d 100644 --- a/reactor-plc/threads.lua +++ b/reactor-plc/threads.lua @@ -1,13 +1,13 @@ -local log = require("scada-common.log") -local mqueue = require("scada-common.mqueue") -local ppm = require("scada-common.ppm") -local tcallbackdsp = require("scada-common.tcallbackdsp") -local util = require("scada-common.util") +local log = require("scada-common.log") +local mqueue = require("scada-common.mqueue") +local ppm = require("scada-common.ppm") +local tcd = require("scada-common.tcd") +local util = require("scada-common.util") -local databus = require("reactor-plc.databus") -local renderer = require("reactor-plc.renderer") +local databus = require("reactor-plc.databus") +local renderer = require("reactor-plc.renderer") -local core = require("graphics.core") +local core = require("graphics.core") local threads = {} @@ -157,7 +157,7 @@ function threads.thread__main(smem, init) smem.q.mq_rps.push_command(MQ__RPS_CMD.TRIP_TIMEOUT) elseif event == "timer" then -- notify timer callback dispatcher if no other timer case claimed this event - tcallbackdsp.handle(param1) + tcd.handle(param1) elseif event == "peripheral_detach" then -- peripheral disconnect local type, device = ppm.handle_unmount(param1) diff --git a/rtu/startup.lua b/rtu/startup.lua index 86c3db2..451a06d 100644 --- a/rtu/startup.lua +++ b/rtu/startup.lua @@ -28,7 +28,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.2.6" +local RTU_VERSION = "v1.2.7" local RTU_UNIT_TYPE = types.RTU_UNIT_TYPE local RTU_UNIT_HW_STATE = databus.RTU_UNIT_HW_STATE diff --git a/rtu/threads.lua b/rtu/threads.lua index 046525c..fdb82b3 100644 --- a/rtu/threads.lua +++ b/rtu/threads.lua @@ -1,6 +1,7 @@ local log = require("scada-common.log") local mqueue = require("scada-common.mqueue") local ppm = require("scada-common.ppm") +local tcd = require("scada-common.tcd") local types = require("scada-common.types") local util = require("scada-common.util") @@ -82,6 +83,9 @@ function threads.thread__main(smem) elseif event == "timer" and conn_watchdog.is_timer(param1) then -- haven't heard from server recently? unlink rtu_comms.unlink(rtu_state) + elseif event == "timer" then + -- notify timer callback dispatcher if no other timer case claimed this event + tcd.handle(param1) elseif event == "peripheral_detach" then -- handle loss of a device local type, device = ppm.handle_unmount(param1) diff --git a/scada-common/tcallbackdsp.lua b/scada-common/tcd.lua similarity index 91% rename from scada-common/tcallbackdsp.lua rename to scada-common/tcd.lua index 3f8f07a..f5ff0e5 100644 --- a/scada-common/tcallbackdsp.lua +++ b/scada-common/tcd.lua @@ -5,14 +5,14 @@ local log = require("scada-common.log") local util = require("scada-common.util") -local tcallbackdsp = {} +local tcd = {} local registry = {} -- request a function to be called after the specified time ---@param time number seconds ---@param f function callback function -function tcallbackdsp.dispatch(time, f) +function tcd.dispatch(time, f) local timer = util.start_timer(time) registry[timer] = { callback = f, @@ -24,7 +24,7 @@ end -- request a function to be called after the specified time, aborting any registered instances of that function reference ---@param time number seconds ---@param f function callback function -function tcallbackdsp.dispatch_unique(time, f) +function tcd.dispatch_unique(time, f) -- cancel if already registered for timer, entry in pairs(registry) do if entry.callback == f then @@ -47,7 +47,7 @@ end -- abort a requested callback ---@param f function callback function -function tcallbackdsp.abort(f) +function tcd.abort(f) for timer, entry in pairs(registry) do if entry.callback == f then -- cancel event and remove from registry (even if it fires it won't call) @@ -59,7 +59,7 @@ end -- lookup a timer event and execute the callback if found ---@param event integer timer event timer ID -function tcallbackdsp.handle(event) +function tcd.handle(event) if registry[event] ~= nil then local callback = registry[event].callback -- clear first so that dispatch_unique call from inside callback won't throw a debug message @@ -70,7 +70,7 @@ end -- identify any overdo callbacks
-- prints to log debug output -function tcallbackdsp.diagnostics() +function tcd.diagnostics() for timer, entry in pairs(registry) do if entry.expiry < util.time_s() then local overtime = util.time_s() - entry.expiry @@ -82,4 +82,4 @@ function tcallbackdsp.diagnostics() end end -return tcallbackdsp +return tcd diff --git a/supervisor/startup.lua b/supervisor/startup.lua index 06853ef..c3f28ad 100644 --- a/supervisor/startup.lua +++ b/supervisor/startup.lua @@ -8,7 +8,7 @@ local crash = require("scada-common.crash") local comms = require("scada-common.comms") local log = require("scada-common.log") local ppm = require("scada-common.ppm") -local tcd = require("scada-common.tcallbackdsp") +local tcd = require("scada-common.tcd") local util = require("scada-common.util") local core = require("graphics.core") @@ -20,7 +20,7 @@ local supervisor = require("supervisor.supervisor") local svsessions = require("supervisor.session.svsessions") -local SUPERVISOR_VERSION = "v0.16.6" +local SUPERVISOR_VERSION = "v0.16.7" local println = util.println local println_ts = util.println_ts