#88 hold on rendering unit detail view until we get a status, added waiting animation

This commit is contained in:
Mikayla Fischler
2022-09-10 10:42:56 -04:00
parent 33695b2ed6
commit 6f3405949d
6 changed files with 444 additions and 284 deletions

View File

@@ -2,9 +2,6 @@
-- Timer Callback Dispatcher
--
local log = require("scada-common.log")
local util = require("scada-common.util")
local tcallbackdsp = {}
local registry = {}
@@ -13,7 +10,6 @@ local registry = {}
---@param time number seconds
---@param f function callback function
function tcallbackdsp.dispatch(time, f)
log.debug(util.c("TCD: dispatching ", f, " for call in ", time, " seconds"))
---@diagnostic disable-next-line: undefined-field
registry[os.startTimer(time)] = { callback = f }
end
@@ -22,7 +18,6 @@ end
---@param event integer timer event timer ID
function tcallbackdsp.handle(event)
if registry[event] ~= nil then
log.debug(util.c("TCD: executing callback ", registry[event].callback, " for timer ", event))
registry[event].callback()
registry[event] = nil
end