Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/dashx/app/app.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")
--[[

* Copyright (C) dashx Project
Expand All @@ -24,7 +25,7 @@ app.initialized = false

local utils = dashx.utils
local log = utils.log
local compile = dashx.compiler.loadfile
local compile = loadfile

local arg = {...}

Expand Down
9 changes: 5 additions & 4 deletions scripts/dashx/app/lib/ui.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")
--[[

* Copyright (C) dashx Project
Expand Down Expand Up @@ -961,7 +962,7 @@ local function getHelpData(section)
local helpPath = "app/modules/" .. section .. "/help.lua"
if dashx.utils.file_exists(helpPath) then
local ok, helpData = pcall(function()
return assert(dashx.compiler.loadfile(helpPath))()
return assert(loadfile(helpPath))()
end)
ui._helpCache[section] = (ok and type(helpData)=="table") and helpData or false
else
Expand Down Expand Up @@ -1005,14 +1006,14 @@ function ui.openPage(idx, title, script, extra1, extra2, extra3, extra5, extra6)
-- Load the module
local modulePath = "app/modules/" .. script

dashx.app.Page = assert(dashx.compiler.loadfile(modulePath))(idx)
dashx.app.Page = assert(loadfile(modulePath))(idx)

-- Load the help file if it exists
local section = script:match("([^/]+)")
local helpData = getHelpData(section)
dashx.app.fieldHelpTxt = helpData and helpData.fields or nil

-- dashx.app.Page = assert(dashx.compiler.loadfile(modulePath))(idx)
-- dashx.app.Page = assert(loadfile(modulePath))(idx)
-- If the Page has its own openPage function, use it and return early
if dashx.app.Page.openPage then
dashx.app.Page.openPage(idx, title, script, extra1, extra2, extra3, extra5, extra6)
Expand Down Expand Up @@ -1094,7 +1095,7 @@ function ui.openPageDashboard(idx, title, script, source, folder)
-- Load the module
local modulePath = script

dashx.app.Page = assert(dashx.compiler.loadfile(modulePath))(idx)
dashx.app.Page = assert(loadfile(modulePath))(idx)

-- load up the menu
local w, h = dashx.utils.getWindowSize()
Expand Down
1 change: 1 addition & 0 deletions scripts/dashx/app/lib/utils.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")
--[[

* Copyright (C) dashx Project
Expand Down
3 changes: 2 additions & 1 deletion scripts/dashx/app/modules/init.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")
--[[

* Copyright (C) dashx Project
Expand All @@ -19,7 +20,7 @@

]] --
local pages = {}
local sections = dashx.compiler.loadfile("app/modules/sections.lua")()
local sections = loadfile("app/modules/sections.lua")()

-- find the modules (this should already have been done in the tasks/tasks.lua script but we catch and retry on the offchance it hasn't)
if dashx.app.moduleList == nil then dashx.app.moduleList = dashx.utils.findModules() end
Expand Down
1 change: 1 addition & 0 deletions scripts/dashx/app/modules/logs/help.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")
--[[
* Copyright (C) dashx Project
*
Expand Down
1 change: 1 addition & 0 deletions scripts/dashx/app/modules/logs/init.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")
--[[
* Copyright (C) dashx Project
*
Expand Down
1 change: 1 addition & 0 deletions scripts/dashx/app/modules/logs/lib/utils.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")
local utils = {}

--- Resolves model name from telemetry folder's configuration file
Expand Down
3 changes: 2 additions & 1 deletion scripts/dashx/app/modules/logs/logs_logs.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local utils = assert(dashx.compiler.loadfile("SCRIPTS:/" .. dashx.config.baseDir .. "/app/modules/logs/lib/utils.lua"))()
local dashx = require("dashx")
local utils = assert(loadfile("SCRIPTS:/" .. dashx.config.baseDir .. "/app/modules/logs/lib/utils.lua"))()

local triggerOverRide = false
local triggerOverRideAll = false
Expand Down
3 changes: 2 additions & 1 deletion scripts/dashx/app/modules/logs/logs_view.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
local dashx = require("dashx")
-- display vars
local utils = assert(dashx.compiler.loadfile("SCRIPTS:/" .. dashx.config.baseDir .. "/app/modules/logs/lib/utils.lua"))()
local utils = assert(loadfile("SCRIPTS:/" .. dashx.config.baseDir .. "/app/modules/logs/lib/utils.lua"))()
local res = system.getVersion()
local LCD_W = res.lcdWidth
local LCD_H = res.lcdHeight
Expand Down
1 change: 1 addition & 0 deletions scripts/dashx/app/modules/model/help.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")
--[[
* Copyright (C) dashx Project
*
Expand Down
1 change: 1 addition & 0 deletions scripts/dashx/app/modules/model/init.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")
--[[
* Copyright (C) dashx Project
*
Expand Down
3 changes: 2 additions & 1 deletion scripts/dashx/app/modules/model/model.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")
local enableWakeup = false

local S_PAGES = {
Expand Down Expand Up @@ -91,7 +92,7 @@ local function openPage(pidx, title, script)
if dashx.preferences.menulastselected["model"] == nil then dashx.preferences.menulastselected["model"] = 1 end


local Menu = assert(dashx.compiler.loadfile("app/modules/" .. script))()
local Menu = assert(loadfile("app/modules/" .. script))()
local pages = S_PAGES
local lc = 0
local bx = 0
Expand Down
1 change: 1 addition & 0 deletions scripts/dashx/app/modules/model/tools/battery.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")
local settings = {}
local enableWakeup = false

Expand Down
1 change: 1 addition & 0 deletions scripts/dashx/app/modules/model/tools/triggers.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")

local enableWakeup = false

Expand Down
1 change: 1 addition & 0 deletions scripts/dashx/app/modules/sections.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")
--[[

* Copyright (C) dashx Project
Expand Down
1 change: 1 addition & 0 deletions scripts/dashx/app/modules/settings/help.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")
--[[
* Copyright (C) dashx Project
*
Expand Down
1 change: 1 addition & 0 deletions scripts/dashx/app/modules/settings/init.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")
--[[
* Copyright (C) dashx Project
*
Expand Down
3 changes: 2 additions & 1 deletion scripts/dashx/app/modules/settings/settings.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")


local S_PAGES = {
Expand Down Expand Up @@ -95,7 +96,7 @@ local function openPage(pidx, title, script)
if dashx.preferences.menulastselected["settings"] == nil then dashx.preferences.menulastselected["settings"] = 1 end


local Menu = assert(dashx.compiler.loadfile("app/modules/" .. script))()
local Menu = assert(loadfile("app/modules/" .. script))()
local pages = S_PAGES
local lc = 0
local bx = 0
Expand Down
3 changes: 2 additions & 1 deletion scripts/dashx/app/modules/settings/tools/audio.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")



Expand Down Expand Up @@ -79,7 +80,7 @@ local function openPage(pidx, title, script)
if dashx.preferences.menulastselected["settings_dashboard"] == nil then dashx.preferences.menulastselected["settings_dashboard"] = 1 end


local Menu = assert(dashx.compiler.loadfile("app/modules/" .. script))()
local Menu = assert(loadfile("app/modules/" .. script))()
local pages = S_PAGES
local lc = 0
local bx = 0
Expand Down
1 change: 1 addition & 0 deletions scripts/dashx/app/modules/settings/tools/audio_events.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")
local settings = {}
local enableWakeup = false

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")
local settings = {}
local enableWakeup = false

Expand Down
3 changes: 2 additions & 1 deletion scripts/dashx/app/modules/settings/tools/dashboard.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")



Expand Down Expand Up @@ -79,7 +80,7 @@ local function openPage(pidx, title, script)
if dashx.preferences.menulastselected["settings_dashboard"] == nil then dashx.preferences.menulastselected["settings_dashboard"] = 1 end


local Menu = assert(dashx.compiler.loadfile("app/modules/" .. script))()
local Menu = assert(loadfile("app/modules/" .. script))()
local pages = S_PAGES
local lc = 0
local bx = 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")


local themesBasePath = "SCRIPTS:/" .. dashx.config.baseDir .. "/widgets/dashboard/themes/"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")
local settings = {}
local settings_model = {}

Expand Down
18 changes: 1 addition & 17 deletions scripts/dashx/app/modules/settings/tools/development.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")
local settings = {}
local enableWakeup = false

Expand Down Expand Up @@ -36,23 +37,6 @@ formFieldCount = formFieldCount + 1
end)


formFieldCount = formFieldCount + 1
dashx.session.formLineCnt = dashx.session.formLineCnt + 1
dashx.app.formLines[dashx.session.formLineCnt] = form.addLine("@i18n(app.modules.settings.txt_compilation)@")
dashx.app.formFields[formFieldCount] = form.addBooleanField(dashx.app.formLines[dashx.session.formLineCnt],
nil,
function()
if dashx.preferences and dashx.preferences.developer then
return settings['compile']
end
end,
function(newValue)
if dashx.preferences and dashx.preferences.developer then
settings.compile = newValue
end
end)



local logpanel = form.addExpansionPanel("@i18n(app.modules.settings.txt_logging)@")
logpanel:open(false)
Expand Down
1 change: 1 addition & 0 deletions scripts/dashx/app/modules/settings/tools/general.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")
local settings = {}
local enableWakeup = false

Expand Down
1 change: 1 addition & 0 deletions scripts/dashx/app/modules/settings/tools/localizations.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")
local settings = {}
local enableWakeup = false

Expand Down
1 change: 1 addition & 0 deletions scripts/dashx/app/radios.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local dashx = require("dashx")
local LCD_W, LCD_H = dashx.utils.getWindowSize()
local resolution = LCD_W .. "x" .. LCD_H

Expand Down
Loading