From 0417986c15eeece6b0b094d8434b79c78fea4fe5 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sun, 2 Nov 2025 13:30:25 -0500 Subject: [PATCH] #580 updated supervisor front panel --- reactor-plc/panel/front_panel.lua | 2 +- supervisor/panel/front_panel.lua | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/reactor-plc/panel/front_panel.lua b/reactor-plc/panel/front_panel.lua index 3df6b3b..b76b3cb 100644 --- a/reactor-plc/panel/front_panel.lua +++ b/reactor-plc/panel/front_panel.lua @@ -128,7 +128,7 @@ local function init(panel, config) rt_sctl.register(databus.ps, "routine__spctl", rt_sctl.update) -- - -- status & controls & hardware labels + -- status & controls & hardware labeling -- local status = Div{parent=panel,width=term_w-32,height=18,x=17,y=3} diff --git a/supervisor/panel/front_panel.lua b/supervisor/panel/front_panel.lua index 14e224e..9a28db6 100644 --- a/supervisor/panel/front_panel.lua +++ b/supervisor/panel/front_panel.lua @@ -19,6 +19,7 @@ local core = require("graphics.core") local Div = require("graphics.elements.Div") local ListBox = require("graphics.elements.ListBox") local MultiPane = require("graphics.elements.MultiPane") +local Rectangle = require("graphics.elements.Rectangle") local TextBox = require("graphics.elements.TextBox") local TabBar = require("graphics.elements.controls.TabBar") @@ -29,6 +30,7 @@ local DataIndicator = require("graphics.elements.indicators.DataIndicator") local ALIGN = core.ALIGN local cpair = core.cpair +local border = core.border local ind_grn = style.ind_grn @@ -77,20 +79,18 @@ local function init(panel, config) wd_modem.register(databus.ps, "has_wd_modem", wd_modem.update) end + -- + -- hardware labeling + -- + + local hw_labels = Rectangle{parent=main_page,x=2,y=term_h-7,width=17,height=5,border=border(1,s_hi_box.bkg,true),even_inner=true} + ---@diagnostic disable-next-line: undefined-field - local comp_id = util.sprintf("(%d)", os.getComputerID()) - TextBox{parent=system,x=12,y=4,width=6,text=comp_id,fg_bg=style.fp.disabled_fg} + local comp_id = util.sprintf("%03d", os.getComputerID()) - -- - -- about footer - -- - - local about = Div{parent=main_page,width=15,height=2,y=term_h-3,fg_bg=style.fp.disabled_fg} - local fw_v = TextBox{parent=about,text="FW: v00.00.00"} - local comms_v = TextBox{parent=about,text="NT: v00.00.00"} - - fw_v.register(databus.ps, "version", function (version) fw_v.set_value(util.c("FW: ", version)) end) - comms_v.register(databus.ps, "comms_version", function (version) comms_v.set_value(util.c("NT: v", version)) end) + TextBox{parent=hw_labels,text="FW "..databus.ps.get("version"),fg_bg=s_hi_box} + TextBox{parent=hw_labels,text="COMM v"..databus.ps.get("comms_version"),fg_bg=s_hi_box} + TextBox{parent=hw_labels,text="S/N SVR-"..comp_id,fg_bg=s_hi_box} -- -- page handling