1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-19 14:25:11 +03:00

Wizard Tail configuration page added

This commit is contained in:
bsongis 2014-05-26 11:15:18 +02:00
parent d82dc54d05
commit e370b32203
9 changed files with 75 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

BIN
radio/wizard/tail-e.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
radio/wizard/tail-eer.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
radio/wizard/tail-er.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
radio/wizard/tail-v.bmp Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

@ -10,6 +10,7 @@ local ENGINE_MENU = PLANE_MENU
local AILERONS_MENU = PLANE_MENU+1
local FLAPERONS_MENU = PLANE_MENU+2
local BRAKES_MENU = PLANE_MENU+3
local TAIL_MENU = PLANE_MENU+4
local page = MODELTYPE_MENU
local dirty = true
@ -27,8 +28,12 @@ local flaperonsMode = 0
local flaperonsCH1 = 5
local flaperonsCH2 = 6
local brakesMode = 0
local brakesCH1 = 7
local brakesCH2 = 8
local brakesCH1 = 8
local brakesCH2 = 9
local tailMode = 0
local eleCH1 = 0
local eleCH2 = 7
local rudCH1 = 0
-- Common functions
@ -107,10 +112,12 @@ end
-- Init function
local function init()
for stick = 0, 4, 1 do
for stick = 0, 3, 1 do
local index = channelOrder(stick);
if index == 0 then
rudCH1 = stick
elseif index == 1 then
eleCH1 = stick
elseif index == 2 then
engineCH1 = stick
else
@ -344,6 +351,69 @@ local function brakesMenu(event)
end
end
-- Tail Menu
local tailModeItems = {"Ele(1ch), no Rud...", "Ele(1ch) + Rud...", "Ele(2ch) + Rud...", "V-Tail..."}
local function drawTailMenu()
lcd.clear()
lcd.drawText(1, 0, "Which is the tail config on your model?", 0)
lcd.drawRect(0, 0, LCD_W, 8, GREY_DEFAULT+FILL_WHITE)
lcd.drawCombobox(0, 8, LCD_W/2, tailModeItems, tailMode, getFieldFlags(0))
lcd.drawLine(LCD_W/2-1, 18, LCD_W/2-1, LCD_H, DOTTED, 0)
lcd.drawText(LCD_W/2-19, LCD_H-8, ">>>", 0);
if tailMode == 0 then
-- Elevator(1ch), no rudder...
lcd.drawPixmap(112, 8, "/TEMPLATES/tail-e.bmp")
lcd.drawText(25, LCD_H-16, "Assign channel", 0);
lcd.drawSource(175, 30, SOURCE_FIRST_CH+eleCH1, getFieldFlags(1))
fieldsMax = 1
elseif tailMode == 1 then
-- Elevator(1ch) + rudder...
lcd.drawPixmap(112, 8, "/TEMPLATES/tail-er.bmp")
lcd.drawText(20, LCD_H-16, "Assign channels", 0);
lcd.drawSource(175, 30, SOURCE_FIRST_CH+eleCH1, getFieldFlags(1))
lcd.drawSource(175, 10, SOURCE_FIRST_CH+rudCH1, getFieldFlags(2))
fieldsMax = 2
elseif tailMode == 2 then
-- Elevator(2ch) + rudder...
lcd.drawPixmap(112, 8, "/TEMPLATES/tail-eer.bmp")
lcd.drawText(20, LCD_H-16, "Assign channels", 0);
lcd.drawSource(175, 30, SOURCE_FIRST_CH+eleCH1, getFieldFlags(1))
lcd.drawSource(175, 20, SOURCE_FIRST_CH+eleCH2, getFieldFlags(2))
lcd.drawSource(175, 10, SOURCE_FIRST_CH+rudCH1, getFieldFlags(3))
fieldsMax = 3
else
-- V-Tail...
lcd.drawPixmap(112, 8, "/TEMPLATES/tail-v.bmp")
lcd.drawText(20, LCD_H-16, "Assign channels", 0);
lcd.drawSource(175, 20, SOURCE_FIRST_CH+eleCH1, getFieldFlags(1))
lcd.drawSource(175, 10, SOURCE_FIRST_CH+eleCH2, getFieldFlags(2))
fieldsMax = 2
end
end
local function tailMenu(event)
if dirty then
dirty = false
drawTailMenu()
end
navigate(event, fieldsMax, page-1, page+1)
if edit then
if field==0 then
tailMode = keyIncDec(event, tailMode, 3)
elseif field==1 then
eleCH1 = keyIncDec(event, eleCH1, 7, true)
elseif (field==2 and tailMode==1) or field==3 then
rudCH1 = keyIncDec(event, rudCH1, 7, true)
elseif field==2 then
eleCH2 = keyIncDec(event, eleCH2, 7, true)
end
end
end
-- Main
local function run(event)
@ -361,6 +431,8 @@ local function run(event)
flaperonsMenu(event)
elseif page == BRAKES_MENU then
brakesMenu(event)
elseif page == TAIL_MENU then
tailMenu(event)
end
return 0
end