diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/icon.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/icon.png old mode 100644 new mode 100755 diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/background.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/background.png new file mode 100755 index 000000000..e21f7bc81 Binary files /dev/null and b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/background.png differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_ail0.gif b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_ail0.gif deleted file mode 100644 index ed4479420..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_ail0.gif and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_ail1.gif b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_ail1.gif deleted file mode 100644 index 5e013c91a..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_ail1.gif and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_ail2.gif b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_ail2.gif deleted file mode 100644 index ae94e144c..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_ail2.gif and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_engine.gif b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_engine.gif deleted file mode 100644 index be2126899..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_engine.gif and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_flaps0.gif b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_flaps0.gif deleted file mode 100644 index ed4479420..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_flaps0.gif and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_flaps1.gif b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_flaps1.gif deleted file mode 100644 index fa92f4b43..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_flaps1.gif and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_flaps2.gif b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_flaps2.gif deleted file mode 100644 index cfa0745c3..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_flaps2.gif and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_sum.gif b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_sum.gif deleted file mode 100644 index 942195343..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_sum.gif and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_tail0.gif b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_tail0.gif deleted file mode 100644 index 5e860ea49..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_tail0.gif and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_tail1.gif b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_tail1.gif deleted file mode 100644 index dd8df3c52..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_tail1.gif and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_tail2.gif b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_tail2.gif deleted file mode 100644 index 93e17b93c..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_tail2.gif and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_tail3.gif b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_tail3.gif deleted file mode 100644 index b4ef88fb4..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/bg_tail3.gif and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/eng_comb.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/eng_comb.png new file mode 100755 index 000000000..e865b54ad Binary files /dev/null and b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/eng_comb.png differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/eng_electric.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/eng_electric.png new file mode 100755 index 000000000..73f9db4cb Binary files /dev/null and b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/eng_electric.png differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/flap.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/flap.png new file mode 100755 index 000000000..82a844891 Binary files /dev/null and b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/flap.png differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/lail.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/lail.png new file mode 100755 index 000000000..00cff0cf6 Binary files /dev/null and b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/lail.png differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/mark_bg.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/mark_bg.png new file mode 100755 index 000000000..fbe6b0ee2 Binary files /dev/null and b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/mark_bg.png differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/pagedn.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/pagedn.png new file mode 100755 index 000000000..0733ccfa1 Binary files /dev/null and b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/pagedn.png differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/pageup.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/pageup.png new file mode 100755 index 000000000..0dbaa5202 Binary files /dev/null and b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/pageup.png differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/plane.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/plane.png new file mode 100755 index 000000000..ab4dafe52 Binary files /dev/null and b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/plane.png differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/rail.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/rail.png new file mode 100755 index 000000000..e2f80ffe2 Binary files /dev/null and b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/rail.png differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/summary.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/summary.png new file mode 100755 index 000000000..8b23b0b42 Binary files /dev/null and b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/summary.png differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/tail.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/tail.png new file mode 100755 index 000000000..db3f29bcd Binary files /dev/null and b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/tail.png differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/tailrud.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/tailrud.png new file mode 100755 index 000000000..d42a7244e Binary files /dev/null and b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/tailrud.png differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/vtail.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/vtail.png new file mode 100755 index 000000000..fae86aae4 Binary files /dev/null and b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/vtail.png differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/wizard.lua b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/wizard.lua old mode 100644 new mode 100755 index 61bb5c4d6..c1bada6f0 --- a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/wizard.lua +++ b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/wizard.lua @@ -6,20 +6,14 @@ local page = 1 local current = 1 local pages = {} local fields = {} -local AilCfgBg = {} -local FlapsCfgBg = {} -local TailCfgBg = {} -local SummaryBackground --- Release memory -local function clean() - print("FREE MEMORY CALLED") - MotorConfigBackground = nil - AilCfgBg = nil - FlapsCfgBg = nil - TailCfgBg = nil - SummaryBackground = nil -end +-- load common Bitmaps +local ImgMarkBg = Bitmap.open("img/mark_bg.png") +local BackgroundImg = Bitmap.open("img/background.png") +local ImgPlane = Bitmap.open("img/plane.png") +local ImgPageUp = Bitmap.open("img/pageup.png") +local ImgPageDn = Bitmap.open("img/pagedn.png") + -- Change display attribute to current field local function addField(step) @@ -117,22 +111,31 @@ local function setFieldsVisible(...) end end --- on demand load of bitmaps -local function loadIndexedBitmap(bitmap, index, name) - if bitmap[index] == nil then - bitmap[index] = Bitmap.open(name..index..".gif") - end +-- draws one letter mark +local function drawMark(x, y, name) + lcd.drawBitmap(ImgMarkBg, x, y) + lcd.drawText(x+8, y+3, name, TEXT_COLOR) end -local MotorConfigBackground = Bitmap.open("img/bg_engine.gif") + local MotorFields = { {50, 50, COMBO, 1, 1, { "No", "Yes"} }, {50, 127, COMBO, 1, 2, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, } +local ImgEngineEl +local ImgEngineCom + local function runMotorConfig(event) lcd.clear() - lcd.drawBitmap(MotorConfigBackground, 0, 0) + if ImgEngineEl == nil then + ImgEngineEl = Bitmap.open("img/eng_electric.png") + ImgEngineCom = Bitmap.open("img/eng_comb.png") + end + lcd.drawBitmap(BackgroundImg, 0, 0) + lcd.drawBitmap(ImgPageDn, 455, 95) + lcd.drawBitmap(ImgEngineEl, 310, 50) + lcd.drawBitmap(ImgEngineCom, 180, 150) lcd.setColor(CUSTOM_COLOR, lcd.RGB(255, 255, 255)) fields = MotorFields lcd.drawText(40, 20, "Does your model have a motor ?", TEXT_COLOR) @@ -143,7 +146,6 @@ local function runMotorConfig(event) lcd.drawFilledRectangle(40, 122, 100, 30, CUSTOM_COLOR) fields[2][4]=1 end - loadIndexedBitmap(AilCfgBg, 2, "img/bg_ail") local result = runFieldsPage(event) return result end @@ -156,28 +158,43 @@ local AilFields = { {50, 167, COMBO, 1, 4, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, -- Ail2 chan } +local ImgAilR +local ImgAilL + local function runAilConfig(event) lcd.clear() + if ImgAilR == nil then + ImgAilR = Bitmap.open("img/rail.png") + ImgAilL = Bitmap.open("img/lail.png") + end + lcd.drawBitmap(BackgroundImg, 0, 0) + lcd.drawBitmap(ImgPageUp, 0, 95) + lcd.drawBitmap(ImgPageDn, 455, 95) + lcd.drawBitmap(ImgPlane, 252, 100) fields = AilFields if fields[1][5] == 1 then - loadIndexedBitmap(AilCfgBg, 1, "img/bg_ail") - lcd.drawBitmap(AilCfgBg[1], 0, 0) + lcd.drawBitmap(ImgAilR, 324, 123) + lcd.drawBitmap(ImgAilL, 275, 210) + drawMark(362, 132, "A") + drawMark(302, 227, "A") lcd.drawFilledRectangle(40, 122, 100, 30, CUSTOM_COLOR) + drawMark(152, 124, "A") setFieldsVisible(1, 0) elseif fields[1][5] == 2 then - loadIndexedBitmap(AilCfgBg, 2, "img/bg_ail") - lcd.drawBitmap(AilCfgBg[2], 0, 0) + lcd.drawBitmap(ImgAilR, 324, 123) + lcd.drawBitmap(ImgAilL, 275, 210) + drawMark(362, 132, "A") + drawMark(302, 227, "B") lcd.drawFilledRectangle(40, 122, 100, 30, CUSTOM_COLOR) + drawMark(152, 124, "A") lcd.drawFilledRectangle(40, 162, 100, 30, CUSTOM_COLOR) + drawMark(152, 164, "B") setFieldsVisible(1, 1) else - loadIndexedBitmap(AilCfgBg, 0, "img/bg_ail") - lcd.drawBitmap(AilCfgBg[0], 0, 0) setFieldsVisible(0, 0) end lcd.drawText(40, 20, "Number of ailerons on your model ?", TEXT_COLOR) lcd.drawFilledRectangle(40, 45, 400, 30, CUSTOM_COLOR) - loadIndexedBitmap(FlapsCfgBg, 1, "img/bg_flaps") local result = runFieldsPage(event) return result end @@ -188,28 +205,41 @@ local FlapsFields = { {50, 167, COMBO, 1, 7, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, } +local ImgFlp + local function runFlapsConfig(event) lcd.clear() + if ImgFlp == nil then + ImgFlp = Bitmap.open("img/flap.png") + end + lcd.drawBitmap(BackgroundImg, 0, 0) + lcd.drawBitmap(ImgPageUp, 0, 95) + lcd.drawBitmap(ImgPageDn, 455, 95) + lcd.drawBitmap(ImgPlane, 252, 100) fields = FlapsFields if fields[1][5] == 1 then - loadIndexedBitmap(FlapsCfgBg, 1, "img/bg_flaps") - lcd.drawBitmap(FlapsCfgBg[1], 0, 0) + lcd.drawBitmap(ImgFlp, 315, 143) + lcd.drawBitmap(ImgFlp, 285, 191) + drawMark(362, 132, "A") + drawMark(302, 227, "A") lcd.drawFilledRectangle(40, 122, 100, 30, CUSTOM_COLOR) + drawMark(152, 124, "A") setFieldsVisible(1, 0) elseif fields[1][5] == 2 then - loadIndexedBitmap(FlapsCfgBg, 2, "img/bg_flaps") - lcd.drawBitmap(FlapsCfgBg[2], 0, 0) + lcd.drawBitmap(ImgFlp, 315, 143) + lcd.drawBitmap(ImgFlp, 285, 191) + drawMark(362, 132, "A") + drawMark(302, 227, "B") lcd.drawFilledRectangle(40, 122, 100, 30, CUSTOM_COLOR) + drawMark(152, 124, "A") lcd.drawFilledRectangle(40, 162, 100, 30, CUSTOM_COLOR) + drawMark(152, 164, "B") setFieldsVisible(1, 1) else - loadIndexedBitmap(FlapsCfgBg, 0, "img/bg_flaps") - lcd.drawBitmap(FlapsCfgBg[0], 0, 0) setFieldsVisible(0, 0) end lcd.drawText(40, 20, "Does your model have flaps ?", TEXT_COLOR) lcd.drawFilledRectangle(40, 45, 400, 30, CUSTOM_COLOR) - loadIndexedBitmap(TailCfgBg, 1, "img/bg_tail") local result = runFieldsPage(event) return result end @@ -221,42 +251,67 @@ local TailFields = { {50, 207, COMBO, 0, 5, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, --ele2 } +local ImgTail +local ImgVTail +local ImgTailRud + local function runTailConfig(event) lcd.clear() + if ImgTail == nil then + ImgTail = Bitmap.open("img/tail.png") + ImgVTail = Bitmap.open("img/vtail.png") + ImgTailRud = Bitmap.open("img/tailrud.png") + end + lcd.drawBitmap(BackgroundImg, 0, 0) + lcd.drawBitmap(ImgPageUp, 0, 95) + lcd.drawBitmap(ImgPageDn, 455, 95) fields = TailFields if fields[1][5] == 0 then - loadIndexedBitmap(TailCfgBg, 0, "img/bg_tail") - lcd.drawBitmap(TailCfgBg[0], 0, 0) + lcd.drawBitmap(ImgTail, 252, 100) + drawMark(275, 120, "A") + drawMark(390, 155, "A") lcd.drawFilledRectangle(40, 122, 100, 30, CUSTOM_COLOR) + drawMark(152, 124, "A") setFieldsVisible(1, 0, 0) end if fields[1][5] == 1 then - loadIndexedBitmap(TailCfgBg, 1, "img/bg_tail") - lcd.drawBitmap(TailCfgBg[1], 0, 0) + lcd.drawBitmap(ImgTail, 252, 100) + lcd.drawBitmap(ImgTailRud, 340, 100) + drawMark(275, 120, "A") + drawMark(390, 155, "A") + drawMark(370, 112, "B") lcd.drawFilledRectangle(40, 122, 100, 30, CUSTOM_COLOR) + drawMark(152, 124, "A") lcd.drawFilledRectangle(40, 162, 100, 30, CUSTOM_COLOR) + drawMark(152, 164, "B") setFieldsVisible(1, 1, 0) end if fields[1][5] == 2 then - loadIndexedBitmap(TailCfgBg, 2, "img/bg_tail") - lcd.drawBitmap(TailCfgBg[2], 0, 0) + lcd.drawBitmap(ImgTail, 252, 100) + lcd.drawBitmap(ImgTailRud, 340, 100) + drawMark(275, 120, "A") + drawMark(390, 155, "C") + drawMark(370, 112, "B") lcd.drawFilledRectangle(40, 122, 100, 30, CUSTOM_COLOR) + drawMark(152, 124, "A") lcd.drawFilledRectangle(40, 162, 100, 30, CUSTOM_COLOR) + drawMark(152, 164, "B") lcd.drawFilledRectangle(40, 202, 100, 30, CUSTOM_COLOR) + drawMark(152, 204, "C") setFieldsVisible(1, 1, 1) end if fields[1][5] == 3 then - loadIndexedBitmap(TailCfgBg, 3, "img/bg_tail") - lcd.drawBitmap(TailCfgBg[3], 0, 0) + lcd.drawBitmap(ImgVTail, 252, 100) + drawMark(315, 110, "A") + drawMark(382, 120, "B") lcd.drawFilledRectangle(40, 122, 100, 30, CUSTOM_COLOR) + drawMark(152, 124, "A") lcd.drawFilledRectangle(40, 162, 100, 30, CUSTOM_COLOR) + drawMark(152, 164, "B") setFieldsVisible(1, 1, 0) end lcd.drawText(40, 20, "Pick the tail config of your model", TEXT_COLOR) lcd.drawFilledRectangle(40, 45, 400, 30, CUSTOM_COLOR) - if SummaryBackground == nil then - SummaryBackground = Bitmap.open("img/bg_sum.gif") - end local result = runFieldsPage(event) return result end @@ -272,10 +327,17 @@ local ConfigSummaryFields = { {110, 250, COMBO, 1, 0, { "No, I need to change something", "Yes, all is well, create the plane !"} }, } +local ImgSummary + local function runConfigSummary(event) lcd.clear() + if ImgSummary == nil then + ImgSummary = Bitmap.open("img/summary.png") + end fields = ConfigSummaryFields - lcd.drawBitmap(SummaryBackground, 0, 0) + lcd.drawBitmap(BackgroundImg, 0, 0) + lcd.drawBitmap(ImgPageUp, 0, 95) + lcd.drawBitmap(ImgSummary, 300, 60) lineIndex = 40 -- motors if(MotorFields[1][5] == 1) then @@ -332,7 +394,8 @@ end local function createModel(event) lcd.clear() - lcd.drawBitmap(SummaryBackground, 0, 0) + lcd.drawBitmap(BackgroundImg, 0, 0) + lcd.drawBitmap(ImgSummary, 300, 60) model.defaultInputs() model.deleteMixes() -- motor @@ -372,8 +435,8 @@ local function createModel(event) addMix(TailFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "VTailE", 50) addMix(TailFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(0), "VTailR", -50, 1) end - lcd.drawText(70, 140, "Model successfully created !", TEXT_COLOR) - lcd.drawText(100, 180, "Press RTN to exit", TEXT_COLOR) + lcd.drawText(70, 90, "Model successfully created !", TEXT_COLOR) + lcd.drawText(100, 130, "Press RTN to exit", TEXT_COLOR) return 2 end