mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
#405 WIP themes and completed main display theme implementation
This commit is contained in:
parent
cdd31508d9
commit
628a50e1bd
@ -47,8 +47,8 @@ local function _init_display(monitor)
|
|||||||
monitor.setCursorPos(1, 1)
|
monitor.setCursorPos(1, 1)
|
||||||
|
|
||||||
-- set overridden colors
|
-- set overridden colors
|
||||||
for i = 1, #style.colors do
|
for i = 1, #style.theme.colors do
|
||||||
monitor.setPaletteColor(style.colors[i].c, style.colors[i].hex)
|
monitor.setPaletteColor(style.theme.colors[i].c, style.theme.colors[i].hex)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -142,9 +142,9 @@ function renderer.close_fp()
|
|||||||
engine.fp_ready = false
|
engine.fp_ready = false
|
||||||
|
|
||||||
-- restore colors
|
-- restore colors
|
||||||
for i = 1, #style.colors do
|
for i = 1, #style.theme.colors do
|
||||||
local r, g, b = term.nativePaletteColor(style.colors[i].c)
|
local r, g, b = term.nativePaletteColor(style.theme.colors[i].c)
|
||||||
term.setPaletteColor(style.colors[i].c, r, g, b)
|
term.setPaletteColor(style.theme.colors[i].c, r, g, b)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- reset terminal
|
-- reset terminal
|
||||||
|
@ -14,7 +14,7 @@ local VerticalBar = require("graphics.elements.indicators.vbar")
|
|||||||
local cpair = core.cpair
|
local cpair = core.cpair
|
||||||
local border = core.border
|
local border = core.border
|
||||||
|
|
||||||
local text_fg_bg = style.text_colors
|
local text_fg = style.theme.text_fg
|
||||||
local lu_col = style.lu_colors
|
local lu_col = style.lu_colors
|
||||||
|
|
||||||
-- new boiler view
|
-- new boiler view
|
||||||
@ -28,17 +28,17 @@ local function new_view(root, x, y, ps)
|
|||||||
local boiler = Rectangle{parent=root,border=border(1,colors.gray,true),width=31,height=7,x=x,y=y}
|
local boiler = Rectangle{parent=root,border=border(1,colors.gray,true),width=31,height=7,x=x,y=y}
|
||||||
|
|
||||||
local status = StateIndicator{parent=boiler,x=9,y=1,states=style.boiler.states,value=1,min_width=12}
|
local status = StateIndicator{parent=boiler,x=9,y=1,states=style.boiler.states,value=1,min_width=12}
|
||||||
local temp = DataIndicator{parent=boiler,x=5,y=3,lu_colors=lu_col,label="Temp:",unit=db.temp_label,format="%10.2f",value=0,commas=true,width=22,fg_bg=text_fg_bg}
|
local temp = DataIndicator{parent=boiler,x=5,y=3,lu_colors=lu_col,label="Temp:",unit=db.temp_label,format="%10.2f",value=0,commas=true,width=22,fg_bg=text_fg}
|
||||||
local boil_r = DataIndicator{parent=boiler,x=5,y=4,lu_colors=lu_col,label="Boil:",unit="mB/t",format="%10.0f",value=0,commas=true,width=22,fg_bg=text_fg_bg}
|
local boil_r = DataIndicator{parent=boiler,x=5,y=4,lu_colors=lu_col,label="Boil:",unit="mB/t",format="%10.0f",value=0,commas=true,width=22,fg_bg=text_fg}
|
||||||
|
|
||||||
status.register(ps, "computed_status", status.update)
|
status.register(ps, "computed_status", status.update)
|
||||||
temp.register(ps, "temperature", function (t) temp.update(db.temp_convert(t)) end)
|
temp.register(ps, "temperature", function (t) temp.update(db.temp_convert(t)) end)
|
||||||
boil_r.register(ps, "boil_rate", boil_r.update)
|
boil_r.register(ps, "boil_rate", boil_r.update)
|
||||||
|
|
||||||
TextBox{parent=boiler,text="H",x=2,y=5,height=1,width=1,fg_bg=text_fg_bg}
|
TextBox{parent=boiler,text="H",x=2,y=5,height=1,width=1,fg_bg=text_fg}
|
||||||
TextBox{parent=boiler,text="W",x=3,y=5,height=1,width=1,fg_bg=text_fg_bg}
|
TextBox{parent=boiler,text="W",x=3,y=5,height=1,width=1,fg_bg=text_fg}
|
||||||
TextBox{parent=boiler,text="S",x=27,y=5,height=1,width=1,fg_bg=text_fg_bg}
|
TextBox{parent=boiler,text="S",x=27,y=5,height=1,width=1,fg_bg=text_fg}
|
||||||
TextBox{parent=boiler,text="C",x=28,y=5,height=1,width=1,fg_bg=text_fg_bg}
|
TextBox{parent=boiler,text="C",x=28,y=5,height=1,width=1,fg_bg=text_fg}
|
||||||
|
|
||||||
local hcool = VerticalBar{parent=boiler,x=2,y=1,fg_bg=cpair(colors.orange,colors.gray),height=4,width=1}
|
local hcool = VerticalBar{parent=boiler,x=2,y=1,fg_bg=cpair(colors.orange,colors.gray),height=4,width=1}
|
||||||
local water = VerticalBar{parent=boiler,x=3,y=1,fg_bg=cpair(colors.blue,colors.gray),height=4,width=1}
|
local water = VerticalBar{parent=boiler,x=3,y=1,fg_bg=cpair(colors.blue,colors.gray),height=4,width=1}
|
||||||
|
@ -18,7 +18,7 @@ local border = core.border
|
|||||||
|
|
||||||
local ALIGN = core.ALIGN
|
local ALIGN = core.ALIGN
|
||||||
|
|
||||||
local text_fg_bg = style.text_colors
|
local text_fg = style.theme.text_fg
|
||||||
local lu_col = style.lu_colors
|
local lu_col = style.lu_colors
|
||||||
|
|
||||||
-- new induction matrix view
|
-- new induction matrix view
|
||||||
@ -34,22 +34,22 @@ local function new_view(root, x, y, data, ps, id)
|
|||||||
|
|
||||||
local matrix = Div{parent=root,fg_bg=style.root,width=33,height=24,x=x,y=y}
|
local matrix = Div{parent=root,fg_bg=style.root,width=33,height=24,x=x,y=y}
|
||||||
|
|
||||||
TextBox{parent=matrix,text=" ",width=33,height=1,x=1,y=1,fg_bg=style.lg_gray}
|
local cutout_fg_bg = cpair(style.theme.bg, colors.gray)
|
||||||
TextBox{parent=matrix,text=title,alignment=ALIGN.CENTER,width=33,height=1,x=1,y=2,fg_bg=style.lg_gray}
|
|
||||||
|
TextBox{parent=matrix,text=" ",width=33,height=1,x=1,y=1,fg_bg=cutout_fg_bg}
|
||||||
|
TextBox{parent=matrix,text=title,alignment=ALIGN.CENTER,width=33,height=1,x=1,y=2,fg_bg=cutout_fg_bg}
|
||||||
|
|
||||||
local rect = Rectangle{parent=matrix,border=border(1,colors.gray,true),width=33,height=22,x=1,y=3}
|
local rect = Rectangle{parent=matrix,border=border(1,colors.gray,true),width=33,height=22,x=1,y=3}
|
||||||
|
|
||||||
local label_fg_bg = cpair(colors.gray, colors.lightGray)
|
|
||||||
|
|
||||||
local status = StateIndicator{parent=rect,x=10,y=1,states=style.imatrix.states,value=1,min_width=14}
|
local status = StateIndicator{parent=rect,x=10,y=1,states=style.imatrix.states,value=1,min_width=14}
|
||||||
local energy = PowerIndicator{parent=rect,x=7,y=3,lu_colors=lu_col,label="Energy: ",format="%8.2f",value=0,width=26,fg_bg=text_fg_bg}
|
local energy = PowerIndicator{parent=rect,x=7,y=3,lu_colors=lu_col,label="Energy: ",format="%8.2f",value=0,width=26,fg_bg=text_fg}
|
||||||
local capacity = PowerIndicator{parent=rect,x=7,y=4,lu_colors=lu_col,label="Capacity:",format="%8.2f",value=0,width=26,fg_bg=text_fg_bg}
|
local capacity = PowerIndicator{parent=rect,x=7,y=4,lu_colors=lu_col,label="Capacity:",format="%8.2f",value=0,width=26,fg_bg=text_fg}
|
||||||
local input = PowerIndicator{parent=rect,x=7,y=5,lu_colors=lu_col,label="Input: ",format="%8.2f",rate=true,value=0,width=26,fg_bg=text_fg_bg}
|
local input = PowerIndicator{parent=rect,x=7,y=5,lu_colors=lu_col,label="Input: ",format="%8.2f",rate=true,value=0,width=26,fg_bg=text_fg}
|
||||||
local output = PowerIndicator{parent=rect,x=7,y=6,lu_colors=lu_col,label="Output: ",format="%8.2f",rate=true,value=0,width=26,fg_bg=text_fg_bg}
|
local output = PowerIndicator{parent=rect,x=7,y=6,lu_colors=lu_col,label="Output: ",format="%8.2f",rate=true,value=0,width=26,fg_bg=text_fg}
|
||||||
|
|
||||||
local avg_chg = PowerIndicator{parent=rect,x=7,y=8,lu_colors=lu_col,label="Avg. Chg:",format="%8.2f",value=0,width=26,fg_bg=text_fg_bg}
|
local avg_chg = PowerIndicator{parent=rect,x=7,y=8,lu_colors=lu_col,label="Avg. Chg:",format="%8.2f",value=0,width=26,fg_bg=text_fg}
|
||||||
local avg_in = PowerIndicator{parent=rect,x=7,y=9,lu_colors=lu_col,label="Avg. In: ",format="%8.2f",rate=true,value=0,width=26,fg_bg=text_fg_bg}
|
local avg_in = PowerIndicator{parent=rect,x=7,y=9,lu_colors=lu_col,label="Avg. In: ",format="%8.2f",rate=true,value=0,width=26,fg_bg=text_fg}
|
||||||
local avg_out = PowerIndicator{parent=rect,x=7,y=10,lu_colors=lu_col,label="Avg. Out:",format="%8.2f",rate=true,value=0,width=26,fg_bg=text_fg_bg}
|
local avg_out = PowerIndicator{parent=rect,x=7,y=10,lu_colors=lu_col,label="Avg. Out:",format="%8.2f",rate=true,value=0,width=26,fg_bg=text_fg}
|
||||||
|
|
||||||
status.register(ps, "computed_status", status.update)
|
status.register(ps, "computed_status", status.update)
|
||||||
energy.register(ps, "energy", function (val) energy.update(util.joules_to_fe(val)) end)
|
energy.register(ps, "energy", function (val) energy.update(util.joules_to_fe(val)) end)
|
||||||
@ -61,13 +61,13 @@ local function new_view(root, x, y, data, ps, id)
|
|||||||
avg_in.register(ps, "avg_inflow", avg_in.update)
|
avg_in.register(ps, "avg_inflow", avg_in.update)
|
||||||
avg_out.register(ps, "avg_outflow", avg_out.update)
|
avg_out.register(ps, "avg_outflow", avg_out.update)
|
||||||
|
|
||||||
local fill = DataIndicator{parent=rect,x=11,y=12,lu_colors=lu_col,label="Fill:",unit="%",format="%8.2f",value=0,width=18,fg_bg=text_fg_bg}
|
local fill = DataIndicator{parent=rect,x=11,y=12,lu_colors=lu_col,label="Fill:",unit="%",format="%8.2f",value=0,width=18,fg_bg=text_fg}
|
||||||
|
|
||||||
local cells = DataIndicator{parent=rect,x=11,y=14,lu_colors=lu_col,label="Cells: ",format="%7d",value=0,width=18,fg_bg=text_fg_bg}
|
local cells = DataIndicator{parent=rect,x=11,y=14,lu_colors=lu_col,label="Cells: ",format="%7d",value=0,width=18,fg_bg=text_fg}
|
||||||
local providers = DataIndicator{parent=rect,x=11,y=15,lu_colors=lu_col,label="Providers:",format="%7d",value=0,width=18,fg_bg=text_fg_bg}
|
local providers = DataIndicator{parent=rect,x=11,y=15,lu_colors=lu_col,label="Providers:",format="%7d",value=0,width=18,fg_bg=text_fg}
|
||||||
|
|
||||||
TextBox{parent=rect,text="Transfer Capacity",x=11,y=17,height=1,width=17,fg_bg=label_fg_bg}
|
TextBox{parent=rect,text="Transfer Capacity",x=11,y=17,height=1,width=17,fg_bg=style.theme.label_fg}
|
||||||
local trans_cap = PowerIndicator{parent=rect,x=19,y=18,lu_colors=lu_col,label="",format="%5.2f",rate=true,value=0,width=12,fg_bg=text_fg_bg}
|
local trans_cap = PowerIndicator{parent=rect,x=19,y=18,lu_colors=lu_col,label="",format="%5.2f",rate=true,value=0,width=12,fg_bg=text_fg}
|
||||||
|
|
||||||
cells.register(ps, "cells", cells.update)
|
cells.register(ps, "cells", cells.update)
|
||||||
providers.register(ps, "providers", providers.update)
|
providers.register(ps, "providers", providers.update)
|
||||||
@ -78,8 +78,8 @@ local function new_view(root, x, y, data, ps, id)
|
|||||||
local in_cap = VerticalBar{parent=rect,x=7,y=12,fg_bg=cpair(colors.red,colors.gray),height=7,width=1}
|
local in_cap = VerticalBar{parent=rect,x=7,y=12,fg_bg=cpair(colors.red,colors.gray),height=7,width=1}
|
||||||
local out_cap = VerticalBar{parent=rect,x=9,y=12,fg_bg=cpair(colors.blue,colors.gray),height=7,width=1}
|
local out_cap = VerticalBar{parent=rect,x=9,y=12,fg_bg=cpair(colors.blue,colors.gray),height=7,width=1}
|
||||||
|
|
||||||
TextBox{parent=rect,text="FILL",x=2,y=20,height=1,width=4,fg_bg=text_fg_bg}
|
TextBox{parent=rect,text="FILL",x=2,y=20,height=1,width=4,fg_bg=text_fg}
|
||||||
TextBox{parent=rect,text="I/O",x=7,y=20,height=1,width=3,fg_bg=text_fg_bg}
|
TextBox{parent=rect,text="I/O",x=7,y=20,height=1,width=3,fg_bg=text_fg}
|
||||||
|
|
||||||
local function calc_saturation(val)
|
local function calc_saturation(val)
|
||||||
if (type(data.build) == "table") and (type(data.build.transfer_cap) == "number") and (data.build.transfer_cap > 0) then
|
if (type(data.build) == "table") and (type(data.build.transfer_cap) == "number") and (data.build.transfer_cap > 0) then
|
||||||
|
@ -33,7 +33,9 @@ local lu_cpair = style.lu_colors
|
|||||||
local hzd_fg_bg = style.hzd_fg_bg
|
local hzd_fg_bg = style.hzd_fg_bg
|
||||||
local dis_colors = style.dis_colors
|
local dis_colors = style.dis_colors
|
||||||
|
|
||||||
local gry_wht = style.gray_white
|
local s_hi_box = style.theme.highlight_box
|
||||||
|
local s_field = style.theme.field_box
|
||||||
|
local arrow_col = cpair(style.theme.label, s_hi_box.bkg)
|
||||||
|
|
||||||
local ind_grn = style.ind_grn
|
local ind_grn = style.ind_grn
|
||||||
local ind_yel = style.ind_yel
|
local ind_yel = style.ind_yel
|
||||||
@ -103,11 +105,11 @@ local function new_view(root, x, y)
|
|||||||
gen_fault.register(facility.ps, "as_gen_fault", gen_fault.update)
|
gen_fault.register(facility.ps, "as_gen_fault", gen_fault.update)
|
||||||
|
|
||||||
TextBox{parent=main,y=23,text="Radiation",height=1,width=13,fg_bg=style.label}
|
TextBox{parent=main,y=23,text="Radiation",height=1,width=13,fg_bg=style.label}
|
||||||
local radiation = RadIndicator{parent=main,label="",format="%9.3f",lu_colors=lu_cpair,width=13,fg_bg=bw_fg_bg}
|
local radiation = RadIndicator{parent=main,label="",format="%9.3f",lu_colors=lu_cpair,width=13,fg_bg=s_field}
|
||||||
radiation.register(facility.ps, "radiation", radiation.update)
|
radiation.register(facility.ps, "radiation", radiation.update)
|
||||||
|
|
||||||
TextBox{parent=main,x=15,y=23,text="Linked RTUs",height=1,width=11,fg_bg=style.label}
|
TextBox{parent=main,x=15,y=23,text="Linked RTUs",height=1,width=11,fg_bg=style.label}
|
||||||
local rtu_count = DataIndicator{parent=main,x=15,y=24,label="",format="%11d",value=0,lu_colors=lu_cpair,width=11,fg_bg=bw_fg_bg}
|
local rtu_count = DataIndicator{parent=main,x=15,y=24,label="",format="%11d",value=0,lu_colors=lu_cpair,width=11,fg_bg=s_field}
|
||||||
rtu_count.register(facility.ps, "rtu_count", rtu_count.update)
|
rtu_count.register(facility.ps, "rtu_count", rtu_count.update)
|
||||||
|
|
||||||
---------------------
|
---------------------
|
||||||
@ -125,9 +127,9 @@ local function new_view(root, x, y)
|
|||||||
local burn_tag = Div{parent=targets,x=1,y=1,width=8,height=4,fg_bg=blk_pur}
|
local burn_tag = Div{parent=targets,x=1,y=1,width=8,height=4,fg_bg=blk_pur}
|
||||||
TextBox{parent=burn_tag,x=2,y=2,text="Burn Target",width=7,height=2}
|
TextBox{parent=burn_tag,x=2,y=2,text="Burn Target",width=7,height=2}
|
||||||
|
|
||||||
local burn_target = Div{parent=targets,x=9,y=1,width=23,height=3,fg_bg=gry_wht}
|
local burn_target = Div{parent=targets,x=9,y=1,width=23,height=3,fg_bg=s_hi_box}
|
||||||
local b_target = SpinboxNumeric{parent=burn_target,x=11,y=1,whole_num_precision=4,fractional_precision=1,min=0.1,arrow_fg_bg=gry_wht,fg_bg=bw_fg_bg}
|
local b_target = SpinboxNumeric{parent=burn_target,x=11,y=1,whole_num_precision=4,fractional_precision=1,min=0.1,arrow_fg_bg=arrow_col,arrow_disable=style.theme.disabled}
|
||||||
TextBox{parent=burn_target,x=18,y=2,text="mB/t"}
|
TextBox{parent=burn_target,x=18,y=2,text="mB/t",fg_bg=style.theme.label_fg}
|
||||||
local burn_sum = DataIndicator{parent=targets,x=9,y=4,label="",format="%18.1f",value=0,unit="mB/t",commas=true,lu_colors=black,width=23,fg_bg=blk_brn}
|
local burn_sum = DataIndicator{parent=targets,x=9,y=4,label="",format="%18.1f",value=0,unit="mB/t",commas=true,lu_colors=black,width=23,fg_bg=blk_brn}
|
||||||
|
|
||||||
b_target.register(facility.ps, "process_burn_target", b_target.set_value)
|
b_target.register(facility.ps, "process_burn_target", b_target.set_value)
|
||||||
@ -136,9 +138,9 @@ local function new_view(root, x, y)
|
|||||||
local chg_tag = Div{parent=targets,x=1,y=6,width=8,height=4,fg_bg=blk_pur}
|
local chg_tag = Div{parent=targets,x=1,y=6,width=8,height=4,fg_bg=blk_pur}
|
||||||
TextBox{parent=chg_tag,x=2,y=2,text="Charge Target",width=7,height=2}
|
TextBox{parent=chg_tag,x=2,y=2,text="Charge Target",width=7,height=2}
|
||||||
|
|
||||||
local chg_target = Div{parent=targets,x=9,y=6,width=23,height=3,fg_bg=gry_wht}
|
local chg_target = Div{parent=targets,x=9,y=6,width=23,height=3,fg_bg=s_hi_box}
|
||||||
local c_target = SpinboxNumeric{parent=chg_target,x=2,y=1,whole_num_precision=15,fractional_precision=0,min=0,arrow_fg_bg=gry_wht,fg_bg=bw_fg_bg}
|
local c_target = SpinboxNumeric{parent=chg_target,x=2,y=1,whole_num_precision=15,fractional_precision=0,min=0,arrow_fg_bg=arrow_col,arrow_disable=style.theme.disabled}
|
||||||
TextBox{parent=chg_target,x=18,y=2,text="MFE"}
|
TextBox{parent=chg_target,x=18,y=2,text="MFE",fg_bg=style.theme.label_fg}
|
||||||
local cur_charge = DataIndicator{parent=targets,x=9,y=9,label="",format="%19d",value=0,unit="MFE",commas=true,lu_colors=black,width=23,fg_bg=blk_brn}
|
local cur_charge = DataIndicator{parent=targets,x=9,y=9,label="",format="%19d",value=0,unit="MFE",commas=true,lu_colors=black,width=23,fg_bg=blk_brn}
|
||||||
|
|
||||||
c_target.register(facility.ps, "process_charge_target", c_target.set_value)
|
c_target.register(facility.ps, "process_charge_target", c_target.set_value)
|
||||||
@ -147,9 +149,9 @@ local function new_view(root, x, y)
|
|||||||
local gen_tag = Div{parent=targets,x=1,y=11,width=8,height=4,fg_bg=blk_pur}
|
local gen_tag = Div{parent=targets,x=1,y=11,width=8,height=4,fg_bg=blk_pur}
|
||||||
TextBox{parent=gen_tag,x=2,y=2,text="Gen. Target",width=7,height=2}
|
TextBox{parent=gen_tag,x=2,y=2,text="Gen. Target",width=7,height=2}
|
||||||
|
|
||||||
local gen_target = Div{parent=targets,x=9,y=11,width=23,height=3,fg_bg=gry_wht}
|
local gen_target = Div{parent=targets,x=9,y=11,width=23,height=3,fg_bg=s_hi_box}
|
||||||
local g_target = SpinboxNumeric{parent=gen_target,x=8,y=1,whole_num_precision=9,fractional_precision=0,min=0,arrow_fg_bg=gry_wht,fg_bg=bw_fg_bg}
|
local g_target = SpinboxNumeric{parent=gen_target,x=8,y=1,whole_num_precision=9,fractional_precision=0,min=0,arrow_fg_bg=arrow_col,arrow_disable=style.theme.disabled}
|
||||||
TextBox{parent=gen_target,x=18,y=2,text="kFE/t"}
|
TextBox{parent=gen_target,x=18,y=2,text="kFE/t",fg_bg=style.theme.label_fg}
|
||||||
local cur_gen = DataIndicator{parent=targets,x=9,y=14,label="",format="%17d",value=0,unit="kFE/t",commas=true,lu_colors=black,width=23,fg_bg=blk_brn}
|
local cur_gen = DataIndicator{parent=targets,x=9,y=14,label="",format="%17d",value=0,unit="kFE/t",commas=true,lu_colors=black,width=23,fg_bg=blk_brn}
|
||||||
|
|
||||||
g_target.register(facility.ps, "process_gen_target", g_target.set_value)
|
g_target.register(facility.ps, "process_gen_target", g_target.set_value)
|
||||||
@ -165,17 +167,17 @@ local function new_view(root, x, y)
|
|||||||
|
|
||||||
for i = 1, 4 do
|
for i = 1, 4 do
|
||||||
local unit
|
local unit
|
||||||
local tag_fg_bg = gry_wht
|
local tag_fg_bg = cpair(style.theme.disabled, s_hi_box.bkg)
|
||||||
local lim_fg_bg = style.lg_white
|
local lim_fg_bg = cpair(style.theme.disabled, s_hi_box.bkg)
|
||||||
local ctl_fg = colors.lightGray
|
local label_fg = style.theme.disabled_fg
|
||||||
local cur_fg_bg = style.lg_white
|
local cur_fg_bg = cpair(style.theme.disabled, s_hi_box.bkg)
|
||||||
local cur_lu = colors.lightGray
|
local cur_lu = style.theme.disabled
|
||||||
|
|
||||||
if i <= facility.num_units then
|
if i <= facility.num_units then
|
||||||
unit = units[i] ---@type ioctl_unit
|
unit = units[i] ---@type ioctl_unit
|
||||||
tag_fg_bg = cpair(colors.black, colors.lightBlue)
|
tag_fg_bg = cpair(colors.black, colors.lightBlue)
|
||||||
lim_fg_bg = bw_fg_bg
|
lim_fg_bg = s_hi_box
|
||||||
ctl_fg = colors.gray
|
label_fg = style.theme.label_fg
|
||||||
cur_fg_bg = blk_brn
|
cur_fg_bg = blk_brn
|
||||||
cur_lu = colors.black
|
cur_lu = colors.black
|
||||||
end
|
end
|
||||||
@ -185,9 +187,9 @@ local function new_view(root, x, y)
|
|||||||
local unit_tag = Div{parent=limit_div,x=1,y=_y,width=8,height=4,fg_bg=tag_fg_bg}
|
local unit_tag = Div{parent=limit_div,x=1,y=_y,width=8,height=4,fg_bg=tag_fg_bg}
|
||||||
TextBox{parent=unit_tag,x=2,y=2,text="Unit "..i.." Limit",width=7,height=2}
|
TextBox{parent=unit_tag,x=2,y=2,text="Unit "..i.." Limit",width=7,height=2}
|
||||||
|
|
||||||
local lim_ctl = Div{parent=limit_div,x=9,y=_y,width=14,height=3,fg_bg=cpair(ctl_fg,colors.white)}
|
local lim_ctl = Div{parent=limit_div,x=9,y=_y,width=14,height=3,fg_bg=s_hi_box}
|
||||||
local lim = SpinboxNumeric{parent=lim_ctl,x=2,y=1,whole_num_precision=4,fractional_precision=1,min=0.1,arrow_fg_bg=gry_wht,fg_bg=lim_fg_bg}
|
local lim = SpinboxNumeric{parent=lim_ctl,x=2,y=1,whole_num_precision=4,fractional_precision=1,min=0.1,arrow_fg_bg=arrow_col,arrow_disable=style.theme.disabled,fg_bg=lim_fg_bg}
|
||||||
TextBox{parent=lim_ctl,x=9,y=2,text="mB/t",width=4,height=1}
|
TextBox{parent=lim_ctl,x=9,y=2,text="mB/t",width=4,height=1,fg_bg=label_fg}
|
||||||
|
|
||||||
local cur_burn = DataIndicator{parent=limit_div,x=9,y=_y+3,label="",format="%7.1f",value=0,unit="mB/t",commas=false,lu_colors=cpair(cur_lu,cur_lu),width=14,fg_bg=cur_fg_bg}
|
local cur_burn = DataIndicator{parent=limit_div,x=9,y=_y+3,label="",format="%7.1f",value=0,unit="mB/t",commas=false,lu_colors=cpair(cur_lu,cur_lu),width=14,fg_bg=cur_fg_bg}
|
||||||
|
|
||||||
@ -209,14 +211,14 @@ local function new_view(root, x, y)
|
|||||||
local stat_div = Div{parent=proc,width=22,height=24,x=57,y=6}
|
local stat_div = Div{parent=proc,width=22,height=24,x=57,y=6}
|
||||||
|
|
||||||
for i = 1, 4 do
|
for i = 1, 4 do
|
||||||
local tag_fg_bg = gry_wht
|
local tag_fg_bg = cpair(style.theme.disabled, s_hi_box.bkg)
|
||||||
local ind_fg_bg = style.lg_white
|
local ind_fg_bg = cpair(style.theme.disabled, s_hi_box.bkg)
|
||||||
local ind_off = colors.lightGray
|
local ind_off = style.theme.disabled
|
||||||
|
|
||||||
if i <= facility.num_units then
|
if i <= facility.num_units then
|
||||||
tag_fg_bg = cpair(colors.black, colors.cyan)
|
tag_fg_bg = cpair(colors.black, colors.cyan)
|
||||||
ind_fg_bg = bw_fg_bg
|
ind_fg_bg = cpair(style.theme.text, s_hi_box.bkg)
|
||||||
ind_off = colors.gray
|
ind_off = style.theme.label
|
||||||
end
|
end
|
||||||
|
|
||||||
local _y = ((i - 1) * 5) + 1
|
local _y = ((i - 1) * 5) + 1
|
||||||
@ -241,18 +243,18 @@ local function new_view(root, x, y)
|
|||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
local ctl_opts = { "Monitored Max Burn", "Combined Burn Rate", "Charge Level", "Generation Rate" }
|
local ctl_opts = { "Monitored Max Burn", "Combined Burn Rate", "Charge Level", "Generation Rate" }
|
||||||
local mode = RadioButton{parent=proc,x=34,y=1,options=ctl_opts,callback=function()end,radio_colors=cpair(colors.gray,colors.white),select_color=colors.purple}
|
local mode = RadioButton{parent=proc,x=34,y=1,options=ctl_opts,callback=function()end,radio_colors=cpair(style.theme.accent_dark,style.theme.accent_light),select_color=colors.purple}
|
||||||
|
|
||||||
mode.register(facility.ps, "process_mode", mode.set_value)
|
mode.register(facility.ps, "process_mode", mode.set_value)
|
||||||
|
|
||||||
local u_stat = Rectangle{parent=proc,border=border(1,colors.gray,true),thin=true,width=31,height=4,x=1,y=16,fg_bg=bw_fg_bg}
|
local u_stat = Rectangle{parent=proc,border=border(1,colors.gray,true),thin=true,width=31,height=4,x=1,y=16,fg_bg=bw_fg_bg}
|
||||||
local stat_line_1 = TextBox{parent=u_stat,x=1,y=1,text="UNKNOWN",width=31,height=1,alignment=ALIGN.CENTER,fg_bg=bw_fg_bg}
|
local stat_line_1 = TextBox{parent=u_stat,x=1,y=1,text="UNKNOWN",width=31,height=1,alignment=ALIGN.CENTER,fg_bg=bw_fg_bg}
|
||||||
local stat_line_2 = TextBox{parent=u_stat,x=1,y=2,text="awaiting data...",width=31,height=1,alignment=ALIGN.CENTER,fg_bg=gry_wht}
|
local stat_line_2 = TextBox{parent=u_stat,x=1,y=2,text="awaiting data...",width=31,height=1,alignment=ALIGN.CENTER,fg_bg=cpair(colors.gray,colors.white)}
|
||||||
|
|
||||||
stat_line_1.register(facility.ps, "status_line_1", stat_line_1.set_value)
|
stat_line_1.register(facility.ps, "status_line_1", stat_line_1.set_value)
|
||||||
stat_line_2.register(facility.ps, "status_line_2", stat_line_2.set_value)
|
stat_line_2.register(facility.ps, "status_line_2", stat_line_2.set_value)
|
||||||
|
|
||||||
local auto_controls = Div{parent=proc,x=1,y=20,width=31,height=5,fg_bg=gry_wht}
|
local auto_controls = Div{parent=proc,x=1,y=20,width=31,height=5,fg_bg=s_hi_box}
|
||||||
|
|
||||||
-- save the automatic process control configuration without starting
|
-- save the automatic process control configuration without starting
|
||||||
local function _save_cfg()
|
local function _save_cfg()
|
||||||
@ -327,15 +329,17 @@ local function new_view(root, x, y)
|
|||||||
|
|
||||||
local waste_sel = Div{parent=proc,width=21,height=24,x=81,y=1}
|
local waste_sel = Div{parent=proc,width=21,height=24,x=81,y=1}
|
||||||
|
|
||||||
TextBox{parent=waste_sel,text=" ",width=21,height=1,x=1,y=1,fg_bg=blk_brn}
|
local cutout_fg_bg = cpair(style.theme.bg, colors.brown)
|
||||||
TextBox{parent=waste_sel,text="WASTE PRODUCTION",alignment=ALIGN.CENTER,width=21,height=1,x=1,y=2,fg_bg=cpair(colors.lightGray,colors.brown)}
|
|
||||||
|
TextBox{parent=waste_sel,text=" ",width=21,height=1,x=1,y=1,fg_bg=cutout_fg_bg}
|
||||||
|
TextBox{parent=waste_sel,text="WASTE PRODUCTION",alignment=ALIGN.CENTER,width=21,height=1,x=1,y=2,fg_bg=cutout_fg_bg}
|
||||||
|
|
||||||
local rect = Rectangle{parent=waste_sel,border=border(1,colors.brown,true),width=21,height=22,x=1,y=3}
|
local rect = Rectangle{parent=waste_sel,border=border(1,colors.brown,true),width=21,height=22,x=1,y=3}
|
||||||
local status = StateIndicator{parent=rect,x=2,y=1,states=style.waste.states,value=1,min_width=17}
|
local status = StateIndicator{parent=rect,x=2,y=1,states=style.waste.states,value=1,min_width=17}
|
||||||
|
|
||||||
status.register(facility.ps, "current_waste_product", status.update)
|
status.register(facility.ps, "current_waste_product", status.update)
|
||||||
|
|
||||||
local waste_prod = RadioButton{parent=rect,x=2,y=3,options=style.waste.options,callback=process.set_process_waste,radio_colors=cpair(colors.gray,colors.white),select_color=colors.brown}
|
local waste_prod = RadioButton{parent=rect,x=2,y=3,options=style.waste.options,callback=process.set_process_waste,radio_colors=cpair(style.theme.accent_dark,style.theme.accent_light),select_color=colors.brown}
|
||||||
local pu_fallback = Checkbox{parent=rect,x=2,y=7,label="Pu Fallback",callback=process.set_pu_fallback,box_fg_bg=cpair(colors.green,colors.black)}
|
local pu_fallback = Checkbox{parent=rect,x=2,y=7,label="Pu Fallback",callback=process.set_pu_fallback,box_fg_bg=cpair(colors.green,colors.black)}
|
||||||
|
|
||||||
waste_prod.register(facility.ps, "process_waste_product", waste_prod.set_value)
|
waste_prod.register(facility.ps, "process_waste_product", waste_prod.set_value)
|
||||||
@ -346,13 +350,13 @@ local function new_view(root, x, y)
|
|||||||
fb_active.register(facility.ps, "pu_fallback_active", fb_active.update)
|
fb_active.register(facility.ps, "pu_fallback_active", fb_active.update)
|
||||||
|
|
||||||
TextBox{parent=rect,x=2,y=11,text="Plutonium Rate",height=1,width=17,fg_bg=style.label}
|
TextBox{parent=rect,x=2,y=11,text="Plutonium Rate",height=1,width=17,fg_bg=style.label}
|
||||||
local pu_rate = DataIndicator{parent=rect,x=2,label="",unit="mB/t",format="%12.2f",value=0,lu_colors=lu_cpair,fg_bg=bw_fg_bg,width=17}
|
local pu_rate = DataIndicator{parent=rect,x=2,label="",unit="mB/t",format="%12.2f",value=0,lu_colors=lu_cpair,fg_bg=s_field,width=17}
|
||||||
|
|
||||||
TextBox{parent=rect,x=2,y=14,text="Polonium Rate",height=1,width=17,fg_bg=style.label}
|
TextBox{parent=rect,x=2,y=14,text="Polonium Rate",height=1,width=17,fg_bg=style.label}
|
||||||
local po_rate = DataIndicator{parent=rect,x=2,label="",unit="mB/t",format="%12.2f",value=0,lu_colors=lu_cpair,fg_bg=bw_fg_bg,width=17}
|
local po_rate = DataIndicator{parent=rect,x=2,label="",unit="mB/t",format="%12.2f",value=0,lu_colors=lu_cpair,fg_bg=s_field,width=17}
|
||||||
|
|
||||||
TextBox{parent=rect,x=2,y=17,text="Antimatter Rate",height=1,width=17,fg_bg=style.label}
|
TextBox{parent=rect,x=2,y=17,text="Antimatter Rate",height=1,width=17,fg_bg=style.label}
|
||||||
local am_rate = DataIndicator{parent=rect,x=2,label="",unit="\xb5B/t",format="%12d",value=0,lu_colors=lu_cpair,fg_bg=bw_fg_bg,width=17}
|
local am_rate = DataIndicator{parent=rect,x=2,label="",unit="\xb5B/t",format="%12d",value=0,lu_colors=lu_cpair,fg_bg=s_field,width=17}
|
||||||
|
|
||||||
pu_rate.register(facility.ps, "pu_rate", pu_rate.update)
|
pu_rate.register(facility.ps, "pu_rate", pu_rate.update)
|
||||||
po_rate.register(facility.ps, "po_rate", po_rate.update)
|
po_rate.register(facility.ps, "po_rate", po_rate.update)
|
||||||
|
@ -16,7 +16,7 @@ local StateIndicator = require("graphics.elements.indicators.state")
|
|||||||
local cpair = core.cpair
|
local cpair = core.cpair
|
||||||
local border = core.border
|
local border = core.border
|
||||||
|
|
||||||
local text_fg_bg = style.text_colors
|
local text_fg = style.theme.text_fg
|
||||||
local lu_col = style.lu_colors
|
local lu_col = style.lu_colors
|
||||||
|
|
||||||
-- create new reactor view
|
-- create new reactor view
|
||||||
@ -30,9 +30,9 @@ local function new_view(root, x, y, ps)
|
|||||||
local reactor = Rectangle{parent=root,border=border(1,colors.gray,true),width=30,height=7,x=x,y=y}
|
local reactor = Rectangle{parent=root,border=border(1,colors.gray,true),width=30,height=7,x=x,y=y}
|
||||||
|
|
||||||
local status = StateIndicator{parent=reactor,x=6,y=1,states=style.reactor.states,value=1,min_width=16}
|
local status = StateIndicator{parent=reactor,x=6,y=1,states=style.reactor.states,value=1,min_width=16}
|
||||||
local core_temp = DataIndicator{parent=reactor,x=2,y=3,lu_colors=lu_col,label="Core Temp:",unit=db.temp_label,format="%10.2f",value=0,commas=true,width=26,fg_bg=text_fg_bg}
|
local core_temp = DataIndicator{parent=reactor,x=2,y=3,lu_colors=lu_col,label="Core Temp:",unit=db.temp_label,format="%10.2f",value=0,commas=true,width=26,fg_bg=text_fg}
|
||||||
local burn_r = DataIndicator{parent=reactor,x=2,y=4,lu_colors=lu_col,label="Burn Rate:",unit="mB/t",format="%10.2f",value=0,width=26,fg_bg=text_fg_bg}
|
local burn_r = DataIndicator{parent=reactor,x=2,y=4,lu_colors=lu_col,label="Burn Rate:",unit="mB/t",format="%10.2f",value=0,width=26,fg_bg=text_fg}
|
||||||
local heating_r = DataIndicator{parent=reactor,x=2,y=5,lu_colors=lu_col,label="Heating:",unit="mB/t",format="%12.0f",value=0,commas=true,width=26,fg_bg=text_fg_bg}
|
local heating_r = DataIndicator{parent=reactor,x=2,y=5,lu_colors=lu_col,label="Heating:",unit="mB/t",format="%12.0f",value=0,commas=true,width=26,fg_bg=text_fg}
|
||||||
|
|
||||||
status.register(ps, "computed_status", status.update)
|
status.register(ps, "computed_status", status.update)
|
||||||
core_temp.register(ps, "temp", function (t) core_temp.update(db.temp_convert(t)) end)
|
core_temp.register(ps, "temp", function (t) core_temp.update(db.temp_convert(t)) end)
|
||||||
@ -41,12 +41,12 @@ local function new_view(root, x, y, ps)
|
|||||||
|
|
||||||
local reactor_fills = Rectangle{parent=root,border=border(1, colors.gray, true),width=24,height=7,x=(x + 29),y=y}
|
local reactor_fills = Rectangle{parent=root,border=border(1, colors.gray, true),width=24,height=7,x=(x + 29),y=y}
|
||||||
|
|
||||||
TextBox{parent=reactor_fills,text="FUEL",x=2,y=1,height=1,fg_bg=text_fg_bg}
|
TextBox{parent=reactor_fills,text="FUEL",x=2,y=1,height=1,fg_bg=text_fg}
|
||||||
TextBox{parent=reactor_fills,text="COOL",x=2,y=2,height=1,fg_bg=text_fg_bg}
|
TextBox{parent=reactor_fills,text="COOL",x=2,y=2,height=1,fg_bg=text_fg}
|
||||||
TextBox{parent=reactor_fills,text="HCOOL",x=2,y=4,height=1,fg_bg=text_fg_bg}
|
TextBox{parent=reactor_fills,text="HCOOL",x=2,y=4,height=1,fg_bg=text_fg}
|
||||||
TextBox{parent=reactor_fills,text="WASTE",x=2,y=5,height=1,fg_bg=text_fg_bg}
|
TextBox{parent=reactor_fills,text="WASTE",x=2,y=5,height=1,fg_bg=text_fg}
|
||||||
|
|
||||||
local fuel = HorizontalBar{parent=reactor_fills,x=8,y=1,show_percent=true,bar_fg_bg=cpair(colors.black,colors.gray),height=1,width=14}
|
local fuel = HorizontalBar{parent=reactor_fills,x=8,y=1,show_percent=true,bar_fg_bg=cpair(style.theme.fuel_color,colors.gray),height=1,width=14}
|
||||||
local ccool = HorizontalBar{parent=reactor_fills,x=8,y=2,show_percent=true,bar_fg_bg=cpair(colors.blue,colors.gray),height=1,width=14}
|
local ccool = HorizontalBar{parent=reactor_fills,x=8,y=2,show_percent=true,bar_fg_bg=cpair(colors.blue,colors.gray),height=1,width=14}
|
||||||
local hcool = HorizontalBar{parent=reactor_fills,x=8,y=4,show_percent=true,bar_fg_bg=cpair(colors.white,colors.gray),height=1,width=14}
|
local hcool = HorizontalBar{parent=reactor_fills,x=8,y=4,show_percent=true,bar_fg_bg=cpair(colors.white,colors.gray),height=1,width=14}
|
||||||
local waste = HorizontalBar{parent=reactor_fills,x=8,y=5,show_percent=true,bar_fg_bg=cpair(colors.brown,colors.gray),height=1,width=14}
|
local waste = HorizontalBar{parent=reactor_fills,x=8,y=5,show_percent=true,bar_fg_bg=cpair(colors.brown,colors.gray),height=1,width=14}
|
||||||
|
@ -15,7 +15,7 @@ local VerticalBar = require("graphics.elements.indicators.vbar")
|
|||||||
local cpair = core.cpair
|
local cpair = core.cpair
|
||||||
local border = core.border
|
local border = core.border
|
||||||
|
|
||||||
local text_fg_bg = style.text_colors
|
local text_fg = style.theme.text_fg
|
||||||
local lu_col = style.lu_colors
|
local lu_col = style.lu_colors
|
||||||
|
|
||||||
-- new turbine view
|
-- new turbine view
|
||||||
@ -27,8 +27,8 @@ local function new_view(root, x, y, ps)
|
|||||||
local turbine = Rectangle{parent=root,border=border(1,colors.gray,true),width=23,height=7,x=x,y=y}
|
local turbine = Rectangle{parent=root,border=border(1,colors.gray,true),width=23,height=7,x=x,y=y}
|
||||||
|
|
||||||
local status = StateIndicator{parent=turbine,x=7,y=1,states=style.turbine.states,value=1,min_width=12}
|
local status = StateIndicator{parent=turbine,x=7,y=1,states=style.turbine.states,value=1,min_width=12}
|
||||||
local prod_rate = PowerIndicator{parent=turbine,x=5,y=3,lu_colors=lu_col,label="",format="%10.2f",value=0,rate=true,width=16,fg_bg=text_fg_bg}
|
local prod_rate = PowerIndicator{parent=turbine,x=5,y=3,lu_colors=lu_col,label="",format="%10.2f",value=0,rate=true,width=16,fg_bg=text_fg}
|
||||||
local flow_rate = DataIndicator{parent=turbine,x=5,y=4,lu_colors=lu_col,label="",unit="mB/t",format="%10.0f",value=0,commas=true,width=16,fg_bg=text_fg_bg}
|
local flow_rate = DataIndicator{parent=turbine,x=5,y=4,lu_colors=lu_col,label="",unit="mB/t",format="%10.0f",value=0,commas=true,width=16,fg_bg=text_fg}
|
||||||
|
|
||||||
status.register(ps, "computed_status", status.update)
|
status.register(ps, "computed_status", status.update)
|
||||||
prod_rate.register(ps, "prod_rate", function (val) prod_rate.update(util.joules_to_fe(val)) end)
|
prod_rate.register(ps, "prod_rate", function (val) prod_rate.update(util.joules_to_fe(val)) end)
|
||||||
@ -37,8 +37,8 @@ local function new_view(root, x, y, ps)
|
|||||||
local steam = VerticalBar{parent=turbine,x=2,y=1,fg_bg=cpair(colors.white,colors.gray),height=4,width=1}
|
local steam = VerticalBar{parent=turbine,x=2,y=1,fg_bg=cpair(colors.white,colors.gray),height=4,width=1}
|
||||||
local energy = VerticalBar{parent=turbine,x=3,y=1,fg_bg=cpair(colors.green,colors.gray),height=4,width=1}
|
local energy = VerticalBar{parent=turbine,x=3,y=1,fg_bg=cpair(colors.green,colors.gray),height=4,width=1}
|
||||||
|
|
||||||
TextBox{parent=turbine,text="S",x=2,y=5,height=1,width=1,fg_bg=text_fg_bg}
|
TextBox{parent=turbine,text="S",x=2,y=5,height=1,width=1,fg_bg=text_fg}
|
||||||
TextBox{parent=turbine,text="E",x=3,y=5,height=1,width=1,fg_bg=text_fg_bg}
|
TextBox{parent=turbine,text="E",x=3,y=5,height=1,width=1,fg_bg=text_fg}
|
||||||
|
|
||||||
steam.register(ps, "steam_fill", steam.update)
|
steam.register(ps, "steam_fill", steam.update)
|
||||||
energy.register(ps, "energy_fill", energy.update)
|
energy.register(ps, "energy_fill", energy.update)
|
||||||
|
@ -64,7 +64,7 @@ local function init(parent, id)
|
|||||||
local b_ps = unit.boiler_ps_tbl
|
local b_ps = unit.boiler_ps_tbl
|
||||||
local t_ps = unit.turbine_ps_tbl
|
local t_ps = unit.turbine_ps_tbl
|
||||||
|
|
||||||
TextBox{parent=main,text="Reactor Unit #" .. id,alignment=ALIGN.CENTER,height=1,fg_bg=style.header}
|
TextBox{parent=main,text="Reactor Unit #" .. id,alignment=ALIGN.CENTER,height=1,fg_bg=style.theme.header}
|
||||||
|
|
||||||
-----------------------------
|
-----------------------------
|
||||||
-- main stats and core map --
|
-- main stats and core map --
|
||||||
|
@ -44,7 +44,7 @@ local function make(parent, x, y, unit)
|
|||||||
local root = Div{parent=parent,x=x,y=y,width=80,height=height}
|
local root = Div{parent=parent,x=x,y=y,width=80,height=height}
|
||||||
|
|
||||||
-- unit header message
|
-- unit header message
|
||||||
TextBox{parent=root,text="Unit #"..unit.unit_id,alignment=ALIGN.CENTER,height=1,fg_bg=style.header}
|
TextBox{parent=root,text="Unit #"..unit.unit_id,alignment=ALIGN.CENTER,height=1,fg_bg=style.theme.header}
|
||||||
|
|
||||||
-------------
|
-------------
|
||||||
-- REACTOR --
|
-- REACTOR --
|
||||||
@ -66,7 +66,7 @@ local function make(parent, x, y, unit)
|
|||||||
table.insert(coolant_pipes, pipe(2, 0, 11, 11, colors.orange))
|
table.insert(coolant_pipes, pipe(2, 0, 11, 11, colors.orange))
|
||||||
end
|
end
|
||||||
|
|
||||||
PipeNetwork{parent=root,x=4,y=10,pipes=coolant_pipes,bg=colors.lightGray}
|
PipeNetwork{parent=root,x=4,y=10,pipes=coolant_pipes,bg=style.theme.bg}
|
||||||
end
|
end
|
||||||
|
|
||||||
-------------
|
-------------
|
||||||
@ -164,10 +164,10 @@ local function make(parent, x, y, unit)
|
|||||||
table.insert(steam_pipes_b, pipe(0, 18, 2, 18, colors.blue, false, true)) -- water boiler 2 to turbine 2 junction
|
table.insert(steam_pipes_b, pipe(0, 18, 2, 18, colors.blue, false, true)) -- water boiler 2 to turbine 2 junction
|
||||||
end
|
end
|
||||||
|
|
||||||
PipeNetwork{parent=root,x=47,y=11,pipes=steam_pipes_a,bg=colors.lightGray}
|
PipeNetwork{parent=root,x=47,y=11,pipes=steam_pipes_a,bg=style.theme.bg}
|
||||||
end
|
end
|
||||||
|
|
||||||
PipeNetwork{parent=root,x=54,y=3,pipes=steam_pipes_b,bg=colors.lightGray}
|
PipeNetwork{parent=root,x=54,y=3,pipes=steam_pipes_b,bg=style.theme.bg}
|
||||||
|
|
||||||
return root
|
return root
|
||||||
end
|
end
|
||||||
|
@ -46,9 +46,9 @@ local function init(main)
|
|||||||
local tank_list = facility.tank_list
|
local tank_list = facility.tank_list
|
||||||
|
|
||||||
-- window header message
|
-- window header message
|
||||||
local header = TextBox{parent=main,y=1,text="Facility Coolant and Waste Flow Monitor",alignment=ALIGN.CENTER,height=1,fg_bg=style.header}
|
local header = TextBox{parent=main,y=1,text="Facility Coolant and Waste Flow Monitor",alignment=ALIGN.CENTER,height=1,fg_bg=style.theme.header}
|
||||||
-- max length example: "01:23:45 AM - Wednesday, September 28 2022"
|
-- max length example: "01:23:45 AM - Wednesday, September 28 2022"
|
||||||
local datetime = TextBox{parent=main,x=(header.get_width()-42),y=1,text="",alignment=ALIGN.RIGHT,width=42,height=1,fg_bg=style.header}
|
local datetime = TextBox{parent=main,x=(header.get_width()-42),y=1,text="",alignment=ALIGN.RIGHT,width=42,height=1,fg_bg=style.theme.header}
|
||||||
|
|
||||||
datetime.register(facility.ps, "date_time", datetime.set_value)
|
datetime.register(facility.ps, "date_time", datetime.set_value)
|
||||||
|
|
||||||
|
@ -12,12 +12,15 @@ local unit_overview = require("coordinator.ui.components.unit_overview")
|
|||||||
|
|
||||||
local core = require("graphics.core")
|
local core = require("graphics.core")
|
||||||
|
|
||||||
|
local ColorMap = require("graphics.elements.colormap")
|
||||||
local TextBox = require("graphics.elements.textbox")
|
local TextBox = require("graphics.elements.textbox")
|
||||||
|
|
||||||
local DataIndicator = require("graphics.elements.indicators.data")
|
local DataIndicator = require("graphics.elements.indicators.data")
|
||||||
|
|
||||||
local ALIGN = core.ALIGN
|
local ALIGN = core.ALIGN
|
||||||
|
|
||||||
|
local s_header = style.theme.header
|
||||||
|
|
||||||
-- create new main view
|
-- create new main view
|
||||||
---@param main graphics_element main displaybox
|
---@param main graphics_element main displaybox
|
||||||
local function init(main)
|
local function init(main)
|
||||||
@ -25,10 +28,10 @@ local function init(main)
|
|||||||
local units = iocontrol.get_db().units
|
local units = iocontrol.get_db().units
|
||||||
|
|
||||||
-- window header message
|
-- window header message
|
||||||
local header = TextBox{parent=main,y=1,text="Nuclear Generation Facility SCADA Coordinator",alignment=ALIGN.CENTER,height=1,fg_bg=style.header}
|
local header = TextBox{parent=main,y=1,text="Nuclear Generation Facility SCADA Coordinator",alignment=ALIGN.CENTER,height=1,fg_bg=s_header}
|
||||||
local ping = DataIndicator{parent=main,x=1,y=1,label="SVTT",format="%d",value=0,unit="ms",lu_colors=style.lg_white,width=12,fg_bg=style.header}
|
local ping = DataIndicator{parent=main,x=1,y=1,label="SVTT",format="%d",value=0,unit="ms",lu_colors=style.lg_white,width=12,fg_bg=s_header}
|
||||||
-- max length example: "01:23:45 AM - Wednesday, September 28 2022"
|
-- max length example: "01:23:45 AM - Wednesday, September 28 2022"
|
||||||
local datetime = TextBox{parent=main,x=(header.get_width()-42),y=1,text="",alignment=ALIGN.RIGHT,width=42,height=1,fg_bg=style.header}
|
local datetime = TextBox{parent=main,x=(header.get_width()-42),y=1,text="",alignment=ALIGN.RIGHT,width=42,height=1,fg_bg=s_header}
|
||||||
|
|
||||||
ping.register(facility.ps, "sv_ping", ping.update)
|
ping.register(facility.ps, "sv_ping", ping.update)
|
||||||
datetime.register(facility.ps, "date_time", datetime.set_value)
|
datetime.register(facility.ps, "date_time", datetime.set_value)
|
||||||
@ -66,6 +69,8 @@ local function init(main)
|
|||||||
|
|
||||||
-- command & control
|
-- command & control
|
||||||
|
|
||||||
|
ColorMap{parent=main,y=cnc_y_start+2}
|
||||||
|
|
||||||
cnc_y_start = cnc_y_start
|
cnc_y_start = cnc_y_start
|
||||||
|
|
||||||
-- induction matrix and process control interfaces are 24 tall + space needed for divider
|
-- induction matrix and process control interfaces are 24 tall + space needed for divider
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
local core = require("graphics.core")
|
local core = require("graphics.core")
|
||||||
|
|
||||||
|
---@class crd_style
|
||||||
local style = {}
|
local style = {}
|
||||||
|
|
||||||
local cpair = core.cpair
|
local cpair = core.cpair
|
||||||
@ -45,11 +46,69 @@ style.fp.colors = {
|
|||||||
|
|
||||||
-- main GUI styling
|
-- main GUI styling
|
||||||
|
|
||||||
style.root = cpair(colors.black, colors.lightGray)
|
---@class theme
|
||||||
style.header = cpair(colors.white, colors.gray)
|
local deepslate = {
|
||||||
style.label = cpair(colors.gray, colors.lightGray)
|
text = colors.white,
|
||||||
|
text_inv = colors.black,
|
||||||
|
label = colors.lightGray,
|
||||||
|
disabled = colors.gray,
|
||||||
|
bg = colors.black,
|
||||||
|
accent_light = colors.gray,
|
||||||
|
accent_dark = colors.lightGray,
|
||||||
|
|
||||||
style.colors = {
|
fuel_color = colors.lightGray,
|
||||||
|
|
||||||
|
header = cpair(colors.white, colors.gray),
|
||||||
|
|
||||||
|
text_fg = cpair(colors.white, colors._INHERIT),
|
||||||
|
label_fg = cpair(colors.lightGray, colors._INHERIT),
|
||||||
|
disabled_fg = cpair(colors.gray, colors._INHERIT),
|
||||||
|
|
||||||
|
highlight_box = cpair(colors.white, colors.gray),
|
||||||
|
field_box = cpair(colors.white, colors.gray),
|
||||||
|
|
||||||
|
colors = {
|
||||||
|
{ c = colors.red, hex = 0xeb6a6c },
|
||||||
|
{ c = colors.orange, hex = 0xf2b564 },
|
||||||
|
{ c = colors.yellow, hex = 0xd9cf81 },
|
||||||
|
{ c = colors.lime, hex = 0x80ff80 },
|
||||||
|
{ c = colors.green, hex = 0x5fe492 },
|
||||||
|
{ c = colors.cyan, hex = 0x6fdbdf },
|
||||||
|
{ c = colors.lightBlue, hex = 0x75beea },
|
||||||
|
{ c = colors.blue, hex = 0x4db4ff },
|
||||||
|
{ c = colors.purple, hex = 0xc38aea },
|
||||||
|
{ c = colors.pink, hex = 0xf26ba2 },
|
||||||
|
{ c = colors.magenta, hex = 0xf9488a },
|
||||||
|
{ c = colors.white, hex = 0xd9d9d9 },
|
||||||
|
{ c = colors.lightGray, hex = 0x949494 },
|
||||||
|
{ c = colors.gray, hex = 0x575757 },
|
||||||
|
{ c = colors.black, hex = 0x262626 },
|
||||||
|
{ c = colors.brown, hex = 0xb18f6a }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
---@type theme
|
||||||
|
local smooth_stone = {
|
||||||
|
text = colors.black,
|
||||||
|
text_inv = colors.white,
|
||||||
|
label = colors.gray,
|
||||||
|
disabled = colors.lightGray,
|
||||||
|
bg = colors.lightGray,
|
||||||
|
accent_light = colors.white,
|
||||||
|
accent_dark = colors.gray,
|
||||||
|
|
||||||
|
fuel_color = colors.black,
|
||||||
|
|
||||||
|
header = cpair(colors.white, colors.gray),
|
||||||
|
|
||||||
|
text_fg = cpair(colors.black, colors._INHERIT),
|
||||||
|
label_fg = cpair(colors.gray, colors._INHERIT),
|
||||||
|
disabled_fg = cpair(colors.lightGray, colors._INHERIT),
|
||||||
|
|
||||||
|
highlight_box = cpair(colors.black, colors.white),
|
||||||
|
field_box = cpair(colors.black, colors.white),
|
||||||
|
|
||||||
|
colors = {
|
||||||
{ c = colors.red, hex = 0xdf4949 },
|
{ c = colors.red, hex = 0xdf4949 },
|
||||||
{ c = colors.orange, hex = 0xffb659 },
|
{ c = colors.orange, hex = 0xffb659 },
|
||||||
{ c = colors.yellow, hex = 0xfffc79 },
|
{ c = colors.yellow, hex = 0xfffc79 },
|
||||||
@ -61,12 +120,19 @@ style.colors = {
|
|||||||
{ c = colors.purple, hex = 0xb156ee },
|
{ c = colors.purple, hex = 0xb156ee },
|
||||||
{ c = colors.pink, hex = 0xf26ba2 },
|
{ c = colors.pink, hex = 0xf26ba2 },
|
||||||
{ c = colors.magenta, hex = 0xf9488a },
|
{ c = colors.magenta, hex = 0xf9488a },
|
||||||
-- { c = colors.white, hex = 0xf0f0f0 },
|
{ c = colors.white, hex = 0xf0f0f0 },
|
||||||
{ c = colors.lightGray, hex = 0xcacaca },
|
{ c = colors.lightGray, hex = 0xcacaca },
|
||||||
{ c = colors.gray, hex = 0x575757 },
|
{ c = colors.gray, hex = 0x575757 },
|
||||||
-- { c = colors.black, hex = 0x191919 },
|
{ c = colors.black, hex = 0x191919 },
|
||||||
-- { c = colors.brown, hex = 0x7f664c }
|
{ c = colors.brown, hex = 0x7f664c }
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
style.theme = deepslate
|
||||||
|
-- style.theme = smooth_stone
|
||||||
|
|
||||||
|
style.root = cpair(style.theme.text, style.theme.bg)
|
||||||
|
style.label = cpair(style.theme.label, style.theme.bg)
|
||||||
|
|
||||||
-- COMMON COLOR PAIRS --
|
-- COMMON COLOR PAIRS --
|
||||||
|
|
||||||
@ -74,7 +140,7 @@ style.wh_gray = cpair(colors.white, colors.gray)
|
|||||||
|
|
||||||
style.bw_fg_bg = cpair(colors.black, colors.white)
|
style.bw_fg_bg = cpair(colors.black, colors.white)
|
||||||
style.text_colors = cpair(colors.black, colors.lightGray)
|
style.text_colors = cpair(colors.black, colors.lightGray)
|
||||||
style.lu_colors = cpair(colors.gray, colors.gray)
|
style.lu_colors = cpair(style.theme.label, style.theme.label)
|
||||||
style.hzd_fg_bg = style.wh_gray
|
style.hzd_fg_bg = style.wh_gray
|
||||||
style.dis_colors = cpair(colors.white, colors.lightGray)
|
style.dis_colors = cpair(colors.white, colors.lightGray)
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ local flasher = require("graphics.flasher")
|
|||||||
|
|
||||||
local core = {}
|
local core = {}
|
||||||
|
|
||||||
core.version = "2.1.1"
|
core.version = "2.2.0"
|
||||||
|
|
||||||
core.flasher = flasher
|
core.flasher = flasher
|
||||||
core.events = events
|
core.events = events
|
||||||
@ -61,6 +61,9 @@ end
|
|||||||
---@field blit_fgd string
|
---@field blit_fgd string
|
||||||
---@field blit_bkg string
|
---@field blit_bkg string
|
||||||
|
|
||||||
|
-- add inherited flag, 3 isn't a pure color so it wouldn't be used
|
||||||
|
colors._INHERIT = 3
|
||||||
|
|
||||||
-- create a new color pair definition
|
-- create a new color pair definition
|
||||||
---@nodiscard
|
---@nodiscard
|
||||||
---@param a color
|
---@param a color
|
||||||
|
@ -234,11 +234,24 @@ function element.new(args, child_offset_x, child_offset_y)
|
|||||||
|
|
||||||
-- init colors
|
-- init colors
|
||||||
if args.fg_bg ~= nil then
|
if args.fg_bg ~= nil then
|
||||||
protected.fg_bg = args.fg_bg
|
protected.fg_bg = core.cpair(args.fg_bg.fgd, args.fg_bg.bkg)
|
||||||
elseif args.parent ~= nil then
|
|
||||||
protected.fg_bg = args.parent.get_fg_bg()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if args.parent ~= nil then
|
||||||
|
local p_fg_bg = args.parent.get_fg_bg()
|
||||||
|
|
||||||
|
if args.fg_bg == nil then
|
||||||
|
protected.fg_bg = core.cpair(p_fg_bg.fgd, p_fg_bg.bkg)
|
||||||
|
else
|
||||||
|
if protected.fg_bg.fgd == colors._INHERIT then protected.fg_bg = core.cpair(p_fg_bg.fgd, protected.fg_bg.bkg) end
|
||||||
|
if protected.fg_bg.bkg == colors._INHERIT then protected.fg_bg = core.cpair(protected.fg_bg.fgd, p_fg_bg.bkg) end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- check colors
|
||||||
|
element.assert(protected.fg_bg.fgd ~= colors._INHERIT, "could not determine foreground color to inherit")
|
||||||
|
element.assert(protected.fg_bg.bkg ~= colors._INHERIT, "could not determine background color to inherit")
|
||||||
|
|
||||||
-- set colors
|
-- set colors
|
||||||
protected.window.setBackgroundColor(protected.fg_bg.bkg)
|
protected.window.setBackgroundColor(protected.fg_bg.bkg)
|
||||||
protected.window.setTextColor(protected.fg_bg.fgd)
|
protected.window.setTextColor(protected.fg_bg.fgd)
|
||||||
|
Loading…
Reference in New Issue
Block a user