specific graphics element types rather than graphics_element
This commit is contained in:
@@ -62,26 +62,26 @@ local tool_ctl = {
|
||||
importing_legacy = false,
|
||||
jumped_to_color = false,
|
||||
|
||||
view_cfg = nil, ---@type graphics_element
|
||||
color_cfg = nil, ---@type graphics_element
|
||||
color_next = nil, ---@type graphics_element
|
||||
color_apply = nil, ---@type graphics_element
|
||||
settings_apply = nil, ---@type graphics_element
|
||||
view_cfg = nil, ---@type PushButton
|
||||
color_cfg = nil, ---@type PushButton
|
||||
color_next = nil, ---@type PushButton
|
||||
color_apply = nil, ---@type PushButton
|
||||
settings_apply = nil, ---@type PushButton
|
||||
|
||||
gen_summary = nil, ---@type function
|
||||
show_current_cfg = nil, ---@type function
|
||||
load_legacy = nil, ---@type function
|
||||
|
||||
show_auth_key = nil, ---@type function
|
||||
show_key_btn = nil, ---@type graphics_element
|
||||
auth_key_textbox = nil, ---@type graphics_element
|
||||
show_key_btn = nil, ---@type PushButton
|
||||
auth_key_textbox = nil, ---@type TextBox
|
||||
auth_key_value = "",
|
||||
|
||||
cooling_elems = {}, ---@type { line: graphics_element, turbines: graphics_element, boilers: graphics_element, tank: graphics_element }[]
|
||||
tank_elems = {}, ---@type { div: graphics_element, tank_opt: graphics_element, no_tank: graphics_element }[]
|
||||
cooling_elems = {}, ---@type { line: Div, turbines: NumberField, boilers: NumberField, tank: CheckBox }[]
|
||||
tank_elems = {}, ---@type { div: Div, tank_opt: Radio2D, no_tank: TextBox }[]
|
||||
|
||||
vis_ftanks = {}, ---@type { line: graphics_element, pipe_conn?: graphics_element, pipe_chain?: graphics_element, pipe_direct?: graphics_element, label?: graphics_element }[]
|
||||
vis_utanks = {} ---@type { line: graphics_element, label: graphics_element }[]
|
||||
vis_ftanks = {}, ---@type { line: Div, pipe_conn?: TextBox, pipe_chain?: TextBox, pipe_direct?: TextBox, label?: TextBox }[]
|
||||
vis_utanks = {} ---@type { line: Div, label: TextBox }[]
|
||||
}
|
||||
|
||||
---@class svr_config
|
||||
|
||||
@@ -16,7 +16,7 @@ local ALIGN = core.ALIGN
|
||||
local cpair = core.cpair
|
||||
|
||||
-- create an ID check list entry
|
||||
---@param parent graphics_element parent
|
||||
---@param parent ListBox parent
|
||||
---@param msg string message
|
||||
---@param fail_code integer failure code
|
||||
local function init(parent, msg, fail_code)
|
||||
|
||||
@@ -18,7 +18,7 @@ local ALIGN = core.ALIGN
|
||||
local cpair = core.cpair
|
||||
|
||||
-- create a pocket diagnostics list entry
|
||||
---@param parent graphics_element parent
|
||||
---@param parent ListBox parent
|
||||
---@param id integer PDG session ID
|
||||
local function init(parent, id)
|
||||
local s_hi_box = style.theme.highlight_box
|
||||
|
||||
@@ -18,7 +18,7 @@ local ALIGN = core.ALIGN
|
||||
local cpair = core.cpair
|
||||
|
||||
-- create an RTU list entry
|
||||
---@param parent graphics_element parent
|
||||
---@param parent ListBox parent
|
||||
---@param id integer RTU session ID
|
||||
local function init(parent, id)
|
||||
local s_hi_box = style.theme.highlight_box
|
||||
|
||||
@@ -8,28 +8,28 @@ local util = require("scada-common.util")
|
||||
local pgi = {}
|
||||
|
||||
local data = {
|
||||
rtu_list = nil, ---@type nil|graphics_element
|
||||
pdg_list = nil, ---@type nil|graphics_element
|
||||
chk_list = nil, ---@type nil|graphics_element
|
||||
rtu_list = nil, ---@type ListBox|nil
|
||||
pdg_list = nil, ---@type ListBox|nil
|
||||
chk_list = nil, ---@type ListBox|nil
|
||||
rtu_entry = nil, ---@type function
|
||||
pdg_entry = nil, ---@type function
|
||||
chk_entry = nil, ---@type function
|
||||
-- list entries
|
||||
entries = {
|
||||
rtu = {}, ---@type graphics_element[]
|
||||
pdg = {}, ---@type graphics_element[]
|
||||
chk = {}, ---@type graphics_element[][]
|
||||
missing = {} ---@type graphics_element[]
|
||||
rtu = {}, ---@type Div[]
|
||||
pdg = {}, ---@type Div[]
|
||||
chk = {}, ---@type Div[][]
|
||||
missing = {} ---@type Div[]
|
||||
}
|
||||
}
|
||||
|
||||
-- link list boxes
|
||||
---@param rtu_list graphics_element RTU list element
|
||||
---@param rtu_entry function RTU entry constructor
|
||||
---@param pdg_list graphics_element pocket diagnostics list element
|
||||
---@param pdg_entry function pocket diagnostics entry constructor
|
||||
---@param chk_list graphics_element CHK list element
|
||||
---@param chk_entry function CHK entry constructor
|
||||
---@param rtu_list ListBox RTU list element
|
||||
---@param rtu_entry fun(parent: ListBox, id: integer) : Div RTU entry constructor
|
||||
---@param pdg_list ListBox pocket diagnostics list element
|
||||
---@param pdg_entry fun(parent: ListBox, id: integer) : Div pocket diagnostics entry constructor
|
||||
---@param chk_list ListBox CHK list element
|
||||
---@param chk_entry fun(parent: ListBox, msg: string, fail_code: integer) : Div CHK entry constructor
|
||||
function pgi.link_elements(rtu_list, rtu_entry, pdg_list, pdg_entry, chk_list, chk_entry)
|
||||
data.rtu_list = rtu_list
|
||||
data.pdg_list = pdg_list
|
||||
@@ -135,8 +135,8 @@ function pgi.create_chk_entry(unit, fail_code, msg)
|
||||
end
|
||||
end
|
||||
|
||||
-- delete a device ID check failure entry from the CHK list
|
||||
---@note this assumes only one type of failure can occur per each RTU gateway session's RTU, which is the case
|
||||
-- delete a device ID check failure entry from the CHK list<br>
|
||||
-- this assumes only one type of failure can occur per each RTU gateway session's RTU, which is the case
|
||||
---@param unit unit_session RTU session
|
||||
function pgi.delete_chk_entry(unit)
|
||||
local gw_session = unit.get_session_id()
|
||||
|
||||
Reference in New Issue
Block a user