mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
#85 handling supervisor disconnected, bugfix with renderer
This commit is contained in:
parent
e456d34468
commit
397e311f1b
@ -38,7 +38,7 @@ local function _reset_display(monitor, recolor)
|
||||
end
|
||||
else
|
||||
-- reset all colors
|
||||
for _, val in colors do
|
||||
for _, val in pairs(colors) do
|
||||
-- colors api has constants and functions, just get color constants
|
||||
if type(val) == "number" then
|
||||
monitor.setPaletteColor(val, term.nativePaletteColor(val))
|
||||
|
@ -16,7 +16,7 @@ local config = require("coordinator.config")
|
||||
local coordinator = require("coordinator.coordinator")
|
||||
local renderer = require("coordinator.renderer")
|
||||
|
||||
local COORDINATOR_VERSION = "alpha-v0.4.3"
|
||||
local COORDINATOR_VERSION = "alpha-v0.4.4"
|
||||
|
||||
local print = util.print
|
||||
local println = util.println
|
||||
@ -247,6 +247,17 @@ while ui_ok do
|
||||
-- got a packet
|
||||
local packet = coord_comms.parse_packet(param1, param2, param3, param4, param5)
|
||||
coord_comms.handle_packet(packet)
|
||||
|
||||
-- check if it was a disconnect
|
||||
if not coord_comms.is_linked() then
|
||||
-- close connection and UI
|
||||
coord_comms.close()
|
||||
renderer.close_ui()
|
||||
|
||||
-- try to re-connect to the supervisor
|
||||
init_connect_sv()
|
||||
ui_ok = init_start_ui()
|
||||
end
|
||||
elseif event == "monitor_touch" then
|
||||
-- handle a monitor touch event
|
||||
renderer.handle_touch(core.events.touch(param1, param2, param3))
|
||||
|
Loading…
Reference in New Issue
Block a user