#557 facility app data and fixes

This commit is contained in:
Mikayla Fischler
2025-01-20 15:38:53 -05:00
parent 127c878794
commit baba2e1411
8 changed files with 229 additions and 53 deletions

View File

@@ -11,7 +11,6 @@ local PushButton = require("graphics.elements.controls.PushButton")
local DataIndicator = require("graphics.elements.indicators.DataIndicator")
local HorizontalBar = require("graphics.elements.indicators.HorizontalBar")
local PowerIndicator = require("graphics.elements.indicators.PowerIndicator")
local StateIndicator = require("graphics.elements.indicators.StateIndicator")
local ALIGN = core.ALIGN
@@ -38,22 +37,19 @@ return function (app, panes, sps_pane, ps, update)
TextBox{parent=sps_div,y=1,text="Facility SPS",alignment=ALIGN.CENTER}
local status = StateIndicator{parent=sps_div,x=5,y=3,states=style.sps.states,value=1,min_width=12}
status.register(ps, "sps_computed_status", status.update)
status.register(ps, "SPSStateStatus", status.update)
TextBox{parent=sps_div,text="Po",y=5,fg_bg=label}
local po_bar = HorizontalBar{parent=sps_div,x=4,y=5,fg_bg=cpair(colors.cyan,colors.gray),height=1}
TextBox{parent=sps_div,text="AM",y=7,fg_bg=label}
local am_bar = HorizontalBar{parent=sps_div,x=4,y=7,fg_bg=cpair(colors.purple,colors.gray),height=1}
TextBox{parent=sps_div,text="En",y=9,fg_bg=label}
local energy_bar = HorizontalBar{parent=sps_div,x=4,y=9,fg_bg=cpair(colors.green,colors.gray),height=1}
po_bar.register(ps, "input_fill", po_bar.update)
am_bar.register(ps, "output_fill", am_bar.update)
energy_bar.register(ps, "energy_fill", energy_bar.update)
TextBox{parent=sps_div,y=11,text="Input Rate",width=10,fg_bg=label}
TextBox{parent=sps_div,y=9,text="Input Rate",width=10,fg_bg=label}
local input_rate = DataIndicator{parent=sps_div,label="",format="%16.2f",value=0,unit="mB/t",lu_colors=lu_col,width=21,fg_bg=text_fg}
TextBox{parent=sps_div,y=14,text="Production Rate",width=15,fg_bg=label}
TextBox{parent=sps_div,y=12,text="Production Rate",width=15,fg_bg=label}
local proc_rate = DataIndicator{parent=sps_div,label="",format="%16d",value=0,unit="\xb5B/t",lu_colors=lu_col,width=21,fg_bg=text_fg}
proc_rate.register(ps, "process_rate", function (r) proc_rate.update(r * 1000) end)
@@ -84,12 +80,5 @@ return function (app, panes, sps_pane, ps, update)
output_p.register(ps, "output_fill", function (x) output_p.update(x * 100) end)
output_amnt.register(ps, "output", function (x) output_amnt.update(x.amount) end)
TextBox{parent=sps_ext_div,text="Energy Fill",x=1,y=9,width=11,fg_bg=label}
local energy_p = DataIndicator{parent=sps_ext_div,x=14,y=9,lu_colors=lu_col,label="",unit="%",format="%6.2f",value=0,width=8,fg_bg=text_fg}
local energy_amnt = PowerIndicator{parent=sps_ext_div,x=1,y=10,lu_colors=lu_col,label="",unit=db.energy_label,format="%17.4f",value=0,width=21,fg_bg=text_fg}
energy_p.register(ps, "energy_fill", function (x) energy_p.update(x * 100) end)
energy_amnt.register(ps, "energy", function (val) energy_amnt.update(db.energy_convert(val)) end)
return sps_page.nav_to
end