Merge pull request #6653 from opentx/LapinFou/Wizard_scripts

Updated wizard Lua scripts.
This commit is contained in:
3djc
2019-09-10 13:52:25 +02:00
committed by GitHub
8 changed files with 96 additions and 102 deletions
@@ -311,6 +311,7 @@ end
local function drawNextLine(x, y, label, channel)
lcd.drawText(x, y, label, 0);
lcd.drawText(x+48, y, ":", 0);
lcd.drawSource(x+52, y, MIXSRC_CH1+channel, 0)
y = y + 8
if y > 50 then
@@ -327,12 +328,12 @@ local function drawConfirmationMenu()
lcd.drawText(48, 1, "Ready to go?", 0);
lcd.drawFilledRectangle(0, 0, LCD_W, 9, 0)
if engineMode == 1 then
x, y = drawNextLine(x, y, "Thr:", thrCH1)
x, y = drawNextLine(x, y, "Throttle", thrCH1)
end
x, y = drawNextLine(x, y, "Ele L:", elevCH1)
x, y = drawNextLine(x, y, "Ele R:", elevCH2)
x, y = drawNextLine(x, y, "Elevon L", elevCH1)
x, y = drawNextLine(x, y, "Elevon R", elevCH2)
if rudderMode == 1 then
drawNextLine(x, y, "Rudder:", rudCH1)
drawNextLine(x, y, "Rudder", rudCH1)
end
lcd.drawText(48, LCD_H-8, "[Enter Long] to confirm", 0);
lcd.drawFilledRectangle(0, LCD_H-9, LCD_W, 9, 0)
@@ -165,8 +165,8 @@ end
-- Init function
local function init()
thrCH1 = defaultChannel(2)
rollCH1 = defaultChannel(3)
yawCH1 = defaultChannel(0)
rollCH1 = defaultChannel(0)
yawCH1 = defaultChannel(3)
pitchCH1 = defaultChannel(1)
local ver, radio, maj, minor, rev = getVersion()
if string.match(radio, "x7") then
@@ -326,6 +326,7 @@ end
-- Confirmation Menu
local function drawNextLine(x, y, label, channel)
lcd.drawText(x, y, label, 0);
lcd.drawText(x+46, y, ":", 0);
lcd.drawSource(x+50, y, MIXSRC_CH1+channel, 0)
y = y + 8
if y > 50 then
@@ -337,6 +338,7 @@ end
local function drawNextSWLine(x, y, label, switch)
lcd.drawText(x, y, label, 0);
lcd.drawText(x+38, y, ":", 0);
lcd.drawText(x+42, y, switches[switch], 0)
y = y + 8
if y > 50 then
@@ -352,15 +354,15 @@ local function drawConfirmationMenu()
lcd.clear()
lcd.drawText(0, 1, "Ready to go?", 0);
lcd.drawFilledRectangle(0, 0, LCD_W, 9, 0)
x, y = drawNextLine(x, y, "Throttle:", thrCH1)
x, y = drawNextLine(x, y, "Roll:", rollCH1)
x, y = drawNextLine(x, y, "Pitch:", pitchCH1)
x, y = drawNextLine(x, y, "Yaw:", yawCH1)
x, y = drawNextLine(x, y, "Throttle", thrCH1)
x, y = drawNextLine(x, y, "Roll", rollCH1)
x, y = drawNextLine(x, y, "Pitch", pitchCH1)
x, y = drawNextLine(x, y, "Yaw", yawCH1)
local x = 72
local y = 12
x, y = drawNextSWLine(x, y, "Arm:", armSW1)
x, y = drawNextSWLine(x, y, "Mode:", modeSW1)
x, y = drawNextSWLine(x, y, "Beeper:", beeperSW1)
x, y = drawNextSWLine(x, y, "Arm", armSW1)
x, y = drawNextSWLine(x, y, "Mode", modeSW1)
x, y = drawNextSWLine(x, y, "Beeper", beeperSW1)
lcd.drawText(0, LCD_H-8, "[Enter Long] to confirm", 0);
lcd.drawFilledRectangle(0, LCD_H-9, LCD_W, 9, 0)
fieldsMax = 0
@@ -429,6 +429,7 @@ end
-- Confirmation Menu
local function drawNextLine(x, y, label, channel)
lcd.drawText(x, y, label, 0);
lcd.drawText(x+26, y, ":", 0);
lcd.drawSource(x+30, y, MIXSRC_CH1+channel, 0)
y = y + 8
if y > 50 then
@@ -502,8 +503,8 @@ local function applySettings()
if aileronsMode == 1 then
addMix(ailCH1, MIXSRC_FIRST_INPUT+defaultChannel(3), "Ail")
elseif aileronsMode == 2 then
addMix(ailCH1, MIXSRC_FIRST_INPUT+defaultChannel(3), "AilL")
addMix(ailCH2, MIXSRC_FIRST_INPUT+defaultChannel(3), "AilR", -100)
addMix(ailCH1, MIXSRC_FIRST_INPUT+defaultChannel(3), "AilL", -100)
addMix(ailCH2, MIXSRC_FIRST_INPUT+defaultChannel(3), "AilR")
end
if flapsMode == 1 then
addMix(flapsCH1, MIXSRC_SA, "Flap")
@@ -519,9 +520,9 @@ local function applySettings()
end
if tailMode == 3 then
addMix(eleCH1, MIXSRC_FIRST_INPUT+defaultChannel(1), "V-EleL", 50)
addMix(eleCH1, MIXSRC_FIRST_INPUT+defaultChannel(0), "V-RudL", 50, 1)
addMix(eleCH1, MIXSRC_FIRST_INPUT+defaultChannel(0), "V-RudL", -50, 1)
addMix(eleCH2, MIXSRC_FIRST_INPUT+defaultChannel(1), "V-EleR", 50)
addMix(eleCH2, MIXSRC_FIRST_INPUT+defaultChannel(0), "V-RudR", -50, 1)
addMix(eleCH2, MIXSRC_FIRST_INPUT+defaultChannel(0), "V-RudR", 50, 1)
else
if tailMode > 0 then
addMix(rudCH1, MIXSRC_FIRST_INPUT+defaultChannel(0), "Rudder")