#74 close supervisor connection on exit, start of touch event handling

This commit is contained in:
Mikayla Fischler
2022-07-20 13:28:58 -04:00
parent 1afafba501
commit 9b21a971fe
3 changed files with 37 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
local log = require("scada-common.log")
local log = require("scada-common.log")
local main_view = require("coordinator.ui.layout.main_view")
local unit_view = require("coordinator.ui.layout.unit_view")
@@ -99,4 +99,19 @@ function renderer.close_ui(recolor)
engine.dmesg_window.redraw()
end
-- handle a touch event
---@param event monitor_touch
function renderer.handle_touch(event)
if event.monitor == engine.monitors.primary_name then
ui.main_layout.handle_touch(event)
else
for id, monitor in pairs(engine.monitors.unit_name_map) do
if event.monitor == monitor then
local layout = ui.unit_layouts[id] ---@type graphics_element
layout.handle_touch(event)
end
end
end
end
return renderer