mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2025-07-26 03:22:51 +00:00
specific graphics element types rather than graphics_element
This commit is contained in:
@ -81,29 +81,29 @@ 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 = "",
|
||||
|
||||
sv_connect = nil, ---@type function
|
||||
sv_conn_button = nil, ---@type graphics_element
|
||||
sv_conn_status = nil, ---@type graphics_element
|
||||
sv_conn_detail = nil, ---@type graphics_element
|
||||
sv_skip = nil, ---@type graphics_element
|
||||
sv_next = nil, ---@type graphics_element
|
||||
sv_conn_button = nil, ---@type PushButton
|
||||
sv_conn_status = nil, ---@type TextBox
|
||||
sv_conn_detail = nil, ---@type TextBox
|
||||
sv_skip = nil, ---@type PushButton
|
||||
sv_next = nil, ---@type PushButton
|
||||
|
||||
apply_mon = nil, ---@type graphics_element
|
||||
apply_mon = nil, ---@type PushButton
|
||||
|
||||
update_mon_reqs = nil, ---@type function
|
||||
gen_mon_list = function () end,
|
||||
@ -622,7 +622,7 @@ local function config_view(display)
|
||||
|
||||
local mon_desc = TextBox{parent=mon_c_3,x=1,y=1,height=4,text=""}
|
||||
|
||||
local mon_unit_l, mon_unit = nil, nil ---@type graphics_element, graphics_element
|
||||
local mon_unit_l, mon_unit = nil, nil ---@type TextBox, NumberField
|
||||
|
||||
local mon_warn = TextBox{parent=mon_c_3,x=1,y=11,height=2,text="",fg_bg=cpair(colors.red,colors.lightGray)}
|
||||
|
||||
|
@ -34,10 +34,10 @@ local engine = {
|
||||
ui_ready = false,
|
||||
fp_ready = false,
|
||||
ui = {
|
||||
front_panel = nil, ---@type graphics_element|nil
|
||||
main_display = nil, ---@type graphics_element|nil
|
||||
flow_display = nil, ---@type graphics_element|nil
|
||||
unit_displays = {} ---@type (graphics_element|nil)[]
|
||||
front_panel = nil, ---@type DisplayBox|nil
|
||||
main_display = nil, ---@type DisplayBox|nil
|
||||
flow_display = nil, ---@type DisplayBox|nil
|
||||
unit_displays = {} ---@type (DisplayBox|nil)[]
|
||||
},
|
||||
disable_flow_view = false
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ local ALIGN = core.ALIGN
|
||||
local cpair = core.cpair
|
||||
|
||||
-- create a pocket list entry
|
||||
---@param parent graphics_element parent
|
||||
---@param parent ListBox parent
|
||||
---@param id integer PKT session ID
|
||||
local function init(parent, id)
|
||||
local s_hi_box = style.fp_theme.highlight_box
|
||||
|
@ -37,7 +37,7 @@ local function init(main)
|
||||
ping.register(facility.ps, "sv_ping", ping.update)
|
||||
datetime.register(facility.ps, "date_time", datetime.set_value)
|
||||
|
||||
---@type graphics_element, graphics_element, graphics_element, graphics_element
|
||||
---@type Div, Div, Div, Div
|
||||
local uo_1, uo_2, uo_3, uo_4
|
||||
|
||||
local cnc_y_start = 3
|
||||
|
@ -8,17 +8,17 @@ local util = require("scada-common.util")
|
||||
local pgi = {}
|
||||
|
||||
local data = {
|
||||
pkt_list = nil, ---@type nil|graphics_element
|
||||
pkt_list = nil, ---@type ListBox|nil
|
||||
pkt_entry = nil, ---@type function
|
||||
-- session entries
|
||||
s_entries = {
|
||||
pkt = {} ---@type graphics_element[]
|
||||
pkt = {} ---@type Div[]
|
||||
}
|
||||
}
|
||||
|
||||
-- link list boxes
|
||||
---@param pkt_list graphics_element pocket list element
|
||||
---@param pkt_entry function pocket entry constructor
|
||||
---@param pkt_list ListBox pocket list element
|
||||
---@param pkt_entry fun(parent: ListBox, id: integer) : Div pocket entry constructor
|
||||
function pgi.link_elements(pkt_list, pkt_entry)
|
||||
data.pkt_list = pkt_list
|
||||
data.pkt_entry = pkt_entry
|
||||
|
@ -566,7 +566,7 @@ function element.new(args, constraint, child_offset_x, child_offset_y)
|
||||
-- remove all child elements and reset next y
|
||||
function public.remove_all()
|
||||
for i = 1, #protected.children do
|
||||
local child = protected.children[i].get() ---@type graphics_element
|
||||
local child = protected.children[i].get() ---@type graphics_element
|
||||
child.delete()
|
||||
protected.on_removed(child.get_id())
|
||||
end
|
||||
|
@ -58,8 +58,8 @@ local tool_ctl = {
|
||||
viewing_config = false,
|
||||
importing_legacy = false,
|
||||
|
||||
view_cfg = nil, ---@type graphics_element
|
||||
settings_apply = nil, ---@type graphics_element
|
||||
view_cfg = nil, ---@type PushButton
|
||||
settings_apply = nil, ---@type PushButton
|
||||
|
||||
set_networked = nil, ---@type function
|
||||
bundled_emcool = nil, ---@type function
|
||||
@ -68,8 +68,8 @@ local tool_ctl = {
|
||||
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 = ""
|
||||
}
|
||||
|
||||
|
@ -83,10 +83,10 @@ function iocontrol.init_core(pkt_comms, nav, cfg)
|
||||
|
||||
get_tone_states = function () comms.diag__get_alarm_tones() end,
|
||||
|
||||
ready_warn = nil, ---@type graphics_element
|
||||
tone_buttons = {}, ---@type graphics_element[]
|
||||
alarm_buttons = {}, ---@type graphics_element[]
|
||||
tone_indicators = {} ---@type graphics_element[] indicators to update from supervisor tone states
|
||||
ready_warn = nil, ---@type TextBox
|
||||
tone_buttons = {}, ---@type SwitchButton[]
|
||||
alarm_buttons = {}, ---@type CheckBox[]
|
||||
tone_indicators = {} ---@type IndicatorLight[] indicators to update from supervisor tone states
|
||||
}
|
||||
|
||||
-- API access
|
||||
|
@ -109,8 +109,8 @@ pocket.APP_ID = APP_ID
|
||||
---@param smem pkt_shared_memory
|
||||
function pocket.init_nav(smem)
|
||||
local self = {
|
||||
pane = nil, ---@type graphics_element
|
||||
sidebar = nil, ---@type graphics_element
|
||||
pane = nil, ---@type MultiPane|nil
|
||||
sidebar = nil, ---@type Sidebar|nil
|
||||
apps = {}, ---@type pocket_app[]
|
||||
containers = {}, ---@type graphics_element[]
|
||||
help_map = {}, ---@type { [string]: function }
|
||||
@ -125,11 +125,11 @@ function pocket.init_nav(smem)
|
||||
local nav = {}
|
||||
|
||||
-- set the root pane element to switch between apps with
|
||||
---@param root_pane graphics_element
|
||||
---@param root_pane MultiPane
|
||||
function nav.set_pane(root_pane) self.pane = root_pane end
|
||||
|
||||
-- link sidebar element
|
||||
---@param sidebar graphics_element
|
||||
---@param sidebar Sidebar
|
||||
function nav.set_sidebar(sidebar) self.sidebar = sidebar end
|
||||
|
||||
-- register an app
|
||||
|
@ -33,8 +33,8 @@ local self = {
|
||||
|
||||
settings = nil, ---@type plc_config
|
||||
|
||||
run_test_btn = nil, ---@type graphics_element
|
||||
sc_log = nil, ---@type graphics_element
|
||||
run_test_btn = nil, ---@type PushButton
|
||||
sc_log = nil, ---@type ListBox
|
||||
self_check_msg = nil ---@type function
|
||||
}
|
||||
|
||||
|
@ -31,8 +31,8 @@ local self = {
|
||||
bundled_emcool = 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 = ""
|
||||
}
|
||||
|
||||
|
@ -58,11 +58,11 @@ local tool_ctl = {
|
||||
viewing_config = 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
|
||||
load_legacy = nil, ---@type function
|
||||
|
@ -130,14 +130,14 @@ local tool_ctl = {
|
||||
rs_cfg_port = IO.F_SCRAM, ---@type IO_PORT
|
||||
rs_cfg_editing = false, ---@type integer|false
|
||||
|
||||
view_gw_cfg = nil, ---@type graphics_element
|
||||
dev_cfg = nil, ---@type graphics_element
|
||||
rs_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
|
||||
settings_confirm = nil, ---@type graphics_element
|
||||
view_gw_cfg = nil, ---@type PushButton
|
||||
dev_cfg = nil, ---@type PushButton
|
||||
rs_cfg = nil, ---@type PushButton
|
||||
color_cfg = nil, ---@type PushButton
|
||||
color_next = nil, ---@type PushButton
|
||||
color_apply = nil, ---@type PushButton
|
||||
settings_apply = nil, ---@type PushButton
|
||||
settings_confirm = nil, ---@type PushButton
|
||||
|
||||
go_home = nil, ---@type function
|
||||
gen_summary = nil, ---@type function
|
||||
@ -149,26 +149,26 @@ local tool_ctl = {
|
||||
gen_rs_summary = 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 = "",
|
||||
|
||||
ppm_devs = nil, ---@type graphics_element
|
||||
p_name_msg = nil, ---@type graphics_element
|
||||
p_prompt = nil, ---@type graphics_element
|
||||
p_idx = nil, ---@type graphics_element
|
||||
p_unit = nil, ---@type graphics_element
|
||||
p_assign_btn = nil, ---@type graphics_element
|
||||
p_desc = nil, ---@type graphics_element
|
||||
p_desc_ext = nil, ---@type graphics_element
|
||||
p_err = nil, ---@type graphics_element
|
||||
ppm_devs = nil, ---@type ListBox
|
||||
p_name_msg = nil, ---@type TextBox
|
||||
p_prompt = nil, ---@type TextBox
|
||||
p_idx = nil, ---@type NumberField
|
||||
p_unit = nil, ---@type NumberField
|
||||
p_assign_btn = nil, ---@type RadioButton
|
||||
p_desc = nil, ---@type TextBox
|
||||
p_desc_ext = nil, ---@type TextBox
|
||||
p_err = nil, ---@type TextBox
|
||||
|
||||
rs_cfg_selection = nil, ---@type graphics_element
|
||||
rs_cfg_unit_l = nil, ---@type graphics_element
|
||||
rs_cfg_unit = nil, ---@type graphics_element
|
||||
rs_cfg_side_l = nil, ---@type graphics_element
|
||||
rs_cfg_color = nil, ---@type graphics_element
|
||||
rs_cfg_shortcut = nil ---@type graphics_element
|
||||
rs_cfg_selection = nil, ---@type TextBox
|
||||
rs_cfg_unit_l = nil, ---@type TextBox
|
||||
rs_cfg_unit = nil, ---@type NumberField
|
||||
rs_cfg_side_l = nil, ---@type TextBox
|
||||
rs_cfg_color = nil, ---@type Radio2D
|
||||
rs_cfg_shortcut = nil ---@type TextBox
|
||||
}
|
||||
|
||||
---@class rtu_config
|
||||
|
@ -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