cleanup to pass checks

This commit is contained in:
Mikayla Fischler 2023-04-19 21:26:54 -04:00
parent ccdc31ed87
commit a614b97d02
10 changed files with 32 additions and 35 deletions

View File

@ -19,7 +19,7 @@
"Lua.diagnostics.severity": {
"unused-local": "Information",
"unused-vararg": "Information",
"unused-function": "Information",
"unused-function": "Warning",
"unused-label": "Information"
},
"Lua.hint.setType": true,

View File

@ -73,16 +73,16 @@ function api.new_session(id, in_queue, out_queue, timeout)
-- send a CAPI packet
---@param msg_type CAPI_TYPE
---@param msg table
local function _send(msg_type, msg)
local s_pkt = comms.scada_packet()
local c_pkt = comms.capi_packet()
-- local function _send(msg_type, msg)
-- local s_pkt = comms.scada_packet()
-- local c_pkt = comms.capi_packet()
c_pkt.make(msg_type, msg)
s_pkt.make(self.seq_num, PROTOCOL.COORD_API, c_pkt.raw_sendable())
-- c_pkt.make(msg_type, msg)
-- s_pkt.make(self.seq_num, PROTOCOL.COORD_API, c_pkt.raw_sendable())
out_queue.push_packet(s_pkt)
self.seq_num = self.seq_num + 1
end
-- out_queue.push_packet(s_pkt)
-- self.seq_num = self.seq_num + 1
-- end
-- send a SCADA management packet
---@param msg_type SCADA_MGMT_TYPE

View File

@ -168,6 +168,8 @@ function element.new(args)
self.bounds.y2 = self.position.y + f.h - 1
end
---@diagnostic disable: unused-local, unused-vararg
-- handle a mouse event
---@param event mouse_interaction mouse interaction event
function protected.handle_mouse(event)
@ -222,6 +224,8 @@ function element.new(args)
function protected.resize(...)
end
---@diagnostic enable: unused-local, unused-vararg
-- start animations
function protected.start_anim()
end

View File

@ -8,7 +8,7 @@ local PROTOCOL = comms.PROTOCOL
local DEVICE_TYPE = comms.DEVICE_TYPE
local ESTABLISH_ACK = comms.ESTABLISH_ACK
local SCADA_MGMT_TYPE = comms.SCADA_MGMT_TYPE
local CAPI_TYPE = comms.CAPI_TYPE
-- local CAPI_TYPE = comms.CAPI_TYPE
local LINK_STATE = coreio.LINK_STATE
@ -84,16 +84,16 @@ function pocket.comms(version, modem, local_port, sv_port, api_port, range, sv_w
-- send a packet to the coordinator API
---@param msg_type CAPI_TYPE
---@param msg table
local function _send_api(msg_type, msg)
local s_pkt = comms.scada_packet()
local pkt = comms.capi_packet()
-- local function _send_api(msg_type, msg)
-- local s_pkt = comms.scada_packet()
-- local pkt = comms.capi_packet()
pkt.make(msg_type, msg)
s_pkt.make(self.api.seq_num, PROTOCOL.COORD_API, pkt.raw_sendable())
-- pkt.make(msg_type, msg)
-- s_pkt.make(self.api.seq_num, PROTOCOL.COORD_API, pkt.raw_sendable())
modem.transmit(api_port, local_port, s_pkt.raw_sendable())
self.api.seq_num = self.api.seq_num + 1
end
-- modem.transmit(api_port, local_port, s_pkt.raw_sendable())
-- self.api.seq_num = self.api.seq_num + 1
-- end
-- attempt supervisor connection establishment
local function _send_sv_establish()

View File

@ -1,11 +1,11 @@
local style = require("pocket.ui.style")
-- local style = require("pocket.ui.style")
local core = require("graphics.core")
local Div = require("graphics.elements.div")
local TextBox = require("graphics.elements.textbox")
local cpair = core.graphics.cpair
-- local cpair = core.graphics.cpair
local TEXT_ALIGN = core.graphics.TEXT_ALIGN

View File

@ -1,11 +1,11 @@
local style = require("pocket.ui.style")
-- local style = require("pocket.ui.style")
local core = require("graphics.core")
local Div = require("graphics.elements.div")
local TextBox = require("graphics.elements.textbox")
local cpair = core.graphics.cpair
-- local cpair = core.graphics.cpair
local TEXT_ALIGN = core.graphics.TEXT_ALIGN

View File

@ -1,11 +1,11 @@
local style = require("pocket.ui.style")
-- local style = require("pocket.ui.style")
local core = require("graphics.core")
local Div = require("graphics.elements.div")
local TextBox = require("graphics.elements.textbox")
local cpair = core.graphics.cpair
-- local cpair = core.graphics.cpair
local TEXT_ALIGN = core.graphics.TEXT_ALIGN

View File

@ -1,11 +1,11 @@
local style = require("pocket.ui.style")
-- local style = require("pocket.ui.style")
local core = require("graphics.core")
local Div = require("graphics.elements.div")
local TextBox = require("graphics.elements.textbox")
local cpair = core.graphics.cpair
-- local cpair = core.graphics.cpair
local TEXT_ALIGN = core.graphics.TEXT_ALIGN

View File

@ -1,11 +1,11 @@
local style = require("pocket.ui.style")
-- local style = require("pocket.ui.style")
local core = require("graphics.core")
local Div = require("graphics.elements.div")
local TextBox = require("graphics.elements.textbox")
local cpair = core.graphics.cpair
-- local cpair = core.graphics.cpair
local TEXT_ALIGN = core.graphics.TEXT_ALIGN

View File

@ -2,8 +2,6 @@
-- Pocket GUI Root
--
local util = require("scada-common.util")
local coreio = require("pocket.coreio")
local style = require("pocket.ui.style")
@ -18,18 +16,13 @@ local turbine_page = require("pocket.ui.components.turbine_page")
local core = require("graphics.core")
local ColorMap = require("graphics.elements.colormap")
local DisplayBox = require("graphics.elements.displaybox")
local Div = require("graphics.elements.div")
local MultiPane = require("graphics.elements.multipane")
local TextBox = require("graphics.elements.textbox")
local PushButton = require("graphics.elements.controls.push_button")
local SwitchButton = require("graphics.elements.controls.switch_button")
local Sidebar = require("graphics.elements.controls.sidebar")
local DataIndicator = require("graphics.elements.indicators.data")
local TEXT_ALIGN = core.graphics.TEXT_ALIGN
local cpair = core.graphics.cpair