#545 pocket type annotation updates

This commit is contained in:
Mikayla Fischler
2024-09-14 15:45:36 -04:00
parent f1b7bac6f9
commit 63a9e23b3a
11 changed files with 67 additions and 166 deletions

View File

@@ -108,7 +108,7 @@ local function new_view(root)
for i = 1, db.facility.num_units do
local u_pane = panes[i]
local u_div = Div{parent=u_pane,x=2,width=main.get_width()-2}
local unit = db.units[i] ---@type pioctl_unit
local unit = db.units[i]
local u_ps = unit.unit_ps
-- refresh data callback, every 500ms it will re-send the query

View File

@@ -90,10 +90,9 @@ local function new_view(root)
local lnk = Div{parent=page_div,x=2,width=p_width}
local panes = { home, search, use, uis, fps, gls, lnk }
local doc_map = {}
local search_db = {}
local doc_map = {} ---@type { [string]: function }
local search_db = {} ---@type [ string, string, string, function ][]
---@class _guide_section_constructor_data
local sect_construct_data = { app, page_div, panes, doc_map, search_db, btn_fg_bg, btn_active }
TextBox{parent=home,y=1,text="cc-mek-scada Guide",alignment=ALIGN.CENTER}
@@ -117,7 +116,7 @@ local function new_view(root)
function func_ref.run_search()
local query = string.lower(query_field.get_value())
local s_results = { {}, {}, {}, {} }
local s_results = { {}, {}, {}, {} } ---@type [ string, string, string, function ][][]
search_results.remove_all()

View File

@@ -73,7 +73,7 @@ local function new_view(root)
-- set sidebar to display unit-specific fields based on a specified unit
local function set_sidebar(id)
local unit = db.units[id] ---@type pioctl_unit
local unit = db.units[id]
local list = {
{ label = " # ", tall = true, color = core.cpair(colors.black, colors.green), callback = function () db.nav.open_app(APP_ID.ROOT) end },
@@ -127,7 +127,7 @@ local function new_view(root)
for i = 1, db.facility.num_units do
local u_pane = panes[i]
local u_div = Div{parent=u_pane,x=2,width=main.get_width()-2}
local unit = db.units[i] ---@type pioctl_unit
local unit = db.units[i]
local u_ps = unit.unit_ps
-- refresh data callback, every 500ms it will re-send the query

View File

@@ -21,14 +21,14 @@ local DOC_TYPE = docs.DOC_ITEM_TYPE
local LIST_TYPE = docs.DOC_LIST_TYPE
-- new guide documentation section
---@param data _guide_section_constructor_data
---@param data { [1]: pocket_app, [2]: graphics_element, [3]: graphics_element[], [4]: { [string]: function }, [5]: [ string, string, string, function ][], [6]: cpair, [7]: cpair }
---@param base_page nav_tree_page
---@param title string
---@param items table
---@param scroll_height integer
---@return nav_tree_page
return function (data, base_page, title, items, scroll_height)
local app, page_div, panes, doc_map, search_db, btn_fg_bg, btn_active = table.unpack(data)
local app, page_div, panes, doc_map, search_db, btn_fg_bg, btn_active = data[1], data[2], data[3], data[4], data[5], data[6], data[7]
local section_page = app.new_page(base_page, #panes + 1)
local section_div = Div{parent=page_div,x=2}

View File

@@ -29,7 +29,7 @@ local yel_ind_s = style.icon_states.yel_ind_s
-- create a boiler view in the unit app
---@param app pocket_app
---@param u_page nav_tree_page
---@param panes table
---@param panes graphics_element[]
---@param blr_pane graphics_element
---@param b_id integer boiler ID
---@param ps psil

View File

@@ -29,7 +29,7 @@ local yel_ind_s = style.icon_states.yel_ind_s
-- create a reactor view in the unit app
---@param app pocket_app
---@param u_page nav_tree_page
---@param panes table
---@param panes graphics_element[]
---@param page_div graphics_element
---@param u_ps psil
---@param update function

View File

@@ -30,7 +30,7 @@ local yel_ind_s = style.icon_states.yel_ind_s
-- create a turbine view in the unit app
---@param app pocket_app
---@param u_page nav_tree_page
---@param panes table
---@param panes graphics_element[]
---@param tbn_pane graphics_element
---@param u_id integer unit ID
---@param t_id integer turbine ID