diff --git a/coordinator/ui/layout/front_panel.lua b/coordinator/ui/layout/front_panel.lua index ebaba12..d23712b 100644 --- a/coordinator/ui/layout/front_panel.lua +++ b/coordinator/ui/layout/front_panel.lua @@ -61,12 +61,12 @@ local function init(panel, num_units) local modem = LED{parent=system,label="MODEM",colors=led_grn} if not style.colorblind then - local network = RGBLED{parent=system,label="NETWORK",colors={colors.green,colors.red,colors.orange,colors.yellow,colors.gray}} + local network = RGBLED{parent=system,label="NETWORK",colors={colors.green,colors.red,colors.orange,colors.yellow,style.ind_bkg}} network.update(types.PANEL_LINK_STATE.DISCONNECTED) network.register(ps, "link_state", network.update) else - local nt_lnk = LEDPair{parent=system,label="NT LINKED",off=colors.black,c1=colors.red,c2=colors.green} - local nt_ver = LEDPair{parent=system,label="NT VERSION",off=colors.black,c1=colors.red,c2=colors.green} + local nt_lnk = LEDPair{parent=system,label="NT LINKED",off=style.ind_bkg,c1=colors.red,c2=colors.green} + local nt_ver = LEDPair{parent=system,label="NT VERSION",off=style.ind_bkg,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 67b886f..ee2f3ed 100644 --- a/reactor-plc/panel/front_panel.lua +++ b/reactor-plc/panel/front_panel.lua @@ -60,12 +60,12 @@ local function init(panel) local modem = LED{parent=system,label="MODEM",colors=ind_grn} if not style.colorblind then - local network = RGBLED{parent=system,label="NETWORK",colors={colors.green,colors.red,colors.orange,colors.yellow,colors.gray}} + local network = RGBLED{parent=system,label="NETWORK",colors={colors.green,colors.red,colors.orange,colors.yellow,style.ind_bkg}} network.update(types.PANEL_LINK_STATE.DISCONNECTED) network.register(databus.ps, "link_state", network.update) else - local nt_lnk = LEDPair{parent=system,label="NT LINKED",off=colors.black,c1=colors.red,c2=colors.green} - local nt_ver = LEDPair{parent=system,label="NT VERSION",off=colors.black,c1=colors.red,c2=colors.green} + local nt_lnk = LEDPair{parent=system,label="NT LINKED",off=style.ind_bkg,c1=colors.red,c2=colors.green} + local nt_ver = LEDPair{parent=system,label="NT VERSION",off=style.ind_bkg,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/reactor-plc/panel/style.lua b/reactor-plc/panel/style.lua index 08c1192..7f5661f 100644 --- a/reactor-plc/panel/style.lua +++ b/reactor-plc/panel/style.lua @@ -2,6 +2,8 @@ -- Graphics Style Options -- +local util = require("scada-common.util") + local core = require("graphics.core") local themes = require("graphics.themes") @@ -30,6 +32,8 @@ function style.set_theme(fp, color_mode) style.fp = themes.get_fp_style(style.theme) style.colorblind = color_mode ~= themes.COLOR_MODE.STANDARD + + style.ind_bkg = util.trinary(style.colorblind and (color_mode ~= themes.COLOR_MODE.BLUE_IND), colors.black, colors.gray) end return style diff --git a/rtu/panel/front_panel.lua b/rtu/panel/front_panel.lua index a1a72b9..738ccca 100644 --- a/rtu/panel/front_panel.lua +++ b/rtu/panel/front_panel.lua @@ -53,12 +53,12 @@ local function init(panel, units) local modem = LED{parent=system,label="MODEM",colors=ind_grn} if not style.colorblind then - local network = RGBLED{parent=system,label="NETWORK",colors={colors.green,colors.red,colors.orange,colors.yellow,colors.gray}} + local network = RGBLED{parent=system,label="NETWORK",colors={colors.green,colors.red,colors.orange,colors.yellow,style.ind_bkg}} network.update(types.PANEL_LINK_STATE.DISCONNECTED) network.register(databus.ps, "link_state", network.update) else - local nt_lnk = LEDPair{parent=system,label="NT LINKED",off=colors.black,c1=colors.red,c2=colors.green} - local nt_ver = LEDPair{parent=system,label="NT VERSION",off=colors.black,c1=colors.red,c2=colors.green} + local nt_lnk = LEDPair{parent=system,label="NT LINKED",off=style.ind_bkg,c1=colors.red,c2=colors.green} + local nt_ver = LEDPair{parent=system,label="NT VERSION",off=style.ind_bkg,c1=colors.red,c2=colors.green} nt_lnk.register(databus.ps, "link_state", function (state) local value = 2 diff --git a/rtu/panel/style.lua b/rtu/panel/style.lua index a72df2a..fd5eaf4 100644 --- a/rtu/panel/style.lua +++ b/rtu/panel/style.lua @@ -2,6 +2,8 @@ -- Graphics Style Options -- +local util = require("scada-common.util") + local core = require("graphics.core") local themes = require("graphics.themes") @@ -29,6 +31,8 @@ function style.set_theme(fp, color_mode) style.fp = themes.get_fp_style(style.theme) style.colorblind = color_mode ~= themes.COLOR_MODE.STANDARD + + style.ind_bkg = util.trinary(style.colorblind and (color_mode ~= themes.COLOR_MODE.BLUE_IND), colors.black, colors.gray) end return style