#403 improved guide UI and added supervisor front panel docs
This commit is contained in:
parent
d7ea68ed3a
commit
07c3b3ec63
@ -215,12 +215,13 @@ local function new_view(root)
|
||||
|
||||
local fp_common_page = guide_section(sect_construct_data, fps_page, "Common Items", docs.fp.common, 100)
|
||||
local fp_rplc_page = guide_section(sect_construct_data, fps_page, "Reactor PLC", docs.fp.r_plc, 180)
|
||||
local fp_rtu_page = guide_section(sect_construct_data, fps_page, "RTU Gateway", docs.fp.rtu_gw, 70)
|
||||
local fp_rtu_page = guide_section(sect_construct_data, fps_page, "RTU Gateway", docs.fp.rtu_gw, 100)
|
||||
local fp_supervisor_page = guide_section(sect_construct_data, fps_page, "Supervisor", docs.fp.supervisor, 160)
|
||||
|
||||
PushButton{parent=fps,y=3,text="Common Items >",fg_bg=btn_fg_bg,active_fg_bg=btn_active,callback=fp_common_page.nav_to}
|
||||
PushButton{parent=fps,text="Reactor PLC >",fg_bg=btn_fg_bg,active_fg_bg=btn_active,callback=fp_rplc_page.nav_to}
|
||||
PushButton{parent=fps,text="RTU Gateway >",fg_bg=btn_fg_bg,active_fg_bg=btn_active,callback=fp_rtu_page.nav_to}
|
||||
PushButton{parent=fps,text="Supervisor >",fg_bg=btn_fg_bg,active_fg_bg=btn_active,dis_fg_bg=btn_disable,callback=function()end}.disable()
|
||||
PushButton{parent=fps,text="Supervisor >",fg_bg=btn_fg_bg,active_fg_bg=btn_active,callback=fp_supervisor_page.nav_to}
|
||||
PushButton{parent=fps,text="Coordinator >",fg_bg=btn_fg_bg,active_fg_bg=btn_active,dis_fg_bg=btn_disable,callback=function()end}.disable()
|
||||
|
||||
TextBox{parent=gls,y=1,text="Glossary",alignment=ALIGN.CENTER}
|
||||
|
||||
@ -155,7 +155,7 @@ doc("as_radiation", "Facility Radiation High", "Automatic SCRAM occurred due to
|
||||
doc("as_gen_fault", "Gen. Control Fault", "Automatic SCRAM occurred due to assigned units being degraded/no longer ready during generation mode. The system will automatically resume (starting with initial ramp) once the problem is resolved.")
|
||||
|
||||
docs.fp = {
|
||||
common = {}, r_plc = {}, rtu_gw = {}
|
||||
common = {}, r_plc = {}, rtu_gw = {}, supervisor = {}
|
||||
}
|
||||
|
||||
--comp id "This must never be the identical between devices, and that can only happen if you duplicate a computer (such as middle-click on it and place it elsewhere in creative mode)."
|
||||
@ -216,6 +216,32 @@ list(DOC_LIST_TYPE.LED, { "disconnected", "faulted", "unformed", "ok" }, { color
|
||||
text("Note that disconnected devices lack detailed information and will not be modifiable in configuration until re-connected.")
|
||||
doc("fp_rtu_rt", "Device Assignment", "In each RTU entry row, the device identification is to the right of the status light. This begins with the device type and its index followed by its assignment after the \x1a, which is a unit or the facility (FACIL). Unit 1's 3rd turbine would show up as 'TURBINE 3 \x1a UNIT 1'.")
|
||||
|
||||
target = docs.fp.supervisor
|
||||
sect("Round Trip Times")
|
||||
doc("fp_sv_fw", "RTT", "Each connection has a round trip time, or RTT. Since the supervisor updates at a rate of 150ms, RTTs from ~150ms to ~300ms are typical. Higher RTTs indicate lag, and if they end up in the thousands there will be performance problems.")
|
||||
list(DOC_LIST_TYPE.BULLET, { "green: <=300ms", "yellow: <=500ms ", "red: >500ms" })
|
||||
sect("SVR Tab")
|
||||
text("This tab includes information about the supervisor, covered by 'Common Items'.")
|
||||
sect("PLC Tab")
|
||||
text("This tab lists the expected PLC connections based on the number of configured units. Status information about each connection is shown when linked.")
|
||||
doc("fp_sv_link", "LINK", "This indicates if the reactor PLC is linked.")
|
||||
doc("fp_sv_p_cmpid", "PLC Computer ID", "This shows the computer ID of the reactor PLC, or --- if disconnected.")
|
||||
doc("fp_sv_p_fw", "PLC FW", "This shows the firmware version of the reactor PLC.")
|
||||
sect("RTU Tab")
|
||||
text("As RTU gateways connect to the supervisor, they will show up here along with some information.")
|
||||
doc("fp_sv_r_cmpid", "RTU Computer ID", "At the start of the entry is an @ sign followed by the computer ID of the RTU gateway.")
|
||||
doc("fp_sv_r_units", "UNITS", "This is a count of the number of RTUs configured on the RTU gateway (each line on the RTU gateway's front panel).")
|
||||
doc("fp_sv_r_fw", "RTU FW", "This shows the firmware version of the RTU gateway.")
|
||||
sect("PKT Tab")
|
||||
text("As pocket computers connect to the supervisor, they will show up here along with some information. The properties listed are the same as with RTU gateways (except for UNITS), so they will not be further described here.")
|
||||
sect("DEV Tab")
|
||||
text("If nothing is connected, this will list all the expected RTU devices that aren't found. This page should be blank if everything is connected and configured correctly. If not, it will list certain types of detectable problems.")
|
||||
doc("fp_sv_d_miss", "MISSING", "These items list missing devices, with the details that should be used in the RTU's configuration.")
|
||||
doc("fp_sv_d_oor", "BAD INDEX", "If you have a configuration entry that has an index outside of the maximum number of devices configured on the supervisor, this will show up indicating what entry is incorrect. For example, if you specified a unit has 2 turbines and a #3 connected, it would show up here as out of range.")
|
||||
doc("fp_sv_d_dupe", "DUPLICATE", "If a device tries to connect that is configured the same as another, it will be rejected and show up here. If you try to connect two #1 turbines for a unit, that would fail and one would appear here.")
|
||||
sect("INF Tab")
|
||||
text("This tab gives information about the other tabs, along with extra details on the DEV tab.")
|
||||
|
||||
docs.glossary = {
|
||||
abbvs = {}, terms = {}
|
||||
}
|
||||
|
||||
@ -42,10 +42,11 @@ return function (data, base_page, title, items, scroll_height)
|
||||
TextBox{parent=section_view_div,y=1,text=title,alignment=ALIGN.CENTER}
|
||||
PushButton{parent=section_view_div,x=3,y=1,text="<",fg_bg=btn_fg_bg,active_fg_bg=btn_active,callback=section_page.nav_to}
|
||||
|
||||
local name_list = ListBox{parent=section_div,x=1,y=3,scroll_height=40,nav_fg_bg=cpair(colors.lightGray,colors.gray),nav_active=cpair(colors.white,colors.gray)}
|
||||
local name_list = ListBox{parent=section_div,x=1,y=3,scroll_height=60,nav_fg_bg=cpair(colors.lightGray,colors.gray),nav_active=cpair(colors.white,colors.gray)}
|
||||
local def_list = ListBox{parent=section_view_div,x=1,y=3,scroll_height=scroll_height,nav_fg_bg=cpair(colors.lightGray,colors.gray),nav_active=cpair(colors.white,colors.gray)}
|
||||
|
||||
local _end
|
||||
local sect_id = 1
|
||||
local page_end
|
||||
|
||||
for i = 1, #items do
|
||||
local item = items[i] ---@type pocket_doc_sect|pocket_doc_subsect|pocket_doc_text|pocket_doc_list
|
||||
@ -53,12 +54,17 @@ return function (data, base_page, title, items, scroll_height)
|
||||
if item.type == DOC_TYPE.SECTION then
|
||||
---@cast item pocket_doc_sect
|
||||
|
||||
local anchor = TextBox{parent=def_list,text=item.name,anchor=true,fg_bg=cpair(colors.green,colors.black)}
|
||||
local title_text = sect_id.."."
|
||||
local title_offs = string.len(title_text) + 2
|
||||
|
||||
_end = Div{parent=def_list,height=1,can_focus=true}
|
||||
local sect_title = Div{parent=def_list,height=1}
|
||||
TextBox{parent=sect_title,x=1,text=title_text,fg_bg=cpair(colors.lightGray,colors.black)}
|
||||
local anchor = TextBox{parent=sect_title,x=title_offs,y=1,text=item.name,anchor=true,fg_bg=cpair(colors.green,colors.black)}
|
||||
|
||||
page_end = Div{parent=def_list,height=1,can_focus=true}
|
||||
|
||||
local function view()
|
||||
_end.focus()
|
||||
page_end.focus()
|
||||
view_page.nav_to()
|
||||
anchor.focus()
|
||||
end
|
||||
@ -67,7 +73,11 @@ return function (data, base_page, title, items, scroll_height)
|
||||
local _ = Div{parent=name_list,height=1}
|
||||
end
|
||||
|
||||
PushButton{parent=name_list,text=item.name,fg_bg=cpair(colors.green,colors.black),active_fg_bg=btn_active,callback=view}
|
||||
local name_title = Div{parent=name_list,height=1}
|
||||
TextBox{parent=name_title,x=1,text=title_text,fg_bg=cpair(colors.lightGray,colors.black)}
|
||||
PushButton{parent=name_title,x=title_offs,y=1,text=item.name,alignment=ALIGN.LEFT,fg_bg=cpair(colors.green,colors.black),active_fg_bg=btn_active,callback=view}
|
||||
|
||||
sect_id = sect_id + 1
|
||||
elseif item.type == DOC_TYPE.SUBSECTION then
|
||||
---@cast item pocket_doc_subsect
|
||||
|
||||
@ -79,10 +89,10 @@ return function (data, base_page, title, items, scroll_height)
|
||||
|
||||
TextBox{parent=def_list,text=item.body}
|
||||
|
||||
_end = Div{parent=def_list,height=1,can_focus=true}
|
||||
page_end = Div{parent=def_list,height=1,can_focus=true}
|
||||
|
||||
local function view()
|
||||
_end.focus()
|
||||
page_end.focus()
|
||||
view_page.nav_to()
|
||||
anchor.focus()
|
||||
end
|
||||
@ -90,13 +100,15 @@ 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,fg_bg=cpair(colors.blue,colors.black),active_fg_bg=btn_active,callback=view}
|
||||
local name_entry = Div{parent=name_list,height=#util.strwrap(item.name,name_list.get_width()-3)}
|
||||
TextBox{parent=name_entry,x=1,text="\x10",fg_bg=cpair(colors.gray,colors.black)}
|
||||
PushButton{parent=name_entry,x=3,y=1,text=item.name,alignment=ALIGN.LEFT,fg_bg=cpair(colors.blue,colors.black),active_fg_bg=btn_active,callback=view}
|
||||
elseif item.type == DOC_TYPE.TEXT then
|
||||
---@cast item pocket_doc_text
|
||||
|
||||
TextBox{parent=def_list,text=item.text}
|
||||
|
||||
_end = Div{parent=def_list,height=1,can_focus=true}
|
||||
page_end = Div{parent=def_list,height=1,can_focus=true}
|
||||
elseif item.type == DOC_TYPE.LIST then
|
||||
---@cast item pocket_doc_list
|
||||
|
||||
@ -121,13 +133,13 @@ return function (data, base_page, title, items, scroll_height)
|
||||
end
|
||||
end
|
||||
|
||||
_end = Div{parent=def_list,height=1,can_focus=true}
|
||||
page_end = Div{parent=def_list,height=1,can_focus=true}
|
||||
end
|
||||
|
||||
if i % 12 == 0 then util.nop() end
|
||||
end
|
||||
|
||||
log.debug("guide section " .. title .. " generated with final height ".. _end.get_y())
|
||||
log.debug("guide section " .. title .. " generated with final height ".. page_end.get_y())
|
||||
|
||||
util.nop()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user