#88 not going to actually hold UI since that hides the PLC offline state and other offline indicators, instead should expose property update capability

This commit is contained in:
Mikayla Fischler 2022-09-10 15:26:52 -04:00
parent 4275c9d408
commit c14fc048a1

View File

@ -8,36 +8,17 @@ local iocontrol = require("coordinator.iocontrol")
local style = require("coordinator.ui.style")
local unit_wait = require("coordinator.ui.components.unit_waiting")
local unit_detail = require("coordinator.ui.components.unit_detail")
local core = require("graphics.core")
local DisplayBox = require("graphics.elements.displaybox")
local cpair = core.graphics.cpair
local border = core.graphics.border
-- create a unit view
---@param monitor table
---@param id integer
local function init(monitor, id)
local main = DisplayBox{window=monitor,fg_bg=style.root}
local waiting = unit_wait(main, 20)
-- block waiting for initial status
local function show_view()
local unit = iocontrol.get_db().units[id] ---@type ioctl_entry
if unit.reactor_data.last_status_update ~= nil then
waiting.hide()
unit_detail(main, id)
else
tcallbackdsp.dispatch(1, show_view)
end
end
tcallbackdsp.dispatch(1, show_view)
unit_detail(main, id)
return main
end