diff --git a/pocket/iocontrol.lua b/pocket/iocontrol.lua index 1d2b77c..3d52e68 100644 --- a/pocket/iocontrol.lua +++ b/pocket/iocontrol.lua @@ -3,7 +3,7 @@ -- local const = require("scada-common.constants") -local log = require("scada-common.log") +-- local log = require("scada-common.log") local psil = require("scada-common.psil") local types = require("scada-common.types") local util = require("scada-common.util") diff --git a/pocket/startup.lua b/pocket/startup.lua index 0d2be64..33832da 100644 --- a/pocket/startup.lua +++ b/pocket/startup.lua @@ -3,7 +3,7 @@ -- ---@diagnostic disable-next-line: undefined-global -local _is_pocket_env = pocket or periphemu +local _is_pocket_env = pocket ~= nil or periphemu ~= nil require("/initenv").init_env() diff --git a/pocket/ui/pages/guide_section.lua b/pocket/ui/pages/guide_section.lua index a9e9596..63e2333 100644 --- a/pocket/ui/pages/guide_section.lua +++ b/pocket/ui/pages/guide_section.lua @@ -36,7 +36,7 @@ return function (data, base_page, title, items, scroll_height) local name_list = ListBox{parent=section_div,x=1,y=3,scroll_height=30,nav_fg_bg=cpair(colors.lightGray,colors.gray),nav_active=cpair(colors.white,colors.gray)} local def_list = ListBox{parent=section_view_div,x=1,y=3,scroll_height=scroll_height,nav_fg_bg=cpair(colors.lightGray,colors.gray),nav_active=cpair(colors.white,colors.gray)} - local _end = nil + local _end for i = 1, #items do local item = items[i] ---@type pocket_doc_item diff --git a/pocket/ui/pages/unit_reactor.lua b/pocket/ui/pages/unit_reactor.lua index 6990e92..7446d78 100644 --- a/pocket/ui/pages/unit_reactor.lua +++ b/pocket/ui/pages/unit_reactor.lua @@ -20,12 +20,11 @@ local PushButton = require("graphics.elements.controls.push_button") local ALIGN = core.ALIGN local cpair = core.cpair -local label = style.label -local lu_col = style.label_unit_pair -local text_fg = style.text_fg -local mode_states = style.icon_states.mode_states -local red_ind_s = style.icon_states.red_ind_s -local yel_ind_s = style.icon_states.yel_ind_s +local label = style.label +local lu_col = style.label_unit_pair +local text_fg = style.text_fg +local red_ind_s = style.icon_states.red_ind_s +local yel_ind_s = style.icon_states.yel_ind_s -- create a reactor view in the unit app ---@param app pocket_app diff --git a/pocket/ui/pages/unit_turbine.lua b/pocket/ui/pages/unit_turbine.lua index b4d9a2e..5a7763b 100644 --- a/pocket/ui/pages/unit_turbine.lua +++ b/pocket/ui/pages/unit_turbine.lua @@ -109,8 +109,8 @@ return function (app, u_page, panes, tbn_pane, u_id, t_id, ps, update) local rotation = DataIndicator{parent=tbn_ext_div,x=1,y=10,lu_colors=lu_col,label="",unit="",format="%21.12f",value=0,width=21,fg_bg=text_fg} rotation.register(ps, "steam", function () - local status, result = pcall(function () return util.turbine_rotation(db.units[u_id].turbine_data_tbl[t_id]) end) - if status then rotation.update(result) end + local ok, result = pcall(function () return util.turbine_rotation(db.units[u_id].turbine_data_tbl[t_id]) end) + if ok then rotation.update(result) end end) return tbn_page.nav_to