diff --git a/radio/wizard/delta.bmp b/radio/wizard/delta.bmp new file mode 100755 index 000000000..25beb3bd1 Binary files /dev/null and b/radio/wizard/delta.bmp differ diff --git a/radio/wizard/heli.bmp b/radio/wizard/heli.bmp new file mode 100755 index 000000000..021f5484d Binary files /dev/null and b/radio/wizard/heli.bmp differ diff --git a/radio/tx_wiz_images/aaa_layout.png b/radio/wizard/images/aaa_layout.png similarity index 100% rename from radio/tx_wiz_images/aaa_layout.png rename to radio/wizard/images/aaa_layout.png diff --git a/radio/tx_wiz_images/ail_d.png b/radio/wizard/images/ail_d.png similarity index 100% rename from radio/tx_wiz_images/ail_d.png rename to radio/wizard/images/ail_d.png diff --git a/radio/tx_wiz_images/ail_n.png b/radio/wizard/images/ail_n.png similarity index 100% rename from radio/tx_wiz_images/ail_n.png rename to radio/wizard/images/ail_n.png diff --git a/radio/tx_wiz_images/ail_s.png b/radio/wizard/images/ail_s.png similarity index 100% rename from radio/tx_wiz_images/ail_s.png rename to radio/wizard/images/ail_s.png diff --git a/radio/tx_wiz_images/brk_d.png b/radio/wizard/images/brk_d.png similarity index 100% rename from radio/tx_wiz_images/brk_d.png rename to radio/wizard/images/brk_d.png diff --git a/radio/tx_wiz_images/brk_s.png b/radio/wizard/images/brk_s.png similarity index 100% rename from radio/tx_wiz_images/brk_s.png rename to radio/wizard/images/brk_s.png diff --git a/radio/tx_wiz_images/delta_d.png b/radio/wizard/images/delta_d.png similarity index 100% rename from radio/tx_wiz_images/delta_d.png rename to radio/wizard/images/delta_d.png diff --git a/radio/tx_wiz_images/delta_r.png b/radio/wizard/images/delta_r.png similarity index 100% rename from radio/tx_wiz_images/delta_r.png rename to radio/wizard/images/delta_r.png diff --git a/radio/tx_wiz_images/delta_rn.png b/radio/wizard/images/delta_rn.png similarity index 100% rename from radio/tx_wiz_images/delta_rn.png rename to radio/wizard/images/delta_rn.png diff --git a/radio/tx_wiz_images/delta_s.png b/radio/wizard/images/delta_s.png similarity index 100% rename from radio/tx_wiz_images/delta_s.png rename to radio/wizard/images/delta_s.png diff --git a/radio/tx_wiz_images/engine.png b/radio/wizard/images/engine.png similarity index 100% rename from radio/tx_wiz_images/engine.png rename to radio/wizard/images/engine.png diff --git a/radio/tx_wiz_images/engine_n.png b/radio/wizard/images/engine_n.png similarity index 100% rename from radio/tx_wiz_images/engine_n.png rename to radio/wizard/images/engine_n.png diff --git a/radio/tx_wiz_images/flp_d.png b/radio/wizard/images/flp_d.png similarity index 100% rename from radio/tx_wiz_images/flp_d.png rename to radio/wizard/images/flp_d.png diff --git a/radio/tx_wiz_images/flp_s.png b/radio/wizard/images/flp_s.png similarity index 100% rename from radio/tx_wiz_images/flp_s.png rename to radio/wizard/images/flp_s.png diff --git a/radio/tx_wiz_images/intro.png b/radio/wizard/images/intro.png similarity index 100% rename from radio/tx_wiz_images/intro.png rename to radio/wizard/images/intro.png diff --git a/radio/tx_wiz_images/model_type.png b/radio/wizard/images/model_type.png similarity index 100% rename from radio/tx_wiz_images/model_type.png rename to radio/wizard/images/model_type.png diff --git a/radio/tx_wiz_images/select_controls.png b/radio/wizard/images/select_controls.png similarity index 100% rename from radio/tx_wiz_images/select_controls.png rename to radio/wizard/images/select_controls.png diff --git a/radio/tx_wiz_images/servoset.png b/radio/wizard/images/servoset.png similarity index 100% rename from radio/tx_wiz_images/servoset.png rename to radio/wizard/images/servoset.png diff --git a/radio/tx_wiz_images/tail_e.png b/radio/wizard/images/tail_e.png similarity index 100% rename from radio/tx_wiz_images/tail_e.png rename to radio/wizard/images/tail_e.png diff --git a/radio/tx_wiz_images/tail_eer.png b/radio/wizard/images/tail_eer.png similarity index 100% rename from radio/tx_wiz_images/tail_eer.png rename to radio/wizard/images/tail_eer.png diff --git a/radio/tx_wiz_images/tail_er.png b/radio/wizard/images/tail_er.png similarity index 100% rename from radio/tx_wiz_images/tail_er.png rename to radio/wizard/images/tail_er.png diff --git a/radio/tx_wiz_images/tail_v.png b/radio/wizard/images/tail_v.png similarity index 100% rename from radio/tx_wiz_images/tail_v.png rename to radio/wizard/images/tail_v.png diff --git a/radio/wizard/mark.bmp b/radio/wizard/mark.bmp new file mode 100755 index 000000000..36db721c6 Binary files /dev/null and b/radio/wizard/mark.bmp differ diff --git a/radio/wizard/plane.bmp b/radio/wizard/plane.bmp new file mode 100755 index 000000000..dde0e10be Binary files /dev/null and b/radio/wizard/plane.bmp differ diff --git a/radio/wizard/quadri.bmp b/radio/wizard/quadri.bmp new file mode 100755 index 000000000..93c80ad8c Binary files /dev/null and b/radio/wizard/quadri.bmp differ diff --git a/radio/wizard/wizard.lua b/radio/wizard/wizard.lua new file mode 100755 index 000000000..95641fa78 --- /dev/null +++ b/radio/wizard/wizard.lua @@ -0,0 +1,82 @@ + +-- Wizard states +local TEMPLATE_CHOICE_INIT = 0 +local TEMPLATE_CHOICE_RUN = 1 +local TEMPLATE_NEXT = 2 + +local state = TEMPLATE_CHOICE_INIT +local choice = 0 + +local function choiceSurround(index) + lcd.drawRectangle(12+47*index, 13, 48, 48) + lcd.drawPixmap(17+47*index, 8, "/TEMPLATES/mark.bmp") +end + +local function drawTemplateChoice() + lcd.clear() + lcd.drawScreenTitle("", 0, 0) + -- lcd.drawText(58, 13, "Select model type", 0) + lcd.drawPixmap( 16, 17, "/TEMPLATES/plane.bmp") + lcd.drawPixmap( 63, 17, "/TEMPLATES/heli.bmp") + lcd.drawPixmap(110, 17, "/TEMPLATES/delta.bmp") + lcd.drawPixmap(157, 17, "/TEMPLATES/quadri.bmp") + choiceSurround(choice) +end + +local function templateChoiceRun(event) + nextchoice = choice + if event == EVT_ENTER_BREAK then + state = 2 + elseif event == EVT_PLUS_BREAK then + nextchoice = (nextchoice + 1) + elseif event == EVT_MINUS_BREAK then + nextchoice = (nextchoice + 3) + end + nextchoice = nextchoice % 4 + if nextchoice ~= choice then + choice = nextchoice + drawTemplateChoice() + end +end + +local function drawWing(x, y) + lcd.drawLine(x+1, y+1, x+54, y) + lcd.drawLine(x+1, y, x+1, y+16) + lcd.drawLine(x, y+17, x+54, y+27) + lcd.drawLine(x+1, y+11, x+33, y+17) + lcd.drawLine(x+34, y+16, x+34, y+22) + MIRROR = 128 + lcd.drawRectangle(x+55, y-8, 15, 39) + lcd.drawLine(x+MIRROR-5, y+1, x+MIRROR-58, y) + lcd.drawLine(x+MIRROR-5, y, x+MIRROR-5, y+16) + lcd.drawLine(x+MIRROR-4, y+17, x+MIRROR-58, y+27) + lcd.drawLine(x+MIRROR-5, y+11, x+MIRROR-37, y+17) + lcd.drawLine(x+MIRROR-38, y+16, x+MIRROR-38, y+22) +end + + +local function run(event) + if event == EVT_EXIT_BREAK then + return 2 + end + lcd.lock() + if state == TEMPLATE_CHOICE_INIT then + drawTemplateChoice() + state = TEMPLATE_CHOICE_RUN + elseif state == TEMPLATE_CHOICE_RUN then + templateChoiceRun(event) + elseif state == 2 then + state = 3 + lcd.clear() + lcd.drawText(68, 13, "Wing config", 0) + lcd.drawScreenTitle("MODEL SETUP WIZARD", 2, 3) + drawWing(2, 33) + lcd.drawText(140, 30, "Ail", 0) + lcd.drawText(175, 30, "50%", INVERS) + lcd.drawText(140, 42, "Flp", 0) + lcd.drawText(175, 42, "30%", 0) + end + return 0 +end + +return { run=run }