diff --git a/pocket/pocket.lua b/pocket/pocket.lua index 133e26d..3119e85 100644 --- a/pocket/pocket.lua +++ b/pocket/pocket.lua @@ -150,7 +150,7 @@ function pocket.init_nav(smem) ---@class pocket_app local app = { loaded = false, - cur_page = nil, ---@type nav_tree_page + cur_page = nil, ---@type nav_tree_page|nil pane = pane, paned_pages = {}, ---@type nav_tree_page[] sidebar_items = {} ---@type sidebar_entry[] @@ -348,7 +348,7 @@ function pocket.init_nav(smem) function nav.get_containers() return self.containers end -- get the currently active page - ---@return nav_tree_page + ---@return nav_tree_page|nil function nav.get_current_page() return self.apps[self.cur_app].get_current_page() end diff --git a/pocket/startup.lua b/pocket/startup.lua index d8d7890..cbd6803 100644 --- a/pocket/startup.lua +++ b/pocket/startup.lua @@ -22,7 +22,7 @@ local pocket = require("pocket.pocket") local renderer = require("pocket.renderer") local threads = require("pocket.threads") -local POCKET_VERSION = "v1.0.0" +local POCKET_VERSION = "v1.0.1" local println = util.println local println_ts = util.println_ts diff --git a/pocket/threads.lua b/pocket/threads.lua index e5d0ea7..120c8dd 100644 --- a/pocket/threads.lua +++ b/pocket/threads.lua @@ -58,8 +58,10 @@ function threads.thread__main(smem) pocket_comms.link_update() -- update any tasks for the active page - local page_tasks = nav.get_current_page().tasks - for i = 1, #page_tasks do page_tasks[i]() end + if nav.get_current_page() then + local page_tasks = nav.get_current_page().tasks + for i = 1, #page_tasks do page_tasks[i]() end + end loop_clock.start() elseif sv_wd.is_timer(param1) then diff --git a/pocket/ui/apps/alarm.lua b/pocket/ui/apps/alarm.lua index 68c69a5..a6dc573 100644 --- a/pocket/ui/apps/alarm.lua +++ b/pocket/ui/apps/alarm.lua @@ -155,14 +155,27 @@ local function new_view(root) --#endregion + --#region info page + + app.new_page(nil, 3) + + local info_div = Div{parent=page_div} + + TextBox{parent=info_div,x=2,y=1,text="This app provides tools to test alarm sounds by alarm and by tone (1-8)."} + TextBox{parent=info_div,x=2,y=6,text="The system must be idle (all units stopped with no alarms active) for testing to run."} + TextBox{parent=info_div,x=2,y=12,text="Currently, testing will be denied unless you have a Facility Authentication Key set (this will change in the future)."} + + --#endregion + -- setup multipane - local u_pane = MultiPane{parent=page_div,x=1,y=1,panes={alarms_div,tones_div}} + local u_pane = MultiPane{parent=page_div,x=1,y=1,panes={alarms_div,tones_div,info_div}} app.set_root_pane(u_pane) local list = { { label = " # ", tall = true, color = core.cpair(colors.black, colors.green), callback = db.nav.go_home }, { label = " \x13 ", color = core.cpair(colors.black, colors.red), callback = function () app.switcher(1) end }, - { label = " \x0f ", color = core.cpair(colors.black, colors.yellow), callback = function () app.switcher(2) end } + { label = " \x0f ", color = core.cpair(colors.black, colors.yellow), callback = function () app.switcher(2) end }, + { label = " ? ", color = core.cpair(colors.black, colors.blue), callback = function () app.switcher(3) end } } app.set_sidebar(list)