From 6b204454464105299dc1eedce22940535b7e8844 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sun, 25 Aug 2024 22:45:41 -0400 Subject: [PATCH] added INF tab to supervisor to provide helpful info and removed some redundant alignment specifiers --- coordinator/ui/layout/front_panel.lua | 4 +-- pocket/ui/apps/guide.lua | 2 +- pocket/ui/apps/sys_apps.lua | 48 +++++++++++++-------------- pocket/ui/main.lua | 2 +- pocket/ui/pages/guide_section.lua | 2 +- reactor-plc/panel/front_panel.lua | 4 +-- rtu/panel/front_panel.lua | 4 +-- supervisor/panel/front_panel.lua | 25 +++++++++++--- supervisor/startup.lua | 2 +- 9 files changed, 55 insertions(+), 38 deletions(-) diff --git a/coordinator/ui/layout/front_panel.lua b/coordinator/ui/layout/front_panel.lua index 4a87b058..3573fb20 100644 --- a/coordinator/ui/layout/front_panel.lua +++ b/coordinator/ui/layout/front_panel.lua @@ -132,8 +132,8 @@ local function init(panel, num_units) -- local about = Div{parent=main_page,width=15,height=3,x=1,y=16,fg_bg=style.fp.disabled_fg} - local fw_v = TextBox{parent=about,x=1,y=1,text="FW: v00.00.00",alignment=ALIGN.LEFT} - local comms_v = TextBox{parent=about,x=1,y=2,text="NT: v00.00.00",alignment=ALIGN.LEFT} + local fw_v = TextBox{parent=about,x=1,y=1,text="FW: v00.00.00"} + local comms_v = TextBox{parent=about,x=1,y=2,text="NT: v00.00.00"} fw_v.register(ps, "version", function (version) fw_v.set_value(util.c("FW: ", version)) end) comms_v.register(ps, "comms_version", function (version) comms_v.set_value(util.c("NT: v", version)) end) diff --git a/pocket/ui/apps/guide.lua b/pocket/ui/apps/guide.lua index 52d16bfe..a4daf8a7 100644 --- a/pocket/ui/apps/guide.lua +++ b/pocket/ui/apps/guide.lua @@ -144,7 +144,7 @@ local function new_view(root) for idx = 1, #s_results[tier] do local entry = s_results[tier][idx] TextBox{parent=search_results,text=entry[3].." >",fg_bg=cpair(colors.gray,colors.black)} - PushButton{parent=search_results,text=entry[2],alignment=ALIGN.LEFT,fg_bg=btn_fg_bg,active_fg_bg=btn_active,callback=entry[4]} + PushButton{parent=search_results,text=entry[2],fg_bg=btn_fg_bg,active_fg_bg=btn_active,callback=entry[4]} empty = false end diff --git a/pocket/ui/apps/sys_apps.lua b/pocket/ui/apps/sys_apps.lua index b5c8f88e..197a4f66 100644 --- a/pocket/ui/apps/sys_apps.lua +++ b/pocket/ui/apps/sys_apps.lua @@ -63,25 +63,25 @@ local function create_pages(root) PushButton{parent=nt_div,x=2,y=1,text="<",fg_bg=btn_fg_bg,active_fg_bg=btn_active,callback=about_page.nav_to} - TextBox{parent=nt_div,x=2,y=3,text="Pocket Address",alignment=ALIGN.LEFT,fg_bg=label} + TextBox{parent=nt_div,x=2,y=3,text="Pocket Address",fg_bg=label} ---@diagnostic disable-next-line: undefined-field - TextBox{parent=nt_div,x=2,text=util.c(os.getComputerID(),":",config.PKT_Channel),alignment=ALIGN.LEFT} + TextBox{parent=nt_div,x=2,text=util.c(os.getComputerID(),":",config.PKT_Channel)} nt_div.line_break() - TextBox{parent=nt_div,x=2,text="Supervisor Address",alignment=ALIGN.LEFT,fg_bg=label} - local sv = TextBox{parent=nt_div,x=2,text="",alignment=ALIGN.LEFT} + TextBox{parent=nt_div,x=2,text="Supervisor Address",fg_bg=label} + local sv = TextBox{parent=nt_div,x=2,text=""} nt_div.line_break() - TextBox{parent=nt_div,x=2,text="Coordinator Address",alignment=ALIGN.LEFT,fg_bg=label} - local coord = TextBox{parent=nt_div,x=2,text="",alignment=ALIGN.LEFT} + TextBox{parent=nt_div,x=2,text="Coordinator Address",fg_bg=label} + local coord = TextBox{parent=nt_div,x=2,text=""} sv.register(db.ps, "sv_addr", sv.set_value) coord.register(db.ps, "api_addr", coord.set_value) nt_div.line_break() - TextBox{parent=nt_div,x=2,text="Message Authentication",alignment=ALIGN.LEFT,fg_bg=label} + TextBox{parent=nt_div,x=2,text="Message Authentication",fg_bg=label} local auth = util.trinary(type(config.AuthKey) == "string" and string.len(config.AuthKey) > 0, "HMAC-MD5", "None") - TextBox{parent=nt_div,x=2,text=auth,alignment=ALIGN.LEFT} + TextBox{parent=nt_div,x=2,text=auth} --#endregion @@ -96,28 +96,28 @@ local function create_pages(root) local fw_list = Div{parent=fw_list_box,x=1,y=2,height=18} - TextBox{parent=fw_list,x=2,text="Pocket Version",alignment=ALIGN.LEFT,fg_bg=label} - TextBox{parent=fw_list,x=2,text=db.version,alignment=ALIGN.LEFT} + TextBox{parent=fw_list,x=2,text="Pocket Version",fg_bg=label} + TextBox{parent=fw_list,x=2,text=db.version} fw_list.line_break() - TextBox{parent=fw_list,x=2,text="Comms Version",alignment=ALIGN.LEFT,fg_bg=label} - TextBox{parent=fw_list,x=2,text=comms.version,alignment=ALIGN.LEFT} + TextBox{parent=fw_list,x=2,text="Comms Version",fg_bg=label} + TextBox{parent=fw_list,x=2,text=comms.version} fw_list.line_break() - TextBox{parent=fw_list,x=2,text="API Version",alignment=ALIGN.LEFT,fg_bg=label} - TextBox{parent=fw_list,x=2,text=comms.api_version,alignment=ALIGN.LEFT} + TextBox{parent=fw_list,x=2,text="API Version",fg_bg=label} + TextBox{parent=fw_list,x=2,text=comms.api_version} fw_list.line_break() - TextBox{parent=fw_list,x=2,text="Common Lib Version",alignment=ALIGN.LEFT,fg_bg=label} - TextBox{parent=fw_list,x=2,text=util.version,alignment=ALIGN.LEFT} + TextBox{parent=fw_list,x=2,text="Common Lib Version",fg_bg=label} + TextBox{parent=fw_list,x=2,text=util.version} fw_list.line_break() - TextBox{parent=fw_list,x=2,text="Graphics Version",alignment=ALIGN.LEFT,fg_bg=label} - TextBox{parent=fw_list,x=2,text=core.version,alignment=ALIGN.LEFT} + TextBox{parent=fw_list,x=2,text="Graphics Version",fg_bg=label} + TextBox{parent=fw_list,x=2,text=core.version} fw_list.line_break() - TextBox{parent=fw_list,x=2,text="Lockbox Version",alignment=ALIGN.LEFT,fg_bg=label} - TextBox{parent=fw_list,x=2,text=lockbox.version,alignment=ALIGN.LEFT} + TextBox{parent=fw_list,x=2,text="Lockbox Version",fg_bg=label} + TextBox{parent=fw_list,x=2,text=lockbox.version} --#endregion @@ -129,12 +129,12 @@ local function create_pages(root) PushButton{parent=hw_div,x=2,y=1,text="<",fg_bg=btn_fg_bg,active_fg_bg=btn_active,callback=about_page.nav_to} hw_div.line_break() - TextBox{parent=hw_div,x=2,text="Lua Version",alignment=ALIGN.LEFT,fg_bg=label} - TextBox{parent=hw_div,x=2,text=_VERSION,alignment=ALIGN.LEFT} + TextBox{parent=hw_div,x=2,text="Lua Version",fg_bg=label} + TextBox{parent=hw_div,x=2,text=_VERSION} hw_div.line_break() - TextBox{parent=hw_div,x=2,text="Environment",alignment=ALIGN.LEFT,fg_bg=label} - TextBox{parent=hw_div,x=2,text=_HOST,height=6,alignment=ALIGN.LEFT} + TextBox{parent=hw_div,x=2,text="Environment",fg_bg=label} + TextBox{parent=hw_div,x=2,text=_HOST,height=6} --#endregion diff --git a/pocket/ui/main.lua b/pocket/ui/main.lua index 25997f5e..080371c5 100644 --- a/pocket/ui/main.lua +++ b/pocket/ui/main.lua @@ -42,7 +42,7 @@ local function init(main) local db = iocontrol.get_db() -- window header message and connection status - TextBox{parent=main,y=1,text="EARLY ACCESS ALPHA S C ",alignment=ALIGN.LEFT,fg_bg=style.header} + TextBox{parent=main,y=1,text="EARLY ACCESS ALPHA S C ",fg_bg=style.header} local svr_conn = SignalBar{parent=main,y=1,x=22,compact=true,colors_low_med=cpair(colors.red,colors.yellow),disconnect_color=colors.lightGray,fg_bg=cpair(colors.green,colors.gray)} local crd_conn = SignalBar{parent=main,y=1,x=26,compact=true,colors_low_med=cpair(colors.red,colors.yellow),disconnect_color=colors.lightGray,fg_bg=cpair(colors.green,colors.gray)} diff --git a/pocket/ui/pages/guide_section.lua b/pocket/ui/pages/guide_section.lua index 0629694b..04d3c092 100644 --- a/pocket/ui/pages/guide_section.lua +++ b/pocket/ui/pages/guide_section.lua @@ -55,7 +55,7 @@ return function (data, base_page, title, items, scroll_height) doc_map[item.key] = view table.insert(search_db, { string.lower(item.name), item.name, title, view }) - PushButton{parent=name_list,text=item.name,alignment=ALIGN.LEFT,fg_bg=cpair(colors.blue,colors.black),active_fg_bg=btn_active,callback=view} + PushButton{parent=name_list,text=item.name,fg_bg=cpair(colors.blue,colors.black),active_fg_bg=btn_active,callback=view} if i % 12 == 0 then util.nop() end end diff --git a/reactor-plc/panel/front_panel.lua b/reactor-plc/panel/front_panel.lua index 20fc7994..d07395fb 100644 --- a/reactor-plc/panel/front_panel.lua +++ b/reactor-plc/panel/front_panel.lua @@ -148,8 +148,8 @@ local function init(panel) -- local about = Div{parent=panel,width=15,height=3,x=1,y=18,fg_bg=disabled_fg} - local fw_v = TextBox{parent=about,x=1,y=1,text="FW: v00.00.00",alignment=ALIGN.LEFT} - local comms_v = TextBox{parent=about,x=1,y=2,text="NT: v00.00.00",alignment=ALIGN.LEFT} + local fw_v = TextBox{parent=about,x=1,y=1,text="FW: v00.00.00"} + local comms_v = TextBox{parent=about,x=1,y=2,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) diff --git a/rtu/panel/front_panel.lua b/rtu/panel/front_panel.lua index a33d3e0f..b5b773af 100644 --- a/rtu/panel/front_panel.lua +++ b/rtu/panel/front_panel.lua @@ -109,8 +109,8 @@ local function init(panel, units) -- local about = Div{parent=panel,width=15,height=3,x=1,y=18,fg_bg=disabled_fg} - local fw_v = TextBox{parent=about,x=1,y=1,text="FW: v00.00.00",alignment=ALIGN.LEFT} - local comms_v = TextBox{parent=about,x=1,y=2,text="NT: v00.00.00",alignment=ALIGN.LEFT} + local fw_v = TextBox{parent=about,x=1,y=1,text="FW: v00.00.00"} + local comms_v = TextBox{parent=about,x=1,y=2,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) diff --git a/supervisor/panel/front_panel.lua b/supervisor/panel/front_panel.lua index d3428aa9..245122e0 100644 --- a/supervisor/panel/front_panel.lua +++ b/supervisor/panel/front_panel.lua @@ -74,8 +74,8 @@ local function init(panel) -- local about = Div{parent=main_page,width=15,height=3,x=1,y=16,fg_bg=style.fp.disabled_fg} - local fw_v = TextBox{parent=about,x=1,y=1,text="FW: v00.00.00",alignment=ALIGN.LEFT} - local comms_v = TextBox{parent=about,x=1,y=2,text="NT: v00.00.00",alignment=ALIGN.LEFT} + local fw_v = TextBox{parent=about,x=1,y=1,text="FW: v00.00.00"} + local comms_v = TextBox{parent=about,x=1,y=2,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) @@ -156,9 +156,25 @@ local function init(panel) local chk_list = ListBox{parent=chk_page,x=1,y=1,height=17,width=51,scroll_height=1000,fg_bg=style.fp.text_fg,nav_fg_bg=cpair(colors.gray,colors.lightGray),nav_active=cpair(colors.black,colors.gray)} local _ = Div{parent=chk_list,height=1,hidden=true} -- padding + -- info page + + local info_page = Div{parent=page_div,x=1,y=1,hidden=true} + local info = Div{parent=info_page,height=6,x=2,y=2} + + TextBox{parent=info,text="SVR \x1a Supervisor Status"} + TextBox{parent=info,text="PLC \x1a Reactor PLC Connections"} + TextBox{parent=info,text="RTU \x1a RTU Gateway Connections"} + TextBox{parent=info,text="CRD \x1a Coordinator Connection"} + TextBox{parent=info,text="PKT \x1a Pocket Connections"} + TextBox{parent=info,text="DEV \x1a RTU Device/Configuration Alerts"} + + local notes = Div{parent=info_page,width=49,height=8,x=2,y=9,fg_bg=style.fp.disabled_fg} + + TextBox{parent=notes,text="The DEV tab will show missing devices and devices that connected with incorrect information. Missing entries will indicate how the configuration should be, duplicate entries will indicate what is a duplicate, and out-of-range entries will indicate the invalid entry. An out-of-range example is a #2 turbine when you should only have 1 turbine for that unit."} + -- assemble page panes - local panes = { main_page, plc_page, rtu_page, crd_page, pkt_page, chk_page } + local panes = { main_page, plc_page, rtu_page, crd_page, pkt_page, chk_page, info_page } local page_pane = MultiPane{parent=page_div,x=1,y=1,panes=panes} @@ -168,7 +184,8 @@ local function init(panel) { name = "RTU", color = style.fp.text }, { name = "CRD", color = style.fp.text }, { name = "PKT", color = style.fp.text }, - { name = "CHECK", color = style.fp.text } + { name = "DEV", color = style.fp.text }, + { name = "INF", color = style.fp.text } } TabBar{parent=panel,y=2,tabs=tabs,min_width=7,callback=page_pane.set_value,fg_bg=style.theme.highlight_box_bright} diff --git a/supervisor/startup.lua b/supervisor/startup.lua index a8c0ecb5..ddb044bf 100644 --- a/supervisor/startup.lua +++ b/supervisor/startup.lua @@ -22,7 +22,7 @@ local supervisor = require("supervisor.supervisor") local svsessions = require("supervisor.session.svsessions") -local SUPERVISOR_VERSION = "v1.5.1" +local SUPERVISOR_VERSION = "v1.5.2" local println = util.println local println_ts = util.println_ts