From c6aff456381c12c129f732156ec1891280f2774f Mon Sep 17 00:00:00 2001 From: bsongis Date: Wed, 21 May 2014 23:23:41 +0200 Subject: [PATCH] Taranis Wizard... first page done! All these files must be copied in a TEMPLATES directory on the SD --- radio/wizard/delta.bmp | Bin 0 -> 1002 bytes radio/wizard/heli.bmp | Bin 0 -> 1002 bytes .../images}/aaa_layout.png | Bin .../images}/ail_d.png | Bin .../images}/ail_n.png | Bin .../images}/ail_s.png | Bin .../images}/brk_d.png | Bin .../images}/brk_s.png | Bin .../images}/delta_d.png | Bin .../images}/delta_r.png | Bin .../images}/delta_rn.png | Bin .../images}/delta_s.png | Bin .../images}/engine.png | Bin .../images}/engine_n.png | Bin .../images}/flp_d.png | Bin .../images}/flp_s.png | Bin .../images}/intro.png | Bin .../images}/model_type.png | Bin .../images}/select_controls.png | Bin .../images}/servoset.png | Bin .../images}/tail_e.png | Bin .../images}/tail_eer.png | Bin .../images}/tail_er.png | Bin .../images}/tail_v.png | Bin radio/wizard/mark.bmp | Bin 0 -> 266 bytes radio/wizard/plane.bmp | Bin 0 -> 1002 bytes radio/wizard/quadri.bmp | Bin 0 -> 1002 bytes radio/wizard/wizard.lua | 82 ++++++++++++++++++ 28 files changed, 82 insertions(+) create mode 100755 radio/wizard/delta.bmp create mode 100755 radio/wizard/heli.bmp rename radio/{tx_wiz_images => wizard/images}/aaa_layout.png (100%) rename radio/{tx_wiz_images => wizard/images}/ail_d.png (100%) rename radio/{tx_wiz_images => wizard/images}/ail_n.png (100%) rename radio/{tx_wiz_images => wizard/images}/ail_s.png (100%) rename radio/{tx_wiz_images => wizard/images}/brk_d.png (100%) rename radio/{tx_wiz_images => wizard/images}/brk_s.png (100%) rename radio/{tx_wiz_images => wizard/images}/delta_d.png (100%) rename radio/{tx_wiz_images => wizard/images}/delta_r.png (100%) rename radio/{tx_wiz_images => wizard/images}/delta_rn.png (100%) rename radio/{tx_wiz_images => wizard/images}/delta_s.png (100%) rename radio/{tx_wiz_images => wizard/images}/engine.png (100%) rename radio/{tx_wiz_images => wizard/images}/engine_n.png (100%) rename radio/{tx_wiz_images => wizard/images}/flp_d.png (100%) rename radio/{tx_wiz_images => wizard/images}/flp_s.png (100%) rename radio/{tx_wiz_images => wizard/images}/intro.png (100%) rename radio/{tx_wiz_images => wizard/images}/model_type.png (100%) rename radio/{tx_wiz_images => wizard/images}/select_controls.png (100%) rename radio/{tx_wiz_images => wizard/images}/servoset.png (100%) rename radio/{tx_wiz_images => wizard/images}/tail_e.png (100%) rename radio/{tx_wiz_images => wizard/images}/tail_eer.png (100%) rename radio/{tx_wiz_images => wizard/images}/tail_er.png (100%) rename radio/{tx_wiz_images => wizard/images}/tail_v.png (100%) create mode 100755 radio/wizard/mark.bmp create mode 100755 radio/wizard/plane.bmp create mode 100755 radio/wizard/quadri.bmp create mode 100755 radio/wizard/wizard.lua diff --git a/radio/wizard/delta.bmp b/radio/wizard/delta.bmp new file mode 100755 index 0000000000000000000000000000000000000000..25beb3bd1ce07e12d554434a0597dcc802115522 GIT binary patch literal 1002 zcmdT=p$@_@5WUL?31D_vunQP6%`|2Pg#eA-4`8wA>HP^B$q(=kpvmNTy>>~P4G))H zyS~2n?s~=U8Ii^v>lvB3WEv^Hz2bZsgJM1#e|0Z~Mtl-MW2&_v+aVg9on=1YmpxG;)fXz)@@U7Z7l#c11l dxXEFQ!Lf!$giy}XC^f9QJAK8%o~-Ei*AGS{B!mC} literal 0 HcmV?d00001 diff --git a/radio/wizard/heli.bmp b/radio/wizard/heli.bmp new file mode 100755 index 0000000000000000000000000000000000000000..021f5484d851e96eb97570fe72c326fe9c28baaa GIT binary patch literal 1002 zcmb`EElvbM5QVFjBgp7zpL7h8>yR0~o|h8CozKtm{wh$~uh%!e@qb0Odbs6;KABo}Qpg+1}8 z2+0lkAvX+`sjGD4e+XWXi(ss>R-+HWTUMDH)=18uW}1V`Jg8v@|s!W}7*4CZ{deb!Ls2ej~6}C;>4YS%iV%`}gk*|NjHcCIbix f3NQ)^GBCg}$e|#w0foQ>*xgXSf`pX706_x)ahn|K literal 0 HcmV?d00001 diff --git a/radio/wizard/plane.bmp b/radio/wizard/plane.bmp new file mode 100755 index 0000000000000000000000000000000000000000..dde0e10be7fc5205fa4b277f24380d58b46e87c6 GIT binary patch literal 1002 zcmchUp-#j=5Qb-Sgak0%T(B2{Ak|c3&Y%#W(R~3d7Ja&JavI4C@D89!Wtsn<>Fyjw zpxAWV-G9INXJ)&-`&bFbo4%iQwmy>_QNPgh^_k5^6-<$7ez@7*K0NJSzuNo#=6v(= znYyl9_kDk*^LQABlbh4`Rr|QRW~jf+Jt`vOILb7s_kWJ`OR{WT#*>tD+;W}MLQBn( zQ_TJHya1+J)=`XorTc8BBEXm;fWT;1L1LDofWSg^2qG3Vu*AGN^yH?V!aGJi7{28P zAV$>0z+k7R1|DeHz!<7mL@;Vv8^NIQ-dJN5ty82fnsrLYl9-q>NaP@}OSGCAnKi=@ prKoZ4hE4sGi)!s>%{CS(bSouLq}!oH?1#jAbC>!FJy!8gt8W6!D(nCN literal 0 HcmV?d00001 diff --git a/radio/wizard/quadri.bmp b/radio/wizard/quadri.bmp new file mode 100755 index 0000000000000000000000000000000000000000..93c80ad8cd1999e5f4b8e51400540a8f04eb6758 GIT binary patch literal 1002 zcmd5(AyNZD5S*=0Q~_p}6gGvTPIDR)gF=8t-v_W*boBis8p#LphoGsGM|aQc)m;>l zt;}wwx2LD)cKdW(nbsHfcSIAB>`eGA?$=iy83@B{tUo2&$CtO==TGyz-`s3IzEj(_ z>#pnW5a)g0Up!nMR?X|~UZt_Q`W!JEhQY=W+W&kNtP_igSn-cjuSf!3Q=Ouu1%@o) zZc!{owlo(c2I8Wa2{@-%0&#(b`h>}*s@~q&008p$Ldw@%{Vp#)b_CS@!qCIe+30jyX78I0ffN04w>dPRFsg^^O zqAdp<K) literal 0 HcmV?d00001 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 }