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
Binary file modified .vscode/scripts/__pycache__/subprocess_conout.cpython-312.pyc
Binary file not shown.
Binary file modified bin/sensors/sensors.exe
Binary file not shown.
6 changes: 0 additions & 6 deletions scripts/dashx/app/app.lua
Original file line number Diff line number Diff line change
Expand Up @@ -771,9 +771,6 @@ function app.close()
dashx.config.useCompiler = true

-- Reset page and navigation state
pageLoaded = 100
pageTitle = nil
pageFile = nil
app.Page = {}
app.formFields = {}
app.formNavigationFields = {}
Expand Down Expand Up @@ -802,9 +799,6 @@ function app.close()
-- Reset audio
app.audio = {}

-- Reset telemetry and protocol state
ELRS_PAUSE_TELEMETRY = false
CRSF_PAUSE_TELEMETRY = false

-- Reset profile/rate state
dashx.app.triggers.profileswitchLast = nil
Expand Down
7 changes: 3 additions & 4 deletions scripts/dashx/app/modules/logs/logs_logs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ local function openPage(pidx, title, script, displaymode)

local logs = utils.getLogs(logDir)

print(logDir)


local name = utils.resolveModelName(dashx.session.mcu_id or dashx.session.activeLogDir)
Expand Down Expand Up @@ -129,17 +128,17 @@ local function openPage(pidx, title, script, displaymode)

if #dates == 0 then

LCD_W, LCD_H = dashx.utils.getWindowSize()
local LCD_W, LCD_H = dashx.utils.getWindowSize()
local str = "@i18n(app.modules.logs.msg_no_logs_found)@"
local ew = LCD_W
local eh = LCD_H
local etsizeW, etsizeH = lcd.getTextSize(str)
local eposX = ew / 2 - etsizeW / 2
local eposY = eh / 2 - etsizeH / 2

local posErr = {w = etsizeW, h = dashx.app.radio.navbuttonHeight, x = eposX, y = ePosY}
local posErr = {w = etsizeW, h = dashx.app.radio.navbuttonHeight, x = eposX, y = eposY}

line = form.addLine("", nil, false)
local line = form.addLine("", nil, false)
form.addStaticText(line, posErr, str)

else
Expand Down
24 changes: 12 additions & 12 deletions scripts/dashx/app/modules/logs/logs_view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ local function secondsToSamples(sec)
return math.floor(sec * SAMPLE_RATE)
end

function readNextChunk()
local function readNextChunk()
if logDataRawReadComplete then
return
end
Expand All @@ -102,7 +102,7 @@ function readNextChunk()
end
end

function format_time(seconds)
local function format_time(seconds)
-- Calculate minutes and remaining seconds
local minutes = math.floor(seconds / 60)
local seconds_remainder = seconds % 60
Expand Down Expand Up @@ -132,7 +132,7 @@ end



function calculateSeconds(totalSeconds, sliderValue)
local function calculateSeconds(totalSeconds, sliderValue)
-- Ensure sliderValue is within the range 1-100
if sliderValue < 1 or sliderValue > 100 then error("Slider value must be between 1 and 100") end

Expand All @@ -141,7 +141,7 @@ function calculateSeconds(totalSeconds, sliderValue)
end

-- Enhanced paginate_table() to support decimation
function paginate_table(data, step_size, position, decimationFactor)
local function paginate_table(data, step_size, position, decimationFactor)
decimationFactor = decimationFactor or 1

local start_index = math.max(1, position)
Expand All @@ -155,7 +155,7 @@ function paginate_table(data, step_size, position, decimationFactor)
return page
end

