From 2f7e3ec20c078eb3bacb81585b9f73aa758fbab8 Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Mon, 30 May 2022 09:21:12 +0200 Subject: [PATCH] Updated driver to show error screen when not connected. --- src/main/resources/driver/cc/driver.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/resources/driver/cc/driver.lua b/src/main/resources/driver/cc/driver.lua index bdcfe9b..98736e8 100644 --- a/src/main/resources/driver/cc/driver.lua +++ b/src/main/resources/driver/cc/driver.lua @@ -62,10 +62,12 @@ end local function displaySignal(signal) local color = colors.white if signal.segment.occupied ~= nil then - if signal.segment.occupied then + if signal.segment.occupied == true then color = colors.red - else + elseif signal.segment.occupied == false then color = colors.lime + else + color = colors.blue end end signal.segment.monitor.setBackgroundColor(color) @@ -270,7 +272,7 @@ while true do elseif event == "websocket_closed" then for _, component in pairs(config.components) do if component.type == "SIGNAL" then - component.segment.occupied = nil + component.segment.occupied = "ERROR" displaySignal(component) end end