Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wing wizard: fix dual rate switch display & setting #178

Merged
Merged
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
25 changes: 15 additions & 10 deletions sdcard/c480x272/TEMPLATES/1.Wizard/3.Wing.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
---- #########################################################################

-- Author: Offer Shmuely
-- Date: 2023
-- version: 1.1
-- Date: 2023-2024
-- version: 1.3

local VALUE = 0
local COMBO = 1
Expand Down Expand Up @@ -380,8 +380,12 @@ local function runConfigSummary(event)
drawNextLine("Arm switch", nil, switchName)
end

drawNextLine("Dual Rate", nil, ElevronFields.is_dual_rate.avail_values[1 + ElevronFields.is_dual_rate.value])

drawNextLine("Dual Rate", nil,
ElevronFields.is_dual_rate.avail_values[1 + ElevronFields.is_dual_rate.value] ..
(ElevronFields.is_dual_rate.value == 1 and
" (" .. ElevronFields.dr_switch.avail_values[1 + ElevronFields.dr_switch.value] .. ")" or
"")
)

lcd.drawFilledRectangle(60-10, 250-2, 240, 25, YELLOW)
lcd.drawText(60, 250, "Hold [Enter] to apply changes...", COLOR_THEME_PRIMARY1)
Expand Down Expand Up @@ -444,14 +448,15 @@ local function createModel(event)
-- expo
local expoVal = ElevronFields.expo.value
local is_dual_rate = (ElevronFields.is_dual_rate.value == 1)
local dr_switch = ElevronFields.dr_switch.avail_values[1 + ElevronFields.dr_switch.value]
if (is_dual_rate) then
updateInputLine(defaultChannel_0_AIL, 0, expoVal, 100, "SC" .. CHAR_UP)
updateInputLine(defaultChannel_0_AIL, 1, expoVal, 75 , "SC-")
updateInputLine(defaultChannel_0_AIL, 2, expoVal, 50 , "SC" .. CHAR_DOWN)
updateInputLine(defaultChannel_0_AIL, 0, expoVal, 100, dr_switch .. CHAR_UP)
updateInputLine(defaultChannel_0_AIL, 1, expoVal, 75 , dr_switch .. "-")
updateInputLine(defaultChannel_0_AIL, 2, expoVal, 50 , dr_switch .. CHAR_DOWN)

updateInputLine(defaultChannel_0_ELE, 0, expoVal, 100, "SC" .. CHAR_UP)
updateInputLine(defaultChannel_0_ELE, 1, expoVal, 75 , "SC-")
updateInputLine(defaultChannel_0_ELE, 2, expoVal, 50 , "SC" .. CHAR_DOWN)
updateInputLine(defaultChannel_0_ELE, 0, expoVal, 100, dr_switch .. CHAR_UP)
updateInputLine(defaultChannel_0_ELE, 1, expoVal, 75 , dr_switch .. "-")
updateInputLine(defaultChannel_0_ELE, 2, expoVal, 50 , dr_switch .. CHAR_DOWN)
else
updateInputLine(defaultChannel_0_AIL, 0, expoVal, 100, nil)
updateInputLine(defaultChannel_0_ELE, 0, expoVal, 100, nil)
Expand Down