From d6175e5cec4564d0ffb6c61aecac8ac14d6e668c Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Tue, 12 Mar 2024 13:23:39 -0400 Subject: [PATCH] switched to using LEDPair elements for colorblind mode network lights --- coordinator/ui/layout/front_panel.lua | 5 +++-- reactor-plc/panel/front_panel.lua | 4 ++-- rtu/panel/front_panel.lua | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/coordinator/ui/layout/front_panel.lua b/coordinator/ui/layout/front_panel.lua index 3e400d9..455e42e 100644 --- a/coordinator/ui/layout/front_panel.lua +++ b/coordinator/ui/layout/front_panel.lua @@ -22,6 +22,7 @@ local TextBox = require("graphics.elements.textbox") local TabBar = require("graphics.elements.controls.tabbar") local LED = require("graphics.elements.indicators.led") +local LEDPair = require("graphics.elements.indicators.ledpair") local RGBLED = require("graphics.elements.indicators.ledrgb") local LINK_STATE = types.PANEL_LINK_STATE @@ -64,8 +65,8 @@ local function init(panel, num_units) network.update(types.PANEL_LINK_STATE.DISCONNECTED) network.register(ps, "link_state", network.update) else - local nt_lnk = RGBLED{parent=system,label="NT LINKED",colors={colors.red_off,colors.red,colors.green}} - local nt_ver = RGBLED{parent=system,label="NT VERSION",colors={colors.red_off,colors.red,colors.green}} + local nt_lnk = LEDPair{parent=system,label="NT LINKED",off=colors.red_off,c1=colors.red,c2=colors.green} + local nt_ver = LEDPair{parent=system,label="NT VERSION",off=colors.red_off,c1=colors.red,c2=colors.green} nt_lnk.register(ps, "link_state", function (state) local value = 2 diff --git a/reactor-plc/panel/front_panel.lua b/reactor-plc/panel/front_panel.lua index 017fb55..b54cd04 100644 --- a/reactor-plc/panel/front_panel.lua +++ b/reactor-plc/panel/front_panel.lua @@ -64,8 +64,8 @@ local function init(panel) network.update(types.PANEL_LINK_STATE.DISCONNECTED) network.register(databus.ps, "link_state", network.update) else - local nt_lnk = RGBLED{parent=system,label="NT LINKED",colors={colors.red_off,colors.red,colors.green}} - local nt_ver = RGBLED{parent=system,label="NT VERSION",colors={colors.red_off,colors.red,colors.green}} + local nt_lnk = LEDPair{parent=system,label="NT LINKED",off=colors.red_off,c1=colors.red,c2=colors.green} + local nt_ver = LEDPair{parent=system,label="NT VERSION",off=colors.red_off,c1=colors.red,c2=colors.green} local nt_col = LED{parent=system,label="NT COLLISION",colors=ind_red} nt_lnk.register(databus.ps, "link_state", function (state) diff --git a/rtu/panel/front_panel.lua b/rtu/panel/front_panel.lua index c43dcb9..d479302 100644 --- a/rtu/panel/front_panel.lua +++ b/rtu/panel/front_panel.lua @@ -16,6 +16,7 @@ local TextBox = require("graphics.elements.textbox") local DataIndicator = require("graphics.elements.indicators.data") local LED = require("graphics.elements.indicators.led") +local LEDPair = require("graphics.elements.indicators.ledpair") local RGBLED = require("graphics.elements.indicators.ledrgb") local LINK_STATE = types.PANEL_LINK_STATE @@ -56,8 +57,8 @@ local function init(panel, units) network.update(types.PANEL_LINK_STATE.DISCONNECTED) network.register(databus.ps, "link_state", network.update) else - local nt_lnk = RGBLED{parent=system,label="NT LINKED",colors={colors.red_off,colors.red,colors.green}} - local nt_ver = RGBLED{parent=system,label="NT VERSION",colors={colors.red_off,colors.red,colors.green}} + local nt_lnk = LEDPair{parent=system,label="NT LINKED",off=colors.red_off,c1=colors.red,c2=colors.green} + local nt_ver = LEDPair{parent=system,label="NT VERSION",off=colors.red_off,c1=colors.red,c2=colors.green} nt_lnk.register(databus.ps, "link_state", function (state) local value = 2