diff --git a/.vscode/settings.json b/.vscode/settings.json index 3bf857e..673ad4e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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, diff --git a/coordinator/session/api.lua b/coordinator/session/api.lua index 69df834..2db28fd 100644 --- a/coordinator/session/api.lua +++ b/coordinator/session/api.lua @@ -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 diff --git a/graphics/element.lua b/graphics/element.lua index 77012fd..92b2f49 100644 --- a/graphics/element.lua +++ b/graphics/element.lua @@ -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 diff --git a/pocket/pocket.lua b/pocket/pocket.lua index be0c622..97ad87a 100644 --- a/pocket/pocket.lua +++ b/pocket/pocket.lua @@ -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() diff --git a/pocket/ui/components/boiler_page.lua b/pocket/ui/components/boiler_page.lua index 204896a..fd0eca1 100644 --- a/pocket/ui/components/boiler_page.lua +++ b/pocket/ui/components/boiler_page.lua @@ -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 diff --git a/pocket/ui/components/home_page.lua b/pocket/ui/components/home_page.lua index 6715f19..5287cac 100644 --- a/pocket/ui/components/home_page.lua +++ b/pocket/ui/components/home_page.lua @@ -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 diff --git a/pocket/ui/components/reactor_page.lua b/pocket/ui/components/reactor_page.lua index 4775d81..50b1939 100644 --- a/pocket/ui/components/reactor_page.lua +++ b/pocket/ui/components/reactor_page.lua @@ -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 diff --git a/pocket/ui/components/turbine_page.lua b/pocket/ui/components/turbine_page.lua index 9c060cc..9fd7af5 100644 --- a/pocket/ui/components/turbine_page.lua +++ b/pocket/ui/components/turbine_page.lua @@ -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 diff --git a/pocket/ui/components/unit_page.lua b/pocket/ui/components/unit_page.lua index 60c91b1..2e24df3 100644 --- a/pocket/ui/components/unit_page.lua +++ b/pocket/ui/components/unit_page.lua @@ -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 diff --git a/pocket/ui/main.lua b/pocket/ui/main.lua index 820867c..d8202a7 100644 --- a/pocket/ui/main.lua +++ b/pocket/ui/main.lua @@ -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