#580 rtu gateway front panel changes and updates to plc and supervisor front panels

This commit is contained in:
Mikayla Fischler
2025-11-02 15:02:56 -05:00
parent d9001090c2
commit cc9d5fe2d6
8 changed files with 87 additions and 62 deletions

View File

@@ -43,7 +43,9 @@ end
-- transmit unit ID across the bus
---@param id integer unit ID
function databus.tx_id(id) databus.ps.publish("unit_id", id) end
function databus.tx_id(id)
databus.ps.publish("unit_id", id)
end
-- transmit hardware status across the bus
---@param plc_state plc_state
@@ -57,15 +59,21 @@ end
-- transmit thread (routine) statuses
---@param thread string thread name
---@param ok boolean thread state
function databus.tx_rt_status(thread, ok) databus.ps.publish(util.c("routine__", thread), ok) end
function databus.tx_rt_status(thread, ok)
databus.ps.publish(util.c("routine__", thread), ok)
end
-- transmit supervisor link state across the bus
---@param state integer
function databus.tx_link_state(state) databus.ps.publish("link_state", state) end
function databus.tx_link_state(state)
databus.ps.publish("link_state", state)
end
-- transmit reactor enable state across the bus
---@param active any reactor active
function databus.tx_reactor_state(active) databus.ps.publish("reactor_active", active == true) end
function databus.tx_reactor_state(active)
databus.ps.publish("reactor_active", active == true)
end
-- transmit RPS data across the bus
---@param tripped boolean RPS tripped

View File

@@ -39,9 +39,7 @@ local ind_red = style.ind_red
local function init(panel, config)
local s_hi_box = style.theme.highlight_box
local disabled_fg = style.fp.disabled_fg
local term_w, term_h = term.getSize()
local term_w, _ = term.getSize()
local header = TextBox{parent=panel,y=1,text="FISSION REACTOR PLC - UNIT ?",alignment=ALIGN.CENTER,fg_bg=style.theme.header}
header.register(databus.ps, "unit_id", function (id) header.set_value(util.c("FISSION REACTOR PLC - UNIT ", id)) end)
@@ -64,8 +62,8 @@ local function init(panel, config)
if config.Networked then
if config.WirelessModem and config.WiredModem then
local wl_modem = LED{parent=system,label="WD MODEM",colors=ind_grn}
local wd_modem = LED{parent=system,label="WL MODEM",colors=ind_grn}
local wd_modem = LED{parent=system,label="WD MODEM",colors=ind_grn}
local wl_modem = LED{parent=system,label="WL MODEM",colors=ind_grn}
wd_modem.register(databus.ps, "has_wd_modem", wd_modem.update)
wl_modem.register(databus.ps, "has_wl_modem", wl_modem.update)
else
@@ -159,9 +157,9 @@ local function init(panel, config)
---@diagnostic disable-next-line: undefined-field
local comp_id = util.sprintf("%03d", os.getComputerID())
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 PLC-"..comp_id,fg_bg=s_hi_box}
TextBox{parent=hw_labels,text="FW "..databus.ps.get("version"),fg_bg=s_hi_box}
TextBox{parent=hw_labels,text="NT v"..databus.ps.get("comms_version"),fg_bg=s_hi_box}
TextBox{parent=hw_labels,text="S/N PLC-"..comp_id,fg_bg=s_hi_box}
--
-- rps list