function padTable(tbl, padCount)
local function padTable(tbl, padCount)
-- Get the first and last values of the table
local first = tbl[1]
local last = tbl[#tbl]
Expand All @@ -176,13 +176,13 @@ function padTable(tbl, padCount)
end


function map(x, in_min, in_max, out_min, out_max)
local function map(x, in_min, in_max, out_min, out_max)
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min
end


-- Efficient function to get a specific column from CSV
function getColumn(csvData, colIndex)
local function getColumn(csvData, colIndex)
local column = {}
local start = 1
local len = #csvData
Expand Down Expand Up @@ -232,7 +232,7 @@ local function cleanColumn(data)
return out
end

function getValueAtPercentage(array, percentage)
local function getValueAtPercentage(array, percentage)
-- Ensure percentage is between 0 and 100
if percentage < 0 or percentage > 100 then error("Percentage must be between 0 and 100") end

Expand Down Expand Up @@ -479,23 +479,23 @@ local function drawCurrentIndex(points, position, totalPoints, keyindex, keyunit
end
end

function findMaxNumber(numbers)
local function findMaxNumber(numbers)
local max = numbers[1] -- Assume the first number is the largest initially
for i = 2, #numbers do -- Iterate through the table starting from the second element
if numbers[i] > max then max = numbers[i] end
end
return max
end

function findMinNumber(numbers)
local function findMinNumber(numbers)
local min = numbers[1] -- Assume the first number is the smallest initially
for i = 2, #numbers do -- Iterate through the table starting from the second element
if numbers[i] < min then min = numbers[i] end
end
return min
end

function findAverage(numbers)
local function findAverage(numbers)
local sum = 0
for i = 1, #numbers do -- Iterate through the table
sum = sum + numbers[i]
Expand All @@ -506,7 +506,7 @@ end

local function openPage(pidx, title, script, logfile, displaymode,dirname)


local err
dashx.app.triggers.isReady = false
dashx.app.uiState = dashx.app.uiStatus.pages

Expand Down
4 changes: 2 additions & 2 deletions scripts/dashx/app/modules/model/model.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ local function openPage(pidx, title, script)
dashx.app.lastTitle = title
dashx.app.lastScript = script

ESC = {}

-- size of buttons
if dashx.preferences.general.iconsize == nil or dashx.preferences.general.iconsize == "" then
Expand All @@ -37,7 +36,7 @@ local function openPage(pidx, title, script)

form.addLine(title)

buttonW = 100
local buttonW = 100
local x = windowWidth - buttonW - 10

dashx.app.formNavigationFields['menu'] = form.addButton(line, {x = x, y = dashx.app.radio.linePaddingTop, w = buttonW, h = dashx.app.radio.navbuttonHeight}, {
Expand Down Expand Up @@ -96,6 +95,7 @@ local function openPage(pidx, title, script)
local pages = S_PAGES
local lc = 0
local bx = 0
local y = 0



Expand Down
5 changes: 3 additions & 2 deletions scripts/dashx/app/modules/settings/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ local function openPage(pidx, title, script)
dashx.app.lastTitle = title
dashx.app.lastScript = script

ESC = {}


-- size of buttons
if dashx.preferences.general.iconsize == nil or dashx.preferences.general.iconsize == "" then
Expand All @@ -40,7 +40,7 @@ local function openPage(pidx, title, script)

form.addLine(title)

buttonW = 100
local buttonW = 100
local x = windowWidth - buttonW - 10

dashx.app.formNavigationFields['menu'] = form.addButton(line, {x = x, y = dashx.app.radio.linePaddingTop, w = buttonW, h = dashx.app.radio.navbuttonHeight}, {
Expand Down Expand Up @@ -99,6 +99,7 @@ local function openPage(pidx, title, script)
local pages = S_PAGES
local lc = 0
local bx = 0
local y = 0



Expand Down
4 changes: 2 additions & 2 deletions scripts/dashx/app/modules/settings/tools/audio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ local function openPage(pidx, title, script)
dashx.app.lastTitle = title
dashx.app.lastScript = script

ESC = {}

-- size of buttons
if dashx.preferences.general.iconsize == nil or dashx.preferences.general.iconsize == "" then
Expand All @@ -38,7 +37,7 @@ local function openPage(pidx, title, script)



buttonW = 100
local buttonW = 100
local x = windowWidth - buttonW - 10

dashx.app.ui.fieldHeader(
Expand Down Expand Up @@ -84,6 +83,7 @@ local function openPage(pidx, title, script)
local pages = S_PAGES
local lc = 0
local bx = 0
local y = 0



Expand Down
2 changes: 1 addition & 1 deletion scripts/dashx/app/modules/settings/tools/audio_events.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local settings = {}

local enableWakeup = false

local function sensorNameMap(sensorList)
local nameMap = {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local settings = {}

local enableWakeup = false

local function sensorNameMap(sensorList)
local nameMap = {}
Expand Down
4 changes: 2 additions & 2 deletions scripts/dashx/app/modules/settings/tools/dashboard.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ local function openPage(pidx, title, script)
dashx.app.lastTitle = title
dashx.app.lastScript = script

ESC = {}

-- size of buttons
if dashx.preferences.general.iconsize == nil or dashx.preferences.general.iconsize == "" then
Expand All @@ -37,7 +36,7 @@ local function openPage(pidx, title, script)
local panel


buttonW = 100
local buttonW = 100
local x = windowWidth - buttonW - 10

dashx.app.ui.fieldHeader(
Expand Down Expand Up @@ -84,6 +83,7 @@ local function openPage(pidx, title, script)
local pages = S_PAGES
local lc = 0
local bx = 0
local y = 0



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

local themesBasePath = "SCRIPTS:/" .. dashx.config.baseDir .. "/widgets/dashboard/themes/"
local themesUserPath = "SCRIPTS:/" .. dashx.config.preferences .. "/dashboard/"
local enableWakeup = false

local function openPage(pidx, title, script)
-- Get the installed themes
Expand Down
1 change: 1 addition & 0 deletions scripts/dashx/app/modules/settings/tools/development.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local settings = {}
local enableWakeup = false

local function openPage(pageIdx, title, script)
enableWakeup = true
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,4 +1,5 @@
local settings = {}
local enableWakeup = false

local function openPage(pageIdx, title, script)
enableWakeup = true
Expand Down
2 changes: 2 additions & 0 deletions scripts/dashx/app/modules/settings/tools/localizations.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
local settings = {}
local enableWakeup = false


local function openPage(pageIdx, title, script)
enableWakeup = true
Expand Down
Loading