#300 utilizing style file for common color pairs
This commit is contained in:
@@ -28,6 +28,9 @@ local TEXT_ALIGN = core.TEXT_ALIGN
|
||||
local cpair = core.cpair
|
||||
local border = core.border
|
||||
|
||||
local ind_grn = style.ind_grn
|
||||
local ind_red = style.ind_red
|
||||
|
||||
-- create new front panel view
|
||||
---@param panel graphics_element main displaybox
|
||||
local function init(panel)
|
||||
@@ -41,14 +44,14 @@ local function init(panel)
|
||||
local system = Div{parent=panel,width=14,height=18,x=2,y=3}
|
||||
|
||||
local init_ok = LED{parent=system,label="STATUS",colors=cpair(colors.green,colors.red)}
|
||||
local heartbeat = LED{parent=system,label="HEARTBEAT",colors=cpair(colors.green,colors.green_off)}
|
||||
local heartbeat = LED{parent=system,label="HEARTBEAT",colors=ind_grn}
|
||||
system.line_break()
|
||||
|
||||
init_ok.register(databus.ps, "init_ok", init_ok.update)
|
||||
heartbeat.register(databus.ps, "heartbeat", heartbeat.update)
|
||||
|
||||
local reactor = LEDPair{parent=system,label="REACTOR",off=colors.red,c1=colors.yellow,c2=colors.green}
|
||||
local modem = LED{parent=system,label="MODEM",colors=cpair(colors.green,colors.green_off)}
|
||||
local modem = LED{parent=system,label="MODEM",colors=ind_grn}
|
||||
local network = RGBLED{parent=system,label="NETWORK",colors={colors.green,colors.red,colors.orange,colors.yellow,colors.gray}}
|
||||
network.update(types.PANEL_LINK_STATE.DISCONNECTED)
|
||||
system.line_break()
|
||||
@@ -57,11 +60,11 @@ local function init(panel)
|
||||
modem.register(databus.ps, "has_modem", modem.update)
|
||||
network.register(databus.ps, "link_state", network.update)
|
||||
|
||||
local rt_main = LED{parent=system,label="RT MAIN",colors=cpair(colors.green,colors.green_off)}
|
||||
local rt_rps = LED{parent=system,label="RT RPS",colors=cpair(colors.green,colors.green_off)}
|
||||
local rt_cmtx = LED{parent=system,label="RT COMMS TX",colors=cpair(colors.green,colors.green_off)}
|
||||
local rt_cmrx = LED{parent=system,label="RT COMMS RX",colors=cpair(colors.green,colors.green_off)}
|
||||
local rt_sctl = LED{parent=system,label="RT SPCTL",colors=cpair(colors.green,colors.green_off)}
|
||||
local rt_main = LED{parent=system,label="RT MAIN",colors=ind_grn}
|
||||
local rt_rps = LED{parent=system,label="RT RPS",colors=ind_grn}
|
||||
local rt_cmtx = LED{parent=system,label="RT COMMS TX",colors=ind_grn}
|
||||
local rt_cmrx = LED{parent=system,label="RT COMMS RX",colors=ind_grn}
|
||||
local rt_sctl = LED{parent=system,label="RT SPCTL",colors=ind_grn}
|
||||
system.line_break()
|
||||
|
||||
rt_main.register(databus.ps, "routine__main", rt_main.update)
|
||||
@@ -80,7 +83,7 @@ local function init(panel)
|
||||
|
||||
local status = Div{parent=panel,width=19,height=18,x=17,y=3}
|
||||
|
||||
local active = LED{parent=status,x=2,width=12,label="RCT ACTIVE",colors=cpair(colors.green,colors.green_off)}
|
||||
local active = LED{parent=status,x=2,width=12,label="RCT ACTIVE",colors=ind_grn}
|
||||
|
||||
-- only show emergency coolant LED if emergency coolant is configured for this device
|
||||
if type(config.EMERGENCY_COOL) == "table" then
|
||||
@@ -90,7 +93,7 @@ local function init(panel)
|
||||
|
||||
local status_trip_rct = Rectangle{parent=status,width=20,height=3,x=1,border=border(1,colors.lightGray,true),even_inner=true,fg_bg=cpair(colors.black,colors.ivory)}
|
||||
local status_trip = Div{parent=status_trip_rct,width=18,height=1,fg_bg=cpair(colors.black,colors.lightGray)}
|
||||
local scram = LED{parent=status_trip,width=10,label="RPS TRIP",colors=cpair(colors.red,colors.red_off),flash=true,period=flasher.PERIOD.BLINK_250_MS}
|
||||
local scram = LED{parent=status_trip,width=10,label="RPS TRIP",colors=ind_red,flash=true,period=flasher.PERIOD.BLINK_250_MS}
|
||||
|
||||
local controls_rct = Rectangle{parent=status,width=17,height=3,x=1,border=border(1,colors.white,true),even_inner=true,fg_bg=cpair(colors.black,colors.ivory)}
|
||||
local controls = Div{parent=controls_rct,width=15,height=1,fg_bg=cpair(colors.black,colors.white)}
|
||||
@@ -116,20 +119,20 @@ local function init(panel)
|
||||
--
|
||||
|
||||
local rps = Rectangle{parent=panel,width=16,height=16,x=36,y=3,border=border(1,colors.lightGray),thin=true,fg_bg=cpair(colors.black,colors.lightGray)}
|
||||
local rps_man = LED{parent=rps,label="MANUAL",colors=cpair(colors.red,colors.red_off)}
|
||||
local rps_auto = LED{parent=rps,label="AUTOMATIC",colors=cpair(colors.red,colors.red_off)}
|
||||
local rps_tmo = LED{parent=rps,label="TIMEOUT",colors=cpair(colors.red,colors.red_off)}
|
||||
local rps_flt = LED{parent=rps,label="PLC FAULT",colors=cpair(colors.red,colors.red_off)}
|
||||
local rps_fail = LED{parent=rps,label="RCT FAULT",colors=cpair(colors.red,colors.red_off)}
|
||||
local rps_man = LED{parent=rps,label="MANUAL",colors=ind_red}
|
||||
local rps_auto = LED{parent=rps,label="AUTOMATIC",colors=ind_red}
|
||||
local rps_tmo = LED{parent=rps,label="TIMEOUT",colors=ind_red}
|
||||
local rps_flt = LED{parent=rps,label="PLC FAULT",colors=ind_red}
|
||||
local rps_fail = LED{parent=rps,label="RCT FAULT",colors=ind_red}
|
||||
rps.line_break()
|
||||
local rps_dmg = LED{parent=rps,label="HI DAMAGE",colors=cpair(colors.red,colors.red_off)}
|
||||
local rps_tmp = LED{parent=rps,label="HI TEMP",colors=cpair(colors.red,colors.red_off)}
|
||||
local rps_dmg = LED{parent=rps,label="HI DAMAGE",colors=ind_red}
|
||||
local rps_tmp = LED{parent=rps,label="HI TEMP",colors=ind_red}
|
||||
rps.line_break()
|
||||
local rps_nof = LED{parent=rps,label="LO FUEL",colors=cpair(colors.red,colors.red_off)}
|
||||
local rps_wst = LED{parent=rps,label="HI WASTE",colors=cpair(colors.red,colors.red_off)}
|
||||
local rps_nof = LED{parent=rps,label="LO FUEL",colors=ind_red}
|
||||
local rps_wst = LED{parent=rps,label="HI WASTE",colors=ind_red}
|
||||
rps.line_break()
|
||||
local rps_ccl = LED{parent=rps,label="LO CCOOLANT",colors=cpair(colors.red,colors.red_off)}
|
||||
local rps_hcl = LED{parent=rps,label="HI HCOOLANT",colors=cpair(colors.red,colors.red_off)}
|
||||
local rps_ccl = LED{parent=rps,label="LO CCOOLANT",colors=ind_red}
|
||||
local rps_hcl = LED{parent=rps,label="HI HCOOLANT",colors=ind_red}
|
||||
|
||||
rps_man.register(databus.ps, "rps_manual", rps_man.update)
|
||||
rps_auto.register(databus.ps, "rps_automatic", rps_auto.update)
|
||||
|
||||
Reference in New Issue
Block a user