diff --git a/radio/sdcard/.gitignore b/radio/sdcard/.gitignore deleted file mode 100644 index c1b29b53e..000000000 --- a/radio/sdcard/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*/opentx.sdcard.version diff --git a/radio/sdcard/horus/FIRMWARE/readme.txt b/radio/sdcard/horus/FIRMWARE/readme.txt deleted file mode 100644 index 4ba9522c9..000000000 --- a/radio/sdcard/horus/FIRMWARE/readme.txt +++ /dev/null @@ -1,2 +0,0 @@ -You can put firmware for your modules or radio in this folder. -Files in this folder are NOT automaticaly applied. diff --git a/radio/sdcard/horus/IMAGES/readme.txt b/radio/sdcard/horus/IMAGES/readme.txt deleted file mode 100644 index a8412eabd..000000000 --- a/radio/sdcard/horus/IMAGES/readme.txt +++ /dev/null @@ -1,3 +0,0 @@ -2.2 : BMP renamed to IMAGES for consistency between Taranis and Horus. -You can put your model and other graphic files in this directory. -Format include bmp and png (including png with transparancy). diff --git a/radio/sdcard/horus/LOGS/readme.txt b/radio/sdcard/horus/LOGS/readme.txt deleted file mode 100644 index f9c005b26..000000000 --- a/radio/sdcard/horus/LOGS/readme.txt +++ /dev/null @@ -1 +0,0 @@ -Logs files created by "SD Logs" special function will be stored in this directory. diff --git a/radio/sdcard/horus/SCRIPTS/FUNCTIONS/readme.txt b/radio/sdcard/horus/SCRIPTS/FUNCTIONS/readme.txt deleted file mode 100644 index e14fc62df..000000000 --- a/radio/sdcard/horus/SCRIPTS/FUNCTIONS/readme.txt +++ /dev/null @@ -1 +0,0 @@ -This directory is for lua functions scripts. diff --git a/radio/sdcard/horus/SCRIPTS/MIXES/readme.txt b/radio/sdcard/horus/SCRIPTS/MIXES/readme.txt deleted file mode 100644 index 8a5e2e738..000000000 --- a/radio/sdcard/horus/SCRIPTS/MIXES/readme.txt +++ /dev/null @@ -1 +0,0 @@ -This directory is for lua mixer scripts. diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/CROSSFIRE/crossfire.lua b/radio/sdcard/horus/SCRIPTS/TOOLS/CROSSFIRE/crossfire.lua deleted file mode 100644 index 3b40fa82b..000000000 --- a/radio/sdcard/horus/SCRIPTS/TOOLS/CROSSFIRE/crossfire.lua +++ /dev/null @@ -1,121 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### -local devices = { } -local lineIndex = 1 -local pageOffset = 0 - -local function createDevice(id, name) - local device = { - id = id, - name = name, - timeout = 0 - } - return device -end - -local function getDevice(name) - for i=1, #devices do - if devices[i].name == name then - return devices[i] - end - end - return nil -end - -local function parseDeviceInfoMessage(data) - local id = data[2] - local name = "" - local i = 3 - while data[i] ~= 0 do - name = name .. string.char(data[i]) - i = i + 1 - end - local device = getDevice(name) - if device == nil then - device = createDevice(id, name) - devices[#devices + 1] = device - end - local time = getTime() - device.timeout = time + 3000 -- 30s - if lineIndex == 0 then - lineIndex = 1 - end -end - -local devicesRefreshTimeout = 0 -local function refreshNext() - local command, data = crossfireTelemetryPop() - if command == nil then - local time = getTime() - if time > devicesRefreshTimeout then - devicesRefreshTimeout = time + 100 -- 1s - crossfireTelemetryPush(0x28, { 0x00, 0xEA }) - end - elseif command == 0x29 then - parseDeviceInfoMessage(data) - end -end - -local function selectDevice(step) - lineIndex = 1 + ((lineIndex + step - 1 + #devices) % #devices) -end - --- Init -local function init() - lineIndex = 0 - pageOffset = 0 -end - -NoCross = { 110, LCD_H - 28, "Waiting for Crossfire devices...", DEFAULT_COLOR + INVERS + BLINK } - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_EXIT then - return 2 - elseif event == EVT_VIRTUAL_NEXT then - selectDevice(1) - elseif event == EVT_VIRTUAL_PREV then - selectDevice(-1) - end - - lcd.clear() - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5,"CROSSFIRE SETUP", MENU_COLOR) - - - if #devices == 0 then - lcd.drawText(NoCross[1],NoCross[2],NoCross[3],NoCross[4]) - else - for i=1, #devices do - local attr = (lineIndex == i and INVERS or 0) - if event == EVT_VIRTUAL_ENTER and attr == INVERS then - crossfireTelemetryPush(0x28, { devices[i].id, 0xEA }) - return "device.lua" - end - lcd.drawText(5, i*22+10, devices[i].name, attr) - end - end - - refreshNext() - - return 0 -end - -return { init=init, run=run } diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/CROSSFIRE/device.lua b/radio/sdcard/horus/SCRIPTS/TOOLS/CROSSFIRE/device.lua deleted file mode 100644 index 7ebc8ec43..000000000 --- a/radio/sdcard/horus/SCRIPTS/TOOLS/CROSSFIRE/device.lua +++ /dev/null @@ -1,528 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### -local deviceId = 0 -local deviceName = "" -local lineIndex = 0 -local pageOffset = 0 -local edit = false -local charIndex = 1 -local fieldPopup -local fieldTimeout = 0 -local fieldId = 1 -local fieldChunk = 0 -local fieldData = {} -local fields = {} - -local function getField(line) - local counter = 1 - for i = 1, #fields do - local field = fields[i] - if not field.hidden then - if counter < line then - counter = counter + 1 - else - return field - end - end - end -end - -local function initLineIndex() - lineIndex = 0 - for i = 1, #fields do - local field = getField(i) - if field and field.type ~= 11 and field.type ~= 12 and field.name ~= nil then - lineIndex = i - break - end - end -end - --- Change display attribute to current field -local function incrField(step) - local field = getField(lineIndex) - if field.type == 10 then - local byte = 32 - if charIndex <= #field.value then - byte = string.byte(field.value, charIndex) + step - end - if byte < 32 then - byte = 32 - elseif byte > 122 then - byte = 122 - end - if charIndex <= #field.value then - field.value = string.sub(field.value, 1, charIndex-1) .. string.char(byte) .. string.sub(field.value, charIndex+1) - else - field.value = field.value .. string.char(byte) - end - else - local min, max = 0, 0 - if ((field.type <= 5) or (field.type == 8)) then - min = field.min - max = field.max - step = field.step * step - elseif field.type == 9 then - min = 0 - max = #field.values - 1 - end - if (step < 0 and field.value > min) or (step > 0 and field.value < max) then - field.value = field.value + step - end - end -end - --- Select the next or previous editable field -local function selectField(step) - local newLineIndex = lineIndex - local field - repeat - newLineIndex = newLineIndex + step - if newLineIndex == 0 then - newLineIndex = #fields - elseif newLineIndex == 1 + #fields then - newLineIndex = 1 - pageOffset = 0 - end - field = getField(newLineIndex) - until newLineIndex == lineIndex or (field and field.type ~= 11 and field.name) - lineIndex = newLineIndex - if lineIndex > 11 + pageOffset then -- NOTE: increased from 7 to 11 to allow 11 lines in Horus display - pageOffset = lineIndex - 11 -- NOTE: increased from 7 to 11 to allow 11 lines in Horus display - elseif lineIndex <= pageOffset then - pageOffset = lineIndex - 1 - end -end - -local function split(str) - local t = {} - local i = 1 - for s in string.gmatch(str, "([^;]+)") do - t[i] = s - i = i + 1 - end - return t -end - -local function fieldGetString(data, offset) - local result = "" - while data[offset] ~= 0 do - result = result .. string.char(data[offset]) - offset = offset + 1 - end - offset = offset + 1 - return result, offset -end - -local function parseDeviceInfoMessage(data) - local offset - deviceId = data[2] - deviceName, offset = fieldGetString(data, 3) - local fields_count = data[offset+12] - for i=1, fields_count do - fields[i] = { name=nil } - end -end - -local function fieldGetValue(data, offset, size) - local result = 0 - for i=0, size-1 do - result = bit32.lshift(result, 8) + data[offset + i] - end - return result -end - -local function fieldUnsignedLoad(field, data, offset, size) - field.value = fieldGetValue(data, offset, size) - field.min = fieldGetValue(data, offset+size, size) - field.max = fieldGetValue(data, offset+2*size, size) - field.default = fieldGetValue(data, offset+3*size, size) - field.unit, offset = fieldGetString(data, offset+4*size) - field.step = 1 -end - -local function fieldUnsignedToSigned(field, size) - local bandval = bit32.lshift(0x80, (size-1)*8) - field.value = field.value - bit32.band(field.value, bandval) * 2 - field.min = field.min - bit32.band(field.min, bandval) * 2 - field.max = field.max - bit32.band(field.max, bandval) * 2 - field.default = field.default - bit32.band(field.default, bandval) * 2 -end - - local function fieldSignedLoad(field, data, offset, size) - fieldUnsignedLoad(field, data, offset, size) - fieldUnsignedToSigned(field, size) -end - -local function fieldIntSave(index, value, size) - local frame = { deviceId, 0xEA, index } - for i=size-1, 0, -1 do - frame[#frame + 1] = (bit32.rshift(value, 8*i) % 256) - end - crossfireTelemetryPush(0x2D, frame) -end - -local function fieldUnsignedSave(field, size) - local value = field.value - fieldIntSave(field.id, value, size) -end - -local function fieldSignedSave(field, size) - local value = field.value - if value < 0 then - value = bit32.lshift(0x100, (size-1)*8) + value - end - fieldIntSave(field.id, value, size) -end - -local function fieldIntDisplay(field, y, attr) - -- lcd.drawNumber(140, y, field.value, LEFT + attr) -- NOTE: original code getLastPos not available in Horus - -- lcd.drawText(lcd.getLastPos(), y, field.unit, attr) -- NOTE: original code getLastPos not available in Horus - lcd.drawText(140, y, field.value .. field.unit, attr) -- NOTE: Concenated fields instead of get lastPos -end - --- UINT8 -local function fieldUint8Load(field, data, offset) - fieldUnsignedLoad(field, data, offset, 1) -end - -local function fieldUint8Save(field) - fieldUnsignedSave(field, 1) -end - --- INT8 -local function fieldInt8Load(field, data, offset) - fieldSignedLoad(field, data, offset, 1) -end - -local function fieldInt8Save(field) - fieldSignedSave(field, 1) -end - --- UINT16 -local function fieldUint16Load(field, data, offset) - fieldUnsignedLoad(field, data, offset, 2) -end - -local function fieldUint16Save(field) - fieldUnsignedSave(field, 2) -end - --- INT16 -local function fieldInt16Load(field, data, offset) - fieldSignedLoad(field, data, offset, 2) -end - -local function fieldInt16Save(field) - fieldSignedSave(field, 2) -end - --- FLOAT -local function fieldFloatLoad(field, data, offset) - field.value = fieldGetValue(data, offset, 4) - field.min = fieldGetValue(data, offset+4, 4) - field.max = fieldGetValue(data, offset+8, 4) - field.default = fieldGetValue(data, offset+12, 4) - fieldUnsignedToSigned(field, 4) - field.prec = data[offset+16] - if field.prec > 3 then - field.prec = 3 - end - field.step = fieldGetValue(data, offset+17, 4) - field.unit, offset = fieldGetString(data, offset+21) -end - -local function formatFloat(num, decimals) - local mult = 10^(decimals or 0) - local val = num / mult - return string.format("%." .. decimals .. "f", val) -end - -local function fieldFloatDisplay(field, y, attr) - lcd.drawText(140, y, formatFloat(field.value, field.prec) .. field.unit, attr) -end - -local function fieldFloatSave(field) - fieldUnsignedSave(field, 4) -end - --- TEXT SELECTION -local function fieldTextSelectionLoad(field, data, offset) - local values - values, offset = fieldGetString(data, offset) - if values ~= "" then - field.values = split(values) - end - field.value = data[offset] - field.min = data[offset+1] - field.max = data[offset+2] - field.default = data[offset+3] - field.unit, offset = fieldGetString(data, offset+4) -end - -local function fieldTextSelectionSave(field) - crossfireTelemetryPush(0x2D, { deviceId, 0xEA, field.id, field.value }) -end - -local function fieldTextSelectionDisplay(field, y, attr) - -- lcd.drawText(140, y, field.values[field.value+1], attr) -- NOTE: original code getLastPos not available in Horus - -- lcd.drawText(lcd.getLastPos(), y, field.unit, attr) -- NOTE: original code getLastPos not available in Horus - lcd.drawText(140, y, field.values[field.value+1] .. field.unit, attr) -- NOTE: Concenated fields instead of get lastPos -end - --- STRING -local function fieldStringLoad(field, data, offset) - field.value, offset = fieldGetString(data, offset) - if #data >= offset then - field.maxlen = data[offset] - end -end - -local function fieldStringSave(field) - local frame = { deviceId, 0xEA, field.id } - for i=1, string.len(field.value) do - frame[#frame + 1] = string.byte(field.value, i) - end - frame[#frame + 1] = 0 - crossfireTelemetryPush(0x2D, frame) -end - -local function fieldStringDisplay(field, y, attr) - if edit == true and attr then - -- lcd.drawText(140, y, field.value, FIXEDWIDTH) -- NOTE: FIXEDWIDTH unknown.... - -- lcd.drawText(134+6*charIndex, y, string.sub(field.value, charIndex, charIndex), FIXEDWIDTH + attr) -- NOTE: FIXEDWIDTH unknown.... - lcd.drawText(140, y, field.value, attr) - lcd.drawText(134+6*charIndex, y, string.sub(field.value, charIndex, charIndex), attr) - else - lcd.drawText(140, y, field.value, attr) - end -end - -local function fieldCommandLoad(field, data, offset) - field.status = data[offset] - field.timeout = data[offset+1] - field.info, offset = fieldGetString(data, offset+2) - if field.status == 0 then - fieldPopup = nil - end -end - -local function fieldCommandSave(field) - if field.status == 0 then - field.status = 1 - crossfireTelemetryPush(0x2D, { deviceId, 0xEA, field.id, field.status }) - fieldPopup = field - fieldTimeout = getTime() + field.timeout - end -end - -local function fieldCommandDisplay(field, y, attr) - lcd.drawText(1, y, field.name, attr) - if field.info ~= "" then - lcd.drawText(140, y, "[" .. field.info .. "]") - end -end - -local functions = { - { load=fieldUint8Load, save=fieldUint8Save, display=fieldIntDisplay }, - { load=fieldInt8Load, save=fieldInt8Save, display=fieldIntDisplay }, - { load=fieldUint16Load, save=fieldUint16Save, display=fieldIntDisplay }, - { load=fieldInt16Load, save=fieldInt16Save, display=fieldIntDisplay }, - nil, - nil, - nil, - nil, - { load=fieldFloatLoad, save=fieldFloatSave, display=fieldFloatDisplay }, - { load=fieldTextSelectionLoad, save=fieldTextSelectionSave, display=fieldTextSelectionDisplay }, - { load=fieldStringLoad, save=fieldStringSave, display=fieldStringDisplay }, - nil, - { load=fieldStringLoad, save=fieldStringSave, display=fieldStringDisplay }, - { load=fieldCommandLoad, save=fieldCommandSave, display=fieldCommandDisplay }, -} - -local function parseParameterInfoMessage(data) - if data[2] ~= deviceId or data[3] ~= fieldId then - fieldData = {} - fieldChunk = 0 - return - end - local field = fields[fieldId] - local chunks = data[4] - for i=5, #data do - fieldData[#fieldData + 1] = data[i] - end - if chunks > 0 then - fieldChunk = fieldChunk + 1 - else - fieldChunk = 0 - field.id = fieldId - field.parent = fieldData[1] - field.type = fieldData[2] % 128 - field.hidden = (bit32.rshift(fieldData[2], 7) == 1) - local name, i = fieldGetString(fieldData, 3) - if name ~= "" then - local indent = "" - local parent = field.parent - while parent ~= 0 do - indent = indent .. " " - parent = fields[parent].parent - end - field.name = indent .. name - end - if functions[field.type+1] then - functions[field.type+1].load(field, fieldData, i) - end - if not fieldPopup then - if lineIndex == 0 and field.hidden ~= true and field.type and field.type ~= 11 and field.type ~= 12 then - initLineIndex() - end - fieldId = 1 + (fieldId % #fields) - end - fieldData = {} - end -end - -local function refreshNext() - local command, data = crossfireTelemetryPop() - if command == nil then - local time = getTime() - if fieldPopup then - if time > fieldTimeout then - crossfireTelemetryPush(0x2D, { deviceId, 0xEA, fieldPopup.id, 6 }) - fieldTimeout = time + fieldPopup.timeout - end - elseif time > fieldTimeout and not edit then - crossfireTelemetryPush(0x2C, { deviceId, 0xEA, fieldId, fieldChunk }) - fieldTimeout = time + 200 -- 2s - end - elseif command == 0x29 then - parseDeviceInfoMessage(data) - elseif command == 0x2B then - parseParameterInfoMessage(data) - fieldTimeout = 0 - end -end - --- Main -local function runDevicePage(event) - if event == EVT_VIRTUAL_EXIT then -- exit script - if edit == true then - edit = false - local field = getField(lineIndex) - fieldTimeout = getTime() + 200 -- 2s - fieldId, fieldChunk = field.id, 0 - fieldData = {} - functions[field.type+1].save(field) - else - return "crossfire.lua" - end - elseif event == EVT_VIRTUAL_ENTER then -- toggle editing/selecting current field - local field = getField(lineIndex) - if field.name then - if field.type == 10 then - if edit == false then - edit = true - charIndex = 1 - else - charIndex = charIndex + 1 - end - elseif field.type < 11 then - edit = not edit - end - if edit == false then - fieldTimeout = getTime() + 200 -- 2s - fieldId, fieldChunk = field.id, 0 - fieldData = {} - functions[field.type+1].save(field) - end - end - elseif edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - incrField(1) - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - incrField(-1) - end - else - if event == EVT_VIRTUAL_NEXT then - selectField(1) - elseif event == EVT_VIRTUAL_PREV then - selectField(-1) - end - end - - lcd.clear() - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5,deviceName, MENU_COLOR) - - for y = 1, 11 do - local field = getField(pageOffset+y) - if not field then - break - elseif field.name == nil then - lcd.drawText(1, y*22+10, "...") - else - local attr = lineIndex == (pageOffset+y) and ((edit == true and BLINK or 0) + INVERS) or 0 - lcd.drawText(1, y*22+10, field.name) - if functions[field.type+1] then - functions[field.type+1].display(field, y*22+10, attr) - end - end - end - - return 0 -end - -local function runPopupPage(event) - local result - if fieldPopup.status == 3 then - result = popupConfirmation("Confirmation", fieldPopup.info, event) - else - result = popupWarning(fieldPopup.info, event) - end - if result == "OK" then - crossfireTelemetryPush(0x2D, { deviceId, 0xEA, fieldPopup.id, 4 }) - elseif result == "CANCEL" then - crossfireTelemetryPush(0x2D, { deviceId, 0xEA, fieldPopup.id, 5 }) - end - return 0 -end - --- Init -local function init() - lineIndex, edit = 0, false -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - end - - local result - if fieldPopup ~= nil then - result = runPopupPage(event) - else - result = runDevicePage(event) - end - - refreshNext() - - return result -end - -return { init=init, run=run } diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/DSM FwdPrg.lua b/radio/sdcard/horus/SCRIPTS/TOOLS/DSM FwdPrg.lua deleted file mode 100644 index c756634d9..000000000 --- a/radio/sdcard/horus/SCRIPTS/TOOLS/DSM FwdPrg.lua +++ /dev/null @@ -1,557 +0,0 @@ -local toolName = "TNS|DSM Forward Programming|TNE" - ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - - ---############################################################################### --- Multi buffer for DSM description --- Multi_Buffer[0..2]=="DSM" -> Lua script is running --- Multi_Buffer[3]==0x70+len -> TX to RX data ready to be sent --- Multi_Buffer[4..9]=6 bytes of TX to RX data --- Multi_Buffer[10..25]=16 bytes of RX to TX data --- --- To start operation: --- Write 0x00 at address 3 --- Write 0x00 at address 10 --- Write "DSM" at address 0..2 ---############################################################################### - -local RX_VERSION, WAIT_CMD, MENU_TITLE, MENU_LINES, MENU_VALUES, VALUE_CHANGING, VALUE_CHANGING_WAIT, VALUE_CHANGED = 0, 1, 2, 3, 4, 5, 6, 7 -local MENU, LIST_MENU_NOCHANGING, LIST_MENU2, PERCENTAGE_VALUE = 0x1C, 0x6C, 0x4C, 0xC0 -local Phase = RX_VERSION -local Waiting_RX = 0 -local Text = {} -local Retry=100 -local Blink = 0 -local Value_Changed=0 - -local Menu = { Cur=nil, Id=nil, Title="", Prev=nil, PrevId=nil, Next=nil, NextId=nil, Back=nil, BackId=nil, CurLine=nil, SelLine=nil, EditLine=nil } -local Line = {} -local RX = { Name="", Version="" } - -local function conv_int16(number) - if number >= 0x8000 then - return number - 0x10000 - end - return number -end - -local function Get_Text(index) - out = Text[index] - if out == nil then -- unknown... - out = "Unknown_"..string.format("%X",index) - end - return out -end - -local function DSM_Release() - multiBuffer( 0, 0 ) -end - -local function DSM_Send(...) - local arg = {...} - for i = 1 , #arg do - multiBuffer( 3+i, arg[i]) - end - multiBuffer( 3, 0x70+#arg) -end - -local function Value_Add(dir) - local line=Line[Menu.SelLine] - Speed = getRotEncSpeed() - if Speed == ROTENC_MIDSPEED then - line.Val = line.Val + (5 * dir) - elseif Speed == ROTENC_HIGHSPEED then - line.Val = line.Val + (15 * dir) - else - line.Val = line.Val + dir - end - if line.Val > line.Max then - line.Val = line.Max - elseif line.Val < line.Min then - line.Val = line.Min - end - if Line[Menu.SelLine].Type ~= LIST_MENU_NOCHANGING then - Phase = VALUE_CHANGING - Waiting_RX = 0 - end -end - -local function DSM_Menu(event) - local Speed = 0 - if event == EVT_VIRTUAL_NEXT then - if Menu.EditLine == nil then - -- not changing a value - if Menu.SelLine ~= nil then - if Menu.SelLine < 7 then - local num = Menu.SelLine - for i = Menu.SelLine + 1, 6, 1 do - if Line[i].Type ~= nil and Line[i].Next ~= nil then - Menu.SelLine=i - break - end - end - if num == Menu.SelLine then - if Menu.Next ~= 0 then -- Next - Menu.SelLine = 7 - elseif Menu.Prev ~= 0 then -- Prev - Menu.SelLine = 8 - end - end - elseif Menu.Prev ~= 0 then -- Prev - Menu.SelLine = 8 - end - end - else -- need to inc the value - Value_Add(1) - end - elseif event == EVT_VIRTUAL_PREV then - if Menu.EditLine == nil then - if Menu.SelLine ~= nil then - if Menu.SelLine == 8 and Menu.Next ~= 0 then - Menu.SelLine = 7 - elseif Menu.SelLine > 0 then - if Menu.SelLine > 6 then - Menu.SelLine = 7 - end - local num = Menu.SelLine - for i = Menu.SelLine-1, 0, -1 do - if Line[i].Type ~= nil and Line[i].Next ~= nil then - Menu.SelLine=i - break - end - end - if num == Menu.SelLine then -- Back - Menu.SelLine = -1 - end - else - Menu.SelLine = -1 -- Back - end - end - else -- need to dec the value - Value_Add(-1) - end - elseif event == EVT_VIRTUAL_ENTER then - if Menu.SelLine == -1 then -- Back - Menu.Cur = Menu.Back - Menu.Id = Menu.BackId - Menu.SelLine = 0 - Phase = MENU_TITLE - Waiting_RX = 0 - elseif Menu.SelLine == 7 then -- Next - Menu.Cur = Menu.Next - Menu.Id = Menu.NextId - Menu.SelLine = 0 - Phase = MENU_TITLE - Waiting_RX = 0 - elseif Menu.SelLine == 8 then -- Prev - Menu.Cur = Menu.Prev - Menu.Id = Menu.PrevId - Menu.SelLine = 0 - Phase = MENU_TITLE - Waiting_RX = 0 - elseif Menu.SelLine ~= nil and Line[Menu.SelLine].Next ~= nil then - if Line[Menu.SelLine].Type == MENU then -- Next menu exist - Menu.Cur = Line[Menu.SelLine].Next - Menu.Id = Line[Menu.SelLine].NextId - Phase = MENU_TITLE - Waiting_RX = 0 - else - -- value entry - if Menu.EditLine == Menu.SelLine then - Menu.EditLine = nil - Value_Changed = 0 - Phase = VALUE_CHANGED - Waiting_RX = 0 - else - Menu.EditLine = Menu.SelLine - end - end - end - end -end - -local function DSM_Send_Receive() - if Waiting_RX == 0 then - Waiting_RX = 1 - -- Need to send a request - if Phase == RX_VERSION then -- request RX version - DSM_Send(0x11,0x06,0x00,0x14,0x00,0x00) - elseif Phase == WAIT_CMD then -- keep connection open - DSM_Send(0x00,0x04,0x00,0x00) - elseif Phase == MENU_TITLE then -- request menu title - if Menu.Cur == nil then - DSM_Send(0x12,0x06,0x00,0x14,0x00,0x00) -- first menu only - Menu.Cur = 0 - else - DSM_Send(0x16,0x06,Menu.Id,Menu.Cur,0x00,Menu.SelLine) - end - elseif Phase == MENU_LINES then -- request menu lines - if Menu.CurLine == nil then - DSM_Send(0x13,0x04,Menu.Id,Menu.Cur) -- line 0 - elseif Menu.CurLine >= 0x80 then - local last_byte={0x40,0x01,0x02,0x04,0x00,0x00} -- unknown... - DSM_Send(0x20,0x06,Menu.CurLine-0x80,Menu.CurLine-0x80,0x00,last_byte[Menu.CurLine-0x80+1]) -- line X - else - DSM_Send(0x14,0x06,Menu.Id,Menu.Cur,0x00,Menu.CurLine) -- line X - end - elseif Phase == MENU_VALUES then -- request menu values - DSM_Send(0x15,0x06,Menu.Id,Menu.Cur,Line[Menu.CurLine].ValId,Menu.CurLine) -- line X - elseif Phase == VALUE_CHANGING then -- send value - local value=Line[Menu.SelLine].Val - if value < 0 then - value = 0x10000 + value - end - DSM_Send(0x18,0x06,Line[Menu.SelLine].ValId,Menu.SelLine,bit32.rshift(value,8),bit32.band(value,0xFF)) -- send current value - Phase = VALUE_CHANGING_WAIT - elseif Phase == VALUE_CHANGED then -- send value - if Value_Changed == 0 then - local value=Line[Menu.SelLine].Val - if value < 0 then - value = 0x10000 + value - end - DSM_Send(0x18,0x06,Line[Menu.SelLine].ValId,Menu.SelLine,bit32.rshift(value,8),bit32.band(value,0xFF)) -- send current value - Value_Changed = Value_Changed + 1 - Waiting_RX = 0 - elseif Value_Changed == 1 then - DSM_Send(0x19,0x06,Line[Menu.SelLine].ValId,Menu.SelLine) -- validate - -- Value_Changed = Value_Changed + 1 - -- Waiting_RX = 0 - --elseif Value_Changed == 2 then - -- DSM_Send(0x1B,0x06,0x10,Menu.SelLine) -- validate again? - -- Value_Changed = Value_Changed + 1 - end - elseif Phase == VALUE_CHANGING_WAIT then - DSM_Send(0x1A,0x06,Line[Menu.SelLine].ValId,Menu.SelLine) - end - multiBuffer(10,0x00); - Retry = 50 - elseif multiBuffer(10) == 0x09 then - -- Answer received - --if multiBuffer(11) == 0x00 then -- waiting for commands? - if multiBuffer(11) == 0x01 then -- read version - --ex: 0x09 0x01 0x00 0x15 0x02 0x22 0x01 0x00 0x14 0x00 0x00 0x00 0x00 0x00 0x00 0x00 - RX.Name = Get_Text(multiBuffer(13)) - RX.Version = multiBuffer(14).."."..multiBuffer(15).."."..multiBuffer(16) - Phase = MENU_TITLE - elseif multiBuffer(11) == 0x02 then -- read menu title - --ex: 0x09 0x02 0x4F 0x10 0xA5 0x00 0x00 0x00 0x50 0x10 0x10 0x10 0x00 0x00 0x00 0x00 - Menu.Cur = multiBuffer(12) - Menu.Id = multiBuffer(13) - Menu.Title = Get_Text(multiBuffer(14)+multiBuffer(15)*256) - Menu.Prev = multiBuffer(16) - Menu.PrevId = multiBuffer(17) - Menu.Next = multiBuffer(18) - Menu.NextId = multiBuffer(19) - Menu.Back = multiBuffer(20) - Menu.BackId = multiBuffer(21) - for i = 0, 6 do -- clear menu - Line[i] = { Menu = nil, Id = nil, Type = nil, Text="", Next = nil, NextId = nil, ValLine = nil, ValId = nil, Min, Max, Def, Val, Unit, Step } - end - Menu.CurLine = nil - if Menu.Next ~= 0 then - Menu.SelLine = 7 -- highlight Next - else - Menu.SelLine = -1 -- highlight Back - end - Blink = 0 - Phase = MENU_LINES - elseif multiBuffer(11) == 0x03 then -- read menu lines - --ex: 0x09 0x03 0x00 0x10 0x00 0x1C 0xF9 0x00 0x10 0x10 0x00 0x00 0x00 0x00 0x03 0x00 - -- Menu Id line Type Text_idx Next V_Id Val_Min Val_Max Val_Def - --ex: 0x09 0x03 0x61 0x10 0x00 0x6C 0x50 0x00 0x00 0x10 0x36 0x00 0x49 0x00 0x36 0x00 - Menu.CurLine = multiBuffer(14) - local line = Line[Menu.CurLine] - line.Menu = multiBuffer(12) - line.Id = multiBuffer(13) -- not quite sure yet - line.Type = multiBuffer(15) -- not quite sure yet: 1C is text menu only, 4C/6C is text followed by text list, C0 is text followed by percentage value - line.Text = Get_Text(multiBuffer(16)+multiBuffer(17)*256) - if multiBuffer(18) == Menu.Cur then - line.Next = nil - else - line.Next = multiBuffer(18) -- not quite sure yet: 1C=text menu=>next menu, others=>line number of the value - end - if Menu.SelLine == -1 and line.Next ~= nil then -- Auto select first line of the menu - Menu.SelLine = Menu.CurLine - end - line.NextId = multiBuffer(19) -- not quite sure yet - line.ValLine = multiBuffer(18) -- not quite sure yet - line.ValId = multiBuffer(19) -- not quite sure yet - line.Min = conv_int16(multiBuffer(20)+multiBuffer(21)*256) - line.Max = conv_int16(multiBuffer(22)+multiBuffer(23)*256) - line.Def = conv_int16(multiBuffer(24)+multiBuffer(25)*256) - if line.Type == MENU then - -- nothing to do on menu entries - elseif line.Type == LIST_MENU_NOCHANGING or line.Type == LIST_MENU2 then - line.Val = nil --line.Def - line.Min -- use default value not sure if needed - line.Def = line.Min -- pointer to the start of the list in Text - line.Max = line.Max - line.Min -- max index - line.Min = 0 -- min index - else -- default to numerical value - line.Val = nil --line.Def -- use default value not sure if needed - end - if line.Type ~= 0x1C then -- value to follow - line.Text = line.Text..":" - end - Phase = MENU_LINES - elseif multiBuffer(11) == 0x04 then -- read menu values - --ex: 0x09 0x04 0x53 0x10 0x00 0x10 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 - -- Menu MeId line VaId Value - --ex: 0x09 0x04 0x61 0x10 0x02 0x10 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 - Menu.CurLine = multiBuffer(14) - Line[Menu.CurLine].Val = conv_int16(multiBuffer(16)+multiBuffer(17)*256) - Phase = MENU_VALUES - elseif multiBuffer(11) == 0x05 then -- unknown... need to get through the lines... - Menu.CurLine = 0x80 + multiBuffer(12) - Phase = MENU_LINES - elseif multiBuffer(11) == 0x00 and Phase == VALUE_CHANGING then - Phase = VALUE_CHANGING_WAIT - end - -- Data processed - Waiting_RX = 0 - multiBuffer(10,0x00) - Retry = 50 - else - Retry = Retry - 1 - if Retry <= 0 then - -- Retry the RX request - Retry = 50 - Waiting_RX = 0 - if Phase ~= RX_VERSION and Phase ~= VALUE_CHANGING_WAIT then - Phase = WAIT_CMD - end - end - end -end - -local function DSM_Display() - lcd.clear() - if LCD_W == 480 then - --Draw title - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, "DSM Forward Programming", MENU_TITLE_COLOR) - --Draw RX Menu - if Phase == RX_VERSION then - lcd.drawText(10,50,"No compatible DSM RX...", BLINK) - else - if Menu.Title ~= nil then - local attrib=0; - lcd.drawText(80,32,Menu.Title,MIDSIZE) - for i = 0, 6 do - if i == Menu.SelLine then - attrib = INVERS - else - attrib = 0 - end - if Line[i] ~= nil and Line[i].Type ~= nil then - if Line[i].Type ~= MENU then -- list/value - if Line[i].Val ~= nil then - local text="" - if Line[i].Type == LIST_MENU_NOCHANGING or Line[i].Type == LIST_MENU2 then - text = Get_Text(Line[i].Val+Line[i].Def) - elseif Line[i].Type == PERCENTAGE_VALUE then - text = Line[i].Val.." %" - else - text = Line[i].Val - end - if Menu.EditLine == Menu.SelLine then -- blink edited entry - Blink = Blink + 1 - if Blink > 25 then - attrib = 0 - if Blink > 50 then - Blink = 0 - end - end - end - lcd.drawText(240,32+20*(i+2), text, attrib) -- display value - end - attrib = 0 - end - lcd.drawText(10,32+20*(i+2), Line[i].Text, attrib) -- display text - end - end - if Menu.SelLine == -1 then - lcd.drawText(437,32, "Back", INVERS) - else - lcd.drawText(437,32, "Back", 0) - end - lcd.drawRectangle(437-5, 32-2, 47, 25) - if Menu.Next ~= 0 then - if Menu.SelLine == 7 then - lcd.drawText(437,220, "Next",INVERS) - else - lcd.drawText(437,220, "Next") - end - lcd.drawRectangle(437-5, 220-2, 47, 25) - end - if Menu.Prev ~= 0 then - if Menu.SelLine == 8 then - lcd.drawText(5,220, "Prev",INVERS) - else - lcd.drawText(5,220, "Prev") - end - lcd.drawRectangle(5-5, 220-2, 47, 25) - end - end - lcd.drawText(170,252, "RX "..RX.Name.." v"..RX.Version) -- display RX info - end - else - -- --Draw RX Menu on LCD_W=128 - -- if multiBuffer( 4 ) == 0xFF then - -- lcd.drawText(2,17,"No compatible DSM RX...",SMLSIZE) - -- else - -- if Retry_128 ~= 0 then - -- --Intro page - -- Retry_128 = Retry_128 - 1 - -- lcd.drawScreenTitle("DSM Forward Programming",0,0) - -- lcd.drawText(2,17,"Press Prev Page for previous Menu" ,SMLSIZE) - -- else - -- --Menu page - -- for line = 0, 7, 1 do - -- for i = 0, 21-1, 1 do - -- value=multiBuffer( line*21+6+i ) - -- if value > 0x80 then - -- value = value - 0x80 - -- lcd.drawText(2+i*6,1+8*line,string.char(value).." ",SMLSIZE+INVERS) - -- else - -- lcd.drawText(2+i*6,1+8*line,string.char(value),SMLSIZE) - -- end - -- end - -- end - -- end - -- end - end -end - --- Init -local function DSM_Init() - --Set protocol to talk to - multiBuffer( 0, string.byte('D') ) - --test if value has been written - if multiBuffer( 0 ) ~= string.byte('D') then - error("Not enough memory!") - return 2 - end - --Init TX buffer - multiBuffer( 3, 0x00 ) - --Init RX buffer - multiBuffer( 10, 0x00 ) - --Init telemetry - multiBuffer( 0, string.byte('D') ) - multiBuffer( 1, string.byte('S') ) - multiBuffer( 2, string.byte('M') ) - - --Text to be displayed -> need to use a file instead? - --RX names-- - Text[0x0014]="SPM4651T" - Text[0x0015]="AR637T" - --Lists-- - Text[0x0036]="Throttle" - Text[0x0037]="Aileron" - Text[0x0038]="Elevator" - Text[0x0039]="Rudder" - Text[0x003A]="Gear" - for i=1,7 do -- 3B..41 - Text[0x003A+i]="Aux"..i - end - for i=1,8 do -- 41..49 - Text[0x0041+i]="XPlus-"..i - end - Text[0x004A]="Failsafe" - Text[0x004B]="Main Menu" - Text[0x004E]="Position" - Text[0x0050]="Outputs" - --Text[0x005E]="Inhibit" - Text[0x005F]="Hold Last" - Text[0x0060]="Preset" - --Text[0x0061]="Custom" - --Messages-- - Text[0x0090]="Apply" - Text[0x0093]="Complete" - Text[0x0094]="Done" - Text[0x0097]="Factory Reset" - Text[0x009A]="Capture Failsafe Positions" - Text[0x009C]="Custom Failsafe" - Text[0x00A5]="First Time Setup" - Text[0x00F9]="Gyro settings" - Text[0x0100]="Make sure the model has been" - Text[0x0101]="configured, including wing type," - Text[0x0102]="reversing, travel, trimmed, etc." - Text[0x0103]="before continuing setup." - Text[0x0104]="" - Text[0x0105]="" - Text[0x0106]="Any wing type, channel assignment," - Text[0x0107]="subtrim, or servo reversing changes" - Text[0x0108]="require running through initial" - Text[0x0109]="setup again." - Text[0x010A]="" - Text[0x010B]="" - - Text[0x019C]="Enter Receiver Bind Mode" - Text[0x020A]="Restore from Backup" - Text[0x0209]="Save to Backup" - - Text[0x021A]="Set the model level," - Text[0x021B]="and press Continue." - Text[0x021C]="" - Text[0x021D]="" - - Text[0x021F]="Set the model on its nose," - Text[0x0220]="and press Continue. If the" - Text[0x0221]="orientation on the next" - Text[0x0222]="screen is wrong go back" - Text[0x0223]="and try again." - Text[0x0224]="Continue" - Text[0x0229]="Set Orientation Manually" - - Text[0x0227]="Other settings" - Text[0x022B]="WARNING!" - Text[0x022C]="This will reset the" - Text[0x022D]="configuration to factory" - Text[0x022E]="defaults. This does not" - Text[0x022F]="affect the backup config." - Text[0x0230]="" - Text[0x0231]="This will overwrite the" - Text[0x0232]="backup memory with your" - Text[0x0233]="current configuartion." - Text[0x0234]="" - Text[0x0235]="" - Text[0x0236]="This will overwrite the" - Text[0x0237]="current config with" - Text[0x0238]="that which is in" - Text[0x0239]="the backup memory." - Text[0x023A]="" -end - --- Main -local function DSM_Run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_EXIT then - DSM_Release() - return 2 - else - DSM_Menu(event) - DSM_Send_Receive() - DSM_Display() - return 0 - end -end - -return { init=DSM_Init, run=DSM_Run } diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/FrSky GaSuite.lua b/radio/sdcard/horus/SCRIPTS/TOOLS/FrSky GaSuite.lua deleted file mode 100755 index e0497f00f..000000000 --- a/radio/sdcard/horus/SCRIPTS/TOOLS/FrSky GaSuite.lua +++ /dev/null @@ -1,515 +0,0 @@ - ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - -local version = "v1.1" - -local VALUE = 0 -local COMBO = 1 -local FLPOI = 2 - - -local edit = false -local page = 1 -local current = 1 --row -local refreshState = 0 -local refreshIndex = 0 -local refreshIndex3 = 0 -local pageOffset = 0 -local pages = {} -local fields = {} -local modifications = {} -local thistime = getTime() -local lastTime = thistime -local margin = 1 -local spacing = 8 -local configFields = {} -local counter = 0 -local appId = 0 - -local function drawScreenTitle(title,page, pages) - if math.fmod(math.floor(getTime()/100),10) == 0 then - title = version - end - if LCD_W == 480 then - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, title, MENU_COLOR) - lcd.drawText(LCD_W-40, 5, page.."/"..pages, MENU_COLOR) - else - lcd.drawScreenTitle(title, page, pages) - end -end - -local interfaceconfig = { - {"Sensor group select", VALUE, appId, nil, 0, 15}, -} - -local settingsFields = { - {"Software version", FLPOT, 0x0c, nil, 1, 100 }, - {"Physical ID", VALUE, 0x01, nil, 0, 26 }, - {"Application IDgroup", VALUE, 0x0D, nil, 0, 15 }, - {"Data rate(*100ms)", VALUE, 0x22, nil, 1, 255 }, -} - -local telemetryFields = { - {"TEMP1(C/F)", VALUE, 0x90, nil, -30, 600}, - {"TEMP2(C/F)", VALUE, 0x91, nil, -30, 600}, - {"SPEED(r/min)", VALUE, 0x92, nil, 0, 100000}, - {"Residual Volume(mL)", VALUE, 0x93, nil, 0, 60000}, - {"Residual Percent(%)", VALUE, 0x94, nil, 0, 100}, - {"FLOW(mL/min)", VALUE, 0x95, nil, 0, 2000}, - {"Max Flow(mL/min)", VALUE, 0x96, nil, 0, 2000}, - {"Avg Flow(mL/min)", VALUE, 0x97, nil, 0, 2000}, -} - --- Change display attribute to current field -local function addField(step) - local field = fields[current] - local min, max - if field[2] == VALUE then - min = field[5] - max = field[6] - elseif field[2] == COMBO then - min = 0 - max = #(field[5]) - 1 - end - if field[2] ~= FLPOT then --only read ? - if field[2] == VALUE and field[6] > 256 then - if field[4] > 1000 then - step = step * 50 - field[4] = math.floor(field[4]/50) - field[4] = field[4] *50 - elseif field[4] > 500 then - step = step * 20 - field[4] = math.floor(field[4]/20) - field[4] = field[4] *20 - elseif field[4] > 200 then - step = step * 10 - field[4] = math.floor(field[4]/10) - field[4] = field[4] *10 - else - step = step * 1 - field[4] = math.floor(field[4]/1) - field[4] = field[4] *1 - end - end - if (step < 0 and field[4] > min) or (step > 0 and field[4] < max) then - field[4] = field[4] + step - end - else - field[4] = field[4] - end -end - --- Select the next or previous page -local function selectPage(step) - page = 1 + ((page + step - 1 + #pages) % #pages) - refreshIndex = 0 - pageOffset = 0 -end - --- Select the next or previous editable field -local function selectField(step) - current = current + step - if current > #fields then - current = #fields - elseif current < 1 then - current = 1 - end - if current > 7 + pageOffset then - pageOffset = current - 7 - elseif current <= pageOffset then - pageOffset = current - 1 - end -end - -local function drawProgressBar() - if LCD_W == 480 then - local width = (300 * refreshIndex) / #fields - lcd.drawRectangle(100, 10, 300, 6) - lcd.drawFilledRectangle(102, 13, width, 2); - else - local width = (60 * refreshIndex) / #fields - lcd.drawRectangle(45, 1, 60, 6) - lcd.drawFilledRectangle(47, 3, width, 2); - end -end - --- Redraw the current page -local function redrawFieldsPage() - lcd.clear() - drawScreenTitle("GasSuit", page, #pages) - if refreshIndex < #fields then - drawProgressBar() - end - for index = 1, 7, 1 do - local field = fields[pageOffset+index] - if field == nil then - break - end - local attr = current == (pageOffset+index) and ((edit == true and BLINK or 0) + INVERS) or 0 - lcd.drawText(1, margin+ spacing * index, field[1]) - if field[4] == nil then - lcd.drawText(LCD_W, margin+ spacing * index, "---", attr + RIGHT) - else - if field[2] == VALUE then - if (field[3] == 0x90 or field[3] == 0x91) and field[4] == 500 then - lcd.drawText(LCD_W, margin+ spacing * index, "---", attr + RIGHT) - else - - lcd.drawNumber(LCD_W, margin+ spacing * index, field[4] , attr + RIGHT) - end - elseif field[2] == COMBO then - if field[4] >= 0 and field[4] < #(field[5]) then - lcd.drawText(LCD_W, margin+ spacing * index, field[5][1+field[4]], attr + RIGHT) - end - elseif field[2] == FLPOT then - lcd.drawText(LCD_W, margin+ spacing * index, field[4], attr + RIGHT) - end - end - end -end - -local function telemetryRead(fieldx) - return sportTelemetryPush(0x1b, 0x30, appId, fieldx) -end - -local function telemetryListen(fieldx) - return sportTelemetryPush(0x1b, 0, 0, 0) -end - -local function telemetryWrite(fieldx, valuex) - return sportTelemetryPush(0x1b, 0x31, appId, fieldx + valuex*256) -end - -local telemetryPopTimeout = 0 -local function refreshNext() - if refreshState == 0 and page ~= 3 then -- - if #modifications > 0 then -- - if modifications[1][1] ~= 0x0c then - if modifications[1][1] == 0x22 then - modifications[1][2] = modifications[1][2] + 0xf00 - end - local modificationstmp = modifications[1][2] - if modifications[1][1] == 0x8a or modifications[1][1] == 0x8b then - if configFields[11][4]== 1 then - modificationstmp = (modifications[1][2] - 32)*10 - modificationstmp = math.floor(modificationstmp/18) - end - end - telemetryWrite(modifications[1][1], modificationstmp) - refreshIndex = 0 - end - modifications[1] = nil - elseif refreshIndex < #fields then - local field = fields[refreshIndex + 1] - if telemetryRead(field[3]) == true then - refreshState = 1 - telemetryPopTimeout = getTime() + 80 - end - end - elseif refreshState == 0 and page == 3 then - if #modifications > 0 then - if modifications[1][1] == 0x96 or modifications[1][1] == 0x97 or modifications[1][1] == 0x93 then - telemetryWrite(modifications[1][1], 0) - end - modifications[1] = nil - elseif refreshIndex < #fields then - local field = fields[refreshIndex + 1] - if telemetryRead(field[3]) == true then - refreshState = 1 - telemetryPopTimeout = getTime() + 20 - end - elseif refreshIndex >= #fields then - refreshIndex = 0 - refreshState = 0 - end - elseif refreshState == 1 and page ~= 3 then - local physicalId, primId, dataId, value = sportTelemetryPop() - if primId == 0x32 and dataId >= 0x0d00 and dataId <= 0x0d7f then - local fieldId = value % 256 - local field = fields[refreshIndex + 1] - if fieldId == field[3] then - local value = math.floor(value / 256) - if field[2] == COMBO then - for index = 1, #(field[6]), 1 do - if value == field[6][index] then - value = index - 1 - break - end - end - elseif field[2] == VALUE then - value = value -- - field[8] + field[5] - end - if field[1] == "Software version" then - local flo_string = string.char(value/16%16 + 48).."."..string.char(value%16 + 48) - fields[refreshIndex + 1][4] = flo_string - else - fields[refreshIndex + 1][4] = value - end - refreshIndex = refreshIndex + 1 - refreshState = 0 - end - elseif getTime() > telemetryPopTimeout then - refreshState = 0 - end - elseif refreshState == 1 and page == 3 then - local pageID3 = 0 - local physicalId3, primId3, dataId3, value3 = sportTelemetryPop() - if value3 ~= nil then - pageID3 = value3 % 256 - value3 = math.floor(value3 / 0x100) - end - if primId3 == 0x32 and value3 ~= nil then - if pageID3 == fields[refreshIndex + 1][3] then - local field = fields[refreshIndex + 1] - if field[2] == COMBO and #field == 6 then - for index = 1, #(field[6]), 1 do - if value3 == field[6][index] then - value3 = index - 1 - break - end - end - elseif field[2] == VALUE then - if field[3] == 0x90 or field[3] == 0x91 then - value3 = math.floor(value3 % 0x10000) - if value3 > 0xf000 then - value3 = value3 - 0x10000 - end - if configFields[11][4]== 1 and (field[3] == 0x90 or field[3] == 0x91) then - value3 =(value3*18) - value3 = math.floor(value3/10)+32 - end - else - value3 = value3 - end - end - fields[refreshIndex + 1][4] = value3 - refreshIndex = refreshIndex + 1 - refreshState = 0 - end - elseif getTime() > telemetryPopTimeout then - refreshState = 0 - end - end -end - -local function updateField(field) - local value = field[4] - if field[2] == COMBO and #field == 6 then - value = field[6][1+value] - elseif field[2] == VALUE and #field == 6 then - value = value -- + field[8] - field[5] - elseif field[2] == FLPOT then - value = 0 - end - modifications[#modifications+1] = {field[3], value} -end - --- Main1 -local function runFieldsPage(event) - if event == EVT_VIRTUAL_EXIT then - return 2 - elseif event == EVT_VIRTUAL_ENTER then - if fields[current][4] ~= nil then - edit = not edit - if edit == false then - updateField(fields[current]) - end - end - elseif edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - addField(1) - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - addField(-1) - end - else - if event == EVT_VIRTUAL_NEXT then - selectField(1) - elseif event == EVT_VIRTUAL_PREV then - selectField(-1) - end - end - redrawFieldsPage() - return 0 -end - -local function runConfigPage(event) - fields = configFields - local result = runFieldsPage(event) - return result -end - -local function runSettingsPage(event) - fields = settingsFields - return runFieldsPage(event) -end - -local function runTelemetryPage(event) - fields = telemetryFields - return runFieldsPage(event) -end - --- Init -local function init() - current, edit, refreshState, refreshIndex = 1, false, 0, 0 - if LCD_W == 480 then - margin = 10 - spacing = 20 - end - if LCD_W == 128 then - configFields = { - {"CDI off speed limit", VALUE, 0x81, nil, 10,10000}, -- 1 - {"Milliliter per pulse", VALUE, 0x80, nil, 1, 2000}, -- 2 - {"Volume", VALUE, 0x83, nil, 10,60000}, -- 3 - -- {"Flow trigger", VALUE, 0x84, nil, 5, 50 }, - -- {"Flow Reset", COMBO, 0x85, nil, { "ON", "OFF" }, {1 , 0}}, - {"Auto Reset", COMBO, 0x8d, nil, { "ON", "OFF" }, {0 , 1}}, -- 4 - {"Reset settings", COMBO, 0x86, nil,{ "YES", "NO" }, {1 , 0} }, -- 5 - {"Volume alarm(%)", VALUE, 0x87, nil, 0, 90 }, -- 6 - {"Max.Flow alarm", VALUE, 0x88, nil, 0, 2000 }, -- 7 - {"Over speed alarm", VALUE, 0x89, nil, 0, 10000 }, -- 8 - {"Over temp1 alarm", VALUE, 0x8a, nil, 0, 600 }, -- 9 - {"Over temp2 alarm", VALUE, 0x8b, nil, 0, 600 }, -- 10 - {"Temperature C/F", COMBO, 0x8c, nil,{ "C", "F" }, {0 , 1} }, -- 11 - } - else - configFields = { - {"CDI off speed limit(*100RPM)", VALUE, 0x81, nil, 10,10000}, - {"Milliliter per pulse(*0.001mL/pul)", VALUE, 0x80, nil, 1, 2000}, - {"Volume(mL)", VALUE, 0x83, nil, 10,60000}, - -- {"Flow trigger(mL/min)", VALUE, 0x84, nil, 5, 50 }, - -- {"Flow Reset", COMBO, 0x85, nil, { "ON", "OFF" }, {1 , 0}}, - {"Auto Reset", COMBO, 0x8d, nil, { "ON", "OFF" }, {0 , 1}}, - {"Reset to factory settings", COMBO, 0x86, nil,{ "YES", "NO" }, {1 , 0} }, - {"Volume alarm(%)", VALUE, 0x87, nil, 0, 90 }, - {"Max.Flow alarm(mL/min)", VALUE, 0x88, nil, 0, 2000 }, - {"Over speed alarm(*100RPM)", VALUE, 0x89, nil, 0, 10000 }, - {"Over temperature1 alarm(C/F)", VALUE, 0x8a, nil, 0, 600 }, - {"Over temperature2 alarm(C/F)", VALUE, 0x8b, nil, 0, 600 }, - {"Temperature Celsius/Fahrenheit", COMBO, 0x8c, nil,{ "C", "F" }, {0 , 1} }, - } - end - - pages = { - runConfigPage, - runSettingsPage, - runTelemetryPage, - } - - -- Warning : GaSuite tool requires Temp2 to be connected and discovered for script to work - for index = 1, 40, 1 do - local sensor = model.getSensor(index) - if sensor ~= nil and sensor.id >= 0x0d10 and sensor.id <= 0x0d1f then - appId = sensor.id - break - end - end - - if appId == 0 then - error("No GasSuit sensor in this model!") - end -end - -local function background() - local tonefrq,tonelength,tonepause - thistime = getTime() - lastTime = thistime - refreshNext() - if page == 3 then --alarm - local alarmnum = 0 - if fields[3][4] ~= nil and configFields[9][4] ~= nil then - local speedtest = fields[3][4] - local speedover = configFields[9][4]*100 - if speedtest >= speedover then - tonefrq = 800 + math.max(0,math.floor((speedtest - speedover)/10)) - tonelength = 50 + math.max(0,(150 - math.floor((speedtest - speedover)/10))) - tonepause = tonelength - playTone(tonefrq, tonelength, tonepause, PLAY_BACKGROUND,10) - alarmnum = alarmnum + 1 - end - end - if fields[5][4] ~= nil and configFields[7][4] ~= nil then - local Residualtest = fields[5][4] - local Residualline = configFields[6][4] - if Residualtest < Residualline then - tonefrq = 400 - tonelength = 100 - tonepause = 1000 + math.floor( Residualline - Residualtest )*30 - playTone(tonefrq, tonelength, tonepause, PLAY_BACKGROUND,10) - alarmnum = alarmnum + 1 - end - end - if fields[6][4] ~= nil and configFields[8][4] ~= nil then - local Flowtest = fields[6][4] - local Flowover = configFields[7][4] - if Flowtest > Flowover then - tonefrq = 400 - tonelength = 100 - tonepause = 200 - playTone(tonefrq, tonelength, tonepause, PLAY_BACKGROUND,10) - alarmnum = alarmnum + 1 - end - end - if fields[1][4] ~= nil and configFields[10][4] ~= nil then - local temp1test = fields[1][4] -- - local temp1over = configFields[9][4] - if temp1test > temp1over and (temp1test ~= 500 and temp1test ~= 932) then - tonefrq = 2000 - tonelength = 100 - tonepause = 900 - playTone(tonefrq, tonelength, tonepause, PLAY_BACKGROUND,10) - alarmnum = alarmnum + 1 - end - end - if fields[2][4] ~= nil and configFields[11][4] ~= nil then - local temp2test = fields[2][4] - local temp2over = configFields[10][4] - if temp2test > temp2over and (temp2test ~= 500 and temp2test ~= 932) then - tonefrq = 2000 - tonelength = 300 - tonepause = 700 - playTone(tonefrq, tonelength, tonepause, PLAY_BACKGROUND,10) - alarmnum = alarmnum + 1 - end - end - if alarmnum > 1 then - playTone(2000, 100, 100, PLAY_BACKGROUND,10) - end - alarmnum = 0 - end -end - -local function run(event) - if event == nil then - error("Cannot be run as a sensor script!") - return 2 - elseif event == EVT_VIRTUAL_NEXT_PAGE then - selectPage(1) - elseif event == EVT_VIRTUAL_PREV_PAGE then - killEvents(event); - selectPage(-1) - end - local result = pages[page](event) - if page ~= 3 then - refreshNext() - end - background() - return result -end - -return { init=init, background=background, run=run } diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/FrSky RB30_RB40.lua b/radio/sdcard/horus/SCRIPTS/TOOLS/FrSky RB30_RB40.lua deleted file mode 100644 index 213faa6cf..000000000 --- a/radio/sdcard/horus/SCRIPTS/TOOLS/FrSky RB30_RB40.lua +++ /dev/null @@ -1,464 +0,0 @@ ---- - ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------ # # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - -local version = "v1.01" - -local VALUE = 0 -local COMBO = 1 - -local edit = false -local page = 1 -local current = 1 -local refreshState = 0 -local refreshIndex = 0 -local pageOffset = 0 -local pages = {} -local fields = {} -local modifications = {} -local margin = 1 -local spacing = 8 -local numberPerPage = 7 - -local configFields = { - { "Self_stable mode", COMBO, 0x80, nil, { "disable", "enable"} }, - { "Sbus out", COMBO, 0x81, nil, { "disable", "enable"} }, - { "VOut1(V)", VALUE, 0xB2, nil, 50, 84}, - { "VOut2(V)", VALUE, 0xB3, nil, 50, 84}, -} - - -local failsafeFields = { - { "CH1 failsafe", VALUE, 0x82, 150, 80, 220}, - { "CH2 failsafe", VALUE, 0x82, 150, 80, 220}, - { "CH3 failsafe", VALUE, 0x83, 150, 80, 220}, - { "CH4 failsafe", VALUE, 0x83, 150, 80, 220}, - { "CH5 failsafe", VALUE, 0x84, 150, 80, 220}, - { "CH6 failsafe", VALUE, 0x84, 150, 80, 220}, - { "CH7 failsafe", VALUE, 0x85, 150, 80, 220}, - { "CH8 failsafe", VALUE, 0x85, 150, 80, 220}, - { "CH9 failsafe", VALUE, 0x86, 150, 80, 220}, - { "CH10 failsafe", VALUE, 0x86, 150, 80, 220}, - { "CH11 failsafe", VALUE, 0x87, 150, 80, 220}, - { "CH12 failsafe", VALUE, 0x87, 150, 80, 220}, - { "CH13 failsafe", VALUE, 0x88, 150, 80, 220}, - { "CH14 failsafe", VALUE, 0x88, 150, 80, 220}, - { "CH15 failsafe", VALUE, 0x89, 150, 80, 220}, - { "CH16 failsafe", VALUE, 0x89, 150, 80, 220}, - { "CH17 failsafe", VALUE, 0x8A, 150, 80, 220}, - { "CH18 failsafe", VALUE, 0x8A, 150, 80, 220}, - { "CH19 failsafe", VALUE, 0x8B, 150, 80, 220}, - { "CH20 failsafe", VALUE, 0x8B, 150, 80, 220}, - { "CH21 failsafe", VALUE, 0x8C, 150, 80, 220}, - { "CH22 failsafe", VALUE, 0x8C, 150, 80, 220}, - { "CH23 failsafe", VALUE, 0x8D, 150, 80, 220}, - { "CH24 failsafe", VALUE, 0x8D, 150, 80, 220}, -} - -local rx1PinMapFields = { - { "CH1 RX1 map", VALUE, 0x8E, 1, 0, 16}, - { "CH2 RX1 map", VALUE, 0x8E, 2, 0, 16}, - { "CH3 RX1 map", VALUE, 0x8F, 3, 0, 16}, - { "CH4 RX1 map", VALUE, 0x8F, 4, 0, 16}, - { "CH5 RX1 map", VALUE, 0x90, 5, 0, 16}, - { "CH6 RX1 map", VALUE, 0x90, 6, 0, 16}, - { "CH7 RX1 map", VALUE, 0x91, 7, 0, 16}, - { "CH8 RX1 map", VALUE, 0x91, 8, 0, 16}, - { "CH9 RX1 map", VALUE, 0x92, 9, 0, 16}, - { "CH10 RX1 map", VALUE, 0x92, 10, 0, 16}, - { "CH11 RX1 map", VALUE, 0x93, 11, 0, 16}, - { "CH12 RX1 map", VALUE, 0x93, 12, 0, 16}, - { "CH13 RX1 map", VALUE, 0x94, 13, 0, 16}, - { "CH14 RX1 map", VALUE, 0x94, 14, 0, 16}, - { "CH15 RX1 map", VALUE, 0x95, 15, 0, 16}, - { "CH16 RX1 map", VALUE, 0x95, 16, 0, 16}, - { "CH17 RX1 map", VALUE, 0x96, 1, 0, 16}, - { "CH18 RX1 map", VALUE, 0x96, 2, 0, 16}, - { "CH19 RX1 map", VALUE, 0x97, 3, 0, 16}, - { "CH20 RX1 map", VALUE, 0x97, 4, 0, 16}, - { "CH21 RX1 map", VALUE, 0x98, 5, 0, 16}, - { "CH22 RX1 map", VALUE, 0x98, 6, 0, 16}, - { "CH23 RX1 map", VALUE, 0x99, 7, 0, 16}, - { "CH24 RX1 map", VALUE, 0x99, 8, 0, 16}, -} - -local rx2PinMapFields = { - { "CH1 RX2 map", VALUE, 0x9A, 1, 0, 16}, - { "CH2 RX2 map", VALUE, 0x9A, 2, 0, 16}, - { "CH3 RX2 map", VALUE, 0x9B, 3, 0, 16}, - { "CH4 RX2 map", VALUE, 0x9B, 4, 0, 16}, - { "CH5 RX2 map", VALUE, 0x9C, 5, 0, 16}, - { "CH6 RX2 map", VALUE, 0x9C, 6, 0, 16}, - { "CH7 RX2 map", VALUE, 0x9D, 7, 0, 16}, - { "CH8 RX2 map", VALUE, 0x9D, 8, 0, 16}, - { "CH9 RX2 map", VALUE, 0x9E, 9, 0, 16}, - { "CH10 RX2 map", VALUE, 0x9E, 10, 0, 16}, - { "CH11 RX2 map", VALUE, 0x9F, 11, 0, 16}, - { "CH12 RX2 map", VALUE, 0x9F, 12, 0, 16}, - { "CH13 RX2 map", VALUE, 0xA0, 13, 0, 16}, - { "CH14 RX2 map", VALUE, 0xA0, 14, 0, 16}, - { "CH15 RX2 map", VALUE, 0xA1, 15, 0, 16}, - { "CH16 RX2 map", VALUE, 0xA0, 16, 0, 16}, - { "CH17 RX2 map", VALUE, 0xA2, 1, 0, 16}, - { "CH18 RX2 map", VALUE, 0xA2, 2, 0, 16}, - { "CH19 RX2 map", VALUE, 0xA3, 3, 0, 16}, - { "CH20 RX2 map", VALUE, 0xA3, 4, 0, 16}, - { "CH21 RX2 map", VALUE, 0xA4, 5, 0, 16}, - { "CH22 RX2 map", VALUE, 0xA4, 6, 0, 16}, - { "CH23 RX2 map", VALUE, 0xA5, 7, 0, 16}, - { "CH24 RX2 map", VALUE, 0xA5, 8, 0, 16}, -} - -local rx3PinMapFields = { - { "CH1 RX3 map", VALUE, 0xA6, 1, 0, 16}, - { "CH2 RX3 map", VALUE, 0xA6, 2, 0, 16}, - { "CH3 RX3 map", VALUE, 0xA7, 3, 0, 16}, - { "CH4 RX3 map", VALUE, 0xA7, 4, 0, 16}, - { "CH5 RX3 map", VALUE, 0xA8, 5, 0, 16}, - { "CH6 RX3 map", VALUE, 0xA8, 6, 0, 16}, - { "CH7 RX3 map", VALUE, 0xA9, 7, 0, 16}, - { "CH8 RX3 map", VALUE, 0xA9, 8, 0, 16}, - { "CH9 RX3 map", VALUE, 0xAA, 9, 0, 16}, - { "CH10 RX3 map", VALUE, 0xAA, 10, 0, 16}, - { "CH11 RX3 map", VALUE, 0xAB, 11, 0, 16}, - { "CH12 RX3 map", VALUE, 0xAB, 12, 0, 16}, - { "CH13 RX3 map", VALUE, 0xAC, 13, 0, 16}, - { "CH14 RX3 map", VALUE, 0xAC, 14, 0, 16}, - { "CH15 RX3 map", VALUE, 0xAD, 15, 0, 16}, - { "CH16 RX3 map", VALUE, 0xAD, 16, 0, 16}, - { "CH17 RX3 map", VALUE, 0xAE, 1, 0, 16}, - { "CH18 RX3 map", VALUE, 0xAE, 2, 0, 16}, - { "CH19 RX3 map", VALUE, 0xAF, 3, 0, 16}, - { "CH20 RX3 map", VALUE, 0xAF, 4, 0, 16}, - { "CH21 RX3 map", VALUE, 0xB0, 5, 0, 16}, - { "CH22 RX3 map", VALUE, 0xB0, 6, 0, 16}, - { "CH23 RX3 map", VALUE, 0xB1, 7, 0, 16}, - { "CH24 RX3 map", VALUE, 0xB1, 8, 0, 16}, -} - - - - -local function drawScreenTitle(title, page, pages) - if math.fmod(math.floor(getTime() / 100), 10) == 0 then - title = version - end - if LCD_W == 480 then - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, title, MENU_TITLE_COLOR) - lcd.drawText(LCD_W - 40, 5, page .. "/" .. pages, MENU_TITLE_COLOR) - else - lcd.drawScreenTitle(title, page, pages) - end -end - --- Change display attribute to current field -local function addField(step) - local field = fields[current] - local min, max - if field[2] == VALUE then - min = field[5] - max = field[6] - elseif field[2] == COMBO then - min = 0 - max = #(field[5]) - 1 - end - if page == 2 and step < 0 and field[4] == min then - field[4] = 0 - elseif page == 2 and step > 0 and field[4] == 0 then - field[4] = min - else - if (step < 0 and field[4] > min) or (step > 0 and field[4] < max) then - field[4] = field[4] + step - end - end -end - --- Select the next or previous page -local function selectPage(step) - local pagesNum = #pages - if configFields[1][4] == 1 then - pagesNum = 1 - elseif configFields[2][4] == 1 then - pagesNum = pagesNum - 1 - end - page = 1 + ((page + step - 1 + pagesNum) % pagesNum) - refreshIndex = 0 - pageOffset = 0 -end - --- Select the next or previous editable field -local function selectField(step) - current = 1 + ((current + step - 1 + #fields) % #fields) - if current > numberPerPage + pageOffset then - pageOffset = current - numberPerPage - elseif current <= pageOffset then - pageOffset = current - 1 - end -end - -local function drawProgressBar() - if LCD_W == 480 then - local width = (300 * refreshIndex) / #fields - lcd.drawRectangle(100, 10, 300, 6) - lcd.drawFilledRectangle(102, 12, width, 2) - else - local width = (60 * refreshIndex) / #fields - lcd.drawRectangle(45, 1, 60, 6) - lcd.drawFilledRectangle(47, 3, width, 2) - end -end - --- Redraw the current page -local function redrawFieldPage() - lcd.clear() - - local pagesNum = #pages - if configFields[1][4] == 1 then - pagesNum = 1 - elseif configFields[2][4] == 1 then - pagesNum = pagesNum - 1 - end - drawScreenTitle("RB30/RB40", page, pagesNum) - - if refreshIndex < #fields then - drawProgressBar() - end - - for index = 1, numberPerPage, 1 do - local field = fields[pageOffset + index] - if field == nil then - break - end - - local attr = current == (pageOffset + index) and ((edit == true and BLINK or 0) + INVERS) or 0 - - lcd.drawText(1, margin + spacing * index, field[1], attr) - - if field[4] == nil then - lcd.drawText(LCD_W, margin + spacing * index, "---", RIGHT + attr) - else - if field[2] == VALUE then - if page == 2 then - if field[4] == 0 then - lcd.drawText(LCD_W, margin + spacing * index, "No pulse", RIGHT + attr) - else - lcd.drawNumber(LCD_W, margin + spacing * index, field[4] * 10, RIGHT + attr) - end - else - if field[4] == 0 then - lcd.drawText(LCD_W, margin + spacing * index, "No map", RIGHT + attr) - else - if field[3] == 0xB2 or field[3] == 0xB3 then - lcd.drawNumber(LCD_W, margin + spacing * index, field[4] , attr + RIGHT + PREC1) - else - lcd.drawNumber(LCD_W, margin + spacing * index, field[4], RIGHT + attr) - end - end - end - elseif field[2] == COMBO then - if field[4] >= 0 and field[4] < #(field[5]) then - lcd.drawText(LCD_W, margin + spacing * index, field[5][field[4] + 1], RIGHT + attr) - end - end - end - end -end - -local function telemetryIdle(field) - return sportTelemetryPush(0x1C, 0x21, 0x0b80, field) -end - -local function telemetryUnIdle(field) - return sportTelemetryPush(0x1C, 0x20, 0x0b80, field) -end - -local function telemetryRead(field) - return sportTelemetryPush(0x1C, 0x30, 0x0b80, field) -end - -local function telemetryWrite(field, value) - return sportTelemetryPush(0x1C, 0x31, 0x0b80, field + value * 256) -end - -local telemetryPopTimeout = 0 -local function refreshNext() - if refreshState == 0 then - if #modifications > 0 then - telemetryWrite(modifications[1][1], modifications[1][2]) - modifications[1] = nil - refreshIndex = 0 - refreshState = 0 - elseif refreshIndex < #fields then - local field = fields[refreshIndex + 1] - if page > 1 then - field = fields[refreshIndex + 2] - end - if telemetryRead(field[3]) == true then - refreshState = 1 - telemetryPopTimeout = getTime() + 100 -- normal delay is 500ms - end - end - elseif refreshState == 1 then - local physicalId, primId, dataId, value = sportTelemetryPop() - if primId == 0x32 and (dataId >= 0x0b80 or dataId <= 0x0b8f) then - local fieldId = value % 256 - local field = fields[refreshIndex + 1] - if fieldId == field[3] then - value = math.floor(value / 256) - if field[2] == COMBO then - fields[refreshIndex + 1][4] = value - else - fields[refreshIndex + 1][4] = value % 256 - if page > 1 then - value = math.floor(value / 256) - fields[refreshIndex + 2][4] = value - end - end - if page > 1 then - refreshIndex = refreshIndex + 2 - else - refreshIndex = refreshIndex + 1 - end - refreshState = 0 - end - elseif getTime() > telemetryPopTimeout then - fields[refreshIndex + 1][4] = nil - if page > 1 then - fields[refreshIndex + 2][4] = nil - refreshIndex = refreshIndex + 2 - else - refreshIndex = refreshIndex + 1 - end - refreshState = 0 - end - end -end - -local function updateField(field) - local value = field[4] - if field[2] == COMBO and #field == 6 then - value = field[6][1 + value] - elseif field[2] == VALUE and #field == 8 then - value = value + field[8] - field[5] - end - - if page > 1 then - if current % 2 == 1 then - value = value + fields[current + 1][4] * 256 - elseif current % 2 == 0 then - value = fields[current - 1][4] + value * 256 - end - end - modifications[#modifications + 1] = { field[3], value } -end - --- Main -local function runFieldsPage(event) - if event == EVT_VIRTUAL_EXIT then -- exit script - telemetryUnIdle(0x80) - return 2 - elseif event == EVT_VIRTUAL_ENTER then -- toggle editing/selecting current field - if fields[current][4] ~= nil then - edit = not edit - if edit == false then - updateField(fields[current]) - end - end - elseif edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - addField(1) - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - addField(-1) - end - else - if event == EVT_VIRTUAL_NEXT then - selectField(1) - elseif event == EVT_VIRTUAL_PREV then - selectField(-1) - end - end - redrawFieldPage() - return 0 -end - -local function runConfigPage(event) - fields = configFields - return runFieldsPage(event) -end - -local function runFailsafePage(event) - fields = failsafeFields - return runFieldsPage(event) -end - -local function runRx1PinMapPage(event) - fields = rx1PinMapFields - return runFieldsPage(event) -end - -local function runRx2PinMapPage(event) - fields = rx2PinMapFields - return runFieldsPage(event) -end - -local function runRx3PinMapPage(event) - fields = rx3PinMapFields - return runFieldsPage(event) -end - --- Init -local function init() - current, edit, refreshState, refreshIndex = 1, false, 0, 0 - if LCD_W == 480 then - margin = 10 - spacing = 20 - numberPerPage = 12 - end - pages = { - runConfigPage, - runFailsafePage, - runRx1PinMapPage, - runRx2PinMapPage, - runRx3PinMapPage - } - telemetryIdle(0x80) -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_NEXT_PAGE then - if edit == false then - selectPage(1) - end - elseif event == EVT_VIRTUAL_PREV_PAGE then - if edit == false then - killEvents(event) - selectPage(-1) - end - end - - local result = pages[page](event) - refreshNext() - - return result -end - -return { init = init, run = run } - diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/FrSky SBEC.lua b/radio/sdcard/horus/SCRIPTS/TOOLS/FrSky SBEC.lua deleted file mode 100644 index 4e05de057..000000000 --- a/radio/sdcard/horus/SCRIPTS/TOOLS/FrSky SBEC.lua +++ /dev/null @@ -1,284 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - -local version = "v1.2" - -local VALUE = 0 -local COMBO = 1 - -local edit = false -local page = 1 -local current = 1 --row -local refreshState = 0 -local refreshIndex = 0 -local pageOffset = 0 -local pages = {} -local fields = {} -local modifications = {} -local margin = 1 -local spacing = 8 -local appId = 0 - -local function drawScreenTitle(title,page, pages) - if math.fmod(math.floor(getTime()/100),10) == 0 then - title = version - end - if LCD_W == 480 then - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, title, MENU_COLOR) - lcd.drawText(LCD_W-40, 5, page.."/"..pages, MENU_COLOR) - else - lcd.drawScreenTitle(title, page, pages) - end -end - -local settingsFields = { - {"SBEC OUTPUT (V)", VALUE, 0x80, nil, 50, 84 }, - {"Physical ID", VALUE, 0x01, nil, 0, 26 }, - {"Application IDgroup", VALUE, 0x0D, nil, 0, 15 }, - {"Data rate(*100ms)", VALUE, 0x22, nil, 1, 255 }, -} - --- Change display attribute to current field -local function addField(step) - local field = fields[current] - local min, max - if field[2] == VALUE then - min = field[5] - max = field[6] - elseif field[2] == COMBO then - min = 0 - max = #(field[5]) - 1 - end - if field[2] ~= FLPOT then --only read ? - if field[2] == VALUE and field[6] > 256 then - if field[4] > 1000 then - step = step * 50 - field[4] = math.floor(field[4]/50) - field[4] = field[4] *50 - elseif field[4] > 500 then - step = step * 20 - field[4] = math.floor(field[4]/20) - field[4] = field[4] *20 - elseif field[4] > 200 then - step = step * 10 - field[4] = math.floor(field[4]/10) - field[4] = field[4] *10 - else - step = step * 1 - field[4] = math.floor(field[4]/1) - field[4] = field[4] *1 - end - end - if (step < 0 and field[4] > min) or (step > 0 and field[4] < max) then - field[4] = field[4] + step - end - else - field[4] = field[4] - end -end - - --- Select the next or previous editable field -local function selectField(step) - current = current + step - if current > #fields then - current = #fields - elseif current < 1 then - current = 1 - end - if current > 7 + pageOffset then - pageOffset = current - 7 - elseif current <= pageOffset then - pageOffset = current - 1 - end -end - -local function drawProgressBar() - if LCD_W == 480 then - local width = (300 * refreshIndex) / #fields - lcd.drawRectangle(100, 10, 300, 6) - lcd.drawFilledRectangle(102, 13, width, 2); - else - local width = (60 * refreshIndex) / #fields - lcd.drawRectangle(45, 1, 60, 6) - lcd.drawFilledRectangle(47, 3, width, 2); - end -end - --- Redraw the current page -local function redrawFieldsPage() - lcd.clear() - drawScreenTitle("SBEC", page, #pages) - if refreshIndex < #fields then - drawProgressBar() - end - for index = 1, 7, 1 do - local field = fields[pageOffset+index] - if field == nil then - break - end - local attr = current == (pageOffset+index) and ((edit == true and BLINK or 0) + INVERS) or 0 - lcd.drawText(1, margin+ spacing * index, field[1]) - if field[4] == nil then - lcd.drawText(LCD_W, margin+ spacing * index, "---", attr + RIGHT) - else - if field[2] == VALUE then - if field[3] == 0x80 then - lcd.drawNumber(LCD_W, margin+ spacing * index, field[4] , attr + RIGHT + PREC1) - else - lcd.drawNumber(LCD_W, margin+ spacing * index, field[4] , attr + RIGHT) - end - end - end - end -end - -local function telemetryRead(fieldx) - return sportTelemetryPush(0x17, 0x30, appId, fieldx) -end - -local function telemetryIdle(field) - return sportTelemetryPush(0x17, 0x21, appId, field) -end - -local function telemetryUnIdle(field) - return sportTelemetryPush(0x17, 0x20, appId, field) -end - -local function telemetryWrite(fieldx, valuex) - return sportTelemetryPush(0x17, 0x31, appId, fieldx + valuex*256) -end - -local telemetryPopTimeout = 0 -local function refreshNext() - if refreshState == 0 then - if #modifications > 0 then - local modificationstmp = modifications[1][2] - telemetryWrite(modifications[1][1], modificationstmp) - refreshIndex = 0 - modifications[1] = nil - elseif refreshIndex < #fields then - local field = fields[refreshIndex + 1] - if telemetryRead(field[3]) == true then - refreshState = 1 - telemetryPopTimeout = getTime() + 80 - end - end - elseif refreshState == 1 then - local physicalId, primId, dataId, value = sportTelemetryPop() - if primId == 0x32 and dataId == appId then - local fieldId = value % 256 - local field = fields[refreshIndex + 1] - if fieldId == field[3] then - local value = math.floor(value / 256) - if field[2] == VALUE then - value = value - end - - fields[refreshIndex + 1][4] = value - refreshIndex = refreshIndex + 1 - refreshState = 0 - end - elseif getTime() > telemetryPopTimeout then - refreshState = 0 - end - end -end - -local function updateField(field) - local value = field[4] - if field[2] == VALUE and #field == 6 then - value = value - end - modifications[#modifications+1] = {field[3], value} -end - --- Main1 -local function runFieldsPage(event) - if event == EVT_VIRTUAL_EXIT then - telemetryUnIdle(0x80) - return 2 - elseif event == EVT_VIRTUAL_ENTER then - if fields[current][4] ~= nil then - edit = not edit - if edit == false then - updateField(fields[current]) - end - end - elseif edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - addField(1) - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - addField(-1) - end - else - if event == EVT_VIRTUAL_NEXT then - selectField(1) - elseif event == EVT_VIRTUAL_PREV then - selectField(-1) - end - end - redrawFieldsPage() - return 0 -end - -local function runSettingsPage(event) - fields = settingsFields - return runFieldsPage(event) -end - --- Init -local function init() - current, edit, refreshState, refreshIndex = 1, false, 0, 0 - if LCD_W == 480 then - margin = 10 - spacing = 20 - end - - pages = { - runSettingsPage, - } - - for index = 1, 40, 1 do - local sensor = model.getSensor(index) - if sensor ~= nil and sensor.id >= 0x0e50 and sensor.id <= 0x0e5f then - appId = sensor.id - break - end - end - - if appId == 0 then - error("No SBEC sensor in this model!") - end - - telemetryIdle(0x80) -end - -local function run(event) - if event == nil then - error("Cannot run as a model script!") - return 2 - end - local result = pages[page](event) - - refreshNext() - - return result -end - -return { init=init, background=background, run=run } diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/FrSky SxR.lua b/radio/sdcard/horus/SCRIPTS/TOOLS/FrSky SxR.lua deleted file mode 100755 index 7bbf9a13d..000000000 --- a/radio/sdcard/horus/SCRIPTS/TOOLS/FrSky SxR.lua +++ /dev/null @@ -1,363 +0,0 @@ ---- - ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------ # # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - -local version = "v2.00" - -local VALUE = 0 -local COMBO = 1 - -local COLUMN_2 = 300 - -local edit = false -local page = 1 -local current = 1 -local refreshState = 0 -local refreshIndex = 0 -local calibrationState = 0 -local pageOffset = 0 -local calibrationStep = 0 -local pages = {} -local fields = {} -local modifications = {} -local wingBitmaps = {} -local mountBitmaps = {} -local margin = 1 -local spacing = 8 -local counter = 0 - -local configFields = { - { "Wing type", COMBO, 0x80, nil, { "Normal", "Delta", "VTail" } }, - { "Mounting type", COMBO, 0x81, nil, { "Horz", "Horz rev.", "Vert", "Vert rev." } }, -} - -local wingBitmapsFile = { "/SCRIPTS/TOOLS/bmp/plane.bmp", "/SCRIPTS/TOOLS/bmp/delta.bmp", "/SCRIPTS/TOOLS/bmp/vtail.bmp" } -local mountBitmapsFile = { "/SCRIPTS/TOOLS/bmp/horz.bmp", "/SCRIPTS/TOOLS/bmp/horz-r.bmp", "/SCRIPTS/TOOLS/bmp/vert.bmp", "/SCRIPTS/TOOLS/bmp/vert-r.bmp" } - -local settingsFields = { - {"SxR functions", COMBO, 0x9C, nil, { "Disable", "Enable" } }, - {"Quick Mode:", COMBO, 0xAA, nil, { "Disable", "Enable" } }, - {"CH5 mode", COMBO, 0xA8, nil, { "AIL2", "AUX1" } }, - {"CH6 mode", COMBO, 0xA9, nil, { "ELE2", "AUX2" } }, - {"AIL direction", COMBO, 0x82, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"ELE direction", COMBO, 0x83, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"RUD direction", COMBO, 0x84, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"AIL2 direction", COMBO, 0x9A, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"ELE2 direction", COMBO, 0x9B, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"AIL stab gain", VALUE, 0x85, nil, 0, 200, "%"}, - {"ELE stab gain", VALUE, 0x86, nil, 0, 200, "%"}, - {"RUD stab gain", VALUE, 0x87, nil, 0, 200, "%"}, - {"AIL autolvl gain", VALUE, 0x88, nil, 0, 200, "%"}, - {"ELE autolvl gain", VALUE, 0x89, nil, 0, 200, "%"}, - {"ELE hover gain", VALUE, 0x8C, nil, 0, 200, "%"}, - {"RUD hover gain", VALUE, 0x8D, nil, 0, 200, "%"}, - {"AIL knife gain", VALUE, 0x8E, nil, 0, 200, "%"}, - {"RUD knife gain", VALUE, 0x90, nil, 0, 200, "%"}, - {"AIL autolvl offset", VALUE, 0x91, nil, -20, 20, "%", 0x6C}, - {"ELE autolvl offset", VALUE, 0x92, nil, -20, 20, "%", 0x6C}, - {"ELE hover offset", VALUE, 0x95, nil, -20, 20, "%", 0x6C}, - {"RUD hover offset", VALUE, 0x96, nil, -20, 20, "%", 0x6C}, - {"AIL knife offset", VALUE, 0x97, nil, -20, 20, "%", 0x6C}, - {"RUD knife offset", VALUE, 0x99, nil, -20, 20, "%", 0x6C}, -} - -local calibrationFields = { - { "X:", VALUE, 0x9E, 0, -100, 100, "%" }, - { "Y:", VALUE, 0x9F, 0, -100, 100, "%" }, - { "Z:", VALUE, 0xA0, 0, -100, 100, "%" } -} - -local function drawScreenTitle(title, page, pages) - if math.fmod(math.floor(getTime() / 100), 10) == 0 then - title = version - end - if LCD_W == 480 then - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, title, MENU_COLOR) - lcd.drawText(LCD_W - 40, 5, page .. "/" .. pages, MENU_COLOR) - else - lcd.drawScreenTitle(title, page, pages) - end -end - --- Change display attribute to current field -local function addField(step) - local field = fields[current] - local min, max - if field[2] == VALUE then - min = field[5] - max = field[6] - elseif field[2] == COMBO then - min = 0 - max = #(field[5]) - 1 - end - if (step < 0 and field[4] > min) or (step > 0 and field[4] < max) then - field[4] = field[4] + step - end -end - --- Select the next or previous page -local function selectPage(step) - page = 1 + ((page + step - 1 + #pages) % #pages) - refreshIndex = 0 - calibrationStep = 0 - pageOffset = 0 -end - --- Select the next or previous editable field -local function selectField(step) - current = 1 + ((current + step - 1 + #fields) % #fields) - if current > 7 + pageOffset then - pageOffset = current - 7 - elseif current <= pageOffset then - pageOffset = current - 1 - end -end - -local function drawProgressBar() - if LCD_W == 480 then - local width = (300 * refreshIndex) / #fields - lcd.drawRectangle(100, 10, 300, 6) - lcd.drawFilledRectangle(102, 13, width, 2); - else - local width = (60 * refreshIndex) / #fields - lcd.drawRectangle(45, 1, 60, 6) - lcd.drawFilledRectangle(47, 3, width, 2); - end -end - --- Redraw the current page -local function redrawFieldsPage(event) - lcd.clear() - drawScreenTitle("SxR", page, #pages) - - if refreshIndex < #fields then - drawProgressBar() - end - - for index = 1, 10, 1 do - local field = fields[pageOffset + index] - if field == nil then - break - end - - local attr = current == (pageOffset + index) and ((edit == true and BLINK or 0) + INVERS) or 0 - - lcd.drawText(1, margin + spacing * index, field[1], attr) - - if field[4] == nil then - lcd.drawText(LCD_W, margin + spacing * index, "---", RIGHT + attr) - else - if field[2] == VALUE then - lcd.drawNumber(LCD_W, margin + spacing * index, field[4], RIGHT + attr) - elseif field[2] == COMBO then - if field[4] >= 0 and field[4] < #(field[5]) then - lcd.drawText(LCD_W, margin + spacing * index, field[5][1 + field[4]], RIGHT + attr) - end - end - end - end -end - -local function telemetryRead(field) - return sportTelemetryPush(0x17, 0x30, 0x0C30, field) -end - -local function telemetryWrite(field, value) - return sportTelemetryPush(0x17, 0x31, 0x0C30, field + value * 256) -end - -local telemetryPopTimeout = 0 -local function refreshNext() - if refreshState == 0 then - if calibrationState == 1 then - if telemetryWrite(0x9D, calibrationStep) == true then - refreshState = 1 - calibrationState = 2 - telemetryPopTimeout = getTime() + 120 -- normal delay is 500ms - end - elseif #modifications > 0 then - telemetryWrite(modifications[1][1], modifications[1][2]) - modifications[1] = nil - elseif refreshIndex < #fields then - local field = fields[refreshIndex + 1] - if telemetryRead(field[3]) == true then - refreshState = 1 - telemetryPopTimeout = getTime() + 80 -- normal delay is 500ms - end - end - elseif refreshState == 1 then - local physicalId, primId, dataId, value = sportTelemetryPop() - if physicalId == 0x1A and primId == 0x32 and dataId == 0x0C30 then - local fieldId = value % 256 - if calibrationState == 2 then - if fieldId == 0x9D then - refreshState = 0 - calibrationState = 0 - calibrationStep = (calibrationStep + 1) % 7 - end - else - local field = fields[refreshIndex + 1] - if fieldId == field[3] then - local value = math.floor(value / 256) - if field[3] == 0xAA then - value = bit32.band(value, 0x0001) - end - if field[3] >= 0x9E and field[3] <= 0xA0 then - local b1 = value % 256 - local b2 = math.floor(value / 256) - value = b1 * 256 + b2 - value = value - bit32.band(value, 0x8000) * 2 - end - if field[2] == COMBO and #field == 6 then - for index = 1, #(field[6]), 1 do - if value == field[6][index] then - value = index - 1 - break - end - end - elseif field[2] == VALUE and #field == 8 then - value = value - field[8] + field[5] - end - fields[refreshIndex + 1][4] = value - refreshIndex = refreshIndex + 1 - refreshState = 0 - end - end - elseif getTime() > telemetryPopTimeout then - fields[refreshIndex + 1][4] = nil - refreshIndex = refreshIndex + 1 - refreshState = 0 - calibrationState = 0 - end - end -end - -local function updateField(field) - local value = field[4] - if field[2] == COMBO and #field == 6 then - value = field[6][1 + value] - elseif field[2] == VALUE and #field == 8 then - value = value + field[8] - field[5] - end - modifications[#modifications + 1] = { field[3], value } -end - --- Main -local function runFieldsPage(event) - if event == EVT_VIRTUAL_EXIT then -- exit script - return 2 - elseif event == EVT_VIRTUAL_ENTER then -- toggle editing/selecting current field - if fields[current][4] ~= nil then - edit = not edit - if edit == false then - updateField(fields[current]) - end - end - elseif edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - addField(1) - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - addField(-1) - end - else - if event == EVT_VIRTUAL_NEXT then - selectField(1) - elseif event == EVT_VIRTUAL_PREV then - selectField(-1) - end - end - redrawFieldsPage(event) - return 0 -end - -local function runConfigPage(event) - fields = configFields - local result = runFieldsPage(event) - if LCD_W == 128 then - local mountText = { "Label is facing the sky", "Label is facing ground", "Label is left when", "Label is right when" } - if fields[2][4] ~= nil then - lcd.drawText(1, 30, "Pins toward tail") - lcd.drawText(1, 40, mountText[1 + fields[2][4]]) - if fields[2][4] > 1 then - lcd.drawText(1, 50, "looking from the tail") - end - end - else - if fields[1][4] ~= nil then - if LCD_W == 480 then - if wingBitmaps[1 + fields[1][4]] == nil then - wingBitmaps[1 + fields[1][4]] = Bitmap.open(wingBitmapsFile[1 + fields[1][4]]) - end - lcd.drawBitmap(wingBitmaps[1 + fields[1][4]], 10, 90) - else - lcd.drawPixmap(20, 28, wingBitmapsFile[1 + fields[1][4]]) - end - end - if fields[2][4] ~= nil then - if LCD_W == 480 then - if mountBitmaps[1 + fields[2][4]] == nil then - mountBitmaps[1 + fields[2][4]] = Bitmap.open(mountBitmapsFile[1 + fields[2][4]]) - end - lcd.drawBitmap(mountBitmaps[1 + fields[2][4]], 190, 110) - else - lcd.drawPixmap(128, 28, mountBitmapsFile[1 + fields[2][4]]) - end - end - end - return result -end - -local function runSettingsPage(event) - fields = settingsFields - return runFieldsPage(event) -end - --- Init -local function init() - current, edit, refreshState, refreshIndex = 1, false, 0, 0 - if LCD_W == 480 then - margin = 10 - spacing = 20 - wingBitmapsFile = { "/SCRIPTS/TOOLS/img/plane_b.png", "/SCRIPTS/TOOLS/img/delta_b.png", "/SCRIPTS/TOOLS/img/planev_b.png" } - mountBitmapsFile = { "/SCRIPTS/TOOLS/img/up.png", "/SCRIPTS/TOOLS/img/down.png", "/SCRIPTS/TOOLS/img/vert.png", "/SCRIPTS/TOOLS/img/vert-r.png" } - end - pages = { - runConfigPage, - runSettingsPage, - } -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_NEXT_PAGE then - selectPage(1) - elseif event == EVT_VIRTUAL_PREV_PAGE then - killEvents(event); - selectPage(-1) - end - - local result = pages[page](event) - refreshNext() - - return result -end - -return { init = init, run = run } - diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/Graupner HoTT.lua b/radio/sdcard/horus/SCRIPTS/TOOLS/Graupner HoTT.lua deleted file mode 100644 index d0a7d4af8..000000000 --- a/radio/sdcard/horus/SCRIPTS/TOOLS/Graupner HoTT.lua +++ /dev/null @@ -1,171 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - - ---############################################################################### --- Multi buffer for HoTT description --- To start operation: --- Write "HoTT" at address 0..3 --- Write 0xFF at address 4 will request the buffer to be cleared --- Write 0x0F at address 5 --- Read buffer from address 6 access the RX text for 168 bytes, 21 caracters --- by 8 lines --- Write at address 5 sends an order to the RX: 0xXF=start, 0xX7=prev page, --- 0xXE=next page, 0xX9=enter, 0xXD=next or 0xXB=prev with X being the sensor --- to request data from 8=RX only, 9=Vario, A=GPS, B=Cust, C=ESC, D=GAM, E=EAM --- Write at address 4 the value 0xFF will request the buffer to be cleared --- !! Before exiting the script must write 0 at address 0 for normal operation !! ---############################################################################### - -HoTT_Sensor = 0 -Timer_128 = 100 - -local function HoTT_Release() - multiBuffer( 0, 0 ) -end - -local function HoTT_Send(button) - multiBuffer( 5, 0x80+(HoTT_Sensor*16) + button) -end - -local function HoTT_Sensor_Inc() - local detected_sensors=multiBuffer( 4 ) - local a - if detected_sensors ~= 0xFF then - repeat - HoTT_Sensor=(HoTT_Sensor+1)%7 -- Switch to next sensor - if HoTT_Sensor ~= 0 then - a = math.floor(detected_sensors/ (2^(HoTT_Sensor-1))) -- shift right - end - until HoTT_Sensor==0 or a % 2 == 1 - HoTT_Send( 0x0F ) - end -end - -local function HoTT_Draw_LCD() - local i - local value - local line - local result - local offset=0 - - local sensor_name = { "", "+Vario", "+GPS", "+Cust", "+ESC", "+GAM", "+EAM" } - - lcd.clear() - - if LCD_W == 480 then - --Draw title - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, "Graupner HoTT: config RX" .. sensor_name[HoTT_Sensor+1] .. " - Menu cycle Sensors", MENU_TITLE_COLOR) - --Draw RX Menu - if multiBuffer( 4 ) == 0xFF then - lcd.drawText(10,50,"No HoTT telemetry...", BLINK) - else - for line = 0, 7, 1 do - for i = 0, 21-1, 1 do - value=multiBuffer( line*21+6+i ) - if value > 0x80 then - value = value - 0x80 - lcd.drawText(10+i*16,32+20*line,string.char(value).." ",INVERS) - else - lcd.drawText(10+i*16,32+20*line,string.char(value)) - end - end - end - end - else - --Draw RX Menu on LCD_W=128 - if multiBuffer( 4 ) == 0xFF then - lcd.drawText(2,17,"No HoTT telemetry...",SMLSIZE) - else - if Timer_128 ~= 0 then - --Intro page - Timer_128 = Timer_128 - 1 - lcd.drawScreenTitle("Graupner Hott",0,0) - lcd.drawText(2,17,"Configuration of RX" .. sensor_name[HoTT_Sensor+1] ,SMLSIZE) - lcd.drawText(2,37,"Press menu to cycle Sensors" ,SMLSIZE) - else - --Menu page - for line = 0, 7, 1 do - for i = 0, 21-1, 1 do - value=multiBuffer( line*21+6+i ) - if value > 0x80 then - value = value - 0x80 - lcd.drawText(2+i*6,1+8*line,string.char(value).." ",SMLSIZE+INVERS) - else - lcd.drawText(2+i*6,1+8*line,string.char(value),SMLSIZE) - end - end - end - end - end - end -end - --- Init -local function HoTT_Init() - --Set protocol to talk to - multiBuffer( 0, string.byte('H') ) - --test if value has been written - if multiBuffer( 0 ) ~= string.byte('H') then - error("Not enough memory!") - return 2 - end - multiBuffer( 1, string.byte('o') ) - multiBuffer( 2, string.byte('T') ) - multiBuffer( 3, string.byte('T') ) - --Request init of the RX buffer - multiBuffer( 4, 0xFF ) - --Request RX to send the config menu - HoTT_Send( 0x0F ) - HoTT_Sensor = 0; - HoTT_Detected_Sensors=0; - Timer_128 = 100 -end - --- Main -local function HoTT_Run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_EXIT then - HoTT_Release() - return 2 - else - if event == EVT_VIRTUAL_PREV_PAGE then - killEvents(event) - HoTT_Send( 0x07 ) - elseif event == EVT_VIRTUAL_ENTER then - HoTT_Send( 0x09 ) - elseif event == EVT_VIRTUAL_PREV then - HoTT_Send( 0x0B ) - elseif event == EVT_VIRTUAL_NEXT then - HoTT_Send( 0x0D ) - elseif event == EVT_VIRTUAL_NEXT_PAGE then - HoTT_Send( 0x0E ) - elseif event == EVT_VIRTUAL_MENU then - Timer_128 = 100 - HoTT_Sensor_Inc() - else - HoTT_Send( 0x0F ) - end - HoTT_Draw_LCD() - return 0 - end -end - -return { init=HoTT_Init, run=HoTT_Run } diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/MultiChan.txt b/radio/sdcard/horus/SCRIPTS/TOOLS/MultiChan.txt deleted file mode 100644 index 305451422..000000000 --- a/radio/sdcard/horus/SCRIPTS/TOOLS/MultiChan.txt +++ /dev/null @@ -1,192 +0,0 @@ -24,0,Assan,Std,0,CH5,CH6,CH7,CH8 -14,0,Bayang,Std,1,Flip,RTH,Pict,Video,HLess,Invert,Rates,n-a,n-a,AnAux1,AnAux2 -14,1,Bayang,H8S3D,1,Flip,RTH,Pict,Video,HLess,Invert,Rates -14,2,Bayang,X16_AH,1,Flip,RTH,Pict,Video,HLess,Invert,Rates,TakeOf -14,3,Bayang,IRDRONE,1,Flip,RTH,Pict,Video,HLess,Invert,Rates,TakeOf,EmStop -14,4,Bayang,DHD_D4,1,Flip,RTH,Pict,Video,HLess,Invert,Rates,TakeOf,EmStop -14,5,Bayang,QX100,1,Flip,RTH,Pict,Video,HLess,Invert,Rates,TakeOf,EmStop -59,0,BayangRX,RX,1,AnAux1,AnAux2,Flip,RTH,Pict,Video -59,1,BayangRX,CPPM,1,AnAux1,AnAux2,Flip,RTH,Pict,Video -41,0,Bugs,3-6-8,0,Arm,Angle,Flip,Pict,Video,LED -42,0,BugsMini,Mini,0,Arm,Angle,Flip,Pict,Video,LED -42,1,BugsMini,3H,0,Arm,Angle,Flip,Pict,Video,LED,AltHol -34,0,Cabell,V3,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -34,1,Cabell,V3Telem,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -13,0,CG023,Std,1,Flip,Light,Pict,Video,HLess -13,1,CG023,YD829,1,Flip,n-a,Pict,Video,HLess -37,0,Corona,COR_V1,0,CH5,CH6,CH7,CH8 -37,1,Corona,COR_V2,0,CH5,CH6,CH7,CH8 -37,2,Corona,FD_V3,0,CH5,CH6,CH7,CH8 -12,0,CX10,Green,1,Flip,Rate -12,1,CX10,Blue,1,Flip,Rate,Pict,Video -12,2,CX10,DM007,1,Flip,Mode,Pict,Video,HLess -12,4,CX10,JC3015_1,1,Flip,Mode,Pict,Video -12,5,CX10,JC3015_2,1,Flip,Mode,LED,DFlip -12,6,CX10,MK33041,1,Flip,Mode,Pict,Video,HLess,RTH -7,0,Devo,8CH,0,CH5,CH6,CH7,CH8 -7,1,Devo,10CH,0,CH5,CH6,CH7,CH8,CH9,CH10 -7,2,Devo,12CH,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12 -7,3,Devo,6CH,0,CH5,CH6 -7,4,Devo,7CH,0,CH5,CH6,CH7 -33,0,DM022,Std,1,Flip,LED,Cam1,Cam2,HLess,RTH,RLow -6,0,DSM,2_22,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,n-a,ThKill -6,1,DSM,2_11,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,n-a,ThKill -6,2,DSM,X_22,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,n-a,ThKill -6,3,DSM,X_11,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,n-a,ThKill -6,4,DSM,AUTO,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,n-a,ThKill -70,0,DSM_RX,RX,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12 -70,1,DSM_RX,CPPM,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12 -45,0,E01X,E012,1,n-a,Flip,n-a,HLess,RTH -45,1,E01X,E015,1,Arm,Flip,LED,HLess,RTH -16,0,ESKY,Std,0,Gyro,Pitch -16,1,ESKY,ET4,0,Gyro,Pitch -35,0,ESKY150,4CH,0 -35,1,ESKY150,7CH,0,FMode,Aux6,Aux7 -69,0,ESKY150V2,Std,0,CH5_RA,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -1,0,Flysky,Flysky,0,CH5,CH6,CH7,CH8 -1,1,Flysky,V9x9,1,Flip,Light,Pict,Video -1,2,Flysky,V6x6,1,Flip,Light,Pict,Video,HLess,RTH,XCAL,YCAL -1,3,Flysky,V912,1,BtmBtn,TopBtn -1,4,Flysky,CX20,0,CH5,CH6,CH7 -28,0,Flysky_AFHDS2A,PWM_IBUS,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 -28,1,Flysky_AFHDS2A,PPM_IBUS,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 -28,2,Flysky_AFHDS2A,PWM_SBUS,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 -28,3,Flysky_AFHDS2A,PPM_SBUS,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 -28,4,Flysky_AFHDS2A,PWM_IB16,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -28,5,Flysky_AFHDS2A,PPM_IB16,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -56,0,Flysky2A_RX,RX,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 -56,1,Flysky2A_RX,CPPM,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 -53,0,Height,5ch,0,Gear -53,1,Height,8ch,0,Gear,Gyro,Flap,Light -25,0,FrSkyV,V8,0,CH5,CH6,CH7,CH8 -3,0,FrSkyD,D8,0,CH5,CH6,CH7,CH8 -3,0,FrSkyD,D8Cloned,0,CH5,CH6,CH7,CH8 -67,0,FrSkyL,LR12,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12 -67,1,FrSkyL,LR12_6CH,0,CH5,CH6 -15,0,FrSkyX,D16_FCC,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -15,1,FrSkyX,D16_8CH_FCC,0,CH5,CH6,CH7,CH8 -15,2,FrSkyX,D16_LBT,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -15,3,FrSkyX,D16_8CH_LBT,0,CH5,CH6,CH7,CH8 -15,4,FrSkyX,D16Cloned,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -15,5,FrSkyX,D16Cloned_8CH,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -64,0,FrSkyX2,D16_FCC,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -64,1,FrSkyX2,D16_8CH_FCC,0,CH5,CH6,CH7,CH8 -64,2,FrSkyX2,D16_LBT,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -64,3,FrSkyX2,D16_8CH_LBT,1,CH5,CH6,CH7,CH8 -64,4,FrSkyX2,D16Cloned,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -64,5,FrSkyX2,D16Cloned_8CH,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -65,0,FrSkyR9,R9_915,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -65,1,FrSkyR9,R9_868,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -65,2,FrSkyR9,R9_915_8CH,0,CH5,CH6,CH7,CH8 -65,3,FrSkyR9,R9_968_8CH,0,CH5,CH6,CH7,CH8 -55,0,FrSkyRX,RX,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -55,1,FrSkyRX,CloneTX,0 -55,2,FrSkyRX,EraseTX,0 -55,3,FrSkyRX,CPPM,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -58,0,FX816,P38,1 -20,0,FY326,FY326,1,Flip,RTH,HLess,Expert,Calib -20,1,FY326,FY319,1,Flip,RTH,HLess,Expert,Calib -23,0,FY326,FY326,1,Flip,RTH,HLess,Expert -47,0,GD00x,V1,1,Trim,LED,Rate -47,1,GD00x,V2,1,Trim,LED,Rate -32,0,GW008,FY326,1,Flip -36,0,H8_3D,Std,1,Flip,Light,Pict,Video,RTH,FlMode,Cal1 -36,1,H8_3D,H20H,1,Flip,Light,Pict,Video,Opt1,Opt2,Cal1,Cal2,Gimbal -36,2,H8_3D,H20,1,Flip,Light,Pict,Video,Opt1,Opt2,Cal1,Cal2,Gimbal -36,3,H8_3D,H30,1,Flip,Light,Pict,Video,Opt1,Opt2,Cal1,Cal2,Gimbal -4,0,Hisky,Std,0,Gear,Pitch,Gyro,CH8 -4,1,Hisky,HK310,0,Aux -39,0,Hitec,Opt_Fw,0,CH5,CH6,CH7,CH8,CH9 -39,1,Hitec,Opt_Hub,0,CH5,CH6,CH7,CH8,CH9 -39,2,Hitec,Minima,0,CH5,CH6,CH7,CH8,CH9 -26,0,Hontai,Std,1,Flip,LED,Pict,Video,HLess,RTH,Calib -26,1,Hontai,JJRCX1,1,Flip,Arm,Pict,Video,HLess,RTH,Calib -26,2,Hontai,X5C1,1,Flip,Arm,Pict,Video,HLess,RTH,Calib -26,3,Hontai,FQ777_951,1,Flip,Arm,Pict,Video,HLess,RTH,Calib -57,0,HoTT,Sync,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -57,1,HoTT,No_Sync,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -2,0,Hubsan,H107,1,Flip,Light,Pict,Video,HLess -2,1,Hubsan,H301,0,RTH,Light,Stab,Video -2,2,Hubsan,H501,0,RTH,Light,Pict,Video,HLess,GPS_H,ALT_H,Flip,FModes -22,0,J6Pro,Std,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12 -71,0,JJRC345,JJRC345,1,Flip,HLess,RTH,LED,UNK1,UNK2,UNK3 -71,1,JJRC345,SkyTmblr,1,Flip,HLess,RTH,LED,UNK1,UNK2,UNK3 -49,0,KF606,Std,1,Trim -9,0,KN,WLToys,0,DRate,THold,IdleUp,Gyro,Ttrim,Atrim,Etrim -9,1,KN,Feilun,0,DRate,THold,IdleUp,Gyro,Ttrim,Atrim,Etrim -73,0,Kyosho,Std,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 -18,0,MJXQ,WHL08,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate -18,1,MJXQ,X600,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate -18,2,MJXQ,X800,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate -18,3,MJXQ,H26D,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate -18,4,MJXQ,E010,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate -18,5,MJXQ,H26WH,1,Flip,Arm,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate -18,6,MJXQ,Phoenix,1,Flip,Arm,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate -17,0,MT99XX,Std,1,Flip,LED,Pict,Video,HLess -17,1,MT99XX,H7,1,Flip,LED,Pict,Video,HLess -17,2,MT99XX,YZ,1,Flip,LED,Pict,Video,HLess -17,3,MT99XX,LS,1,Flip,Invert,Pict,Video,HLess -17,4,MT99XX,FY805,1,Flip,n-a,n-a,n-a,HLess -17,5,MT99XX,A180,0,3D_6G -17,6,MT99XX,Dragon,0,Mode,RTH -44,0,NCC1701,Std,1,Warp -77,0,OMP,M2,0,THold,IdleUp,6G_3D -60,0,Pelikan,PRO_V4,0,CH5,CH6,CH7,CH8 -60,1,Pelikan,LITE_V4,0,CH5,CH6,CH7,CH8 -51,0,Potensic,A20,1,TakLan,Emerg,Mode,HLess -66,0,Propel,74-Z,1,LEDs,RollCW,RolCCW,Fire,Weapon,Calib,AltHol,TakeOf,Land,Train -29,0,Q2x2,Q222,1,Flip,LED,Mod2,Mod1,HLess,RTH,XCal,YCal -29,1,Q2x2,Q242,1,Flip,LED,Pict,Video,HLess,RTH,XCal,YCal -29,2,Q2x2,Q282,1,Flip,LED,Pict,Video,HLess,RTH,XCal,YCal -31,0,Q303,Q303,1,AltHol,Flip,Pict,Video,HLess,RTH,Gimbal -31,1,Q303,C35,1,Arm,VTX,Pict,Video,n-a,RTH,Gimbal -31,2,Q303,CX10D,1,Arm,Flip -31,3,Q303,CX10WD,1,Arm,Flip -72,0,Q90C,Std,0,FMode,VTX+ -74,0,RadioLink,Surface,0,CH5,CH6,CH7,CH8,FS_CH1,FS_CH2,FS_CH3,FS_CH4,FS_CH5,FS_CH6,FS_CH7,FS_CH8 -74,1,RadioLink,Air,0,CH5,CH6,CH7,CH8,FS_CH1,FS_CH2,FS_CH3,FS_CH4,FS_CH5,FS_CH6,FS_CH7,FS_CH8 -74,2,RadioLink,DumboRC,0,CH5,CH6,CH7,CH8,FS_CH1,FS_CH2,FS_CH3,FS_CH4,FS_CH5,FS_CH6,FS_CH7,FS_CH8 -76,0,Realacc,R11,1,Flip,Light,Calib,HLess,RTH,UNK -50,0,Redpine,Fast,0,sCH5,sCH6,sCH7,sCH8,sCH9,sCH10,sCH11,sCH12,sCH13,sCH14,sCH15,sCH16 -50,1,Redpine,Slow,0,sCH5,sCH6,sCH7,sCH8,sCH9,sCH10,sCH11,sCH12,sCH13,sCH14,sCH15,sCH16 -21,0,Futaba,SFHSS,0,CH5,CH6,CH7,CH8 -19,0,Shenqi,Cycle,1 -68,0,Skyartec,Std,0,CH5,CH6,CH7 -11,0,SLT,V1,0,Gear,Pitch -11,1,SLT,V2,0,CH5,CH6,CH7,CH8 -11,2,SLT,Q100,0,Rates,n-a,CH7,CH8,Mode,Flip,n-a,n-a,Calib -11,3,SLT,Q200,0,Rates,n-a,CH7,CH8,Mode,VidOn,VidOff,Calib -11,4,SLT,MR100,0,Rates,n-a,CH7,CH8,Mode,Flip,Video,Pict -10,0,Symax,Std,1,Flip,Rates,Pict,Video,HLess -10,1,Symax,X5C,1,Flip,Rates,Pict,Video,HLess -61,0,Tiger,Std,1,Flip,Light -43,0,Traxxas,6519,0 -5,0,V2x2,Std,1,Flip,Light,Pict,Video,HLess,CalX,CalY -5,1,V2x2,JXD506,1,Flip,Light,Pict,Video,HLess,StaSto,Emerg,Cam_UD -48,0,V761,3CH,0,Gyro,Calib,Flip,RtnAct,Rtn -48,1,V761,4CH,0,Gyro,Calib,Flip,RtnAct,Rtn -46,0,V911s,V911s,1,Calib -46,1,V911s,E119,1,Calib -22,0,WFLY,WFR0xS,0,CH5,CH6,CH7,CH8,CH9 -30,0,WK2x01,WK2801,0,CH5,CH6,CH7,CH8 -30,1,WK2x01,WK2401,0 -30,2,WK2x01,W6_5_1,0,Gear,Dis,Gyro -30,3,WK2x01,W6_6_1,0,Gear,Col,Gyro -30,4,WK2x01,W6HEL,0,Gear,Col,Gyro -30,5,WK2x01,W6HEL_I,0,Gear,Col,Gyro -62,0,XK,X450,1,FMode,TakeOf,Emerg,3D_6G,Pict,Video -62,1,XK,X420,1,FMode,TakeOf,Emerg,3D_6G,Pict,Video -8,0,YD717,Std,1,Flip,Light,Pict,Video,HLess -8,1,YD717,SkyWlkr,1,Flip,Light,Pict,Video,HLess -8,2,YD717,Simax4,1,Flip,Light,Pict,Video,HLess -8,3,YD717,XinXun,1,Flip,Light,Pict,Video,HLess -8,4,YD717,NiHui,1,Flip,Light,Pict,Video,HLess -52,0,ZSX,280,1,Light -78,0,M-Link,Std,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -79,0,WFLY2,RF20x,0,CH5,CH6,CH7,CH8,CH9,CH10 -80,0,E016Hv2,E016Hv2,1,TakLan,EmStop,Flip,Calib,HLess,RTH -81,0,E010r5,E010r5,1,Flip,LED,CALIB,HLess,RTH,GLIDE -82,0,LOLI,Std,0,CH5,CH6,CH7,CH8,1SwSePpPw,2SwSePw,3SwSe,4SwSe,5SwSeSb,6SwSe,7SwSePw,8SwSe -83,0,E129,E129,1,TakLan,EmStop,TrimA,TrimE,TrimR -84,0,JOYSWAY,Std,0 -85,0,E016H,Std,1,Stop,Flip,n-a,HLess,RTH diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/MultiChannelsUpdater.lua b/radio/sdcard/horus/SCRIPTS/TOOLS/MultiChannelsUpdater.lua deleted file mode 100644 index 14902b782..000000000 --- a/radio/sdcard/horus/SCRIPTS/TOOLS/MultiChannelsUpdater.lua +++ /dev/null @@ -1,311 +0,0 @@ - -local toolName = "TNS|Multi chan namer|TNE" - ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - -local protocol_name = "" -local sub_protocol_name = "" -local bind_ch = 0 -local module_conf = {} -local module_pos = "Internal" -local file_ok = 0 -local done = 0 -local protocol = 0 -local sub_protocol = 0 -local f_seek = 0 -local channel_names={} -local num_search = "Searching" - -local function drawScreenTitle(title) - if LCD_W == 480 then - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, title, MENU_TITLE_COLOR) - else - lcd.drawScreenTitle(title, 0, 0) - end -end - -function bitand(a, b) - local result = 0 - local bitval = 1 - while a > 0 and b > 0 do - if a % 2 == 1 and b % 2 == 1 then -- test the rightmost bits - result = result + bitval -- set the current bit - end - bitval = bitval * 2 -- shift left - a = math.floor(a/2) -- shift right - b = math.floor(b/2) - end - return result -end - -local function Multi_Draw_LCD(event) - local line = 0 - - lcd.clear() - drawScreenTitle("Multi channels namer") - - --Display settings - local lcd_opt = 0 - if LCD_W == 480 then - x_pos = 10 - y_pos = 32 - y_inc = 20 - else - x_pos = 0 - y_pos = 9 - y_inc = 8 - lcd_opt = SMLSIZE - end - - --Multi Module detection - if module_conf["Type"] ~= 6 then - if LCD_W == 480 then - lcd.drawText(10,50,"No Multi module configured...", BLINK) - else - --Draw on LCD_W=128 - lcd.drawText(2,17,"No Multi module configured...",SMLSIZE) - end - return - else - lcd.drawText(x_pos, y_pos+y_inc*line,module_pos .. " Multi detected.", lcd_opt) - line = line + 1 - end - - --Channel order - if (ch_order == -1) then - lcd.drawText(x_pos, y_pos+y_inc*line,"Channels order can't be read from Multi...", lcd_opt) - line = line + 1 - end - - --Can't open file MultiChan.txt - if file_ok == 0 then - lcd.drawText(x_pos, y_pos+y_inc*line,"Can't read MultiChan.txt file...", lcd_opt) - return - end - - if ( protocol_name == "" or sub_protocol_name == "" ) and f_seek ~=-1 then - local f = io.open("/SCRIPTS/TOOLS/MultiChan.txt", "r") - if f == nil then return end - lcd.drawText(x_pos, y_pos+y_inc*line,num_search, lcd_opt) - num_search = num_search .. "." - if #num_search > 15 then - num_search = string.sub(num_search,1,9) - end - local proto = 0 - local sub_proto = 0 - local proto_name = "" - local sub_proto_name = "" - local channels = "" - local nbr_try = 0 - local nbr_car = 0 - repeat - io.seek(f, f_seek) - local data = io.read(f, 100) -- read 100 characters - if #data ==0 then - f_seek = -1 -- end of file - break - end - proto, sub_proto, proto_name, sub_proto_name, bind_ch, channels = string.match(data,'(%d+),(%d),([%w-_ ]+),([%w-_ ]+),(%d)(.+)') - if proto ~= nil and sub_proto ~= nil and protocol_name ~= nil and sub_protocol_name ~= nil and bind_ch ~= nil then - if tonumber(proto) == protocol and tonumber(sub_proto) == sub_protocol then - protocol_name = proto_name - sub_protocol_name = sub_proto_name - bind_ch = tonumber(bind_ch) - if channels ~= nil then - --extract channel names - nbr_car = string.find(channels, "\r") - if nbr_car == nil then nbr_car = string.find(channels, "\n") end - if nbr_car ~= nil then - channels = string.sub(channels,1,nbr_car-1) - end - local i = 5 - for k in string.gmatch(channels, ",([%w-_ ]+)") do - channel_names[i] = k - i = i + 1 - end - end - f_seek = -1 -- protocol found - break - end - end - if f_seek ~= -1 then - nbr_car = string.find(data, "\n") - if nbr_car == nil then nbr_car = string.find(data, "\r") end - if nbr_car == nil then - f_seek = -1 -- end of file - break - end - f_seek = f_seek + nbr_car -- seek to next line - nbr_try = nbr_try + 1 - end - until nbr_try > 20 or f_seek == -1 - io.close(f) - end - - if f_seek ~= -1 then - return -- continue searching... - end - - --Protocol & Sub_protocol - if protocol_name == "" or sub_protocol_name == "" then - lcd.drawText(x_pos, y_pos+y_inc*line,"Unknown protocol "..tostring(protocol).."/"..tostring(sub_protocol).." ...", lcd_opt) - return - elseif LCD_W > 128 then - lcd.drawText(x_pos, y_pos+y_inc*line,"Protocol: " .. protocol_name .. " / SubProtocol: " .. sub_protocol_name, lcd_opt) - line = line + 1 - else - lcd.drawText(x_pos, y_pos+y_inc*line,"Protocol: " .. protocol_name, lcd_opt) - line = line + 1 - lcd.drawText(x_pos, y_pos+y_inc*line,"SubProtocol: " .. sub_protocol_name, lcd_opt) - line = line + 1 - end - - text1="" - text2="" - for i,v in ipairs(channel_names) do - if i<=8 then - if i==1 then - text1 = v - else - text1=text1 .. "," .. v - end - else - if i==9 then - text2 = v - else - text2=text2 .. "," .. v - end - end - end - if LCD_W > 128 then - lcd.drawText(x_pos, y_pos+y_inc*line,"Channels: " .. text1, lcd_opt) - line = line + 1 - if text2 ~= "" then - lcd.drawText(x_pos*9, y_pos+y_inc*line,text2, lcd_opt) - line = line + 1 - end - end - - if event ~= EVT_VIRTUAL_ENTER and done == 0 then - lcd.drawText(x_pos, y_pos+y_inc*line," Save", lcd_opt + INVERS + BLINK) - return - end - - lcd.drawText(x_pos, y_pos+y_inc*line,"Setting channel names.", lcd_opt) - line = line + 1 - local output, nbr - if done == 0 then - for i,v in ipairs(channel_names) do - output = model.getOutput(i-1) - output["name"] = v - model.setOutput(i-1,output) - nbr = i - end - for i = nbr, 15 do - output = model.getOutput(i) - output["name"] = "n-a" - model.setOutput(i,output) - end - if bind_ch == 1 then - output = model.getOutput(15) - output["name"] = "BindCH" - model.setOutput(15,output) - end - done = 1 - end - lcd.drawText(x_pos, y_pos+y_inc*line,"Done!", lcd_opt) - line = line + 1 -end - --- Init -local function Multi_Init() - module_conf = model.getModule(0) - if module_conf["Type"] ~= 6 then - module_pos = "External" - module_conf = model.getModule(1) - if module_conf["Type"] ~= 6 then - return - end - end - - protocol = module_conf["protocol"] - sub_protocol = module_conf["subProtocol"] - - --Exceptions on first 4 channels... - local stick_names = { "Rud", "Ele", "Thr", "Ail" } - if ( protocol == 4 and sub_protocol == 1 ) or protocol == 19 or protocol == 52 then -- Hisky/HK310, Shenqi, ZSX - stick_names[2] = "n-a" - stick_names[4] = "n-a" - elseif protocol == 43 then -- Traxxas - stick_names[2] = "Aux4" - stick_names[4] = "Aux3" - elseif ( protocol == 48 and sub_protocol == 0 ) then -- V761 3CH - stick_names[4] = "n-a" - elseif protocol == 47 or protocol == 49 or protocol == 58 then -- GD00x, KF606, FX816 - stick_names[1] = "n-a" - stick_names[2] = "n-a" - end - - --Determine fist 4 channels order - local ch_order=module_conf["channelsOrder"] - if (ch_order == -1) then - channel_names[1] = stick_names[defaultChannel(0)+1] - channel_names[2] = stick_names[defaultChannel(1)+1] - channel_names[3] = stick_names[defaultChannel(2)+1] - channel_names[4] = stick_names[defaultChannel(3)+1] - else - channel_names[bitand(ch_order,3)+1] = stick_names[4] - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = stick_names[2] - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = stick_names[3] - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = stick_names[1] - end - - --Exceptions on first 4 channels... - if ( protocol == 73 or (protocol == 74 and sub_protocol == 0) ) then -- Kyosho or RadioLink Surface - channel_names[1] = "ST" - channel_names[2] = "THR" - channel_names[3] = "CH3" - channel_names[4] = "CH4" - end - - --Check MultiChan.txt - local f = io.open("/SCRIPTS/TOOLS/MultiChan.txt", "r") - if f == nil then return end - file_ok = 1 - io.close(f) -end - --- Main -local function Multi_Run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - else - Multi_Draw_LCD(event) - if event == EVT_VIRTUAL_EXIT then - return 2 - end - end - return 0 -end - -return { init=Multi_Init, run=Multi_Run } diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/MultiLOLI.lua b/radio/sdcard/horus/SCRIPTS/TOOLS/MultiLOLI.lua deleted file mode 100644 index 4d309e37e..000000000 --- a/radio/sdcard/horus/SCRIPTS/TOOLS/MultiLOLI.lua +++ /dev/null @@ -1,221 +0,0 @@ - -local toolName = "TNS|Multi LOLI RX config|TNE" - ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - -local loli_nok = false -local channels={ { 768, "PWM", 100, 102, "PPM", 50, -768, "Servo", 0, -2048, "Switch", -100 }, -- CH1 - { 768, "PWM", 100, -768, "Servo", 0, -2048, "Switch", -100 }, -- CH2 - { -768, "Servo", 0, -2048, "Switch", -100 }, -- CH3 - { -768, "Servo", 0, -2048, "Switch", -100 }, -- CH4 - { 102, "SBUS", 50, -768, "Servo", 0, -2048, "Switch", -100 }, -- CH5 - { -768, "Servo", 0, -2048, "Switch", -100 }, -- CH6 - { 768, "PWM", 100, -768, "Servo", 0, -2048, "Switch", -100 }, -- CH7 - { -768, "Servo", 0, -2048, "Switch", -100 } } -- CH8 - -local sel = 1 -local edit = false - -local blink = 0 -local BLINK_SPEED = 15 - -local function drawScreenTitle(title) - if LCD_W == 480 then - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, title, MENU_TITLE_COLOR) - else - lcd.drawScreenTitle(title, 0, 0) - end -end - -local function LOLI_Draw_LCD(event) - local line = 0 - - lcd.clear() - - --Display settings - local lcd_opt = 0 - if LCD_W == 480 then - drawScreenTitle("Multi - LOLI RX configuration tool") - x_pos = 152 - x_inc = 90 - y_pos = 40 - y_inc = 20 - else - x_pos = 5 - x_inc = 30 - y_pos = 1 - y_inc = 8 - lcd_opt = SMLSIZE - end - - --Multi Module detection - if loli_nok then - if LCD_W == 480 then - lcd.drawText(10,50,"The LOLI protocol is not selected...", lcd_opt) - else - --Draw on LCD_W=128 - lcd.drawText(2,17,"LOLI protocol not selected...",SMLSIZE) - end - return - end - - --Display current config - if LCD_W == 480 then - line = line + 1 - lcd.drawText(x_pos, y_pos+y_inc*line -2, "Channel", lcd_opt) - lcd.drawText(x_pos+x_inc, y_pos+y_inc*line -2, "Function", lcd_opt) - lcd.drawRectangle(x_pos-4, y_pos+y_inc*line -4 , 2*x_inc +2, 188) - lcd.drawLine(x_pos-4, y_pos+y_inc*line +18, x_pos-4 +2*x_inc +1, y_pos+y_inc*line +18, SOLID, 0) - lcd.drawLine(x_pos+x_inc -5, y_pos+y_inc*line -4, x_pos+x_inc -5, y_pos+y_inc*line -5 +188, SOLID, 0) - line = line + 1 - end - - local out - for i = 1, 8 do - out = getValue("ch"..(i+8)) - lcd.drawText(x_pos, y_pos+y_inc*line, "CH"..i, lcd_opt) - for j = 1, #channels[i], 3 do - if out > channels[i][j] then - if sel == i then - invert = INVERS - if edit == true then - blink = blink + 1 - if blink > BLINK_SPEED then - invert = 0 - if blink > BLINK_SPEED * 2 then - blink = 0 - end - end - end - else - invert = 0 - end - lcd.drawText(x_pos+x_inc, y_pos+y_inc*line, channels[i][j+1], lcd_opt + invert) - break - end - end - line = line + 1 - end -end - -local function LOLI_Change_Value(dir) - local pos = 0 - local out - --look for the current position - out = getValue("ch"..(sel+8)) - for j = 1, #channels[sel], 3 do - if out > channels[sel][j] then - pos = j - break - end - end - - --decrement or increment - if dir < 0 and pos > 1 then - pos = pos - 3 - elseif dir > 0 and pos + 3 < #channels[sel] then - pos = pos + 3 - else - return - end - - --delete all mixers for the selected channel - local num_mix = model.getMixesCount(sel-1 +8) - for i = 1, num_mix do - model.deleteMix(sel-1 +8, 0); - end - - --create new mixer - local source_max = getFieldInfo("cyc1") - - local val = { name = channels[sel][pos+1], - source = source_max.id - 1, -- MAX=100 on TX16S - weight = channels[sel][pos+2], - offset = 0, - switch = 0, - multiplex = 0, - curveType = 0, - curveValue = 0, - flightModes = 0, - carryTrim = false, - mixWarn = 0, - delayUp = 0, - delayDown = 0, - speedUp = 0, - speedDown = 0 } - model.insertMix(sel-1 +8, 0, val) -end - -local function LOLI_Menu(event) - if event == EVT_VIRTUAL_NEXT then - if edit == false then - -- not changing a value - if sel < 8 then - sel = sel + 1 - end - else - -- need to inc the value - LOLI_Change_Value(1) - end - elseif event == EVT_VIRTUAL_PREV then - if edit == false then - -- not changing a value - if sel > 1 then - sel = sel - 1 - end - else - -- need to dec the value - LOLI_Change_Value(-1) - end - elseif event == EVT_VIRTUAL_ENTER then - if edit == false then - edit = true - blink = BLINK_SPEED - else - edit = false - end - end -end - --- Init -local function LOLI_Init() - local module_conf = model.getModule(0) - if module_conf["Type"] ~= 6 or module_conf["protocol"] ~= 82 then - module_conf = model.getModule(1) - if module_conf["Type"] ~= 6 or module_conf["protocol"] ~= 82 then - loli_nok = true - end - end -end - --- Main -local function LOLI_Run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_EXIT then - return 2 - else - LOLI_Menu(event) - LOLI_Draw_LCD(event) - return 0 - end -end - -return { init=LOLI_Init, run=LOLI_Run } diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/crossfire.lua b/radio/sdcard/horus/SCRIPTS/TOOLS/crossfire.lua deleted file mode 100644 index b19bb5ee2..000000000 --- a/radio/sdcard/horus/SCRIPTS/TOOLS/crossfire.lua +++ /dev/null @@ -1,42 +0,0 @@ -local toolName = "TNS|Crossfire configure|TNE" - ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - - - --- Init -local function init() -end - --- Run -local function run(event) - if event == nil then - error("Cannot run as a model script!") - return 2 - end - - if crossfireTelemetryPush() == nil then - error("Crossfire not available!") - return 2 - end - - chdir("/SCRIPTS/TOOLS/CROSSFIRE") - return "crossfire.lua" -end - -return { init=init, run=run } diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/img/back.png b/radio/sdcard/horus/SCRIPTS/TOOLS/img/back.png deleted file mode 100755 index 2cf3cd699..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/TOOLS/img/back.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/img/delta_b.png b/radio/sdcard/horus/SCRIPTS/TOOLS/img/delta_b.png deleted file mode 100755 index 80c0302f9..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/TOOLS/img/delta_b.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/img/done.bmp b/radio/sdcard/horus/SCRIPTS/TOOLS/img/done.bmp deleted file mode 100755 index 9ac501398..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/TOOLS/img/done.bmp and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/img/down.png b/radio/sdcard/horus/SCRIPTS/TOOLS/img/down.png deleted file mode 100755 index 8eac8039a..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/TOOLS/img/down.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/img/forward.png b/radio/sdcard/horus/SCRIPTS/TOOLS/img/forward.png deleted file mode 100755 index de09680b7..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/TOOLS/img/forward.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/img/left.png b/radio/sdcard/horus/SCRIPTS/TOOLS/img/left.png deleted file mode 100755 index 658c9916b..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/TOOLS/img/left.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/img/plane_b.png b/radio/sdcard/horus/SCRIPTS/TOOLS/img/plane_b.png deleted file mode 100755 index 37abedc3a..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/TOOLS/img/plane_b.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/img/planev_b.png b/radio/sdcard/horus/SCRIPTS/TOOLS/img/planev_b.png deleted file mode 100755 index 4e33f660b..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/TOOLS/img/planev_b.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/img/planev_s.png b/radio/sdcard/horus/SCRIPTS/TOOLS/img/planev_s.png deleted file mode 100755 index 48283a290..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/TOOLS/img/planev_s.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/img/right.png b/radio/sdcard/horus/SCRIPTS/TOOLS/img/right.png deleted file mode 100755 index 01d555394..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/TOOLS/img/right.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/img/up.png b/radio/sdcard/horus/SCRIPTS/TOOLS/img/up.png deleted file mode 100755 index f033aba55..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/TOOLS/img/up.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/img/vert-r.png b/radio/sdcard/horus/SCRIPTS/TOOLS/img/vert-r.png deleted file mode 100755 index 7bfc9450c..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/TOOLS/img/vert-r.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/img/vert.png b/radio/sdcard/horus/SCRIPTS/TOOLS/img/vert.png deleted file mode 100755 index de09680b7..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/TOOLS/img/vert.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/TOOLS/readme.txt b/radio/sdcard/horus/SCRIPTS/TOOLS/readme.txt deleted file mode 100644 index 20b95c415..000000000 --- a/radio/sdcard/horus/SCRIPTS/TOOLS/readme.txt +++ /dev/null @@ -1 +0,0 @@ -Scripts that need to be available in TOOLS menu should be in this directory diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/icon.png b/radio/sdcard/horus/SCRIPTS/WIZARD/glider/icon.png deleted file mode 100755 index 6869f18e9..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/icon.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/background.png b/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/background.png deleted file mode 100755 index e21f7bc81..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/background.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/brake.png b/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/brake.png deleted file mode 100755 index 701cc2bdc..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/brake.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/flap.png b/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/flap.png deleted file mode 100755 index 074bdf8d3..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/flap.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/lail.png b/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/lail.png deleted file mode 100755 index 074bdf8d3..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/lail.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/mark_bg.png b/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/mark_bg.png deleted file mode 100755 index fbe6b0ee2..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/mark_bg.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/pagedn.png b/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/pagedn.png deleted file mode 100755 index 0733ccfa1..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/pagedn.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/pageup.png b/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/pageup.png deleted file mode 100755 index 0dbaa5202..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/pageup.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/plane.png b/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/plane.png deleted file mode 100755 index af1785270..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/plane.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/prop.png b/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/prop.png deleted file mode 100644 index 4139d3542..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/prop.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/rail.png b/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/rail.png deleted file mode 100755 index 074bdf8d3..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/rail.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/summary.png b/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/summary.png deleted file mode 100755 index 8b23b0b42..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/summary.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/tail.png b/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/tail.png deleted file mode 100755 index 6c6143cfd..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/tail.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/tail_rud.png b/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/tail_rud.png deleted file mode 100755 index a777c0c80..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/tail_rud.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/vtail.png b/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/vtail.png deleted file mode 100755 index f68035ece..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/img/vtail.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/wizard.lua b/radio/sdcard/horus/SCRIPTS/WIZARD/glider/wizard.lua deleted file mode 100644 index c06f6544c..000000000 --- a/radio/sdcard/horus/SCRIPTS/WIZARD/glider/wizard.lua +++ /dev/null @@ -1,478 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### -local VALUE = 0 -local COMBO = 1 - -local edit = false -local page = 1 -local current = 1 -local pages = {} -local fields = {} - --- 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) - local field = fields[current] - local min, max - if field[3] == VALUE then - min = field[6] - max = field[7] - elseif field[3] == COMBO then - min = 0 - max = #(field[6]) - 1 - end - if (step < 0 and field[5] > min) or (step > 0 and field[5] < max) then - field[5] = field[5] + step - end -end - --- Select the next or previous page -local function selectPage(step) - page = 1 + ((page + step - 1 + #pages) % #pages) - edit = false - current = 1 -end - --- Select the next or previous editable field -local function selectField(step) - repeat - current = 1 + ((current + step - 1 + #fields) % #fields) - until fields[current][4]==1 -end - --- Redraw the current page -local function redrawFieldsPage(event) - - for index = 1, 10, 1 do - local field = fields[index] - if field == nil then - break - end - - local attr = current == (index) and ((edit == true and BLINK or 0) + INVERS) or 0 - attr = attr + DEFAULT_COLOR - - if field[4] == 1 then - if field[3] == VALUE then - lcd.drawNumber(field[1], field[2], field[5], LEFT + attr) - elseif field[3] == COMBO then - if field[5] >= 0 and field[5] < #(field[6]) then - lcd.drawText(field[1],field[2], field[6][1+field[5]], attr) - end - end - end - end -end - -local function updateField(field) - local value = field[5] -end - --- Main -local function runFieldsPage(event) - if event == EVT_VIRTUAL_EXIT then -- exit script - return 2 - elseif event == EVT_VIRTUAL_ENTER then -- toggle editing/selecting current field - if fields[current][5] ~= nil then - edit = not edit - if edit == false then - updateField(fields[current]) - end - end - elseif edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - addField(1) - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - addField(-1) - end - else - if event == EVT_VIRTUAL_NEXT then - selectField(1) - elseif event == EVT_VIRTUAL_PREV then - selectField(-1) - end - end - redrawFieldsPage(event) - return 0 -end - --- set visibility flags starting with SECOND field of fields -local function setFieldsVisible(...) - local arg={...} - local cnt = 2 - for i,v in ipairs(arg) do - fields[cnt][4] = v - cnt = cnt + 1 - end -end - --- draws one letter mark -local function drawMark(x, y, name) - lcd.drawBitmap(ImgMarkBg, x, y) - lcd.drawText(x+8, y+3, name, DEFAULT_COLOR) -end - - -local MotorFields = { - {50, 50, COMBO, 1, 1, { "No", "Yes"} }, - {50, 127, COMBO, 1, 2, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, -} - -local ImgEngine - -local function runMotorConfig(event) - lcd.clear() - if ImgEngine == nil then - ImgEngine = Bitmap.open("img/prop.png") - end - lcd.drawBitmap(BackgroundImg, 0, 0) - lcd.drawBitmap(ImgPageDn, 455, 95) - lcd.drawBitmap(ImgEngine, 310, 50) - fields = MotorFields - lcd.drawText(40, 20, "Does your model have a motor ?", DEFAULT_COLOR) - lcd.drawFilledRectangle(40, 45, 200, 30, TEXT_BGCOLOR) - fields[2][4]=0 - if fields[1][5] == 1 then - lcd.drawText(40, 100, "What channel is it on ?", DEFAULT_COLOR) - lcd.drawFilledRectangle(40, 122, 100, 30, TEXT_BGCOLOR) - fields[2][4]=1 - end - local result = runFieldsPage(event) - return result -end - --- fields format : {[1]x, [2]y, [3]COMBO, [4]visible, [5]default, [6]{values}} --- fields format : {[1]x, [2]y, [3]VALUE, [4]visible, [5]default, [6]min, [7]max} -local AilFields = { - {50, 50, COMBO, 1, 2, { "None", "One, or two with Y cable", "Two"} }, - {50, 127, COMBO, 1, 0, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, -- Ail1 chan - {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 - lcd.drawBitmap(ImgAilR, 274, 123) - lcd.drawBitmap(ImgAilL, 395, 235) - drawMark(308, 115, "A") - drawMark(422, 220, "A") - lcd.drawFilledRectangle(40, 122, 100, 30, TEXT_BGCOLOR) - drawMark(152, 124, "A") - setFieldsVisible(1, 0) - elseif fields[1][5] == 2 then - lcd.drawBitmap(ImgAilR, 274, 123) - lcd.drawBitmap(ImgAilL, 395, 235) - drawMark(308, 115, "A") - drawMark(422, 220, "B") - lcd.drawFilledRectangle(40, 122, 100, 30, TEXT_BGCOLOR) - drawMark(152, 124, "A") - lcd.drawFilledRectangle(40, 162, 100, 30, TEXT_BGCOLOR) - drawMark(152, 164, "B") - setFieldsVisible(1, 1) - else - setFieldsVisible(0, 0) - end - lcd.drawText(40, 20, "Number of ailerons on your model ?", DEFAULT_COLOR) - lcd.drawFilledRectangle(40, 45, 400, 30, TEXT_BGCOLOR) - local result = runFieldsPage(event) - return result -end - -local FlapsFields = { - {50, 50, COMBO, 1, 0, { "No", "Yes, on one channel", "Yes, on two channels"} }, - {50, 127, COMBO, 1, 6, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, - {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 - lcd.drawBitmap(ImgFlp, 315, 160) - lcd.drawBitmap(ImgFlp, 358, 202) - drawMark(332, 132, "A") - drawMark(412, 215, "A") - lcd.drawFilledRectangle(40, 122, 100, 30, TEXT_BGCOLOR) - drawMark(152, 124, "A") - setFieldsVisible(1, 0) - elseif fields[1][5] == 2 then - lcd.drawBitmap(ImgFlp, 315, 160) - lcd.drawBitmap(ImgFlp, 358, 202) - drawMark(332, 132, "A") - drawMark(412, 215, "B") - lcd.drawFilledRectangle(40, 122, 100, 30, TEXT_BGCOLOR) - drawMark(152, 124, "A") - lcd.drawFilledRectangle(40, 162, 100, 30, TEXT_BGCOLOR) - drawMark(152, 164, "B") - setFieldsVisible(1, 1) - else - setFieldsVisible(0, 0) - end - lcd.drawText(40, 20, "Does your model have flaps ?", DEFAULT_COLOR) - lcd.drawFilledRectangle(40, 45, 400, 30, TEXT_BGCOLOR) - local result = runFieldsPage(event) - return result -end - -local TailFields = { - {50, 50, COMBO, 1, 1, { "1 channel for Elevator, no Rudder", "One channel for Elevator, one for Rudder", "Two channels for Elevator, one for Rudder", "V Tail"} }, - {50, 127, COMBO, 1, 1, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, --ele - {50, 167, COMBO, 1, 3, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, --rud - {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 - lcd.drawBitmap(ImgTail, 252, 100) - drawMark(360, 125, "A") - drawMark(390, 155, "A") - lcd.drawFilledRectangle(40, 122, 100, 30, TEXT_BGCOLOR) - drawMark(152, 124, "A") - setFieldsVisible(1, 0, 0) - end - if fields[1][5] == 1 then - lcd.drawBitmap(ImgTail, 252, 100) - lcd.drawBitmap(ImgTailRud, 340, 100) - drawMark(415, 150, "A") - drawMark(380, 120, "A") - drawMark(390, 185, "B") - lcd.drawFilledRectangle(40, 122, 100, 30, TEXT_BGCOLOR) - drawMark(152, 124, "A") - lcd.drawFilledRectangle(40, 162, 100, 30, TEXT_BGCOLOR) - drawMark(152, 164, "B") - setFieldsVisible(1, 1, 0) - end - if fields[1][5] == 2 then - lcd.drawBitmap(ImgTail, 252, 100) - lcd.drawBitmap(ImgTailRud, 340, 100) - drawMark(415, 150, "C") - drawMark(380, 120, "A") - drawMark(390, 185, "B") - lcd.drawFilledRectangle(40, 122, 100, 30, TEXT_BGCOLOR) - drawMark(152, 124, "A") - lcd.drawFilledRectangle(40, 162, 100, 30, TEXT_BGCOLOR) - drawMark(152, 164, "B") - lcd.drawFilledRectangle(40, 202, 100, 30, TEXT_BGCOLOR) - drawMark(152, 204, "C") - setFieldsVisible(1, 1, 1) - end - if fields[1][5] == 3 then - lcd.drawBitmap(ImgVTail, 252, 100) - drawMark(315, 110, "A") - drawMark(382, 120, "B") - lcd.drawFilledRectangle(40, 122, 100, 30, TEXT_BGCOLOR) - drawMark(152, 124, "A") - lcd.drawFilledRectangle(40, 162, 100, 30, TEXT_BGCOLOR) - drawMark(152, 164, "B") - setFieldsVisible(1, 1, 0) - end - lcd.drawText(40, 20, "Pick the tail config of your model", DEFAULT_COLOR) - lcd.drawFilledRectangle(40, 45, 400, 30, TEXT_BGCOLOR) - local result = runFieldsPage(event) - return result -end - -local lineIndex -local function drawNextLine(text, text2) - lcd.drawText(40, lineIndex, text, DEFAULT_COLOR) - lcd.drawText(242, lineIndex, ": CH" .. text2 + 1, DEFAULT_COLOR) - lineIndex = lineIndex + 20 -end - -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(BackgroundImg, 0, 0) - lcd.drawBitmap(ImgPageUp, 0, 95) - lcd.drawBitmap(ImgSummary, 300, 60) - lineIndex = 40 - -- motors - if(MotorFields[1][5] == 1) then - drawNextLine("Motor channel", MotorFields[2][5]) - end - -- ail - if(AilFields[1][5] == 1) then - drawNextLine("Aileron channel",AilFields[2][5]) - elseif (AilFields[1][5] == 2) then - drawNextLine("Aileron Right channel",AilFields[2][5]) - drawNextLine("Aileron Left channel",AilFields[3][5]) - end - -- flaps - if(FlapsFields[1][5] == 1) then - drawNextLine("Flaps channel",FlapsFields[2][5]) - elseif (FlapsFields[1][5] == 2) then - drawNextLine("Flaps Right channel",FlapsFields[2][5]) - drawNextLine("Flaps Left channel",FlapsFields[3][5]) - end - -- tail - if(TailFields[1][5] == 0) then - drawNextLine("Elevator channel",TailFields[2][5]) - elseif (TailFields[1][5] == 1) then - drawNextLine("Elevator channel",TailFields[2][5]) - drawNextLine("Rudder channel",TailFields[3][5]) - elseif (TailFields[1][5] == 2) then - drawNextLine("Elevator Right channel",TailFields[2][5]) - drawNextLine("Rudder channel",TailFields[3][5]) - drawNextLine("Elevator Left channel",TailFields[4][5]) - elseif (TailFields[1][5] == 3) then - drawNextLine("V-Tail Right", TailFields[2][5]) - drawNextLine("V-Tail Left", TailFields[3][5]) - end - local result = runFieldsPage(event) - if(fields[1][5] == 1 and edit == false) then - selectPage(1) - end - return result -end - -local function addMix(channel, input, name, weight, index) - local mix = { source=input, name=name } - if weight ~= nil then - mix.weight = weight - end - if index == nil then - index = 0 - end - model.insertMix(channel, index, mix) -end - -local function createModel(event) - lcd.clear() - lcd.drawBitmap(BackgroundImg, 0, 0) - lcd.drawBitmap(ImgSummary, 300, 60) - model.defaultInputs() - model.deleteMixes() - -- motor - if(MotorFields[1][5] == 1) then - addMix(MotorFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(2), "Motor") - end - -- Ailerons - if(AilFields[1][5] == 1) then - addMix(AilFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(3), "Ail") - elseif (AilFields[1][5] == 2) then - addMix(AilFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(3), "AilR") - addMix(AilFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(3), "AilL", -100) - end - -- Flaps - if(FlapsFields[1][5] == 1) then - addMix(FlapsFields[2][5], MIXSRC_SA, "Flaps") - elseif (FlapsFields[1][5] == 2) then - addMix(FlapsFields[2][5], MIXSRC_SA, "FlapsR") - addMix(FlapsFields[3][5], MIXSRC_SA, "FlapsL") - end - -- Tail - if(TailFields[1][5] == 0) then - addMix(TailFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "Elev") - elseif (TailFields[1][5] == 1) then - addMix(TailFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "Elev") - addMix(TailFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(0), "Rudder") - elseif (TailFields[1][5] == 2) then - addMix(TailFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "ElevR") - addMix(TailFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(0), "Rudder") - addMix(TailFields[4][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "ElevL") - elseif (TailFields[1][5] == 3) then - addMix(TailFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "V-EleR", 50) - addMix(TailFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(0), "V-RudR", 50, 1) - addMix(TailFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "V-EleL", 50) - addMix(TailFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(0), "V-RudL", -50, 1) - end - lcd.drawText(70, 90, "Model successfully created !", DEFAULT_COLOR) - lcd.drawText(100, 130, "Press RTN to exit", DEFAULT_COLOR) - return 2 -end - --- Init -local function init() - current, edit = 1, false - pages = { - runMotorConfig, - runAilConfig, - runFlapsConfig, - runTailConfig, - runConfigSummary, - createModel, - } -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_NEXT_PAGE and page < #pages-1 then - selectPage(1) - elseif event == EVT_VIRTUAL_PREV_PAGE and page > 1 then - killEvents(event); - selectPage(-1) - end - - local result = pages[page](event) - return result -end - -return { init=init, run=run } diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/icon.png b/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/icon.png deleted file mode 100755 index b6b737047..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/icon.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/arm.png b/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/arm.png deleted file mode 100755 index 33dcd7d91..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/arm.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/background.png b/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/background.png deleted file mode 100755 index e21f7bc81..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/background.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/beeper.png b/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/beeper.png deleted file mode 100755 index 57c37f2fe..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/beeper.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/mark_bg.png b/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/mark_bg.png deleted file mode 100755 index fbe6b0ee2..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/mark_bg.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/mode.png b/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/mode.png deleted file mode 100755 index 37a183020..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/mode.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/pagedn.png b/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/pagedn.png deleted file mode 100755 index 0733ccfa1..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/pagedn.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/pageup.png b/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/pageup.png deleted file mode 100755 index 0dbaa5202..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/pageup.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/pitch.png b/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/pitch.png deleted file mode 100755 index e691fded2..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/pitch.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/roll.png b/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/roll.png deleted file mode 100755 index 9110a0d52..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/roll.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/throttle.png b/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/throttle.png deleted file mode 100755 index b4f796b0a..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/throttle.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/yaw.png b/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/yaw.png deleted file mode 100755 index 3fc055bb3..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/img/yaw.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/wizard.lua b/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/wizard.lua deleted file mode 100755 index baf8461b5..000000000 --- a/radio/sdcard/horus/SCRIPTS/WIZARD/multirotor/wizard.lua +++ /dev/null @@ -1,411 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ------# Credits: graphics by Radiomaster # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - -local VALUE = 0 -local COMBO = 1 - -local edit = false -local page = 1 -local current = 1 -local pages = {} -local fields = {} -local switches = {"SA", "SB", "SC", "SD", "SE", "SF", "SG"} - --- load common Bitmaps -local ImgMarkBg = Bitmap.open("img/mark_bg.png") -local BackgroundImg = Bitmap.open("img/background.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) - local field = fields[current] - local min, max - if field[3] == VALUE then - min = field[6] - max = field[7] - elseif field[3] == COMBO then - min = 0 - max = #(field[6]) - 1 - end - if (step < 0 and field[5] > min) or (step > 0 and field[5] < max) then - field[5] = field[5] + step - end -end - --- Select the next or previous page -local function selectPage(step) - page = 1 + ((page + step - 1 + #pages) % #pages) - edit = false - current = 1 -end - --- Select the next or previous editable field -local function selectField(step) - repeat - current = 1 + ((current + step - 1 + #fields) % #fields) - until fields[current][4]==1 -end - --- Redraw the current page -local function redrawFieldsPage(event) - - for index = 1, 10, 1 do - local field = fields[index] - if field == nil then - break - end - - local attr = current == (index) and ((edit == true and BLINK or 0) + INVERS) or 0 - attr = attr + TEXT_COLOR - - if field[4] == 1 then - if field[3] == VALUE then - lcd.drawNumber(field[1], field[2], field[5], LEFT + attr) - elseif field[3] == COMBO then - if field[5] >= 0 and field[5] < #(field[6]) then - lcd.drawText(field[1],field[2], field[6][1+field[5]], attr) - end - end - end - end -end - -local function updateField(field) - local value = field[5] -end - --- Main -local function runFieldsPage(event) - if event == EVT_VIRTUAL_EXIT then -- exit script - return 2 - elseif event == EVT_VIRTUAL_ENTER then -- toggle editing/selecting current field - if fields[current][5] ~= nil then - edit = not edit - if edit == false then - updateField(fields[current]) - end - end - elseif edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - addField(1) - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - addField(-1) - end - else - if event == EVT_VIRTUAL_NEXT then - selectField(1) - elseif event == EVT_VIRTUAL_PREV then - selectField(-1) - end - end - redrawFieldsPage(event) - return 0 -end - --- set visibility flags starting with SECOND field of fields -local function setFieldsVisible(...) - local arg={...} - local cnt = 2 - for i,v in ipairs(arg) do - fields[cnt][4] = v - cnt = cnt + 1 - end -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 ThrottleFields = { - {50, 50, COMBO, 1, 2, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, -} - -local ThrottleBackground - -local function runThrottleConfig(event) - lcd.clear() - if ThrottleBackground == nil then - ThrottleBackground = Bitmap.open("img/throttle.png") - end - lcd.drawBitmap(ThrottleBackground, 0, 0) - lcd.drawBitmap(ImgPageDn, 455, 95) - fields = ThrottleFields - lcd.drawText(40, 20, "Assign Throttle channel", TEXT_COLOR) - lcd.drawFilledRectangle(40, 45, 100, 30, TEXT_BGCOLOR) - fields[1][4]=1 - local result = runFieldsPage(event) - return result -end - -local RollFields = { - {50, 50, COMBO, 1, 0, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, -} - -local RollBackground - -local function runRollConfig(event) - lcd.clear() - if RollBackground == nil then - RollBackground = Bitmap.open("img/roll.png") - end - lcd.drawBitmap(RollBackground, 0, 0) - lcd.drawBitmap(ImgPageUp, 0, 95) - lcd.drawBitmap(ImgPageDn, 455, 95) - fields = RollFields - lcd.drawText(40, 20, "Assign Roll channel", TEXT_COLOR) - lcd.drawFilledRectangle(40, 45, 100, 30, TEXT_BGCOLOR) - fields[1][4]=1 - local result = runFieldsPage(event) - return result -end - -local PitchFields = { - {50, 50, COMBO, 1, 1, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, -} - -local PitchBackground - -local function runPitchConfig(event) - lcd.clear() - if PitchBackground == nil then - PitchBackground = Bitmap.open("img/pitch.png") - end - lcd.drawBitmap(PitchBackground, 0, 0) - lcd.drawBitmap(ImgPageUp, 0, 95) - lcd.drawBitmap(ImgPageDn, 455, 95) - fields = PitchFields - lcd.drawText(40, 20, "Assign Pitch channel", TEXT_COLOR) - lcd.drawFilledRectangle(40, 45, 100, 30, TEXT_BGCOLOR) - fields[1][4]=1 - local result = runFieldsPage(event) - return result -end - -local YawFields = { - {50, 50, COMBO, 1, 3, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, -} - -local YawBackground - -local function runYawConfig(event) - lcd.clear() - if YawBackground == nil then - YawBackground = Bitmap.open("img/yaw.png") - end - lcd.drawBitmap(YawBackground, 0, 0) - lcd.drawBitmap(ImgPageUp, 0, 95) - lcd.drawBitmap(ImgPageDn, 455, 95) - fields = YawFields - lcd.drawText(40, 20, "Assign Yaw channel", TEXT_COLOR) - lcd.drawFilledRectangle(40, 45, 100, 30, TEXT_BGCOLOR) - fields[1][4]=1 - local result = runFieldsPage(event) - return result -end - -local ArmFields = { - {50, 50, COMBO, 1, 5, { "SA", "SB", "SC", "SD", "SE", "SF"} }, -} - -local ArmBackground - -local function runArmConfig(event) - lcd.clear() - if ArmBackground == nil then - ArmBackground = Bitmap.open("img/arm.png") - end - lcd.drawBitmap(ArmBackground, 0, 0) - lcd.drawBitmap(ImgPageUp, 0, 95) - lcd.drawBitmap(ImgPageDn, 455, 95) - fields = ArmFields - lcd.drawText(40, 20, "Assign Arm switch", TEXT_COLOR) - lcd.drawFilledRectangle(40, 45, 100, 30, TEXT_BGCOLOR) - fields[1][4]=1 - local result = runFieldsPage(event) - return result -end - -local BeeperFields = { - {50, 50, COMBO, 1, 3, { "SA", "SB", "SC", "SD", "SE", "SF"} }, -} - -local BeeperBackground - -local function runBeeperConfig(event) - lcd.clear() - if BeeperBackground == nil then - BeeperBackground = Bitmap.open("img/beeper.png") - end - lcd.drawBitmap(BeeperBackground, 0, 0) - lcd.drawBitmap(ImgPageUp, 0, 95) - lcd.drawBitmap(ImgPageDn, 455, 95) - fields = BeeperFields - lcd.drawText(40, 20, "Assign Beeper switch", TEXT_COLOR) - lcd.drawFilledRectangle(40, 45, 100, 30, TEXT_BGCOLOR) - fields[1][4]=1 - local result = runFieldsPage(event) - return result -end - -local ModeFields = { - {50, 50, COMBO, 1, 0, { "SA", "SB", "SC", "SD", "SE", "SF"} }, -} - -local ModeBackground - -local function runModeConfig(event) - lcd.clear() - if ModeBackground == nil then - ModeBackground = Bitmap.open("img/mode.png") - end - lcd.drawBitmap(ModeBackground, 0, 0) - lcd.drawBitmap(ImgPageUp, 0, 95) - lcd.drawBitmap(ImgPageDn, 455, 95) - fields = ModeFields - lcd.drawText(40, 20, "Assign Mode switch", TEXT_COLOR) - lcd.drawFilledRectangle(40, 45, 100, 30, TEXT_BGCOLOR) - fields[1][4]=1 - local result = runFieldsPage(event) - return result -end - -local lineIndex -local function drawNextChanelLine(text, text2) - lcd.drawText(40, lineIndex, text, TEXT_COLOR) - lcd.drawText(242, lineIndex, ": CH" .. text2 + 1, TEXT_COLOR) - lineIndex = lineIndex + 20 -end - -local function drawNextSwitchLine(text, text2) - lcd.drawText(40, lineIndex, text, TEXT_COLOR) - lcd.drawText(242, lineIndex, ": " ..switches[text2 + 1], TEXT_COLOR) - lineIndex = lineIndex + 20 -end - - -local ConfigSummaryFields = { - {110, 250, COMBO, 1, 0, { "No, I need to change something", "Yes, all is well, create the model !"} }, -} - -local ImgSummary - -local function runConfigSummary(event) - lcd.clear() - if ImgSummary == nil then - ImgSummary = Bitmap.open("img/summary.png") - end - fields = ConfigSummaryFields - lcd.drawBitmap(BackgroundImg, 0, 0) - lcd.drawBitmap(ImgPageUp, 0, 95) - lcd.drawBitmap(ImgSummary, 300, 60) - lineIndex = 40 - -- throttle - drawNextChanelLine("Throttle channel", ThrottleFields[1][5]) - -- roll - drawNextChanelLine("Roll channel",RollFields[1][5]) - -- pitch - drawNextChanelLine("Pitch channel",PitchFields[1][5]) - -- yaw - drawNextChanelLine("Yaw channel",YawFields[1][5]) - -- arm - drawNextSwitchLine("Arm switch",ArmFields[1][5]) - -- beeper - drawNextSwitchLine("Beeper switch",BeeperFields[1][5]) - -- mode - drawNextSwitchLine("Mode switch",ModeFields[1][5]) - - local result = runFieldsPage(event) - if(fields[1][5] == 1 and edit == false) then - selectPage(1) - end - return result -end - -local function addMix(channel, input, name, weight, index) - local mix = { source=input, name=name } - if weight ~= nil then - mix.weight = weight - end - if index == nil then - index = 0 - end - model.insertMix(channel, index, mix) -end - -local function createModel(event) - lcd.clear() - lcd.drawBitmap(BackgroundImg, 0, 0) - lcd.drawBitmap(ImgSummary, 300, 60) - model.defaultInputs() - model.deleteMixes() - -- throttle - addMix(ThrottleFields[1][5], MIXSRC_FIRST_INPUT+defaultChannel(2), "Thr") - -- roll - addMix(RollFields[1][5], MIXSRC_FIRST_INPUT+defaultChannel(0), "Roll") - -- pitch - addMix(PitchFields[1][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "Pitch") - -- yaw - addMix(YawFields[1][5], MIXSRC_FIRST_INPUT+defaultChannel(3), "Yaw") - addMix(4, MIXSRC_SA + ArmFields[1][5], "Arm") - addMix(5, MIXSRC_SA + BeeperFields[1][5], "Beeper") - addMix(6, MIXSRC_SA + ModeFields[1][5], "Mode") - - lcd.drawText(70, 90, "Model successfully created !", TEXT_COLOR) - lcd.drawText(100, 130, "Press RTN to exit", TEXT_COLOR) - return 2 -end - --- Init -local function init() - current, edit = 1, false - pages = { - runThrottleConfig, - runRollConfig, - runPitchConfig, - runYawConfig, - runArmConfig, - runBeeperConfig, - runModeConfig, - runConfigSummary, - createModel, - } -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_NEXT_PAGE and page < #pages-1 then - selectPage(1) - elseif event == EVT_VIRTUAL_PREV_PAGE and page > 1 then - killEvents(event); - selectPage(-1) - end - - local result = pages[page](event) - return result -end - -return { init=init, run=run } diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/icon.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/icon.png deleted file mode 100755 index 2deea1d9a..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/icon.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/background.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/background.png deleted file mode 100755 index e21f7bc81..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/background.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/flap.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/flap.png deleted file mode 100755 index 82a844891..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/flap.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/lail.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/lail.png deleted file mode 100755 index 00cff0cf6..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/lail.png and /dev/null 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 deleted file mode 100755 index fbe6b0ee2..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/mark_bg.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/pagedn.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/pagedn.png deleted file mode 100755 index 0733ccfa1..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/pagedn.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/pageup.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/pageup.png deleted file mode 100755 index 0dbaa5202..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/pageup.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/plane.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/plane.png deleted file mode 100644 index ab9db2606..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/plane.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/prop.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/prop.png deleted file mode 100644 index 9c353400f..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/prop.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/rail.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/rail.png deleted file mode 100755 index e2f80ffe2..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/rail.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/summary.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/summary.png deleted file mode 100755 index 8b23b0b42..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/summary.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/tail.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/tail.png deleted file mode 100755 index db3f29bcd..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/tail.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/tailrud.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/tailrud.png deleted file mode 100755 index d42a7244e..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/tailrud.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/vtail.png b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/vtail.png deleted file mode 100755 index fae86aae4..000000000 Binary files a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/img/vtail.png and /dev/null differ diff --git a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/wizard.lua b/radio/sdcard/horus/SCRIPTS/WIZARD/plane/wizard.lua deleted file mode 100755 index f970cc998..000000000 --- a/radio/sdcard/horus/SCRIPTS/WIZARD/plane/wizard.lua +++ /dev/null @@ -1,478 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### -local VALUE = 0 -local COMBO = 1 - -local edit = false -local page = 1 -local current = 1 -local pages = {} -local fields = {} - --- 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) - local field = fields[current] - local min, max - if field[3] == VALUE then - min = field[6] - max = field[7] - elseif field[3] == COMBO then - min = 0 - max = #(field[6]) - 1 - end - if (step < 0 and field[5] > min) or (step > 0 and field[5] < max) then - field[5] = field[5] + step - end -end - --- Select the next or previous page -local function selectPage(step) - page = 1 + ((page + step - 1 + #pages) % #pages) - edit = false - current = 1 -end - --- Select the next or previous editable field -local function selectField(step) - repeat - current = 1 + ((current + step - 1 + #fields) % #fields) - until fields[current][4]==1 -end - --- Redraw the current page -local function redrawFieldsPage(event) - - for index = 1, 10, 1 do - local field = fields[index] - if field == nil then - break - end - - local attr = current == (index) and ((edit == true and BLINK or 0) + INVERS) or 0 - attr = attr + DEFAULT_COLOR - - if field[4] == 1 then - if field[3] == VALUE then - lcd.drawNumber(field[1], field[2], field[5], LEFT + attr) - elseif field[3] == COMBO then - if field[5] >= 0 and field[5] < #(field[6]) then - lcd.drawText(field[1],field[2], field[6][1+field[5]], attr) - end - end - end - end -end - -local function updateField(field) - local value = field[5] -end - --- Main -local function runFieldsPage(event) - if event == EVT_VIRTUAL_EXIT then -- exit script - return 2 - elseif event == EVT_VIRTUAL_ENTER then -- toggle editing/selecting current field - if fields[current][5] ~= nil then - edit = not edit - if edit == false then - updateField(fields[current]) - end - end - elseif edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - addField(1) - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - addField(-1) - end - else - if event == EVT_VIRTUAL_NEXT then - selectField(1) - elseif event == EVT_VIRTUAL_PREV then - selectField(-1) - end - end - redrawFieldsPage(event) - return 0 -end - --- set visibility flags starting with SECOND field of fields -local function setFieldsVisible(...) - local arg={...} - local cnt = 2 - for i,v in ipairs(arg) do - fields[cnt][4] = v - cnt = cnt + 1 - end -end - --- draws one letter mark -local function drawMark(x, y, name) - lcd.drawBitmap(ImgMarkBg, x, y) - lcd.drawText(x+8, y+3, name, DEFAULT_COLOR) -end - - -local MotorFields = { - {50, 50, COMBO, 1, 1, { "No", "Yes"} }, - {50, 127, COMBO, 1, 2, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, -} - -local ImgEngine - -local function runMotorConfig(event) - lcd.clear() - if ImgEngine == nil then - ImgEngine = Bitmap.open("img/prop.png") - end - lcd.drawBitmap(BackgroundImg, 0, 0) - lcd.drawBitmap(ImgPageDn, 455, 95) - lcd.drawBitmap(ImgEngine, 310, 50) - fields = MotorFields - lcd.drawText(40, 20, "Does your model have a motor ?", DEFAULT_COLOR) - lcd.drawFilledRectangle(40, 45, 200, 30, TEXT_BGCOLOR) - fields[2][4]=0 - if fields[1][5] == 1 then - lcd.drawText(40, 100, "What channel is it on ?", DEFAULT_COLOR) - lcd.drawFilledRectangle(40, 122, 100, 30, TEXT_BGCOLOR) - fields[2][4]=1 - end - local result = runFieldsPage(event) - return result -end - --- fields format : {[1]x, [2]y, [3]COMBO, [4]visible, [5]default, [6]{values}} --- fields format : {[1]x, [2]y, [3]VALUE, [4]visible, [5]default, [6]min, [7]max} -local AilFields = { - {50, 50, COMBO, 1, 2, { "None", "One, or two with Y cable", "Two"} }, - {50, 127, COMBO, 1, 0, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, -- Ail1 chan - {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 - lcd.drawBitmap(ImgAilR, 324, 123) - lcd.drawBitmap(ImgAilL, 275, 210) - drawMark(362, 132, "A") - drawMark(302, 227, "A") - lcd.drawFilledRectangle(40, 122, 100, 30, TEXT_BGCOLOR) - drawMark(152, 124, "A") - setFieldsVisible(1, 0) - elseif fields[1][5] == 2 then - lcd.drawBitmap(ImgAilR, 324, 123) - lcd.drawBitmap(ImgAilL, 275, 210) - drawMark(362, 132, "A") - drawMark(302, 227, "B") - lcd.drawFilledRectangle(40, 122, 100, 30, TEXT_BGCOLOR) - drawMark(152, 124, "A") - lcd.drawFilledRectangle(40, 162, 100, 30, TEXT_BGCOLOR) - drawMark(152, 164, "B") - setFieldsVisible(1, 1) - else - setFieldsVisible(0, 0) - end - lcd.drawText(40, 20, "Number of ailerons on your model ?", DEFAULT_COLOR) - lcd.drawFilledRectangle(40, 45, 400, 30, TEXT_BGCOLOR) - local result = runFieldsPage(event) - return result -end - -local FlapsFields = { - {50, 50, COMBO, 1, 0, { "No", "Yes, on one channel", "Yes, on two channels"} }, - {50, 127, COMBO, 1, 6, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, - {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 - lcd.drawBitmap(ImgFlp, 315, 143) - lcd.drawBitmap(ImgFlp, 285, 191) - drawMark(362, 132, "A") - drawMark(302, 227, "A") - lcd.drawFilledRectangle(40, 122, 100, 30, TEXT_BGCOLOR) - drawMark(152, 124, "A") - setFieldsVisible(1, 0) - elseif fields[1][5] == 2 then - lcd.drawBitmap(ImgFlp, 315, 143) - lcd.drawBitmap(ImgFlp, 285, 191) - drawMark(362, 132, "A") - drawMark(302, 227, "B") - lcd.drawFilledRectangle(40, 122, 100, 30, TEXT_BGCOLOR) - drawMark(152, 124, "A") - lcd.drawFilledRectangle(40, 162, 100, 30, TEXT_BGCOLOR) - drawMark(152, 164, "B") - setFieldsVisible(1, 1) - else - setFieldsVisible(0, 0) - end - lcd.drawText(40, 20, "Does your model have flaps ?", DEFAULT_COLOR) - lcd.drawFilledRectangle(40, 45, 400, 30, TEXT_BGCOLOR) - local result = runFieldsPage(event) - return result -end - -local TailFields = { - {50, 50, COMBO, 1, 1, { "1 channel for Elevator, no Rudder", "One channel for Elevator, one for Rudder", "Two channels for Elevator, one for Rudder", "V Tail"} }, - {50, 127, COMBO, 1, 1, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, --ele - {50, 167, COMBO, 1, 3, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, --rud - {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 - lcd.drawBitmap(ImgTail, 252, 100) - drawMark(275, 120, "A") - drawMark(390, 155, "A") - lcd.drawFilledRectangle(40, 122, 100, 30, TEXT_BGCOLOR) - drawMark(152, 124, "A") - setFieldsVisible(1, 0, 0) - end - if fields[1][5] == 1 then - 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, TEXT_BGCOLOR) - drawMark(152, 124, "A") - lcd.drawFilledRectangle(40, 162, 100, 30, TEXT_BGCOLOR) - drawMark(152, 164, "B") - setFieldsVisible(1, 1, 0) - end - if fields[1][5] == 2 then - 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, TEXT_BGCOLOR) - drawMark(152, 124, "A") - lcd.drawFilledRectangle(40, 162, 100, 30, TEXT_BGCOLOR) - drawMark(152, 164, "B") - lcd.drawFilledRectangle(40, 202, 100, 30, TEXT_BGCOLOR) - drawMark(152, 204, "C") - setFieldsVisible(1, 1, 1) - end - if fields[1][5] == 3 then - lcd.drawBitmap(ImgVTail, 252, 100) - drawMark(315, 110, "A") - drawMark(382, 120, "B") - lcd.drawFilledRectangle(40, 122, 100, 30, TEXT_BGCOLOR) - drawMark(152, 124, "A") - lcd.drawFilledRectangle(40, 162, 100, 30, TEXT_BGCOLOR) - drawMark(152, 164, "B") - setFieldsVisible(1, 1, 0) - end - lcd.drawText(40, 20, "Pick the tail config of your model", DEFAULT_COLOR) - lcd.drawFilledRectangle(40, 45, 400, 30, TEXT_BGCOLOR) - local result = runFieldsPage(event) - return result -end - -local lineIndex -local function drawNextLine(text, text2) - lcd.drawText(40, lineIndex, text, DEFAULT_COLOR) - lcd.drawText(242, lineIndex, ": CH" .. text2 + 1, DEFAULT_COLOR) - lineIndex = lineIndex + 20 -end - -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(BackgroundImg, 0, 0) - lcd.drawBitmap(ImgPageUp, 0, 95) - lcd.drawBitmap(ImgSummary, 300, 60) - lineIndex = 40 - -- motors - if(MotorFields[1][5] == 1) then - drawNextLine("Motor channel", MotorFields[2][5]) - end - -- ail - if(AilFields[1][5] == 1) then - drawNextLine("Aileron channel",AilFields[2][5]) - elseif (AilFields[1][5] == 2) then - drawNextLine("Aileron Right channel",AilFields[2][5]) - drawNextLine("Aileron Left channel",AilFields[3][5]) - end - -- flaps - if(FlapsFields[1][5] == 1) then - drawNextLine("Flaps channel",FlapsFields[2][5]) - elseif (FlapsFields[1][5] == 2) then - drawNextLine("Flaps Right channel",FlapsFields[2][5]) - drawNextLine("Flaps Left channel",FlapsFields[3][5]) - end - -- tail - if(TailFields[1][5] == 0) then - drawNextLine("Elevator channel",TailFields[2][5]) - elseif (TailFields[1][5] == 1) then - drawNextLine("Elevator channel",TailFields[2][5]) - drawNextLine("Rudder channel",TailFields[3][5]) - elseif (TailFields[1][5] == 2) then - drawNextLine("Elevator Right channel",TailFields[2][5]) - drawNextLine("Rudder channel",TailFields[3][5]) - drawNextLine("Elevator Left channel",TailFields[4][5]) - elseif (TailFields[1][5] == 3) then - drawNextLine("V-Tail Right", TailFields[2][5]) - drawNextLine("V-Tail Left", TailFields[3][5]) - end - local result = runFieldsPage(event) - if(fields[1][5] == 1 and edit == false) then - selectPage(1) - end - return result -end - -local function addMix(channel, input, name, weight, index) - local mix = { source=input, name=name } - if weight ~= nil then - mix.weight = weight - end - if index == nil then - index = 0 - end - model.insertMix(channel, index, mix) -end - -local function createModel(event) - lcd.clear() - lcd.drawBitmap(BackgroundImg, 0, 0) - lcd.drawBitmap(ImgSummary, 300, 60) - model.defaultInputs() - model.deleteMixes() - -- motor - if(MotorFields[1][5] == 1) then - addMix(MotorFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(2), "Motor") - end - -- Ailerons - if(AilFields[1][5] == 1) then - addMix(AilFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(3), "Ail") - elseif (AilFields[1][5] == 2) then - addMix(AilFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(3), "AilR") - addMix(AilFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(3), "AilL", -100) - end - -- Flaps - if(FlapsFields[1][5] == 1) then - addMix(FlapsFields[2][5], MIXSRC_SA, "Flaps") - elseif (FlapsFields[1][5] == 2) then - addMix(FlapsFields[2][5], MIXSRC_SA, "FlapsR") - addMix(FlapsFields[3][5], MIXSRC_SA, "FlapsL") - end - -- Tail - if(TailFields[1][5] == 0) then - addMix(TailFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "Elev") - elseif (TailFields[1][5] == 1) then - addMix(TailFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "Elev") - addMix(TailFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(0), "Rudder") - elseif (TailFields[1][5] == 2) then - addMix(TailFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "ElevR") - addMix(TailFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(0), "Rudder") - addMix(TailFields[4][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "ElevL") - elseif (TailFields[1][5] == 3) then - addMix(TailFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "V-EleR", 50) - addMix(TailFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(0), "V-RudR", 50, 1) - addMix(TailFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "V-EleL", 50) - addMix(TailFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(0), "V-RudL", -50, 1) - end - lcd.drawText(70, 90, "Model successfully created !", DEFAULT_COLOR) - lcd.drawText(100, 130, "Press RTN to exit", DEFAULT_COLOR) - return 2 -end - --- Init -local function init() - current, edit = 1, false - pages = { - runMotorConfig, - runAilConfig, - runFlapsConfig, - runTailConfig, - runConfigSummary, - createModel, - } -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_NEXT_PAGE and page < #pages-1 then - selectPage(1) - elseif event == EVT_VIRTUAL_PREV_PAGE and page > 1 then - killEvents(event); - selectPage(-1) - end - - local result = pages[page](event) - return result -end - -return { init=init, run=run } diff --git a/radio/sdcard/horus/THEMES/Darkblue/X10.bmp b/radio/sdcard/horus/THEMES/Darkblue/X10.bmp deleted file mode 100755 index 24893bad0..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/X10.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/X10S.bmp b/radio/sdcard/horus/THEMES/Darkblue/X10S.bmp deleted file mode 100755 index e27932eef..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/X10S.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/asterisk.bmp b/radio/sdcard/horus/THEMES/Darkblue/asterisk.bmp deleted file mode 100644 index 3dd3cfef4..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/asterisk.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/busy.bmp b/radio/sdcard/horus/THEMES/Darkblue/busy.bmp deleted file mode 100644 index 8e6a8b7f7..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/busy.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/horus.bmp b/radio/sdcard/horus/THEMES/Darkblue/horus.bmp deleted file mode 100644 index 98bc631cd..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/horus.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_currentmenu_bg.png b/radio/sdcard/horus/THEMES/Darkblue/mask_currentmenu_bg.png deleted file mode 100644 index 715792023..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_currentmenu_bg.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_currentmenu_dot.png b/radio/sdcard/horus/THEMES/Darkblue/mask_currentmenu_dot.png deleted file mode 100644 index 6f76965a9..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_currentmenu_dot.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_currentmenu_shadow.png b/radio/sdcard/horus/THEMES/Darkblue/mask_currentmenu_shadow.png deleted file mode 100644 index 97bf6c577..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_currentmenu_shadow.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_edgetx.png b/radio/sdcard/horus/THEMES/Darkblue/mask_edgetx.png deleted file mode 100644 index 84a7d9782..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_edgetx.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_library.png b/radio/sdcard/horus/THEMES/Darkblue/mask_library.png deleted file mode 100644 index 237883fc5..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_library.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_menu_model.png b/radio/sdcard/horus/THEMES/Darkblue/mask_menu_model.png deleted file mode 100644 index 9832267b7..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_menu_model.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_menu_radio.png b/radio/sdcard/horus/THEMES/Darkblue/mask_menu_radio.png deleted file mode 100644 index 6d93fbccc..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_menu_radio.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_menu_stats.png b/radio/sdcard/horus/THEMES/Darkblue/mask_menu_stats.png deleted file mode 100644 index ebd482588..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_menu_stats.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_menu_theme.png b/radio/sdcard/horus/THEMES/Darkblue/mask_menu_theme.png deleted file mode 100644 index 3a9fc15e7..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_menu_theme.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_model_curves.png b/radio/sdcard/horus/THEMES/Darkblue/mask_model_curves.png deleted file mode 100644 index 6e1e19e8e..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_model_curves.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_model_flight_modes.png b/radio/sdcard/horus/THEMES/Darkblue/mask_model_flight_modes.png deleted file mode 100644 index e963f0abb..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_model_flight_modes.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_model_gvars.png b/radio/sdcard/horus/THEMES/Darkblue/mask_model_gvars.png deleted file mode 100644 index 0b5015dac..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_model_gvars.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_model_heli.png b/radio/sdcard/horus/THEMES/Darkblue/mask_model_heli.png deleted file mode 100644 index ecd93d2ff..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_model_heli.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_model_inputs.png b/radio/sdcard/horus/THEMES/Darkblue/mask_model_inputs.png deleted file mode 100644 index 720099c47..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_model_inputs.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_model_logical_switches.png b/radio/sdcard/horus/THEMES/Darkblue/mask_model_logical_switches.png deleted file mode 100644 index 5cd1e3834..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_model_logical_switches.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_model_lua_scripts.png b/radio/sdcard/horus/THEMES/Darkblue/mask_model_lua_scripts.png deleted file mode 100644 index a20c1ccbd..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_model_lua_scripts.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_model_mixer.png b/radio/sdcard/horus/THEMES/Darkblue/mask_model_mixer.png deleted file mode 100644 index 009b360f1..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_model_mixer.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_model_outputs.png b/radio/sdcard/horus/THEMES/Darkblue/mask_model_outputs.png deleted file mode 100644 index a209ae8d3..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_model_outputs.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_model_setup.png b/radio/sdcard/horus/THEMES/Darkblue/mask_model_setup.png deleted file mode 100644 index afe526c8f..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_model_setup.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_model_special_functions.png b/radio/sdcard/horus/THEMES/Darkblue/mask_model_special_functions.png deleted file mode 100644 index a12a2a50d..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_model_special_functions.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_model_telemetry.png b/radio/sdcard/horus/THEMES/Darkblue/mask_model_telemetry.png deleted file mode 100644 index d95d3b25f..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_model_telemetry.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor.png b/radio/sdcard/horus/THEMES/Darkblue/mask_monitor.png deleted file mode 100644 index 68ddd4516..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_channels1.png b/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_channels1.png deleted file mode 100644 index b886fc1bc..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_channels1.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_channels2.png b/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_channels2.png deleted file mode 100644 index 4d0354e25..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_channels2.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_channels3.png b/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_channels3.png deleted file mode 100644 index d9ba27de7..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_channels3.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_channels4.png b/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_channels4.png deleted file mode 100644 index fb321151f..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_channels4.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_gvars.png b/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_gvars.png deleted file mode 100644 index 55b488d1e..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_gvars.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_inver.png b/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_inver.png deleted file mode 100644 index 64f251238..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_inver.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_lockch.png b/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_lockch.png deleted file mode 100644 index 360923a09..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_lockch.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_logsw.png b/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_logsw.png deleted file mode 100644 index dc6355143..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_logsw.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_mixes1.png b/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_mixes1.png deleted file mode 100644 index 7b0c71f60..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_mixes1.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_mixes2.png b/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_mixes2.png deleted file mode 100644 index f8c04780e..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_mixes2.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_mplex_add.png b/radio/sdcard/horus/THEMES/Darkblue/mask_mplex_add.png deleted file mode 100644 index 14f4ecc23..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_mplex_add.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_mplex_multi.png b/radio/sdcard/horus/THEMES/Darkblue/mask_mplex_multi.png deleted file mode 100644 index bcf79695f..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_mplex_multi.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_mplex_replace.png b/radio/sdcard/horus/THEMES/Darkblue/mask_mplex_replace.png deleted file mode 100644 index faccba0ea..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_mplex_replace.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_opentx.png b/radio/sdcard/horus/THEMES/Darkblue/mask_opentx.png deleted file mode 100644 index df2b0b356..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_opentx.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_opentx_testmode.png b/radio/sdcard/horus/THEMES/Darkblue/mask_opentx_testmode.png deleted file mode 100644 index b535cf8ee..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_opentx_testmode.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_radio_calibration.png b/radio/sdcard/horus/THEMES/Darkblue/mask_radio_calibration.png deleted file mode 100644 index db696778b..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_radio_calibration.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_radio_global_functions.png b/radio/sdcard/horus/THEMES/Darkblue/mask_radio_global_functions.png deleted file mode 100644 index 3b3efefb5..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_radio_global_functions.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_radio_hardware.png b/radio/sdcard/horus/THEMES/Darkblue/mask_radio_hardware.png deleted file mode 100644 index f51a1aee1..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_radio_hardware.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_radio_sd_browser.png b/radio/sdcard/horus/THEMES/Darkblue/mask_radio_sd_browser.png deleted file mode 100644 index 75b6a9296..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_radio_sd_browser.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_radio_setup.png b/radio/sdcard/horus/THEMES/Darkblue/mask_radio_setup.png deleted file mode 100644 index 0010a06ab..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_radio_setup.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_radio_spectrum_analyser.png b/radio/sdcard/horus/THEMES/Darkblue/mask_radio_spectrum_analyser.png deleted file mode 100755 index 2908833ec..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_radio_spectrum_analyser.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_radio_tools.png b/radio/sdcard/horus/THEMES/Darkblue/mask_radio_tools.png deleted file mode 100755 index 711d499de..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_radio_tools.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_radio_trainer.png b/radio/sdcard/horus/THEMES/Darkblue/mask_radio_trainer.png deleted file mode 100644 index 7a0b56970..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_radio_trainer.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_radio_version.png b/radio/sdcard/horus/THEMES/Darkblue/mask_radio_version.png deleted file mode 100644 index 8730f6c1a..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_radio_version.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_sbar_mixer.png b/radio/sdcard/horus/THEMES/Darkblue/mask_sbar_mixer.png deleted file mode 100644 index 154406419..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_sbar_mixer.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_sbar_output.png b/radio/sdcard/horus/THEMES/Darkblue/mask_sbar_output.png deleted file mode 100644 index 12d599823..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_sbar_output.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_sbar_to.png b/radio/sdcard/horus/THEMES/Darkblue/mask_sbar_to.png deleted file mode 100644 index 813610307..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_sbar_to.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_stats_analogs.png b/radio/sdcard/horus/THEMES/Darkblue/mask_stats_analogs.png deleted file mode 100644 index 96fc0c8a2..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_stats_analogs.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_stats_debug.png b/radio/sdcard/horus/THEMES/Darkblue/mask_stats_debug.png deleted file mode 100644 index 0dce13d46..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_stats_debug.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_stats_lua.png b/radio/sdcard/horus/THEMES/Darkblue/mask_stats_lua.png deleted file mode 100644 index d1b54a4d6..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_stats_lua.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_stats_throttle_graph.png b/radio/sdcard/horus/THEMES/Darkblue/mask_stats_throttle_graph.png deleted file mode 100644 index a3720a005..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_stats_throttle_graph.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_stats_timers.png b/radio/sdcard/horus/THEMES/Darkblue/mask_stats_timers.png deleted file mode 100644 index 78bf00064..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_stats_timers.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_stats_value.png b/radio/sdcard/horus/THEMES/Darkblue/mask_stats_value.png deleted file mode 100644 index 180f16e8c..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_stats_value.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_switches.png b/radio/sdcard/horus/THEMES/Darkblue/mask_switches.png deleted file mode 100644 index 4097ed751..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_switches.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_textline_curve.png b/radio/sdcard/horus/THEMES/Darkblue/mask_textline_curve.png deleted file mode 100644 index 050229393..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_textline_curve.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_textline_delay.png b/radio/sdcard/horus/THEMES/Darkblue/mask_textline_delay.png deleted file mode 100644 index 9b771a94a..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_textline_delay.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_textline_delayslow.png b/radio/sdcard/horus/THEMES/Darkblue/mask_textline_delayslow.png deleted file mode 100644 index de2f7d1f7..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_textline_delayslow.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_textline_fm.png b/radio/sdcard/horus/THEMES/Darkblue/mask_textline_fm.png deleted file mode 100644 index b9a2c4a32..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_textline_fm.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_textline_label.png b/radio/sdcard/horus/THEMES/Darkblue/mask_textline_label.png deleted file mode 100644 index 8be12e39b..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_textline_label.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_textline_slow.png b/radio/sdcard/horus/THEMES/Darkblue/mask_textline_slow.png deleted file mode 100644 index 1afbea37d..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_textline_slow.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_textline_switch.png b/radio/sdcard/horus/THEMES/Darkblue/mask_textline_switch.png deleted file mode 100644 index 7c7d646e4..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_textline_switch.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_theme_add_view.png b/radio/sdcard/horus/THEMES/Darkblue/mask_theme_add_view.png deleted file mode 100644 index 7e240372f..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_theme_add_view.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_theme_setup.png b/radio/sdcard/horus/THEMES/Darkblue/mask_theme_setup.png deleted file mode 100644 index 2a39d1e40..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_theme_setup.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view1.png b/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view1.png deleted file mode 100644 index 9e67515ec..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view1.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view2.png b/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view2.png deleted file mode 100644 index 45cec234d..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view2.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view3.png b/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view3.png deleted file mode 100644 index e5a776b06..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view3.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view4.png b/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view4.png deleted file mode 100644 index 9064b9403..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view4.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view5.png b/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view5.png deleted file mode 100644 index 724bcc141..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view5.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view6.png b/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view6.png deleted file mode 100644 index 2aa43514b..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view6.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view7.png b/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view7.png deleted file mode 100644 index d6a0540f5..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view7.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view8.png b/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view8.png deleted file mode 100644 index 82dfd7875..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/mask_theme_view8.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/modelsel/icon_boat1.png b/radio/sdcard/horus/THEMES/Darkblue/modelsel/icon_boat1.png deleted file mode 100644 index a9335c4bc..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/modelsel/icon_boat1.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/modelsel/icon_boat2.png b/radio/sdcard/horus/THEMES/Darkblue/modelsel/icon_boat2.png deleted file mode 100644 index e3c899d18..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/modelsel/icon_boat2.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/modelsel/icon_default.png b/radio/sdcard/horus/THEMES/Darkblue/modelsel/icon_default.png deleted file mode 100644 index 6f3042c67..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/modelsel/icon_default.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/modelsel/icon_favorites.png b/radio/sdcard/horus/THEMES/Darkblue/modelsel/icon_favorites.png deleted file mode 100644 index e4a37dacb..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/modelsel/icon_favorites.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/modelsel/icon_plane1.png b/radio/sdcard/horus/THEMES/Darkblue/modelsel/icon_plane1.png deleted file mode 100644 index a49a50271..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/modelsel/icon_plane1.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/modelsel/icon_plane2.png b/radio/sdcard/horus/THEMES/Darkblue/modelsel/icon_plane2.png deleted file mode 100644 index 8305b4150..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/modelsel/icon_plane2.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/modelsel/icon_plane3.png b/radio/sdcard/horus/THEMES/Darkblue/modelsel/icon_plane3.png deleted file mode 100644 index d998144b2..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/modelsel/icon_plane3.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/modelsel/mask_iconback.png b/radio/sdcard/horus/THEMES/Darkblue/modelsel/mask_iconback.png deleted file mode 100644 index 966f6b7f2..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/modelsel/mask_iconback.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/modelsel/mask_modelname.png b/radio/sdcard/horus/THEMES/Darkblue/modelsel/mask_modelname.png deleted file mode 100644 index 2edca73ea..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/modelsel/mask_modelname.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/modelsel/mask_modelqty.png b/radio/sdcard/horus/THEMES/Darkblue/modelsel/mask_modelqty.png deleted file mode 100644 index 9a38e4f13..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/modelsel/mask_modelqty.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/modelsel/mask_moveback.png b/radio/sdcard/horus/THEMES/Darkblue/modelsel/mask_moveback.png deleted file mode 100644 index 63f56df92..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/modelsel/mask_moveback.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/modelsel/mask_moveico.png b/radio/sdcard/horus/THEMES/Darkblue/modelsel/mask_moveico.png deleted file mode 100644 index 3662b9bb0..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/modelsel/mask_moveico.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/modelsel/mask_sdfree.png b/radio/sdcard/horus/THEMES/Darkblue/modelsel/mask_sdfree.png deleted file mode 100644 index f0ae81982..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/modelsel/mask_sdfree.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/question.bmp b/radio/sdcard/horus/THEMES/Darkblue/question.bmp deleted file mode 100644 index 101d7ed53..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/question.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/shutdown.bmp b/radio/sdcard/horus/THEMES/Darkblue/shutdown.bmp deleted file mode 100755 index be7034db7..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/shutdown.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/stick_background.png b/radio/sdcard/horus/THEMES/Darkblue/stick_background.png deleted file mode 100644 index 9f6d53d92..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/stick_background.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/stick_pointer.png b/radio/sdcard/horus/THEMES/Darkblue/stick_pointer.png deleted file mode 100644 index 0d75765f9..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/stick_pointer.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/t16.bmp b/radio/sdcard/horus/THEMES/Darkblue/t16.bmp deleted file mode 100755 index 9c78cb498..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/t16.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/t18.bmp b/radio/sdcard/horus/THEMES/Darkblue/t18.bmp deleted file mode 100755 index c1220ca1b..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/t18.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/thumb.bmp b/radio/sdcard/horus/THEMES/Darkblue/thumb.bmp deleted file mode 100644 index af5de373e..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/thumb.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/topleft.png b/radio/sdcard/horus/THEMES/Darkblue/topleft.png deleted file mode 100644 index 603bfe1cf..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/topleft.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/topmenu_opentx.bmp b/radio/sdcard/horus/THEMES/Darkblue/topmenu_opentx.bmp deleted file mode 100644 index cbc7f8149..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/topmenu_opentx.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/trackp_background.png b/radio/sdcard/horus/THEMES/Darkblue/trackp_background.png deleted file mode 100644 index 5beada59e..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/trackp_background.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/tx16s.bmp b/radio/sdcard/horus/THEMES/Darkblue/tx16s.bmp deleted file mode 100644 index bb44eda41..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/tx16s.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/wizard/background.png b/radio/sdcard/horus/THEMES/Darkblue/wizard/background.png deleted file mode 100644 index 6b31b2914..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/wizard/background.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/wizard/itembg.png b/radio/sdcard/horus/THEMES/Darkblue/wizard/itembg.png deleted file mode 100644 index b899446b2..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/wizard/itembg.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/wizard/pgdn.png b/radio/sdcard/horus/THEMES/Darkblue/wizard/pgdn.png deleted file mode 100644 index 6a1377620..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/wizard/pgdn.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/wizard/pgup.png b/radio/sdcard/horus/THEMES/Darkblue/wizard/pgup.png deleted file mode 100644 index 06fab5cac..000000000 Binary files a/radio/sdcard/horus/THEMES/Darkblue/wizard/pgup.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Default/mask_radio_spectrum_analyser.png b/radio/sdcard/horus/THEMES/Default/mask_radio_spectrum_analyser.png deleted file mode 100755 index 2908833ec..000000000 Binary files a/radio/sdcard/horus/THEMES/Default/mask_radio_spectrum_analyser.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Default/mask_radio_tools.png b/radio/sdcard/horus/THEMES/Default/mask_radio_tools.png deleted file mode 100755 index 711d499de..000000000 Binary files a/radio/sdcard/horus/THEMES/Default/mask_radio_tools.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Default/t16.bmp b/radio/sdcard/horus/THEMES/Default/t16.bmp deleted file mode 100755 index ac0d16cf6..000000000 Binary files a/radio/sdcard/horus/THEMES/Default/t16.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Default/t18.bmp b/radio/sdcard/horus/THEMES/Default/t18.bmp deleted file mode 100755 index c1220ca1b..000000000 Binary files a/radio/sdcard/horus/THEMES/Default/t18.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Default/tx16s.bmp b/radio/sdcard/horus/THEMES/Default/tx16s.bmp deleted file mode 100644 index 8f6e2872d..000000000 Binary files a/radio/sdcard/horus/THEMES/Default/tx16s.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/asterisk.bmp b/radio/sdcard/horus/THEMES/EdgeTX/asterisk.bmp deleted file mode 100644 index 411c60c5d..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/asterisk.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/background.png b/radio/sdcard/horus/THEMES/EdgeTX/background.png deleted file mode 100644 index 119f3cdd8..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/background.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/busy.bmp b/radio/sdcard/horus/THEMES/EdgeTX/busy.bmp deleted file mode 100644 index d68df82e4..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/busy.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/icon_boat1.png b/radio/sdcard/horus/THEMES/EdgeTX/modelsel/icon_boat1.png deleted file mode 100644 index a9335c4bc..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/icon_boat1.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/icon_boat2.png b/radio/sdcard/horus/THEMES/EdgeTX/modelsel/icon_boat2.png deleted file mode 100644 index e3c899d18..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/icon_boat2.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/icon_default.png b/radio/sdcard/horus/THEMES/EdgeTX/modelsel/icon_default.png deleted file mode 100644 index 6f3042c67..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/icon_default.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/icon_favorites.png b/radio/sdcard/horus/THEMES/EdgeTX/modelsel/icon_favorites.png deleted file mode 100644 index e4a37dacb..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/icon_favorites.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/icon_plane1.png b/radio/sdcard/horus/THEMES/EdgeTX/modelsel/icon_plane1.png deleted file mode 100644 index a49a50271..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/icon_plane1.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/icon_plane2.png b/radio/sdcard/horus/THEMES/EdgeTX/modelsel/icon_plane2.png deleted file mode 100644 index 8305b4150..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/icon_plane2.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/icon_plane3.png b/radio/sdcard/horus/THEMES/EdgeTX/modelsel/icon_plane3.png deleted file mode 100644 index d998144b2..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/icon_plane3.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/mask_iconback.png b/radio/sdcard/horus/THEMES/EdgeTX/modelsel/mask_iconback.png deleted file mode 100644 index 966f6b7f2..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/mask_iconback.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/mask_modelname.png b/radio/sdcard/horus/THEMES/EdgeTX/modelsel/mask_modelname.png deleted file mode 100644 index 2edca73ea..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/mask_modelname.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/mask_modelqty.png b/radio/sdcard/horus/THEMES/EdgeTX/modelsel/mask_modelqty.png deleted file mode 100644 index 9a38e4f13..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/mask_modelqty.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/mask_moveback.png b/radio/sdcard/horus/THEMES/EdgeTX/modelsel/mask_moveback.png deleted file mode 100644 index 63f56df92..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/mask_moveback.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/mask_moveico.png b/radio/sdcard/horus/THEMES/EdgeTX/modelsel/mask_moveico.png deleted file mode 100644 index 3662b9bb0..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/mask_moveico.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/mask_sdfree.png b/radio/sdcard/horus/THEMES/EdgeTX/modelsel/mask_sdfree.png deleted file mode 100644 index f0ae81982..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/modelsel/mask_sdfree.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/question.bmp b/radio/sdcard/horus/THEMES/EdgeTX/question.bmp deleted file mode 100644 index 79792574b..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/question.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/shutdown.bmp b/radio/sdcard/horus/THEMES/EdgeTX/shutdown.bmp deleted file mode 100644 index be7034db7..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/shutdown.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/sleep.bmp b/radio/sdcard/horus/THEMES/EdgeTX/sleep.bmp deleted file mode 100644 index 279a9b855..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/sleep.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/thumb.bmp b/radio/sdcard/horus/THEMES/EdgeTX/thumb.bmp deleted file mode 100644 index 37de4998e..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/thumb.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/topleft.png b/radio/sdcard/horus/THEMES/EdgeTX/topleft.png deleted file mode 100644 index 603bfe1cf..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/topleft.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/wizard/background.png b/radio/sdcard/horus/THEMES/EdgeTX/wizard/background.png deleted file mode 100644 index 6b31b2914..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/wizard/background.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/wizard/itembg.png b/radio/sdcard/horus/THEMES/EdgeTX/wizard/itembg.png deleted file mode 100644 index b899446b2..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/wizard/itembg.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/wizard/pgdn.png b/radio/sdcard/horus/THEMES/EdgeTX/wizard/pgdn.png deleted file mode 100644 index 6a1377620..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/wizard/pgdn.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/wizard/pgup.png b/radio/sdcard/horus/THEMES/EdgeTX/wizard/pgup.png deleted file mode 100644 index 06fab5cac..000000000 Binary files a/radio/sdcard/horus/THEMES/EdgeTX/wizard/pgup.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/X10.bmp b/radio/sdcard/horus/THEMES/Flexi/X10.bmp deleted file mode 100755 index 32a730cde..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/X10.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/X10S.bmp b/radio/sdcard/horus/THEMES/Flexi/X10S.bmp deleted file mode 100644 index 221e25ec4..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/X10S.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/asterisk.bmp b/radio/sdcard/horus/THEMES/Flexi/asterisk.bmp deleted file mode 100644 index 3dd3cfef4..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/asterisk.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/busy.bmp b/radio/sdcard/horus/THEMES/Flexi/busy.bmp deleted file mode 100644 index 8e6a8b7f7..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/busy.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/ghost.png b/radio/sdcard/horus/THEMES/Flexi/ghost.png deleted file mode 100644 index cfec1cb35..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/ghost.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/horus.bmp b/radio/sdcard/horus/THEMES/Flexi/horus.bmp deleted file mode 100644 index 98bc631cd..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/horus.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_currentmenu_bg.png b/radio/sdcard/horus/THEMES/Flexi/mask_currentmenu_bg.png deleted file mode 100644 index 715792023..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_currentmenu_bg.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_currentmenu_dot.png b/radio/sdcard/horus/THEMES/Flexi/mask_currentmenu_dot.png deleted file mode 100644 index 6f76965a9..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_currentmenu_dot.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_currentmenu_shadow.png b/radio/sdcard/horus/THEMES/Flexi/mask_currentmenu_shadow.png deleted file mode 100644 index 97bf6c577..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_currentmenu_shadow.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_edgetx.png b/radio/sdcard/horus/THEMES/Flexi/mask_edgetx.png deleted file mode 100644 index 84a7d9782..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_edgetx.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_library.png b/radio/sdcard/horus/THEMES/Flexi/mask_library.png deleted file mode 100644 index 237883fc5..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_library.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_menu_model.png b/radio/sdcard/horus/THEMES/Flexi/mask_menu_model.png deleted file mode 100644 index 9832267b7..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_menu_model.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_menu_radio.png b/radio/sdcard/horus/THEMES/Flexi/mask_menu_radio.png deleted file mode 100644 index 6d93fbccc..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_menu_radio.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_menu_stats.png b/radio/sdcard/horus/THEMES/Flexi/mask_menu_stats.png deleted file mode 100644 index ebd482588..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_menu_stats.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_menu_theme.png b/radio/sdcard/horus/THEMES/Flexi/mask_menu_theme.png deleted file mode 100644 index 3a9fc15e7..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_menu_theme.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_model_curves.png b/radio/sdcard/horus/THEMES/Flexi/mask_model_curves.png deleted file mode 100644 index 6e1e19e8e..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_model_curves.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_model_flight_modes.png b/radio/sdcard/horus/THEMES/Flexi/mask_model_flight_modes.png deleted file mode 100644 index e963f0abb..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_model_flight_modes.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_model_gvars.png b/radio/sdcard/horus/THEMES/Flexi/mask_model_gvars.png deleted file mode 100644 index 0b5015dac..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_model_gvars.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_model_heli.png b/radio/sdcard/horus/THEMES/Flexi/mask_model_heli.png deleted file mode 100644 index ecd93d2ff..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_model_heli.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_model_inputs.png b/radio/sdcard/horus/THEMES/Flexi/mask_model_inputs.png deleted file mode 100644 index 720099c47..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_model_inputs.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_model_logical_switches.png b/radio/sdcard/horus/THEMES/Flexi/mask_model_logical_switches.png deleted file mode 100644 index 5cd1e3834..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_model_logical_switches.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_model_lua_scripts.png b/radio/sdcard/horus/THEMES/Flexi/mask_model_lua_scripts.png deleted file mode 100644 index a20c1ccbd..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_model_lua_scripts.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_model_mixer.png b/radio/sdcard/horus/THEMES/Flexi/mask_model_mixer.png deleted file mode 100644 index 009b360f1..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_model_mixer.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_model_outputs.png b/radio/sdcard/horus/THEMES/Flexi/mask_model_outputs.png deleted file mode 100644 index a209ae8d3..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_model_outputs.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_model_setup.png b/radio/sdcard/horus/THEMES/Flexi/mask_model_setup.png deleted file mode 100644 index afe526c8f..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_model_setup.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_model_special_functions.png b/radio/sdcard/horus/THEMES/Flexi/mask_model_special_functions.png deleted file mode 100644 index a12a2a50d..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_model_special_functions.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_model_telemetry.png b/radio/sdcard/horus/THEMES/Flexi/mask_model_telemetry.png deleted file mode 100644 index d95d3b25f..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_model_telemetry.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_monitor.png b/radio/sdcard/horus/THEMES/Flexi/mask_monitor.png deleted file mode 100644 index 68ddd4516..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_monitor.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_monitor_channels1.png b/radio/sdcard/horus/THEMES/Flexi/mask_monitor_channels1.png deleted file mode 100644 index b886fc1bc..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_monitor_channels1.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_monitor_channels2.png b/radio/sdcard/horus/THEMES/Flexi/mask_monitor_channels2.png deleted file mode 100644 index 4d0354e25..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_monitor_channels2.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_monitor_channels3.png b/radio/sdcard/horus/THEMES/Flexi/mask_monitor_channels3.png deleted file mode 100644 index d9ba27de7..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_monitor_channels3.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_monitor_channels4.png b/radio/sdcard/horus/THEMES/Flexi/mask_monitor_channels4.png deleted file mode 100644 index fb321151f..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_monitor_channels4.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_monitor_gvars.png b/radio/sdcard/horus/THEMES/Flexi/mask_monitor_gvars.png deleted file mode 100644 index 55b488d1e..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_monitor_gvars.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_monitor_inver.png b/radio/sdcard/horus/THEMES/Flexi/mask_monitor_inver.png deleted file mode 100644 index 64f251238..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_monitor_inver.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_monitor_lockch.png b/radio/sdcard/horus/THEMES/Flexi/mask_monitor_lockch.png deleted file mode 100644 index 360923a09..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_monitor_lockch.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_monitor_logsw.png b/radio/sdcard/horus/THEMES/Flexi/mask_monitor_logsw.png deleted file mode 100644 index dc6355143..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_monitor_logsw.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_monitor_mixes1.png b/radio/sdcard/horus/THEMES/Flexi/mask_monitor_mixes1.png deleted file mode 100644 index 7b0c71f60..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_monitor_mixes1.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_monitor_mixes2.png b/radio/sdcard/horus/THEMES/Flexi/mask_monitor_mixes2.png deleted file mode 100644 index f8c04780e..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_monitor_mixes2.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_mplex_add.png b/radio/sdcard/horus/THEMES/Flexi/mask_mplex_add.png deleted file mode 100644 index 14f4ecc23..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_mplex_add.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_mplex_multi.png b/radio/sdcard/horus/THEMES/Flexi/mask_mplex_multi.png deleted file mode 100644 index bcf79695f..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_mplex_multi.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_mplex_replace.png b/radio/sdcard/horus/THEMES/Flexi/mask_mplex_replace.png deleted file mode 100644 index faccba0ea..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_mplex_replace.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_opentx.png b/radio/sdcard/horus/THEMES/Flexi/mask_opentx.png deleted file mode 100644 index df2b0b356..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_opentx.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_opentx_testmode.png b/radio/sdcard/horus/THEMES/Flexi/mask_opentx_testmode.png deleted file mode 100644 index b535cf8ee..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_opentx_testmode.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_radio_calibration.png b/radio/sdcard/horus/THEMES/Flexi/mask_radio_calibration.png deleted file mode 100644 index db696778b..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_radio_calibration.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_radio_global_functions.png b/radio/sdcard/horus/THEMES/Flexi/mask_radio_global_functions.png deleted file mode 100644 index 3b3efefb5..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_radio_global_functions.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_radio_hardware.png b/radio/sdcard/horus/THEMES/Flexi/mask_radio_hardware.png deleted file mode 100644 index f51a1aee1..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_radio_hardware.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_radio_sd_browser.png b/radio/sdcard/horus/THEMES/Flexi/mask_radio_sd_browser.png deleted file mode 100644 index 75b6a9296..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_radio_sd_browser.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_radio_setup.png b/radio/sdcard/horus/THEMES/Flexi/mask_radio_setup.png deleted file mode 100644 index 0010a06ab..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_radio_setup.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_radio_spectrum_analyser.png b/radio/sdcard/horus/THEMES/Flexi/mask_radio_spectrum_analyser.png deleted file mode 100755 index 2908833ec..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_radio_spectrum_analyser.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_radio_tools.png b/radio/sdcard/horus/THEMES/Flexi/mask_radio_tools.png deleted file mode 100755 index 711d499de..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_radio_tools.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_radio_trainer.png b/radio/sdcard/horus/THEMES/Flexi/mask_radio_trainer.png deleted file mode 100644 index 7a0b56970..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_radio_trainer.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_radio_version.png b/radio/sdcard/horus/THEMES/Flexi/mask_radio_version.png deleted file mode 100644 index 8730f6c1a..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_radio_version.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_sbar_mixer.png b/radio/sdcard/horus/THEMES/Flexi/mask_sbar_mixer.png deleted file mode 100644 index 154406419..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_sbar_mixer.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_sbar_output.png b/radio/sdcard/horus/THEMES/Flexi/mask_sbar_output.png deleted file mode 100644 index 12d599823..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_sbar_output.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_sbar_to.png b/radio/sdcard/horus/THEMES/Flexi/mask_sbar_to.png deleted file mode 100644 index 813610307..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_sbar_to.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_stats_analogs.png b/radio/sdcard/horus/THEMES/Flexi/mask_stats_analogs.png deleted file mode 100644 index 96fc0c8a2..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_stats_analogs.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_stats_debug.png b/radio/sdcard/horus/THEMES/Flexi/mask_stats_debug.png deleted file mode 100644 index 0dce13d46..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_stats_debug.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_stats_lua.png b/radio/sdcard/horus/THEMES/Flexi/mask_stats_lua.png deleted file mode 100644 index d1b54a4d6..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_stats_lua.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_stats_throttle_graph.png b/radio/sdcard/horus/THEMES/Flexi/mask_stats_throttle_graph.png deleted file mode 100644 index a3720a005..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_stats_throttle_graph.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_stats_timers.png b/radio/sdcard/horus/THEMES/Flexi/mask_stats_timers.png deleted file mode 100644 index 78bf00064..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_stats_timers.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_stats_value.png b/radio/sdcard/horus/THEMES/Flexi/mask_stats_value.png deleted file mode 100644 index 180f16e8c..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_stats_value.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_switches.png b/radio/sdcard/horus/THEMES/Flexi/mask_switches.png deleted file mode 100644 index 4097ed751..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_switches.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_textline_curve.png b/radio/sdcard/horus/THEMES/Flexi/mask_textline_curve.png deleted file mode 100644 index 050229393..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_textline_curve.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_textline_delay.png b/radio/sdcard/horus/THEMES/Flexi/mask_textline_delay.png deleted file mode 100644 index 9b771a94a..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_textline_delay.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_textline_delayslow.png b/radio/sdcard/horus/THEMES/Flexi/mask_textline_delayslow.png deleted file mode 100644 index de2f7d1f7..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_textline_delayslow.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_textline_fm.png b/radio/sdcard/horus/THEMES/Flexi/mask_textline_fm.png deleted file mode 100644 index b9a2c4a32..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_textline_fm.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_textline_label.png b/radio/sdcard/horus/THEMES/Flexi/mask_textline_label.png deleted file mode 100644 index 8be12e39b..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_textline_label.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_textline_slow.png b/radio/sdcard/horus/THEMES/Flexi/mask_textline_slow.png deleted file mode 100644 index 1afbea37d..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_textline_slow.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_textline_switch.png b/radio/sdcard/horus/THEMES/Flexi/mask_textline_switch.png deleted file mode 100644 index 7c7d646e4..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_textline_switch.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_theme_add_view.png b/radio/sdcard/horus/THEMES/Flexi/mask_theme_add_view.png deleted file mode 100644 index 7e240372f..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_theme_add_view.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_theme_setup.png b/radio/sdcard/horus/THEMES/Flexi/mask_theme_setup.png deleted file mode 100644 index 2a39d1e40..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_theme_setup.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_theme_view1.png b/radio/sdcard/horus/THEMES/Flexi/mask_theme_view1.png deleted file mode 100644 index 9e67515ec..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_theme_view1.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_theme_view2.png b/radio/sdcard/horus/THEMES/Flexi/mask_theme_view2.png deleted file mode 100644 index 45cec234d..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_theme_view2.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_theme_view3.png b/radio/sdcard/horus/THEMES/Flexi/mask_theme_view3.png deleted file mode 100644 index e5a776b06..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_theme_view3.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_theme_view4.png b/radio/sdcard/horus/THEMES/Flexi/mask_theme_view4.png deleted file mode 100644 index 9064b9403..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_theme_view4.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_theme_view5.png b/radio/sdcard/horus/THEMES/Flexi/mask_theme_view5.png deleted file mode 100644 index 724bcc141..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_theme_view5.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_theme_view6.png b/radio/sdcard/horus/THEMES/Flexi/mask_theme_view6.png deleted file mode 100644 index 2aa43514b..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_theme_view6.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_theme_view7.png b/radio/sdcard/horus/THEMES/Flexi/mask_theme_view7.png deleted file mode 100644 index d6a0540f5..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_theme_view7.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/mask_theme_view8.png b/radio/sdcard/horus/THEMES/Flexi/mask_theme_view8.png deleted file mode 100644 index 82dfd7875..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/mask_theme_view8.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/modelsel/icon_boat1.png b/radio/sdcard/horus/THEMES/Flexi/modelsel/icon_boat1.png deleted file mode 100644 index a9335c4bc..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/modelsel/icon_boat1.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/modelsel/icon_boat2.png b/radio/sdcard/horus/THEMES/Flexi/modelsel/icon_boat2.png deleted file mode 100644 index e3c899d18..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/modelsel/icon_boat2.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/modelsel/icon_default.png b/radio/sdcard/horus/THEMES/Flexi/modelsel/icon_default.png deleted file mode 100644 index 6f3042c67..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/modelsel/icon_default.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/modelsel/icon_favorites.png b/radio/sdcard/horus/THEMES/Flexi/modelsel/icon_favorites.png deleted file mode 100644 index e4a37dacb..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/modelsel/icon_favorites.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/modelsel/icon_plane1.png b/radio/sdcard/horus/THEMES/Flexi/modelsel/icon_plane1.png deleted file mode 100644 index a49a50271..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/modelsel/icon_plane1.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/modelsel/icon_plane2.png b/radio/sdcard/horus/THEMES/Flexi/modelsel/icon_plane2.png deleted file mode 100644 index 8305b4150..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/modelsel/icon_plane2.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/modelsel/icon_plane3.png b/radio/sdcard/horus/THEMES/Flexi/modelsel/icon_plane3.png deleted file mode 100644 index d998144b2..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/modelsel/icon_plane3.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/modelsel/mask_iconback.png b/radio/sdcard/horus/THEMES/Flexi/modelsel/mask_iconback.png deleted file mode 100644 index 966f6b7f2..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/modelsel/mask_iconback.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/modelsel/mask_modelname.png b/radio/sdcard/horus/THEMES/Flexi/modelsel/mask_modelname.png deleted file mode 100644 index 2edca73ea..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/modelsel/mask_modelname.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/modelsel/mask_modelqty.png b/radio/sdcard/horus/THEMES/Flexi/modelsel/mask_modelqty.png deleted file mode 100644 index 9a38e4f13..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/modelsel/mask_modelqty.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/modelsel/mask_moveback.png b/radio/sdcard/horus/THEMES/Flexi/modelsel/mask_moveback.png deleted file mode 100644 index 63f56df92..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/modelsel/mask_moveback.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/modelsel/mask_moveico.png b/radio/sdcard/horus/THEMES/Flexi/modelsel/mask_moveico.png deleted file mode 100644 index 3662b9bb0..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/modelsel/mask_moveico.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/modelsel/mask_sdfree.png b/radio/sdcard/horus/THEMES/Flexi/modelsel/mask_sdfree.png deleted file mode 100644 index f0ae81982..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/modelsel/mask_sdfree.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/question.bmp b/radio/sdcard/horus/THEMES/Flexi/question.bmp deleted file mode 100644 index 101d7ed53..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/question.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/shutdown.bmp b/radio/sdcard/horus/THEMES/Flexi/shutdown.bmp deleted file mode 100755 index be7034db7..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/shutdown.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/stick_background.png b/radio/sdcard/horus/THEMES/Flexi/stick_background.png deleted file mode 100644 index 9f6d53d92..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/stick_background.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/stick_pointer.png b/radio/sdcard/horus/THEMES/Flexi/stick_pointer.png deleted file mode 100644 index 0d75765f9..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/stick_pointer.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/t16.bmp b/radio/sdcard/horus/THEMES/Flexi/t16.bmp deleted file mode 100755 index 9c78cb498..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/t16.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/t18.bmp b/radio/sdcard/horus/THEMES/Flexi/t18.bmp deleted file mode 100755 index c1220ca1b..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/t18.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/thumb.bmp b/radio/sdcard/horus/THEMES/Flexi/thumb.bmp deleted file mode 100644 index c0494a694..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/thumb.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/topleft.png b/radio/sdcard/horus/THEMES/Flexi/topleft.png deleted file mode 100644 index 603bfe1cf..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/topleft.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/topmenu_opentx.bmp b/radio/sdcard/horus/THEMES/Flexi/topmenu_opentx.bmp deleted file mode 100644 index cbc7f8149..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/topmenu_opentx.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/trackp_background.png b/radio/sdcard/horus/THEMES/Flexi/trackp_background.png deleted file mode 100644 index 5beada59e..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/trackp_background.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/tx16s.bmp b/radio/sdcard/horus/THEMES/Flexi/tx16s.bmp deleted file mode 100644 index bb44eda41..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/tx16s.bmp and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/wizard/background.png b/radio/sdcard/horus/THEMES/Flexi/wizard/background.png deleted file mode 100644 index 6b31b2914..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/wizard/background.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/wizard/itembg.png b/radio/sdcard/horus/THEMES/Flexi/wizard/itembg.png deleted file mode 100644 index b899446b2..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/wizard/itembg.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/wizard/pgdn.png b/radio/sdcard/horus/THEMES/Flexi/wizard/pgdn.png deleted file mode 100644 index 6a1377620..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/wizard/pgdn.png and /dev/null differ diff --git a/radio/sdcard/horus/THEMES/Flexi/wizard/pgup.png b/radio/sdcard/horus/THEMES/Flexi/wizard/pgup.png deleted file mode 100644 index 06fab5cac..000000000 Binary files a/radio/sdcard/horus/THEMES/Flexi/wizard/pgup.png and /dev/null differ diff --git a/radio/sdcard/horus/UTILITIES/MultiConfigExternal.lua b/radio/sdcard/horus/UTILITIES/MultiConfigExternal.lua deleted file mode 100755 index a8baf3d13..000000000 --- a/radio/sdcard/horus/UTILITIES/MultiConfigExternal.lua +++ /dev/null @@ -1,499 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - - ---############################################################################### --- Multi buffer for Config description --- To start operation: --- Write 0xFF at address 4 will request the buffer to be cleared --- Write "Conf" at address 0..3 --- Read --- Read at address 12 gives the current config page --- Read at address 13..172 gives the current data of the page = 8 lines * 20 caracters --- Write --- Write at address 5..11 the command --- Write 0x01 at address 4 will send the command to the module --- !! Before exiting the script must write 0 at address 0 for normal operation !! ---############################################################################### - -local Version = "v0.1" -local Focus = -1 -local Page = 0 -local Edit = -1 -local Edit_pos = 1 -local Menu = { {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""} } -local Menu_value = {} -local Blink = 0 -local Module = {} -local InitialProtocol = 0 - -function bitand(a, b) - local result = 0 - local bitval = 1 - while a > 0 and b > 0 do - if a % 2 == 1 and b % 2 == 1 then -- test the rightmost bits - result = result + bitval -- set the current bit - end - bitval = bitval * 2 -- shift left - a = math.floor(a/2) -- shift right - b = math.floor(b/2) - end - return result -end - -local function Config_Send(page, line, value) - local i - i = (page*16) + line - multiBuffer( 5, i ) - for i = 1 , 6 , 1 do - multiBuffer( 5+i, value[i] ) - end - multiBuffer( 4, 1 ) -end - -local function Config_Release() - Module.protocol = InitialProtocol - model.setModule(1, Module) - - local i - for i = 3 , 0 , -1 do - multiBuffer( i, 0 ) - end -end - -local function Config_Page( ) - Config_Send(Page, 0, { 0, 0, 0, 0, 0, 0 }) -end - -local function Config_Draw_Edit( event ) - local i - local text - - if Menu[Focus].field_type == 0xD0 then - -- Editable Hex value - if Edit == -1 then - -- Init - Edit = 0 - Edit_pos = 1 - Blink = 0 - for i = 1, Menu[Focus].field_len, 1 do - Menu_value[i] = Menu[Focus].field_value[i] - end - end - if Edit == 0 then - -- Not editing value - if event == EVT_VIRTUAL_ENTER then - if Edit_pos > Menu[Focus].field_len then - -- Save or Cancel - Edit = -1 - if Edit_pos == Menu[Focus].field_len + 1 then - -- Save - Config_Send(Page, Focus, Menu_value) - end - return - else - -- Switch to edit mode - Edit = 1 - end - elseif event == EVT_VIRTUAL_PREV and Edit_pos > 1 then - -- Move cursor - Edit_pos = Edit_pos - 1 - elseif event == EVT_VIRTUAL_NEXT and Edit_pos < Menu[Focus].field_len + 2 then - -- Move cursor - Edit_pos = Edit_pos + 1 - end - else - -- Editing value - if event == EVT_VIRTUAL_ENTER then - -- End edit - Edit = 0 - elseif event == EVT_VIRTUAL_PREV then - -- Change value - Menu_value[Edit_pos] = Menu_value[Edit_pos] - 1 - elseif event == EVT_VIRTUAL_NEXT then - -- Change value - Menu_value[Edit_pos] = Menu_value[Edit_pos] + 1 - end - --Blink - Blink = Blink + 1 - if Blink > 30 then - Blink = 0 - end - end - --Display - if LCD_W == 480 then - lcd.drawRectangle(160-1, 100-1, 160+2, 55+2, TEXT_COLOR) - lcd.drawFilledRectangle(160, 100, 160, 55, TEXT_BGCOLOR) - else - lcd.clear() - end - for i = 1, Menu[Focus].field_len, 1 do - if i==Edit_pos and (Edit ~= 1 or Blink > 15) then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(170+12*2*(i-1), 110, string.format('%02X', Menu_value[i]), attrib) - else - lcd.drawText(17+6*2*(i-1), 10, string.format('%02X', Menu_value[i]), attrib + SMLSIZE) - end - end - if Edit_pos == Menu[Focus].field_len + 1 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(170, 130, "Save", attrib) - else - lcd.drawText(17, 30, "Save", attrib + SMLSIZE) - end - if Edit_pos == Menu[Focus].field_len + 2 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(260, 130, "Cancel", attrib) - else - lcd.drawText(77, 30, "Cancel", attrib + SMLSIZE) - end - - elseif Menu[Focus].field_type == 0x90 then - -- Action text - if Edit == -1 then - -- Init - Edit = 0 - Edit_pos = 2 - end - if event == EVT_VIRTUAL_ENTER then - -- Exit - Edit = -1 - if Edit_pos == 1 then - -- Yes - Config_Send(Page, Focus, { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA } ) - end - return - elseif event == EVT_VIRTUAL_PREV and Edit_pos > 1 then - -- Switch to Yes - Edit_pos = Edit_pos - 1 - elseif event == EVT_VIRTUAL_NEXT and Edit_pos < 2 then - -- Switch to No - Edit_pos = Edit_pos + 1 - end - -- Display - if LCD_W == 480 then - lcd.drawRectangle(160-1, 100-1, 160+2, 55+2, TEXT_COLOR) - lcd.drawFilledRectangle(160, 100, 160, 55, TEXT_BGCOLOR) - else - lcd.clear() - end - if LCD_W == 480 then - lcd.drawText(170, 110, Menu[Focus].field_text .. "?") - else - lcd.drawText(17, 10, Menu[Focus].field_text .. "?", SMLSIZE) - end - if Edit_pos == 1 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(170, 130, "Yes", attrib) - else - lcd.drawText(17, 30, "Yes", attrib + SMLSIZE) - end - if Edit_pos == 2 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(260, 130, "No", attrib) - else - lcd.drawText(77, 30, "No", attrib) - end - end -end - -local function Config_Next_Prev( event ) --- Next Prev on main menu - local line - if event == EVT_VIRTUAL_PREV then - for line = Focus - 1, 1, -1 do - if Menu[line].field_type >= 0x80 and Menu[line].field_type ~= 0xA0 and Menu[line].field_type ~= 0xC0 then - Focus = line - break - end - end - elseif event == EVT_VIRTUAL_NEXT then - for line = Focus + 1, 7, 1 do - if Menu[line].field_type >= 0x80 and Menu[line].field_type ~= 0xA0 and Menu[line].field_type ~= 0xC0 then - Focus = line - break - end - end - end -end - -local function Config_Draw_Menu() --- Main menu - local i - local value - local line - local length - local text - - lcd.clear() - - if LCD_W == 480 then - --Draw title - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, "Multi Config " .. Version, MENU_TITLE_COLOR) - if multiBuffer(13) == 0x00 then - lcd.drawText(10,50,"No Config telemetry...", BLINK) - end - else - --Draw on LCD_W=128 - lcd.drawText(1, 0, "Multi Config " .. Version, SMLSIZE) - if multiBuffer(13) == 0x00 then - lcd.drawText(2,17,"No Config telemetry...",SMLSIZE) - end - end - - if multiBuffer(13) ~= 0x00 then - if LCD_W == 480 then - --Draw firmware version and channels order - local ch_order = multiBuffer(17) - local channel_names = {} - channel_names[bitand(ch_order,3)+1] = "A" - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = "E" - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = "T" - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = "R" - lcd.drawText(150, 5, "Firmware v" .. multiBuffer(13) .. "." .. multiBuffer(14) .. "." .. multiBuffer(15) .. "." .. multiBuffer(16), MENU_TITLE_COLOR) - --lcd.drawText(150, 5, "Firmware v" .. multiBuffer(13) .. "." .. multiBuffer(14) .. "." .. multiBuffer(15) .. "." .. multiBuffer(16) .. " " .. channel_names[1] .. channel_names[2] .. channel_names[3] .. channel_names[4], MENU_TITLE_COLOR) - else - lcd.drawText(76, 0, "/Fw" .. multiBuffer(13) .. "." .. multiBuffer(14) .. "." .. multiBuffer(15) .. "." .. multiBuffer(16),SMLSIZE) -- .. " " .. channel_names[1] .. channel_names[2] .. channel_names[3] .. channel_names[4]) - end - - --Draw Menu - for line = 1, 7, 1 do - --Clear line info - Menu[line].text = "" - Menu[line].field_type = 0 - Menu[line].field_len = 0 - for i = 1, 7, 1 do - Menu[line].field_value[i] = 0 - end - Menu[line].field_text = "" - length = 0 - --Read line from buffer - for i = 0, 20-1, 1 do - value=multiBuffer( line*20+13+i ) - if value == 0 then - break -- end of line - end - if value > 0x80 and Menu[line].field_type == 0 then - -- Read field type - Menu[line].field_type = bitand(value, 0xF0) - Menu[line].field_len = bitand(value, 0x0F) - length = Menu[line].field_len - if Menu[line].field_type ~= 0xA0 and Menu[line].field_type ~= 0xC0 and Focus == -1 then - -- First actionnable field if nothing was selected - Focus = line; - end - else - if Menu[line].field_type == 0 then - -- Text - Menu[line].text = Menu[line].text .. string.char(value) - else - -- Menu specific fields - length = length - 1 - if Menu[line].field_type == 0x80 or Menu[line].field_type == 0x90 then - Menu[line].field_text = Menu[line].field_text .. string.char(value) - else - Menu[line].field_value[Menu[line].field_len-length] = value - end - if length == 0 then - -- End of fields - break - end - end - end - end - -- Display menu text - if Menu[line].text ~= "" then - if Menu[line].field_type == 0xA0 or Menu[line].field_type == 0xB0 or Menu[line].field_type == 0xC0 or Menu[line].field_type == 0xD0 then - Menu[line].text = Menu[line].text .. ":" - end - if LCD_W == 480 then - lcd.drawText(10,32+20*line,Menu[line].text ) - else - lcd.drawText(2,1+8*line,Menu[line].text,SMLSIZE) - end - end - -- Display specific fields - if line == Focus then - attrib = INVERS - else - attrib = 0 - end - if Menu[line].field_type == 0x80 or Menu[line].field_type == 0x90 then - -- Text - if LCD_W == 480 then - lcd.drawText(10+9*#Menu[line].text, 32+20*line, Menu[line].field_text, attrib) - else - lcd.drawText(2+5*#Menu[line].text, 1+8*line, Menu[line].field_text, SMLSIZE + attrib) - end - elseif Menu[line].field_type == 0xA0 or Menu[line].field_type == 0xB0 then - -- Decimal value - value = 0 - for i = 1, Menu[line].field_len, 1 do - value = value*256 + value - end - if LCD_W == 480 then - lcd.drawText(10+9*#Menu[line].text, 32+20*line, value, attrib) - else - lcd.drawText(2+5*#Menu[line].text, 1+8*line, value, SMLSIZE + attrib) - end - elseif Menu[line].field_type == 0xC0 or Menu[line].field_type == 0xD0 then - -- Hex value - text="" - for i = 1, Menu[line].field_len, 1 do - text = text .. string.format('%02X ', Menu[line].field_value[i]) - end - if LCD_W == 480 then - lcd.drawText(10+9*#Menu[line].text, 32+20*line, text, attrib) - else - lcd.drawText(2+5*#Menu[line].text, 1+8*line, text, SMLSIZE + attrib) - end - end - end - end -end - --- Init -local function Config_Init() - --get Module settings and set to config - Module = model.getModule(1) - InitialProtocol = Module.protocol - Module.protocol = 86 - model.setModule(1, Module) - for i = 0, 10, 1 do end - --Set protocol to talk to - multiBuffer( 0, string.byte('C') ) - --test if value has been written - if multiBuffer( 0 ) ~= string.byte('C') then - error("Not enough memory!") - return 2 - end - --Request init of the buffer - multiBuffer( 4, 0xFF ) - --Continue buffer init - multiBuffer( 1, string.byte('o') ) - multiBuffer( 2, string.byte('n') ) - multiBuffer( 3, string.byte('f') ) - - -- Test set - -- multiBuffer( 12, 0 ) - -- multiBuffer( 13, 1 ) - -- multiBuffer( 14, 3 ) - -- multiBuffer( 15, 2 ) - -- multiBuffer( 16, 62 ) - -- multiBuffer( 17, 0 + 1*4 + 2*16 + 3*64) - - -- multiBuffer( 33, string.byte('G') ) - -- multiBuffer( 34, string.byte('l') ) - -- multiBuffer( 35, string.byte('o') ) - -- multiBuffer( 36, string.byte('b') ) - -- multiBuffer( 37, string.byte('a') ) - -- multiBuffer( 38, string.byte('l') ) - -- multiBuffer( 39, string.byte(' ') ) - -- multiBuffer( 40, string.byte('I') ) - -- multiBuffer( 41, string.byte('D') ) - -- multiBuffer( 42, 0xD0 + 4 ) - -- multiBuffer( 43, 0x12 ) - -- multiBuffer( 44, 0x34 ) - -- multiBuffer( 45, 0x56 ) - -- multiBuffer( 46, 0x78 ) - -- multiBuffer( 47, 0x9A ) - -- multiBuffer( 48, 0xBC ) - - -- multiBuffer( 53, 0x90 + 9 ) - -- multiBuffer( 54, string.byte('R') ) - -- multiBuffer( 55, string.byte('e') ) - -- multiBuffer( 56, string.byte('s') ) - -- multiBuffer( 57, string.byte('e') ) - -- multiBuffer( 58, string.byte('t') ) - -- multiBuffer( 59, string.byte(' ') ) - -- multiBuffer( 60, string.byte('G') ) - -- multiBuffer( 61, string.byte('I') ) - -- multiBuffer( 62, string.byte('D') ) - -- multiBuffer( 63, 0x00 ) -end - --- Main -local function Config_Run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_EXIT then - Config_Release() - return 2 - else - Config_Draw_Menu() - if ( event == EVT_VIRTUAL_PREV_PAGE or event == EVT_VIRTUAL_NEXT_PAGE ) and Edit < 1 then - -- Not editing, ok to change page - if event == EVT_VIRTUAL_PREV_PAGE then - killEvents(event) - if Page > 0 then - --Page = Page - 1 - --Config_Page() - end - else - --Page = Page + 1 - --Config_Page() - end - end - if Focus > 0 then - -- At least one line has an action - if Edit >= 0 then - -- Currently editing - Config_Draw_Edit( event ) - elseif event == EVT_VIRTUAL_ENTER then - -- Switch to edit - Config_Draw_Edit( 0 ) - elseif event == EVT_VIRTUAL_PREV or event == EVT_VIRTUAL_NEXT then - -- Main menu selection - Config_Next_Prev( event ) - end - end - return 0 - end -end - -return { init=Config_Init, run=Config_Run } diff --git a/radio/sdcard/horus/UTILITIES/MultiConfigInternal.lua b/radio/sdcard/horus/UTILITIES/MultiConfigInternal.lua deleted file mode 100755 index 29ced006c..000000000 --- a/radio/sdcard/horus/UTILITIES/MultiConfigInternal.lua +++ /dev/null @@ -1,499 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - - ---############################################################################### --- Multi buffer for Config description --- To start operation: --- Write 0xFF at address 4 will request the buffer to be cleared --- Write "Conf" at address 0..3 --- Read --- Read at address 12 gives the current config page --- Read at address 13..172 gives the current data of the page = 8 lines * 20 caracters --- Write --- Write at address 5..11 the command --- Write 0x01 at address 4 will send the command to the module --- !! Before exiting the script must write 0 at address 0 for normal operation !! ---############################################################################### - -local Version = "v0.1" -local Focus = -1 -local Page = 0 -local Edit = -1 -local Edit_pos = 1 -local Menu = { {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""} } -local Menu_value = {} -local Blink = 0 -local Module = {} -local InitialProtocol = 0 - -function bitand(a, b) - local result = 0 - local bitval = 1 - while a > 0 and b > 0 do - if a % 2 == 1 and b % 2 == 1 then -- test the rightmost bits - result = result + bitval -- set the current bit - end - bitval = bitval * 2 -- shift left - a = math.floor(a/2) -- shift right - b = math.floor(b/2) - end - return result -end - -local function Config_Send(page, line, value) - local i - i = (page*16) + line - multiBuffer( 5, i ) - for i = 1 , 6 , 1 do - multiBuffer( 5+i, value[i] ) - end - multiBuffer( 4, 1 ) -end - -local function Config_Release() - Module.protocol = InitialProtocol - model.setModule(0, Module) - - local i - for i = 3 , 0 , -1 do - multiBuffer( i, 0 ) - end -end - -local function Config_Page( ) - Config_Send(Page, 0, { 0, 0, 0, 0, 0, 0 }) -end - -local function Config_Draw_Edit( event ) - local i - local text - - if Menu[Focus].field_type == 0xD0 then - -- Editable Hex value - if Edit == -1 then - -- Init - Edit = 0 - Edit_pos = 1 - Blink = 0 - for i = 1, Menu[Focus].field_len, 1 do - Menu_value[i] = Menu[Focus].field_value[i] - end - end - if Edit == 0 then - -- Not editing value - if event == EVT_VIRTUAL_ENTER then - if Edit_pos > Menu[Focus].field_len then - -- Save or Cancel - Edit = -1 - if Edit_pos == Menu[Focus].field_len + 1 then - -- Save - Config_Send(Page, Focus, Menu_value) - end - return - else - -- Switch to edit mode - Edit = 1 - end - elseif event == EVT_VIRTUAL_PREV and Edit_pos > 1 then - -- Move cursor - Edit_pos = Edit_pos - 1 - elseif event == EVT_VIRTUAL_NEXT and Edit_pos < Menu[Focus].field_len + 2 then - -- Move cursor - Edit_pos = Edit_pos + 1 - end - else - -- Editing value - if event == EVT_VIRTUAL_ENTER then - -- End edit - Edit = 0 - elseif event == EVT_VIRTUAL_PREV then - -- Change value - Menu_value[Edit_pos] = Menu_value[Edit_pos] - 1 - elseif event == EVT_VIRTUAL_NEXT then - -- Change value - Menu_value[Edit_pos] = Menu_value[Edit_pos] + 1 - end - --Blink - Blink = Blink + 1 - if Blink > 30 then - Blink = 0 - end - end - --Display - if LCD_W == 480 then - lcd.drawRectangle(160-1, 100-1, 160+2, 55+2, TEXT_COLOR) - lcd.drawFilledRectangle(160, 100, 160, 55, TEXT_BGCOLOR) - else - lcd.clear() - end - for i = 1, Menu[Focus].field_len, 1 do - if i==Edit_pos and (Edit ~= 1 or Blink > 15) then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(170+12*2*(i-1), 110, string.format('%02X', Menu_value[i]), attrib) - else - lcd.drawText(17+6*2*(i-1), 10, string.format('%02X', Menu_value[i]), attrib + SMLSIZE) - end - end - if Edit_pos == Menu[Focus].field_len + 1 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(170, 130, "Save", attrib) - else - lcd.drawText(17, 30, "Save", attrib + SMLSIZE) - end - if Edit_pos == Menu[Focus].field_len + 2 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(260, 130, "Cancel", attrib) - else - lcd.drawText(77, 30, "Cancel", attrib + SMLSIZE) - end - - elseif Menu[Focus].field_type == 0x90 then - -- Action text - if Edit == -1 then - -- Init - Edit = 0 - Edit_pos = 2 - end - if event == EVT_VIRTUAL_ENTER then - -- Exit - Edit = -1 - if Edit_pos == 1 then - -- Yes - Config_Send(Page, Focus, { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA } ) - end - return - elseif event == EVT_VIRTUAL_PREV and Edit_pos > 1 then - -- Switch to Yes - Edit_pos = Edit_pos - 1 - elseif event == EVT_VIRTUAL_NEXT and Edit_pos < 2 then - -- Switch to No - Edit_pos = Edit_pos + 1 - end - -- Display - if LCD_W == 480 then - lcd.drawRectangle(160-1, 100-1, 160+2, 55+2, TEXT_COLOR) - lcd.drawFilledRectangle(160, 100, 160, 55, TEXT_BGCOLOR) - else - lcd.clear() - end - if LCD_W == 480 then - lcd.drawText(170, 110, Menu[Focus].field_text .. "?") - else - lcd.drawText(17, 10, Menu[Focus].field_text .. "?", SMLSIZE) - end - if Edit_pos == 1 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(170, 130, "Yes", attrib) - else - lcd.drawText(17, 30, "Yes", attrib + SMLSIZE) - end - if Edit_pos == 2 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(260, 130, "No", attrib) - else - lcd.drawText(77, 30, "No", attrib) - end - end -end - -local function Config_Next_Prev( event ) --- Next Prev on main menu - local line - if event == EVT_VIRTUAL_PREV then - for line = Focus - 1, 1, -1 do - if Menu[line].field_type >= 0x80 and Menu[line].field_type ~= 0xA0 and Menu[line].field_type ~= 0xC0 then - Focus = line - break - end - end - elseif event == EVT_VIRTUAL_NEXT then - for line = Focus + 1, 7, 1 do - if Menu[line].field_type >= 0x80 and Menu[line].field_type ~= 0xA0 and Menu[line].field_type ~= 0xC0 then - Focus = line - break - end - end - end -end - -local function Config_Draw_Menu() --- Main menu - local i - local value - local line - local length - local text - - lcd.clear() - - if LCD_W == 480 then - --Draw title - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, "Multi Config " .. Version, MENU_TITLE_COLOR) - if multiBuffer(13) == 0x00 then - lcd.drawText(10,50,"No Config telemetry...", BLINK) - end - else - --Draw on LCD_W=128 - lcd.drawText(1, 0, "Multi Config " .. Version, SMLSIZE) - if multiBuffer(13) == 0x00 then - lcd.drawText(2,17,"No Config telemetry...",SMLSIZE) - end - end - - if multiBuffer(13) ~= 0x00 then - if LCD_W == 480 then - --Draw firmware version and channels order - local ch_order = multiBuffer(17) - local channel_names = {} - channel_names[bitand(ch_order,3)+1] = "A" - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = "E" - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = "T" - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = "R" - lcd.drawText(150, 5, "Firmware v" .. multiBuffer(13) .. "." .. multiBuffer(14) .. "." .. multiBuffer(15) .. "." .. multiBuffer(16), MENU_TITLE_COLOR) - --lcd.drawText(150, 5, "Firmware v" .. multiBuffer(13) .. "." .. multiBuffer(14) .. "." .. multiBuffer(15) .. "." .. multiBuffer(16) .. " " .. channel_names[1] .. channel_names[2] .. channel_names[3] .. channel_names[4], MENU_TITLE_COLOR) - else - lcd.drawText(76, 0, "/Fw" .. multiBuffer(13) .. "." .. multiBuffer(14) .. "." .. multiBuffer(15) .. "." .. multiBuffer(16),SMLSIZE) -- .. " " .. channel_names[1] .. channel_names[2] .. channel_names[3] .. channel_names[4]) - end - - --Draw Menu - for line = 1, 7, 1 do - --Clear line info - Menu[line].text = "" - Menu[line].field_type = 0 - Menu[line].field_len = 0 - for i = 1, 7, 1 do - Menu[line].field_value[i] = 0 - end - Menu[line].field_text = "" - length = 0 - --Read line from buffer - for i = 0, 20-1, 1 do - value=multiBuffer( line*20+13+i ) - if value == 0 then - break -- end of line - end - if value > 0x80 and Menu[line].field_type == 0 then - -- Read field type - Menu[line].field_type = bitand(value, 0xF0) - Menu[line].field_len = bitand(value, 0x0F) - length = Menu[line].field_len - if Menu[line].field_type ~= 0xA0 and Menu[line].field_type ~= 0xC0 and Focus == -1 then - -- First actionnable field if nothing was selected - Focus = line; - end - else - if Menu[line].field_type == 0 then - -- Text - Menu[line].text = Menu[line].text .. string.char(value) - else - -- Menu specific fields - length = length - 1 - if Menu[line].field_type == 0x80 or Menu[line].field_type == 0x90 then - Menu[line].field_text = Menu[line].field_text .. string.char(value) - else - Menu[line].field_value[Menu[line].field_len-length] = value - end - if length == 0 then - -- End of fields - break - end - end - end - end - -- Display menu text - if Menu[line].text ~= "" then - if Menu[line].field_type == 0xA0 or Menu[line].field_type == 0xB0 or Menu[line].field_type == 0xC0 or Menu[line].field_type == 0xD0 then - Menu[line].text = Menu[line].text .. ":" - end - if LCD_W == 480 then - lcd.drawText(10,32+20*line,Menu[line].text ) - else - lcd.drawText(2,1+8*line,Menu[line].text,SMLSIZE) - end - end - -- Display specific fields - if line == Focus then - attrib = INVERS - else - attrib = 0 - end - if Menu[line].field_type == 0x80 or Menu[line].field_type == 0x90 then - -- Text - if LCD_W == 480 then - lcd.drawText(10+9*#Menu[line].text, 32+20*line, Menu[line].field_text, attrib) - else - lcd.drawText(2+5*#Menu[line].text, 1+8*line, Menu[line].field_text, SMLSIZE + attrib) - end - elseif Menu[line].field_type == 0xA0 or Menu[line].field_type == 0xB0 then - -- Decimal value - value = 0 - for i = 1, Menu[line].field_len, 1 do - value = value*256 + value - end - if LCD_W == 480 then - lcd.drawText(10+9*#Menu[line].text, 32+20*line, value, attrib) - else - lcd.drawText(2+5*#Menu[line].text, 1+8*line, value, SMLSIZE + attrib) - end - elseif Menu[line].field_type == 0xC0 or Menu[line].field_type == 0xD0 then - -- Hex value - text="" - for i = 1, Menu[line].field_len, 1 do - text = text .. string.format('%02X ', Menu[line].field_value[i]) - end - if LCD_W == 480 then - lcd.drawText(10+9*#Menu[line].text, 32+20*line, text, attrib) - else - lcd.drawText(2+5*#Menu[line].text, 1+8*line, text, SMLSIZE + attrib) - end - end - end - end -end - --- Init -local function Config_Init() - --get Module settings and set to config - Module = model.getModule(0) - InitialProtocol = Module.protocol - Module.protocol = 86 - model.setModule(0, Module) - for i = 0, 10, 1 do end - --Set protocol to talk to - multiBuffer( 0, string.byte('C') ) - --test if value has been written - if multiBuffer( 0 ) ~= string.byte('C') then - error("Not enough memory!") - return 2 - end - --Request init of the buffer - multiBuffer( 4, 0xFF ) - --Continue buffer init - multiBuffer( 1, string.byte('o') ) - multiBuffer( 2, string.byte('n') ) - multiBuffer( 3, string.byte('f') ) - - -- Test set - -- multiBuffer( 12, 0 ) - -- multiBuffer( 13, 1 ) - -- multiBuffer( 14, 3 ) - -- multiBuffer( 15, 2 ) - -- multiBuffer( 16, 62 ) - -- multiBuffer( 17, 0 + 1*4 + 2*16 + 3*64) - - -- multiBuffer( 33, string.byte('G') ) - -- multiBuffer( 34, string.byte('l') ) - -- multiBuffer( 35, string.byte('o') ) - -- multiBuffer( 36, string.byte('b') ) - -- multiBuffer( 37, string.byte('a') ) - -- multiBuffer( 38, string.byte('l') ) - -- multiBuffer( 39, string.byte(' ') ) - -- multiBuffer( 40, string.byte('I') ) - -- multiBuffer( 41, string.byte('D') ) - -- multiBuffer( 42, 0xD0 + 4 ) - -- multiBuffer( 43, 0x12 ) - -- multiBuffer( 44, 0x34 ) - -- multiBuffer( 45, 0x56 ) - -- multiBuffer( 46, 0x78 ) - -- multiBuffer( 47, 0x9A ) - -- multiBuffer( 48, 0xBC ) - - -- multiBuffer( 53, 0x90 + 9 ) - -- multiBuffer( 54, string.byte('R') ) - -- multiBuffer( 55, string.byte('e') ) - -- multiBuffer( 56, string.byte('s') ) - -- multiBuffer( 57, string.byte('e') ) - -- multiBuffer( 58, string.byte('t') ) - -- multiBuffer( 59, string.byte(' ') ) - -- multiBuffer( 60, string.byte('G') ) - -- multiBuffer( 61, string.byte('I') ) - -- multiBuffer( 62, string.byte('D') ) - -- multiBuffer( 63, 0x00 ) -end - --- Main -local function Config_Run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_EXIT then - Config_Release() - return 2 - else - Config_Draw_Menu() - if ( event == EVT_VIRTUAL_PREV_PAGE or event == EVT_VIRTUAL_NEXT_PAGE ) and Edit < 1 then - -- Not editing, ok to change page - if event == EVT_VIRTUAL_PREV_PAGE then - killEvents(event) - if Page > 0 then - --Page = Page - 1 - --Config_Page() - end - else - --Page = Page + 1 - --Config_Page() - end - end - if Focus > 0 then - -- At least one line has an action - if Edit >= 0 then - -- Currently editing - Config_Draw_Edit( event ) - elseif event == EVT_VIRTUAL_ENTER then - -- Switch to edit - Config_Draw_Edit( 0 ) - elseif event == EVT_VIRTUAL_PREV or event == EVT_VIRTUAL_NEXT then - -- Main menu selection - Config_Next_Prev( event ) - end - end - return 0 - end -end - -return { init=Config_Init, run=Config_Run } diff --git a/radio/sdcard/horus/UTILITIES/SxR Calibrate/SxR_Calibrate.lua b/radio/sdcard/horus/UTILITIES/SxR Calibrate/SxR_Calibrate.lua deleted file mode 100755 index a40a3978e..000000000 --- a/radio/sdcard/horus/UTILITIES/SxR Calibrate/SxR_Calibrate.lua +++ /dev/null @@ -1,357 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### -local VALUE = 0 -local COMBO = 1 - -local COLUMN_2 = 300 - -local edit = false -local page = 1 -local current = 1 -local refreshState = 0 -local refreshIndex = 0 -local calibrationState = 0 -local pageOffset = 0 -local calibrationStep = 0 -local pages = {} -local fields = {} -local modifications = {} -local wingBitmaps = {} -local mountBitmaps = {} -local calibBitmaps = {} - -local configFields = { - {"Wing type:", COMBO, 0x80, nil, { "Normal", "Delta", "VTail" } }, - {"Mounting type:", COMBO, 0x81, nil, { "Horz", "Horz rev.", "Vert", "Vert rev." } }, -} -local calibrationPositions = { "up", "down", "left", "right", "forward", "back" } -local wingBitmapsFile = {"img/plane_b.png", "img/delta_b.png", "img/planev_b.png"} -local mountBitmapsFile = {"img/up.png", "img/down.png", "img/vert.png", "img/vert-r.png"} -local calibBitmapsFile = {"img/up.png", "img/down.png", "img/left.png", "img/right.png", "img/forward.png", "img/back.png"} - -local settingsFields = { - {"SxR functions:", COMBO, 0x9C, nil, { "Disable", "Enable" } }, - {"CH5 mode:", COMBO, 0xA8, nil, { "AIL2", "AUX1" } }, - {"CH6 mode:", COMBO, 0xA9, nil, { "ELE2", "AUX2" } }, - {"AIL direction:", COMBO, 0x82, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"ELE direction:", COMBO, 0x83, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"RUD direction:", COMBO, 0x84, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"AIL2 direction:", COMBO, 0x9A, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"ELE2 direction:", COMBO, 0x9B, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"AIL stabilize gain:", VALUE, 0x85, nil, 0, 200, "%"}, - {"ELE stabilize gain:", VALUE, 0x86, nil, 0, 200, "%"}, - {"RUD stabilize gain:", VALUE, 0x87, nil, 0, 200, "%"}, - {"AIL auto level gain:", VALUE, 0x88, nil, 0, 200, "%"}, - {"ELE auto level gain:", VALUE, 0x89, nil, 0, 200, "%"}, - {"ELE upright gain:", VALUE, 0x8C, nil, 0, 200, "%"}, - {"RUD upright gain:", VALUE, 0x8D, nil, 0, 200, "%"}, - {"AIL crab gain:", VALUE, 0x8E, nil, 0, 200, "%"}, - {"RUD crab gain:", VALUE, 0x90, nil, 0, 200, "%"}, - {"AIL auto angle offset:", VALUE, 0x91, nil, -20, 20, "%", 0x6C}, - {"ELE auto angle offset:", VALUE, 0x92, nil, -20, 20, "%", 0x6C}, - {"ELE upright angle offset:", VALUE, 0x95, nil, -20, 20, "%", 0x6C}, - {"RUD upright angle offset:", VALUE, 0x96, nil, -20, 20, "%", 0x6C}, - {"AIL crab angle offset:", VALUE, 0x97, nil, -20, 20, "%", 0x6C}, - {"RUD crab angle offset:", VALUE, 0x99, nil, -20, 20, "%", 0x6C}, -} - -local calibrationFields = { - {"X:", VALUE, 0x9E, 0, -100, 100, "%"}, - {"Y:", VALUE, 0x9F, 0, -100, 100, "%"}, - {"Z:", VALUE, 0xA0, 0, -100, 100, "%"} -} - -local function drawScreenTitle(title,page, pages) - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, title, MENU_COLOR) - lcd.drawText(LCD_W-40, 5, page.."/"..pages, MENU_COLOR) -end - --- Change display attribute to current field -local function addField(step) - local field = fields[current] - local min, max - if field[2] == VALUE then - min = field[5] - max = field[6] - elseif field[2] == COMBO then - min = 0 - max = #(field[5]) - 1 - end - if (step < 0 and field[4] > min) or (step > 0 and field[4] < max) then - field[4] = field[4] + step - end -end - --- Select the next or previous page -local function selectPage(step) - page = 1 + ((page + step - 1 + #pages) % #pages) - refreshIndex = 0 - calibrationStep = 0 - pageOffset = 0 -end - --- Select the next or previous editable field -local function selectField(step) - current = 1 + ((current + step - 1 + #fields) % #fields) - if current > 7 + pageOffset then - pageOffset = current - 7 - elseif current <= pageOffset then - pageOffset = current - 1 - end -end - -local function drawProgressBar() - local width = (300 * refreshIndex) / #fields - lcd.drawRectangle(100, 10, 300, 6) - lcd.drawFilledRectangle(102, 13, width, 2); -end - --- Redraw the current page -local function redrawFieldsPage(event) - lcd.clear() - drawScreenTitle("SxR", page, #pages) - - if refreshIndex < #fields then - drawProgressBar() - end - - for index = 1, 10, 1 do - local field = fields[pageOffset+index] - if field == nil then - break - end - - local attr = current == (pageOffset+index) and ((edit == true and BLINK or 0) + INVERS) or 0 - attr = attr + DEFAULT_COLOR - - lcd.drawText(1, 30+20*index, field[1], DEFAULT_COLOR) - - if field[4] == nil then - lcd.drawText(COLUMN_2, 30+20*index, "---", attr) - else - if field[2] == VALUE then - lcd.drawNumber(COLUMN_2, 30+20*index, field[4], LEFT + attr) - elseif field[2] == COMBO then - if field[4] >= 0 and field[4] < #(field[5]) then - lcd.drawText(COLUMN_2, 30+20*index, field[5][1+field[4]], attr) - end - end - end - end -end - -local function telemetryRead(field) - return sportTelemetryPush(0x17, 0x30, 0x0C30, field) -end - -local function telemetryWrite(field, value) - return sportTelemetryPush(0x17, 0x31, 0x0C30, field + value*256) -end - -local telemetryPopTimeout = 0 -local function refreshNext() - if refreshState == 0 then - if calibrationState == 1 then - if telemetryWrite(0x9D, calibrationStep) == true then - refreshState = 1 - calibrationState = 2 - telemetryPopTimeout = getTime() + 80 -- normal delay is 500ms - end - elseif #modifications > 0 then - telemetryWrite(modifications[1][1], modifications[1][2]) - modifications[1] = nil - elseif refreshIndex < #fields then - local field = fields[refreshIndex + 1] - if telemetryRead(field[3]) == true then - refreshState = 1 - telemetryPopTimeout = getTime() + 80 -- normal delay is 500ms - end - end - elseif refreshState == 1 then - local physicalId, primId, dataId, value = sportTelemetryPop() - if physicalId == 0x1A and primId == 0x32 and dataId == 0x0C30 then - local fieldId = value % 256 - if calibrationState == 2 then - if fieldId == 0x9D then - refreshState = 0 - calibrationState = 0 - calibrationStep = (calibrationStep + 1) % 7 - end - else - local field = fields[refreshIndex + 1] - if fieldId == field[3] then - local value = math.floor(value / 256) - value = bit32.band(value, 0xffff) - if field[3] >= 0x9E and field[3] <= 0xA0 then - local b1 = value % 256 - local b2 = math.floor(value / 256) - value = b1*256 + b2 - value = value - bit32.band(value, 0x8000) * 2 - end - if field[2] == COMBO and #field == 6 then - for index = 1, #(field[6]), 1 do - if value == field[6][index] then - value = index - 1 - break - end - end - elseif field[2] == VALUE and #field == 8 then - value = value - field[8] + field[5] - end - fields[refreshIndex + 1][4] = value - refreshIndex = refreshIndex + 1 - refreshState = 0 - end - end - elseif getTime() > telemetryPopTimeout then - refreshState = 0 - calibrationState = 0 - end - end -end - -local function updateField(field) - local value = field[4] - if field[2] == COMBO and #field == 6 then - value = field[6][1+value] - elseif field[2] == VALUE and #field == 8 then - value = value + field[8] - field[5] - end - modifications[#modifications+1] = { field[3], value } -end - --- Main -local function runFieldsPage(event) - if event == EVT_VIRTUAL_EXIT then -- exit script - return 2 - elseif event == EVT_VIRTUAL_ENTER then -- toggle editing/selecting current field - if fields[current][4] ~= nil then - edit = not edit - if edit == false then - updateField(fields[current]) - end - end - elseif edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - addField(1) - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - addField(-1) - end - else - if event == EVT_VIRTUAL_NEXT then - selectField(1) - elseif event == EVT_VIRTUAL_PREV then - selectField(-1) - end - end - redrawFieldsPage(event) - return 0 -end - -local function runConfigPage(event) - fields = configFields - local result = runFieldsPage(event) - if fields[1][4] ~= nil then - if wingBitmaps[1 + fields[1][4]] == nil then - wingBitmaps[1 + fields[1][4]] = Bitmap.open(wingBitmapsFile[1 + fields[1][4]]) - end - lcd.drawBitmap(wingBitmaps[1 + fields[1][4]], 10, 90) - end - if fields[2][4] ~= nil then - if mountBitmaps[1 + fields[2][4]] == nil then - mountBitmaps[1 + fields[2][4]] = Bitmap.open(mountBitmapsFile[1 + fields[2][4]]) - end - lcd.drawBitmap(mountBitmaps[1 + fields[2][4]], 190, 110) - end - return result -end - -local function runSettingsPage(event) - fields = settingsFields - return runFieldsPage(event) -end - -local function runCalibrationPage(event) - fields = calibrationFields - if refreshIndex == #fields then - refreshIndex = 0 - end - lcd.clear() - drawScreenTitle("SxR", page, #pages) - if(calibrationStep < 6) then - local position = calibrationPositions[1 + calibrationStep] - lcd.drawText(100, 50, "Place the SxR in the following position", DEFAULT_COLOR) - if calibBitmaps[calibrationStep + 1] == nil then - calibBitmaps[calibrationStep + 1] = Bitmap.open(calibBitmapsFile[calibrationStep + 1]) - end - lcd.drawBitmap(calibBitmaps[calibrationStep + 1], 200, 70) - for index = 1, 3, 1 do - local field = fields[index] - lcd.drawText(70, 80+20*index, field[1]..":", DEFAULT_COLOR) - lcd.drawNumber(90, 80+20*index, field[4]/10, LEFT+PREC2) - end - - local attr = calibrationState == 0 and INVERS or 0 - lcd.drawText(160, 220, "Press [Enter] when ready", attr) - else - lcd.drawText(160, 50, "Calibration completed", 0) - lcd.drawBitmap(Bitmap.open("img/done.bmp"),200, 100) - lcd.drawText(160, 220, "Press [RTN] when ready", attr) - end - if calibrationStep > 6 and (event == EVT_VIRTUAL_ENTER or event == EVT_VIRTUAL_EXIT) then - return 2 - elseif event == EVT_VIRTUAL_ENTER then - calibrationState = 1 - elseif event == EVT_VIRTUAL_EXIT then - if calibrationStep > 0 then - calibrationStep = 0 - end - end - return 0 - -end - --- Init -local function init() - current, edit, refreshState, refreshIndex = 1, false, 0, 0 - pages = { - -- runConfigPage, - -- runSettingsPage, - runCalibrationPage - } -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_NEXT_PAGE then - selectPage(1) - elseif event == EVT_VIRTUAL_PREV_PAGE then - killEvents(event); - selectPage(-1) - end - - local result = pages[page](event) - refreshNext() - - return result -end - -return { init=init, run=run } diff --git a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/back.png b/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/back.png deleted file mode 100755 index 2cf3cd699..000000000 Binary files a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/back.png and /dev/null differ diff --git a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/delta_b.png b/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/delta_b.png deleted file mode 100755 index 80c0302f9..000000000 Binary files a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/delta_b.png and /dev/null differ diff --git a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/done.bmp b/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/done.bmp deleted file mode 100755 index 9ac501398..000000000 Binary files a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/done.bmp and /dev/null differ diff --git a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/down.png b/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/down.png deleted file mode 100755 index 8eac8039a..000000000 Binary files a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/down.png and /dev/null differ diff --git a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/forward.png b/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/forward.png deleted file mode 100755 index de09680b7..000000000 Binary files a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/forward.png and /dev/null differ diff --git a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/left.png b/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/left.png deleted file mode 100755 index 658c9916b..000000000 Binary files a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/left.png and /dev/null differ diff --git a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/plane_b.png b/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/plane_b.png deleted file mode 100755 index 37abedc3a..000000000 Binary files a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/plane_b.png and /dev/null differ diff --git a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/planev_b.png b/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/planev_b.png deleted file mode 100755 index 4e33f660b..000000000 Binary files a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/planev_b.png and /dev/null differ diff --git a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/planev_s.png b/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/planev_s.png deleted file mode 100755 index 48283a290..000000000 Binary files a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/planev_s.png and /dev/null differ diff --git a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/right.png b/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/right.png deleted file mode 100755 index 01d555394..000000000 Binary files a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/right.png and /dev/null differ diff --git a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/up.png b/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/up.png deleted file mode 100755 index f033aba55..000000000 Binary files a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/up.png and /dev/null differ diff --git a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/vert-r.png b/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/vert-r.png deleted file mode 100755 index 7bfc9450c..000000000 Binary files a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/vert-r.png and /dev/null differ diff --git a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/vert.png b/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/vert.png deleted file mode 100755 index de09680b7..000000000 Binary files a/radio/sdcard/horus/UTILITIES/SxR Calibrate/img/vert.png and /dev/null differ diff --git a/radio/sdcard/horus/WIDGETS/BattCheck/main.lua b/radio/sdcard/horus/WIDGETS/BattCheck/main.lua deleted file mode 100755 index 58790445a..000000000 --- a/radio/sdcard/horus/WIDGETS/BattCheck/main.lua +++ /dev/null @@ -1,553 +0,0 @@ ----- ######################################################################### ----- # # ----- # Telemetry Widget script for FrSky Horus # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - --- Horus Widget to display the levels of lipo battery with per cell indication --- 3djc & Offer Shmuely --- Date: 2020 --- ver: 0.5 -local version = "v0.5" - -local _options = { - { "Sensor", SOURCE, 0 }, -- default to 'Cels' - { "Color", COLOR, WHITE }, - { "Shadow", BOOL, 0 }, - { "LowestCell", BOOL, 1 } -- 0=main voltage display shows all-cell-voltage, 1=main voltage display shows lowest-cell -} - --- Data gathered from commercial lipo sensors - -local _lipoPercentListSplit = { - { { 3, 0 }, { 3.093, 1 }, { 3.196, 2 }, { 3.301, 3 }, { 3.401, 4 }, { 3.477, 5 }, { 3.544, 6 }, { 3.601, 7 }, { 3.637, 8 }, { 3.664, 9 }, { 3.679, 10 }, { 3.683, 11 }, { 3.689, 12 }, { 3.692, 13 } }, - { { 3.705, 14 }, { 3.71, 15 }, { 3.713, 16 }, { 3.715, 17 }, { 3.72, 18 }, { 3.731, 19 }, { 3.735, 20 }, { 3.744, 21 }, { 3.753, 22 }, { 3.756, 23 }, { 3.758, 24 }, { 3.762, 25 }, { 3.767, 26 } }, - { { 3.774, 27 }, { 3.78, 28 }, { 3.783, 29 }, { 3.786, 30 }, { 3.789, 31 }, { 3.794, 32 }, { 3.797, 33 }, { 3.8, 34 }, { 3.802, 35 }, { 3.805, 36 }, { 3.808, 37 }, { 3.811, 38 }, { 3.815, 39 } }, - { { 3.818, 40 }, { 3.822, 41 }, { 3.825, 42 }, { 3.829, 43 }, { 3.833, 44 }, { 3.836, 45 }, { 3.84, 46 }, { 3.843, 47 }, { 3.847, 48 }, { 3.85, 49 }, { 3.854, 50 }, { 3.857, 51 }, { 3.86, 52 } }, - { { 3.863, 53 }, { 3.866, 54 }, { 3.87, 55 }, { 3.874, 56 }, { 3.879, 57 }, { 3.888, 58 }, { 3.893, 59 }, { 3.897, 60 }, { 3.902, 61 }, { 3.906, 62 }, { 3.911, 63 }, { 3.918, 64 } }, - { { 3.923, 65 }, { 3.928, 66 }, { 3.939, 67 }, { 3.943, 68 }, { 3.949, 69 }, { 3.955, 70 }, { 3.961, 71 }, { 3.968, 72 }, { 3.974, 73 }, { 3.981, 74 }, { 3.987, 75 }, { 3.994, 76 } }, - { { 4.001, 77 }, { 4.007, 78 }, { 4.014, 79 }, { 4.021, 80 }, { 4.029, 81 }, { 4.036, 82 }, { 4.044, 83 }, { 4.052, 84 }, { 4.062, 85 }, { 4.074, 86 }, { 4.085, 87 }, { 4.095, 88 } }, - { { 4.105, 89 }, { 4.111, 90 }, { 4.116, 91 }, { 4.12, 92 }, { 4.125, 93 }, { 4.129, 94 }, { 4.135, 95 }, { 4.145, 96 }, { 4.176, 97 }, { 4.179, 98 }, { 4.193, 99 }, { 4.2, 100 } }, -} - -local function periodicInit(t, durationMili) - t.startTime = getTime(); - t.durationMili = durationMili; -end -local function periodicReset(t) - t.startTime = getTime(); -end -local function periodicHasPassed(t) - local elapsed = getTime() - t.startTime; - local elapsedMili = elapsed * 10; - if (elapsedMili < t.durationMili) then - return false; - end - return true; -end -local function periodicGetElapsedTime(t) - local elapsed = getTime() - t.startTime; - local elapsedMili = elapsed * 10; - return elapsedMili; -end - --- This function is run once at the creation of the widget -local function create(zone, options) - local wgt = { - zone = zone, - options = options, - counter = 0, - shadowed = 0, - - telemResetCount = 0, - telemResetLowestMinRSSI = 101, - no_telem_blink = 0, - isDataAvailable = 0, - cellDataLive = { 0, 0, 0, 0, 0, 0 }, - cellDataHistoryLowest = { 5, 5, 5, 5, 5, 5 }, - cellDataHistoryCellLowest = 5, - cellMax = 0, - cellMin = 0, - cellAvg = 0, - cellPercent = 0, - cellCount = 0, - cellSum = 0, - mainValue = 0, - secondaryValue = 0, - periodic1 = { startTime = getTime(), durationMili = 1000 }, - periodicProfiler = { startTime = getTime(), durationMili = 5000 }, - profTimes = {}, - } - - -- use default if user did not set, So widget is operational on "select widget" - if wgt.options.Sensor == 0 then - wgt.options.Sensor = "Cels" - end - - wgt.options.LowestCell = wgt.options.LowestCell % 2 -- modulo due to bug that cause the value to be other than 0|1 - - return wgt -end - --- This function allow updates when you change widgets settings -local function update(wgt, options) - if (wgt == nil) then - return - end - - wgt.options = options - - -- use default if user did not set, So widget is operational on "select widget" - if wgt.options.Sensor == 0 then - wgt.options.Sensor = "Cels" - end - - wgt.options.LowestCell = wgt.options.LowestCell % 2 -- modulo due to bug that cause the value to be other than 0|1 - -end - - --- clear old telemetry data upon reset event -local function onTelemetryResetEvent(wgt) - wgt.telemResetCount = wgt.telemResetCount + 1 - - wgt.cellDataLive = { 0, 0, 0, 0, 0, 0 } - wgt.cellDataHistoryLowest = { 5, 5, 5, 5, 5, 5 } - wgt.cellDataHistoryCellLowest = 5 -end - - --- workaround to detect telemetry-reset event, until a proper implementation on the lua interface will be created --- this workaround assume that: --- RSSI- is always going down --- RSSI- is reset on the C++ side when a telemetry-reset is pressed by user --- widget is calling this func on each refresh/background --- on event detection, the function onTelemetryResetEvent() will be trigger --- -local function detectResetEvent(wgt) - - local currMinRSSI = getValue('RSSI-') - if (currMinRSSI == nil) then - return - end - if (currMinRSSI == wgt.telemResetLowestMinRSSI) then - return - end - - if (currMinRSSI < wgt.telemResetLowestMinRSSI) then - -- rssi just got lower, record it - wgt.telemResetLowestMinRSSI = currMinRSSI - return - end - - - -- reset telemetry detected - wgt.telemResetLowestMinRSSI = 101 - - -- notify event - onTelemetryResetEvent(wgt) - -end - ---- This function return the percentage remaining in a single Lipo cel ---- since running on long array found to be very intensive to hrous cpu, we are splitting the list to small lists -local function getCellPercent(wgt, cellValue) - if cellValue == nil then - return 0 - end - local result = 0; - - for i1, v1 in ipairs(_lipoPercentListSplit) do - --is the cellVal < last-value-on-sub-list? (first-val:v1[1], last-val:v1[#v1]) - if (cellValue <= v1[#v1][1]) then - -- cellVal is in this sub-list, find the exact value - for i2, v2 in ipairs(v1) do - if v2[1] >= cellValue then - result = v2[2] - return result - end - end - end - end - -- in case somehow voltage is too high (>4.2), don't return nil - return 100 -end - ---- This function returns a table with cels values -local function calculateBatteryData(wgt) - - local newCellData = getValue(wgt.options.Sensor) - - if type(newCellData) ~= "table" then - wgt.isDataAvailable = false - return - end - - local cellMax = 0 - local cellMin = 5 - local cellSum = 0 - for k, v in pairs(newCellData) do - -- stores the lowest cell values in historical table - if v > 1 and v < wgt.cellDataHistoryLowest[k] then - -- min 1v to consider a valid reading - wgt.cellDataHistoryLowest[k] = v - - --- calc history lowest of all cells - if v < wgt.cellDataHistoryCellLowest then - wgt.cellDataHistoryCellLowest = v - end - - end - - -- calc highest of all cells - if v > cellMax then - cellMax = v - end - - --- calc lowest of all cells - if v < cellMin and v > 1 then - -- min 1v to consider a valid reading - cellMin = v - end - --- sum of all cells - cellSum = cellSum + v - - - end - - wgt.cellMin = cellMin - wgt.cellMax = cellMax - wgt.cellCount = #newCellData - wgt.cellSum = cellSum - - --- average of all cells - wgt.cellAvg = wgt.cellSum / wgt.cellCount - - wgt.cellDataLive = newCellData - - -- mainValue - if wgt.options.LowestCell == 1 then - wgt.mainValue = wgt.cellMin - elseif wgt.options.LowestCell == 0 then - wgt.mainValue = wgt.cellSum - else - wgt.mainValue = "-1" - end - - -- secondaryValue - if wgt.options.LowestCell == 1 then - wgt.secondaryValue = wgt.cellSum - elseif wgt.options.LowestCell == 0 then - wgt.secondaryValue = wgt.cellMin - else - wgt.secondaryValue = "-2" - end - - wgt.isDataAvailable = true - - -- calculate intensive CPU data - if (periodicHasPassed(wgt.periodic1) or wgt.cellPercent == 0) then - - --wgt.cellPercent = getCellPercent(wgt, wgt.cellMin) -- use batt percentage by lowest cell voltage - wgt.cellPercent = getCellPercent(wgt, wgt.cellAvg) -- use batt percentage by average cell voltage - - periodicReset(wgt.periodic1) - end - -end - --- color for battery --- This function returns green at 100%, red bellow 30% and graduate in between -local function getPercentColor(percent) - if percent < 30 then - return lcd.RGB(0xff, 0, 0) - else - g = math.floor(0xdf * percent / 100) - r = 0xdf - g - return lcd.RGB(r, g, 0) - end -end - --- color for cell --- This function returns green at gvalue, red at rvalue and graduate in between -local function getRangeColor(value, green_value, red_value) - local range = math.abs(green_value - red_value) - if range == 0 then - return lcd.RGB(0, 0xdf, 0) - end - if value == nil then - return lcd.RGB(0, 0xdf, 0) - end - - if green_value > red_value then - if value > green_value then - return lcd.RGB(0, 0xdf, 0) - end - if value < red_value then - return lcd.RGB(0xdf, 0, 0) - end - g = math.floor(0xdf * (value - red_value) / range) - r = 0xdf - g - return lcd.RGB(r, g, 0) - else - if value > green_value then - return lcd.RGB(0, 0xdf, 0) - end - if value < red_value then - return lcd.RGB(0xdf, 0, 0) - end - r = math.floor(0xdf * (value - green_value) / range) - g = 0xdf - r - return lcd.RGB(r, g, 0) - end -end - ---- Zone size: 70x39 1/8th top bar -local function refreshZoneTiny(wgt) - local myString = string.format("%2.1fV", wgt.mainValue) - lcd.drawText(wgt.zone.x + wgt.zone.w - 25, wgt.zone.y + 5, wgt.cellPercent .. "%", RIGHT + SMLSIZE + CUSTOM_COLOR + wgt.no_telem_blink) - lcd.drawText(wgt.zone.x + wgt.zone.w - 25, wgt.zone.y + 20, myString, RIGHT + SMLSIZE + CUSTOM_COLOR + wgt.no_telem_blink) - -- draw batt - lcd.drawRectangle(wgt.zone.x + 50, wgt.zone.y + 9, 16, 25, CUSTOM_COLOR, 2) - lcd.drawFilledRectangle(wgt.zone.x + 50 + 4, wgt.zone.y + 7, 6, 3, CUSTOM_COLOR) - local rect_h = math.floor(25 * wgt.cellPercent / 100) - lcd.drawFilledRectangle(wgt.zone.x + 50, wgt.zone.y + 9 + 25 - rect_h, 16, rect_h, CUSTOM_COLOR + wgt.no_telem_blink) -end - ---- Zone size: 160x32 1/8th -local function refreshZoneSmall(wgt) - local myBatt = { ["x"] = 0, ["y"] = 0, ["w"] = 155, ["h"] = 35, ["segments_w"] = 25, ["color"] = WHITE, ["cath_w"] = 6, ["cath_h"] = 20 } - - -- draws bat - lcd.setColor(CUSTOM_COLOR, WHITE) - lcd.drawRectangle(wgt.zone.x + myBatt.x, wgt.zone.y + myBatt.y, myBatt.w, myBatt.h, CUSTOM_COLOR, 2) - - -- fill batt - lcd.setColor(CUSTOM_COLOR, getPercentColor(wgt.cellPercent)) - lcd.drawGauge(wgt.zone.x + 2, wgt.zone.y + 2, myBatt.w - 4, wgt.zone.h, wgt.cellPercent, 100, CUSTOM_COLOR) - - -- write text - if wgt.isDataAvailable then - lcd.setColor(CUSTOM_COLOR, wgt.options.Color) - else - lcd.setColor(CUSTOM_COLOR, GREY) - end - local topLine = string.format("%2.1fV %2.0f%%", wgt.mainValue, wgt.cellPercent) - lcd.drawText(wgt.zone.x + 20, wgt.zone.y + 2, topLine, MIDSIZE + CUSTOM_COLOR + wgt.shadowed + wgt.no_telem_blink) - -end - ---- Zone size: 180x70 1/4th (with sliders/trim) ---- Zone size: 225x98 1/4th (no sliders/trim) -local function refreshZoneMedium(wgt) - local myBatt = { ["x"] = 0, ["y"] = 0, ["w"] = 85, ["h"] = 35, ["segments_w"] = 15, ["color"] = WHITE, ["cath_w"] = 6, ["cath_h"] = 20 } - - if wgt.isDataAvailable then - lcd.setColor(CUSTOM_COLOR, wgt.options.Color) - else - lcd.setColor(CUSTOM_COLOR, GREY) - end - - -- draw values - lcd.drawText(wgt.zone.x + wgt.zone.w, wgt.zone.y, string.format("%2.1fV", wgt.mainValue), DBLSIZE + CUSTOM_COLOR + RIGHT + wgt.shadowed + wgt.no_telem_blink) - - -- more info if 1/4 is high enough (without trim & slider) - if wgt.zone.h > 80 then - --lcd.drawText(wgt.zone.x + 50 , wgt.zone.y + 70, string.format("%2.2fV" , wgt.secondaryValue), SMLSIZE + CUSTOM_COLOR + wgt.no_telem_blink) - lcd.drawText(wgt.zone.x, wgt.zone.y + 70, string.format("dV %2.2fV", wgt.cellMax - wgt.cellMin), SMLSIZE + CUSTOM_COLOR + wgt.no_telem_blink) - lcd.drawText(wgt.zone.x, wgt.zone.y + 84, string.format("Min %2.2fV", wgt.cellDataHistoryCellLowest), SMLSIZE + CUSTOM_COLOR + wgt.no_telem_blink) - end - - -- fill batt - lcd.setColor(CUSTOM_COLOR, getPercentColor(wgt.cellPercent)) - lcd.drawGauge(wgt.zone.x + myBatt.x, wgt.zone.y + myBatt.y, myBatt.w, myBatt.h, wgt.cellPercent, 100, CUSTOM_COLOR) - - -- draw cells - local cellH = 19 - local cellX = 118 - local cellW = wgt.zone.w / 3 - - local pos = { { x = 0, y = 38 }, { x = cellW, y = 38 }, { x = 2 * cellW, y = 38 }, { x = 0, y = 57 }, { x = cellW, y = 57 }, { x = 2 * cellW, y = 57 } } - for i = 1, wgt.cellCount, 1 do - local cellY = wgt.zone.y + (i - 1) * (cellH - 1) - - -- fill current cell - --lcd.drawFilledRectangle(wgt.zone.x + cellX , cellY, 58, cellH, CUSTOM_COLOR) - lcd.setColor(CUSTOM_COLOR, getRangeColor(wgt.cellDataLive[i], wgt.cellMax, wgt.cellMax - 0.2)) - lcd.drawFilledRectangle(wgt.zone.x + pos[i].x, wgt.zone.y + pos[i].y, cellW - 1, 20, CUSTOM_COLOR) - lcd.setColor(CUSTOM_COLOR, WHITE) - lcd.drawText(wgt.zone.x + pos[i].x + 10, wgt.zone.y + pos[i].y, string.format("%.2f", wgt.cellDataLive[i]), CUSTOM_COLOR + wgt.shadowed) - lcd.drawRectangle(wgt.zone.x + pos[i].x, wgt.zone.y + pos[i].y, cellW, 20, CUSTOM_COLOR, 1) - end - - -- draws bat - lcd.setColor(CUSTOM_COLOR, WHITE) - lcd.drawRectangle(wgt.zone.x + myBatt.x, wgt.zone.y + myBatt.y, myBatt.w, myBatt.h, CUSTOM_COLOR, 2) - lcd.drawFilledRectangle(wgt.zone.x + myBatt.x + myBatt.w, wgt.zone.y + myBatt.h / 2 - myBatt.cath_h / 2, myBatt.cath_w, myBatt.cath_h, CUSTOM_COLOR) - lcd.drawText(wgt.zone.x + myBatt.x + 20, wgt.zone.y + myBatt.y + 5, string.format("%2.0f%%", wgt.cellPercent), LEFT + MIDSIZE + CUSTOM_COLOR + wgt.shadowed) - -end - ---- Zone size: 192x152 1/2 -local function refreshZoneLarge(wgt) - local myBatt = { ["x"] = 0, ["y"] = 18, ["w"] = 76, ["h"] = 121, ["segments_h"] = 30, ["color"] = WHITE, ["cath_w"] = 30, ["cath_h"] = 10 } - - if wgt.isDataAvailable then - lcd.setColor(CUSTOM_COLOR, wgt.options.Color) - else - lcd.setColor(CUSTOM_COLOR, GREY) - end - - lcd.drawText(wgt.zone.x + wgt.zone.w, wgt.zone.y, wgt.cellPercent .. "%", RIGHT + DBLSIZE + CUSTOM_COLOR + wgt.shadowed) - lcd.drawText(wgt.zone.x + wgt.zone.w, wgt.zone.y + 30, string.format("%2.1fV", wgt.mainValue), RIGHT + DBLSIZE + CUSTOM_COLOR + wgt.shadowed) - lcd.drawText(wgt.zone.x + wgt.zone.w, wgt.zone.y + 70, string.format("%2.1fV %dS", wgt.secondaryValue, wgt.cellCount), RIGHT + SMLSIZE + CUSTOM_COLOR + wgt.shadowed) - -- fill batt - lcd.setColor(CUSTOM_COLOR, getPercentColor(wgt.cellPercent)) - lcd.drawFilledRectangle(wgt.zone.x + myBatt.x, wgt.zone.y + myBatt.y + myBatt.h + myBatt.cath_h - math.floor(wgt.cellPercent / 100 * myBatt.h), myBatt.w, math.floor(wgt.cellPercent / 100 * myBatt.h), CUSTOM_COLOR) - -- draw cells - local pos = { { x = 80, y = 90 }, { x = 138, y = 90 }, { x = 80, y = 109 }, { x = 138, y = 109 }, { x = 80, y = 128 }, { x = 138, y = 128 } } - for i = 1, wgt.cellCount, 1 do - lcd.setColor(CUSTOM_COLOR, getRangeColor(wgt.cellDataLive[i], wgt.cellMax, wgt.cellMax - 0.2)) - lcd.drawFilledRectangle(wgt.zone.x + pos[i].x, wgt.zone.y + pos[i].y, 58, 20, CUSTOM_COLOR) - lcd.setColor(CUSTOM_COLOR, WHITE) - lcd.drawText(wgt.zone.x + pos[i].x + 10, wgt.zone.y + pos[i].y, string.format("%.2f", wgt.cellDataLive[i]), CUSTOM_COLOR + wgt.shadowed) - lcd.drawRectangle(wgt.zone.x + pos[i].x, wgt.zone.y + pos[i].y, 59, 20, CUSTOM_COLOR, 1) - end - - -- draw bat - lcd.setColor(CUSTOM_COLOR, WHITE) - lcd.drawRectangle(wgt.zone.x + myBatt.x, wgt.zone.y + myBatt.y + myBatt.cath_h, myBatt.w, myBatt.h, CUSTOM_COLOR, 2) - lcd.drawFilledRectangle(wgt.zone.x + myBatt.x + myBatt.w / 2 - myBatt.cath_w / 2, wgt.zone.y + myBatt.y, myBatt.cath_w, myBatt.cath_h, CUSTOM_COLOR) - for i = 1, myBatt.h - myBatt.segments_h, myBatt.segments_h do - lcd.drawRectangle(wgt.zone.x + myBatt.x, wgt.zone.y + myBatt.y + myBatt.cath_h + i, myBatt.w, myBatt.segments_h, CUSTOM_COLOR, 1) - end - -end - ---- Zone size: 390x172 1/1 ---- Zone size: 460x252 1/1 (no sliders/trim/topbar) -local function refreshZoneXLarge(wgt) - local myBatt = { ["x"] = 10, ["y"] = 20, ["w"] = 80, ["h"] = 121, ["segments_h"] = 30, ["color"] = WHITE, ["cath_w"] = 30, ["cath_h"] = 10 } - - lcd.setColor(CUSTOM_COLOR, wgt.options.Color) - - -- fill batt - lcd.setColor(CUSTOM_COLOR, getPercentColor(wgt.cellPercent)) - lcd.drawFilledRectangle(wgt.zone.x + myBatt.x, wgt.zone.y + myBatt.y + myBatt.h + myBatt.cath_h - math.floor(wgt.cellPercent / 100 * myBatt.h), myBatt.w, math.floor(wgt.cellPercent / 100 * myBatt.h), CUSTOM_COLOR) - - -- draw right text section - if wgt.isDataAvailable then - lcd.setColor(CUSTOM_COLOR, wgt.options.Color) - else - lcd.setColor(CUSTOM_COLOR, GREY) - end - lcd.drawText(wgt.zone.x + wgt.zone.w, wgt.zone.y + myBatt.y, wgt.cellPercent .. "%", RIGHT + DBLSIZE + CUSTOM_COLOR + wgt.shadowed + wgt.no_telem_blink) - - lcd.drawText(wgt.zone.x + wgt.zone.w, wgt.zone.y + myBatt.y + 30, string.format("%2.1fV", wgt.mainValue), RIGHT + DBLSIZE + CUSTOM_COLOR + wgt.shadowed + wgt.no_telem_blink) - lcd.drawText(wgt.zone.x + wgt.zone.w, wgt.zone.y + myBatt.y + 105, string.format("%2.1fV %dS", wgt.secondaryValue, wgt.cellCount), RIGHT + SMLSIZE + CUSTOM_COLOR + wgt.shadowed + wgt.no_telem_blink) - - -- draw cells - local pos = { { x = 111, y = 38 }, { x = 164, y = 38 }, { x = 217, y = 38 }, { x = 111, y = 57 }, { x = 164, y = 57 }, { x = 217, y = 57 } } - for i = 1, wgt.cellCount, 1 do - lcd.setColor(CUSTOM_COLOR, getRangeColor(wgt.cellDataLive[i], wgt.cellMax, wgt.cellMax - 0.2)) - lcd.drawFilledRectangle(wgt.zone.x + pos[i].x, wgt.zone.y + pos[i].y, 53, 20, CUSTOM_COLOR) - lcd.setColor(CUSTOM_COLOR, WHITE) - lcd.drawText(wgt.zone.x + pos[i].x + 10, wgt.zone.y + pos[i].y, string.format("%.2f", wgt.cellDataLive[i]), CUSTOM_COLOR + wgt.shadowed + wgt.no_telem_blink) - lcd.drawRectangle(wgt.zone.x + pos[i].x, wgt.zone.y + pos[i].y, 54, 20, CUSTOM_COLOR, 1) - end - -- draw cells for lowest cells - local pos = { { x = 111, y = 110 }, { x = 164, y = 110 }, { x = 217, y = 110 }, { x = 111, y = 129 }, { x = 164, y = 129 }, { x = 217, y = 129 } } - for i = 1, wgt.cellCount, 1 do - lcd.setColor(CUSTOM_COLOR, getRangeColor(wgt.cellDataHistoryLowest[i], wgt.cellDataLive[i], wgt.cellDataLive[i] - 0.3)) - lcd.drawFilledRectangle(wgt.zone.x + pos[i].x, wgt.zone.y + pos[i].y, 53, 20, CUSTOM_COLOR) - lcd.setColor(CUSTOM_COLOR, WHITE) - lcd.drawRectangle(wgt.zone.x + pos[i].x, wgt.zone.y + pos[i].y, 54, 20, CUSTOM_COLOR, 1) - lcd.drawText(wgt.zone.x + pos[i].x + 10, wgt.zone.y + pos[i].y, string.format("%.2f", wgt.cellDataHistoryLowest[i]), CUSTOM_COLOR + wgt.shadowed + wgt.no_telem_blink) - end - - -- draws bat - lcd.setColor(CUSTOM_COLOR, WHITE) - lcd.drawRectangle(wgt.zone.x + myBatt.x, wgt.zone.y + myBatt.y + myBatt.cath_h, myBatt.w, myBatt.h, CUSTOM_COLOR, 2) - lcd.drawFilledRectangle(wgt.zone.x + myBatt.x + myBatt.w / 2 - myBatt.cath_w / 2, wgt.zone.y + myBatt.y, myBatt.cath_w, myBatt.cath_h, CUSTOM_COLOR) - for i = 1, myBatt.h - myBatt.segments_h, myBatt.segments_h do - lcd.drawRectangle(wgt.zone.x + myBatt.x, wgt.zone.y + myBatt.y + myBatt.cath_h + i, myBatt.w, myBatt.segments_h, CUSTOM_COLOR, 1) - end - -- draw middle rectangles - lcd.drawRectangle(wgt.zone.x + 110, wgt.zone.y + 38, 161, 40, CUSTOM_COLOR, 1) - lcd.drawText(wgt.zone.x + 220, wgt.zone.y + 21, "Live data", RIGHT + SMLSIZE + INVERS + CUSTOM_COLOR + wgt.shadowed) - lcd.drawRectangle(wgt.zone.x + 110, wgt.zone.y + 110, 161, 40, CUSTOM_COLOR, 1) - lcd.drawText(wgt.zone.x + 230, wgt.zone.y + 93, "Lowest data", RIGHT + SMLSIZE + INVERS + CUSTOM_COLOR + wgt.shadowed) - return -end - --- This function allow recording of lowest cells when widget is in background -local function background(wgt) - if (wgt == nil) then - return - end - - detectResetEvent(wgt) - - calculateBatteryData(wgt) - -end - -local function refresh(wgt) - if (wgt == nil) then - return - end - if type(wgt) ~= "table" then - return - end - if (wgt.options == nil) then - return - end - if (wgt.zone == nil) then - return - end - if (wgt.options.LowestCell == nil) then - return - end - - if wgt.options.Shadow == 1 then - wgt.shadowed = SHADOWED - else - wgt.shadowed = 0 - end - - detectResetEvent(wgt) - - calculateBatteryData(wgt) - - if wgt.isDataAvailable then - wgt.no_telem_blink = 0 - else - wgt.no_telem_blink = INVERS + BLINK - end - - if wgt.zone.w > 380 and wgt.zone.h > 165 then - refreshZoneXLarge(wgt) - elseif wgt.zone.w > 180 and wgt.zone.h > 145 then - refreshZoneLarge(wgt) - elseif wgt.zone.w > 170 and wgt.zone.h > 65 then - refreshZoneMedium(wgt) - elseif wgt.zone.w > 150 and wgt.zone.h > 28 then - refreshZoneSmall(wgt) - elseif wgt.zone.w > 65 and wgt.zone.h > 35 then - refreshZoneTiny(wgt) - end -end - -return { name = "BattCheck", options = _options, create = create, update = update, background = background, refresh = refresh } \ No newline at end of file diff --git a/radio/sdcard/horus/WIDGETS/Counter/main.lua b/radio/sdcard/horus/WIDGETS/Counter/main.lua deleted file mode 100644 index 4b6122b56..000000000 --- a/radio/sdcard/horus/WIDGETS/Counter/main.lua +++ /dev/null @@ -1,47 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### -local options = { - { "Option1", SOURCE, 1 }, - { "Option2", VALUE, 1000 }, - { "Option3", COLOR, RED }, - { "Shadow", BOOL, 0 } -} - -local function create(zone, options) - local pie = { zone=zone, options=options, counter=0 } - print(options.Option2) - return pie -end - -local function update(pie, options) - pie.options = options -end - -local function background(pie) - pie.counter = pie.counter + 1 -end - -function refresh(pie) - pie.counter = pie.counter + 1 - if pie.options.Shadow == 1 then - lcd.drawNumber(pie.zone.x, pie.zone.y, pie.counter, LEFT + DBLSIZE + DEFAULT_COLOR); - else - lcd.drawNumber(pie.zone.x, pie.zone.y, pie.counter, LEFT + DBLSIZE + DEFAULT_COLOR + SHADOWED); - end -end - -return { name="Counter", options=options, create=create, update=update, refresh=refresh, background=background } diff --git a/radio/sdcard/horus/WIDGETS/Ghost/img/background.png b/radio/sdcard/horus/WIDGETS/Ghost/img/background.png deleted file mode 100644 index 887c022fa..000000000 Binary files a/radio/sdcard/horus/WIDGETS/Ghost/img/background.png and /dev/null differ diff --git a/radio/sdcard/horus/WIDGETS/Ghost/img/green.png b/radio/sdcard/horus/WIDGETS/Ghost/img/green.png deleted file mode 100644 index 27c3a85cc..000000000 Binary files a/radio/sdcard/horus/WIDGETS/Ghost/img/green.png and /dev/null differ diff --git a/radio/sdcard/horus/WIDGETS/Ghost/img/orange.png b/radio/sdcard/horus/WIDGETS/Ghost/img/orange.png deleted file mode 100644 index 6f926c44b..000000000 Binary files a/radio/sdcard/horus/WIDGETS/Ghost/img/orange.png and /dev/null differ diff --git a/radio/sdcard/horus/WIDGETS/Ghost/img/red.png b/radio/sdcard/horus/WIDGETS/Ghost/img/red.png deleted file mode 100644 index 86b8da84f..000000000 Binary files a/radio/sdcard/horus/WIDGETS/Ghost/img/red.png and /dev/null differ diff --git a/radio/sdcard/horus/WIDGETS/Ghost/main.lua b/radio/sdcard/horus/WIDGETS/Ghost/main.lua deleted file mode 100644 index 1e1c5c06d..000000000 --- a/radio/sdcard/horus/WIDGETS/Ghost/main.lua +++ /dev/null @@ -1,100 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - -local backgroundBitmap -local orangeLed -local greenLed -local offsetX -local offsetY -local sensors = {} - -local options = { - { "VTX", BOOL, 0 }, -} - -local function getValues(wgt) - if wgt.options.VTX == 0 then - sensors[1] = string.format("%s", getValue("RFMD")) - sensors[2] = string.format("%d Hz", getValue("FRat")) - sensors[3] = string.format("%d %%", getValue("RQly")) - if (getValue("TPWR") == 0) then - sensors[4] = "Range" - else - sensors[4] = string.format("%d mW", getValue("TPWR")) - end - else - sensors[1] = string.format("%s", getValue("VBan")) - sensors[2] = string.format("%dMHz", getValue("VFrq")) - sensors[3] = string.format("CH: %d", getValue("VChn")) - sensors[4] = string.format("%d mW", getValue("VPwr")) - end -end - -local function create(zone, options) - local wgt = { zone=zone, options=options} - backgroundBitmap = Bitmap.open("/WIDGETS/Ghost/img/background.png") - orangeLed = Bitmap.open("/WIDGETS/Ghost/img/orange.png") - greenLed = Bitmap.open("/WIDGETS/Ghost/img/green.png") - offsetX = (wgt.zone.w - 178) / 2 - offsetY = (wgt.zone.h - 148) / 2 - return wgt -end - -local function update(wgt, options) - wgt.options = options -end - -local function background(wgt) -end - -function refresh(wgt) - -- runs onty on large enough zone - if wgt.zone.w < 180 or wgt.zone.h < 145 then - return - end - - if backgroundBitmap ~= nil then - lcd.drawBitmap(backgroundBitmap, wgt.zone.x + offsetX, wgt.zone.y + offsetY) - end - - if getRSSI() ~= 0 then - if getValue("RFMD") == "Pure" then - if orangeLed ~= nil then - lcd.drawBitmap(orangeLed, wgt.zone.x + offsetX + 143, wgt.zone.y + offsetY) - end - elseif greenLed ~= nil then - lcd.drawBitmap(greenLed, wgt.zone.x + offsetX + 143, wgt.zone.y + offsetY) - end - - getValues(wgt) - - -- RF Mode/Band - lcd.drawText(wgt.zone.x + offsetX + 75, wgt.zone.y + offsetY + 2, sensors[1], CENTER + DBLSIZE) - - -- Frame rate / Frequency - lcd.drawText(wgt.zone.x + offsetX + 85, wgt.zone.y + offsetY + 35, sensors[2], CENTER + DBLSIZE) - - -- RSSI / Channel - lcd.drawText(wgt.zone.x + offsetX + 85, wgt.zone.y + offsetY + 70, sensors[3], CENTER + DBLSIZE) - - -- Transmit power - lcd.drawText(wgt.zone.x + offsetX + 85, wgt.zone.y + offsetY + 105, sensors[4], CENTER + DBLSIZE) - end - -end - -return { name="Ghost", options=options, create=create, update=update, refresh=refresh, background=background } \ No newline at end of file diff --git a/radio/sdcard/horus/WIDGETS/Timer2/main.lua b/radio/sdcard/horus/WIDGETS/Timer2/main.lua deleted file mode 100644 index ee4661f2d..000000000 --- a/radio/sdcard/horus/WIDGETS/Timer2/main.lua +++ /dev/null @@ -1,98 +0,0 @@ --- A Timer version that fill better the widget area --- Offer Shmuely --- Date: 2018 --- ver: 0.2 - -local options = { - { "TextColor", COLOR, YELLOW }, - { "Timer", VALUE, 1, 1, 3} -} - -local function create(zone, options) - local wgt = { zone=zone, options=options} - return wgt -end - -local function update(wgt, options) - if (wgt == nil) then return end - wgt.options = options - --print("TimerNumB:" .. options.Timer) -end - -local function background(wgt) - return -end - ------------------------------------------------------------- - --- Zone size: top bar widgets -local function refreshZoneTiny(wgt) -end - ---- Zone size: 160x32 1/8th -local function refreshZoneSmall(wgt) - local t1 = model.getTimer(wgt.options.Timer-1) - local timerInfo = string.format("T%s: ", wgt.options.Timer) - lcd.drawText(wgt.zone.x, wgt.zone.y, timerInfo, SMLSIZE + CUSTOM_COLOR) - lcd.drawTimer(wgt.zone.x+35, wgt.zone.y, t1.value, DBLSIZE + CUSTOM_COLOR) - return -end - ---- Zone size: 180x70 1/4th (with sliders/trim) ---- Zone size: 225x98 1/4th (no sliders/trim) -local function refreshZoneMedium(wgt) - local t1 = model.getTimer(wgt.options.Timer-1) - --print(t1.value) - local timerInfo = string.format("Timer:%s", wgt.options.Timer) - lcd.drawText (wgt.zone.x, wgt.zone.y, timerInfo, SMLSIZE + CUSTOM_COLOR) - lcd.drawTimer(wgt.zone.x, wgt.zone.y+3, t1.value, XXLSIZE + CUSTOM_COLOR) -end - ---- Zone size: 192x152 1/2 -local function refreshZoneLarge(wgt) - local t1 = model.getTimer(wgt.options.Timer-1) - --print(t1.value) - local timerInfo = string.format("Timer:%s", wgt.options.Timer) - lcd.drawText(wgt.zone.x, wgt.zone.y, timerInfo, SMLSIZE + CUSTOM_COLOR) - lcd.drawTimer(wgt.zone.x, wgt.zone.y+15, t1.value, XXLSIZE + CUSTOM_COLOR) -end - ---- Zone size: 390x172 1/1 ---- Zone size: 460x252 1/1 (no sliders/trim/topbar) -local function refreshZoneXLarge(wgt) - local t1 = model.getTimer(wgt.options.Timer-1) - --print(t1.value) - local timerInfo = string.format("Timer:%s", wgt.options.Timer) - lcd.drawText(wgt.zone.x, wgt.zone.y, timerInfo, SMLSIZE + CUSTOM_COLOR) - lcd.drawTimer(wgt.zone.x, wgt.zone.y+15, t1.value, XXLSIZE + CUSTOM_COLOR) -end - - -function refresh(wgt) - - if (wgt==nil) then - print("refresh(nil)") - return - end - - if (wgt.options==nil) then - print("refresh(wgt.options=nil)") - return - end - - if (wgt.options.Timer==nil) then - print("refresh(wgt.options.Timer=nil)") - return - end - - lcd.setColor(CUSTOM_COLOR, wgt.options.TextColor) - - if wgt.zone.w > 380 and wgt.zone.h > 165 then refreshZoneXLarge(wgt) - elseif wgt.zone.w > 180 and wgt.zone.h > 145 then refreshZoneLarge(wgt) - elseif wgt.zone.w > 170 and wgt.zone.h > 65 then refreshZoneMedium(wgt) - elseif wgt.zone.w > 150 and wgt.zone.h > 28 then refreshZoneSmall(wgt) - elseif wgt.zone.w > 65 and wgt.zone.h > 35 then refreshZoneTiny(wgt) - end -end - -return { name="Timer2", options=options, create=create, update=update, background=background, refresh=refresh } diff --git a/radio/sdcard/horus/edgetx.sdcard.version b/radio/sdcard/horus/edgetx.sdcard.version deleted file mode 100644 index a921c3b61..000000000 --- a/radio/sdcard/horus/edgetx.sdcard.version +++ /dev/null @@ -1 +0,0 @@ -2.4V0037 diff --git a/radio/sdcard/nv14/CROSSFIRE/crossfire.lua b/radio/sdcard/nv14/CROSSFIRE/crossfire.lua deleted file mode 100644 index 96e5ce3e8..000000000 --- a/radio/sdcard/nv14/CROSSFIRE/crossfire.lua +++ /dev/null @@ -1,121 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### -local devices = { } -local lineIndex = 1 -local pageOffset = 0 - -local function createDevice(id, name) - local device = { - id = id, - name = name, - timeout = 0 - } - return device -end - -local function getDevice(name) - for i=1, #devices do - if devices[i].name == name then - return devices[i] - end - end - return nil -end - -local function parseDeviceInfoMessage(data) - local id = data[2] - local name = "" - local i = 3 - while data[i] ~= 0 do - name = name .. string.char(data[i]) - i = i + 1 - end - local device = getDevice(name) - if device == nil then - device = createDevice(id, name) - devices[#devices + 1] = device - end - local time = getTime() - device.timeout = time + 3000 -- 30s - if lineIndex == 0 then - lineIndex = 1 - end -end - -local devicesRefreshTimeout = 0 -local function refreshNext() - local command, data = crossfireTelemetryPop() - if command == nil then - local time = getTime() - if time > devicesRefreshTimeout then - devicesRefreshTimeout = time + 100 -- 1s - crossfireTelemetryPush(0x28, { 0x00, 0xEA }) - end - elseif command == 0x29 then - parseDeviceInfoMessage(data) - end -end - -local function selectDevice(step) - lineIndex = 1 + ((lineIndex + step - 1 + #devices) % #devices) -end - --- Init -local function init() - lineIndex = 0 - pageOffset = 0 -end - -NoCross = { 110, LCD_H - 28, "Waiting for Crossfire devices...", DEFAULT_COLOR + INVERS + BLINK } - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_EXIT_BREAK then - return 2 - elseif event == EVT_ROT_LEFT then - selectDevice(1) - elseif event == EVT_ROT_RIGHT then - selectDevice(-1) - end - - lcd.clear() - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5,"CROSSFIRE SETUP", MENU_COLOR) - - - if #devices == 0 then - lcd.drawText(NoCross[1],NoCross[2],NoCross[3],NoCross[4]) - else - for i=1, #devices do - local attr = (lineIndex == i and INVERS or 0) - if event == EVT_ROT_BREAK and attr == INVERS then - crossfireTelemetryPush(0x28, { devices[i].id, 0xEA }) - return "device.lua" - end - lcd.drawText(5, i*22+10, devices[i].name, attr) - end - end - - refreshNext() - - return 0 -end - -return { init=init, run=run } diff --git a/radio/sdcard/nv14/CROSSFIRE/device.lua b/radio/sdcard/nv14/CROSSFIRE/device.lua deleted file mode 100644 index fe477825f..000000000 --- a/radio/sdcard/nv14/CROSSFIRE/device.lua +++ /dev/null @@ -1,533 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### -local deviceId = 0 -local deviceName = "" -local lineIndex = 0 -local pageOffset = 0 -local edit = false -local charIndex = 1 -local fieldPopup -local fieldTimeout = 0 -local fieldId = 1 -local fieldChunk = 0 -local fieldData = {} -local fields = {} - -local function getField(line) - local counter = 1 - for i = 1, #fields do - local field = fields[i] - if not field.hidden then - if counter < line then - counter = counter + 1 - else - return field - end - end - end -end - -local function initLineIndex() - lineIndex = 0 - for i = 1, #fields do - local field = getField(i) - if field and field.type ~= 11 and field.type ~= 12 and field.name ~= nil then - lineIndex = i - break - end - end -end - --- Change display attribute to current field -local function incrField(step) - local field = getField(lineIndex) - if field.type == 10 then - local byte = 32 - if charIndex <= #field.value then - byte = string.byte(field.value, charIndex) + step - end - if byte < 32 then - byte = 32 - elseif byte > 122 then - byte = 122 - end - if charIndex <= #field.value then - field.value = string.sub(field.value, 1, charIndex-1) .. string.char(byte) .. string.sub(field.value, charIndex+1) - else - field.value = field.value .. string.char(byte) - end - else - local min, max = 0, 0 - if field.type <= 5 then - min = field.min - max = field.max - step = field.step * step - elseif field.type == 9 then - min = 0 - max = #field.values - 1 - end - if (step < 0 and field.value > min) or (step > 0 and field.value < max) then - field.value = field.value + step - end - end -end - --- Select the next or previous editable field -local function selectField(step) - local newLineIndex = lineIndex - local field - repeat - newLineIndex = newLineIndex + step - if newLineIndex == 0 then - newLineIndex = #fields - elseif newLineIndex == 1 + #fields then - newLineIndex = 1 - pageOffset = 0 - end - field = getField(newLineIndex) - until newLineIndex == lineIndex or (field and field.type ~= 11 and field.name) - lineIndex = newLineIndex - if lineIndex > 11 + pageOffset then -- NOTE: increased from 7 to 11 to allow 11 lines in Horus display - pageOffset = lineIndex - 11 -- NOTE: increased from 7 to 11 to allow 11 lines in Horus display - elseif lineIndex <= pageOffset then - pageOffset = lineIndex - 1 - end -end - -local function split(str) - local t = {} - local i = 1 - for s in string.gmatch(str, "([^;]+)") do - t[i] = s - i = i + 1 - end - return t -end - -local function fieldGetString(data, offset) - local result = "" - while data[offset] ~= 0 do - result = result .. string.char(data[offset]) - offset = offset + 1 - end - offset = offset + 1 - return result, offset -end - -local function parseDeviceInfoMessage(data) - local offset - deviceId = data[2] - deviceName, offset = fieldGetString(data, 3) - local fields_count = data[offset+12] - for i=1, fields_count do - fields[i] = { name=nil } - end -end - -local function fieldGetValue(data, offset, size) - local result = 0 - for i=0, size-1 do - result = bit32.lshift(result, 8) + data[offset + i] - end - return result -end - -local function fieldUnsignedLoad(field, data, offset, size) - field.value = fieldGetValue(data, offset, size) - field.min = fieldGetValue(data, offset+size, size) - field.max = fieldGetValue(data, offset+2*size, size) - field.default = fieldGetValue(data, offset+3*size, size) - field.unit, offset = fieldGetString(data, offset+4*size) - field.step = 1 -end - -local function fieldUnsignedToSigned(field, size) - local bandval = bit32.lshift(0x80, (size-1)*8) - field.value = field.value - bit32.band(field.value, bandval) * 2 - field.min = field.min - bit32.band(field.min, bandval) * 2 - field.max = field.max - bit32.band(field.max, bandval) * 2 - field.default = field.default - bit32.band(field.default, bandval) * 2 -end - - local function fieldSignedLoad(field, data, offset, size) - fieldUnsignedLoad(field, data, offset, size) - fieldUnsignedToSigned(field, size) -end - -local function fieldIntSave(index, value, size) - local frame = { deviceId, 0xEA, index } - for i=size-1, 0, -1 do - frame[#frame + 1] = (bit32.rshift(value, 8*i) % 256) - end - crossfireTelemetryPush(0x2D, frame) -end - -local function fieldUnsignedSave(field, size) - local value = field.value - fieldIntSave(field.id, value, size) -end - -local function fieldSignedSave(field, size) - local value = field.value - if value < 0 then - value = bit32.lshift(0x100, (size-1)*8) + value - end - fieldIntSave(field.id, value, size) -end - -local function fieldIntDisplay(field, y, attr) - -- lcd.drawNumber(140, y, field.value, LEFT + attr) -- NOTE: original code getLastPos not available in Horus - -- lcd.drawText(lcd.getLastPos(), y, field.unit, attr) -- NOTE: original code getLastPos not available in Horus - lcd.drawText(140, y, field.value .. field.unit, attr) -- NOTE: Concenated fields instead of get lastPos -end - --- UINT8 -local function fieldUint8Load(field, data, offset) - fieldUnsignedLoad(field, data, offset, 1) -end - -local function fieldUint8Save(field) - fieldUnsignedSave(field, 1) -end - --- INT8 -local function fieldInt8Load(field, data, offset) - fieldSignedLoad(field, data, offset, 1) -end - -local function fieldInt8Save(field) - fieldSignedSave(field, 1) -end - --- UINT16 -local function fieldUint16Load(field, data, offset) - fieldUnsignedLoad(field, data, offset, 2) -end - -local function fieldUint16Save(field) - fieldUnsignedSave(field, 2) -end - --- INT16 -local function fieldInt16Load(field, data, offset) - fieldSignedLoad(field, data, offset, 2) -end - -local function fieldInt16Save(field) - fieldSignedSave(field, 2) -end - --- FLOAT -local function fieldFloatLoad(field, data, offset) - field.value = fieldGetValue(data, offset, 4) - field.min = fieldGetValue(data, offset+4, 4) - field.max = fieldGetValue(data, offset+8, 4) - field.default = fieldGetValue(data, offset+12, 4) - fieldUnsignedToSigned(field, 4) - field.prec = data[offset+16] - if field.prec > 2 then - field.prec = 2 - end - field.step = fieldGetValue(data, offset+17, 4) - field.unit, offset = fieldGetString(data, offset+21) -end - -local function fieldFloatDisplay(field, y, attr) - local attrnum - if field.prec == 1 then - attrnum = LEFT + attr + PREC1 - elseif field.prec == 2 then - attrnum = LEFT + attr + PREC2 - else - attrnum = LEFT + attr - end - -- lcd.drawNumber(140, y, field.value, attrnum) -- NOTE: original code getLastPos not available in Horus - -- lcd.drawText(lcd.getLastPos(), y, field.unit, attr) -- NOTE: original code getLastPos not available in Horus - lcd.drawText(140, y, field.value .. field.unit, attr) -- NOTE: Concenated fields instead of get lastPos -end - -local function fieldFloatSave(field) - fieldUnsignedSave(field, 4) -end - --- TEXT SELECTION -local function fieldTextSelectionLoad(field, data, offset) - local values - values, offset = fieldGetString(data, offset) - if values ~= "" then - field.values = split(values) - end - field.value = data[offset] - field.min = data[offset+1] - field.max = data[offset+2] - field.default = data[offset+3] - field.unit, offset = fieldGetString(data, offset+4) -end - -local function fieldTextSelectionSave(field) - crossfireTelemetryPush(0x2D, { deviceId, 0xEA, field.id, field.value }) -end - -local function fieldTextSelectionDisplay(field, y, attr) - -- lcd.drawText(140, y, field.values[field.value+1], attr) -- NOTE: original code getLastPos not available in Horus - -- lcd.drawText(lcd.getLastPos(), y, field.unit, attr) -- NOTE: original code getLastPos not available in Horus - lcd.drawText(140, y, field.values[field.value+1] .. field.unit, attr) -- NOTE: Concenated fields instead of get lastPos -end - --- STRING -local function fieldStringLoad(field, data, offset) - field.value, offset = fieldGetString(data, offset) - if #data >= offset then - field.maxlen = data[offset] - end -end - -local function fieldStringSave(field) - local frame = { deviceId, 0xEA, field.id } - for i=1, string.len(field.value) do - frame[#frame + 1] = string.byte(field.value, i) - end - frame[#frame + 1] = 0 - crossfireTelemetryPush(0x2D, frame) -end - -local function fieldStringDisplay(field, y, attr) - if edit == true and attr then - -- lcd.drawText(140, y, field.value, FIXEDWIDTH) -- NOTE: FIXEDWIDTH unknown.... - -- lcd.drawText(134+6*charIndex, y, string.sub(field.value, charIndex, charIndex), FIXEDWIDTH + attr) -- NOTE: FIXEDWIDTH unknown.... - lcd.drawText(140, y, field.value, attr) - lcd.drawText(134+6*charIndex, y, string.sub(field.value, charIndex, charIndex), attr) - else - lcd.drawText(140, y, field.value, attr) - end -end - -local function fieldCommandLoad(field, data, offset) - field.status = data[offset] - field.timeout = data[offset+1] - field.info, offset = fieldGetString(data, offset+2) - if field.status < 2 or field.status > 3 then - fieldPopup = nil - end -end - -local function fieldCommandSave(field) - if field.status == 0 then - field.status = 1 - crossfireTelemetryPush(0x2D, { deviceId, 0xEA, field.id, field.status }) - fieldPopup = field - fieldTimeout = getTime() + field.timeout - end -end - -local function fieldCommandDisplay(field, y, attr) - lcd.drawText(1, y, field.name, attr) - if field.info ~= "" then - lcd.drawText(140, y, "[" .. field.info .. "]") - end -end - -local functions = { - { load=fieldUint8Load, save=fieldUint8Save, display=fieldIntDisplay }, - { load=fieldInt8Load, save=fieldInt8Save, display=fieldIntDisplay }, - { load=fieldUint16Load, save=fieldUint16Save, display=fieldIntDisplay }, - { load=fieldInt16Load, save=fieldInt16Save, display=fieldIntDisplay }, - nil, - nil, - nil, - nil, - { load=fieldFloatLoad, save=fieldFloatSave, display=fieldFloatDisplay }, - { load=fieldTextSelectionLoad, save=fieldTextSelectionSave, display=fieldTextSelectionDisplay }, - { load=fieldStringLoad, save=fieldStringSave, display=fieldStringDisplay }, - nil, - { load=fieldStringLoad, save=fieldStringSave, display=fieldStringDisplay }, - { load=fieldCommandLoad, save=fieldCommandSave, display=fieldCommandDisplay }, -} - -local function parseParameterInfoMessage(data) - if data[2] ~= deviceId or data[3] ~= fieldId then - fieldData = {} - fieldChunk = 0 - return - end - local field = fields[fieldId] - local chunks = data[4] - for i=5, #data do - fieldData[#fieldData + 1] = data[i] - end - if chunks > 0 then - fieldChunk = fieldChunk + 1 - else - fieldChunk = 0 - field.id = fieldId - field.parent = fieldData[1] - field.type = fieldData[2] % 128 - field.hidden = (bit32.rshift(fieldData[2], 7) == 1) - local name, i = fieldGetString(fieldData, 3) - if name ~= "" then - local indent = "" - local parent = field.parent - while parent ~= 0 do - indent = indent .. " " - parent = fields[parent].parent - end - field.name = indent .. name - end - if functions[field.type+1] then - functions[field.type+1].load(field, fieldData, i) - end - if not fieldPopup then - if lineIndex == 0 and field.hidden ~= true and field.type and field.type ~= 11 and field.type ~= 12 then - initLineIndex() - end - fieldId = 1 + (fieldId % #fields) - end - fieldData = {} - end -end - -local function refreshNext() - local command, data = crossfireTelemetryPop() - if command == nil then - local time = getTime() - if fieldPopup then - if time > fieldTimeout then - local frame = { deviceId, 0xEA, fieldPopup.id } - crossfireTelemetryPush(0x2D, frame) - fieldTimeout = time + fieldPopup.timeout - end - elseif time > fieldTimeout and not edit then - crossfireTelemetryPush(0x2C, { deviceId, 0xEA, fieldId, fieldChunk }) - fieldTimeout = time + 200 -- 2s - end - elseif command == 0x29 then - parseDeviceInfoMessage(data) - elseif command == 0x2B then - parseParameterInfoMessage(data) - fieldTimeout = 0 - end -end - --- Main -local function runDevicePage(event) - if event == EVT_EXIT_BREAK then -- exit script - if edit == true then - edit = false - local field = getField(lineIndex) - fieldTimeout = getTime() + 200 -- 2s - fieldId, fieldChunk = field.id, 0 - fieldData = {} - functions[field.type+1].save(field) - else - return "crossfire.lua" - end - elseif event == EVT_ROT_BREAK then -- toggle editing/selecting current field - local field = getField(lineIndex) - if field.name then - if field.type == 10 then - if edit == false then - edit = true - charIndex = 1 - else - charIndex = charIndex + 1 - end - elseif field.type < 11 then - edit = not edit - end - if edit == false then - fieldTimeout = getTime() + 200 -- 2s - fieldId, fieldChunk = field.id, 0 - fieldData = {} - functions[field.type+1].save(field) - end - end - elseif edit then - if event == EVT_ROT_LEFT then - incrField(1) - elseif event == EVT_ROT_RIGHT then - incrField(-1) - end - else - if event == EVT_ROT_RIGHT then - selectField(1) - elseif event == EVT_ROT_LEFT then - selectField(-1) - end - end - - lcd.clear() - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5,deviceName, MENU_COLOR) - - for y = 1, 11 do - local field = getField(pageOffset+y) - if not field then - break - elseif field.name == nil then - lcd.drawText(1, y*22+10, "...") - else - local attr = lineIndex == (pageOffset+y) and ((edit == true and BLINK or 0) + INVERS) or 0 - lcd.drawText(1, y*22+10, field.name) - if functions[field.type+1] then - functions[field.type+1].display(field, y*22+10, attr) - end - end - end - - return 0 -end - -local function runPopupPage(event) - local result - if fieldPopup.status == 3 then - result = popupConfirmation(fieldPopup.info, event) - else - result = popupWarning(fieldPopup.info, event) - end - if result == "OK" then - crossfireTelemetryPush(0x2D, { deviceId, 0xEA, fieldPopup.id, 4 }) - elseif result == "CANCEL" then - crossfireTelemetryPush(0x2D, { deviceId, 0xEA, fieldPopup.id, 5 }) - end - return 0 -end - --- Init -local function init() - lineIndex, edit = 0, false -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - end - - local result - if fieldPopup ~= nil then - result = runPopupPage(event) - else - result = runDevicePage(event) - end - - refreshNext() - - return result -end - -return { init=init, run=run } diff --git a/radio/sdcard/nv14/FIRMWARE/readme.txt b/radio/sdcard/nv14/FIRMWARE/readme.txt deleted file mode 100644 index 4ba9522c9..000000000 --- a/radio/sdcard/nv14/FIRMWARE/readme.txt +++ /dev/null @@ -1,2 +0,0 @@ -You can put firmware for your modules or radio in this folder. -Files in this folder are NOT automaticaly applied. diff --git a/radio/sdcard/nv14/IMAGES/readme.txt b/radio/sdcard/nv14/IMAGES/readme.txt deleted file mode 100644 index a8412eabd..000000000 --- a/radio/sdcard/nv14/IMAGES/readme.txt +++ /dev/null @@ -1,3 +0,0 @@ -2.2 : BMP renamed to IMAGES for consistency between Taranis and Horus. -You can put your model and other graphic files in this directory. -Format include bmp and png (including png with transparancy). diff --git a/radio/sdcard/nv14/LOGS/readme.txt b/radio/sdcard/nv14/LOGS/readme.txt deleted file mode 100644 index f9c005b26..000000000 --- a/radio/sdcard/nv14/LOGS/readme.txt +++ /dev/null @@ -1 +0,0 @@ -Logs files created by "SD Logs" special function will be stored in this directory. diff --git a/radio/sdcard/nv14/SCRIPTS/FUNCTIONS/readme.txt b/radio/sdcard/nv14/SCRIPTS/FUNCTIONS/readme.txt deleted file mode 100644 index e14fc62df..000000000 --- a/radio/sdcard/nv14/SCRIPTS/FUNCTIONS/readme.txt +++ /dev/null @@ -1 +0,0 @@ -This directory is for lua functions scripts. diff --git a/radio/sdcard/nv14/SCRIPTS/MIXES/readme.txt b/radio/sdcard/nv14/SCRIPTS/MIXES/readme.txt deleted file mode 100644 index 8a5e2e738..000000000 --- a/radio/sdcard/nv14/SCRIPTS/MIXES/readme.txt +++ /dev/null @@ -1 +0,0 @@ -This directory is for lua mixer scripts. diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/icon.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/icon.png deleted file mode 100755 index 6869f18e9..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/icon.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/background.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/background.png deleted file mode 100755 index e21f7bc81..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/background.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/brake.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/brake.png deleted file mode 100755 index 701cc2bdc..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/brake.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/flap.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/flap.png deleted file mode 100755 index 074bdf8d3..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/flap.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/lail.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/lail.png deleted file mode 100755 index 074bdf8d3..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/lail.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/mark_bg.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/mark_bg.png deleted file mode 100755 index fbe6b0ee2..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/mark_bg.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/pagedn.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/pagedn.png deleted file mode 100755 index 0733ccfa1..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/pagedn.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/pageup.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/pageup.png deleted file mode 100755 index 0dbaa5202..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/pageup.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/plane.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/plane.png deleted file mode 100755 index af1785270..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/plane.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/prop.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/prop.png deleted file mode 100644 index 4139d3542..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/prop.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/rail.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/rail.png deleted file mode 100755 index 074bdf8d3..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/rail.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/summary.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/summary.png deleted file mode 100755 index 8b23b0b42..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/summary.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/tail.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/tail.png deleted file mode 100755 index 6c6143cfd..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/tail.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/tail_rud.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/tail_rud.png deleted file mode 100755 index a777c0c80..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/tail_rud.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/vtail.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/vtail.png deleted file mode 100755 index f68035ece..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/img/vtail.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/wizard.lua b/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/wizard.lua deleted file mode 100644 index 890f9688a..000000000 --- a/radio/sdcard/nv14/SCRIPTS/WIZARD/glider/wizard.lua +++ /dev/null @@ -1,485 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### -local VALUE = 0 -local COMBO = 1 - -local edit = false -local page = 1 -local current = 1 -local pages = {} -local fields = {} - --- 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) - local field = fields[current] - local min, max - if field[3] == VALUE then - min = field[6] - max = field[7] - elseif field[3] == COMBO then - min = 0 - max = #(field[6]) - 1 - end - if (step < 0 and field[5] > min) or (step > 0 and field[5] < max) then - field[5] = field[5] + step - end -end - --- Select the next or previous page -local function selectPage(step) - page = 1 + ((page + step - 1 + #pages) % #pages) - edit = false - current = 1 -end - --- Select the next or previous editable field -local function selectField(step) - repeat - current = 1 + ((current + step - 1 + #fields) % #fields) - until fields[current][4]==1 -end - --- Redraw the current page -local function redrawFieldsPage(event) - - for index = 1, 10, 1 do - local field = fields[index] - if field == nil then - break - end - - local attr = current == (index) and ((edit == true and BLINK or 0) + INVERS) or 0 - attr = attr + DEFAULT_COLOR - - if field[4] == 1 then - if field[3] == VALUE then - lcd.drawNumber(field[1], field[2], field[5], LEFT + attr) - elseif field[3] == COMBO then - if field[5] >= 0 and field[5] < #(field[6]) then - lcd.drawText(field[1],field[2], field[6][1+field[5]], attr) - end - end - end - end -end - -local function updateField(field) - local value = field[5] -end - --- Main -local function runFieldsPage(event) - if event == EVT_EXIT_BREAK then -- exit script - return 2 - elseif event == EVT_ENTER_BREAK or event == EVT_ROT_BREAK then -- toggle editing/selecting current field - if fields[current][5] ~= nil then - edit = not edit - if edit == false then - updateField(fields[current]) - end - end - elseif edit then - if event == EVT_PLUS_FIRST or event == EVT_ROT_RIGHT or event == EVT_PLUS_REPT then - addField(1) - elseif event == EVT_MINUS_FIRST or event == EVT_ROT_LEFT or event == EVT_MINUS_REPT then - addField(-1) - end - else - if event == EVT_MINUS_FIRST or event == EVT_ROT_RIGHT then - selectField(1) - elseif event == EVT_PLUS_FIRST or event == EVT_ROT_LEFT then - selectField(-1) - end - end - redrawFieldsPage(event) - return 0 -end - --- set visibility flags starting with SECOND field of fields -local function setFieldsVisible(...) - local arg={...} - local cnt = 2 - for i,v in ipairs(arg) do - fields[cnt][4] = v - cnt = cnt + 1 - end -end - --- draws one letter mark -local function drawMark(x, y, name) - lcd.drawBitmap(ImgMarkBg, x, y) - lcd.drawText(x+8, y+3, name, DEFAULT_COLOR) -end - - -local MotorFields = { - {50, 50, COMBO, 1, 1, { "No", "Yes"} }, - {50, 127, COMBO, 1, 2, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, -} - -local ImgEngine - -local function runMotorConfig(event) - lcd.clear() - if ImgEngine == nil then - ImgEngine = Bitmap.open("img/prop.png") - end - lcd.drawBitmap(BackgroundImg, 0, 0) - lcd.drawBitmap(ImgPageDn, 455, 95) - lcd.drawBitmap(ImgEngine, 310, 50) - lcd.setColor(CUSTOM_COLOR, lcd.RGB(255, 255, 255)) - fields = MotorFields - lcd.drawText(40, 20, "Does your model have a motor ?", DEFAULT_COLOR) - lcd.drawFilledRectangle(40, 45, 200, 30, CUSTOM_COLOR) - fields[2][4]=0 - if fields[1][5] == 1 then - lcd.drawText(40, 100, "What channel is it on ?", DEFAULT_COLOR) - lcd.drawFilledRectangle(40, 122, 100, 30, CUSTOM_COLOR) - fields[2][4]=1 - end - local result = runFieldsPage(event) - return result -end - --- fields format : {[1]x, [2]y, [3]COMBO, [4]visible, [5]default, [6]{values}} --- fields format : {[1]x, [2]y, [3]VALUE, [4]visible, [5]default, [6]min, [7]max} -local AilFields = { - {50, 50, COMBO, 1, 2, { "None", "One, or two with Y cable", "Two"} }, - {50, 127, COMBO, 1, 0, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, -- Ail1 chan - {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 - lcd.drawBitmap(ImgAilR, 274, 123) - lcd.drawBitmap(ImgAilL, 395, 235) - drawMark(308, 115, "A") - drawMark(422, 220, "A") - lcd.drawFilledRectangle(40, 122, 100, 30, CUSTOM_COLOR) - drawMark(152, 124, "A") - setFieldsVisible(1, 0) - elseif fields[1][5] == 2 then - lcd.drawBitmap(ImgAilR, 274, 123) - lcd.drawBitmap(ImgAilL, 395, 235) - drawMark(308, 115, "A") - drawMark(422, 220, "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 - setFieldsVisible(0, 0) - end - lcd.drawText(40, 20, "Number of ailerons on your model ?", DEFAULT_COLOR) - lcd.drawFilledRectangle(40, 45, 400, 30, CUSTOM_COLOR) - local result = runFieldsPage(event) - return result -end - -local FlapsFields = { - {50, 50, COMBO, 1, 0, { "No", "Yes, on one channel", "Yes, on two channels"} }, - {50, 127, COMBO, 1, 6, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, - {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 - lcd.drawBitmap(ImgFlp, 315, 160) - lcd.drawBitmap(ImgFlp, 358, 202) - drawMark(332, 132, "A") - drawMark(412, 215, "A") - lcd.drawFilledRectangle(40, 122, 100, 30, CUSTOM_COLOR) - drawMark(152, 124, "A") - setFieldsVisible(1, 0) - elseif fields[1][5] == 2 then - lcd.drawBitmap(ImgFlp, 315, 160) - lcd.drawBitmap(ImgFlp, 358, 202) - drawMark(332, 132, "A") - drawMark(412, 215, "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 - setFieldsVisible(0, 0) - end - lcd.drawText(40, 20, "Does your model have flaps ?", DEFAULT_COLOR) - lcd.drawFilledRectangle(40, 45, 400, 30, CUSTOM_COLOR) - local result = runFieldsPage(event) - return result -end - -local TailFields = { - {50, 50, COMBO, 1, 1, { "1 channel for Elevator, no Rudder", "One chan for Elevator, one for Rudder", "Two chans for Elevator, one for Rudder", "V Tail"} }, - {50, 127, COMBO, 1, 1, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, --ele - {50, 167, COMBO, 1, 3, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, --rud - {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 - lcd.drawBitmap(ImgTail, 252, 100) - drawMark(360, 125, "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 - lcd.drawBitmap(ImgTail, 252, 100) - lcd.drawBitmap(ImgTailRud, 340, 100) - drawMark(415, 150, "A") - drawMark(380, 120, "A") - drawMark(390, 185, "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 - lcd.drawBitmap(ImgTail, 252, 100) - lcd.drawBitmap(ImgTailRud, 340, 100) - drawMark(415, 150, "A") - drawMark(380, 120, "C") - drawMark(390, 185, "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 - 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", DEFAULT_COLOR) - lcd.drawFilledRectangle(40, 45, 400, 30, CUSTOM_COLOR) - local result = runFieldsPage(event) - return result -end - -local lineIndex -local function drawNextLine(text, text2) - lcd.drawText(40, lineIndex, text, DEFAULT_COLOR) - lcd.drawText(250, lineIndex, text2 + 1, DEFAULT_COLOR) - lineIndex = lineIndex + 20 -end - -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(BackgroundImg, 0, 0) - lcd.drawBitmap(ImgPageUp, 0, 95) - lcd.drawBitmap(ImgSummary, 300, 60) - lineIndex = 40 - -- motors - if(MotorFields[1][5] == 1) then - drawNextLine("Motor chan :", MotorFields[2][5]) - elseif (MotorFields[1][5] == 2) then - drawNextLine("Motor 1 chan :", MotorFields[2][5]) - drawNextLine("Motor 2 chan :", MotorFields[3][5]) - end - -- ail - if(AilFields[1][5] == 1) then - drawNextLine("Aileron chan :",AilFields[2][5]) - elseif (AilFields[1][5] == 2) then - drawNextLine("Aileron 1 chan :",AilFields[2][5]) - drawNextLine("Aileron 2 chan :",AilFields[3][5]) - end - -- flaps - if(FlapsFields[1][5] == 1) then - drawNextLine("Flaps chan :",FlapsFields[2][5]) - elseif (FlapsFields[1][5] == 2) then - drawNextLine("Flaps 1 chan :",FlapsFields[2][5]) - drawNextLine("Flaps 2 chan :",FlapsFields[3][5]) - end - -- tail - if(TailFields[1][5] == 0) then - drawNextLine("Elevator chan :",TailFields[2][5]) - elseif (TailFields[1][5] == 1) then - drawNextLine("Elevator chan :",TailFields[2][5]) - drawNextLine("Rudder chan :",TailFields[3][5]) - elseif (TailFields[1][5] == 2) then - drawNextLine("Elevator 1 chan :",TailFields[2][5]) - drawNextLine("Rudder chan :",TailFields[3][5]) - drawNextLine("Elevator 2 chan :",TailFields[4][5]) - elseif (TailFields[1][5] == 3) then - drawNextLine("V-Tail elevator :", TailFields[2][5]) - drawNextLine("V-Tail rudder :", TailFields[3][5]) - end - local result = runFieldsPage(event) - if(fields[1][5] == 1 and edit == false) then - selectPage(1) - end - return result -end - -local function addMix(channel, input, name, weight, index) - local mix = { source=input, name=name } - if weight ~= nil then - mix.weight = weight - end - if index == nil then - index = 0 - end - model.insertMix(channel, index, mix) -end - -local function createModel(event) - lcd.clear() - lcd.drawBitmap(BackgroundImg, 0, 0) - lcd.drawBitmap(ImgSummary, 300, 60) - model.defaultInputs() - model.deleteMixes() - -- motor - if(MotorFields[1][5] == 1) then - addMix(MotorFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(2), "Motor") - elseif (MotorFields[1][5] == 2) then - addMix(MotorFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(2), "Motor1") - addMix(MotorFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(2), "Motor2") - end - -- Ailerons - if(AilFields[1][5] == 1) then - addMix(AilFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(3), "Ail") - elseif (AilFields[1][5] == 2) then - addMix(AilFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(3), "AilL") - addMix(AilFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(3), "AilR", -100) - end - -- Flaps - if(FlapsFields[1][5] == 1) then - addMix(FlapsFields[2][5], MIXSRC_SA, "Flaps") - elseif (FlapsFields[1][5] == 2) then - addMix(FlapsFields[2][5], MIXSRC_SA, "FlapsL") - addMix(FlapsFields[3][5], MIXSRC_SA, "FlapsR") - end - -- Tail - if(TailFields[1][5] == 0) then - addMix(TailFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "Elev") - elseif (TailFields[1][5] == 1) then - addMix(TailFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "Elev") - addMix(TailFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(0), "Rudder") - elseif (TailFields[1][5] == 2) then - addMix(TailFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "ElevL") - addMix(TailFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(0), "Rudder") - addMix(TailFields[4][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "ElevR") - elseif (TailFields[1][5] == 3) then - addMix(TailFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "V-EleL", 50) - addMix(TailFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(0), "V-RudL", 50, 1) - addMix(TailFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "V-EleR", 50) - addMix(TailFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(0), "V-RudR", -50, 1) - end - lcd.drawText(70, 90, "Model successfully created !", DEFAULT_COLOR) - lcd.drawText(100, 130, "Press RTN to exit", DEFAULT_COLOR) - return 2 -end - --- Init -local function init() - current, edit = 1, false - pages = { - runMotorConfig, - runAilConfig, - runFlapsConfig, - runTailConfig, - runConfigSummary, - createModel, - } -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif (event == EVT_PAGE_BREAK or event == EVT_PAGEDN_FIRST) and page < #pages-1 then - selectPage(1) - elseif (event == EVT_PAGE_LONG or event == EVT_PAGEUP_FIRST) and page > 1 then - killEvents(event); - selectPage(-1) - end - - local result = pages[page](event) - return result -end - -return { init=init, run=run } diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/icon.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/icon.png deleted file mode 100755 index 2deea1d9a..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/icon.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/background.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/background.png deleted file mode 100755 index e21f7bc81..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/background.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/flap.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/flap.png deleted file mode 100755 index 82a844891..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/flap.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/lail.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/lail.png deleted file mode 100755 index 00cff0cf6..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/lail.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/mark_bg.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/mark_bg.png deleted file mode 100755 index fbe6b0ee2..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/mark_bg.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/pagedn.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/pagedn.png deleted file mode 100755 index 0733ccfa1..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/pagedn.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/pageup.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/pageup.png deleted file mode 100755 index 0dbaa5202..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/pageup.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/plane.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/plane.png deleted file mode 100644 index ab9db2606..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/plane.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/prop.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/prop.png deleted file mode 100644 index 9c353400f..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/prop.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/rail.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/rail.png deleted file mode 100755 index e2f80ffe2..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/rail.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/summary.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/summary.png deleted file mode 100755 index 8b23b0b42..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/summary.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/tail.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/tail.png deleted file mode 100755 index db3f29bcd..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/tail.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/tailrud.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/tailrud.png deleted file mode 100755 index d42a7244e..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/tailrud.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/vtail.png b/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/vtail.png deleted file mode 100755 index fae86aae4..000000000 Binary files a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/img/vtail.png and /dev/null differ diff --git a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/wizard.lua b/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/wizard.lua deleted file mode 100755 index b0085af81..000000000 --- a/radio/sdcard/nv14/SCRIPTS/WIZARD/plane/wizard.lua +++ /dev/null @@ -1,485 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### -local VALUE = 0 -local COMBO = 1 - -local edit = false -local page = 1 -local current = 1 -local pages = {} -local fields = {} - --- 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) - local field = fields[current] - local min, max - if field[3] == VALUE then - min = field[6] - max = field[7] - elseif field[3] == COMBO then - min = 0 - max = #(field[6]) - 1 - end - if (step < 0 and field[5] > min) or (step > 0 and field[5] < max) then - field[5] = field[5] + step - end -end - --- Select the next or previous page -local function selectPage(step) - page = 1 + ((page + step - 1 + #pages) % #pages) - edit = false - current = 1 -end - --- Select the next or previous editable field -local function selectField(step) - repeat - current = 1 + ((current + step - 1 + #fields) % #fields) - until fields[current][4]==1 -end - --- Redraw the current page -local function redrawFieldsPage(event) - - for index = 1, 10, 1 do - local field = fields[index] - if field == nil then - break - end - - local attr = current == (index) and ((edit == true and BLINK or 0) + INVERS) or 0 - attr = attr + DEFAULT_COLOR - - if field[4] == 1 then - if field[3] == VALUE then - lcd.drawNumber(field[1], field[2], field[5], LEFT + attr) - elseif field[3] == COMBO then - if field[5] >= 0 and field[5] < #(field[6]) then - lcd.drawText(field[1],field[2], field[6][1+field[5]], attr) - end - end - end - end -end - -local function updateField(field) - local value = field[5] -end - --- Main -local function runFieldsPage(event) - if event == EVT_EXIT_BREAK then -- exit script - return 2 - elseif event == EVT_ENTER_BREAK or event == EVT_ROT_BREAK then -- toggle editing/selecting current field - if fields[current][5] ~= nil then - edit = not edit - if edit == false then - updateField(fields[current]) - end - end - elseif edit then - if event == EVT_PLUS_FIRST or event == EVT_ROT_RIGHT or event == EVT_PLUS_REPT then - addField(1) - elseif event == EVT_MINUS_FIRST or event == EVT_ROT_LEFT or event == EVT_MINUS_REPT then - addField(-1) - end - else - if event == EVT_MINUS_FIRST or event == EVT_ROT_RIGHT then - selectField(1) - elseif event == EVT_PLUS_FIRST or event == EVT_ROT_LEFT then - selectField(-1) - end - end - redrawFieldsPage(event) - return 0 -end - --- set visibility flags starting with SECOND field of fields -local function setFieldsVisible(...) - local arg={...} - local cnt = 2 - for i,v in ipairs(arg) do - fields[cnt][4] = v - cnt = cnt + 1 - end -end - --- draws one letter mark -local function drawMark(x, y, name) - lcd.drawBitmap(ImgMarkBg, x, y) - lcd.drawText(x+8, y+3, name, DEFAULT_COLOR) -end - - -local MotorFields = { - {50, 50, COMBO, 1, 1, { "No", "Yes"} }, - {50, 127, COMBO, 1, 2, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, -} - -local ImgEngine - -local function runMotorConfig(event) - lcd.clear() - if ImgEngine == nil then - ImgEngine = Bitmap.open("img/prop.png") - end - lcd.drawBitmap(BackgroundImg, 0, 0) - lcd.drawBitmap(ImgPageDn, 455, 95) - lcd.drawBitmap(ImgEngine, 310, 50) - lcd.setColor(CUSTOM_COLOR, lcd.RGB(255, 255, 255)) - fields = MotorFields - lcd.drawText(40, 20, "Does your model have a motor ?", DEFAULT_COLOR) - lcd.drawFilledRectangle(40, 45, 200, 30, CUSTOM_COLOR) - fields[2][4]=0 - if fields[1][5] == 1 then - lcd.drawText(40, 100, "What channel is it on ?", DEFAULT_COLOR) - lcd.drawFilledRectangle(40, 122, 100, 30, CUSTOM_COLOR) - fields[2][4]=1 - end - local result = runFieldsPage(event) - return result -end - --- fields format : {[1]x, [2]y, [3]COMBO, [4]visible, [5]default, [6]{values}} --- fields format : {[1]x, [2]y, [3]VALUE, [4]visible, [5]default, [6]min, [7]max} -local AilFields = { - {50, 50, COMBO, 1, 2, { "None", "One, or two with Y cable", "Two"} }, - {50, 127, COMBO, 1, 0, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, -- Ail1 chan - {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 - 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 - 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 - setFieldsVisible(0, 0) - end - lcd.drawText(40, 20, "Number of ailerons on your model ?", DEFAULT_COLOR) - lcd.drawFilledRectangle(40, 45, 400, 30, CUSTOM_COLOR) - local result = runFieldsPage(event) - return result -end - -local FlapsFields = { - {50, 50, COMBO, 1, 0, { "No", "Yes, on one channel", "Yes, on two channels"} }, - {50, 127, COMBO, 1, 6, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, - {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 - 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 - 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 - setFieldsVisible(0, 0) - end - lcd.drawText(40, 20, "Does your model have flaps ?", DEFAULT_COLOR) - lcd.drawFilledRectangle(40, 45, 400, 30, CUSTOM_COLOR) - local result = runFieldsPage(event) - return result -end - -local TailFields = { - {50, 50, COMBO, 1, 1, { "1 channel for Elevator, no Rudder", "One chan for Elevator, one for Rudder", "Two chans for Elevator, one for Rudder", "V Tail"} }, - {50, 127, COMBO, 1, 1, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, --ele - {50, 167, COMBO, 1, 3, { "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8" } }, --rud - {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 - 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 - 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 - 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 - 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", DEFAULT_COLOR) - lcd.drawFilledRectangle(40, 45, 400, 30, CUSTOM_COLOR) - local result = runFieldsPage(event) - return result -end - -local lineIndex -local function drawNextLine(text, text2) - lcd.drawText(40, lineIndex, text, DEFAULT_COLOR) - lcd.drawText(250, lineIndex, text2 + 1, DEFAULT_COLOR) - lineIndex = lineIndex + 20 -end - -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(BackgroundImg, 0, 0) - lcd.drawBitmap(ImgPageUp, 0, 95) - lcd.drawBitmap(ImgSummary, 300, 60) - lineIndex = 40 - -- motors - if(MotorFields[1][5] == 1) then - drawNextLine("Motor chan :", MotorFields[2][5]) - elseif (MotorFields[1][5] == 2) then - drawNextLine("Motor 1 chan :", MotorFields[2][5]) - drawNextLine("Motor 2 chan :", MotorFields[3][5]) - end - -- ail - if(AilFields[1][5] == 1) then - drawNextLine("Aileron chan :",AilFields[2][5]) - elseif (AilFields[1][5] == 2) then - drawNextLine("Aileron 1 chan :",AilFields[2][5]) - drawNextLine("Aileron 2 chan :",AilFields[3][5]) - end - -- flaps - if(FlapsFields[1][5] == 1) then - drawNextLine("Flaps chan :",FlapsFields[2][5]) - elseif (FlapsFields[1][5] == 2) then - drawNextLine("Flaps 1 chan :",FlapsFields[2][5]) - drawNextLine("Flaps 2 chan :",FlapsFields[3][5]) - end - -- tail - if(TailFields[1][5] == 0) then - drawNextLine("Elevator chan :",TailFields[2][5]) - elseif (TailFields[1][5] == 1) then - drawNextLine("Elevator chan :",TailFields[2][5]) - drawNextLine("Rudder chan :",TailFields[3][5]) - elseif (TailFields[1][5] == 2) then - drawNextLine("Elevator 1 chan :",TailFields[2][5]) - drawNextLine("Rudder chan :",TailFields[3][5]) - drawNextLine("Elevator 2 chan :",TailFields[4][5]) - elseif (TailFields[1][5] == 3) then - drawNextLine("V-Tail elevator :", TailFields[2][5]) - drawNextLine("V-Tail rudder :", TailFields[3][5]) - end - local result = runFieldsPage(event) - if(fields[1][5] == 1 and edit == false) then - selectPage(1) - end - return result -end - -local function addMix(channel, input, name, weight, index) - local mix = { source=input, name=name } - if weight ~= nil then - mix.weight = weight - end - if index == nil then - index = 0 - end - model.insertMix(channel, index, mix) -end - -local function createModel(event) - lcd.clear() - lcd.drawBitmap(BackgroundImg, 0, 0) - lcd.drawBitmap(ImgSummary, 300, 60) - model.defaultInputs() - model.deleteMixes() - -- motor - if(MotorFields[1][5] == 1) then - addMix(MotorFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(2), "Motor") - elseif (MotorFields[1][5] == 2) then - addMix(MotorFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(2), "Motor1") - addMix(MotorFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(2), "Motor2") - end - -- Ailerons - if(AilFields[1][5] == 1) then - addMix(AilFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(3), "Ail") - elseif (AilFields[1][5] == 2) then - addMix(AilFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(3), "AilL") - addMix(AilFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(3), "AilR", -100) - end - -- Flaps - if(FlapsFields[1][5] == 1) then - addMix(FlapsFields[2][5], MIXSRC_SA, "Flaps") - elseif (FlapsFields[1][5] == 2) then - addMix(FlapsFields[2][5], MIXSRC_SA, "FlapsL") - addMix(FlapsFields[3][5], MIXSRC_SA, "FlapsR") - end - -- Tail - if(TailFields[1][5] == 0) then - addMix(TailFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "Elev") - elseif (TailFields[1][5] == 1) then - addMix(TailFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "Elev") - addMix(TailFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(0), "Rudder") - elseif (TailFields[1][5] == 2) then - addMix(TailFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "ElevL") - addMix(TailFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(0), "Rudder") - addMix(TailFields[4][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "ElevR") - elseif (TailFields[1][5] == 3) then - addMix(TailFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "V-EleL", 50) - addMix(TailFields[2][5], MIXSRC_FIRST_INPUT+defaultChannel(0), "V-RudL", 50, 1) - addMix(TailFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(1), "V-EleR", 50) - addMix(TailFields[3][5], MIXSRC_FIRST_INPUT+defaultChannel(0), "V-RudR", -50, 1) - end - lcd.drawText(70, 90, "Model successfully created !", DEFAULT_COLOR) - lcd.drawText(100, 130, "Press RTN to exit", DEFAULT_COLOR) - return 2 -end - --- Init -local function init() - current, edit = 1, false - pages = { - runMotorConfig, - runAilConfig, - runFlapsConfig, - runTailConfig, - runConfigSummary, - createModel, - } -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif (event == EVT_PAGE_BREAK or event == EVT_PAGEDN_FIRST) and page < #pages-1 then - selectPage(1) - elseif (event == EVT_PAGE_LONG or event == EVT_PAGEUP_FIRST) and page > 1 then - killEvents(event); - selectPage(-1) - end - - local result = pages[page](event) - return result -end - -return { init=init, run=run } diff --git a/radio/sdcard/nv14/SxR/SxR.lua b/radio/sdcard/nv14/SxR/SxR.lua deleted file mode 100755 index 7beab4101..000000000 --- a/radio/sdcard/nv14/SxR/SxR.lua +++ /dev/null @@ -1,318 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### -local VALUE = 0 -local COMBO = 1 - -local COLUMN_2 = 300 - -local edit = false -local page = 1 -local current = 1 -local refreshState = 0 -local refreshIndex = 0 -local calibrationState = 0 -local pageOffset = 0 -local calibrationStep = 0 -local pages = {} -local fields = {} -local modifications = {} -local wingBitmaps = {} -local mountBitmaps = {} - -local configFields = { - {"Wing type:", COMBO, 0x80, nil, { "Normal", "Delta", "VTail" } }, - {"Mounting type:", COMBO, 0x81, nil, { "Horz", "Horz rev.", "Vert", "Vert rev." } }, -} -local wingBitmapsFile = {"img/plane_b.png", "img/delta_b.png", "img/planev_b.png"} -local mountBitmapsFile = {"img/up.png", "img/down.png", "img/vert.png", "img/vert-r.png"} - -local settingsFields = { - {"SxR functions:", COMBO, 0x9C, nil, { "Disable", "Enable" } }, - {"Quick Mode:", COMBO, 0xAA, nil, { "Disable", "Enable" } }, - {"CH5 mode:", COMBO, 0xA8, nil, { "AIL2", "AUX1" } }, - {"CH6 mode:", COMBO, 0xA9, nil, { "ELE2", "AUX2" } }, - {"AIL direction:", COMBO, 0x82, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"ELE direction:", COMBO, 0x83, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"RUD direction:", COMBO, 0x84, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"AIL2 direction:", COMBO, 0x9A, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"ELE2 direction:", COMBO, 0x9B, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"AIL stabilize gain:", VALUE, 0x85, nil, 0, 200, "%"}, - {"ELE stabilize gain:", VALUE, 0x86, nil, 0, 200, "%"}, - {"RUD stabilize gain:", VALUE, 0x87, nil, 0, 200, "%"}, - {"AIL auto level gain:", VALUE, 0x88, nil, 0, 200, "%"}, - {"ELE auto level gain:", VALUE, 0x89, nil, 0, 200, "%"}, - {"ELE upright gain:", VALUE, 0x8C, nil, 0, 200, "%"}, - {"RUD upright gain:", VALUE, 0x8D, nil, 0, 200, "%"}, - {"AIL crab gain:", VALUE, 0x8E, nil, 0, 200, "%"}, - {"RUD crab gain:", VALUE, 0x90, nil, 0, 200, "%"}, - {"AIL auto angle offset:", VALUE, 0x91, nil, -20, 20, "%", 0x6C}, - {"ELE auto angle offset:", VALUE, 0x92, nil, -20, 20, "%", 0x6C}, - {"ELE upright angle offset:", VALUE, 0x95, nil, -20, 20, "%", 0x6C}, - {"RUD upright angle offset:", VALUE, 0x96, nil, -20, 20, "%", 0x6C}, - {"AIL crab angle offset:", VALUE, 0x97, nil, -20, 20, "%", 0x6C}, - {"RUD crab angle offset:", VALUE, 0x99, nil, -20, 20, "%", 0x6C}, -} - -local calibrationFields = { - {"X:", VALUE, 0x9E, 0, -100, 100, "%"}, - {"Y:", VALUE, 0x9F, 0, -100, 100, "%"}, - {"Z:", VALUE, 0xA0, 0, -100, 100, "%"} -} - -local function drawScreenTitle(title,page, pages) - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, title, MENU_COLOR) - lcd.drawText(LCD_W-40, 5, page.."/"..pages, MENU_COLOR) -end - --- Change display attribute to current field -local function addField(step) - local field = fields[current] - local min, max - if field[2] == VALUE then - min = field[5] - max = field[6] - elseif field[2] == COMBO then - min = 0 - max = #(field[5]) - 1 - end - if (step < 0 and field[4] > min) or (step > 0 and field[4] < max) then - field[4] = field[4] + step - end -end - --- Select the next or previous page -local function selectPage(step) - page = 1 + ((page + step - 1 + #pages) % #pages) - refreshIndex = 0 - calibrationStep = 0 - pageOffset = 0 -end - --- Select the next or previous editable field -local function selectField(step) - current = 1 + ((current + step - 1 + #fields) % #fields) - if current > 7 + pageOffset then - pageOffset = current - 7 - elseif current <= pageOffset then - pageOffset = current - 1 - end -end - -local function drawProgressBar() - local width = (300 * refreshIndex) / #fields - lcd.drawRectangle(100, 10, 300, 6) - lcd.drawFilledRectangle(102, 13, width, 2); -end - --- Redraw the current page -local function redrawFieldsPage(event) - lcd.clear() - drawScreenTitle("SxR", page, #pages) - - if refreshIndex < #fields then - drawProgressBar() - end - - for index = 1, 10, 1 do - local field = fields[pageOffset+index] - if field == nil then - break - end - - local attr = current == (pageOffset+index) and ((edit == true and BLINK or 0) + INVERS) or 0 - attr = attr + DEFAULT_COLOR - - lcd.drawText(1, 30+20*index, field[1], DEFAULT_COLOR) - - if field[4] == nil then - lcd.drawText(COLUMN_2, 30+20*index, "---", attr) - else - if field[2] == VALUE then - lcd.drawNumber(COLUMN_2, 30+20*index, field[4], LEFT + attr) - elseif field[2] == COMBO then - if field[4] >= 0 and field[4] < #(field[5]) then - lcd.drawText(COLUMN_2, 30+20*index, field[5][1+field[4]], attr) - end - end - end - end -end - -local function telemetryRead(field) - return sportTelemetryPush(0x17, 0x30, 0x0C30, field) -end - -local function telemetryWrite(field, value) - return sportTelemetryPush(0x17, 0x31, 0x0C30, field + value*256) -end - -local telemetryPopTimeout = 0 -local function refreshNext() - if refreshState == 0 then - if calibrationState == 1 then - if telemetryWrite(0x9D, calibrationStep) == true then - refreshState = 1 - calibrationState = 2 - telemetryPopTimeout = getTime() + 120 -- normal delay is 500ms - end - elseif #modifications > 0 then - telemetryWrite(modifications[1][1], modifications[1][2]) - modifications[1] = nil - elseif refreshIndex < #fields then - local field = fields[refreshIndex + 1] - if telemetryRead(field[3]) == true then - refreshState = 1 - telemetryPopTimeout = getTime() + 80 -- normal delay is 500ms - end - end - elseif refreshState == 1 then - local physicalId, primId, dataId, value = sportTelemetryPop() - if physicalId == 0x1A and primId == 0x32 and dataId == 0x0C30 then - local fieldId = value % 256 - if calibrationState == 2 then - if fieldId == 0x9D then - refreshState = 0 - calibrationState = 0 - calibrationStep = (calibrationStep + 1) % 7 - end - else - local field = fields[refreshIndex + 1] - if fieldId == field[3] then - local value = math.floor(value / 256) - if field[3] == 0xAA then - value = bit32.band(value, 0x0001) - end - if field[3] >= 0x9E and field[3] <= 0xA0 then - local b1 = value % 256 - local b2 = math.floor(value / 256) - value = b1*256 + b2 - value = value - bit32.band(value, 0x8000) * 2 - end - if field[2] == COMBO and #field == 6 then - for index = 1, #(field[6]), 1 do - if value == field[6][index] then - value = index - 1 - break - end - end - elseif field[2] == VALUE and #field == 8 then - value = value - field[8] + field[5] - end - fields[refreshIndex + 1][4] = value - refreshIndex = refreshIndex + 1 - refreshState = 0 - end - end - elseif getTime() > telemetryPopTimeout then - fields[refreshIndex + 1][4] = nil - refreshIndex = refreshIndex + 1 - refreshState = 0 - calibrationState = 0 - end - end -end - -local function updateField(field) - local value = field[4] - if field[2] == COMBO and #field == 6 then - value = field[6][1+value] - elseif field[2] == VALUE and #field == 8 then - value = value + field[8] - field[5] - end - modifications[#modifications+1] = { field[3], value } -end - --- Main -local function runFieldsPage(event) - if event == EVT_EXIT_BREAK then -- exit script - return 2 - elseif event == EVT_ENTER_BREAK or event == EVT_ROT_BREAK then -- toggle editing/selecting current field - if fields[current][4] ~= nil then - edit = not edit - if edit == false then - updateField(fields[current]) - end - end - elseif edit then - if event == EVT_PLUS_FIRST or event == EVT_ROT_RIGHT or event == EVT_PLUS_REPT then - addField(1) - elseif event == EVT_MINUS_FIRST or event == EVT_ROT_LEFT or event == EVT_MINUS_REPT then - addField(-1) - end - else - if event == EVT_MINUS_FIRST or event == EVT_ROT_RIGHT then - selectField(1) - elseif event == EVT_PLUS_FIRST or event == EVT_ROT_LEFT then - selectField(-1) - end - end - redrawFieldsPage(event) - return 0 -end - -local function runConfigPage(event) - fields = configFields - local result = runFieldsPage(event) - if fields[1][4] ~= nil then - if wingBitmaps[1 + fields[1][4]] == nil then - wingBitmaps[1 + fields[1][4]] = Bitmap.open(wingBitmapsFile[1 + fields[1][4]]) - end - lcd.drawBitmap(wingBitmaps[1 + fields[1][4]], 10, 90) - end - if fields[2][4] ~= nil then - if mountBitmaps[1 + fields[2][4]] == nil then - mountBitmaps[1 + fields[2][4]] = Bitmap.open(mountBitmapsFile[1 + fields[2][4]]) - end - lcd.drawBitmap(mountBitmaps[1 + fields[2][4]], 190, 110) - end - return result -end - -local function runSettingsPage(event) - fields = settingsFields - return runFieldsPage(event) -end - --- Init -local function init() - current, edit, refreshState, refreshIndex = 1, false, 0, 0 - pages = { - runConfigPage, - runSettingsPage, - } -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_PAGE_BREAK or event == EVT_PAGEDN_FIRST then - selectPage(1) - elseif event == EVT_PAGE_LONG or event == EVT_PAGEUP_FIRST then - killEvents(event); - selectPage(-1) - end - - local result = pages[page](event) - refreshNext() - - return result -end - -return { init=init, run=run } diff --git a/radio/sdcard/nv14/SxR/SxR_Calibrate.lua b/radio/sdcard/nv14/SxR/SxR_Calibrate.lua deleted file mode 100755 index ac2c6e9ea..000000000 --- a/radio/sdcard/nv14/SxR/SxR_Calibrate.lua +++ /dev/null @@ -1,357 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### -local VALUE = 0 -local COMBO = 1 - -local COLUMN_2 = 300 - -local edit = false -local page = 1 -local current = 1 -local refreshState = 0 -local refreshIndex = 0 -local calibrationState = 0 -local pageOffset = 0 -local calibrationStep = 0 -local pages = {} -local fields = {} -local modifications = {} -local wingBitmaps = {} -local mountBitmaps = {} -local calibBitmaps = {} - -local configFields = { - {"Wing type:", COMBO, 0x80, nil, { "Normal", "Delta", "VTail" } }, - {"Mounting type:", COMBO, 0x81, nil, { "Horz", "Horz rev.", "Vert", "Vert rev." } }, -} -local calibrationPositions = { "up", "down", "left", "right", "forward", "back" } -local wingBitmapsFile = {"img/plane_b.png", "img/delta_b.png", "img/planev_b.png"} -local mountBitmapsFile = {"img/up.png", "img/down.png", "img/vert.png", "img/vert-r.png"} -local calibBitmapsFile = {"img/up.png", "img/down.png", "img/left.png", "img/right.png", "img/forward.png", "img/back.png"} - -local settingsFields = { - {"SxR functions:", COMBO, 0x9C, nil, { "Disable", "Enable" } }, - {"CH5 mode:", COMBO, 0xA8, nil, { "AIL2", "AUX1" } }, - {"CH6 mode:", COMBO, 0xA9, nil, { "ELE2", "AUX2" } }, - {"AIL direction:", COMBO, 0x82, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"ELE direction:", COMBO, 0x83, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"RUD direction:", COMBO, 0x84, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"AIL2 direction:", COMBO, 0x9A, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"ELE2 direction:", COMBO, 0x9B, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"AIL stabilize gain:", VALUE, 0x85, nil, 0, 200, "%"}, - {"ELE stabilize gain:", VALUE, 0x86, nil, 0, 200, "%"}, - {"RUD stabilize gain:", VALUE, 0x87, nil, 0, 200, "%"}, - {"AIL auto level gain:", VALUE, 0x88, nil, 0, 200, "%"}, - {"ELE auto level gain:", VALUE, 0x89, nil, 0, 200, "%"}, - {"ELE upright gain:", VALUE, 0x8C, nil, 0, 200, "%"}, - {"RUD upright gain:", VALUE, 0x8D, nil, 0, 200, "%"}, - {"AIL crab gain:", VALUE, 0x8E, nil, 0, 200, "%"}, - {"RUD crab gain:", VALUE, 0x90, nil, 0, 200, "%"}, - {"AIL auto angle offset:", VALUE, 0x91, nil, -20, 20, "%", 0x6C}, - {"ELE auto angle offset:", VALUE, 0x92, nil, -20, 20, "%", 0x6C}, - {"ELE upright angle offset:", VALUE, 0x95, nil, -20, 20, "%", 0x6C}, - {"RUD upright angle offset:", VALUE, 0x96, nil, -20, 20, "%", 0x6C}, - {"AIL crab angle offset:", VALUE, 0x97, nil, -20, 20, "%", 0x6C}, - {"RUD crab angle offset:", VALUE, 0x99, nil, -20, 20, "%", 0x6C}, -} - -local calibrationFields = { - {"X:", VALUE, 0x9E, 0, -100, 100, "%"}, - {"Y:", VALUE, 0x9F, 0, -100, 100, "%"}, - {"Z:", VALUE, 0xA0, 0, -100, 100, "%"} -} - -local function drawScreenTitle(title,page, pages) - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, title, MENU_COLOR) - lcd.drawText(LCD_W-40, 5, page.."/"..pages, MENU_COLOR) -end - --- Change display attribute to current field -local function addField(step) - local field = fields[current] - local min, max - if field[2] == VALUE then - min = field[5] - max = field[6] - elseif field[2] == COMBO then - min = 0 - max = #(field[5]) - 1 - end - if (step < 0 and field[4] > min) or (step > 0 and field[4] < max) then - field[4] = field[4] + step - end -end - --- Select the next or previous page -local function selectPage(step) - page = 1 + ((page + step - 1 + #pages) % #pages) - refreshIndex = 0 - calibrationStep = 0 - pageOffset = 0 -end - --- Select the next or previous editable field -local function selectField(step) - current = 1 + ((current + step - 1 + #fields) % #fields) - if current > 7 + pageOffset then - pageOffset = current - 7 - elseif current <= pageOffset then - pageOffset = current - 1 - end -end - -local function drawProgressBar() - local width = (300 * refreshIndex) / #fields - lcd.drawRectangle(100, 10, 300, 6) - lcd.drawFilledRectangle(102, 13, width, 2); -end - --- Redraw the current page -local function redrawFieldsPage(event) - lcd.clear() - drawScreenTitle("SxR", page, #pages) - - if refreshIndex < #fields then - drawProgressBar() - end - - for index = 1, 10, 1 do - local field = fields[pageOffset+index] - if field == nil then - break - end - - local attr = current == (pageOffset+index) and ((edit == true and BLINK or 0) + INVERS) or 0 - attr = attr + DEFAULT_COLOR - - lcd.drawText(1, 30+20*index, field[1], DEFAULT_COLOR) - - if field[4] == nil then - lcd.drawText(COLUMN_2, 30+20*index, "---", attr) - else - if field[2] == VALUE then - lcd.drawNumber(COLUMN_2, 30+20*index, field[4], LEFT + attr) - elseif field[2] == COMBO then - if field[4] >= 0 and field[4] < #(field[5]) then - lcd.drawText(COLUMN_2, 30+20*index, field[5][1+field[4]], attr) - end - end - end - end -end - -local function telemetryRead(field) - return sportTelemetryPush(0x17, 0x30, 0x0C30, field) -end - -local function telemetryWrite(field, value) - return sportTelemetryPush(0x17, 0x31, 0x0C30, field + value*256) -end - -local telemetryPopTimeout = 0 -local function refreshNext() - if refreshState == 0 then - if calibrationState == 1 then - if telemetryWrite(0x9D, calibrationStep) == true then - refreshState = 1 - calibrationState = 2 - telemetryPopTimeout = getTime() + 80 -- normal delay is 500ms - end - elseif #modifications > 0 then - telemetryWrite(modifications[1][1], modifications[1][2]) - modifications[1] = nil - elseif refreshIndex < #fields then - local field = fields[refreshIndex + 1] - if telemetryRead(field[3]) == true then - refreshState = 1 - telemetryPopTimeout = getTime() + 80 -- normal delay is 500ms - end - end - elseif refreshState == 1 then - local physicalId, primId, dataId, value = sportTelemetryPop() - if physicalId == 0x1A and primId == 0x32 and dataId == 0x0C30 then - local fieldId = value % 256 - if calibrationState == 2 then - if fieldId == 0x9D then - refreshState = 0 - calibrationState = 0 - calibrationStep = (calibrationStep + 1) % 7 - end - else - local field = fields[refreshIndex + 1] - if fieldId == field[3] then - local value = math.floor(value / 256) - value = bit32.band(value, 0xffff) - if field[3] >= 0x9E and field[3] <= 0xA0 then - local b1 = value % 256 - local b2 = math.floor(value / 256) - value = b1*256 + b2 - value = value - bit32.band(value, 0x8000) * 2 - end - if field[2] == COMBO and #field == 6 then - for index = 1, #(field[6]), 1 do - if value == field[6][index] then - value = index - 1 - break - end - end - elseif field[2] == VALUE and #field == 8 then - value = value - field[8] + field[5] - end - fields[refreshIndex + 1][4] = value - refreshIndex = refreshIndex + 1 - refreshState = 0 - end - end - elseif getTime() > telemetryPopTimeout then - refreshState = 0 - calibrationState = 0 - end - end -end - -local function updateField(field) - local value = field[4] - if field[2] == COMBO and #field == 6 then - value = field[6][1+value] - elseif field[2] == VALUE and #field == 8 then - value = value + field[8] - field[5] - end - modifications[#modifications+1] = { field[3], value } -end - --- Main -local function runFieldsPage(event) - if event == EVT_EXIT_BREAK then -- exit script - return 2 - elseif event == EVT_ENTER_BREAK or event == EVT_ROT_BREAK then -- toggle editing/selecting current field - if fields[current][4] ~= nil then - edit = not edit - if edit == false then - updateField(fields[current]) - end - end - elseif edit then - if event == EVT_PLUS_FIRST or event == EVT_ROT_RIGHT or event == EVT_PLUS_REPT then - addField(1) - elseif event == EVT_MINUS_FIRST or event == EVT_ROT_LEFT or event == EVT_MINUS_REPT then - addField(-1) - end - else - if event == EVT_MINUS_FIRST or event == EVT_ROT_RIGHT then - selectField(1) - elseif event == EVT_PLUS_FIRST or event == EVT_ROT_LEFT then - selectField(-1) - end - end - redrawFieldsPage(event) - return 0 -end - -local function runConfigPage(event) - fields = configFields - local result = runFieldsPage(event) - if fields[1][4] ~= nil then - if wingBitmaps[1 + fields[1][4]] == nil then - wingBitmaps[1 + fields[1][4]] = Bitmap.open(wingBitmapsFile[1 + fields[1][4]]) - end - lcd.drawBitmap(wingBitmaps[1 + fields[1][4]], 10, 90) - end - if fields[2][4] ~= nil then - if mountBitmaps[1 + fields[2][4]] == nil then - mountBitmaps[1 + fields[2][4]] = Bitmap.open(mountBitmapsFile[1 + fields[2][4]]) - end - lcd.drawBitmap(mountBitmaps[1 + fields[2][4]], 190, 110) - end - return result -end - -local function runSettingsPage(event) - fields = settingsFields - return runFieldsPage(event) -end - -local function runCalibrationPage(event) - fields = calibrationFields - if refreshIndex == #fields then - refreshIndex = 0 - end - lcd.clear() - drawScreenTitle("SxR", page, #pages) - if(calibrationStep < 6) then - local position = calibrationPositions[1 + calibrationStep] - lcd.drawText(100, 50, "Place the SxR in the following position", DEFAULT_COLOR) - if calibBitmaps[calibrationStep + 1] == nil then - calibBitmaps[calibrationStep + 1] = Bitmap.open(calibBitmapsFile[calibrationStep + 1]) - end - lcd.drawBitmap(calibBitmaps[calibrationStep + 1], 200, 70) - for index = 1, 3, 1 do - local field = fields[index] - lcd.drawText(70, 80+20*index, field[1]..":", DEFAULT_COLOR) - lcd.drawNumber(90, 80+20*index, field[4]/10, LEFT+PREC2) - end - - local attr = calibrationState == 0 and INVERS or 0 - lcd.drawText(160, 220, "Press [Enter] when ready", attr) - else - lcd.drawText(160, 50, "Calibration completed", 0) - lcd.drawBitmap(Bitmap.open("img/done.bmp"),200, 100) - lcd.drawText(160, 220, "Press [RTN] when ready", attr) - end - if calibrationStep > 6 and (event == EVT_ENTER_BREAK or event == EVT_EXIT_BREAK) then - return 2 - elseif event == EVT_ENTER_BREAK then - calibrationState = 1 - elseif event == EVT_EXIT_BREAK then - if calibrationStep > 0 then - calibrationStep = 0 - end - end - return 0 - -end - --- Init -local function init() - current, edit, refreshState, refreshIndex = 1, false, 0, 0 - pages = { - -- runConfigPage, - -- runSettingsPage, - runCalibrationPage - } -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_PAGE_BREAK or event == EVT_PAGEDN_FIRST then - selectPage(1) - elseif event == EVT_PAGE_LONG or event == EVT_PAGEUP_FIRST then - killEvents(event); - selectPage(-1) - end - - local result = pages[page](event) - refreshNext() - - return result -end - -return { init=init, run=run } diff --git a/radio/sdcard/nv14/SxR/img/back.png b/radio/sdcard/nv14/SxR/img/back.png deleted file mode 100755 index 2cf3cd699..000000000 Binary files a/radio/sdcard/nv14/SxR/img/back.png and /dev/null differ diff --git a/radio/sdcard/nv14/SxR/img/delta_b.png b/radio/sdcard/nv14/SxR/img/delta_b.png deleted file mode 100755 index 80c0302f9..000000000 Binary files a/radio/sdcard/nv14/SxR/img/delta_b.png and /dev/null differ diff --git a/radio/sdcard/nv14/SxR/img/done.bmp b/radio/sdcard/nv14/SxR/img/done.bmp deleted file mode 100755 index 9ac501398..000000000 Binary files a/radio/sdcard/nv14/SxR/img/done.bmp and /dev/null differ diff --git a/radio/sdcard/nv14/SxR/img/down.png b/radio/sdcard/nv14/SxR/img/down.png deleted file mode 100755 index 8eac8039a..000000000 Binary files a/radio/sdcard/nv14/SxR/img/down.png and /dev/null differ diff --git a/radio/sdcard/nv14/SxR/img/forward.png b/radio/sdcard/nv14/SxR/img/forward.png deleted file mode 100755 index de09680b7..000000000 Binary files a/radio/sdcard/nv14/SxR/img/forward.png and /dev/null differ diff --git a/radio/sdcard/nv14/SxR/img/left.png b/radio/sdcard/nv14/SxR/img/left.png deleted file mode 100755 index 658c9916b..000000000 Binary files a/radio/sdcard/nv14/SxR/img/left.png and /dev/null differ diff --git a/radio/sdcard/nv14/SxR/img/plane_b.png b/radio/sdcard/nv14/SxR/img/plane_b.png deleted file mode 100755 index 37abedc3a..000000000 Binary files a/radio/sdcard/nv14/SxR/img/plane_b.png and /dev/null differ diff --git a/radio/sdcard/nv14/SxR/img/planev_b.png b/radio/sdcard/nv14/SxR/img/planev_b.png deleted file mode 100755 index 4e33f660b..000000000 Binary files a/radio/sdcard/nv14/SxR/img/planev_b.png and /dev/null differ diff --git a/radio/sdcard/nv14/SxR/img/planev_s.png b/radio/sdcard/nv14/SxR/img/planev_s.png deleted file mode 100755 index 48283a290..000000000 Binary files a/radio/sdcard/nv14/SxR/img/planev_s.png and /dev/null differ diff --git a/radio/sdcard/nv14/SxR/img/right.png b/radio/sdcard/nv14/SxR/img/right.png deleted file mode 100755 index 01d555394..000000000 Binary files a/radio/sdcard/nv14/SxR/img/right.png and /dev/null differ diff --git a/radio/sdcard/nv14/SxR/img/up.png b/radio/sdcard/nv14/SxR/img/up.png deleted file mode 100755 index f033aba55..000000000 Binary files a/radio/sdcard/nv14/SxR/img/up.png and /dev/null differ diff --git a/radio/sdcard/nv14/SxR/img/vert-r.png b/radio/sdcard/nv14/SxR/img/vert-r.png deleted file mode 100755 index 7bfc9450c..000000000 Binary files a/radio/sdcard/nv14/SxR/img/vert-r.png and /dev/null differ diff --git a/radio/sdcard/nv14/SxR/img/vert.png b/radio/sdcard/nv14/SxR/img/vert.png deleted file mode 100755 index de09680b7..000000000 Binary files a/radio/sdcard/nv14/SxR/img/vert.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/X10.bmp b/radio/sdcard/nv14/THEMES/Darkblue/X10.bmp deleted file mode 100755 index 24893bad0..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/X10.bmp and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/X10S.bmp b/radio/sdcard/nv14/THEMES/Darkblue/X10S.bmp deleted file mode 100755 index e27932eef..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/X10S.bmp and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/asterisk.bmp b/radio/sdcard/nv14/THEMES/Darkblue/asterisk.bmp deleted file mode 100644 index 3dd3cfef4..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/asterisk.bmp and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/busy.bmp b/radio/sdcard/nv14/THEMES/Darkblue/busy.bmp deleted file mode 100644 index 8e6a8b7f7..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/busy.bmp and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/horus.bmp b/radio/sdcard/nv14/THEMES/Darkblue/horus.bmp deleted file mode 100644 index 98bc631cd..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/horus.bmp and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_currentmenu_bg.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_currentmenu_bg.png deleted file mode 100644 index 715792023..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_currentmenu_bg.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_currentmenu_dot.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_currentmenu_dot.png deleted file mode 100644 index 6f76965a9..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_currentmenu_dot.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_currentmenu_shadow.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_currentmenu_shadow.png deleted file mode 100644 index 97bf6c577..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_currentmenu_shadow.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_edgetx.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_edgetx.png deleted file mode 100644 index 84a7d9782..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_edgetx.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_library.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_library.png deleted file mode 100644 index 237883fc5..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_library.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_menu_model.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_menu_model.png deleted file mode 100644 index 9832267b7..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_menu_model.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_menu_radio.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_menu_radio.png deleted file mode 100644 index 6d93fbccc..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_menu_radio.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_menu_stats.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_menu_stats.png deleted file mode 100644 index ebd482588..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_menu_stats.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_menu_theme.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_menu_theme.png deleted file mode 100644 index 3a9fc15e7..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_menu_theme.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_curves.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_model_curves.png deleted file mode 100644 index 6e1e19e8e..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_curves.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_flight_modes.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_model_flight_modes.png deleted file mode 100644 index e963f0abb..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_flight_modes.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_gvars.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_model_gvars.png deleted file mode 100644 index 0b5015dac..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_gvars.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_heli.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_model_heli.png deleted file mode 100644 index ecd93d2ff..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_heli.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_inputs.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_model_inputs.png deleted file mode 100644 index 720099c47..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_inputs.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_logical_switches.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_model_logical_switches.png deleted file mode 100644 index 5cd1e3834..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_logical_switches.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_lua_scripts.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_model_lua_scripts.png deleted file mode 100644 index a20c1ccbd..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_lua_scripts.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_mixer.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_model_mixer.png deleted file mode 100644 index 009b360f1..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_mixer.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_outputs.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_model_outputs.png deleted file mode 100644 index a209ae8d3..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_outputs.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_setup.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_model_setup.png deleted file mode 100644 index afe526c8f..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_setup.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_special_functions.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_model_special_functions.png deleted file mode 100644 index a12a2a50d..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_special_functions.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_telemetry.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_model_telemetry.png deleted file mode 100644 index d95d3b25f..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_model_telemetry.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor.png deleted file mode 100644 index 68ddd4516..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_channels1.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_channels1.png deleted file mode 100644 index b886fc1bc..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_channels1.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_channels2.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_channels2.png deleted file mode 100644 index 4d0354e25..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_channels2.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_channels3.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_channels3.png deleted file mode 100644 index d9ba27de7..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_channels3.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_channels4.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_channels4.png deleted file mode 100644 index fb321151f..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_channels4.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_gvars.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_gvars.png deleted file mode 100644 index 55b488d1e..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_gvars.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_inver.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_inver.png deleted file mode 100644 index 64f251238..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_inver.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_lockch.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_lockch.png deleted file mode 100644 index 360923a09..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_lockch.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_logsw.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_logsw.png deleted file mode 100644 index dc6355143..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_logsw.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_mixes1.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_mixes1.png deleted file mode 100644 index 7b0c71f60..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_mixes1.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_mixes2.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_mixes2.png deleted file mode 100644 index f8c04780e..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_monitor_mixes2.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_mplex_add.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_mplex_add.png deleted file mode 100644 index 14f4ecc23..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_mplex_add.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_mplex_multi.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_mplex_multi.png deleted file mode 100644 index bcf79695f..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_mplex_multi.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_mplex_replace.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_mplex_replace.png deleted file mode 100644 index faccba0ea..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_mplex_replace.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_opentx.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_opentx.png deleted file mode 100644 index df2b0b356..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_opentx.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_opentx_testmode.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_opentx_testmode.png deleted file mode 100644 index b535cf8ee..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_opentx_testmode.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_calibration.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_calibration.png deleted file mode 100644 index db696778b..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_calibration.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_global_functions.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_global_functions.png deleted file mode 100644 index 3b3efefb5..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_global_functions.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_hardware.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_hardware.png deleted file mode 100644 index f51a1aee1..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_hardware.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_sd_browser.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_sd_browser.png deleted file mode 100644 index 75b6a9296..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_sd_browser.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_setup.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_setup.png deleted file mode 100644 index 0010a06ab..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_setup.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_tools.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_tools.png deleted file mode 100755 index 711d499de..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_tools.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_trainer.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_trainer.png deleted file mode 100644 index 7a0b56970..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_trainer.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_version.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_version.png deleted file mode 100644 index 8730f6c1a..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_radio_version.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_sbar_mixer.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_sbar_mixer.png deleted file mode 100644 index 154406419..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_sbar_mixer.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_sbar_output.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_sbar_output.png deleted file mode 100644 index 12d599823..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_sbar_output.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_sbar_to.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_sbar_to.png deleted file mode 100644 index 813610307..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_sbar_to.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_stats_analogs.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_stats_analogs.png deleted file mode 100644 index 96fc0c8a2..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_stats_analogs.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_stats_debug.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_stats_debug.png deleted file mode 100644 index 0dce13d46..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_stats_debug.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_stats_lua.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_stats_lua.png deleted file mode 100644 index d1b54a4d6..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_stats_lua.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_stats_throttle_graph.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_stats_throttle_graph.png deleted file mode 100644 index a3720a005..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_stats_throttle_graph.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_stats_timers.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_stats_timers.png deleted file mode 100644 index 78bf00064..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_stats_timers.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_stats_value.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_stats_value.png deleted file mode 100644 index 180f16e8c..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_stats_value.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_switches.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_switches.png deleted file mode 100644 index 4097ed751..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_switches.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_textline_curve.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_textline_curve.png deleted file mode 100644 index 050229393..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_textline_curve.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_textline_delay.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_textline_delay.png deleted file mode 100644 index 9b771a94a..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_textline_delay.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_textline_delayslow.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_textline_delayslow.png deleted file mode 100644 index de2f7d1f7..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_textline_delayslow.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_textline_fm.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_textline_fm.png deleted file mode 100644 index b9a2c4a32..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_textline_fm.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_textline_label.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_textline_label.png deleted file mode 100644 index 8be12e39b..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_textline_label.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_textline_slow.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_textline_slow.png deleted file mode 100644 index 1afbea37d..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_textline_slow.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_textline_switch.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_textline_switch.png deleted file mode 100644 index 7c7d646e4..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_textline_switch.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_add_view.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_add_view.png deleted file mode 100644 index 7e240372f..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_add_view.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_setup.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_setup.png deleted file mode 100644 index 2a39d1e40..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_setup.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view1.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view1.png deleted file mode 100644 index 9e67515ec..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view1.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view2.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view2.png deleted file mode 100644 index 45cec234d..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view2.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view3.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view3.png deleted file mode 100644 index e5a776b06..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view3.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view4.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view4.png deleted file mode 100644 index 9064b9403..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view4.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view5.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view5.png deleted file mode 100644 index 724bcc141..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view5.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view6.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view6.png deleted file mode 100644 index 2aa43514b..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view6.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view7.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view7.png deleted file mode 100644 index d6a0540f5..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view7.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view8.png b/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view8.png deleted file mode 100644 index 82dfd7875..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/mask_theme_view8.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/icon_boat1.png b/radio/sdcard/nv14/THEMES/Darkblue/modelsel/icon_boat1.png deleted file mode 100644 index a9335c4bc..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/icon_boat1.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/icon_boat2.png b/radio/sdcard/nv14/THEMES/Darkblue/modelsel/icon_boat2.png deleted file mode 100644 index e3c899d18..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/icon_boat2.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/icon_default.png b/radio/sdcard/nv14/THEMES/Darkblue/modelsel/icon_default.png deleted file mode 100644 index 6f3042c67..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/icon_default.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/icon_favorites.png b/radio/sdcard/nv14/THEMES/Darkblue/modelsel/icon_favorites.png deleted file mode 100644 index e4a37dacb..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/icon_favorites.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/icon_plane1.png b/radio/sdcard/nv14/THEMES/Darkblue/modelsel/icon_plane1.png deleted file mode 100644 index a49a50271..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/icon_plane1.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/icon_plane2.png b/radio/sdcard/nv14/THEMES/Darkblue/modelsel/icon_plane2.png deleted file mode 100644 index 8305b4150..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/icon_plane2.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/icon_plane3.png b/radio/sdcard/nv14/THEMES/Darkblue/modelsel/icon_plane3.png deleted file mode 100644 index d998144b2..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/icon_plane3.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/mask_iconback.png b/radio/sdcard/nv14/THEMES/Darkblue/modelsel/mask_iconback.png deleted file mode 100644 index 966f6b7f2..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/mask_iconback.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/mask_modelname.png b/radio/sdcard/nv14/THEMES/Darkblue/modelsel/mask_modelname.png deleted file mode 100644 index 2edca73ea..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/mask_modelname.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/mask_modelqty.png b/radio/sdcard/nv14/THEMES/Darkblue/modelsel/mask_modelqty.png deleted file mode 100644 index 9a38e4f13..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/mask_modelqty.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/mask_moveback.png b/radio/sdcard/nv14/THEMES/Darkblue/modelsel/mask_moveback.png deleted file mode 100644 index 63f56df92..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/mask_moveback.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/mask_moveico.png b/radio/sdcard/nv14/THEMES/Darkblue/modelsel/mask_moveico.png deleted file mode 100644 index 3662b9bb0..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/mask_moveico.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/mask_sdfree.png b/radio/sdcard/nv14/THEMES/Darkblue/modelsel/mask_sdfree.png deleted file mode 100644 index f0ae81982..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/modelsel/mask_sdfree.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/question.bmp b/radio/sdcard/nv14/THEMES/Darkblue/question.bmp deleted file mode 100644 index 101d7ed53..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/question.bmp and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/stick_background.png b/radio/sdcard/nv14/THEMES/Darkblue/stick_background.png deleted file mode 100644 index 9f6d53d92..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/stick_background.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/stick_pointer.png b/radio/sdcard/nv14/THEMES/Darkblue/stick_pointer.png deleted file mode 100644 index 0d75765f9..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/stick_pointer.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/thumb.bmp b/radio/sdcard/nv14/THEMES/Darkblue/thumb.bmp deleted file mode 100644 index af5de373e..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/thumb.bmp and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/topleft.png b/radio/sdcard/nv14/THEMES/Darkblue/topleft.png deleted file mode 100644 index 603bfe1cf..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/topleft.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/topmenu_opentx.bmp b/radio/sdcard/nv14/THEMES/Darkblue/topmenu_opentx.bmp deleted file mode 100644 index cbc7f8149..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/topmenu_opentx.bmp and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/trackp_background.png b/radio/sdcard/nv14/THEMES/Darkblue/trackp_background.png deleted file mode 100644 index 5beada59e..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/trackp_background.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/wizard/background.png b/radio/sdcard/nv14/THEMES/Darkblue/wizard/background.png deleted file mode 100644 index 6b31b2914..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/wizard/background.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/wizard/itembg.png b/radio/sdcard/nv14/THEMES/Darkblue/wizard/itembg.png deleted file mode 100644 index b899446b2..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/wizard/itembg.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/wizard/pgdn.png b/radio/sdcard/nv14/THEMES/Darkblue/wizard/pgdn.png deleted file mode 100644 index 6a1377620..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/wizard/pgdn.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/Darkblue/wizard/pgup.png b/radio/sdcard/nv14/THEMES/Darkblue/wizard/pgup.png deleted file mode 100644 index 06fab5cac..000000000 Binary files a/radio/sdcard/nv14/THEMES/Darkblue/wizard/pgup.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/NV14.bmp b/radio/sdcard/nv14/THEMES/FlySky/NV14.bmp deleted file mode 100644 index 4d64ac89e..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/NV14.bmp and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/X10.bmp b/radio/sdcard/nv14/THEMES/FlySky/X10.bmp deleted file mode 100755 index 32a730cde..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/X10.bmp and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/X10S.bmp b/radio/sdcard/nv14/THEMES/FlySky/X10S.bmp deleted file mode 100755 index 221e25ec4..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/X10S.bmp and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/asterisk.bmp b/radio/sdcard/nv14/THEMES/FlySky/asterisk.bmp deleted file mode 100644 index 411c60c5d..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/asterisk.bmp and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/background.png b/radio/sdcard/nv14/THEMES/FlySky/background.png deleted file mode 100644 index 09b2dcc08..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/background.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/busy.bmp b/radio/sdcard/nv14/THEMES/FlySky/busy.bmp deleted file mode 100644 index d68df82e4..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/busy.bmp and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/horus.bmp b/radio/sdcard/nv14/THEMES/FlySky/horus.bmp deleted file mode 100644 index 98bc631cd..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/horus.bmp and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_back.png b/radio/sdcard/nv14/THEMES/FlySky/mask_back.png deleted file mode 100755 index ffd31b820..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_back.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_currentmenu_bg.png b/radio/sdcard/nv14/THEMES/FlySky/mask_currentmenu_bg.png deleted file mode 100644 index 715792023..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_currentmenu_bg.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_currentmenu_dot.png b/radio/sdcard/nv14/THEMES/FlySky/mask_currentmenu_dot.png deleted file mode 100644 index 6f76965a9..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_currentmenu_dot.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_currentmenu_shadow.png b/radio/sdcard/nv14/THEMES/FlySky/mask_currentmenu_shadow.png deleted file mode 100644 index 97bf6c577..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_currentmenu_shadow.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_edgetx.png b/radio/sdcard/nv14/THEMES/FlySky/mask_edgetx.png deleted file mode 100644 index 84a7d9782..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_edgetx.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_menu_model.png b/radio/sdcard/nv14/THEMES/FlySky/mask_menu_model.png deleted file mode 100644 index 49c390c93..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_menu_model.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_menu_radio.png b/radio/sdcard/nv14/THEMES/FlySky/mask_menu_radio.png deleted file mode 100644 index 3b67ac8d4..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_menu_radio.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_menu_stats.png b/radio/sdcard/nv14/THEMES/FlySky/mask_menu_stats.png deleted file mode 100644 index ebd482588..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_menu_stats.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_menu_theme.png b/radio/sdcard/nv14/THEMES/FlySky/mask_menu_theme.png deleted file mode 100644 index 3a9fc15e7..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_menu_theme.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_model_curves.png b/radio/sdcard/nv14/THEMES/FlySky/mask_model_curves.png deleted file mode 100644 index 6e1e19e8e..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_model_curves.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_model_flight_modes.png b/radio/sdcard/nv14/THEMES/FlySky/mask_model_flight_modes.png deleted file mode 100644 index e963f0abb..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_model_flight_modes.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_model_gvars.png b/radio/sdcard/nv14/THEMES/FlySky/mask_model_gvars.png deleted file mode 100644 index 0b5015dac..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_model_gvars.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_model_heli.png b/radio/sdcard/nv14/THEMES/FlySky/mask_model_heli.png deleted file mode 100644 index ecd93d2ff..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_model_heli.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_model_inputs.png b/radio/sdcard/nv14/THEMES/FlySky/mask_model_inputs.png deleted file mode 100644 index 720099c47..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_model_inputs.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_model_logical_switches.png b/radio/sdcard/nv14/THEMES/FlySky/mask_model_logical_switches.png deleted file mode 100644 index 5cd1e3834..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_model_logical_switches.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_model_lua_scripts.png b/radio/sdcard/nv14/THEMES/FlySky/mask_model_lua_scripts.png deleted file mode 100644 index a20c1ccbd..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_model_lua_scripts.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_model_mixer.png b/radio/sdcard/nv14/THEMES/FlySky/mask_model_mixer.png deleted file mode 100644 index 009b360f1..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_model_mixer.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_model_outputs.png b/radio/sdcard/nv14/THEMES/FlySky/mask_model_outputs.png deleted file mode 100644 index a209ae8d3..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_model_outputs.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_model_setup.png b/radio/sdcard/nv14/THEMES/FlySky/mask_model_setup.png deleted file mode 100644 index afe526c8f..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_model_setup.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_model_special_functions.png b/radio/sdcard/nv14/THEMES/FlySky/mask_model_special_functions.png deleted file mode 100644 index a12a2a50d..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_model_special_functions.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_model_telemetry.png b/radio/sdcard/nv14/THEMES/FlySky/mask_model_telemetry.png deleted file mode 100644 index d95d3b25f..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_model_telemetry.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_modelselect.png b/radio/sdcard/nv14/THEMES/FlySky/mask_modelselect.png deleted file mode 100644 index 237883fc5..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_modelselect.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_monitor.png b/radio/sdcard/nv14/THEMES/FlySky/mask_monitor.png deleted file mode 100644 index 68ddd4516..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_monitor.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_channels1.png b/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_channels1.png deleted file mode 100644 index b886fc1bc..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_channels1.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_channels2.png b/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_channels2.png deleted file mode 100644 index 4d0354e25..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_channels2.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_channels3.png b/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_channels3.png deleted file mode 100644 index d9ba27de7..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_channels3.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_channels4.png b/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_channels4.png deleted file mode 100644 index fb321151f..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_channels4.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_gvars.png b/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_gvars.png deleted file mode 100644 index 55b488d1e..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_gvars.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_inver.png b/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_inver.png deleted file mode 100644 index 64f251238..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_inver.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_lockch.png b/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_lockch.png deleted file mode 100644 index 360923a09..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_lockch.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_logsw.png b/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_logsw.png deleted file mode 100644 index dc6355143..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_logsw.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_mixes1.png b/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_mixes1.png deleted file mode 100644 index 7b0c71f60..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_mixes1.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_mixes2.png b/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_mixes2.png deleted file mode 100644 index f8c04780e..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_monitor_mixes2.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_mplex_add.png b/radio/sdcard/nv14/THEMES/FlySky/mask_mplex_add.png deleted file mode 100644 index 14f4ecc23..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_mplex_add.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_mplex_multi.png b/radio/sdcard/nv14/THEMES/FlySky/mask_mplex_multi.png deleted file mode 100644 index bcf79695f..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_mplex_multi.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_mplex_replace.png b/radio/sdcard/nv14/THEMES/FlySky/mask_mplex_replace.png deleted file mode 100644 index faccba0ea..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_mplex_replace.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_next.png b/radio/sdcard/nv14/THEMES/FlySky/mask_next.png deleted file mode 100644 index 848019e8e..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_next.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_opentx.png b/radio/sdcard/nv14/THEMES/FlySky/mask_opentx.png deleted file mode 100644 index df2b0b356..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_opentx.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_opentx_testmode.png b/radio/sdcard/nv14/THEMES/FlySky/mask_opentx_testmode.png deleted file mode 100644 index b535cf8ee..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_opentx_testmode.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_radio_calibration.png b/radio/sdcard/nv14/THEMES/FlySky/mask_radio_calibration.png deleted file mode 100644 index db696778b..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_radio_calibration.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_radio_global_functions.png b/radio/sdcard/nv14/THEMES/FlySky/mask_radio_global_functions.png deleted file mode 100644 index 3b3efefb5..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_radio_global_functions.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_radio_hardware.png b/radio/sdcard/nv14/THEMES/FlySky/mask_radio_hardware.png deleted file mode 100644 index f51a1aee1..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_radio_hardware.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_radio_sd_browser.png b/radio/sdcard/nv14/THEMES/FlySky/mask_radio_sd_browser.png deleted file mode 100644 index 75b6a9296..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_radio_sd_browser.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_radio_setup.png b/radio/sdcard/nv14/THEMES/FlySky/mask_radio_setup.png deleted file mode 100644 index 0010a06ab..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_radio_setup.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_radio_tools.png b/radio/sdcard/nv14/THEMES/FlySky/mask_radio_tools.png deleted file mode 100755 index 711d499de..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_radio_tools.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_radio_trainer.png b/radio/sdcard/nv14/THEMES/FlySky/mask_radio_trainer.png deleted file mode 100644 index 7a0b56970..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_radio_trainer.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_radio_version.png b/radio/sdcard/nv14/THEMES/FlySky/mask_radio_version.png deleted file mode 100644 index 8730f6c1a..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_radio_version.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_sbar_mixer.png b/radio/sdcard/nv14/THEMES/FlySky/mask_sbar_mixer.png deleted file mode 100644 index 154406419..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_sbar_mixer.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_sbar_output.png b/radio/sdcard/nv14/THEMES/FlySky/mask_sbar_output.png deleted file mode 100644 index 12d599823..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_sbar_output.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_sbar_to.png b/radio/sdcard/nv14/THEMES/FlySky/mask_sbar_to.png deleted file mode 100644 index 813610307..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_sbar_to.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_shutdown_circle.png b/radio/sdcard/nv14/THEMES/FlySky/mask_shutdown_circle.png deleted file mode 100644 index 465ead89b..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_shutdown_circle.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_stats_analogs.png b/radio/sdcard/nv14/THEMES/FlySky/mask_stats_analogs.png deleted file mode 100644 index 96fc0c8a2..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_stats_analogs.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_stats_debug.png b/radio/sdcard/nv14/THEMES/FlySky/mask_stats_debug.png deleted file mode 100644 index 0dce13d46..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_stats_debug.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_stats_lua.png b/radio/sdcard/nv14/THEMES/FlySky/mask_stats_lua.png deleted file mode 100644 index d1b54a4d6..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_stats_lua.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_stats_throttle_graph.png b/radio/sdcard/nv14/THEMES/FlySky/mask_stats_throttle_graph.png deleted file mode 100644 index a3720a005..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_stats_throttle_graph.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_stats_timers.png b/radio/sdcard/nv14/THEMES/FlySky/mask_stats_timers.png deleted file mode 100644 index 78bf00064..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_stats_timers.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_stats_value.png b/radio/sdcard/nv14/THEMES/FlySky/mask_stats_value.png deleted file mode 100644 index 180f16e8c..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_stats_value.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_switches.png b/radio/sdcard/nv14/THEMES/FlySky/mask_switches.png deleted file mode 100644 index 4097ed751..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_switches.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_textline_curve.png b/radio/sdcard/nv14/THEMES/FlySky/mask_textline_curve.png deleted file mode 100644 index 050229393..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_textline_curve.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_textline_delay.png b/radio/sdcard/nv14/THEMES/FlySky/mask_textline_delay.png deleted file mode 100644 index 9b771a94a..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_textline_delay.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_textline_delayslow.png b/radio/sdcard/nv14/THEMES/FlySky/mask_textline_delayslow.png deleted file mode 100644 index de2f7d1f7..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_textline_delayslow.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_textline_fm.png b/radio/sdcard/nv14/THEMES/FlySky/mask_textline_fm.png deleted file mode 100644 index b9a2c4a32..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_textline_fm.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_textline_label.png b/radio/sdcard/nv14/THEMES/FlySky/mask_textline_label.png deleted file mode 100644 index 8be12e39b..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_textline_label.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_textline_slow.png b/radio/sdcard/nv14/THEMES/FlySky/mask_textline_slow.png deleted file mode 100644 index 1afbea37d..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_textline_slow.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_textline_switch.png b/radio/sdcard/nv14/THEMES/FlySky/mask_textline_switch.png deleted file mode 100644 index 7c7d646e4..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_textline_switch.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_theme_add_view.png b/radio/sdcard/nv14/THEMES/FlySky/mask_theme_add_view.png deleted file mode 100644 index 7e240372f..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_theme_add_view.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_theme_setup.png b/radio/sdcard/nv14/THEMES/FlySky/mask_theme_setup.png deleted file mode 100644 index 2a39d1e40..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_theme_setup.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view1.png b/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view1.png deleted file mode 100644 index 9e67515ec..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view1.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view2.png b/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view2.png deleted file mode 100644 index 45cec234d..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view2.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view3.png b/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view3.png deleted file mode 100644 index e5a776b06..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view3.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view4.png b/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view4.png deleted file mode 100644 index 9064b9403..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view4.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view5.png b/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view5.png deleted file mode 100644 index 724bcc141..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view5.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view6.png b/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view6.png deleted file mode 100644 index 2aa43514b..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view6.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view7.png b/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view7.png deleted file mode 100644 index d6a0540f5..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view7.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view8.png b/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view8.png deleted file mode 100644 index 82dfd7875..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_theme_view8.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_timer.png b/radio/sdcard/nv14/THEMES/FlySky/mask_timer.png deleted file mode 100644 index 7038d41c8..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_timer.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/mask_timer_bg.png b/radio/sdcard/nv14/THEMES/FlySky/mask_timer_bg.png deleted file mode 100644 index e8d000e78..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/mask_timer_bg.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/modelsel/icon_boat1.png b/radio/sdcard/nv14/THEMES/FlySky/modelsel/icon_boat1.png deleted file mode 100644 index a9335c4bc..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/modelsel/icon_boat1.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/modelsel/icon_boat2.png b/radio/sdcard/nv14/THEMES/FlySky/modelsel/icon_boat2.png deleted file mode 100644 index e3c899d18..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/modelsel/icon_boat2.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/modelsel/icon_default.png b/radio/sdcard/nv14/THEMES/FlySky/modelsel/icon_default.png deleted file mode 100644 index 6f3042c67..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/modelsel/icon_default.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/modelsel/icon_favorites.png b/radio/sdcard/nv14/THEMES/FlySky/modelsel/icon_favorites.png deleted file mode 100644 index e4a37dacb..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/modelsel/icon_favorites.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/modelsel/icon_plane1.png b/radio/sdcard/nv14/THEMES/FlySky/modelsel/icon_plane1.png deleted file mode 100644 index a49a50271..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/modelsel/icon_plane1.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/modelsel/icon_plane2.png b/radio/sdcard/nv14/THEMES/FlySky/modelsel/icon_plane2.png deleted file mode 100644 index 8305b4150..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/modelsel/icon_plane2.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/modelsel/icon_plane3.png b/radio/sdcard/nv14/THEMES/FlySky/modelsel/icon_plane3.png deleted file mode 100644 index d998144b2..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/modelsel/icon_plane3.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/modelsel/mask_iconback.png b/radio/sdcard/nv14/THEMES/FlySky/modelsel/mask_iconback.png deleted file mode 100644 index 6f19c3ee0..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/modelsel/mask_iconback.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/modelsel/mask_modelname.png b/radio/sdcard/nv14/THEMES/FlySky/modelsel/mask_modelname.png deleted file mode 100644 index 2edca73ea..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/modelsel/mask_modelname.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/modelsel/mask_modelqty.png b/radio/sdcard/nv14/THEMES/FlySky/modelsel/mask_modelqty.png deleted file mode 100644 index 9a38e4f13..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/modelsel/mask_modelqty.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/modelsel/mask_moveback.png b/radio/sdcard/nv14/THEMES/FlySky/modelsel/mask_moveback.png deleted file mode 100644 index 63f56df92..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/modelsel/mask_moveback.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/modelsel/mask_moveico.png b/radio/sdcard/nv14/THEMES/FlySky/modelsel/mask_moveico.png deleted file mode 100644 index 3662b9bb0..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/modelsel/mask_moveico.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/modelsel/mask_sdfree.png b/radio/sdcard/nv14/THEMES/FlySky/modelsel/mask_sdfree.png deleted file mode 100644 index f0ae81982..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/modelsel/mask_sdfree.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/question.bmp b/radio/sdcard/nv14/THEMES/FlySky/question.bmp deleted file mode 100644 index 79792574b..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/question.bmp and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/shutdown.bmp b/radio/sdcard/nv14/THEMES/FlySky/shutdown.bmp deleted file mode 100644 index be7034db7..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/shutdown.bmp and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/sleep.bmp b/radio/sdcard/nv14/THEMES/FlySky/sleep.bmp deleted file mode 100644 index 279a9b855..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/sleep.bmp and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/stick_background.png b/radio/sdcard/nv14/THEMES/FlySky/stick_background.png deleted file mode 100644 index 9f6d53d92..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/stick_background.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/stick_pointer.png b/radio/sdcard/nv14/THEMES/FlySky/stick_pointer.png deleted file mode 100644 index 0d75765f9..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/stick_pointer.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/thumb.bmp b/radio/sdcard/nv14/THEMES/FlySky/thumb.bmp deleted file mode 100644 index 37de4998e..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/thumb.bmp and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/topleft.png b/radio/sdcard/nv14/THEMES/FlySky/topleft.png deleted file mode 100644 index 603bfe1cf..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/topleft.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/trackp_background.png b/radio/sdcard/nv14/THEMES/FlySky/trackp_background.png deleted file mode 100644 index 5beada59e..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/trackp_background.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/wizard/background.png b/radio/sdcard/nv14/THEMES/FlySky/wizard/background.png deleted file mode 100644 index 6b31b2914..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/wizard/background.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/wizard/itembg.png b/radio/sdcard/nv14/THEMES/FlySky/wizard/itembg.png deleted file mode 100644 index b899446b2..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/wizard/itembg.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/wizard/pgdn.png b/radio/sdcard/nv14/THEMES/FlySky/wizard/pgdn.png deleted file mode 100644 index 6a1377620..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/wizard/pgdn.png and /dev/null differ diff --git a/radio/sdcard/nv14/THEMES/FlySky/wizard/pgup.png b/radio/sdcard/nv14/THEMES/FlySky/wizard/pgup.png deleted file mode 100644 index 06fab5cac..000000000 Binary files a/radio/sdcard/nv14/THEMES/FlySky/wizard/pgup.png and /dev/null differ diff --git a/radio/sdcard/nv14/WIDGETS/BattCheck/main.lua b/radio/sdcard/nv14/WIDGETS/BattCheck/main.lua deleted file mode 100755 index 11edfe67d..000000000 --- a/radio/sdcard/nv14/WIDGETS/BattCheck/main.lua +++ /dev/null @@ -1,401 +0,0 @@ ----- ######################################################################### ----- # # ----- # Telemetry Widget script for FrSky Horus # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - -local shadowed = 0 - -local options = { - { "Sensor", SOURCE, 0 }, - { "Color", COLOR, WHITE }, - { "Shadow", BOOL, 0 }, - { "LowestCell", BOOL, 0 } -} - --- This function is runned once at the creation of the widget -local function create(zone, options) - local myZone = { zone=zone, options=options, counter=0 } - histCellData = {} - - -- use default if user did not set, So widget is operational when selecting the widget - if myZone.options.Sensor == 0 then - myZone.options.Sensor = "Cels" - end - - return myZone -end - --- This function allow updates when you change widgets settings -local function update(myZone, options) - myZone.options = options - - -- use default if user did not set, So widget is operational when selecting the widget - if myZone.options.Sensor == 0 then - myZone.options.Sensor = "Cels" - end - -end - --- A quick and dirty check for empty table -local function isEmpty(self) - for _, _ in pairs(self) do - return false - end - return true -end - ---- This function returns a table with cels values -local function getCels(sensor) - liveCellData = getValue(sensor) - if type(liveCellData) == "table" then - -- initialize historical table if not done yet - if isEmpty(histCellData) then - for k, v in pairs(liveCellData) do - histCellData[k] = v - end - end - -- this is necessary for simu where cellcount can change - if #histCellData ~= #liveCellData then - for k, v in pairs(liveCellData) do - histCellData[k] = v - end - end - -- stores the lowest cell values in historical table - for k, v in pairs(liveCellData) do - if v < histCellData[k] then histCellData[k] = v end - end - else - -- erase low cell memory when you change lipo - histCellData = {} - end - return liveCellData -end - ---- This function returns the number of cels -local function getCellCount(cellData) - return #cellData -end - ---- This function returns the value of the highest of all cels -local function getCellMax(cellData) - cellMax = 0 - if type(cellData) == "table" then - for k, v in pairs(cellData) do - if v > cellMax then cellMax = v end - end - end - return cellMax -end - ---- This function returns the value of the lowest of all cels -local function getCellMin(cellData) - cellMin = 5 - if type(cellData) == "table" then - for k, v in pairs(cellData) do - if v < cellMin then cellMin = v end - end - end - return cellMin -end - ---- This function return the percentage remaining in a single Lipo cel -local function getCellPercent(cellValue) - if cellValue == nil then - return 0 - end - --## Data gathered from commercial lipo sensors - local myArrayPercentList = -{{3, 0}, {3.093, 1}, {3.196, 2}, {3.301, 3}, {3.401, 4}, {3.477, 5}, {3.544, 6}, {3.601, 7}, {3.637, 8}, {3.664, 9}, {3.679, 10}, {3.683, 11}, {3.689, 12}, {3.692, 13}, {3.705, 14}, {3.71, 15}, {3.713, 16}, {3.715, 17}, {3.72, 18}, {3.731, 19}, {3.735, 20}, {3.744, 21}, {3.753, 22}, {3.756, 23}, {3.758, 24}, {3.762, 25}, {3.767, 26}, {3.774, 27}, {3.78, 28}, {3.783, 29}, {3.786, 30}, {3.789, 31}, {3.794, 32}, {3.797, 33}, {3.8, 34}, {3.802, 35}, {3.805, 36}, {3.808, 37}, {3.811, 38}, {3.815, 39}, {3.818, 40}, {3.822, 41}, {3.825, 42}, {3.829, 43}, {3.833, 44}, {3.836, 45}, {3.84, 46}, {3.843, 47}, {3.847, 48}, {3.85, 49}, {3.854, 50}, {3.857, 51}, {3.86, 52}, {3.863, 53}, {3.866, 54}, {3.87, 55}, {3.874, 56}, {3.879, 57}, {3.888, 58}, {3.893, 59}, {3.897, 60}, {3.902, 61}, {3.906, 62}, {3.911, 63}, {3.918, 64}, {3.923, 65}, {3.928, 66}, {3.939, 67}, {3.943, 68}, {3.949, 69}, {3.955, 70}, {3.961, 71}, {3.968, 72}, {3.974, 73}, {3.981, 74}, {3.987, 75}, {3.994, 76}, {4.001, 77}, {4.007, 78}, {4.014, 79}, {4.021, 80}, {4.029, 81}, {4.036, 82}, {4.044, 83}, {4.052, 84}, {4.062, 85}, {4.074, 86}, {4.085, 87}, {4.095, 88}, {4.105, 89}, {4.111, 90}, {4.116, 91}, {4.12, 92}, {4.125, 93}, {4.129, 94}, {4.135, 95}, {4.145, 96}, {4.176, 97}, {4.179, 98}, {4.193, 99}, {4.2, 100}} - - for i, v in ipairs( myArrayPercentList ) do - if v[ 1 ] >= cellValue then - result = v[ 2 ] - break - end - end - return result -end - ---- This function parse each individual cell and return the sum of all cels -local function getCellSum(cellData) - cellSum = 0 - if type(cellData) == "table" then - for k, v in pairs(cellData) do cellSum = cellSum + v end - end - return cellSum -end - ---- This function returns the average of all cels -local function getCellAvg(cellData) - if type(cellData) == "table" then - return getCellSum(cellData)/getCellCount(cellData) - end -end - --- This function returns green at 100%, red bellow 30% and graduate in between --- color for battery -local function getPercentColor(cpercent) - if cpercent < 30 then - return lcd.RGB(0xff, 0, 0) - else - g = math.floor(0xdf * cpercent / 100) - r = 0xdf - g - return lcd.RGB(r, g, 0) - end -end - --- This function returns green at gvalue, red at rvalue and graduate in between --- color for cell -local function getRangeColor(value, gvalue, rvalue) - if gvalue > rvalue and not range==0 then - range = gvalue - rvalue - if value > gvalue then return lcd.RGB(0, 0xdf, 0) end - if value < rvalue then return lcd.RGB(0xdf, 0, 0) end - g = math.floor(0xdf * (value-rvalue) / range) - r = 0xdf - g - return lcd.RGB(r, g, 0) - else - range = rvalue - gvalue - if value > gvalue then return lcd.RGB(0, 0xdf, 0) end - if value < rvalue then return lcd.RGB(0xdf, 0, 0) end - r = math.floor(0xdf * (value-gvalue) / range) - g = 0xdf - r - return lcd.RGB(r, g, 0) - end -end - -local function getMainValue(mySensor, options) - if options.LowestCell == 1 then - return getCellMin(mySensor) - else - return getCellSum(mySensor) - end -end - -local function getSecondaryValue(mySensor, options) - if options.LowestCell == 1 then - return getCellSum(mySensor) - else - return getCellMin(mySensor) - end -end - - --- This size is for top bar widgets -local function refreshZoneTiny(zone) - local mySensor = getCels(zone.options.Sensor) - local isHaveData = (type(mySensor) == "table") - if isHaveData then - local myString = string.format("%2.1fV", getMainValue(mySensor, zone.options)) - local percent = getCellPercent(getCellAvg(mySensor)) - lcd.drawText(zone.zone.x + zone.zone.w, zone.zone.y, percent.."%", RIGHT + SMLSIZE + CUSTOM_COLOR) - lcd.drawText(zone.zone.x + zone.zone.w, zone.zone.y + 15, myString, RIGHT + SMLSIZE + CUSTOM_COLOR) - -- draw batt - lcd.drawRectangle(zone.zone.x, zone.zone.y + 6, 16, 25, CUSTOM_COLOR, 2) - lcd.drawFilledRectangle(zone.zone.x + 4, zone.zone.y + 4, 6, 3, CUSTOM_COLOR) - local rect_h = math.floor(25 * percent / 100) - lcd.drawFilledRectangle(zone.zone.x, zone.zone.y + 6 + 25 - rect_h , 16, rect_h, CUSTOM_COLOR) - end -end - ---- Size is 160x32 1/8th -local function refreshZoneSmall(zone) - local myBatt = {["x"]=0, ["y"]=0, ["w"]=155, ["h"]=35, ["segments_w"]=25, ["color"]=WHITE, ["cath_w"]=6, ["cath_h"]=20} - local mySensor = getCels(zone.options.Sensor) - local isDataAvailable = (type(mySensor) == "table") - - local percent = getCellPercent(getCellAvg(mySensor)) - - -- draws bat - lcd.setColor(CUSTOM_COLOR, WHITE) - lcd.drawRectangle(zone.zone.x + myBatt.x, zone.zone.y + myBatt.y, myBatt.w, myBatt.h, CUSTOM_COLOR, 2) - lcd.drawFilledRectangle(zone.zone.x + myBatt.x + myBatt.w, zone.zone.y + myBatt.h/2 - myBatt.cath_h/2, myBatt.cath_w, myBatt.cath_h, CUSTOM_COLOR) - - -- fils batt - lcd.setColor(CUSTOM_COLOR, getPercentColor(percent)) - lcd.drawGauge(zone.zone.x+2, zone.zone.y+2, myBatt.w-4, zone.zone.h, percent, 100, CUSTOM_COLOR) - -- write text - if isDataAvailable then - lcd.setColor(CUSTOM_COLOR, zone.options.Color) - local topLine = string.format("%2.1fV %2.0f%%", getMainValue(mySensor, zone.options), percent) - lcd.drawText(zone.zone.x + 20, zone.zone.y +2, topLine , MIDSIZE + CUSTOM_COLOR + shadowed) - else - lcd.drawText(zone.zone.x + 10, zone.zone.y+10, "No Cells Data", LEFT + SMLSIZE + INVERS + CUSTOM_COLOR + shadowed) - end - - - return -end - ---- Size is 225x98 1/4th (no sliders/trim) -local function refreshZoneMedium(zone) - local myBatt = {["x"]=0, ["y"]=0, ["w"]=85, ["h"]=35, ["segments_w"]=15, ["color"]=WHITE, ["cath_w"]=6, ["cath_h"]=20} - local mySensor = getCels(zone.options.Sensor) - local isDataAvailable = (type(mySensor) == "table") - - lcd.setColor(CUSTOM_COLOR, zone.options.Color) - if isDataAvailable then - -- draw values - local percent = getCellPercent(getCellAvg(mySensor)) - lcd.drawText(zone.zone.x + zone.zone.w, zone.zone.y, string.format("%2.1fV", getMainValue(mySensor, zone.options)) , DBLSIZE + CUSTOM_COLOR + RIGHT+ shadowed) - - -- fils batt - lcd.setColor(CUSTOM_COLOR, getPercentColor(percent)) - lcd.drawGauge(zone.zone.x + myBatt.x, zone.zone.y + myBatt.y, myBatt.w, myBatt.h, percent, 100, CUSTOM_COLOR) - -- draw cells - local pos = {{x=2, y=38}, {x=60, y=38}, {x=118, y=38}, {x=2, y=57}, {x=60, y=57}, {x=118, y=57}} - for i=1, getCellCount(mySensor), 1 do - lcd.setColor(CUSTOM_COLOR, getRangeColor(mySensor[i], getCellMax(mySensor), getCellMax(mySensor) - 0.2)) - lcd.drawFilledRectangle(zone.zone.x + pos[i].x, zone.zone.y + pos[i].y, 58, 20, CUSTOM_COLOR) - lcd.setColor(CUSTOM_COLOR, WHITE) - lcd.drawText(zone.zone.x + pos[i].x+10, zone.zone.y + pos[i].y, string.format("%.2f", mySensor[i]), CUSTOM_COLOR + shadowed) - lcd.drawRectangle(zone.zone.x + pos[i].x, zone.zone.y + pos[i].y, 59, 20, CUSTOM_COLOR,1) - end - else - lcd.drawText(zone.zone.x, zone.zone.y+35, "No Cells Data", LEFT + SMLSIZE + INVERS + CUSTOM_COLOR) - end - -- draws bat - lcd.setColor(CUSTOM_COLOR, WHITE) - lcd.drawRectangle(zone.zone.x + myBatt.x , zone.zone.y + myBatt.y, myBatt.w, myBatt.h, CUSTOM_COLOR, 2) - lcd.drawFilledRectangle(zone.zone.x + myBatt.x + myBatt.w, zone.zone.y + myBatt.h/2 - myBatt.cath_h/2, myBatt.cath_w, myBatt.cath_h, CUSTOM_COLOR) - lcd.drawText(zone.zone.x + myBatt.x + 20 , zone.zone.y + myBatt.y + 5, string.format("%2.0f%%", getCellPercent(getCellAvg(mySensor))), LEFT + MIDSIZE + CUSTOM_COLOR + shadowed) - --for i=1, myBatt.w - myBatt.segments_w, myBatt.segments_w do - -- lcd.drawRectangle(zone.zone.x + myBatt.x + i, zone.zone.y + myBatt.y, myBatt.segments_w, myBatt.h, CUSTOM_COLOR, 1) - --end - return -end - ---- Size is 192x152 1/2 -local function refreshZoneLarge(zone) - local myBatt = {["x"]=0, ["y"]=18, ["w"]=76, ["h"]=121, ["segments_h"]=30, ["color"]=WHITE, ["cath_w"]=30, ["cath_h"]=10} - local mySensor = getCels(zone.options.Sensor) - local isDataAvailable = (type(mySensor) == "table") - - lcd.setColor(CUSTOM_COLOR, zone.options.Color) - if isDataAvailable then - local percent = getCellPercent(getCellAvg(mySensor)) - - lcd.drawText(zone.zone.x+zone.zone.w, zone.zone.y, percent.."%", RIGHT + DBLSIZE + CUSTOM_COLOR + shadowed) - lcd.drawText(zone.zone.x+zone.zone.w, zone.zone.y+30, string.format("%2.1fV", getMainValue(mySensor, zone.options)), RIGHT + DBLSIZE + CUSTOM_COLOR + shadowed) - lcd.drawText(zone.zone.x+zone.zone.w, zone.zone.y+70, string.format("%2.1fV %2.1fS", getSecondaryValue(mySensor, options), getCellCount(mySensor)), RIGHT + SMLSIZE + CUSTOM_COLOR + shadowed) - -- fils batt - lcd.setColor(CUSTOM_COLOR, getPercentColor(percent)) - lcd.drawFilledRectangle(zone.zone.x + myBatt.x, zone.zone.y + myBatt.y + myBatt.h + myBatt.cath_h - math.floor(percent/100 * myBatt.h), myBatt.w, math.floor(percent/100 * myBatt.h), CUSTOM_COLOR) - -- draw cells - local pos = {{x=80, y=90}, {x=138, y=90}, {x=80, y=109}, {x=138, y=109}, {x=80, y=128}, {x=138, y=128}} - for i=1, getCellCount(mySensor), 1 do - lcd.setColor(CUSTOM_COLOR, getRangeColor(mySensor[i], getCellMax(mySensor), getCellMax(mySensor) - 0.2)) - lcd.drawFilledRectangle(zone.zone.x + pos[i].x, zone.zone.y + pos[i].y, 58, 20, CUSTOM_COLOR) - lcd.setColor(CUSTOM_COLOR, WHITE) - lcd.drawText(zone.zone.x + pos[i].x+10, zone.zone.y + pos[i].y, string.format("%.2f", mySensor[i]), CUSTOM_COLOR + shadowed) - lcd.drawRectangle(zone.zone.x + pos[i].x, zone.zone.y + pos[i].y, 59, 20, CUSTOM_COLOR, 1) - end - else - lcd.drawText(zone.zone.x+5, zone.zone.y, "No Cells Data", LEFT + SMLSIZE + INVERS + CUSTOM_COLOR + shadowed) - end - -- draws bat - lcd.setColor(CUSTOM_COLOR, WHITE) - lcd.drawRectangle(zone.zone.x + myBatt.x, zone.zone.y + myBatt.y + myBatt.cath_h , myBatt.w, myBatt.h, CUSTOM_COLOR, 2) - lcd.drawFilledRectangle(zone.zone.x + myBatt.x + myBatt.w/2 - myBatt.cath_w/2, zone.zone.y + myBatt.y, myBatt.cath_w, myBatt.cath_h, CUSTOM_COLOR) - for i=1, myBatt.h - myBatt.segments_h, myBatt.segments_h do - lcd.drawRectangle(zone.zone.x + myBatt.x, zone.zone.y + myBatt.y + myBatt.cath_h + i, myBatt.w, myBatt.segments_h, CUSTOM_COLOR, 1) - end - return -end - ---- Size is 390x172 1/1 ---- Size is 460x252 1/1 (no sliders/trim/topbar) -local function refreshZoneXLarge(zone) - local myBatt = {["x"]=10, ["y"]=20, ["w"]=80, ["h"]=121, ["segments_h"]=30, ["color"]=WHITE, ["cath_w"]=30, ["cath_h"]=10} - local mySensor = getCels(zone.options.Sensor) - local isDataAvailable = (type(mySensor) == "table") - - lcd.setColor(CUSTOM_COLOR, zone.options.Color) - if isDataAvailable then - local percent = getCellPercent(getCellAvg(mySensor)) - -- fils batt - lcd.setColor(CUSTOM_COLOR, getPercentColor(percent)) - lcd.drawFilledRectangle(zone.zone.x + myBatt.x, zone.zone.y + myBatt.y + myBatt.h + myBatt.cath_h - math.floor(percent/100 * myBatt.h), myBatt.w, math.floor(percent/100 * myBatt.h), CUSTOM_COLOR) - -- draw right text section - lcd.setColor(CUSTOM_COLOR, zone.options.Color) - lcd.drawText(zone.zone.x+zone.zone.w, zone.zone.y + myBatt.y, percent.."%", RIGHT + DBLSIZE + CUSTOM_COLOR + shadowed) - - lcd.drawText(zone.zone.x+zone.zone.w, zone.zone.y + myBatt.y + 30, string.format("%2.1fV", getMainValue(mySensor, zone.options)), RIGHT + DBLSIZE + CUSTOM_COLOR + shadowed) - lcd.drawText(zone.zone.x+zone.zone.w, zone.zone.y + myBatt.y + 105, string.format("%2.1fV %2.1fS", getSecondaryValue(mySensor, zone.options), getCellCount(mySensor)) , RIGHT + SMLSIZE + CUSTOM_COLOR + shadowed) - - -- draw cells - local pos = {{x=111, y=38}, {x=164, y=38}, {x=217, y=38}, {x=111, y=57}, {x=164, y=57}, {x=217, y=57}} - for i=1, getCellCount(mySensor), 1 do - lcd.setColor(CUSTOM_COLOR, getRangeColor(mySensor[i], getCellMax(mySensor), getCellMax(mySensor) - 0.2)) - lcd.drawFilledRectangle(zone.zone.x + pos[i].x, zone.zone.y + pos[i].y, 53, 20, CUSTOM_COLOR) - lcd.setColor(CUSTOM_COLOR, WHITE) - lcd.drawText(zone.zone.x + pos[i].x+10, zone.zone.y + pos[i].y, string.format("%.2f", mySensor[i]), CUSTOM_COLOR + shadowed) - lcd.drawRectangle(zone.zone.x + pos[i].x, zone.zone.y + pos[i].y, 54, 20, CUSTOM_COLOR, 1) - end - -- draw cells for lowest cells - local pos = {{x=111, y=110}, {x=164, y=110}, {x=217, y=110}, {x=111, y=129}, {x=164, y=129}, {x=217, y=129}} - for i=1, getCellCount(mySensor), 1 do - lcd.setColor(CUSTOM_COLOR, getRangeColor(histCellData[i], mySensor[i], mySensor[i] - 0.3)) - lcd.drawFilledRectangle(zone.zone.x + pos[i].x, zone.zone.y + pos[i].y, 53, 20, CUSTOM_COLOR) - lcd.setColor(CUSTOM_COLOR, WHITE) - lcd.drawRectangle(zone.zone.x + pos[i].x, zone.zone.y + pos[i].y, 54, 20, CUSTOM_COLOR, 1) - lcd.drawText(zone.zone.x + pos[i].x+10, zone.zone.y + pos[i].y, string.format("%.2f", histCellData[i]), CUSTOM_COLOR + shadowed) - end - else - lcd.drawText(zone.zone.x+5, zone.zone.y, "No Cells Data", LEFT + SMLSIZE + INVERS + CUSTOM_COLOR) - end - -- draws bat - lcd.setColor(CUSTOM_COLOR, WHITE) - lcd.drawRectangle(zone.zone.x + myBatt.x, zone.zone.y + myBatt.y + myBatt.cath_h , myBatt.w, myBatt.h, CUSTOM_COLOR, 2) - lcd.drawFilledRectangle(zone.zone.x + myBatt.x + myBatt.w/2 - myBatt.cath_w/2, zone.zone.y + myBatt.y, myBatt.cath_w, myBatt.cath_h, CUSTOM_COLOR) - for i=1, myBatt.h - myBatt.segments_h, myBatt.segments_h do - lcd.drawRectangle(zone.zone.x + myBatt.x, zone.zone.y + myBatt.y + myBatt.cath_h + i, myBatt.w, myBatt.segments_h, CUSTOM_COLOR, 1) - end - -- draw middle rectangles - lcd.drawRectangle(zone.zone.x + 110, zone.zone.y + 38, 161, 40, CUSTOM_COLOR, 1) - lcd.drawText(zone.zone.x + 220, zone.zone.y + 21, "Live data", RIGHT + SMLSIZE + INVERS + CUSTOM_COLOR + shadowed) - lcd.drawRectangle(zone.zone.x + 110, zone.zone.y + 110, 161, 40, CUSTOM_COLOR, 1) - lcd.drawText(zone.zone.x + 230, zone.zone.y + 93, "Lowest data", RIGHT + SMLSIZE + INVERS + CUSTOM_COLOR + shadowed) - return -end - --- This function allow recording of lowest cells when widget is not active -local function background(myZone) - getCels(myZone.options.Sensor) - return -end - -function refresh(myZone) - if myZone.options.Shadow == 1 then - shadowed = SHADOWED - else - shadowed = 0 - end - - --if myZone.options.Sensor == 1 then - -- lcd.drawText(myZone.zone.x+2, myZone.zone.y+2, "Not configured", LEFT + SMLSIZE + CUSTOM_COLOR) - -- lcd.drawText(myZone.zone.x+2, myZone.zone.y+20, "Requires setting a Voltage Sensor", LEFT + SMLSIZE + INVERS + CUSTOM_COLOR) - -- return - --end - if myZone.zone.w > 380 and myZone.zone.h > 165 then refreshZoneXLarge(myZone) - elseif myZone.zone.w > 180 and myZone.zone.h > 145 then refreshZoneLarge(myZone) - elseif myZone.zone.w > 170 and myZone.zone.h > 65 then refreshZoneMedium(myZone) - elseif myZone.zone.w > 150 and myZone.zone.h > 28 then refreshZoneSmall(myZone) - elseif myZone.zone.w > 65 and myZone.zone.h > 35 then refreshZoneTiny(myZone) - end -end - -return { name="BattCheck", options=options, create=create, update=update, background=background, refresh=refresh } diff --git a/radio/sdcard/nv14/WIDGETS/Counter/main.lua b/radio/sdcard/nv14/WIDGETS/Counter/main.lua deleted file mode 100644 index 4b6122b56..000000000 --- a/radio/sdcard/nv14/WIDGETS/Counter/main.lua +++ /dev/null @@ -1,47 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### -local options = { - { "Option1", SOURCE, 1 }, - { "Option2", VALUE, 1000 }, - { "Option3", COLOR, RED }, - { "Shadow", BOOL, 0 } -} - -local function create(zone, options) - local pie = { zone=zone, options=options, counter=0 } - print(options.Option2) - return pie -end - -local function update(pie, options) - pie.options = options -end - -local function background(pie) - pie.counter = pie.counter + 1 -end - -function refresh(pie) - pie.counter = pie.counter + 1 - if pie.options.Shadow == 1 then - lcd.drawNumber(pie.zone.x, pie.zone.y, pie.counter, LEFT + DBLSIZE + DEFAULT_COLOR); - else - lcd.drawNumber(pie.zone.x, pie.zone.y, pie.counter, LEFT + DBLSIZE + DEFAULT_COLOR + SHADOWED); - end -end - -return { name="Counter", options=options, create=create, update=update, refresh=refresh, background=background } diff --git a/radio/sdcard/nv14/WIDGETS/Timer2/main.lua b/radio/sdcard/nv14/WIDGETS/Timer2/main.lua deleted file mode 100644 index 6354eee4e..000000000 --- a/radio/sdcard/nv14/WIDGETS/Timer2/main.lua +++ /dev/null @@ -1,100 +0,0 @@ --- A Timer version that fill better the widget area --- Offer Shmuely --- Date: 2018 --- ver: 0.2 - -local options = { - { "TextColor", COLOR, YELLOW }, - { "Timer", VALUE, 1, 1, 3} -} - -local function create(zone, options) - local wgt = { zone=zone, options=options} - return wgt -end - -local function update(wgt, options) - if (wgt==nil) then - print("update(nil)") - return - end - wgt.options = options - print("TimerNumB:" .. options.Timer) -end - -local function background(wgt) - return -end - ------------------------------------------------------------- - --- This size is for top bar wgts -local function refreshZoneTiny(wgt) -end - ---- Size is 160x32 1/8th -local function refreshZoneSmall(wgt) - local t1 = model.getTimer(wgt.options.Timer-1) - local timerInfo = string.format("T%s: ", wgt.options.Timer) - lcd.drawText(wgt.zone.x, wgt.zone.y, timerInfo, SMLSIZE + CUSTOM_COLOR) - lcd.drawTimer(wgt.zone.x+35, wgt.zone.y, t1.value, DBLSIZE + CUSTOM_COLOR) - return -end - ---- Size is 225x98 1/4th (no sliders/trim) -local function refreshZoneMedium(wgt) - local t1 = model.getTimer(wgt.options.Timer-1) - --print(t1.value) - local timerInfo = string.format("Timer:%s", wgt.options.Timer) - lcd.drawText (wgt.zone.x, wgt.zone.y, timerInfo, SMLSIZE + CUSTOM_COLOR) - lcd.drawTimer(wgt.zone.x, wgt.zone.y+3, t1.value, XXLSIZE + CUSTOM_COLOR) -end - ---- Size is 192x152 1/2 -local function refreshZoneLarge(wgt) - local t1 = model.getTimer(wgt.options.Timer-1) - --print(t1.value) - local timerInfo = string.format("Timer:%s", wgt.options.Timer) - lcd.drawText(wgt.zone.x, wgt.zone.y, timerInfo, SMLSIZE + CUSTOM_COLOR) - lcd.drawTimer(wgt.zone.x, wgt.zone.y+15, t1.value, XXLSIZE + CUSTOM_COLOR) -end - ---- Size is 390x172 1/1 ---- Size is 460x252 1/1 (no sliders/trim/topbar) -local function refreshZoneXLarge(wgt) - local t1 = model.getTimer(wgt.options.Timer-1) - --print(t1.value) - local timerInfo = string.format("Timer:%s", wgt.options.Timer) - lcd.drawText(wgt.zone.x, wgt.zone.y, timerInfo, SMLSIZE + CUSTOM_COLOR) - lcd.drawTimer(wgt.zone.x, wgt.zone.y+15, t1.value, XXLSIZE + CUSTOM_COLOR) -end - - -function refresh(wgt) - - if (wgt==nil) then - print("refresh(nil)") - return - end - - if (wgt.options==nil) then - print("refresh(wgt.options=nil)") - return - end - - if (wgt.options.Timer==nil) then - print("refresh(wgt.options.Timer=nil)") - return - end - - lcd.setColor(CUSTOM_COLOR, wgt.options.TextColor) - - if wgt.zone.w > 380 and wgt.zone.h > 165 then refreshZoneXLarge(wgt) - elseif wgt.zone.w > 180 and wgt.zone.h > 145 then refreshZoneLarge(wgt) - elseif wgt.zone.w > 170 and wgt.zone.h > 65 then refreshZoneMedium(wgt) - elseif wgt.zone.w > 150 and wgt.zone.h > 28 then refreshZoneSmall(wgt) - elseif wgt.zone.w > 65 and wgt.zone.h > 35 then refreshZoneTiny(wgt) - end -end - -return { name="Timer2", options=options, create=create, update=update, background=background, refresh=refresh } diff --git a/radio/sdcard/nv14/edgetx.sdcard.version b/radio/sdcard/nv14/edgetx.sdcard.version deleted file mode 100644 index a921c3b61..000000000 --- a/radio/sdcard/nv14/edgetx.sdcard.version +++ /dev/null @@ -1 +0,0 @@ -2.4V0037 diff --git a/radio/sdcard/taranis-x7/EEPROM/readme.txt b/radio/sdcard/taranis-x7/EEPROM/readme.txt deleted file mode 100644 index 52977efaf..000000000 --- a/radio/sdcard/taranis-x7/EEPROM/readme.txt +++ /dev/null @@ -1,2 +0,0 @@ -EEprom backups go in this folder. -EEprom backups can be generated from VERSION screen in RADIO SETUP diff --git a/radio/sdcard/taranis-x7/FIRMWARE/readme.txt b/radio/sdcard/taranis-x7/FIRMWARE/readme.txt deleted file mode 100644 index 4ba9522c9..000000000 --- a/radio/sdcard/taranis-x7/FIRMWARE/readme.txt +++ /dev/null @@ -1,2 +0,0 @@ -You can put firmware for your modules or radio in this folder. -Files in this folder are NOT automaticaly applied. diff --git a/radio/sdcard/taranis-x7/LOGS/readme.txt b/radio/sdcard/taranis-x7/LOGS/readme.txt deleted file mode 100644 index f9c005b26..000000000 --- a/radio/sdcard/taranis-x7/LOGS/readme.txt +++ /dev/null @@ -1 +0,0 @@ -Logs files created by "SD Logs" special function will be stored in this directory. diff --git a/radio/sdcard/taranis-x7/MODELS/readme.txt b/radio/sdcard/taranis-x7/MODELS/readme.txt deleted file mode 100644 index 5c5707a4d..000000000 --- a/radio/sdcard/taranis-x7/MODELS/readme.txt +++ /dev/null @@ -1 +0,0 @@ -Individual model files for the Backup/Restore model features go here, as well as model note text files. diff --git a/radio/sdcard/taranis-x7/SCREENSHOTS/readme.txt b/radio/sdcard/taranis-x7/SCREENSHOTS/readme.txt deleted file mode 100644 index 8b89b3c6c..000000000 --- a/radio/sdcard/taranis-x7/SCREENSHOTS/readme.txt +++ /dev/null @@ -1 +0,0 @@ -Screenshots created by "Screenshot" special function will be stored in this directory. diff --git a/radio/sdcard/taranis-x7/SCRIPTS/FUNCTIONS/readme.txt b/radio/sdcard/taranis-x7/SCRIPTS/FUNCTIONS/readme.txt deleted file mode 100644 index e14fc62df..000000000 --- a/radio/sdcard/taranis-x7/SCRIPTS/FUNCTIONS/readme.txt +++ /dev/null @@ -1 +0,0 @@ -This directory is for lua functions scripts. diff --git a/radio/sdcard/taranis-x7/SCRIPTS/MIXES/readme.txt b/radio/sdcard/taranis-x7/SCRIPTS/MIXES/readme.txt deleted file mode 100644 index 8a5e2e738..000000000 --- a/radio/sdcard/taranis-x7/SCRIPTS/MIXES/readme.txt +++ /dev/null @@ -1 +0,0 @@ -This directory is for lua mixer scripts. diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TELEMETRY/readme.txt b/radio/sdcard/taranis-x7/SCRIPTS/TELEMETRY/readme.txt deleted file mode 100644 index 26b887558..000000000 --- a/radio/sdcard/taranis-x7/SCRIPTS/TELEMETRY/readme.txt +++ /dev/null @@ -1,2 +0,0 @@ -This directory is for lua telemetry scripts. -Those scripts can be selected using DISPLAY page. diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/CROSSFIRE/crossfire.lua b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/CROSSFIRE/crossfire.lua deleted file mode 100644 index 70c125b69..000000000 --- a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/CROSSFIRE/crossfire.lua +++ /dev/null @@ -1,117 +0,0 @@ -local toolName = "TNS|Crossfire setup|TNE" ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### -local devices = { } -local lineIndex = 1 -local pageOffset = 0 - -local function createDevice(id, name) - local device = { - id = id, - name = name, - timeout = 0 - } - return device -end - -local function getDevice(name) - for i=1, #devices do - if devices[i].name == name then - return devices[i] - end - end - return nil -end - -local function parseDeviceInfoMessage(data) - local id = data[2] - local name = "" - local i = 3 - while data[i] ~= 0 do - name = name .. string.char(data[i]) - i = i + 1 - end - local device = getDevice(name) - if device == nil then - device = createDevice(id, name) - devices[#devices + 1] = device - end - local time = getTime() - device.timeout = time + 3000 -- 30s - if lineIndex == 0 then - lineIndex = 1 - end -end - -local devicesRefreshTimeout = 0 -local function refreshNext() - local command, data = crossfireTelemetryPop() - if command == nil then - local time = getTime() - if time > devicesRefreshTimeout then - devicesRefreshTimeout = time + 100 -- 1s - crossfireTelemetryPush(0x28, { 0x00, 0xEA }) - end - elseif command == 0x29 then - parseDeviceInfoMessage(data) - end -end - -local function selectDevice(step) - lineIndex = 1 + ((lineIndex + step - 1 + #devices) % #devices) -end - --- Init -local function init() - lineIndex = 0 - pageOffset = 0 -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_EXIT then - return 2 - elseif event == EVT_VIRTUAL_NEXT then - selectDevice(1) - elseif event == EVT_VIRTUAL_PREV then - selectDevice(-1) - end - - lcd.clear() - lcd.drawScreenTitle("CROSSFIRE SETUP", 0, 0) - if #devices == 0 then - lcd.drawText(24, 28, "Waiting for Crossfire devices...") - else - for i=1, #devices do - local attr = (lineIndex == i and INVERS or 0) - if event == EVT_VIRTUAL_ENTER and attr == INVERS then - crossfireTelemetryPush(0x28, { devices[i].id, 0xEA }) - return "device.lua" - end - lcd.drawText(0, i*8+9, devices[i].name, attr) - end - end - - refreshNext() - - return 0 -end - -return { init=init, run=run } diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/CROSSFIRE/device.lua b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/CROSSFIRE/device.lua deleted file mode 100644 index b6115d088..000000000 --- a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/CROSSFIRE/device.lua +++ /dev/null @@ -1,523 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### -local deviceId = 0 -local deviceName = "" -local lineIndex = 0 -local pageOffset = 0 -local edit = false -local charIndex = 1 -local fieldPopup -local fieldTimeout = 0 -local fieldId = 1 -local fieldChunk = 0 -local fieldData = {} -local fields = {} - -local function getField(line) - local counter = 1 - for i = 1, #fields do - local field = fields[i] - if not field.hidden then - if counter < line then - counter = counter + 1 - else - return field - end - end - end -end - -local function initLineIndex() - lineIndex = 0 - for i = 1, #fields do - local field = getField(i) - if field and field.type ~= 11 and field.type ~= 12 and field.name ~= nil then - lineIndex = i - break - end - end -end - --- Change display attribute to current field -local function incrField(step) - local field = getField(lineIndex) - if field.type == 10 then - local byte = 32 - if charIndex <= #field.value then - byte = string.byte(field.value, charIndex) + step - end - if byte < 32 then - byte = 32 - elseif byte > 122 then - byte = 122 - end - if charIndex <= #field.value then - field.value = string.sub(field.value, 1, charIndex-1) .. string.char(byte) .. string.sub(field.value, charIndex+1) - else - field.value = field.value .. string.char(byte) - end - else - local min, max = 0, 0 - if ((field.type <= 5) or (field.type == 8)) then - min = field.min - max = field.max - step = field.step * step - elseif field.type == 9 then - min = 0 - max = #field.values - 1 - end - if (step < 0 and field.value > min) or (step > 0 and field.value < max) then - field.value = field.value + step - end - end -end - --- Select the next or previous editable field -local function selectField(step) - local newLineIndex = lineIndex - local field - repeat - newLineIndex = newLineIndex + step - if newLineIndex == 0 then - newLineIndex = #fields - elseif newLineIndex == 1 + #fields then - newLineIndex = 1 - pageOffset = 0 - end - field = getField(newLineIndex) - until newLineIndex == lineIndex or (field and field.type ~= 11 and field.name) - lineIndex = newLineIndex - if lineIndex > 7 + pageOffset then - pageOffset = lineIndex - 7 - elseif lineIndex <= pageOffset then - pageOffset = lineIndex - 1 - end -end - -local function split(str) - local t = {} - local i = 1 - for s in string.gmatch(str, "([^;]+)") do - t[i] = s - i = i + 1 - end - return t -end - -local function fieldGetString(data, offset) - local result = "" - while data[offset] ~= 0 do - result = result .. string.char(data[offset]) - offset = offset + 1 - end - offset = offset + 1 - return result, offset -end - -local function parseDeviceInfoMessage(data) - local offset - deviceId = data[2] - deviceName, offset = fieldGetString(data, 3) - local fields_count = data[offset+12] - for i=1, fields_count do - fields[i] = { name=nil } - end -end - -local function fieldGetValue(data, offset, size) - local result = 0 - for i=0, size-1 do - result = bit32.lshift(result, 8) + data[offset + i] - end - return result -end - -local function fieldUnsignedLoad(field, data, offset, size) - field.value = fieldGetValue(data, offset, size) - field.min = fieldGetValue(data, offset+size, size) - field.max = fieldGetValue(data, offset+2*size, size) - field.default = fieldGetValue(data, offset+3*size, size) - field.unit, offset = fieldGetString(data, offset+4*size) - field.step = 1 -end - -local function fieldUnsignedToSigned(field, size) - local bandval = bit32.lshift(0x80, (size-1)*8) - field.value = field.value - bit32.band(field.value, bandval) * 2 - field.min = field.min - bit32.band(field.min, bandval) * 2 - field.max = field.max - bit32.band(field.max, bandval) * 2 - field.default = field.default - bit32.band(field.default, bandval) * 2 -end - - local function fieldSignedLoad(field, data, offset, size) - fieldUnsignedLoad(field, data, offset, size) - fieldUnsignedToSigned(field, size) -end - -local function fieldIntSave(index, value, size) - local frame = { deviceId, 0xEA, index } - for i=size-1, 0, -1 do - frame[#frame + 1] = (bit32.rshift(value, 8*i) % 256) - end - crossfireTelemetryPush(0x2D, frame) -end - -local function fieldUnsignedSave(field, size) - local value = field.value - fieldIntSave(field.id, value, size) -end - -local function fieldSignedSave(field, size) - local value = field.value - if value < 0 then - value = bit32.lshift(0x100, (size-1)*8) + value - end - fieldIntSave(field.id, value, size) -end - -local function fieldIntDisplay(field, y, attr) - lcd.drawNumber(89, y, field.value, LEFT + attr) - lcd.drawText(lcd.getLastPos(), y, field.unit, attr) -end - --- UINT8 -local function fieldUint8Load(field, data, offset) - fieldUnsignedLoad(field, data, offset, 1) -end - -local function fieldUint8Save(field) - fieldUnsignedSave(field, 1) -end - --- INT8 -local function fieldInt8Load(field, data, offset) - fieldSignedLoad(field, data, offset, 1) -end - -local function fieldInt8Save(field) - fieldSignedSave(field, 1) -end - --- UINT16 -local function fieldUint16Load(field, data, offset) - fieldUnsignedLoad(field, data, offset, 2) -end - -local function fieldUint16Save(field) - fieldUnsignedSave(field, 2) -end - --- INT16 -local function fieldInt16Load(field, data, offset) - fieldSignedLoad(field, data, offset, 2) -end - -local function fieldInt16Save(field) - fieldSignedSave(field, 2) -end - --- FLOAT -local function fieldFloatLoad(field, data, offset) - field.value = fieldGetValue(data, offset, 4) - field.min = fieldGetValue(data, offset+4, 4) - field.max = fieldGetValue(data, offset+8, 4) - field.default = fieldGetValue(data, offset+12, 4) - fieldUnsignedToSigned(field, 4) - field.prec = data[offset+16] - if field.prec > 3 then - field.prec = 3 - end - field.step = fieldGetValue(data, offset+17, 4) - field.unit, offset = fieldGetString(data, offset+21) -end - -local function formatFloat(num, decimals) - local mult = 10^(decimals or 0) - local val = num / mult - return string.format("%." .. decimals .. "f", val) -end - -local function fieldFloatDisplay(field, y, attr) - lcd.drawText(89, y, formatFloat(field.value, field.prec), LEFT + attr) - lcd.drawText(lcd.getLastPos(), y, field.unit, attr) -end - -local function fieldFloatSave(field) - fieldUnsignedSave(field, 4) -end - --- TEXT SELECTION -local function fieldTextSelectionLoad(field, data, offset) - local values - values, offset = fieldGetString(data, offset) - if values ~= "" then - field.values = split(values) - end - field.value = data[offset] - field.min = data[offset+1] - field.max = data[offset+2] - field.default = data[offset+3] - field.unit, offset = fieldGetString(data, offset+4) -end - -local function fieldTextSelectionSave(field) - crossfireTelemetryPush(0x2D, { deviceId, 0xEA, field.id, field.value }) -end - -local function fieldTextSelectionDisplay(field, y, attr) - lcd.drawText(89, y, field.values[field.value+1], attr) - lcd.drawText(lcd.getLastPos(), y, field.unit, attr) -end - --- STRING -local function fieldStringLoad(field, data, offset) - field.value, offset = fieldGetString(data, offset) - if #data >= offset then - field.maxlen = data[offset] - end -end - -local function fieldStringSave(field) - local frame = { deviceId, 0xEA, field.id } - for i=1, string.len(field.value) do - frame[#frame + 1] = string.byte(field.value, i) - end - frame[#frame + 1] = 0 - crossfireTelemetryPush(0x2D, frame) -end - -local function fieldStringDisplay(field, y, attr) - if edit == true and attr then - lcd.drawText(89, y, field.value, FIXEDWIDTH) - lcd.drawText(83+6*charIndex, y, string.sub(field.value, charIndex, charIndex), FIXEDWIDTH + attr) - else - lcd.drawText(89, y, field.value, attr) - end -end - -local function fieldCommandLoad(field, data, offset) - field.status = data[offset] - field.timeout = data[offset+1] - field.info, offset = fieldGetString(data, offset+2) - if field.status == 0 then - fieldPopup = nil - end -end - -local function fieldCommandSave(field) - if field.status == 0 then - field.status = 1 - crossfireTelemetryPush(0x2D, { deviceId, 0xEA, field.id, field.status }) - fieldPopup = field - fieldTimeout = getTime() + field.timeout - end -end - -local function fieldCommandDisplay(field, y, attr) - lcd.drawText(0, y, field.name, attr) - if field.info ~= "" then - lcd.drawText(89, y, "[" .. field.info .. "]") - end -end - -local functions = { - { load=fieldUint8Load, save=fieldUint8Save, display=fieldIntDisplay }, - { load=fieldInt8Load, save=fieldInt8Save, display=fieldIntDisplay }, - { load=fieldUint16Load, save=fieldUint16Save, display=fieldIntDisplay }, - { load=fieldInt16Load, save=fieldInt16Save, display=fieldIntDisplay }, - nil, - nil, - nil, - nil, - { load=fieldFloatLoad, save=fieldFloatSave, display=fieldFloatDisplay }, - { load=fieldTextSelectionLoad, save=fieldTextSelectionSave, display=fieldTextSelectionDisplay }, - { load=fieldStringLoad, save=fieldStringSave, display=fieldStringDisplay }, - nil, - { load=fieldStringLoad, save=fieldStringSave, display=fieldStringDisplay }, - { load=fieldCommandLoad, save=fieldCommandSave, display=fieldCommandDisplay }, -} - -local function parseParameterInfoMessage(data) - if data[2] ~= deviceId or data[3] ~= fieldId then - fieldData = {} - fieldChunk = 0 - return - end - local field = fields[fieldId] - local chunks = data[4] - for i=5, #data do - fieldData[#fieldData + 1] = data[i] - end - if chunks > 0 then - fieldChunk = fieldChunk + 1 - else - fieldChunk = 0 - field.id = fieldId - field.parent = fieldData[1] - field.type = fieldData[2] % 128 - field.hidden = (bit32.rshift(fieldData[2], 7) == 1) - local name, i = fieldGetString(fieldData, 3) - if name ~= "" then - local indent = "" - local parent = field.parent - while parent ~= 0 do - indent = indent .. " " - parent = fields[parent].parent - end - field.name = indent .. name - end - if functions[field.type+1] then - functions[field.type+1].load(field, fieldData, i) - end - if not fieldPopup then - if lineIndex == 0 and field.hidden ~= true and field.type and field.type ~= 11 and field.type ~= 12 then - initLineIndex() - end - fieldId = 1 + (fieldId % #fields) - end - fieldData = {} - end -end - -local function refreshNext() - local command, data = crossfireTelemetryPop() - if command == nil then - local time = getTime() - if fieldPopup then - if time > fieldTimeout then - crossfireTelemetryPush(0x2D, { deviceId, 0xEA, fieldPopup.id, 6 }) - fieldTimeout = time + fieldPopup.timeout - end - elseif time > fieldTimeout and not edit then - crossfireTelemetryPush(0x2C, { deviceId, 0xEA, fieldId, fieldChunk }) - fieldTimeout = time + 200 -- 2s - end - elseif command == 0x29 then - parseDeviceInfoMessage(data) - elseif command == 0x2B then - parseParameterInfoMessage(data) - fieldTimeout = 0 - end -end - --- Main -local function runDevicePage(event) - if event == EVT_VIRTUAL_EXIT then -- exit script - if edit == true then - edit = false - local field = getField(lineIndex) - fieldTimeout = getTime() + 200 -- 2s - fieldId, fieldChunk = field.id, 0 - fieldData = {} - functions[field.type+1].save(field) - else - return "crossfire.lua" - end - elseif event == EVT_VIRTUAL_ENTER then -- toggle editing/selecting current field - local field = getField(lineIndex) - if field.name then - if field.type == 10 then - if edit == false then - edit = true - charIndex = 1 - else - charIndex = charIndex + 1 - end - elseif field.type < 11 then - edit = not edit - end - if edit == false then - fieldTimeout = getTime() + 200 -- 2s - fieldId, fieldChunk = field.id, 0 - fieldData = {} - functions[field.type+1].save(field) - end - end - elseif edit then - if event == EVT_VIRTUAL_NEXT or event == EVT_VIRTUAL_NEXT_REPT then - incrField(1) - elseif event == EVT_VIRTUAL_PREV or event == EVT_VIRTUAL_PREV_REPT then - incrField(-1) - end - else - if event == EVT_VIRTUAL_NEXT then - selectField(1) - elseif event == EVT_VIRTUAL_PREV then - selectField(-1) - end - end - - lcd.clear() - lcd.drawScreenTitle(deviceName, 0, 0) - for y = 1, 7 do - local field = getField(pageOffset+y) - if not field then - break - elseif field.name == nil then - lcd.drawText(0, 1+8*y, "...") - else - local attr = lineIndex == (pageOffset+y) and ((edit == true and BLINK or 0) + INVERS) or 0 - lcd.drawText(0, 1+8*y, field.name) - if functions[field.type+1] then - functions[field.type+1].display(field, 1+8*y, attr) - end - end - end - - return 0 -end - -local function runPopupPage(event) - local result - if fieldPopup.status == 3 then - result = popupConfirmation(fieldPopup.info, event) - else - result = popupWarning(fieldPopup.info, event) - end - if result == "OK" then - crossfireTelemetryPush(0x2D, { deviceId, 0xEA, fieldPopup.id, 4 }) - elseif result == "CANCEL" then - crossfireTelemetryPush(0x2D, { deviceId, 0xEA, fieldPopup.id, 5 }) - end - return 0 -end - --- Init -local function init() - lineIndex, edit = 0, false -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - end - - local result - if fieldPopup ~= nil then - result = runPopupPage(event) - else - result = runDevicePage(event) - end - - refreshNext() - - return result -end - -return { init=init, run=run } diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/FrSky GaSuite.lua b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/FrSky GaSuite.lua deleted file mode 100755 index e0497f00f..000000000 --- a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/FrSky GaSuite.lua +++ /dev/null @@ -1,515 +0,0 @@ - ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - -local version = "v1.1" - -local VALUE = 0 -local COMBO = 1 -local FLPOI = 2 - - -local edit = false -local page = 1 -local current = 1 --row -local refreshState = 0 -local refreshIndex = 0 -local refreshIndex3 = 0 -local pageOffset = 0 -local pages = {} -local fields = {} -local modifications = {} -local thistime = getTime() -local lastTime = thistime -local margin = 1 -local spacing = 8 -local configFields = {} -local counter = 0 -local appId = 0 - -local function drawScreenTitle(title,page, pages) - if math.fmod(math.floor(getTime()/100),10) == 0 then - title = version - end - if LCD_W == 480 then - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, title, MENU_COLOR) - lcd.drawText(LCD_W-40, 5, page.."/"..pages, MENU_COLOR) - else - lcd.drawScreenTitle(title, page, pages) - end -end - -local interfaceconfig = { - {"Sensor group select", VALUE, appId, nil, 0, 15}, -} - -local settingsFields = { - {"Software version", FLPOT, 0x0c, nil, 1, 100 }, - {"Physical ID", VALUE, 0x01, nil, 0, 26 }, - {"Application IDgroup", VALUE, 0x0D, nil, 0, 15 }, - {"Data rate(*100ms)", VALUE, 0x22, nil, 1, 255 }, -} - -local telemetryFields = { - {"TEMP1(C/F)", VALUE, 0x90, nil, -30, 600}, - {"TEMP2(C/F)", VALUE, 0x91, nil, -30, 600}, - {"SPEED(r/min)", VALUE, 0x92, nil, 0, 100000}, - {"Residual Volume(mL)", VALUE, 0x93, nil, 0, 60000}, - {"Residual Percent(%)", VALUE, 0x94, nil, 0, 100}, - {"FLOW(mL/min)", VALUE, 0x95, nil, 0, 2000}, - {"Max Flow(mL/min)", VALUE, 0x96, nil, 0, 2000}, - {"Avg Flow(mL/min)", VALUE, 0x97, nil, 0, 2000}, -} - --- Change display attribute to current field -local function addField(step) - local field = fields[current] - local min, max - if field[2] == VALUE then - min = field[5] - max = field[6] - elseif field[2] == COMBO then - min = 0 - max = #(field[5]) - 1 - end - if field[2] ~= FLPOT then --only read ? - if field[2] == VALUE and field[6] > 256 then - if field[4] > 1000 then - step = step * 50 - field[4] = math.floor(field[4]/50) - field[4] = field[4] *50 - elseif field[4] > 500 then - step = step * 20 - field[4] = math.floor(field[4]/20) - field[4] = field[4] *20 - elseif field[4] > 200 then - step = step * 10 - field[4] = math.floor(field[4]/10) - field[4] = field[4] *10 - else - step = step * 1 - field[4] = math.floor(field[4]/1) - field[4] = field[4] *1 - end - end - if (step < 0 and field[4] > min) or (step > 0 and field[4] < max) then - field[4] = field[4] + step - end - else - field[4] = field[4] - end -end - --- Select the next or previous page -local function selectPage(step) - page = 1 + ((page + step - 1 + #pages) % #pages) - refreshIndex = 0 - pageOffset = 0 -end - --- Select the next or previous editable field -local function selectField(step) - current = current + step - if current > #fields then - current = #fields - elseif current < 1 then - current = 1 - end - if current > 7 + pageOffset then - pageOffset = current - 7 - elseif current <= pageOffset then - pageOffset = current - 1 - end -end - -local function drawProgressBar() - if LCD_W == 480 then - local width = (300 * refreshIndex) / #fields - lcd.drawRectangle(100, 10, 300, 6) - lcd.drawFilledRectangle(102, 13, width, 2); - else - local width = (60 * refreshIndex) / #fields - lcd.drawRectangle(45, 1, 60, 6) - lcd.drawFilledRectangle(47, 3, width, 2); - end -end - --- Redraw the current page -local function redrawFieldsPage() - lcd.clear() - drawScreenTitle("GasSuit", page, #pages) - if refreshIndex < #fields then - drawProgressBar() - end - for index = 1, 7, 1 do - local field = fields[pageOffset+index] - if field == nil then - break - end - local attr = current == (pageOffset+index) and ((edit == true and BLINK or 0) + INVERS) or 0 - lcd.drawText(1, margin+ spacing * index, field[1]) - if field[4] == nil then - lcd.drawText(LCD_W, margin+ spacing * index, "---", attr + RIGHT) - else - if field[2] == VALUE then - if (field[3] == 0x90 or field[3] == 0x91) and field[4] == 500 then - lcd.drawText(LCD_W, margin+ spacing * index, "---", attr + RIGHT) - else - - lcd.drawNumber(LCD_W, margin+ spacing * index, field[4] , attr + RIGHT) - end - elseif field[2] == COMBO then - if field[4] >= 0 and field[4] < #(field[5]) then - lcd.drawText(LCD_W, margin+ spacing * index, field[5][1+field[4]], attr + RIGHT) - end - elseif field[2] == FLPOT then - lcd.drawText(LCD_W, margin+ spacing * index, field[4], attr + RIGHT) - end - end - end -end - -local function telemetryRead(fieldx) - return sportTelemetryPush(0x1b, 0x30, appId, fieldx) -end - -local function telemetryListen(fieldx) - return sportTelemetryPush(0x1b, 0, 0, 0) -end - -local function telemetryWrite(fieldx, valuex) - return sportTelemetryPush(0x1b, 0x31, appId, fieldx + valuex*256) -end - -local telemetryPopTimeout = 0 -local function refreshNext() - if refreshState == 0 and page ~= 3 then -- - if #modifications > 0 then -- - if modifications[1][1] ~= 0x0c then - if modifications[1][1] == 0x22 then - modifications[1][2] = modifications[1][2] + 0xf00 - end - local modificationstmp = modifications[1][2] - if modifications[1][1] == 0x8a or modifications[1][1] == 0x8b then - if configFields[11][4]== 1 then - modificationstmp = (modifications[1][2] - 32)*10 - modificationstmp = math.floor(modificationstmp/18) - end - end - telemetryWrite(modifications[1][1], modificationstmp) - refreshIndex = 0 - end - modifications[1] = nil - elseif refreshIndex < #fields then - local field = fields[refreshIndex + 1] - if telemetryRead(field[3]) == true then - refreshState = 1 - telemetryPopTimeout = getTime() + 80 - end - end - elseif refreshState == 0 and page == 3 then - if #modifications > 0 then - if modifications[1][1] == 0x96 or modifications[1][1] == 0x97 or modifications[1][1] == 0x93 then - telemetryWrite(modifications[1][1], 0) - end - modifications[1] = nil - elseif refreshIndex < #fields then - local field = fields[refreshIndex + 1] - if telemetryRead(field[3]) == true then - refreshState = 1 - telemetryPopTimeout = getTime() + 20 - end - elseif refreshIndex >= #fields then - refreshIndex = 0 - refreshState = 0 - end - elseif refreshState == 1 and page ~= 3 then - local physicalId, primId, dataId, value = sportTelemetryPop() - if primId == 0x32 and dataId >= 0x0d00 and dataId <= 0x0d7f then - local fieldId = value % 256 - local field = fields[refreshIndex + 1] - if fieldId == field[3] then - local value = math.floor(value / 256) - if field[2] == COMBO then - for index = 1, #(field[6]), 1 do - if value == field[6][index] then - value = index - 1 - break - end - end - elseif field[2] == VALUE then - value = value -- - field[8] + field[5] - end - if field[1] == "Software version" then - local flo_string = string.char(value/16%16 + 48).."."..string.char(value%16 + 48) - fields[refreshIndex + 1][4] = flo_string - else - fields[refreshIndex + 1][4] = value - end - refreshIndex = refreshIndex + 1 - refreshState = 0 - end - elseif getTime() > telemetryPopTimeout then - refreshState = 0 - end - elseif refreshState == 1 and page == 3 then - local pageID3 = 0 - local physicalId3, primId3, dataId3, value3 = sportTelemetryPop() - if value3 ~= nil then - pageID3 = value3 % 256 - value3 = math.floor(value3 / 0x100) - end - if primId3 == 0x32 and value3 ~= nil then - if pageID3 == fields[refreshIndex + 1][3] then - local field = fields[refreshIndex + 1] - if field[2] == COMBO and #field == 6 then - for index = 1, #(field[6]), 1 do - if value3 == field[6][index] then - value3 = index - 1 - break - end - end - elseif field[2] == VALUE then - if field[3] == 0x90 or field[3] == 0x91 then - value3 = math.floor(value3 % 0x10000) - if value3 > 0xf000 then - value3 = value3 - 0x10000 - end - if configFields[11][4]== 1 and (field[3] == 0x90 or field[3] == 0x91) then - value3 =(value3*18) - value3 = math.floor(value3/10)+32 - end - else - value3 = value3 - end - end - fields[refreshIndex + 1][4] = value3 - refreshIndex = refreshIndex + 1 - refreshState = 0 - end - elseif getTime() > telemetryPopTimeout then - refreshState = 0 - end - end -end - -local function updateField(field) - local value = field[4] - if field[2] == COMBO and #field == 6 then - value = field[6][1+value] - elseif field[2] == VALUE and #field == 6 then - value = value -- + field[8] - field[5] - elseif field[2] == FLPOT then - value = 0 - end - modifications[#modifications+1] = {field[3], value} -end - --- Main1 -local function runFieldsPage(event) - if event == EVT_VIRTUAL_EXIT then - return 2 - elseif event == EVT_VIRTUAL_ENTER then - if fields[current][4] ~= nil then - edit = not edit - if edit == false then - updateField(fields[current]) - end - end - elseif edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - addField(1) - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - addField(-1) - end - else - if event == EVT_VIRTUAL_NEXT then - selectField(1) - elseif event == EVT_VIRTUAL_PREV then - selectField(-1) - end - end - redrawFieldsPage() - return 0 -end - -local function runConfigPage(event) - fields = configFields - local result = runFieldsPage(event) - return result -end - -local function runSettingsPage(event) - fields = settingsFields - return runFieldsPage(event) -end - -local function runTelemetryPage(event) - fields = telemetryFields - return runFieldsPage(event) -end - --- Init -local function init() - current, edit, refreshState, refreshIndex = 1, false, 0, 0 - if LCD_W == 480 then - margin = 10 - spacing = 20 - end - if LCD_W == 128 then - configFields = { - {"CDI off speed limit", VALUE, 0x81, nil, 10,10000}, -- 1 - {"Milliliter per pulse", VALUE, 0x80, nil, 1, 2000}, -- 2 - {"Volume", VALUE, 0x83, nil, 10,60000}, -- 3 - -- {"Flow trigger", VALUE, 0x84, nil, 5, 50 }, - -- {"Flow Reset", COMBO, 0x85, nil, { "ON", "OFF" }, {1 , 0}}, - {"Auto Reset", COMBO, 0x8d, nil, { "ON", "OFF" }, {0 , 1}}, -- 4 - {"Reset settings", COMBO, 0x86, nil,{ "YES", "NO" }, {1 , 0} }, -- 5 - {"Volume alarm(%)", VALUE, 0x87, nil, 0, 90 }, -- 6 - {"Max.Flow alarm", VALUE, 0x88, nil, 0, 2000 }, -- 7 - {"Over speed alarm", VALUE, 0x89, nil, 0, 10000 }, -- 8 - {"Over temp1 alarm", VALUE, 0x8a, nil, 0, 600 }, -- 9 - {"Over temp2 alarm", VALUE, 0x8b, nil, 0, 600 }, -- 10 - {"Temperature C/F", COMBO, 0x8c, nil,{ "C", "F" }, {0 , 1} }, -- 11 - } - else - configFields = { - {"CDI off speed limit(*100RPM)", VALUE, 0x81, nil, 10,10000}, - {"Milliliter per pulse(*0.001mL/pul)", VALUE, 0x80, nil, 1, 2000}, - {"Volume(mL)", VALUE, 0x83, nil, 10,60000}, - -- {"Flow trigger(mL/min)", VALUE, 0x84, nil, 5, 50 }, - -- {"Flow Reset", COMBO, 0x85, nil, { "ON", "OFF" }, {1 , 0}}, - {"Auto Reset", COMBO, 0x8d, nil, { "ON", "OFF" }, {0 , 1}}, - {"Reset to factory settings", COMBO, 0x86, nil,{ "YES", "NO" }, {1 , 0} }, - {"Volume alarm(%)", VALUE, 0x87, nil, 0, 90 }, - {"Max.Flow alarm(mL/min)", VALUE, 0x88, nil, 0, 2000 }, - {"Over speed alarm(*100RPM)", VALUE, 0x89, nil, 0, 10000 }, - {"Over temperature1 alarm(C/F)", VALUE, 0x8a, nil, 0, 600 }, - {"Over temperature2 alarm(C/F)", VALUE, 0x8b, nil, 0, 600 }, - {"Temperature Celsius/Fahrenheit", COMBO, 0x8c, nil,{ "C", "F" }, {0 , 1} }, - } - end - - pages = { - runConfigPage, - runSettingsPage, - runTelemetryPage, - } - - -- Warning : GaSuite tool requires Temp2 to be connected and discovered for script to work - for index = 1, 40, 1 do - local sensor = model.getSensor(index) - if sensor ~= nil and sensor.id >= 0x0d10 and sensor.id <= 0x0d1f then - appId = sensor.id - break - end - end - - if appId == 0 then - error("No GasSuit sensor in this model!") - end -end - -local function background() - local tonefrq,tonelength,tonepause - thistime = getTime() - lastTime = thistime - refreshNext() - if page == 3 then --alarm - local alarmnum = 0 - if fields[3][4] ~= nil and configFields[9][4] ~= nil then - local speedtest = fields[3][4] - local speedover = configFields[9][4]*100 - if speedtest >= speedover then - tonefrq = 800 + math.max(0,math.floor((speedtest - speedover)/10)) - tonelength = 50 + math.max(0,(150 - math.floor((speedtest - speedover)/10))) - tonepause = tonelength - playTone(tonefrq, tonelength, tonepause, PLAY_BACKGROUND,10) - alarmnum = alarmnum + 1 - end - end - if fields[5][4] ~= nil and configFields[7][4] ~= nil then - local Residualtest = fields[5][4] - local Residualline = configFields[6][4] - if Residualtest < Residualline then - tonefrq = 400 - tonelength = 100 - tonepause = 1000 + math.floor( Residualline - Residualtest )*30 - playTone(tonefrq, tonelength, tonepause, PLAY_BACKGROUND,10) - alarmnum = alarmnum + 1 - end - end - if fields[6][4] ~= nil and configFields[8][4] ~= nil then - local Flowtest = fields[6][4] - local Flowover = configFields[7][4] - if Flowtest > Flowover then - tonefrq = 400 - tonelength = 100 - tonepause = 200 - playTone(tonefrq, tonelength, tonepause, PLAY_BACKGROUND,10) - alarmnum = alarmnum + 1 - end - end - if fields[1][4] ~= nil and configFields[10][4] ~= nil then - local temp1test = fields[1][4] -- - local temp1over = configFields[9][4] - if temp1test > temp1over and (temp1test ~= 500 and temp1test ~= 932) then - tonefrq = 2000 - tonelength = 100 - tonepause = 900 - playTone(tonefrq, tonelength, tonepause, PLAY_BACKGROUND,10) - alarmnum = alarmnum + 1 - end - end - if fields[2][4] ~= nil and configFields[11][4] ~= nil then - local temp2test = fields[2][4] - local temp2over = configFields[10][4] - if temp2test > temp2over and (temp2test ~= 500 and temp2test ~= 932) then - tonefrq = 2000 - tonelength = 300 - tonepause = 700 - playTone(tonefrq, tonelength, tonepause, PLAY_BACKGROUND,10) - alarmnum = alarmnum + 1 - end - end - if alarmnum > 1 then - playTone(2000, 100, 100, PLAY_BACKGROUND,10) - end - alarmnum = 0 - end -end - -local function run(event) - if event == nil then - error("Cannot be run as a sensor script!") - return 2 - elseif event == EVT_VIRTUAL_NEXT_PAGE then - selectPage(1) - elseif event == EVT_VIRTUAL_PREV_PAGE then - killEvents(event); - selectPage(-1) - end - local result = pages[page](event) - if page ~= 3 then - refreshNext() - end - background() - return result -end - -return { init=init, background=background, run=run } diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/FrSky RB30_RB40.lua b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/FrSky RB30_RB40.lua deleted file mode 100644 index 213faa6cf..000000000 --- a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/FrSky RB30_RB40.lua +++ /dev/null @@ -1,464 +0,0 @@ ---- - ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------ # # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - -local version = "v1.01" - -local VALUE = 0 -local COMBO = 1 - -local edit = false -local page = 1 -local current = 1 -local refreshState = 0 -local refreshIndex = 0 -local pageOffset = 0 -local pages = {} -local fields = {} -local modifications = {} -local margin = 1 -local spacing = 8 -local numberPerPage = 7 - -local configFields = { - { "Self_stable mode", COMBO, 0x80, nil, { "disable", "enable"} }, - { "Sbus out", COMBO, 0x81, nil, { "disable", "enable"} }, - { "VOut1(V)", VALUE, 0xB2, nil, 50, 84}, - { "VOut2(V)", VALUE, 0xB3, nil, 50, 84}, -} - - -local failsafeFields = { - { "CH1 failsafe", VALUE, 0x82, 150, 80, 220}, - { "CH2 failsafe", VALUE, 0x82, 150, 80, 220}, - { "CH3 failsafe", VALUE, 0x83, 150, 80, 220}, - { "CH4 failsafe", VALUE, 0x83, 150, 80, 220}, - { "CH5 failsafe", VALUE, 0x84, 150, 80, 220}, - { "CH6 failsafe", VALUE, 0x84, 150, 80, 220}, - { "CH7 failsafe", VALUE, 0x85, 150, 80, 220}, - { "CH8 failsafe", VALUE, 0x85, 150, 80, 220}, - { "CH9 failsafe", VALUE, 0x86, 150, 80, 220}, - { "CH10 failsafe", VALUE, 0x86, 150, 80, 220}, - { "CH11 failsafe", VALUE, 0x87, 150, 80, 220}, - { "CH12 failsafe", VALUE, 0x87, 150, 80, 220}, - { "CH13 failsafe", VALUE, 0x88, 150, 80, 220}, - { "CH14 failsafe", VALUE, 0x88, 150, 80, 220}, - { "CH15 failsafe", VALUE, 0x89, 150, 80, 220}, - { "CH16 failsafe", VALUE, 0x89, 150, 80, 220}, - { "CH17 failsafe", VALUE, 0x8A, 150, 80, 220}, - { "CH18 failsafe", VALUE, 0x8A, 150, 80, 220}, - { "CH19 failsafe", VALUE, 0x8B, 150, 80, 220}, - { "CH20 failsafe", VALUE, 0x8B, 150, 80, 220}, - { "CH21 failsafe", VALUE, 0x8C, 150, 80, 220}, - { "CH22 failsafe", VALUE, 0x8C, 150, 80, 220}, - { "CH23 failsafe", VALUE, 0x8D, 150, 80, 220}, - { "CH24 failsafe", VALUE, 0x8D, 150, 80, 220}, -} - -local rx1PinMapFields = { - { "CH1 RX1 map", VALUE, 0x8E, 1, 0, 16}, - { "CH2 RX1 map", VALUE, 0x8E, 2, 0, 16}, - { "CH3 RX1 map", VALUE, 0x8F, 3, 0, 16}, - { "CH4 RX1 map", VALUE, 0x8F, 4, 0, 16}, - { "CH5 RX1 map", VALUE, 0x90, 5, 0, 16}, - { "CH6 RX1 map", VALUE, 0x90, 6, 0, 16}, - { "CH7 RX1 map", VALUE, 0x91, 7, 0, 16}, - { "CH8 RX1 map", VALUE, 0x91, 8, 0, 16}, - { "CH9 RX1 map", VALUE, 0x92, 9, 0, 16}, - { "CH10 RX1 map", VALUE, 0x92, 10, 0, 16}, - { "CH11 RX1 map", VALUE, 0x93, 11, 0, 16}, - { "CH12 RX1 map", VALUE, 0x93, 12, 0, 16}, - { "CH13 RX1 map", VALUE, 0x94, 13, 0, 16}, - { "CH14 RX1 map", VALUE, 0x94, 14, 0, 16}, - { "CH15 RX1 map", VALUE, 0x95, 15, 0, 16}, - { "CH16 RX1 map", VALUE, 0x95, 16, 0, 16}, - { "CH17 RX1 map", VALUE, 0x96, 1, 0, 16}, - { "CH18 RX1 map", VALUE, 0x96, 2, 0, 16}, - { "CH19 RX1 map", VALUE, 0x97, 3, 0, 16}, - { "CH20 RX1 map", VALUE, 0x97, 4, 0, 16}, - { "CH21 RX1 map", VALUE, 0x98, 5, 0, 16}, - { "CH22 RX1 map", VALUE, 0x98, 6, 0, 16}, - { "CH23 RX1 map", VALUE, 0x99, 7, 0, 16}, - { "CH24 RX1 map", VALUE, 0x99, 8, 0, 16}, -} - -local rx2PinMapFields = { - { "CH1 RX2 map", VALUE, 0x9A, 1, 0, 16}, - { "CH2 RX2 map", VALUE, 0x9A, 2, 0, 16}, - { "CH3 RX2 map", VALUE, 0x9B, 3, 0, 16}, - { "CH4 RX2 map", VALUE, 0x9B, 4, 0, 16}, - { "CH5 RX2 map", VALUE, 0x9C, 5, 0, 16}, - { "CH6 RX2 map", VALUE, 0x9C, 6, 0, 16}, - { "CH7 RX2 map", VALUE, 0x9D, 7, 0, 16}, - { "CH8 RX2 map", VALUE, 0x9D, 8, 0, 16}, - { "CH9 RX2 map", VALUE, 0x9E, 9, 0, 16}, - { "CH10 RX2 map", VALUE, 0x9E, 10, 0, 16}, - { "CH11 RX2 map", VALUE, 0x9F, 11, 0, 16}, - { "CH12 RX2 map", VALUE, 0x9F, 12, 0, 16}, - { "CH13 RX2 map", VALUE, 0xA0, 13, 0, 16}, - { "CH14 RX2 map", VALUE, 0xA0, 14, 0, 16}, - { "CH15 RX2 map", VALUE, 0xA1, 15, 0, 16}, - { "CH16 RX2 map", VALUE, 0xA0, 16, 0, 16}, - { "CH17 RX2 map", VALUE, 0xA2, 1, 0, 16}, - { "CH18 RX2 map", VALUE, 0xA2, 2, 0, 16}, - { "CH19 RX2 map", VALUE, 0xA3, 3, 0, 16}, - { "CH20 RX2 map", VALUE, 0xA3, 4, 0, 16}, - { "CH21 RX2 map", VALUE, 0xA4, 5, 0, 16}, - { "CH22 RX2 map", VALUE, 0xA4, 6, 0, 16}, - { "CH23 RX2 map", VALUE, 0xA5, 7, 0, 16}, - { "CH24 RX2 map", VALUE, 0xA5, 8, 0, 16}, -} - -local rx3PinMapFields = { - { "CH1 RX3 map", VALUE, 0xA6, 1, 0, 16}, - { "CH2 RX3 map", VALUE, 0xA6, 2, 0, 16}, - { "CH3 RX3 map", VALUE, 0xA7, 3, 0, 16}, - { "CH4 RX3 map", VALUE, 0xA7, 4, 0, 16}, - { "CH5 RX3 map", VALUE, 0xA8, 5, 0, 16}, - { "CH6 RX3 map", VALUE, 0xA8, 6, 0, 16}, - { "CH7 RX3 map", VALUE, 0xA9, 7, 0, 16}, - { "CH8 RX3 map", VALUE, 0xA9, 8, 0, 16}, - { "CH9 RX3 map", VALUE, 0xAA, 9, 0, 16}, - { "CH10 RX3 map", VALUE, 0xAA, 10, 0, 16}, - { "CH11 RX3 map", VALUE, 0xAB, 11, 0, 16}, - { "CH12 RX3 map", VALUE, 0xAB, 12, 0, 16}, - { "CH13 RX3 map", VALUE, 0xAC, 13, 0, 16}, - { "CH14 RX3 map", VALUE, 0xAC, 14, 0, 16}, - { "CH15 RX3 map", VALUE, 0xAD, 15, 0, 16}, - { "CH16 RX3 map", VALUE, 0xAD, 16, 0, 16}, - { "CH17 RX3 map", VALUE, 0xAE, 1, 0, 16}, - { "CH18 RX3 map", VALUE, 0xAE, 2, 0, 16}, - { "CH19 RX3 map", VALUE, 0xAF, 3, 0, 16}, - { "CH20 RX3 map", VALUE, 0xAF, 4, 0, 16}, - { "CH21 RX3 map", VALUE, 0xB0, 5, 0, 16}, - { "CH22 RX3 map", VALUE, 0xB0, 6, 0, 16}, - { "CH23 RX3 map", VALUE, 0xB1, 7, 0, 16}, - { "CH24 RX3 map", VALUE, 0xB1, 8, 0, 16}, -} - - - - -local function drawScreenTitle(title, page, pages) - if math.fmod(math.floor(getTime() / 100), 10) == 0 then - title = version - end - if LCD_W == 480 then - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, title, MENU_TITLE_COLOR) - lcd.drawText(LCD_W - 40, 5, page .. "/" .. pages, MENU_TITLE_COLOR) - else - lcd.drawScreenTitle(title, page, pages) - end -end - --- Change display attribute to current field -local function addField(step) - local field = fields[current] - local min, max - if field[2] == VALUE then - min = field[5] - max = field[6] - elseif field[2] == COMBO then - min = 0 - max = #(field[5]) - 1 - end - if page == 2 and step < 0 and field[4] == min then - field[4] = 0 - elseif page == 2 and step > 0 and field[4] == 0 then - field[4] = min - else - if (step < 0 and field[4] > min) or (step > 0 and field[4] < max) then - field[4] = field[4] + step - end - end -end - --- Select the next or previous page -local function selectPage(step) - local pagesNum = #pages - if configFields[1][4] == 1 then - pagesNum = 1 - elseif configFields[2][4] == 1 then - pagesNum = pagesNum - 1 - end - page = 1 + ((page + step - 1 + pagesNum) % pagesNum) - refreshIndex = 0 - pageOffset = 0 -end - --- Select the next or previous editable field -local function selectField(step) - current = 1 + ((current + step - 1 + #fields) % #fields) - if current > numberPerPage + pageOffset then - pageOffset = current - numberPerPage - elseif current <= pageOffset then - pageOffset = current - 1 - end -end - -local function drawProgressBar() - if LCD_W == 480 then - local width = (300 * refreshIndex) / #fields - lcd.drawRectangle(100, 10, 300, 6) - lcd.drawFilledRectangle(102, 12, width, 2) - else - local width = (60 * refreshIndex) / #fields - lcd.drawRectangle(45, 1, 60, 6) - lcd.drawFilledRectangle(47, 3, width, 2) - end -end - --- Redraw the current page -local function redrawFieldPage() - lcd.clear() - - local pagesNum = #pages - if configFields[1][4] == 1 then - pagesNum = 1 - elseif configFields[2][4] == 1 then - pagesNum = pagesNum - 1 - end - drawScreenTitle("RB30/RB40", page, pagesNum) - - if refreshIndex < #fields then - drawProgressBar() - end - - for index = 1, numberPerPage, 1 do - local field = fields[pageOffset + index] - if field == nil then - break - end - - local attr = current == (pageOffset + index) and ((edit == true and BLINK or 0) + INVERS) or 0 - - lcd.drawText(1, margin + spacing * index, field[1], attr) - - if field[4] == nil then - lcd.drawText(LCD_W, margin + spacing * index, "---", RIGHT + attr) - else - if field[2] == VALUE then - if page == 2 then - if field[4] == 0 then - lcd.drawText(LCD_W, margin + spacing * index, "No pulse", RIGHT + attr) - else - lcd.drawNumber(LCD_W, margin + spacing * index, field[4] * 10, RIGHT + attr) - end - else - if field[4] == 0 then - lcd.drawText(LCD_W, margin + spacing * index, "No map", RIGHT + attr) - else - if field[3] == 0xB2 or field[3] == 0xB3 then - lcd.drawNumber(LCD_W, margin + spacing * index, field[4] , attr + RIGHT + PREC1) - else - lcd.drawNumber(LCD_W, margin + spacing * index, field[4], RIGHT + attr) - end - end - end - elseif field[2] == COMBO then - if field[4] >= 0 and field[4] < #(field[5]) then - lcd.drawText(LCD_W, margin + spacing * index, field[5][field[4] + 1], RIGHT + attr) - end - end - end - end -end - -local function telemetryIdle(field) - return sportTelemetryPush(0x1C, 0x21, 0x0b80, field) -end - -local function telemetryUnIdle(field) - return sportTelemetryPush(0x1C, 0x20, 0x0b80, field) -end - -local function telemetryRead(field) - return sportTelemetryPush(0x1C, 0x30, 0x0b80, field) -end - -local function telemetryWrite(field, value) - return sportTelemetryPush(0x1C, 0x31, 0x0b80, field + value * 256) -end - -local telemetryPopTimeout = 0 -local function refreshNext() - if refreshState == 0 then - if #modifications > 0 then - telemetryWrite(modifications[1][1], modifications[1][2]) - modifications[1] = nil - refreshIndex = 0 - refreshState = 0 - elseif refreshIndex < #fields then - local field = fields[refreshIndex + 1] - if page > 1 then - field = fields[refreshIndex + 2] - end - if telemetryRead(field[3]) == true then - refreshState = 1 - telemetryPopTimeout = getTime() + 100 -- normal delay is 500ms - end - end - elseif refreshState == 1 then - local physicalId, primId, dataId, value = sportTelemetryPop() - if primId == 0x32 and (dataId >= 0x0b80 or dataId <= 0x0b8f) then - local fieldId = value % 256 - local field = fields[refreshIndex + 1] - if fieldId == field[3] then - value = math.floor(value / 256) - if field[2] == COMBO then - fields[refreshIndex + 1][4] = value - else - fields[refreshIndex + 1][4] = value % 256 - if page > 1 then - value = math.floor(value / 256) - fields[refreshIndex + 2][4] = value - end - end - if page > 1 then - refreshIndex = refreshIndex + 2 - else - refreshIndex = refreshIndex + 1 - end - refreshState = 0 - end - elseif getTime() > telemetryPopTimeout then - fields[refreshIndex + 1][4] = nil - if page > 1 then - fields[refreshIndex + 2][4] = nil - refreshIndex = refreshIndex + 2 - else - refreshIndex = refreshIndex + 1 - end - refreshState = 0 - end - end -end - -local function updateField(field) - local value = field[4] - if field[2] == COMBO and #field == 6 then - value = field[6][1 + value] - elseif field[2] == VALUE and #field == 8 then - value = value + field[8] - field[5] - end - - if page > 1 then - if current % 2 == 1 then - value = value + fields[current + 1][4] * 256 - elseif current % 2 == 0 then - value = fields[current - 1][4] + value * 256 - end - end - modifications[#modifications + 1] = { field[3], value } -end - --- Main -local function runFieldsPage(event) - if event == EVT_VIRTUAL_EXIT then -- exit script - telemetryUnIdle(0x80) - return 2 - elseif event == EVT_VIRTUAL_ENTER then -- toggle editing/selecting current field - if fields[current][4] ~= nil then - edit = not edit - if edit == false then - updateField(fields[current]) - end - end - elseif edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - addField(1) - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - addField(-1) - end - else - if event == EVT_VIRTUAL_NEXT then - selectField(1) - elseif event == EVT_VIRTUAL_PREV then - selectField(-1) - end - end - redrawFieldPage() - return 0 -end - -local function runConfigPage(event) - fields = configFields - return runFieldsPage(event) -end - -local function runFailsafePage(event) - fields = failsafeFields - return runFieldsPage(event) -end - -local function runRx1PinMapPage(event) - fields = rx1PinMapFields - return runFieldsPage(event) -end - -local function runRx2PinMapPage(event) - fields = rx2PinMapFields - return runFieldsPage(event) -end - -local function runRx3PinMapPage(event) - fields = rx3PinMapFields - return runFieldsPage(event) -end - --- Init -local function init() - current, edit, refreshState, refreshIndex = 1, false, 0, 0 - if LCD_W == 480 then - margin = 10 - spacing = 20 - numberPerPage = 12 - end - pages = { - runConfigPage, - runFailsafePage, - runRx1PinMapPage, - runRx2PinMapPage, - runRx3PinMapPage - } - telemetryIdle(0x80) -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_NEXT_PAGE then - if edit == false then - selectPage(1) - end - elseif event == EVT_VIRTUAL_PREV_PAGE then - if edit == false then - killEvents(event) - selectPage(-1) - end - end - - local result = pages[page](event) - refreshNext() - - return result -end - -return { init = init, run = run } - diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/FrSky SBEC.lua b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/FrSky SBEC.lua deleted file mode 100644 index 4e05de057..000000000 --- a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/FrSky SBEC.lua +++ /dev/null @@ -1,284 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - -local version = "v1.2" - -local VALUE = 0 -local COMBO = 1 - -local edit = false -local page = 1 -local current = 1 --row -local refreshState = 0 -local refreshIndex = 0 -local pageOffset = 0 -local pages = {} -local fields = {} -local modifications = {} -local margin = 1 -local spacing = 8 -local appId = 0 - -local function drawScreenTitle(title,page, pages) - if math.fmod(math.floor(getTime()/100),10) == 0 then - title = version - end - if LCD_W == 480 then - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, title, MENU_COLOR) - lcd.drawText(LCD_W-40, 5, page.."/"..pages, MENU_COLOR) - else - lcd.drawScreenTitle(title, page, pages) - end -end - -local settingsFields = { - {"SBEC OUTPUT (V)", VALUE, 0x80, nil, 50, 84 }, - {"Physical ID", VALUE, 0x01, nil, 0, 26 }, - {"Application IDgroup", VALUE, 0x0D, nil, 0, 15 }, - {"Data rate(*100ms)", VALUE, 0x22, nil, 1, 255 }, -} - --- Change display attribute to current field -local function addField(step) - local field = fields[current] - local min, max - if field[2] == VALUE then - min = field[5] - max = field[6] - elseif field[2] == COMBO then - min = 0 - max = #(field[5]) - 1 - end - if field[2] ~= FLPOT then --only read ? - if field[2] == VALUE and field[6] > 256 then - if field[4] > 1000 then - step = step * 50 - field[4] = math.floor(field[4]/50) - field[4] = field[4] *50 - elseif field[4] > 500 then - step = step * 20 - field[4] = math.floor(field[4]/20) - field[4] = field[4] *20 - elseif field[4] > 200 then - step = step * 10 - field[4] = math.floor(field[4]/10) - field[4] = field[4] *10 - else - step = step * 1 - field[4] = math.floor(field[4]/1) - field[4] = field[4] *1 - end - end - if (step < 0 and field[4] > min) or (step > 0 and field[4] < max) then - field[4] = field[4] + step - end - else - field[4] = field[4] - end -end - - --- Select the next or previous editable field -local function selectField(step) - current = current + step - if current > #fields then - current = #fields - elseif current < 1 then - current = 1 - end - if current > 7 + pageOffset then - pageOffset = current - 7 - elseif current <= pageOffset then - pageOffset = current - 1 - end -end - -local function drawProgressBar() - if LCD_W == 480 then - local width = (300 * refreshIndex) / #fields - lcd.drawRectangle(100, 10, 300, 6) - lcd.drawFilledRectangle(102, 13, width, 2); - else - local width = (60 * refreshIndex) / #fields - lcd.drawRectangle(45, 1, 60, 6) - lcd.drawFilledRectangle(47, 3, width, 2); - end -end - --- Redraw the current page -local function redrawFieldsPage() - lcd.clear() - drawScreenTitle("SBEC", page, #pages) - if refreshIndex < #fields then - drawProgressBar() - end - for index = 1, 7, 1 do - local field = fields[pageOffset+index] - if field == nil then - break - end - local attr = current == (pageOffset+index) and ((edit == true and BLINK or 0) + INVERS) or 0 - lcd.drawText(1, margin+ spacing * index, field[1]) - if field[4] == nil then - lcd.drawText(LCD_W, margin+ spacing * index, "---", attr + RIGHT) - else - if field[2] == VALUE then - if field[3] == 0x80 then - lcd.drawNumber(LCD_W, margin+ spacing * index, field[4] , attr + RIGHT + PREC1) - else - lcd.drawNumber(LCD_W, margin+ spacing * index, field[4] , attr + RIGHT) - end - end - end - end -end - -local function telemetryRead(fieldx) - return sportTelemetryPush(0x17, 0x30, appId, fieldx) -end - -local function telemetryIdle(field) - return sportTelemetryPush(0x17, 0x21, appId, field) -end - -local function telemetryUnIdle(field) - return sportTelemetryPush(0x17, 0x20, appId, field) -end - -local function telemetryWrite(fieldx, valuex) - return sportTelemetryPush(0x17, 0x31, appId, fieldx + valuex*256) -end - -local telemetryPopTimeout = 0 -local function refreshNext() - if refreshState == 0 then - if #modifications > 0 then - local modificationstmp = modifications[1][2] - telemetryWrite(modifications[1][1], modificationstmp) - refreshIndex = 0 - modifications[1] = nil - elseif refreshIndex < #fields then - local field = fields[refreshIndex + 1] - if telemetryRead(field[3]) == true then - refreshState = 1 - telemetryPopTimeout = getTime() + 80 - end - end - elseif refreshState == 1 then - local physicalId, primId, dataId, value = sportTelemetryPop() - if primId == 0x32 and dataId == appId then - local fieldId = value % 256 - local field = fields[refreshIndex + 1] - if fieldId == field[3] then - local value = math.floor(value / 256) - if field[2] == VALUE then - value = value - end - - fields[refreshIndex + 1][4] = value - refreshIndex = refreshIndex + 1 - refreshState = 0 - end - elseif getTime() > telemetryPopTimeout then - refreshState = 0 - end - end -end - -local function updateField(field) - local value = field[4] - if field[2] == VALUE and #field == 6 then - value = value - end - modifications[#modifications+1] = {field[3], value} -end - --- Main1 -local function runFieldsPage(event) - if event == EVT_VIRTUAL_EXIT then - telemetryUnIdle(0x80) - return 2 - elseif event == EVT_VIRTUAL_ENTER then - if fields[current][4] ~= nil then - edit = not edit - if edit == false then - updateField(fields[current]) - end - end - elseif edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - addField(1) - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - addField(-1) - end - else - if event == EVT_VIRTUAL_NEXT then - selectField(1) - elseif event == EVT_VIRTUAL_PREV then - selectField(-1) - end - end - redrawFieldsPage() - return 0 -end - -local function runSettingsPage(event) - fields = settingsFields - return runFieldsPage(event) -end - --- Init -local function init() - current, edit, refreshState, refreshIndex = 1, false, 0, 0 - if LCD_W == 480 then - margin = 10 - spacing = 20 - end - - pages = { - runSettingsPage, - } - - for index = 1, 40, 1 do - local sensor = model.getSensor(index) - if sensor ~= nil and sensor.id >= 0x0e50 and sensor.id <= 0x0e5f then - appId = sensor.id - break - end - end - - if appId == 0 then - error("No SBEC sensor in this model!") - end - - telemetryIdle(0x80) -end - -local function run(event) - if event == nil then - error("Cannot run as a model script!") - return 2 - end - local result = pages[page](event) - - refreshNext() - - return result -end - -return { init=init, background=background, run=run } diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/FrSky SxR.lua b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/FrSky SxR.lua deleted file mode 100755 index 7bbf9a13d..000000000 --- a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/FrSky SxR.lua +++ /dev/null @@ -1,363 +0,0 @@ ---- - ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------ # # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - -local version = "v2.00" - -local VALUE = 0 -local COMBO = 1 - -local COLUMN_2 = 300 - -local edit = false -local page = 1 -local current = 1 -local refreshState = 0 -local refreshIndex = 0 -local calibrationState = 0 -local pageOffset = 0 -local calibrationStep = 0 -local pages = {} -local fields = {} -local modifications = {} -local wingBitmaps = {} -local mountBitmaps = {} -local margin = 1 -local spacing = 8 -local counter = 0 - -local configFields = { - { "Wing type", COMBO, 0x80, nil, { "Normal", "Delta", "VTail" } }, - { "Mounting type", COMBO, 0x81, nil, { "Horz", "Horz rev.", "Vert", "Vert rev." } }, -} - -local wingBitmapsFile = { "/SCRIPTS/TOOLS/bmp/plane.bmp", "/SCRIPTS/TOOLS/bmp/delta.bmp", "/SCRIPTS/TOOLS/bmp/vtail.bmp" } -local mountBitmapsFile = { "/SCRIPTS/TOOLS/bmp/horz.bmp", "/SCRIPTS/TOOLS/bmp/horz-r.bmp", "/SCRIPTS/TOOLS/bmp/vert.bmp", "/SCRIPTS/TOOLS/bmp/vert-r.bmp" } - -local settingsFields = { - {"SxR functions", COMBO, 0x9C, nil, { "Disable", "Enable" } }, - {"Quick Mode:", COMBO, 0xAA, nil, { "Disable", "Enable" } }, - {"CH5 mode", COMBO, 0xA8, nil, { "AIL2", "AUX1" } }, - {"CH6 mode", COMBO, 0xA9, nil, { "ELE2", "AUX2" } }, - {"AIL direction", COMBO, 0x82, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"ELE direction", COMBO, 0x83, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"RUD direction", COMBO, 0x84, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"AIL2 direction", COMBO, 0x9A, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"ELE2 direction", COMBO, 0x9B, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"AIL stab gain", VALUE, 0x85, nil, 0, 200, "%"}, - {"ELE stab gain", VALUE, 0x86, nil, 0, 200, "%"}, - {"RUD stab gain", VALUE, 0x87, nil, 0, 200, "%"}, - {"AIL autolvl gain", VALUE, 0x88, nil, 0, 200, "%"}, - {"ELE autolvl gain", VALUE, 0x89, nil, 0, 200, "%"}, - {"ELE hover gain", VALUE, 0x8C, nil, 0, 200, "%"}, - {"RUD hover gain", VALUE, 0x8D, nil, 0, 200, "%"}, - {"AIL knife gain", VALUE, 0x8E, nil, 0, 200, "%"}, - {"RUD knife gain", VALUE, 0x90, nil, 0, 200, "%"}, - {"AIL autolvl offset", VALUE, 0x91, nil, -20, 20, "%", 0x6C}, - {"ELE autolvl offset", VALUE, 0x92, nil, -20, 20, "%", 0x6C}, - {"ELE hover offset", VALUE, 0x95, nil, -20, 20, "%", 0x6C}, - {"RUD hover offset", VALUE, 0x96, nil, -20, 20, "%", 0x6C}, - {"AIL knife offset", VALUE, 0x97, nil, -20, 20, "%", 0x6C}, - {"RUD knife offset", VALUE, 0x99, nil, -20, 20, "%", 0x6C}, -} - -local calibrationFields = { - { "X:", VALUE, 0x9E, 0, -100, 100, "%" }, - { "Y:", VALUE, 0x9F, 0, -100, 100, "%" }, - { "Z:", VALUE, 0xA0, 0, -100, 100, "%" } -} - -local function drawScreenTitle(title, page, pages) - if math.fmod(math.floor(getTime() / 100), 10) == 0 then - title = version - end - if LCD_W == 480 then - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, title, MENU_COLOR) - lcd.drawText(LCD_W - 40, 5, page .. "/" .. pages, MENU_COLOR) - else - lcd.drawScreenTitle(title, page, pages) - end -end - --- Change display attribute to current field -local function addField(step) - local field = fields[current] - local min, max - if field[2] == VALUE then - min = field[5] - max = field[6] - elseif field[2] == COMBO then - min = 0 - max = #(field[5]) - 1 - end - if (step < 0 and field[4] > min) or (step > 0 and field[4] < max) then - field[4] = field[4] + step - end -end - --- Select the next or previous page -local function selectPage(step) - page = 1 + ((page + step - 1 + #pages) % #pages) - refreshIndex = 0 - calibrationStep = 0 - pageOffset = 0 -end - --- Select the next or previous editable field -local function selectField(step) - current = 1 + ((current + step - 1 + #fields) % #fields) - if current > 7 + pageOffset then - pageOffset = current - 7 - elseif current <= pageOffset then - pageOffset = current - 1 - end -end - -local function drawProgressBar() - if LCD_W == 480 then - local width = (300 * refreshIndex) / #fields - lcd.drawRectangle(100, 10, 300, 6) - lcd.drawFilledRectangle(102, 13, width, 2); - else - local width = (60 * refreshIndex) / #fields - lcd.drawRectangle(45, 1, 60, 6) - lcd.drawFilledRectangle(47, 3, width, 2); - end -end - --- Redraw the current page -local function redrawFieldsPage(event) - lcd.clear() - drawScreenTitle("SxR", page, #pages) - - if refreshIndex < #fields then - drawProgressBar() - end - - for index = 1, 10, 1 do - local field = fields[pageOffset + index] - if field == nil then - break - end - - local attr = current == (pageOffset + index) and ((edit == true and BLINK or 0) + INVERS) or 0 - - lcd.drawText(1, margin + spacing * index, field[1], attr) - - if field[4] == nil then - lcd.drawText(LCD_W, margin + spacing * index, "---", RIGHT + attr) - else - if field[2] == VALUE then - lcd.drawNumber(LCD_W, margin + spacing * index, field[4], RIGHT + attr) - elseif field[2] == COMBO then - if field[4] >= 0 and field[4] < #(field[5]) then - lcd.drawText(LCD_W, margin + spacing * index, field[5][1 + field[4]], RIGHT + attr) - end - end - end - end -end - -local function telemetryRead(field) - return sportTelemetryPush(0x17, 0x30, 0x0C30, field) -end - -local function telemetryWrite(field, value) - return sportTelemetryPush(0x17, 0x31, 0x0C30, field + value * 256) -end - -local telemetryPopTimeout = 0 -local function refreshNext() - if refreshState == 0 then - if calibrationState == 1 then - if telemetryWrite(0x9D, calibrationStep) == true then - refreshState = 1 - calibrationState = 2 - telemetryPopTimeout = getTime() + 120 -- normal delay is 500ms - end - elseif #modifications > 0 then - telemetryWrite(modifications[1][1], modifications[1][2]) - modifications[1] = nil - elseif refreshIndex < #fields then - local field = fields[refreshIndex + 1] - if telemetryRead(field[3]) == true then - refreshState = 1 - telemetryPopTimeout = getTime() + 80 -- normal delay is 500ms - end - end - elseif refreshState == 1 then - local physicalId, primId, dataId, value = sportTelemetryPop() - if physicalId == 0x1A and primId == 0x32 and dataId == 0x0C30 then - local fieldId = value % 256 - if calibrationState == 2 then - if fieldId == 0x9D then - refreshState = 0 - calibrationState = 0 - calibrationStep = (calibrationStep + 1) % 7 - end - else - local field = fields[refreshIndex + 1] - if fieldId == field[3] then - local value = math.floor(value / 256) - if field[3] == 0xAA then - value = bit32.band(value, 0x0001) - end - if field[3] >= 0x9E and field[3] <= 0xA0 then - local b1 = value % 256 - local b2 = math.floor(value / 256) - value = b1 * 256 + b2 - value = value - bit32.band(value, 0x8000) * 2 - end - if field[2] == COMBO and #field == 6 then - for index = 1, #(field[6]), 1 do - if value == field[6][index] then - value = index - 1 - break - end - end - elseif field[2] == VALUE and #field == 8 then - value = value - field[8] + field[5] - end - fields[refreshIndex + 1][4] = value - refreshIndex = refreshIndex + 1 - refreshState = 0 - end - end - elseif getTime() > telemetryPopTimeout then - fields[refreshIndex + 1][4] = nil - refreshIndex = refreshIndex + 1 - refreshState = 0 - calibrationState = 0 - end - end -end - -local function updateField(field) - local value = field[4] - if field[2] == COMBO and #field == 6 then - value = field[6][1 + value] - elseif field[2] == VALUE and #field == 8 then - value = value + field[8] - field[5] - end - modifications[#modifications + 1] = { field[3], value } -end - --- Main -local function runFieldsPage(event) - if event == EVT_VIRTUAL_EXIT then -- exit script - return 2 - elseif event == EVT_VIRTUAL_ENTER then -- toggle editing/selecting current field - if fields[current][4] ~= nil then - edit = not edit - if edit == false then - updateField(fields[current]) - end - end - elseif edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - addField(1) - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - addField(-1) - end - else - if event == EVT_VIRTUAL_NEXT then - selectField(1) - elseif event == EVT_VIRTUAL_PREV then - selectField(-1) - end - end - redrawFieldsPage(event) - return 0 -end - -local function runConfigPage(event) - fields = configFields - local result = runFieldsPage(event) - if LCD_W == 128 then - local mountText = { "Label is facing the sky", "Label is facing ground", "Label is left when", "Label is right when" } - if fields[2][4] ~= nil then - lcd.drawText(1, 30, "Pins toward tail") - lcd.drawText(1, 40, mountText[1 + fields[2][4]]) - if fields[2][4] > 1 then - lcd.drawText(1, 50, "looking from the tail") - end - end - else - if fields[1][4] ~= nil then - if LCD_W == 480 then - if wingBitmaps[1 + fields[1][4]] == nil then - wingBitmaps[1 + fields[1][4]] = Bitmap.open(wingBitmapsFile[1 + fields[1][4]]) - end - lcd.drawBitmap(wingBitmaps[1 + fields[1][4]], 10, 90) - else - lcd.drawPixmap(20, 28, wingBitmapsFile[1 + fields[1][4]]) - end - end - if fields[2][4] ~= nil then - if LCD_W == 480 then - if mountBitmaps[1 + fields[2][4]] == nil then - mountBitmaps[1 + fields[2][4]] = Bitmap.open(mountBitmapsFile[1 + fields[2][4]]) - end - lcd.drawBitmap(mountBitmaps[1 + fields[2][4]], 190, 110) - else - lcd.drawPixmap(128, 28, mountBitmapsFile[1 + fields[2][4]]) - end - end - end - return result -end - -local function runSettingsPage(event) - fields = settingsFields - return runFieldsPage(event) -end - --- Init -local function init() - current, edit, refreshState, refreshIndex = 1, false, 0, 0 - if LCD_W == 480 then - margin = 10 - spacing = 20 - wingBitmapsFile = { "/SCRIPTS/TOOLS/img/plane_b.png", "/SCRIPTS/TOOLS/img/delta_b.png", "/SCRIPTS/TOOLS/img/planev_b.png" } - mountBitmapsFile = { "/SCRIPTS/TOOLS/img/up.png", "/SCRIPTS/TOOLS/img/down.png", "/SCRIPTS/TOOLS/img/vert.png", "/SCRIPTS/TOOLS/img/vert-r.png" } - end - pages = { - runConfigPage, - runSettingsPage, - } -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_NEXT_PAGE then - selectPage(1) - elseif event == EVT_VIRTUAL_PREV_PAGE then - killEvents(event); - selectPage(-1) - end - - local result = pages[page](event) - refreshNext() - - return result -end - -return { init = init, run = run } - diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/Graupner HoTT.lua b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/Graupner HoTT.lua deleted file mode 100644 index d0a7d4af8..000000000 --- a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/Graupner HoTT.lua +++ /dev/null @@ -1,171 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - - ---############################################################################### --- Multi buffer for HoTT description --- To start operation: --- Write "HoTT" at address 0..3 --- Write 0xFF at address 4 will request the buffer to be cleared --- Write 0x0F at address 5 --- Read buffer from address 6 access the RX text for 168 bytes, 21 caracters --- by 8 lines --- Write at address 5 sends an order to the RX: 0xXF=start, 0xX7=prev page, --- 0xXE=next page, 0xX9=enter, 0xXD=next or 0xXB=prev with X being the sensor --- to request data from 8=RX only, 9=Vario, A=GPS, B=Cust, C=ESC, D=GAM, E=EAM --- Write at address 4 the value 0xFF will request the buffer to be cleared --- !! Before exiting the script must write 0 at address 0 for normal operation !! ---############################################################################### - -HoTT_Sensor = 0 -Timer_128 = 100 - -local function HoTT_Release() - multiBuffer( 0, 0 ) -end - -local function HoTT_Send(button) - multiBuffer( 5, 0x80+(HoTT_Sensor*16) + button) -end - -local function HoTT_Sensor_Inc() - local detected_sensors=multiBuffer( 4 ) - local a - if detected_sensors ~= 0xFF then - repeat - HoTT_Sensor=(HoTT_Sensor+1)%7 -- Switch to next sensor - if HoTT_Sensor ~= 0 then - a = math.floor(detected_sensors/ (2^(HoTT_Sensor-1))) -- shift right - end - until HoTT_Sensor==0 or a % 2 == 1 - HoTT_Send( 0x0F ) - end -end - -local function HoTT_Draw_LCD() - local i - local value - local line - local result - local offset=0 - - local sensor_name = { "", "+Vario", "+GPS", "+Cust", "+ESC", "+GAM", "+EAM" } - - lcd.clear() - - if LCD_W == 480 then - --Draw title - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, "Graupner HoTT: config RX" .. sensor_name[HoTT_Sensor+1] .. " - Menu cycle Sensors", MENU_TITLE_COLOR) - --Draw RX Menu - if multiBuffer( 4 ) == 0xFF then - lcd.drawText(10,50,"No HoTT telemetry...", BLINK) - else - for line = 0, 7, 1 do - for i = 0, 21-1, 1 do - value=multiBuffer( line*21+6+i ) - if value > 0x80 then - value = value - 0x80 - lcd.drawText(10+i*16,32+20*line,string.char(value).." ",INVERS) - else - lcd.drawText(10+i*16,32+20*line,string.char(value)) - end - end - end - end - else - --Draw RX Menu on LCD_W=128 - if multiBuffer( 4 ) == 0xFF then - lcd.drawText(2,17,"No HoTT telemetry...",SMLSIZE) - else - if Timer_128 ~= 0 then - --Intro page - Timer_128 = Timer_128 - 1 - lcd.drawScreenTitle("Graupner Hott",0,0) - lcd.drawText(2,17,"Configuration of RX" .. sensor_name[HoTT_Sensor+1] ,SMLSIZE) - lcd.drawText(2,37,"Press menu to cycle Sensors" ,SMLSIZE) - else - --Menu page - for line = 0, 7, 1 do - for i = 0, 21-1, 1 do - value=multiBuffer( line*21+6+i ) - if value > 0x80 then - value = value - 0x80 - lcd.drawText(2+i*6,1+8*line,string.char(value).." ",SMLSIZE+INVERS) - else - lcd.drawText(2+i*6,1+8*line,string.char(value),SMLSIZE) - end - end - end - end - end - end -end - --- Init -local function HoTT_Init() - --Set protocol to talk to - multiBuffer( 0, string.byte('H') ) - --test if value has been written - if multiBuffer( 0 ) ~= string.byte('H') then - error("Not enough memory!") - return 2 - end - multiBuffer( 1, string.byte('o') ) - multiBuffer( 2, string.byte('T') ) - multiBuffer( 3, string.byte('T') ) - --Request init of the RX buffer - multiBuffer( 4, 0xFF ) - --Request RX to send the config menu - HoTT_Send( 0x0F ) - HoTT_Sensor = 0; - HoTT_Detected_Sensors=0; - Timer_128 = 100 -end - --- Main -local function HoTT_Run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_EXIT then - HoTT_Release() - return 2 - else - if event == EVT_VIRTUAL_PREV_PAGE then - killEvents(event) - HoTT_Send( 0x07 ) - elseif event == EVT_VIRTUAL_ENTER then - HoTT_Send( 0x09 ) - elseif event == EVT_VIRTUAL_PREV then - HoTT_Send( 0x0B ) - elseif event == EVT_VIRTUAL_NEXT then - HoTT_Send( 0x0D ) - elseif event == EVT_VIRTUAL_NEXT_PAGE then - HoTT_Send( 0x0E ) - elseif event == EVT_VIRTUAL_MENU then - Timer_128 = 100 - HoTT_Sensor_Inc() - else - HoTT_Send( 0x0F ) - end - HoTT_Draw_LCD() - return 0 - end -end - -return { init=HoTT_Init, run=HoTT_Run } diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/MultiChan.txt b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/MultiChan.txt deleted file mode 100644 index 305451422..000000000 --- a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/MultiChan.txt +++ /dev/null @@ -1,192 +0,0 @@ -24,0,Assan,Std,0,CH5,CH6,CH7,CH8 -14,0,Bayang,Std,1,Flip,RTH,Pict,Video,HLess,Invert,Rates,n-a,n-a,AnAux1,AnAux2 -14,1,Bayang,H8S3D,1,Flip,RTH,Pict,Video,HLess,Invert,Rates -14,2,Bayang,X16_AH,1,Flip,RTH,Pict,Video,HLess,Invert,Rates,TakeOf -14,3,Bayang,IRDRONE,1,Flip,RTH,Pict,Video,HLess,Invert,Rates,TakeOf,EmStop -14,4,Bayang,DHD_D4,1,Flip,RTH,Pict,Video,HLess,Invert,Rates,TakeOf,EmStop -14,5,Bayang,QX100,1,Flip,RTH,Pict,Video,HLess,Invert,Rates,TakeOf,EmStop -59,0,BayangRX,RX,1,AnAux1,AnAux2,Flip,RTH,Pict,Video -59,1,BayangRX,CPPM,1,AnAux1,AnAux2,Flip,RTH,Pict,Video -41,0,Bugs,3-6-8,0,Arm,Angle,Flip,Pict,Video,LED -42,0,BugsMini,Mini,0,Arm,Angle,Flip,Pict,Video,LED -42,1,BugsMini,3H,0,Arm,Angle,Flip,Pict,Video,LED,AltHol -34,0,Cabell,V3,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -34,1,Cabell,V3Telem,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -13,0,CG023,Std,1,Flip,Light,Pict,Video,HLess -13,1,CG023,YD829,1,Flip,n-a,Pict,Video,HLess -37,0,Corona,COR_V1,0,CH5,CH6,CH7,CH8 -37,1,Corona,COR_V2,0,CH5,CH6,CH7,CH8 -37,2,Corona,FD_V3,0,CH5,CH6,CH7,CH8 -12,0,CX10,Green,1,Flip,Rate -12,1,CX10,Blue,1,Flip,Rate,Pict,Video -12,2,CX10,DM007,1,Flip,Mode,Pict,Video,HLess -12,4,CX10,JC3015_1,1,Flip,Mode,Pict,Video -12,5,CX10,JC3015_2,1,Flip,Mode,LED,DFlip -12,6,CX10,MK33041,1,Flip,Mode,Pict,Video,HLess,RTH -7,0,Devo,8CH,0,CH5,CH6,CH7,CH8 -7,1,Devo,10CH,0,CH5,CH6,CH7,CH8,CH9,CH10 -7,2,Devo,12CH,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12 -7,3,Devo,6CH,0,CH5,CH6 -7,4,Devo,7CH,0,CH5,CH6,CH7 -33,0,DM022,Std,1,Flip,LED,Cam1,Cam2,HLess,RTH,RLow -6,0,DSM,2_22,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,n-a,ThKill -6,1,DSM,2_11,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,n-a,ThKill -6,2,DSM,X_22,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,n-a,ThKill -6,3,DSM,X_11,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,n-a,ThKill -6,4,DSM,AUTO,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,n-a,ThKill -70,0,DSM_RX,RX,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12 -70,1,DSM_RX,CPPM,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12 -45,0,E01X,E012,1,n-a,Flip,n-a,HLess,RTH -45,1,E01X,E015,1,Arm,Flip,LED,HLess,RTH -16,0,ESKY,Std,0,Gyro,Pitch -16,1,ESKY,ET4,0,Gyro,Pitch -35,0,ESKY150,4CH,0 -35,1,ESKY150,7CH,0,FMode,Aux6,Aux7 -69,0,ESKY150V2,Std,0,CH5_RA,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -1,0,Flysky,Flysky,0,CH5,CH6,CH7,CH8 -1,1,Flysky,V9x9,1,Flip,Light,Pict,Video -1,2,Flysky,V6x6,1,Flip,Light,Pict,Video,HLess,RTH,XCAL,YCAL -1,3,Flysky,V912,1,BtmBtn,TopBtn -1,4,Flysky,CX20,0,CH5,CH6,CH7 -28,0,Flysky_AFHDS2A,PWM_IBUS,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 -28,1,Flysky_AFHDS2A,PPM_IBUS,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 -28,2,Flysky_AFHDS2A,PWM_SBUS,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 -28,3,Flysky_AFHDS2A,PPM_SBUS,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 -28,4,Flysky_AFHDS2A,PWM_IB16,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -28,5,Flysky_AFHDS2A,PPM_IB16,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -56,0,Flysky2A_RX,RX,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 -56,1,Flysky2A_RX,CPPM,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 -53,0,Height,5ch,0,Gear -53,1,Height,8ch,0,Gear,Gyro,Flap,Light -25,0,FrSkyV,V8,0,CH5,CH6,CH7,CH8 -3,0,FrSkyD,D8,0,CH5,CH6,CH7,CH8 -3,0,FrSkyD,D8Cloned,0,CH5,CH6,CH7,CH8 -67,0,FrSkyL,LR12,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12 -67,1,FrSkyL,LR12_6CH,0,CH5,CH6 -15,0,FrSkyX,D16_FCC,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -15,1,FrSkyX,D16_8CH_FCC,0,CH5,CH6,CH7,CH8 -15,2,FrSkyX,D16_LBT,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -15,3,FrSkyX,D16_8CH_LBT,0,CH5,CH6,CH7,CH8 -15,4,FrSkyX,D16Cloned,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -15,5,FrSkyX,D16Cloned_8CH,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -64,0,FrSkyX2,D16_FCC,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -64,1,FrSkyX2,D16_8CH_FCC,0,CH5,CH6,CH7,CH8 -64,2,FrSkyX2,D16_LBT,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -64,3,FrSkyX2,D16_8CH_LBT,1,CH5,CH6,CH7,CH8 -64,4,FrSkyX2,D16Cloned,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -64,5,FrSkyX2,D16Cloned_8CH,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -65,0,FrSkyR9,R9_915,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -65,1,FrSkyR9,R9_868,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -65,2,FrSkyR9,R9_915_8CH,0,CH5,CH6,CH7,CH8 -65,3,FrSkyR9,R9_968_8CH,0,CH5,CH6,CH7,CH8 -55,0,FrSkyRX,RX,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -55,1,FrSkyRX,CloneTX,0 -55,2,FrSkyRX,EraseTX,0 -55,3,FrSkyRX,CPPM,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -58,0,FX816,P38,1 -20,0,FY326,FY326,1,Flip,RTH,HLess,Expert,Calib -20,1,FY326,FY319,1,Flip,RTH,HLess,Expert,Calib -23,0,FY326,FY326,1,Flip,RTH,HLess,Expert -47,0,GD00x,V1,1,Trim,LED,Rate -47,1,GD00x,V2,1,Trim,LED,Rate -32,0,GW008,FY326,1,Flip -36,0,H8_3D,Std,1,Flip,Light,Pict,Video,RTH,FlMode,Cal1 -36,1,H8_3D,H20H,1,Flip,Light,Pict,Video,Opt1,Opt2,Cal1,Cal2,Gimbal -36,2,H8_3D,H20,1,Flip,Light,Pict,Video,Opt1,Opt2,Cal1,Cal2,Gimbal -36,3,H8_3D,H30,1,Flip,Light,Pict,Video,Opt1,Opt2,Cal1,Cal2,Gimbal -4,0,Hisky,Std,0,Gear,Pitch,Gyro,CH8 -4,1,Hisky,HK310,0,Aux -39,0,Hitec,Opt_Fw,0,CH5,CH6,CH7,CH8,CH9 -39,1,Hitec,Opt_Hub,0,CH5,CH6,CH7,CH8,CH9 -39,2,Hitec,Minima,0,CH5,CH6,CH7,CH8,CH9 -26,0,Hontai,Std,1,Flip,LED,Pict,Video,HLess,RTH,Calib -26,1,Hontai,JJRCX1,1,Flip,Arm,Pict,Video,HLess,RTH,Calib -26,2,Hontai,X5C1,1,Flip,Arm,Pict,Video,HLess,RTH,Calib -26,3,Hontai,FQ777_951,1,Flip,Arm,Pict,Video,HLess,RTH,Calib -57,0,HoTT,Sync,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -57,1,HoTT,No_Sync,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -2,0,Hubsan,H107,1,Flip,Light,Pict,Video,HLess -2,1,Hubsan,H301,0,RTH,Light,Stab,Video -2,2,Hubsan,H501,0,RTH,Light,Pict,Video,HLess,GPS_H,ALT_H,Flip,FModes -22,0,J6Pro,Std,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12 -71,0,JJRC345,JJRC345,1,Flip,HLess,RTH,LED,UNK1,UNK2,UNK3 -71,1,JJRC345,SkyTmblr,1,Flip,HLess,RTH,LED,UNK1,UNK2,UNK3 -49,0,KF606,Std,1,Trim -9,0,KN,WLToys,0,DRate,THold,IdleUp,Gyro,Ttrim,Atrim,Etrim -9,1,KN,Feilun,0,DRate,THold,IdleUp,Gyro,Ttrim,Atrim,Etrim -73,0,Kyosho,Std,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 -18,0,MJXQ,WHL08,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate -18,1,MJXQ,X600,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate -18,2,MJXQ,X800,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate -18,3,MJXQ,H26D,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate -18,4,MJXQ,E010,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate -18,5,MJXQ,H26WH,1,Flip,Arm,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate -18,6,MJXQ,Phoenix,1,Flip,Arm,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate -17,0,MT99XX,Std,1,Flip,LED,Pict,Video,HLess -17,1,MT99XX,H7,1,Flip,LED,Pict,Video,HLess -17,2,MT99XX,YZ,1,Flip,LED,Pict,Video,HLess -17,3,MT99XX,LS,1,Flip,Invert,Pict,Video,HLess -17,4,MT99XX,FY805,1,Flip,n-a,n-a,n-a,HLess -17,5,MT99XX,A180,0,3D_6G -17,6,MT99XX,Dragon,0,Mode,RTH -44,0,NCC1701,Std,1,Warp -77,0,OMP,M2,0,THold,IdleUp,6G_3D -60,0,Pelikan,PRO_V4,0,CH5,CH6,CH7,CH8 -60,1,Pelikan,LITE_V4,0,CH5,CH6,CH7,CH8 -51,0,Potensic,A20,1,TakLan,Emerg,Mode,HLess -66,0,Propel,74-Z,1,LEDs,RollCW,RolCCW,Fire,Weapon,Calib,AltHol,TakeOf,Land,Train -29,0,Q2x2,Q222,1,Flip,LED,Mod2,Mod1,HLess,RTH,XCal,YCal -29,1,Q2x2,Q242,1,Flip,LED,Pict,Video,HLess,RTH,XCal,YCal -29,2,Q2x2,Q282,1,Flip,LED,Pict,Video,HLess,RTH,XCal,YCal -31,0,Q303,Q303,1,AltHol,Flip,Pict,Video,HLess,RTH,Gimbal -31,1,Q303,C35,1,Arm,VTX,Pict,Video,n-a,RTH,Gimbal -31,2,Q303,CX10D,1,Arm,Flip -31,3,Q303,CX10WD,1,Arm,Flip -72,0,Q90C,Std,0,FMode,VTX+ -74,0,RadioLink,Surface,0,CH5,CH6,CH7,CH8,FS_CH1,FS_CH2,FS_CH3,FS_CH4,FS_CH5,FS_CH6,FS_CH7,FS_CH8 -74,1,RadioLink,Air,0,CH5,CH6,CH7,CH8,FS_CH1,FS_CH2,FS_CH3,FS_CH4,FS_CH5,FS_CH6,FS_CH7,FS_CH8 -74,2,RadioLink,DumboRC,0,CH5,CH6,CH7,CH8,FS_CH1,FS_CH2,FS_CH3,FS_CH4,FS_CH5,FS_CH6,FS_CH7,FS_CH8 -76,0,Realacc,R11,1,Flip,Light,Calib,HLess,RTH,UNK -50,0,Redpine,Fast,0,sCH5,sCH6,sCH7,sCH8,sCH9,sCH10,sCH11,sCH12,sCH13,sCH14,sCH15,sCH16 -50,1,Redpine,Slow,0,sCH5,sCH6,sCH7,sCH8,sCH9,sCH10,sCH11,sCH12,sCH13,sCH14,sCH15,sCH16 -21,0,Futaba,SFHSS,0,CH5,CH6,CH7,CH8 -19,0,Shenqi,Cycle,1 -68,0,Skyartec,Std,0,CH5,CH6,CH7 -11,0,SLT,V1,0,Gear,Pitch -11,1,SLT,V2,0,CH5,CH6,CH7,CH8 -11,2,SLT,Q100,0,Rates,n-a,CH7,CH8,Mode,Flip,n-a,n-a,Calib -11,3,SLT,Q200,0,Rates,n-a,CH7,CH8,Mode,VidOn,VidOff,Calib -11,4,SLT,MR100,0,Rates,n-a,CH7,CH8,Mode,Flip,Video,Pict -10,0,Symax,Std,1,Flip,Rates,Pict,Video,HLess -10,1,Symax,X5C,1,Flip,Rates,Pict,Video,HLess -61,0,Tiger,Std,1,Flip,Light -43,0,Traxxas,6519,0 -5,0,V2x2,Std,1,Flip,Light,Pict,Video,HLess,CalX,CalY -5,1,V2x2,JXD506,1,Flip,Light,Pict,Video,HLess,StaSto,Emerg,Cam_UD -48,0,V761,3CH,0,Gyro,Calib,Flip,RtnAct,Rtn -48,1,V761,4CH,0,Gyro,Calib,Flip,RtnAct,Rtn -46,0,V911s,V911s,1,Calib -46,1,V911s,E119,1,Calib -22,0,WFLY,WFR0xS,0,CH5,CH6,CH7,CH8,CH9 -30,0,WK2x01,WK2801,0,CH5,CH6,CH7,CH8 -30,1,WK2x01,WK2401,0 -30,2,WK2x01,W6_5_1,0,Gear,Dis,Gyro -30,3,WK2x01,W6_6_1,0,Gear,Col,Gyro -30,4,WK2x01,W6HEL,0,Gear,Col,Gyro -30,5,WK2x01,W6HEL_I,0,Gear,Col,Gyro -62,0,XK,X450,1,FMode,TakeOf,Emerg,3D_6G,Pict,Video -62,1,XK,X420,1,FMode,TakeOf,Emerg,3D_6G,Pict,Video -8,0,YD717,Std,1,Flip,Light,Pict,Video,HLess -8,1,YD717,SkyWlkr,1,Flip,Light,Pict,Video,HLess -8,2,YD717,Simax4,1,Flip,Light,Pict,Video,HLess -8,3,YD717,XinXun,1,Flip,Light,Pict,Video,HLess -8,4,YD717,NiHui,1,Flip,Light,Pict,Video,HLess -52,0,ZSX,280,1,Light -78,0,M-Link,Std,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -79,0,WFLY2,RF20x,0,CH5,CH6,CH7,CH8,CH9,CH10 -80,0,E016Hv2,E016Hv2,1,TakLan,EmStop,Flip,Calib,HLess,RTH -81,0,E010r5,E010r5,1,Flip,LED,CALIB,HLess,RTH,GLIDE -82,0,LOLI,Std,0,CH5,CH6,CH7,CH8,1SwSePpPw,2SwSePw,3SwSe,4SwSe,5SwSeSb,6SwSe,7SwSePw,8SwSe -83,0,E129,E129,1,TakLan,EmStop,TrimA,TrimE,TrimR -84,0,JOYSWAY,Std,0 -85,0,E016H,Std,1,Stop,Flip,n-a,HLess,RTH diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/MultiChannelsUpdater.lua b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/MultiChannelsUpdater.lua deleted file mode 100644 index 14902b782..000000000 --- a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/MultiChannelsUpdater.lua +++ /dev/null @@ -1,311 +0,0 @@ - -local toolName = "TNS|Multi chan namer|TNE" - ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - -local protocol_name = "" -local sub_protocol_name = "" -local bind_ch = 0 -local module_conf = {} -local module_pos = "Internal" -local file_ok = 0 -local done = 0 -local protocol = 0 -local sub_protocol = 0 -local f_seek = 0 -local channel_names={} -local num_search = "Searching" - -local function drawScreenTitle(title) - if LCD_W == 480 then - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, title, MENU_TITLE_COLOR) - else - lcd.drawScreenTitle(title, 0, 0) - end -end - -function bitand(a, b) - local result = 0 - local bitval = 1 - while a > 0 and b > 0 do - if a % 2 == 1 and b % 2 == 1 then -- test the rightmost bits - result = result + bitval -- set the current bit - end - bitval = bitval * 2 -- shift left - a = math.floor(a/2) -- shift right - b = math.floor(b/2) - end - return result -end - -local function Multi_Draw_LCD(event) - local line = 0 - - lcd.clear() - drawScreenTitle("Multi channels namer") - - --Display settings - local lcd_opt = 0 - if LCD_W == 480 then - x_pos = 10 - y_pos = 32 - y_inc = 20 - else - x_pos = 0 - y_pos = 9 - y_inc = 8 - lcd_opt = SMLSIZE - end - - --Multi Module detection - if module_conf["Type"] ~= 6 then - if LCD_W == 480 then - lcd.drawText(10,50,"No Multi module configured...", BLINK) - else - --Draw on LCD_W=128 - lcd.drawText(2,17,"No Multi module configured...",SMLSIZE) - end - return - else - lcd.drawText(x_pos, y_pos+y_inc*line,module_pos .. " Multi detected.", lcd_opt) - line = line + 1 - end - - --Channel order - if (ch_order == -1) then - lcd.drawText(x_pos, y_pos+y_inc*line,"Channels order can't be read from Multi...", lcd_opt) - line = line + 1 - end - - --Can't open file MultiChan.txt - if file_ok == 0 then - lcd.drawText(x_pos, y_pos+y_inc*line,"Can't read MultiChan.txt file...", lcd_opt) - return - end - - if ( protocol_name == "" or sub_protocol_name == "" ) and f_seek ~=-1 then - local f = io.open("/SCRIPTS/TOOLS/MultiChan.txt", "r") - if f == nil then return end - lcd.drawText(x_pos, y_pos+y_inc*line,num_search, lcd_opt) - num_search = num_search .. "." - if #num_search > 15 then - num_search = string.sub(num_search,1,9) - end - local proto = 0 - local sub_proto = 0 - local proto_name = "" - local sub_proto_name = "" - local channels = "" - local nbr_try = 0 - local nbr_car = 0 - repeat - io.seek(f, f_seek) - local data = io.read(f, 100) -- read 100 characters - if #data ==0 then - f_seek = -1 -- end of file - break - end - proto, sub_proto, proto_name, sub_proto_name, bind_ch, channels = string.match(data,'(%d+),(%d),([%w-_ ]+),([%w-_ ]+),(%d)(.+)') - if proto ~= nil and sub_proto ~= nil and protocol_name ~= nil and sub_protocol_name ~= nil and bind_ch ~= nil then - if tonumber(proto) == protocol and tonumber(sub_proto) == sub_protocol then - protocol_name = proto_name - sub_protocol_name = sub_proto_name - bind_ch = tonumber(bind_ch) - if channels ~= nil then - --extract channel names - nbr_car = string.find(channels, "\r") - if nbr_car == nil then nbr_car = string.find(channels, "\n") end - if nbr_car ~= nil then - channels = string.sub(channels,1,nbr_car-1) - end - local i = 5 - for k in string.gmatch(channels, ",([%w-_ ]+)") do - channel_names[i] = k - i = i + 1 - end - end - f_seek = -1 -- protocol found - break - end - end - if f_seek ~= -1 then - nbr_car = string.find(data, "\n") - if nbr_car == nil then nbr_car = string.find(data, "\r") end - if nbr_car == nil then - f_seek = -1 -- end of file - break - end - f_seek = f_seek + nbr_car -- seek to next line - nbr_try = nbr_try + 1 - end - until nbr_try > 20 or f_seek == -1 - io.close(f) - end - - if f_seek ~= -1 then - return -- continue searching... - end - - --Protocol & Sub_protocol - if protocol_name == "" or sub_protocol_name == "" then - lcd.drawText(x_pos, y_pos+y_inc*line,"Unknown protocol "..tostring(protocol).."/"..tostring(sub_protocol).." ...", lcd_opt) - return - elseif LCD_W > 128 then - lcd.drawText(x_pos, y_pos+y_inc*line,"Protocol: " .. protocol_name .. " / SubProtocol: " .. sub_protocol_name, lcd_opt) - line = line + 1 - else - lcd.drawText(x_pos, y_pos+y_inc*line,"Protocol: " .. protocol_name, lcd_opt) - line = line + 1 - lcd.drawText(x_pos, y_pos+y_inc*line,"SubProtocol: " .. sub_protocol_name, lcd_opt) - line = line + 1 - end - - text1="" - text2="" - for i,v in ipairs(channel_names) do - if i<=8 then - if i==1 then - text1 = v - else - text1=text1 .. "," .. v - end - else - if i==9 then - text2 = v - else - text2=text2 .. "," .. v - end - end - end - if LCD_W > 128 then - lcd.drawText(x_pos, y_pos+y_inc*line,"Channels: " .. text1, lcd_opt) - line = line + 1 - if text2 ~= "" then - lcd.drawText(x_pos*9, y_pos+y_inc*line,text2, lcd_opt) - line = line + 1 - end - end - - if event ~= EVT_VIRTUAL_ENTER and done == 0 then - lcd.drawText(x_pos, y_pos+y_inc*line," Save", lcd_opt + INVERS + BLINK) - return - end - - lcd.drawText(x_pos, y_pos+y_inc*line,"Setting channel names.", lcd_opt) - line = line + 1 - local output, nbr - if done == 0 then - for i,v in ipairs(channel_names) do - output = model.getOutput(i-1) - output["name"] = v - model.setOutput(i-1,output) - nbr = i - end - for i = nbr, 15 do - output = model.getOutput(i) - output["name"] = "n-a" - model.setOutput(i,output) - end - if bind_ch == 1 then - output = model.getOutput(15) - output["name"] = "BindCH" - model.setOutput(15,output) - end - done = 1 - end - lcd.drawText(x_pos, y_pos+y_inc*line,"Done!", lcd_opt) - line = line + 1 -end - --- Init -local function Multi_Init() - module_conf = model.getModule(0) - if module_conf["Type"] ~= 6 then - module_pos = "External" - module_conf = model.getModule(1) - if module_conf["Type"] ~= 6 then - return - end - end - - protocol = module_conf["protocol"] - sub_protocol = module_conf["subProtocol"] - - --Exceptions on first 4 channels... - local stick_names = { "Rud", "Ele", "Thr", "Ail" } - if ( protocol == 4 and sub_protocol == 1 ) or protocol == 19 or protocol == 52 then -- Hisky/HK310, Shenqi, ZSX - stick_names[2] = "n-a" - stick_names[4] = "n-a" - elseif protocol == 43 then -- Traxxas - stick_names[2] = "Aux4" - stick_names[4] = "Aux3" - elseif ( protocol == 48 and sub_protocol == 0 ) then -- V761 3CH - stick_names[4] = "n-a" - elseif protocol == 47 or protocol == 49 or protocol == 58 then -- GD00x, KF606, FX816 - stick_names[1] = "n-a" - stick_names[2] = "n-a" - end - - --Determine fist 4 channels order - local ch_order=module_conf["channelsOrder"] - if (ch_order == -1) then - channel_names[1] = stick_names[defaultChannel(0)+1] - channel_names[2] = stick_names[defaultChannel(1)+1] - channel_names[3] = stick_names[defaultChannel(2)+1] - channel_names[4] = stick_names[defaultChannel(3)+1] - else - channel_names[bitand(ch_order,3)+1] = stick_names[4] - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = stick_names[2] - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = stick_names[3] - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = stick_names[1] - end - - --Exceptions on first 4 channels... - if ( protocol == 73 or (protocol == 74 and sub_protocol == 0) ) then -- Kyosho or RadioLink Surface - channel_names[1] = "ST" - channel_names[2] = "THR" - channel_names[3] = "CH3" - channel_names[4] = "CH4" - end - - --Check MultiChan.txt - local f = io.open("/SCRIPTS/TOOLS/MultiChan.txt", "r") - if f == nil then return end - file_ok = 1 - io.close(f) -end - --- Main -local function Multi_Run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - else - Multi_Draw_LCD(event) - if event == EVT_VIRTUAL_EXIT then - return 2 - end - end - return 0 -end - -return { init=Multi_Init, run=Multi_Run } diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/MultiLOLI.lua b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/MultiLOLI.lua deleted file mode 100644 index 4d309e37e..000000000 --- a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/MultiLOLI.lua +++ /dev/null @@ -1,221 +0,0 @@ - -local toolName = "TNS|Multi LOLI RX config|TNE" - ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - -local loli_nok = false -local channels={ { 768, "PWM", 100, 102, "PPM", 50, -768, "Servo", 0, -2048, "Switch", -100 }, -- CH1 - { 768, "PWM", 100, -768, "Servo", 0, -2048, "Switch", -100 }, -- CH2 - { -768, "Servo", 0, -2048, "Switch", -100 }, -- CH3 - { -768, "Servo", 0, -2048, "Switch", -100 }, -- CH4 - { 102, "SBUS", 50, -768, "Servo", 0, -2048, "Switch", -100 }, -- CH5 - { -768, "Servo", 0, -2048, "Switch", -100 }, -- CH6 - { 768, "PWM", 100, -768, "Servo", 0, -2048, "Switch", -100 }, -- CH7 - { -768, "Servo", 0, -2048, "Switch", -100 } } -- CH8 - -local sel = 1 -local edit = false - -local blink = 0 -local BLINK_SPEED = 15 - -local function drawScreenTitle(title) - if LCD_W == 480 then - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, title, MENU_TITLE_COLOR) - else - lcd.drawScreenTitle(title, 0, 0) - end -end - -local function LOLI_Draw_LCD(event) - local line = 0 - - lcd.clear() - - --Display settings - local lcd_opt = 0 - if LCD_W == 480 then - drawScreenTitle("Multi - LOLI RX configuration tool") - x_pos = 152 - x_inc = 90 - y_pos = 40 - y_inc = 20 - else - x_pos = 5 - x_inc = 30 - y_pos = 1 - y_inc = 8 - lcd_opt = SMLSIZE - end - - --Multi Module detection - if loli_nok then - if LCD_W == 480 then - lcd.drawText(10,50,"The LOLI protocol is not selected...", lcd_opt) - else - --Draw on LCD_W=128 - lcd.drawText(2,17,"LOLI protocol not selected...",SMLSIZE) - end - return - end - - --Display current config - if LCD_W == 480 then - line = line + 1 - lcd.drawText(x_pos, y_pos+y_inc*line -2, "Channel", lcd_opt) - lcd.drawText(x_pos+x_inc, y_pos+y_inc*line -2, "Function", lcd_opt) - lcd.drawRectangle(x_pos-4, y_pos+y_inc*line -4 , 2*x_inc +2, 188) - lcd.drawLine(x_pos-4, y_pos+y_inc*line +18, x_pos-4 +2*x_inc +1, y_pos+y_inc*line +18, SOLID, 0) - lcd.drawLine(x_pos+x_inc -5, y_pos+y_inc*line -4, x_pos+x_inc -5, y_pos+y_inc*line -5 +188, SOLID, 0) - line = line + 1 - end - - local out - for i = 1, 8 do - out = getValue("ch"..(i+8)) - lcd.drawText(x_pos, y_pos+y_inc*line, "CH"..i, lcd_opt) - for j = 1, #channels[i], 3 do - if out > channels[i][j] then - if sel == i then - invert = INVERS - if edit == true then - blink = blink + 1 - if blink > BLINK_SPEED then - invert = 0 - if blink > BLINK_SPEED * 2 then - blink = 0 - end - end - end - else - invert = 0 - end - lcd.drawText(x_pos+x_inc, y_pos+y_inc*line, channels[i][j+1], lcd_opt + invert) - break - end - end - line = line + 1 - end -end - -local function LOLI_Change_Value(dir) - local pos = 0 - local out - --look for the current position - out = getValue("ch"..(sel+8)) - for j = 1, #channels[sel], 3 do - if out > channels[sel][j] then - pos = j - break - end - end - - --decrement or increment - if dir < 0 and pos > 1 then - pos = pos - 3 - elseif dir > 0 and pos + 3 < #channels[sel] then - pos = pos + 3 - else - return - end - - --delete all mixers for the selected channel - local num_mix = model.getMixesCount(sel-1 +8) - for i = 1, num_mix do - model.deleteMix(sel-1 +8, 0); - end - - --create new mixer - local source_max = getFieldInfo("cyc1") - - local val = { name = channels[sel][pos+1], - source = source_max.id - 1, -- MAX=100 on TX16S - weight = channels[sel][pos+2], - offset = 0, - switch = 0, - multiplex = 0, - curveType = 0, - curveValue = 0, - flightModes = 0, - carryTrim = false, - mixWarn = 0, - delayUp = 0, - delayDown = 0, - speedUp = 0, - speedDown = 0 } - model.insertMix(sel-1 +8, 0, val) -end - -local function LOLI_Menu(event) - if event == EVT_VIRTUAL_NEXT then - if edit == false then - -- not changing a value - if sel < 8 then - sel = sel + 1 - end - else - -- need to inc the value - LOLI_Change_Value(1) - end - elseif event == EVT_VIRTUAL_PREV then - if edit == false then - -- not changing a value - if sel > 1 then - sel = sel - 1 - end - else - -- need to dec the value - LOLI_Change_Value(-1) - end - elseif event == EVT_VIRTUAL_ENTER then - if edit == false then - edit = true - blink = BLINK_SPEED - else - edit = false - end - end -end - --- Init -local function LOLI_Init() - local module_conf = model.getModule(0) - if module_conf["Type"] ~= 6 or module_conf["protocol"] ~= 82 then - module_conf = model.getModule(1) - if module_conf["Type"] ~= 6 or module_conf["protocol"] ~= 82 then - loli_nok = true - end - end -end - --- Main -local function LOLI_Run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_EXIT then - return 2 - else - LOLI_Menu(event) - LOLI_Draw_LCD(event) - return 0 - end -end - -return { init=LOLI_Init, run=LOLI_Run } diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/back.bmp b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/back.bmp deleted file mode 100644 index a8996262c..000000000 Binary files a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/back.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/delta.bmp b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/delta.bmp deleted file mode 100644 index ab94279c1..000000000 Binary files a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/delta.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/done.bmp b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/done.bmp deleted file mode 100644 index 9ac501398..000000000 Binary files a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/done.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/down.bmp b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/down.bmp deleted file mode 100644 index 97f9105ac..000000000 Binary files a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/down.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/forward.bmp b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/forward.bmp deleted file mode 100644 index df769aef2..000000000 Binary files a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/forward.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/horz-r.bmp b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/horz-r.bmp deleted file mode 100644 index 93ffdb0fc..000000000 Binary files a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/horz-r.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/horz.bmp b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/horz.bmp deleted file mode 100644 index 4295e8475..000000000 Binary files a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/horz.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/left.bmp b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/left.bmp deleted file mode 100644 index 8cc811fd1..000000000 Binary files a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/left.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/plane.bmp b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/plane.bmp deleted file mode 100644 index b3e61bf5f..000000000 Binary files a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/plane.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/right.bmp b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/right.bmp deleted file mode 100644 index 5fd52d475..000000000 Binary files a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/right.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/up.bmp b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/up.bmp deleted file mode 100644 index dcffc4186..000000000 Binary files a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/up.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/vert-r.bmp b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/vert-r.bmp deleted file mode 100644 index 763409ec4..000000000 Binary files a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/vert-r.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/vert.bmp b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/vert.bmp deleted file mode 100644 index 5f1b91f05..000000000 Binary files a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/vert.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/vtail.bmp b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/vtail.bmp deleted file mode 100644 index 6c7ec0b56..000000000 Binary files a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/bmp/vtail.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/crossfire.lua b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/crossfire.lua deleted file mode 100644 index 3e8a6930a..000000000 --- a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/crossfire.lua +++ /dev/null @@ -1,42 +0,0 @@ -local toolName = "TNS|Crossfire config|TNE" - ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - - - --- Init -local function init() -end - --- Run -local function run(event) - if event == nil then - error("Cannot run as a model script!") - return 2 - end - - if crossfireTelemetryPush() == nil then - error("Crossfire not available!") - return 2 - end - - chdir("/SCRIPTS/TOOLS/CROSSFIRE") - return "crossfire.lua" -end - -return { init=init, run=run } diff --git a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/readme.txt b/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/readme.txt deleted file mode 100644 index 20b95c415..000000000 --- a/radio/sdcard/taranis-x7/SCRIPTS/TOOLS/readme.txt +++ /dev/null @@ -1 +0,0 @@ -Scripts that need to be available in TOOLS menu should be in this directory diff --git a/radio/sdcard/taranis-x7/SCRIPTS/WIZARD/delta.lua b/radio/sdcard/taranis-x7/SCRIPTS/WIZARD/delta.lua deleted file mode 100755 index 9cf7fdefd..000000000 --- a/radio/sdcard/taranis-x7/SCRIPTS/WIZARD/delta.lua +++ /dev/null @@ -1,383 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### --- Delta Wizard pages -local ENGINE_PAGE = 0 -local ELEVONS_PAGE = 1 -local RUDDER_PAGE = 2 -local CONFIRMATION_PAGE = 3 - --- Navigation variables -local page = ENGINE_PAGE -local dirty = true -local edit = false -local field = 0 -local fieldsMax = 0 - --- Model settings -local engineMode = 1 -local thrCH1 = 0 -local elevCH1 = 0 -local elevCH2 = 0 -local elevonsMode = 0 -local rudderMode = 0 -local rudCH1 = 0 -local servoPage = nil - --- Common functions -local lastBlink = 0 -local function blinkChanged() - local time = getTime() % 128 - local blink = (time - time % 64) / 64 - if blink ~= lastBlink then - lastBlink = blink - return true - else - return false - end -end - -local function fieldIncDec(event, value, max, force) - if edit or force==true then - if event == EVT_VIRTUAL_INC then - value = (value + max) - dirty = true - elseif event == EVT_VIRTUAL_DEC then - value = (value + max + 2) - dirty = true - end - value = (value % (max+1)) - end - return value -end - -local function valueIncDec(event, value, min, max) - if edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - if value < max then - value = (value + 1) - dirty = true - end - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - if value > min then - value = (value - 1) - dirty = true - end - end - end - return value -end - -local function navigate(event, fieldMax, prevPage, nextPage) - if event == EVT_VIRTUAL_ENTER then - edit = not edit - dirty = true - elseif edit then - if event == EVT_VIRTUAL_EXIT then - edit = false - dirty = true - elseif not dirty then - dirty = blinkChanged() - end - else - if event == EVT_VIRTUAL_NEXT_PAGE then - page = nextPage - field = 0 - dirty = true - elseif event == EVT_VIRTUAL_PREV_PAGE then - page = prevPage - field = 0 - killEvents(event); - dirty = true - else - field = fieldIncDec(event, field, fieldMax, true) - end - end -end - -local function getFieldFlags(position) - flags = 0 - if field == position then - flags = INVERS - if edit then - flags = INVERS + BLINK - end - end - return flags -end - -local function channelIncDec(event, value) - if not edit and event==EVT_VIRTUAL_MENU then - servoPage = value - dirty = true - else - value = valueIncDec(event, value, 0, 15) - end - return value -end - --- Init function -local function init() - rudCH1 = defaultChannel(0) - thrCH1 = defaultChannel(2) - elevCH1 = defaultChannel(1) - elevCH2 = defaultChannel(3) -end - --- Engine Menu -local engineModeItems = {"No", "Yes"} -local function drawEngineMenu() - lcd.clear() - if engineMode == 0 then - -- No engine - fieldsMax = 0 - else - -- 1 channel - lcd.drawText(5, 30, "Assign channel", 0); - lcd.drawText(5, 40, ">>>", 0); - lcd.drawSource(25, 40, MIXSRC_CH1+thrCH1, getFieldFlags(1)) - fieldsMax = 1 - end - lcd.drawText(1, 0, "Got an engine?", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, FILL_WHITE) - lcd.drawCombobox(0, 8, LCD_W, engineModeItems, engineMode, getFieldFlags(0)) -end - -local function engineMenu(event) - if dirty then - dirty = false - drawEngineMenu() - end - - navigate(event, fieldsMax, page, page+1) - - if field==0 then - engineMode = fieldIncDec(event, engineMode, 1) - elseif field==1 then - thrCH1 = channelIncDec(event, thrCH1) - end -end - --- Elevons Menu -local elevonsModeItems = {"2 Channels"} -local function drawElevonsMenu() - lcd.clear() - lcd.drawText(1, 0, "Select elevon channnels", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, FILL_WHITE) - lcd.drawCombobox(0, 8, LCD_W, elevonsModeItems, elevonsMode, 0) - lcd.drawText(5, 30, "Assign channels", 0); - lcd.drawText(30, 40, "L", 0); - lcd.drawText(65, 40, "R", 0); - lcd.drawText(5, 50, ">>>", 0); - lcd.drawSource(25, 50, MIXSRC_CH1+elevCH1, getFieldFlags(0)) - lcd.drawSource(60, 50, MIXSRC_CH1+elevCH2, getFieldFlags(1)) - fieldsMax = 1 -end - -local function elevonsMenu(event) - if dirty then - dirty = false - drawElevonsMenu() - end - - navigate(event, fieldsMax, page-1, page+1) - - if field==0 then - elevCH1 = channelIncDec(event, elevCH1) - elseif field==1 then - elevCH2 = channelIncDec(event, elevCH2) - end -end - --- Rudder menu -local rudderModeItems = {"No", "Yes"} - -local function drawRudderMenu() - lcd.clear() - if rudderMode == 0 then - -- No rudder - fieldsMax = 0 - else - -- 1 channel - lcd.drawText(5, 30, "Assign channel", 0); - lcd.drawText(5, 40, ">>>", 0); - lcd.drawSource(25, 40, MIXSRC_CH1+rudCH1, getFieldFlags(1)) - fieldsMax = 1 - end - lcd.drawText(1, 0, "Got a rudder?", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, FILL_WHITE) - lcd.drawCombobox(0, 8, LCD_W, rudderModeItems, rudderMode, getFieldFlags(0)) -end - -local function rudderMenu(event) - if dirty then - dirty = false - drawRudderMenu() - end - - navigate(event, fieldsMax, page-1, page+1) - - if field==0 then - rudderMode = fieldIncDec(event, rudderMode, 1) - elseif field==1 then - rudCH1 = channelIncDec(event, rudCH1) - end -end - --- Servo (limits) Menu -local function drawServoMenu(limits) - lcd.clear() - lcd.drawSource(1, 0, MIXSRC_CH1+servoPage, 0) - lcd.drawText(25, 0, "servo min/max/center/direction?", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, FILL_WHITE) - lcd.drawText(LCD_W/2-19, LCD_H-8, ">>>", 0); - lcd.drawNumber(140, 35, limits.min, PREC1+getFieldFlags(0)); - lcd.drawNumber(205, 35, limits.max, PREC1+getFieldFlags(1)); - lcd.drawNumber(170, 9, limits.offset, PREC1+getFieldFlags(2)); - if limits.revert == 0 then - lcd.drawText(129, 50, "\126", getFieldFlags(3)); - else - lcd.drawText(129, 50, "\127", getFieldFlags(3)); - end - fieldsMax = 3 -end - -local function servoMenu(event) - local limits = model.getOutput(servoPage) - - if dirty then - dirty = false - drawServoMenu(limits) - end - - navigate(event, fieldsMax, page, page) - - if edit then - if field==0 then - limits.min = valueIncDec(event, limits.min, -1000, 0) - elseif field==1 then - limits.max = valueIncDec(event, limits.max, 0, 1000) - elseif field==2 then - limits.offset = valueIncDec(event, limits.offset, -1000, 1000) - elseif field==3 then - limits.revert = fieldIncDec(event, limits.revert, 1) - end - model.setOutput(servoPage, limits) - elseif event == EVT_VIRTUAL_EXIT then - servoPage = nil - dirty = true - end -end - --- Confirmation Menu -local function addMix(channel, input, name, weight, index) - local mix = { source=input, name=name } - if weight ~= nil then - mix.weight = weight - end - if index == nil then - index = 0 - end - model.insertMix(channel, index, mix) -end - -local function applySettings() - model.defaultInputs() - model.deleteMixes() - if engineMode == 1 then - addMix(thrCH1, MIXSRC_FIRST_INPUT+defaultChannel(2), "Engine") - end - addMix(elevCH1, MIXSRC_FIRST_INPUT+defaultChannel(1), "D-EleL", 50) - addMix(elevCH1, MIXSRC_FIRST_INPUT+defaultChannel(3), "D-AilL", 50, 1) - addMix(elevCH2, MIXSRC_FIRST_INPUT+defaultChannel(1), "D-EleR", 50) - addMix(elevCH2, MIXSRC_FIRST_INPUT+defaultChannel(3), "D-AilR", -50, 1) - if rudderMode == 1 then - addMix(rudCH1, MIXSRC_FIRST_INPUT+defaultChannel(0), "Rudder") - end -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 - y = 12 - x = 120 - end - return x, y -end - -local function drawConfirmationMenu() - local x = 22 - local y = 12 - lcd.clear() - 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, "Throttle", thrCH1) - end - 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) - end - lcd.drawText(0, LCD_H-8, "[Enter Long] to confirm", 0); - lcd.drawFilledRectangle(0, LCD_H-9, LCD_W, 9, 0) - fieldsMax = 0 -end - -local function confirmationMenu(event) - if dirty then - dirty = false - drawConfirmationMenu() - end - - navigate(event, fieldsMax, RUDDER_PAGE, page) - - if event == EVT_VIRTUAL_EXIT then - return 2 - elseif event == EVT_VIRTUAL_ENTER_LONG then - killEvents(event) - applySettings() - return 2 - else - return 0 - end -end - --- Main - -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - end - - if servoPage ~= nil then - servoMenu(event) - elseif page == ENGINE_PAGE then - engineMenu(event) - elseif page == ELEVONS_PAGE then - elevonsMenu(event) - elseif page == RUDDER_PAGE then - rudderMenu(event) - elseif page == CONFIRMATION_PAGE then - return confirmationMenu(event) - end - return 0 -end - -return { init=init, run=run } diff --git a/radio/sdcard/taranis-x7/SCRIPTS/WIZARD/multi.lua b/radio/sdcard/taranis-x7/SCRIPTS/WIZARD/multi.lua deleted file mode 100755 index fc65db204..000000000 --- a/radio/sdcard/taranis-x7/SCRIPTS/WIZARD/multi.lua +++ /dev/null @@ -1,440 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### --- Multicopter Wizard pages -local THROTTLE_PAGE = 0 -local ROLL_PAGE = 1 -local PITCH_PAGE = 2 -local YAW_PAGE = 3 -local ARM_PAGE = 4 -local MODE_PAGE = 5 -local BEEPER_PAGE = 6 -local CONFIRMATION_PAGE = 7 - --- Navigation variables -local page = THROTTLE_PAGE -local dirty = true -local edit = false -local field = 0 -local fieldsMax = 0 -local comboBoxMode = 0 -- Scrap variable -local validSwitch = {} - --- Model settings -local thrCH1 = 0 -local rollCH1 = 0 -local yawCH1 = 0 -local pitchCH1 = 0 -local armSW1 = 1 -local beeperSW1 = 1 -local modeSW1 = 1 -local switches = {} - --- Common functions -local lastBlink = 0 -local function blinkChanged() - local time = getTime() % 128 - local blink = (time - time % 64) / 64 - if blink ~= lastBlink then - lastBlink = blink - return true - else - return false - end -end - -local function fieldIncDec(event, value, max, force) - if edit or force==true then - if event == EVT_VIRTUAL_INC then - value = (value + max) - dirty = true - elseif event == EVT_VIRTUAL_DEC then - value = (value + max + 2) - dirty = true - end - value = (value % (max+1)) - end - return value -end - -local function valueIncDec(event, value, min, max) - if edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - if value < max then - value = (value + 1) - dirty = true - end - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - if value > min then - value = (value - 1) - dirty = true - end - end - end - return value -end - -local function navigate(event, fieldMax, prevPage, nextPage) - if event == EVT_VIRTUAL_ENTER then - edit = not edit - dirty = true - elseif edit then - if event == EVT_VIRTUAL_EXIT then - edit = false - dirty = true - elseif not dirty then - dirty = blinkChanged() - end - else - if event == EVT_VIRTUAL_NEXT_PAGE then - page = nextPage - field = 0 - dirty = true - elseif event == EVT_VIRTUAL_PREV_PAGE then - page = prevPage - field = 0 - killEvents(event); - dirty = true - else - field = fieldIncDec(event, field, fieldMax, true) - end - end -end - -local function getFieldFlags(position) - flags = 0 - if field == position then - flags = INVERS - if edit then - flags = INVERS + BLINK - end - end - return flags -end - -local function channelIncDec(event, value) - if not edit and event==EVT_VIRTUAL_MENU then - servoPage = value - dirty = true - else - value = valueIncDec(event, value, 0, 15) - end - return value -end - -local function switchValueIncDec(event, value, min, max) - if edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - if value < max then - value = (value + 1) - dirty = true - end - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - if value > min then - value = (value - 1) - dirty = true - end - end - end - return value -end - -local function switchIncDec(event, value) - if not edit and event== EVT_VIRTUAL_MENU then - servoPage = value - dirty = true - else - value = switchValueIncDec(event, value, 1, #switches) - end - return value -end - --- Init function -local function init() - thrCH1 = defaultChannel(2) - rollCH1 = defaultChannel(3) - yawCH1 = defaultChannel(0) - pitchCH1 = defaultChannel(1) - local ver, radio, maj, minor, rev = getVersion() - if string.match(radio, "x7") then - switches = {"SA", "SB", "SC", "SD", "SF", "SH"} - elseif string.match(radio, "tx12") then - switches = {"SA", "SB", "SC", "SD", "SE", "SF"} - else - switches = {"SA", "SB", "SC", "SD"} - end -end - --- Throttle Menu -local function drawThrottleMenu() - lcd.clear() - lcd.drawText(1, 0, "Multicopter", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, FILL_WHITE) - lcd.drawCombobox(0, 8, LCD_W, {"Throttle"}, comboBoxMode, getFieldFlags(1)) - lcd.drawText(5, 30, "Assign channel", 0); - lcd.drawText(5, 40, ">>>", 0); - lcd.drawSource(25, 40, MIXSRC_CH1+thrCH1, getFieldFlags(0)) - fieldsMax = 0 -end - -local function throttleMenu(event) - if dirty then - dirty = false - drawThrottleMenu() - end - navigate(event, fieldsMax, page, page+1) - thrCH1 = channelIncDec(event, thrCH1) -end - --- Roll Menu -local function drawRollMenu() - lcd.clear() - lcd.drawText(1, 0, "Multicopter", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, FILL_WHITE) - lcd.drawCombobox(0, 8, LCD_W, {"Roll"}, comboBoxMode, getFieldFlags(1)) - lcd.drawText(5, 30, "Assign channel", 0); - lcd.drawText(5, 40, ">>>", 0); - lcd.drawSource(25, 40, MIXSRC_CH1+rollCH1, getFieldFlags(0)) - fieldsMax = 0 -end - -local function rollMenu(event) - if dirty then - dirty = false - drawRollMenu() - end - navigate(event, fieldsMax, page-1, page+1) - rollCH1 = channelIncDec(event, rollCH1) -end - --- Pitch Menu -local function drawPitchMenu() - lcd.clear() - lcd.drawText(1, 0, "Multicopter", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, FILL_WHITE) - lcd.drawCombobox(0, 8, LCD_W, {"Pitch"}, comboBoxMode, getFieldFlags(1)) - lcd.drawText(5, 30, "Assign channel", 0); - lcd.drawText(5, 40, ">>>", 0); - lcd.drawSource(25, 40, MIXSRC_CH1+pitchCH1, getFieldFlags(0)) - fieldsMax = 0 -end - -local function pitchMenu(event) - if dirty then - dirty = false - drawPitchMenu() - end - navigate(event, fieldsMax, page-1, page+1) - pitchCH1 = channelIncDec(event, pitchCH1) -end - --- Yaw Menu -local function drawYawMenu() - lcd.clear() - lcd.drawText(1, 0, "Multicopter", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, FILL_WHITE) - lcd.drawCombobox(0, 8, LCD_W, {"Yaw"}, comboBoxMode, getFieldFlags(1)) - lcd.drawText(5, 30, "Assign channel", 0); - lcd.drawText(5, 40, ">>>", 0); - lcd.drawSource(25, 40, MIXSRC_CH1+yawCH1, getFieldFlags(0)) - fieldsMax = 0 -end - -local function yawMenu(event) - if dirty then - dirty = false - drawYawMenu() - end - navigate(event, fieldsMax, page-1, page+1) - yawCH1 = channelIncDec(event, yawCH1) -end - --- Arm Menu -local function drawArmMenu() - lcd.clear() - lcd.drawText(1, 0, "Multicopter", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, FILL_WHITE) - lcd.drawCombobox(0, 8, LCD_W, {"Arm"}, comboBoxMode, getFieldFlags(1)) - lcd.drawText(5, 30, "Assign AUX1", 0); - lcd.drawText(5, 40, ">>>", 0); - lcd.drawText(25, 40, switches[armSW1], getFieldFlags(0)) - fieldsMax = 0 -end - -local function armMenu(event) - if dirty then - dirty = false - drawArmMenu() - end - navigate(event, fieldsMax, page-1, page+1) - armSW1 = switchIncDec(event, armSW1) -end - --- Beeper Menu -local function drawbeeperMenu() - lcd.clear() - lcd.drawText(1, 0, "Multicopter", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, FILL_WHITE) - lcd.drawCombobox(0, 8, LCD_W, {"Beeper"}, comboBoxMode, getFieldFlags(1)) - lcd.drawText(5, 30, "Assign AUX2", 0); - lcd.drawText(5, 40, ">>>", 0); - lcd.drawText(25, 40, switches[beeperSW1], getFieldFlags(0)) - fieldsMax = 0 -end - -local function beeperMenu(event) - if dirty then - dirty = false - drawbeeperMenu() - end - navigate(event, fieldsMax, page-1, page+1) - beeperSW1 = switchIncDec(event, beeperSW1) -end - --- Mode Menu -local function drawmodeMenu() - lcd.clear() - lcd.drawText(1, 0, "Multicopter", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, FILL_WHITE) - lcd.drawCombobox(0, 8, LCD_W, {"Mode"}, comboBoxMode, getFieldFlags(1)) - lcd.drawText(5, 30, "Assign AUX3", 0); - lcd.drawText(5, 40, ">>>", 0); - lcd.drawText(25, 40, switches[modeSW1], getFieldFlags(0)) - fieldsMax = 0 -end - -local function modeMenu(event) - if dirty then - dirty = false - drawmodeMenu() - end - navigate(event, fieldsMax, page-1, page+1) - modeSW1 = switchIncDec(event, modeSW1) -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 - y = 12 - x = 120 - end - return x, y -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 - y = 12 - x = 120 - end - return x, y -end - -local function drawConfirmationMenu() - local x = 1 - local y = 12 - 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) - 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) - lcd.drawText(0, LCD_H-8, "[Enter Long] to confirm", 0); - lcd.drawFilledRectangle(0, LCD_H-9, LCD_W, 9, 0) - fieldsMax = 0 -end - -local function addMix(channel, input, name, weight, index) - local mix = { source=input, name=name } - if weight ~= nil then - mix.weight = weight - end - if index == nil then - index = 0 - end - model.insertMix(channel, index, mix) -end - -local function applySettings() - model.defaultInputs() - model.deleteMixes() - addMix(thrCH1, MIXSRC_FIRST_INPUT+defaultChannel(2), "Throttle") - addMix(rollCH1, MIXSRC_FIRST_INPUT+defaultChannel(3), "Roll") - addMix(yawCH1, MIXSRC_FIRST_INPUT+defaultChannel(0), "Yaw") - addMix(pitchCH1, MIXSRC_FIRST_INPUT+defaultChannel(1), "Pitch") - addMix(4, MIXSRC_SA + armSW1 - 1, "Arm") - addMix(5, MIXSRC_SA + beeperSW1 - 1, "Beeper") - addMix(6, MIXSRC_SA + modeSW1 - 1, "Mode") -end - -local function confirmationMenu(event) - if dirty then - dirty = false - drawConfirmationMenu() - end - - navigate(event, fieldsMax, BEEPER_PAGE, page) - - if event == EVT_VIRTUAL_EXIT then - return 2 - elseif event == EVT_VIRTUAL_ENTER_LONG then - killEvents(event) - applySettings() - return 2 - else - return 0 - end -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - end - if page == THROTTLE_PAGE then - throttleMenu(event) - elseif page == ROLL_PAGE then - rollMenu(event) - elseif page == YAW_PAGE then - yawMenu(event) - elseif page == PITCH_PAGE then - pitchMenu(event) - elseif page == ARM_PAGE then - armMenu(event) - elseif page == BEEPER_PAGE then - beeperMenu(event) - elseif page == MODE_PAGE then - modeMenu(event) - elseif page == CONFIRMATION_PAGE then - return confirmationMenu(event) - end - return 0 -end - -return { init=init, run=run } diff --git a/radio/sdcard/taranis-x7/SCRIPTS/WIZARD/plane.lua b/radio/sdcard/taranis-x7/SCRIPTS/WIZARD/plane.lua deleted file mode 100755 index d52c1f936..000000000 --- a/radio/sdcard/taranis-x7/SCRIPTS/WIZARD/plane.lua +++ /dev/null @@ -1,582 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### --- Plane Wizard pages -local ENGINE_PAGE = 0 -local AILERONS_PAGE = 1 -local FLAPERONS_PAGE = 2 -local BRAKES_PAGE = 3 -local TAIL_PAGE = 4 -local CONFIRMATION_PAGE = 5 - --- Navigation variables -local page = ENGINE_PAGE -local dirty = true -local edit = false -local field = 0 -local fieldsMax = 0 - --- Model settings -local engineMode = 1 -local thrCH1 = 0 -local aileronsMode = 1 -local ailCH1 = 0 -local ailCH2 = 5 -local flapsMode = 0 -local flapsCH1 = 6 -local flapsCH2 = 7 -local brakesMode = 0 -local brakesCH1 = 8 -local brakesCH2 = 9 -local tailMode = 1 -local eleCH1 = 0 -local eleCH2 = 4 -local rudCH1 = 0 -local servoPage = nil - --- Common functions -local lastBlink = 0 -local function blinkChanged() - local time = getTime() % 128 - local blink = (time - time % 64) / 64 - if blink ~= lastBlink then - lastBlink = blink - return true - else - return false - end -end - -local function fieldIncDec(event, value, max, force) - if edit or force==true then - if event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - value = (value + max) - dirty = true - elseif event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - value = (value + max + 2) - dirty = true - end - value = (value % (max+1)) - end - return value -end - -local function valueIncDec(event, value, min, max) - if edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - if value < max then - value = (value + 1) - dirty = true - end - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - if value > min then - value = (value - 1) - dirty = true - end - end - end - return value -end - -local function navigate(event, fieldMax, prevPage, nextPage) - if event == EVT_VIRTUAL_ENTER then - edit = not edit - dirty = true - elseif edit then - if event == EVT_VIRTUAL_EXIT then - edit = false - dirty = true - elseif not dirty then - dirty = blinkChanged() - end - else - if event == EVT_VIRTUAL_NEXT_PAGE then - page = nextPage - field = 0 - dirty = true - elseif event == EVT_VIRTUAL_PREV_PAGE then - page = prevPage - field = 0 - killEvents(event); - dirty = true - else - field = fieldIncDec(event, field, fieldMax, true) - end - end -end - -local function getFieldFlags(position) - flags = 0 - if field == position then - flags = INVERS - if edit then - flags = INVERS + BLINK - end - end - return flags -end - -local function channelIncDec(event, value) - if not edit and event==EVT_VIRTUAL_MENU then - servoPage = value - dirty = true - else - value = valueIncDec(event, value, 0, 15) - end - return value -end - --- Init function -local function init() - rudCH1 = defaultChannel(0) - eleCH1 = defaultChannel(1) - thrCH1 = defaultChannel(2) - ailCH1 = defaultChannel(3) -end - --- Engine Menu -local engineModeItems = {"No", "Yes"} -local function drawEngineMenu() - lcd.clear() - if engineMode == 1 then - -- 1 channel - lcd.drawText(5, 30, "Assign channel", 0); - lcd.drawText(5, 40, ">>>", 0); - lcd.drawSource(25, 40, MIXSRC_CH1+thrCH1, getFieldFlags(1)) - fieldsMax = 1 - else - -- No engine - fieldsMax = 0 - end - lcd.drawText(1, 0, "Got an engine?", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, FILL_WHITE) - lcd.drawCombobox(0, 8, LCD_W, engineModeItems, engineMode, getFieldFlags(0)) -end - -local function engineMenu(event) - if dirty then - dirty = false - drawEngineMenu() - end - - navigate(event, fieldsMax, page, page+1) - - if field==0 then - engineMode = fieldIncDec(event, engineMode, 1) - elseif field==1 then - thrCH1 = channelIncDec(event, thrCH1) - end -end - --- Ailerons Menu -local aileronsModeItems = {"No", "Yes, 1 channel", "Yes, 2 channels"} -local function drawAileronsMenu() - lcd.clear() - if aileronsMode == 2 then - -- 2 channels - lcd.drawText(5, 30, "Assign channels", 0); - lcd.drawText(30, 40, "L", 0); - lcd.drawText(65, 40, "R", 0); - lcd.drawText(5, 50, ">>>", 0); - lcd.drawSource(25, 50, MIXSRC_CH1+ailCH1, getFieldFlags(1)) - lcd.drawSource(60, 50, MIXSRC_CH1+ailCH2, getFieldFlags(2)) - fieldsMax = 2 - elseif aileronsMode == 1 then - -- 1 channel - lcd.drawText(5, 30, "Assign channel", 0); - lcd.drawText(5, 40, ">>>", 0); - lcd.drawSource(25, 40, MIXSRC_CH1+ailCH1, getFieldFlags(1)) - fieldsMax = 1 - else - -- No ailerons - fieldsMax = 0 - end - lcd.drawText(1, 0, "Got ailerons?", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, FILL_WHITE) - lcd.drawCombobox(0, 8, LCD_W, aileronsModeItems, aileronsMode, getFieldFlags(0)) -end - -local function aileronsMenu(event) - if dirty then - dirty = false - drawAileronsMenu() - end - - navigate(event, fieldsMax, page-1, page+1) - - if field==0 then - aileronsMode = fieldIncDec(event, aileronsMode, 2) - elseif field==1 then - ailCH1 = channelIncDec(event, ailCH1) - elseif field==2 then - ailCH2 = channelIncDec(event, ailCH2) - end -end - --- Flaps Menu -local flapsModeItems = {"No", "Yes, 1 channel", "Yes, 2 channels"} -local function drawFlapsMenu() - lcd.clear() - if flapsMode == 0 then - -- no flaps - fieldsMax = 0 - elseif flapsMode == 1 then - -- 1 channel - lcd.drawText(5, 30, "Assign channel", 0); - lcd.drawText(5, 40, ">>>", 0); - lcd.drawSource(25, 40, MIXSRC_CH1+flapsCH1, getFieldFlags(1)) - fieldsMax = 1 - elseif flapsMode == 2 then - -- 2 channels - lcd.drawText(5, 30, "Assign channels", 0); - lcd.drawText(30, 40, "L", 0); - lcd.drawText(65, 40, "R", 0); - lcd.drawText(5, 50, ">>>", 0); - lcd.drawSource(25, 50, MIXSRC_CH1+flapsCH1, getFieldFlags(1)) - lcd.drawSource(60, 50, MIXSRC_CH1+flapsCH2, getFieldFlags(2)) - fieldsMax = 2 - end - lcd.drawText(1, 0, "Got flaps?", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, FILL_WHITE) - lcd.drawCombobox(0, 8, LCD_W, flapsModeItems, flapsMode, getFieldFlags(0)) -end - -local function flapsMenu(event) - if dirty then - dirty = false - drawFlapsMenu() - end - - navigate(event, fieldsMax, page-1, page+1) - - if field==0 then - flapsMode = fieldIncDec(event, flapsMode, 2) - elseif field==1 then - flapsCH1 = channelIncDec(event, flapsCH1) - elseif field==2 then - flapsCH2 = channelIncDec(event, flapsCH2) - end -end - --- Airbrakes Menu -local brakesModeItems = {"No", "Yes, 1 channel", "Yes, 2 channels"} -local function drawBrakesMenu() - lcd.clear() - if brakesMode == 0 then - -- no brakes - fieldsMax = 0 - elseif brakesMode == 1 then - -- 1 channel - lcd.drawText(5, 30, "Assign channel", 0); - lcd.drawText(5, 40, ">>>", 0); - lcd.drawSource(25, 40, MIXSRC_CH1+brakesCH1, getFieldFlags(1)) - fieldsMax = 1 - elseif brakesMode == 2 then - -- 2 channels - lcd.drawText(5, 30, "Assign channels", 0); - lcd.drawText(30, 40, "L", 0); - lcd.drawText(65, 40, "R", 0); - lcd.drawText(5, 50, ">>>", 0); - lcd.drawSource(25, 50, MIXSRC_CH1+brakesCH1, getFieldFlags(1)) - lcd.drawSource(60, 50, MIXSRC_CH1+brakesCH2, getFieldFlags(2)) - fieldsMax = 2 - end - lcd.drawText(1, 0, "Got air brakes?", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, FILL_WHITE) - lcd.drawCombobox(0, 8, LCD_W, brakesModeItems, brakesMode, getFieldFlags(0)) -end - -local function brakesMenu(event) - if dirty then - dirty = false - drawBrakesMenu() - end - - navigate(event, fieldsMax, page-1, page+1) - - if field==0 then - brakesMode = fieldIncDec(event, brakesMode, 2) - elseif field==1 then - brakesCH1 = channelIncDec(event, brakesCH1) - elseif field==2 then - brakesCH2 = channelIncDec(event, brakesCH2) - end -end - --- Tail Menu -local tailModeItems = {"Ele(1)", "Ele(1) + Ruder(1)", "Ele(2) + Ruder(1)", "V-Tail(2)"} -local function drawTailMenu() - lcd.clear() - if tailMode == 0 then - -- Elevator(1ch), no rudder... - lcd.drawText(5, 30, "Assign channel", 0); - lcd.drawText(5, 40, ">>>", 0); - lcd.drawSource(25, 40, MIXSRC_CH1+eleCH1, getFieldFlags(1)) - fieldsMax = 1 - elseif tailMode == 1 then - -- Elevator(1ch) + rudder... - lcd.drawText(5, 30, "Assign channels", 0); - lcd.drawText(25, 40, "Ele", 0); - lcd.drawText(60, 40, "Rud", 0); - lcd.drawText(5, 50, ">>>", 0); - lcd.drawSource(25, 50, MIXSRC_CH1+eleCH1, getFieldFlags(1)) - lcd.drawSource(60, 50, MIXSRC_CH1+rudCH1, getFieldFlags(2)) - fieldsMax = 2 - elseif tailMode == 2 then - -- Elevator(2ch) + rudder... - lcd.drawText(5, 30, "Assign channels", 0); - lcd.drawText(25, 40, "EleL", 0); - lcd.drawText(60, 40, "EleR", 0); - lcd.drawText(95, 40, "Rud", 0); - lcd.drawText(5, 50, ">>>", 0); - lcd.drawSource(25, 50, MIXSRC_CH1+eleCH1, getFieldFlags(1)) - lcd.drawSource(60, 50, MIXSRC_CH1+eleCH2, getFieldFlags(2)) - lcd.drawSource(95, 50, MIXSRC_CH1+rudCH1, getFieldFlags(3)) - fieldsMax = 3 - else - -- V-Tail... - lcd.drawText(5, 30, "Assign channels", 0); - lcd.drawText(25, 40, "VtaL", 0); - lcd.drawText(60, 40, "VtaR", 0); - lcd.drawText(5, 50, ">>>", 0); - lcd.drawSource(25, 50, MIXSRC_CH1+eleCH1, getFieldFlags(1)) - lcd.drawSource(60, 50, MIXSRC_CH1+eleCH2, getFieldFlags(2)) - fieldsMax = 2 - end - lcd.drawText(1, 0, "Tail config", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, FILL_WHITE) - lcd.drawCombobox(0, 8, LCD_W, tailModeItems, tailMode, getFieldFlags(0)) -end - -local function tailMenu(event) - if dirty then - dirty = false - drawTailMenu() - end - - navigate(event, fieldsMax, page-1, page+1) - - if field==0 then - tailMode = fieldIncDec(event, tailMode, 3) - elseif field==1 then - eleCH1 = channelIncDec(event, eleCH1) - elseif (field==2 and tailMode==1) or field==3 then - rudCH1 = channelIncDec(event, rudCH1) - elseif field==2 then - eleCH2 = channelIncDec(event, eleCH2) - end -end - --- Servo (limits) Menu -local function drawServoMenu(limits) - lcd.clear() - lcd.drawSource(1, 0, MIXSRC_CH1+servoPage, 0) - lcd.drawText(25, 0, "servo min/max/center/direction?", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, FILL_WHITE) - lcd.drawLine(LCD_W/2-1, 8, LCD_W/2-1, LCD_H, DOTTED, 0) - lcd.drawText(LCD_W/2-19, LCD_H-8, ">>>", 0); - lcd.drawNumber(140, 35, limits.min, PREC1+getFieldFlags(0)); - lcd.drawNumber(205, 35, limits.max, PREC1+getFieldFlags(1)); - lcd.drawNumber(170, 9, limits.offset, PREC1+getFieldFlags(2)); - if limits.revert == 0 then - lcd.drawText(129, 50, "\126", getFieldFlags(3)); - else - lcd.drawText(129, 50, "\127", getFieldFlags(3)); - end - fieldsMax = 3 -end - -local function servoMenu(event) - local limits = model.getOutput(servoPage) - - if dirty then - dirty = false - drawServoMenu(limits) - end - - navigate(event, fieldsMax, page, page) - - if edit then - if field==0 then - limits.min = valueIncDec(event, limits.min, -1000, 0) - elseif field==1 then - limits.max = valueIncDec(event, limits.max, 0, 1000) - elseif field==2 then - limits.offset = valueIncDec(event, limits.offset, -1000, 1000) - elseif field==3 then - limits.revert = fieldIncDec(event, limits.revert, 1) - end - model.setOutput(servoPage, limits) - elseif event == EVT_VIRTUAL_EXIT then - servoPage = nil - dirty = true - end -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 - y = 12 - x = 70 - end - return x, y -end - -local function drawConfirmationMenu() - local x = 5 - local y = 12 - lcd.clear() - lcd.drawText(0, 1, "Ready to go?", 0); - lcd.drawFilledRectangle(0, 0, LCD_W, 9, 0) - if engineMode == 1 then - x, y = drawNextLine(x, y, "Thr", thrCH1) - end - if aileronsMode == 1 then - x, y = drawNextLine(x, y, "Ail", ailCH1) - elseif aileronsMode == 2 then - x, y = drawNextLine(x, y, "AilL", ailCH1) - x, y = drawNextLine(x, y, "AilR", ailCH2) - end - if flapsMode == 1 then - x, y = drawNextLine(x, y, "Flap", flapsCH1) - elseif flapsMode == 2 then - x, y = drawNextLine(x, y, "FlpL", flapsCH1) - x, y = drawNextLine(x, y, "FlpR", flapsCH2) - end - if brakesMode == 1 then - x, y = drawNextLine(x, y, "Brak", brakesCH1) - elseif brakesMode == 2 then - x, y = drawNextLine(x, y, "BrkL", brakesCH1) - x, y = drawNextLine(x, y, "BrkR", brakesCH2) - end - if tailMode == 3 then - x, y = drawNextLine(x, y, "VtaL", eleCH1) - x, y = drawNextLine(x, y, "VtaR", eleCH2) - else - x, y = drawNextLine(x, y, "Rud", rudCH1) - if tailMode == 1 then - x, y = drawNextLine(x, y, "Elev", eleCH1) - elseif tailMode == 2 then - x, y = drawNextLine(x, y, "EleL", eleCH1) - x, y = drawNextLine(x, y, "EleR", eleCH2) - end - end - lcd.drawText(0, LCD_H-8, "[Enter Long] to confirm", 0); - lcd.drawFilledRectangle(0, LCD_H-9, LCD_W, 9, 0) - fieldsMax = 0 -end - -local function addMix(channel, input, name, weight, index) - local mix = { source=input, name=name } - if weight ~= nil then - mix.weight = weight - end - if index == nil then - index = 0 - end - model.insertMix(channel, index, mix) -end - -local function applySettings() - model.defaultInputs() - model.deleteMixes() - if engineMode > 0 then - addMix(thrCH1, MIXSRC_FIRST_INPUT+defaultChannel(2), "Engine") - end - if aileronsMode == 1 then - addMix(ailCH1, MIXSRC_FIRST_INPUT+defaultChannel(3), "Ail") - elseif aileronsMode == 2 then - 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") - elseif flapsMode == 2 then - addMix(flapsCH1, MIXSRC_SA, "FlapL") - addMix(flapsCH2, MIXSRC_SA, "FlapR") - end - if brakesMode == 1 then - addMix(brakesCH1, MIXSRC_SD, "Brake") - elseif brakesMode == 2 then - addMix(brakesCH1, MIXSRC_SD, "BrakeL") - addMix(brakesCH2, MIXSRC_SD, "BrakeR") - 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(eleCH2, MIXSRC_FIRST_INPUT+defaultChannel(1), "V-EleR", 50) - addMix(eleCH2, MIXSRC_FIRST_INPUT+defaultChannel(0), "V-RudR", 50, 1) - else - if tailMode > 0 then - addMix(rudCH1, MIXSRC_FIRST_INPUT+defaultChannel(0), "Rudder") - end - if tailMode == 1 then - addMix(eleCH1, MIXSRC_FIRST_INPUT+defaultChannel(1), "Elev") - elseif tailMode == 2 then - addMix(eleCH1, MIXSRC_FIRST_INPUT+defaultChannel(1), "ElevG") - addMix(eleCH2, MIXSRC_FIRST_INPUT+defaultChannel(1), "ElevD") - end - end -end - -local function confirmationMenu(event) - if dirty then - dirty = false - drawConfirmationMenu() - end - - navigate(event, fieldsMax, TAIL_PAGE, page) - - if event == EVT_VIRTUAL_EXIT then - return 2 - elseif event == EVT_VIRTUAL_ENTER_LONG then - killEvents(event) - applySettings() - return 2 - else - return 0 - end -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - end - - if servoPage ~= nil then - servoMenu(event) - elseif page == ENGINE_PAGE then - engineMenu(event) - elseif page == AILERONS_PAGE then - aileronsMenu(event) - elseif page == FLAPERONS_PAGE then - flapsMenu(event) - elseif page == BRAKES_PAGE then - brakesMenu(event) - elseif page == TAIL_PAGE then - tailMenu(event) - elseif page == CONFIRMATION_PAGE then - return confirmationMenu(event) - end - return 0 -end - -return { init=init, run=run } diff --git a/radio/sdcard/taranis-x7/SCRIPTS/WIZARD/wizard.lua b/radio/sdcard/taranis-x7/SCRIPTS/WIZARD/wizard.lua deleted file mode 100755 index 06f365c9c..000000000 --- a/radio/sdcard/taranis-x7/SCRIPTS/WIZARD/wizard.lua +++ /dev/null @@ -1,84 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - --- Model types -local modelType = 0 -local MODELTYPE_PLANE = 0 -local MODELTYPE_DELTA = 1 -local MODELTYPE_QUAD = 2 - --- Common functions -local function fieldIncDec(event, value, max) - if event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - value = (value + max) - elseif event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - value = (value + max + 2) - end - value = (value % (max+1)) - return value -end - --- Model Type Menu -local function modelTypeSurround(index) - if index <= 1 then - lcd.drawFilledRectangle(59*(index%2)+12, 13, 43, 23) - else - lcd.drawFilledRectangle(59*(index%2)+12, 34, 40, 20) - end -end - -local function drawModelChoiceMenu() - lcd.clear() - lcd.drawScreenTitle("Select model type", 0, 0) - lcd.drawText( 20, 20, "Plane") - lcd.drawText( 78, 20, "Delta") - lcd.drawText( 20, 40, "Multi") - modelTypeSurround(modelType) - fieldsMax = 0 -end - -local function modelTypeMenu(event) - drawModelChoiceMenu() - if event == EVT_VIRTUAL_ENTER then - if modelType == MODELTYPE_PLANE then - return "plane.lua" - elseif modelType == MODELTYPE_DELTA then - return "delta.lua" - elseif modelType == MODELTYPE_QUAD then - return "multi.lua" - end - else - modelType = fieldIncDec(event, modelType, 2) - end - return 0 -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - end - - if event == EVT_VIRTUAL_EXIT then - return 2 - end - - - return modelTypeMenu(event) -end - -return { run=run } diff --git a/radio/sdcard/taranis-x7/SCRIPTS/snake.lua b/radio/sdcard/taranis-x7/SCRIPTS/snake.lua deleted file mode 100644 index d3a1914bb..000000000 --- a/radio/sdcard/taranis-x7/SCRIPTS/snake.lua +++ /dev/null @@ -1,176 +0,0 @@ --------------------------------------------------------------- --- Classic snake game --- --- 2009 Led Lab @PUC-Rio www.eluaproject.net --- Dado Sutter --- Ives Negreiros --- To Benjamin ---------------------------------------------------------------- - -local xMax = math.floor( LCD_W / 6 ) - 1 -local yMax = math.floor( LCD_H / 8 ) - 1 -local game_map = {} - -local Head = {} -local Tail = {} - -local highscore = 0 -local size = 3 -Tail.x = 1 -Tail.y = 1 -Head.x = Tail.x + ( size - 1 ) -Head.y = Tail.y - -local Food = {} -Food.x = false -Food.y = false - -Head.dx = 1 -Head.dy = 0 -Tail.dx = Head.dx -Tail.dy = Head.dy -local direction = "right" -local score = 0 - -local function create_food() - Food.x, Food.y = math.random( xMax - 1), math.random( yMax - 1) - while game_map[ Food.x ][ Food.y ] do - Food.x, Food.y = math.random( xMax - 1 ), math.random( yMax - 1 ) - end - game_map[ Food.x ][ Food.y ] = "food" - lcd.drawText( Food.x * 6, Food.y * 8+2, "@", 0 ) -end - -local function eat_food() - playFile("/SCRIPTS/snake.wav") - lcd.drawText( Head.x * 6, Head.y * 8, " ", 0 ) - game_map[ Head.x ][ Head.y ] = nil - create_food() - score = score + 1 -end - -local function check_collision() - if Head.x < 0 or Head.x > xMax then - return true - elseif Head.y < 0 or Head.y > yMax then - return true - elseif ( ( game_map[ Head.x ][ Head.y ] ) and ( game_map[ Head.x ][ Head.y ] ~= "food" ) ) then - return true - end - return false -end - -local function move() - if game_map[ Tail.x ][ Tail.y ] == "right" then - Tail.dx = 1 - Tail.dy = 0 - elseif game_map[ Tail.x ][ Tail.y ] == "left" then - Tail.dx = -1 - Tail.dy = 0 - elseif game_map[ Tail.x ][ Tail.y ] == "up" then - Tail.dx = 0 - Tail.dy = -1 - elseif game_map[ Tail.x ][ Tail.y ] == "down" then - Tail.dx = 0 - Tail.dy = 1 - end - - game_map[ Head.x ][ Head.y ] = direction - Head.x = Head.x + Head.dx - Head.y = Head.y + Head.dy - - if Head.x < 0 or Head.x > xMax or Head.y < 0 or Head.y > yMax then - return - elseif game_map[ Head.x ][ Head.y ] == "food" then - eat_food() - else - lcd.drawText(Tail.x * 6, Tail.y * 8, " ", 16) - game_map[ Tail.x ][ Tail.y ] = nil - Tail.x = Tail.x + Tail.dx - Tail.y = Tail.y + Tail.dy - end - - lcd.drawText(Head.x * 6, Head.y * 8, "*", 0) -end - -local function init() - food = false - lcd.clear() - size = 3 - score = 0 - Tail.x = 1 - Tail.y = 1 - Head.x = Tail.x + ( size - 1 ) - Head.y = Tail.y - Head.dx = 1 - Head.dy = 0 - Tail.dx = Head.dx - Tail.dy = Head.dy - direction = "right" - - for i = 0, xMax, 1 do - game_map[ i ] = {} - end - - for i = 0, size - 1, 1 do - game_map[ Tail.x + ( i * Tail.dx ) ][ Tail.y + ( i * Tail.dy ) ] = direction - lcd.drawText( ( Tail.x + ( i * Tail.dx ) ) * 6, ( Tail.y + ( i * Tail.dy ) ) * 8, "*", 0 ) - end - - create_food() -end - -local snakeCounter = 0 - -local function run(event) - if event == nil then - raise("Cannot be run as a model script!") - end - - if event == EVT_VIRTUAL_EXIT then - return 2 - end - - snakeCounter = snakeCounter + 1 - if snakeCounter < 30 then - return 0 - end - - snakeCounter = 0 - - local dir = direction - if getValue('rud') > 100 and direction ~= "left" then - dir = "right" - Head.dx = 1 - Head.dy = 0 - end - if getValue('rud') < -100 and direction ~= "right" then - dir = "left" - Head.dx = -1 - Head.dy = 0 - end - if getValue('ele') > 100 and direction ~= "down" then - dir = "up" - Head.dx = 0 - Head.dy = -1 - end - if getValue('ele') < -100 and direction ~= "up" then - dir = "down" - Head.dx = 0 - Head.dy = 1 - end - - direction = dir - move() - - lcd.refresh() - - if check_collision() then - return 1 - end - - return 0 -end - -return { init=init, run=run } - diff --git a/radio/sdcard/taranis-x7/UTILITIES/MultiConfigExternal.lua b/radio/sdcard/taranis-x7/UTILITIES/MultiConfigExternal.lua deleted file mode 100644 index a8baf3d13..000000000 --- a/radio/sdcard/taranis-x7/UTILITIES/MultiConfigExternal.lua +++ /dev/null @@ -1,499 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - - ---############################################################################### --- Multi buffer for Config description --- To start operation: --- Write 0xFF at address 4 will request the buffer to be cleared --- Write "Conf" at address 0..3 --- Read --- Read at address 12 gives the current config page --- Read at address 13..172 gives the current data of the page = 8 lines * 20 caracters --- Write --- Write at address 5..11 the command --- Write 0x01 at address 4 will send the command to the module --- !! Before exiting the script must write 0 at address 0 for normal operation !! ---############################################################################### - -local Version = "v0.1" -local Focus = -1 -local Page = 0 -local Edit = -1 -local Edit_pos = 1 -local Menu = { {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""} } -local Menu_value = {} -local Blink = 0 -local Module = {} -local InitialProtocol = 0 - -function bitand(a, b) - local result = 0 - local bitval = 1 - while a > 0 and b > 0 do - if a % 2 == 1 and b % 2 == 1 then -- test the rightmost bits - result = result + bitval -- set the current bit - end - bitval = bitval * 2 -- shift left - a = math.floor(a/2) -- shift right - b = math.floor(b/2) - end - return result -end - -local function Config_Send(page, line, value) - local i - i = (page*16) + line - multiBuffer( 5, i ) - for i = 1 , 6 , 1 do - multiBuffer( 5+i, value[i] ) - end - multiBuffer( 4, 1 ) -end - -local function Config_Release() - Module.protocol = InitialProtocol - model.setModule(1, Module) - - local i - for i = 3 , 0 , -1 do - multiBuffer( i, 0 ) - end -end - -local function Config_Page( ) - Config_Send(Page, 0, { 0, 0, 0, 0, 0, 0 }) -end - -local function Config_Draw_Edit( event ) - local i - local text - - if Menu[Focus].field_type == 0xD0 then - -- Editable Hex value - if Edit == -1 then - -- Init - Edit = 0 - Edit_pos = 1 - Blink = 0 - for i = 1, Menu[Focus].field_len, 1 do - Menu_value[i] = Menu[Focus].field_value[i] - end - end - if Edit == 0 then - -- Not editing value - if event == EVT_VIRTUAL_ENTER then - if Edit_pos > Menu[Focus].field_len then - -- Save or Cancel - Edit = -1 - if Edit_pos == Menu[Focus].field_len + 1 then - -- Save - Config_Send(Page, Focus, Menu_value) - end - return - else - -- Switch to edit mode - Edit = 1 - end - elseif event == EVT_VIRTUAL_PREV and Edit_pos > 1 then - -- Move cursor - Edit_pos = Edit_pos - 1 - elseif event == EVT_VIRTUAL_NEXT and Edit_pos < Menu[Focus].field_len + 2 then - -- Move cursor - Edit_pos = Edit_pos + 1 - end - else - -- Editing value - if event == EVT_VIRTUAL_ENTER then - -- End edit - Edit = 0 - elseif event == EVT_VIRTUAL_PREV then - -- Change value - Menu_value[Edit_pos] = Menu_value[Edit_pos] - 1 - elseif event == EVT_VIRTUAL_NEXT then - -- Change value - Menu_value[Edit_pos] = Menu_value[Edit_pos] + 1 - end - --Blink - Blink = Blink + 1 - if Blink > 30 then - Blink = 0 - end - end - --Display - if LCD_W == 480 then - lcd.drawRectangle(160-1, 100-1, 160+2, 55+2, TEXT_COLOR) - lcd.drawFilledRectangle(160, 100, 160, 55, TEXT_BGCOLOR) - else - lcd.clear() - end - for i = 1, Menu[Focus].field_len, 1 do - if i==Edit_pos and (Edit ~= 1 or Blink > 15) then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(170+12*2*(i-1), 110, string.format('%02X', Menu_value[i]), attrib) - else - lcd.drawText(17+6*2*(i-1), 10, string.format('%02X', Menu_value[i]), attrib + SMLSIZE) - end - end - if Edit_pos == Menu[Focus].field_len + 1 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(170, 130, "Save", attrib) - else - lcd.drawText(17, 30, "Save", attrib + SMLSIZE) - end - if Edit_pos == Menu[Focus].field_len + 2 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(260, 130, "Cancel", attrib) - else - lcd.drawText(77, 30, "Cancel", attrib + SMLSIZE) - end - - elseif Menu[Focus].field_type == 0x90 then - -- Action text - if Edit == -1 then - -- Init - Edit = 0 - Edit_pos = 2 - end - if event == EVT_VIRTUAL_ENTER then - -- Exit - Edit = -1 - if Edit_pos == 1 then - -- Yes - Config_Send(Page, Focus, { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA } ) - end - return - elseif event == EVT_VIRTUAL_PREV and Edit_pos > 1 then - -- Switch to Yes - Edit_pos = Edit_pos - 1 - elseif event == EVT_VIRTUAL_NEXT and Edit_pos < 2 then - -- Switch to No - Edit_pos = Edit_pos + 1 - end - -- Display - if LCD_W == 480 then - lcd.drawRectangle(160-1, 100-1, 160+2, 55+2, TEXT_COLOR) - lcd.drawFilledRectangle(160, 100, 160, 55, TEXT_BGCOLOR) - else - lcd.clear() - end - if LCD_W == 480 then - lcd.drawText(170, 110, Menu[Focus].field_text .. "?") - else - lcd.drawText(17, 10, Menu[Focus].field_text .. "?", SMLSIZE) - end - if Edit_pos == 1 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(170, 130, "Yes", attrib) - else - lcd.drawText(17, 30, "Yes", attrib + SMLSIZE) - end - if Edit_pos == 2 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(260, 130, "No", attrib) - else - lcd.drawText(77, 30, "No", attrib) - end - end -end - -local function Config_Next_Prev( event ) --- Next Prev on main menu - local line - if event == EVT_VIRTUAL_PREV then - for line = Focus - 1, 1, -1 do - if Menu[line].field_type >= 0x80 and Menu[line].field_type ~= 0xA0 and Menu[line].field_type ~= 0xC0 then - Focus = line - break - end - end - elseif event == EVT_VIRTUAL_NEXT then - for line = Focus + 1, 7, 1 do - if Menu[line].field_type >= 0x80 and Menu[line].field_type ~= 0xA0 and Menu[line].field_type ~= 0xC0 then - Focus = line - break - end - end - end -end - -local function Config_Draw_Menu() --- Main menu - local i - local value - local line - local length - local text - - lcd.clear() - - if LCD_W == 480 then - --Draw title - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, "Multi Config " .. Version, MENU_TITLE_COLOR) - if multiBuffer(13) == 0x00 then - lcd.drawText(10,50,"No Config telemetry...", BLINK) - end - else - --Draw on LCD_W=128 - lcd.drawText(1, 0, "Multi Config " .. Version, SMLSIZE) - if multiBuffer(13) == 0x00 then - lcd.drawText(2,17,"No Config telemetry...",SMLSIZE) - end - end - - if multiBuffer(13) ~= 0x00 then - if LCD_W == 480 then - --Draw firmware version and channels order - local ch_order = multiBuffer(17) - local channel_names = {} - channel_names[bitand(ch_order,3)+1] = "A" - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = "E" - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = "T" - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = "R" - lcd.drawText(150, 5, "Firmware v" .. multiBuffer(13) .. "." .. multiBuffer(14) .. "." .. multiBuffer(15) .. "." .. multiBuffer(16), MENU_TITLE_COLOR) - --lcd.drawText(150, 5, "Firmware v" .. multiBuffer(13) .. "." .. multiBuffer(14) .. "." .. multiBuffer(15) .. "." .. multiBuffer(16) .. " " .. channel_names[1] .. channel_names[2] .. channel_names[3] .. channel_names[4], MENU_TITLE_COLOR) - else - lcd.drawText(76, 0, "/Fw" .. multiBuffer(13) .. "." .. multiBuffer(14) .. "." .. multiBuffer(15) .. "." .. multiBuffer(16),SMLSIZE) -- .. " " .. channel_names[1] .. channel_names[2] .. channel_names[3] .. channel_names[4]) - end - - --Draw Menu - for line = 1, 7, 1 do - --Clear line info - Menu[line].text = "" - Menu[line].field_type = 0 - Menu[line].field_len = 0 - for i = 1, 7, 1 do - Menu[line].field_value[i] = 0 - end - Menu[line].field_text = "" - length = 0 - --Read line from buffer - for i = 0, 20-1, 1 do - value=multiBuffer( line*20+13+i ) - if value == 0 then - break -- end of line - end - if value > 0x80 and Menu[line].field_type == 0 then - -- Read field type - Menu[line].field_type = bitand(value, 0xF0) - Menu[line].field_len = bitand(value, 0x0F) - length = Menu[line].field_len - if Menu[line].field_type ~= 0xA0 and Menu[line].field_type ~= 0xC0 and Focus == -1 then - -- First actionnable field if nothing was selected - Focus = line; - end - else - if Menu[line].field_type == 0 then - -- Text - Menu[line].text = Menu[line].text .. string.char(value) - else - -- Menu specific fields - length = length - 1 - if Menu[line].field_type == 0x80 or Menu[line].field_type == 0x90 then - Menu[line].field_text = Menu[line].field_text .. string.char(value) - else - Menu[line].field_value[Menu[line].field_len-length] = value - end - if length == 0 then - -- End of fields - break - end - end - end - end - -- Display menu text - if Menu[line].text ~= "" then - if Menu[line].field_type == 0xA0 or Menu[line].field_type == 0xB0 or Menu[line].field_type == 0xC0 or Menu[line].field_type == 0xD0 then - Menu[line].text = Menu[line].text .. ":" - end - if LCD_W == 480 then - lcd.drawText(10,32+20*line,Menu[line].text ) - else - lcd.drawText(2,1+8*line,Menu[line].text,SMLSIZE) - end - end - -- Display specific fields - if line == Focus then - attrib = INVERS - else - attrib = 0 - end - if Menu[line].field_type == 0x80 or Menu[line].field_type == 0x90 then - -- Text - if LCD_W == 480 then - lcd.drawText(10+9*#Menu[line].text, 32+20*line, Menu[line].field_text, attrib) - else - lcd.drawText(2+5*#Menu[line].text, 1+8*line, Menu[line].field_text, SMLSIZE + attrib) - end - elseif Menu[line].field_type == 0xA0 or Menu[line].field_type == 0xB0 then - -- Decimal value - value = 0 - for i = 1, Menu[line].field_len, 1 do - value = value*256 + value - end - if LCD_W == 480 then - lcd.drawText(10+9*#Menu[line].text, 32+20*line, value, attrib) - else - lcd.drawText(2+5*#Menu[line].text, 1+8*line, value, SMLSIZE + attrib) - end - elseif Menu[line].field_type == 0xC0 or Menu[line].field_type == 0xD0 then - -- Hex value - text="" - for i = 1, Menu[line].field_len, 1 do - text = text .. string.format('%02X ', Menu[line].field_value[i]) - end - if LCD_W == 480 then - lcd.drawText(10+9*#Menu[line].text, 32+20*line, text, attrib) - else - lcd.drawText(2+5*#Menu[line].text, 1+8*line, text, SMLSIZE + attrib) - end - end - end - end -end - --- Init -local function Config_Init() - --get Module settings and set to config - Module = model.getModule(1) - InitialProtocol = Module.protocol - Module.protocol = 86 - model.setModule(1, Module) - for i = 0, 10, 1 do end - --Set protocol to talk to - multiBuffer( 0, string.byte('C') ) - --test if value has been written - if multiBuffer( 0 ) ~= string.byte('C') then - error("Not enough memory!") - return 2 - end - --Request init of the buffer - multiBuffer( 4, 0xFF ) - --Continue buffer init - multiBuffer( 1, string.byte('o') ) - multiBuffer( 2, string.byte('n') ) - multiBuffer( 3, string.byte('f') ) - - -- Test set - -- multiBuffer( 12, 0 ) - -- multiBuffer( 13, 1 ) - -- multiBuffer( 14, 3 ) - -- multiBuffer( 15, 2 ) - -- multiBuffer( 16, 62 ) - -- multiBuffer( 17, 0 + 1*4 + 2*16 + 3*64) - - -- multiBuffer( 33, string.byte('G') ) - -- multiBuffer( 34, string.byte('l') ) - -- multiBuffer( 35, string.byte('o') ) - -- multiBuffer( 36, string.byte('b') ) - -- multiBuffer( 37, string.byte('a') ) - -- multiBuffer( 38, string.byte('l') ) - -- multiBuffer( 39, string.byte(' ') ) - -- multiBuffer( 40, string.byte('I') ) - -- multiBuffer( 41, string.byte('D') ) - -- multiBuffer( 42, 0xD0 + 4 ) - -- multiBuffer( 43, 0x12 ) - -- multiBuffer( 44, 0x34 ) - -- multiBuffer( 45, 0x56 ) - -- multiBuffer( 46, 0x78 ) - -- multiBuffer( 47, 0x9A ) - -- multiBuffer( 48, 0xBC ) - - -- multiBuffer( 53, 0x90 + 9 ) - -- multiBuffer( 54, string.byte('R') ) - -- multiBuffer( 55, string.byte('e') ) - -- multiBuffer( 56, string.byte('s') ) - -- multiBuffer( 57, string.byte('e') ) - -- multiBuffer( 58, string.byte('t') ) - -- multiBuffer( 59, string.byte(' ') ) - -- multiBuffer( 60, string.byte('G') ) - -- multiBuffer( 61, string.byte('I') ) - -- multiBuffer( 62, string.byte('D') ) - -- multiBuffer( 63, 0x00 ) -end - --- Main -local function Config_Run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_EXIT then - Config_Release() - return 2 - else - Config_Draw_Menu() - if ( event == EVT_VIRTUAL_PREV_PAGE or event == EVT_VIRTUAL_NEXT_PAGE ) and Edit < 1 then - -- Not editing, ok to change page - if event == EVT_VIRTUAL_PREV_PAGE then - killEvents(event) - if Page > 0 then - --Page = Page - 1 - --Config_Page() - end - else - --Page = Page + 1 - --Config_Page() - end - end - if Focus > 0 then - -- At least one line has an action - if Edit >= 0 then - -- Currently editing - Config_Draw_Edit( event ) - elseif event == EVT_VIRTUAL_ENTER then - -- Switch to edit - Config_Draw_Edit( 0 ) - elseif event == EVT_VIRTUAL_PREV or event == EVT_VIRTUAL_NEXT then - -- Main menu selection - Config_Next_Prev( event ) - end - end - return 0 - end -end - -return { init=Config_Init, run=Config_Run } diff --git a/radio/sdcard/taranis-x7/UTILITIES/MultiConfigInternal.lua b/radio/sdcard/taranis-x7/UTILITIES/MultiConfigInternal.lua deleted file mode 100644 index 29ced006c..000000000 --- a/radio/sdcard/taranis-x7/UTILITIES/MultiConfigInternal.lua +++ /dev/null @@ -1,499 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - - ---############################################################################### --- Multi buffer for Config description --- To start operation: --- Write 0xFF at address 4 will request the buffer to be cleared --- Write "Conf" at address 0..3 --- Read --- Read at address 12 gives the current config page --- Read at address 13..172 gives the current data of the page = 8 lines * 20 caracters --- Write --- Write at address 5..11 the command --- Write 0x01 at address 4 will send the command to the module --- !! Before exiting the script must write 0 at address 0 for normal operation !! ---############################################################################### - -local Version = "v0.1" -local Focus = -1 -local Page = 0 -local Edit = -1 -local Edit_pos = 1 -local Menu = { {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""} } -local Menu_value = {} -local Blink = 0 -local Module = {} -local InitialProtocol = 0 - -function bitand(a, b) - local result = 0 - local bitval = 1 - while a > 0 and b > 0 do - if a % 2 == 1 and b % 2 == 1 then -- test the rightmost bits - result = result + bitval -- set the current bit - end - bitval = bitval * 2 -- shift left - a = math.floor(a/2) -- shift right - b = math.floor(b/2) - end - return result -end - -local function Config_Send(page, line, value) - local i - i = (page*16) + line - multiBuffer( 5, i ) - for i = 1 , 6 , 1 do - multiBuffer( 5+i, value[i] ) - end - multiBuffer( 4, 1 ) -end - -local function Config_Release() - Module.protocol = InitialProtocol - model.setModule(0, Module) - - local i - for i = 3 , 0 , -1 do - multiBuffer( i, 0 ) - end -end - -local function Config_Page( ) - Config_Send(Page, 0, { 0, 0, 0, 0, 0, 0 }) -end - -local function Config_Draw_Edit( event ) - local i - local text - - if Menu[Focus].field_type == 0xD0 then - -- Editable Hex value - if Edit == -1 then - -- Init - Edit = 0 - Edit_pos = 1 - Blink = 0 - for i = 1, Menu[Focus].field_len, 1 do - Menu_value[i] = Menu[Focus].field_value[i] - end - end - if Edit == 0 then - -- Not editing value - if event == EVT_VIRTUAL_ENTER then - if Edit_pos > Menu[Focus].field_len then - -- Save or Cancel - Edit = -1 - if Edit_pos == Menu[Focus].field_len + 1 then - -- Save - Config_Send(Page, Focus, Menu_value) - end - return - else - -- Switch to edit mode - Edit = 1 - end - elseif event == EVT_VIRTUAL_PREV and Edit_pos > 1 then - -- Move cursor - Edit_pos = Edit_pos - 1 - elseif event == EVT_VIRTUAL_NEXT and Edit_pos < Menu[Focus].field_len + 2 then - -- Move cursor - Edit_pos = Edit_pos + 1 - end - else - -- Editing value - if event == EVT_VIRTUAL_ENTER then - -- End edit - Edit = 0 - elseif event == EVT_VIRTUAL_PREV then - -- Change value - Menu_value[Edit_pos] = Menu_value[Edit_pos] - 1 - elseif event == EVT_VIRTUAL_NEXT then - -- Change value - Menu_value[Edit_pos] = Menu_value[Edit_pos] + 1 - end - --Blink - Blink = Blink + 1 - if Blink > 30 then - Blink = 0 - end - end - --Display - if LCD_W == 480 then - lcd.drawRectangle(160-1, 100-1, 160+2, 55+2, TEXT_COLOR) - lcd.drawFilledRectangle(160, 100, 160, 55, TEXT_BGCOLOR) - else - lcd.clear() - end - for i = 1, Menu[Focus].field_len, 1 do - if i==Edit_pos and (Edit ~= 1 or Blink > 15) then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(170+12*2*(i-1), 110, string.format('%02X', Menu_value[i]), attrib) - else - lcd.drawText(17+6*2*(i-1), 10, string.format('%02X', Menu_value[i]), attrib + SMLSIZE) - end - end - if Edit_pos == Menu[Focus].field_len + 1 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(170, 130, "Save", attrib) - else - lcd.drawText(17, 30, "Save", attrib + SMLSIZE) - end - if Edit_pos == Menu[Focus].field_len + 2 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(260, 130, "Cancel", attrib) - else - lcd.drawText(77, 30, "Cancel", attrib + SMLSIZE) - end - - elseif Menu[Focus].field_type == 0x90 then - -- Action text - if Edit == -1 then - -- Init - Edit = 0 - Edit_pos = 2 - end - if event == EVT_VIRTUAL_ENTER then - -- Exit - Edit = -1 - if Edit_pos == 1 then - -- Yes - Config_Send(Page, Focus, { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA } ) - end - return - elseif event == EVT_VIRTUAL_PREV and Edit_pos > 1 then - -- Switch to Yes - Edit_pos = Edit_pos - 1 - elseif event == EVT_VIRTUAL_NEXT and Edit_pos < 2 then - -- Switch to No - Edit_pos = Edit_pos + 1 - end - -- Display - if LCD_W == 480 then - lcd.drawRectangle(160-1, 100-1, 160+2, 55+2, TEXT_COLOR) - lcd.drawFilledRectangle(160, 100, 160, 55, TEXT_BGCOLOR) - else - lcd.clear() - end - if LCD_W == 480 then - lcd.drawText(170, 110, Menu[Focus].field_text .. "?") - else - lcd.drawText(17, 10, Menu[Focus].field_text .. "?", SMLSIZE) - end - if Edit_pos == 1 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(170, 130, "Yes", attrib) - else - lcd.drawText(17, 30, "Yes", attrib + SMLSIZE) - end - if Edit_pos == 2 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(260, 130, "No", attrib) - else - lcd.drawText(77, 30, "No", attrib) - end - end -end - -local function Config_Next_Prev( event ) --- Next Prev on main menu - local line - if event == EVT_VIRTUAL_PREV then - for line = Focus - 1, 1, -1 do - if Menu[line].field_type >= 0x80 and Menu[line].field_type ~= 0xA0 and Menu[line].field_type ~= 0xC0 then - Focus = line - break - end - end - elseif event == EVT_VIRTUAL_NEXT then - for line = Focus + 1, 7, 1 do - if Menu[line].field_type >= 0x80 and Menu[line].field_type ~= 0xA0 and Menu[line].field_type ~= 0xC0 then - Focus = line - break - end - end - end -end - -local function Config_Draw_Menu() --- Main menu - local i - local value - local line - local length - local text - - lcd.clear() - - if LCD_W == 480 then - --Draw title - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, "Multi Config " .. Version, MENU_TITLE_COLOR) - if multiBuffer(13) == 0x00 then - lcd.drawText(10,50,"No Config telemetry...", BLINK) - end - else - --Draw on LCD_W=128 - lcd.drawText(1, 0, "Multi Config " .. Version, SMLSIZE) - if multiBuffer(13) == 0x00 then - lcd.drawText(2,17,"No Config telemetry...",SMLSIZE) - end - end - - if multiBuffer(13) ~= 0x00 then - if LCD_W == 480 then - --Draw firmware version and channels order - local ch_order = multiBuffer(17) - local channel_names = {} - channel_names[bitand(ch_order,3)+1] = "A" - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = "E" - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = "T" - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = "R" - lcd.drawText(150, 5, "Firmware v" .. multiBuffer(13) .. "." .. multiBuffer(14) .. "." .. multiBuffer(15) .. "." .. multiBuffer(16), MENU_TITLE_COLOR) - --lcd.drawText(150, 5, "Firmware v" .. multiBuffer(13) .. "." .. multiBuffer(14) .. "." .. multiBuffer(15) .. "." .. multiBuffer(16) .. " " .. channel_names[1] .. channel_names[2] .. channel_names[3] .. channel_names[4], MENU_TITLE_COLOR) - else - lcd.drawText(76, 0, "/Fw" .. multiBuffer(13) .. "." .. multiBuffer(14) .. "." .. multiBuffer(15) .. "." .. multiBuffer(16),SMLSIZE) -- .. " " .. channel_names[1] .. channel_names[2] .. channel_names[3] .. channel_names[4]) - end - - --Draw Menu - for line = 1, 7, 1 do - --Clear line info - Menu[line].text = "" - Menu[line].field_type = 0 - Menu[line].field_len = 0 - for i = 1, 7, 1 do - Menu[line].field_value[i] = 0 - end - Menu[line].field_text = "" - length = 0 - --Read line from buffer - for i = 0, 20-1, 1 do - value=multiBuffer( line*20+13+i ) - if value == 0 then - break -- end of line - end - if value > 0x80 and Menu[line].field_type == 0 then - -- Read field type - Menu[line].field_type = bitand(value, 0xF0) - Menu[line].field_len = bitand(value, 0x0F) - length = Menu[line].field_len - if Menu[line].field_type ~= 0xA0 and Menu[line].field_type ~= 0xC0 and Focus == -1 then - -- First actionnable field if nothing was selected - Focus = line; - end - else - if Menu[line].field_type == 0 then - -- Text - Menu[line].text = Menu[line].text .. string.char(value) - else - -- Menu specific fields - length = length - 1 - if Menu[line].field_type == 0x80 or Menu[line].field_type == 0x90 then - Menu[line].field_text = Menu[line].field_text .. string.char(value) - else - Menu[line].field_value[Menu[line].field_len-length] = value - end - if length == 0 then - -- End of fields - break - end - end - end - end - -- Display menu text - if Menu[line].text ~= "" then - if Menu[line].field_type == 0xA0 or Menu[line].field_type == 0xB0 or Menu[line].field_type == 0xC0 or Menu[line].field_type == 0xD0 then - Menu[line].text = Menu[line].text .. ":" - end - if LCD_W == 480 then - lcd.drawText(10,32+20*line,Menu[line].text ) - else - lcd.drawText(2,1+8*line,Menu[line].text,SMLSIZE) - end - end - -- Display specific fields - if line == Focus then - attrib = INVERS - else - attrib = 0 - end - if Menu[line].field_type == 0x80 or Menu[line].field_type == 0x90 then - -- Text - if LCD_W == 480 then - lcd.drawText(10+9*#Menu[line].text, 32+20*line, Menu[line].field_text, attrib) - else - lcd.drawText(2+5*#Menu[line].text, 1+8*line, Menu[line].field_text, SMLSIZE + attrib) - end - elseif Menu[line].field_type == 0xA0 or Menu[line].field_type == 0xB0 then - -- Decimal value - value = 0 - for i = 1, Menu[line].field_len, 1 do - value = value*256 + value - end - if LCD_W == 480 then - lcd.drawText(10+9*#Menu[line].text, 32+20*line, value, attrib) - else - lcd.drawText(2+5*#Menu[line].text, 1+8*line, value, SMLSIZE + attrib) - end - elseif Menu[line].field_type == 0xC0 or Menu[line].field_type == 0xD0 then - -- Hex value - text="" - for i = 1, Menu[line].field_len, 1 do - text = text .. string.format('%02X ', Menu[line].field_value[i]) - end - if LCD_W == 480 then - lcd.drawText(10+9*#Menu[line].text, 32+20*line, text, attrib) - else - lcd.drawText(2+5*#Menu[line].text, 1+8*line, text, SMLSIZE + attrib) - end - end - end - end -end - --- Init -local function Config_Init() - --get Module settings and set to config - Module = model.getModule(0) - InitialProtocol = Module.protocol - Module.protocol = 86 - model.setModule(0, Module) - for i = 0, 10, 1 do end - --Set protocol to talk to - multiBuffer( 0, string.byte('C') ) - --test if value has been written - if multiBuffer( 0 ) ~= string.byte('C') then - error("Not enough memory!") - return 2 - end - --Request init of the buffer - multiBuffer( 4, 0xFF ) - --Continue buffer init - multiBuffer( 1, string.byte('o') ) - multiBuffer( 2, string.byte('n') ) - multiBuffer( 3, string.byte('f') ) - - -- Test set - -- multiBuffer( 12, 0 ) - -- multiBuffer( 13, 1 ) - -- multiBuffer( 14, 3 ) - -- multiBuffer( 15, 2 ) - -- multiBuffer( 16, 62 ) - -- multiBuffer( 17, 0 + 1*4 + 2*16 + 3*64) - - -- multiBuffer( 33, string.byte('G') ) - -- multiBuffer( 34, string.byte('l') ) - -- multiBuffer( 35, string.byte('o') ) - -- multiBuffer( 36, string.byte('b') ) - -- multiBuffer( 37, string.byte('a') ) - -- multiBuffer( 38, string.byte('l') ) - -- multiBuffer( 39, string.byte(' ') ) - -- multiBuffer( 40, string.byte('I') ) - -- multiBuffer( 41, string.byte('D') ) - -- multiBuffer( 42, 0xD0 + 4 ) - -- multiBuffer( 43, 0x12 ) - -- multiBuffer( 44, 0x34 ) - -- multiBuffer( 45, 0x56 ) - -- multiBuffer( 46, 0x78 ) - -- multiBuffer( 47, 0x9A ) - -- multiBuffer( 48, 0xBC ) - - -- multiBuffer( 53, 0x90 + 9 ) - -- multiBuffer( 54, string.byte('R') ) - -- multiBuffer( 55, string.byte('e') ) - -- multiBuffer( 56, string.byte('s') ) - -- multiBuffer( 57, string.byte('e') ) - -- multiBuffer( 58, string.byte('t') ) - -- multiBuffer( 59, string.byte(' ') ) - -- multiBuffer( 60, string.byte('G') ) - -- multiBuffer( 61, string.byte('I') ) - -- multiBuffer( 62, string.byte('D') ) - -- multiBuffer( 63, 0x00 ) -end - --- Main -local function Config_Run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_EXIT then - Config_Release() - return 2 - else - Config_Draw_Menu() - if ( event == EVT_VIRTUAL_PREV_PAGE or event == EVT_VIRTUAL_NEXT_PAGE ) and Edit < 1 then - -- Not editing, ok to change page - if event == EVT_VIRTUAL_PREV_PAGE then - killEvents(event) - if Page > 0 then - --Page = Page - 1 - --Config_Page() - end - else - --Page = Page + 1 - --Config_Page() - end - end - if Focus > 0 then - -- At least one line has an action - if Edit >= 0 then - -- Currently editing - Config_Draw_Edit( event ) - elseif event == EVT_VIRTUAL_ENTER then - -- Switch to edit - Config_Draw_Edit( 0 ) - elseif event == EVT_VIRTUAL_PREV or event == EVT_VIRTUAL_NEXT then - -- Main menu selection - Config_Next_Prev( event ) - end - end - return 0 - end -end - -return { init=Config_Init, run=Config_Run } diff --git a/radio/sdcard/taranis-x7/UTILITIES/SxR Calibrate/SxR_Calibrate.lua b/radio/sdcard/taranis-x7/UTILITIES/SxR Calibrate/SxR_Calibrate.lua deleted file mode 100644 index b9e406691..000000000 --- a/radio/sdcard/taranis-x7/UTILITIES/SxR Calibrate/SxR_Calibrate.lua +++ /dev/null @@ -1,300 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### -local VALUE = 0 -local COMBO = 1 - -local COLUMN_2 = 150 - -local edit = false -local page = 1 -local current = 1 -local refreshState = 0 -local refreshIndex = 0 -local calibrationState = 0 -local pageOffset = 0 -local calibrationStep = 0 -local pages = {} -local fields = {} -local modifications = {} -local positionConfirmed = 0 -local orientationAutoSense = 0 - -local calibrationFields = { - {"X:", VALUE, 0x9E, 0, -100, 100, "%"}, - {"Y:", VALUE, 0x9F, 0, -100, 100, "%"}, - {"Z:", VALUE, 0xA0, 0, -100, 100, "%"} -} - -local function drawProgressBar() - local width = (140 * refreshIndex) / #fields - lcd.drawRectangle(30, 1, 144, 6) - lcd.drawFilledRectangle(32, 3, width, 2); -end - --- Select the next or previous page -local function selectPage(step) - page = 1 + ((page + step - 1 + #pages) % #pages) - refreshIndex = 0 - calibrationStep = 0 - pageOffset = 0 -end - --- Draw initial warning page -local function runWarningPage(event) - lcd.clear() - lcd.drawScreenTitle("SxR Calibration", page, #pages) - lcd.drawText(0, 10, "You only need to calibrate", SMLSIZE) - lcd.drawText(0, 20, "once. You will need the SxR,", SMLSIZE) - lcd.drawText(0, 30, "power, and a level surface.", SMLSIZE) - lcd.drawText(0, 40, "Press [Enter] when ready", SMLSIZE) - lcd.drawText(0, 50, "Press [Exit] to cancel", SMLSIZE) - if event == EVT_VIRTUAL_ENTER then - selectPage(1) - return 0 - elseif event == EVT_VIRTUAL_EXIT then - return 2 - end - return 0 -end - --- Redraw the current page -local function redrawFieldsPage() - lcd.clear() - lcd.drawScreenTitle("SxR Calibration", page, #pages) - - if refreshIndex < #fields then - drawProgressBar() - end - - for index = 1, 7, 1 do - local field = fields[pageOffset+index] - if field == nil then - break - end - - local attr = current == (pageOffset+index) and ((edit == true and BLINK or 0) + INVERS) or 0 - - lcd.drawText(0, 1+8*index, field[1]) - - if field[4] == nil then - lcd.drawText(COLUMN_2, 1+8*index, "---", attr) - else - if field[2] == VALUE then - lcd.drawNumber(COLUMN_2, 1+8*index, field[4], LEFT + attr) - elseif field[2] == COMBO then - if field[4] >= 0 and field[4] < #(field[5]) then - lcd.drawText(COLUMN_2, 1+8*index, field[5][1+field[4]], attr) - end - end - end - end -end - -local function telemetryRead(field) - return sportTelemetryPush(0x17, 0x30, 0x0C30, field) -end - -local function telemetryWrite(field, value) - return sportTelemetryPush(0x17, 0x31, 0x0C30, field + value*256) -end - -local telemetryPopTimeout = 0 -local function refreshNext() - if refreshState == 0 then - if calibrationState == 1 then - if telemetryWrite(0x9D, calibrationStep) == true then - refreshState = 1 - calibrationState = 2 - telemetryPopTimeout = getTime() + 80 -- normal delay is 500ms - end - elseif #modifications > 0 then - telemetryWrite(modifications[1][1], modifications[1][2]) - modifications[1] = nil - elseif refreshIndex < #fields then - local field = fields[refreshIndex + 1] - if telemetryRead(field[3]) == true then - refreshState = 1 - telemetryPopTimeout = getTime() + 80 -- normal delay is 500ms - end - end - elseif refreshState == 1 then - local physicalId, primId, dataId, value = sportTelemetryPop() - if physicalId == 0x1A and primId == 0x32 and dataId == 0x0C30 then - local fieldId = value % 256 - if calibrationState == 2 then - if fieldId == 0x9D then - refreshState = 0 - calibrationState = 0 - calibrationStep = (calibrationStep + 1) % 7 - end - else - local field = fields[refreshIndex + 1] - if fieldId == field[3] then - local value = math.floor(value / 256) - value = bit32.band(value, 0xffff) - if field[3] >= 0x9E and field[3] <= 0xA0 then - local b1 = value % 256 - local b2 = math.floor(value / 256) - value = b1*256 + b2 - value = value - bit32.band(value, 0x8000) * 2 - end - if field[2] == COMBO and #field == 6 then - for index = 1, #(field[6]), 1 do - if value == field[6][index] then - value = index - 1 - break - end - end - elseif field[2] == VALUE and #field == 8 then - value = value - field[8] + field[5] - end - fields[refreshIndex + 1][4] = value - refreshIndex = refreshIndex + 1 - refreshState = 0 - end - end - elseif getTime() > telemetryPopTimeout then - refreshState = 0 - calibrationState = 0 - end - end -end - -local function updateField(field) - local value = field[4] - if field[2] == COMBO and #field == 6 then - value = field[6][1+value] - elseif field[2] == VALUE and #field == 8 then - value = value + field[8] - field[5] - end - modifications[#modifications+1] = { field[3], value } -end - --- Main -local function runFieldsPage(event) - if event == EVT_VIRTUAL_EXIT then -- exit script - return 2 - elseif event == EVT_VIRTUAL_ENTER then -- toggle editing/selecting current field - if fields[current][4] ~= nil then - edit = not edit - if edit == false then - updateField(fields[current]) - end - end - elseif edit then - if event == EVT_VIRTUAL_NEXT or event == EVT_VIRTUAL_NEXT_REP then - addField(1) - elseif event == EVT_VIRTUAL_PREV or event == EVT_VIRTUAL_PREV_REP then - addField(-1) - end - else - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REP then - selectField(1) - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REP then - selectField(-1) - end - end - redrawFieldsPage() - return 0 -end - -local function drawCalibrationOrientation(x, y, step) - local orientation = { {"Label up.", "", 0, 0, 1000, 0, 0, 1000}, - {"Label down.", "", 0, 0, -1000, 0, 0, -1000}, - {"Pins Up.", "", -1000, 0, 0, 1000, 0, 0}, - {"Pins Down.", "", 1000, 0, 0, -1000, 0, 0}, - {"Label facing you", "Pins Right", 0, 1000, 0, 0, -1000, 0}, - {"Label facing you", "Pins Left", 0, -1000 , 0, 0, 1000, 0} } - - lcd.drawText(0, 9, "Place the SxR as follows:", 0) - lcd.drawText(x-9, y, orientation[step][1]) - lcd.drawText(x-9, y+10, orientation[step][2]) - local positionStatus = 0 - for index = 1, 3, 1 do - local field = fields[index] - lcd.drawText(90, 12+10*index, field[1], 0) - if math.abs(field[4] - orientation[step][2+index+orientationAutoSense]) < 200 then - lcd.drawNumber(100, 12+10*index, field[4]/10, LEFT+PREC2) - positionStatus = positionStatus + 1 - else - lcd.drawNumber(100, 12+10*index, field[4]/10, LEFT+PREC2+INVERS) - end - end - if step == 3 and positionStatus == 2 then -- orientation auto sensing - orientationAutoSense = 3 - orientationAutoSense - end - if positionStatus == 3 then - lcd.drawText(0, 56, " [Enter] to validate ", INVERS) - positionConfirmed = 1 - end -end - -local function runCalibrationPage(event) - fields = calibrationFields - if refreshIndex == #fields then - refreshIndex = 0 - end - lcd.clear() - lcd.drawScreenTitle("SxR Calibration", page, #pages) - if(calibrationStep < 6) then - drawCalibrationOrientation(10, 24, 1 + calibrationStep) - - local attr = calibrationState == 0 and INVERS or 0 - --lcd.drawText(0, 56, "[Enter] to validate", attr) - else - lcd.drawText(0, 19, "Calibration completed", 0) --- lcd.drawText(10, 19, "Done",0) - lcd.drawText(0, 56, "Press [Exit] when ready", attr) - end - if calibrationStep > 6 and (event == EVT_VIRTUAL_ENTER or event == EVT_VIRTUAL_EXIT) then - return 2 - elseif event == EVT_VIRTUAL_ENTER and positionConfirmed then - calibrationState = 1 - positionConfirmed = 0 - end - return 0 -end - - --- Init -local function init() - current, edit, refreshState, refreshIndex = 1, false, 0, 0 - pages = { - runWarningPage, - runCalibrationPage - } -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_NEXT_PAGE then - selectPage(1) - elseif event == EVT_VIRTUAL_PREV_PAGE then - killEvents(event); - selectPage(-1) - end - - local result = pages[page](event) - refreshNext() - - return result -end - -return { init=init, run=run } diff --git a/radio/sdcard/taranis-x7/edgetx.sdcard.version b/radio/sdcard/taranis-x7/edgetx.sdcard.version deleted file mode 100644 index a921c3b61..000000000 --- a/radio/sdcard/taranis-x7/edgetx.sdcard.version +++ /dev/null @@ -1 +0,0 @@ -2.4V0037 diff --git a/radio/sdcard/taranis-x9/EEPROM/readme.txt b/radio/sdcard/taranis-x9/EEPROM/readme.txt deleted file mode 100644 index 52977efaf..000000000 --- a/radio/sdcard/taranis-x9/EEPROM/readme.txt +++ /dev/null @@ -1,2 +0,0 @@ -EEprom backups go in this folder. -EEprom backups can be generated from VERSION screen in RADIO SETUP diff --git a/radio/sdcard/taranis-x9/FIRMWARE/readme.txt b/radio/sdcard/taranis-x9/FIRMWARE/readme.txt deleted file mode 100644 index 4ba9522c9..000000000 --- a/radio/sdcard/taranis-x9/FIRMWARE/readme.txt +++ /dev/null @@ -1,2 +0,0 @@ -You can put firmware for your modules or radio in this folder. -Files in this folder are NOT automaticaly applied. diff --git a/radio/sdcard/taranis-x9/IMAGES/readme.txt b/radio/sdcard/taranis-x9/IMAGES/readme.txt deleted file mode 100644 index 1ceddccf8..000000000 --- a/radio/sdcard/taranis-x9/IMAGES/readme.txt +++ /dev/null @@ -1,3 +0,0 @@ -2.2 : BMP renamed to IMAGES for consistency between Taranis and Horus. -You can put your model BMP and other graphic files in this directory. -BMP color depth must be set to 4 bits. diff --git a/radio/sdcard/taranis-x9/LOGS/readme.txt b/radio/sdcard/taranis-x9/LOGS/readme.txt deleted file mode 100644 index f9c005b26..000000000 --- a/radio/sdcard/taranis-x9/LOGS/readme.txt +++ /dev/null @@ -1 +0,0 @@ -Logs files created by "SD Logs" special function will be stored in this directory. diff --git a/radio/sdcard/taranis-x9/MODELS/readme.txt b/radio/sdcard/taranis-x9/MODELS/readme.txt deleted file mode 100644 index 5c5707a4d..000000000 --- a/radio/sdcard/taranis-x9/MODELS/readme.txt +++ /dev/null @@ -1 +0,0 @@ -Individual model files for the Backup/Restore model features go here, as well as model note text files. diff --git a/radio/sdcard/taranis-x9/SCREENSHOTS/readme.txt b/radio/sdcard/taranis-x9/SCREENSHOTS/readme.txt deleted file mode 100644 index 8b89b3c6c..000000000 --- a/radio/sdcard/taranis-x9/SCREENSHOTS/readme.txt +++ /dev/null @@ -1 +0,0 @@ -Screenshots created by "Screenshot" special function will be stored in this directory. diff --git a/radio/sdcard/taranis-x9/SCRIPTS/FUNCTIONS/readme.txt b/radio/sdcard/taranis-x9/SCRIPTS/FUNCTIONS/readme.txt deleted file mode 100644 index e14fc62df..000000000 --- a/radio/sdcard/taranis-x9/SCRIPTS/FUNCTIONS/readme.txt +++ /dev/null @@ -1 +0,0 @@ -This directory is for lua functions scripts. diff --git a/radio/sdcard/taranis-x9/SCRIPTS/MIXES/readme.txt b/radio/sdcard/taranis-x9/SCRIPTS/MIXES/readme.txt deleted file mode 100644 index 8a5e2e738..000000000 --- a/radio/sdcard/taranis-x9/SCRIPTS/MIXES/readme.txt +++ /dev/null @@ -1 +0,0 @@ -This directory is for lua mixer scripts. diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TELEMETRY/readme.txt b/radio/sdcard/taranis-x9/SCRIPTS/TELEMETRY/readme.txt deleted file mode 100644 index 26b887558..000000000 --- a/radio/sdcard/taranis-x9/SCRIPTS/TELEMETRY/readme.txt +++ /dev/null @@ -1,2 +0,0 @@ -This directory is for lua telemetry scripts. -Those scripts can be selected using DISPLAY page. diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/CROSSFIRE/crossfire.lua b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/CROSSFIRE/crossfire.lua deleted file mode 100644 index 70c125b69..000000000 --- a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/CROSSFIRE/crossfire.lua +++ /dev/null @@ -1,117 +0,0 @@ -local toolName = "TNS|Crossfire setup|TNE" ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### -local devices = { } -local lineIndex = 1 -local pageOffset = 0 - -local function createDevice(id, name) - local device = { - id = id, - name = name, - timeout = 0 - } - return device -end - -local function getDevice(name) - for i=1, #devices do - if devices[i].name == name then - return devices[i] - end - end - return nil -end - -local function parseDeviceInfoMessage(data) - local id = data[2] - local name = "" - local i = 3 - while data[i] ~= 0 do - name = name .. string.char(data[i]) - i = i + 1 - end - local device = getDevice(name) - if device == nil then - device = createDevice(id, name) - devices[#devices + 1] = device - end - local time = getTime() - device.timeout = time + 3000 -- 30s - if lineIndex == 0 then - lineIndex = 1 - end -end - -local devicesRefreshTimeout = 0 -local function refreshNext() - local command, data = crossfireTelemetryPop() - if command == nil then - local time = getTime() - if time > devicesRefreshTimeout then - devicesRefreshTimeout = time + 100 -- 1s - crossfireTelemetryPush(0x28, { 0x00, 0xEA }) - end - elseif command == 0x29 then - parseDeviceInfoMessage(data) - end -end - -local function selectDevice(step) - lineIndex = 1 + ((lineIndex + step - 1 + #devices) % #devices) -end - --- Init -local function init() - lineIndex = 0 - pageOffset = 0 -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_EXIT then - return 2 - elseif event == EVT_VIRTUAL_NEXT then - selectDevice(1) - elseif event == EVT_VIRTUAL_PREV then - selectDevice(-1) - end - - lcd.clear() - lcd.drawScreenTitle("CROSSFIRE SETUP", 0, 0) - if #devices == 0 then - lcd.drawText(24, 28, "Waiting for Crossfire devices...") - else - for i=1, #devices do - local attr = (lineIndex == i and INVERS or 0) - if event == EVT_VIRTUAL_ENTER and attr == INVERS then - crossfireTelemetryPush(0x28, { devices[i].id, 0xEA }) - return "device.lua" - end - lcd.drawText(0, i*8+9, devices[i].name, attr) - end - end - - refreshNext() - - return 0 -end - -return { init=init, run=run } diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/CROSSFIRE/device.lua b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/CROSSFIRE/device.lua deleted file mode 100644 index 833ec6d83..000000000 --- a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/CROSSFIRE/device.lua +++ /dev/null @@ -1,523 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### -local deviceId = 0 -local deviceName = "" -local lineIndex = 0 -local pageOffset = 0 -local edit = false -local charIndex = 1 -local fieldPopup -local fieldTimeout = 0 -local fieldId = 1 -local fieldChunk = 0 -local fieldData = {} -local fields = {} - -local function getField(line) - local counter = 1 - for i = 1, #fields do - local field = fields[i] - if not field.hidden then - if counter < line then - counter = counter + 1 - else - return field - end - end - end -end - -local function initLineIndex() - lineIndex = 0 - for i = 1, #fields do - local field = getField(i) - if field and field.type ~= 11 and field.type ~= 12 and field.name ~= nil then - lineIndex = i - break - end - end -end - --- Change display attribute to current field -local function incrField(step) - local field = getField(lineIndex) - if field.type == 10 then - local byte = 32 - if charIndex <= #field.value then - byte = string.byte(field.value, charIndex) + step - end - if byte < 32 then - byte = 32 - elseif byte > 122 then - byte = 122 - end - if charIndex <= #field.value then - field.value = string.sub(field.value, 1, charIndex-1) .. string.char(byte) .. string.sub(field.value, charIndex+1) - else - field.value = field.value .. string.char(byte) - end - else - local min, max = 0, 0 - if ((field.type <= 5) or (field.type == 8)) then - min = field.min - max = field.max - step = field.step * step - elseif field.type == 9 then - min = 0 - max = #field.values - 1 - end - if (step < 0 and field.value > min) or (step > 0 and field.value < max) then - field.value = field.value + step - end - end -end - --- Select the next or previous editable field -local function selectField(step) - local newLineIndex = lineIndex - local field - repeat - newLineIndex = newLineIndex + step - if newLineIndex == 0 then - newLineIndex = #fields - elseif newLineIndex == 1 + #fields then - newLineIndex = 1 - pageOffset = 0 - end - field = getField(newLineIndex) - until newLineIndex == lineIndex or (field and field.type ~= 11 and field.name) - lineIndex = newLineIndex - if lineIndex > 7 + pageOffset then - pageOffset = lineIndex - 7 - elseif lineIndex <= pageOffset then - pageOffset = lineIndex - 1 - end -end - -local function split(str) - local t = {} - local i = 1 - for s in string.gmatch(str, "([^;]+)") do - t[i] = s - i = i + 1 - end - return t -end - -local function fieldGetString(data, offset) - local result = "" - while data[offset] ~= 0 do - result = result .. string.char(data[offset]) - offset = offset + 1 - end - offset = offset + 1 - return result, offset -end - -local function parseDeviceInfoMessage(data) - local offset - deviceId = data[2] - deviceName, offset = fieldGetString(data, 3) - local fields_count = data[offset+12] - for i=1, fields_count do - fields[i] = { name=nil } - end -end - -local function fieldGetValue(data, offset, size) - local result = 0 - for i=0, size-1 do - result = bit32.lshift(result, 8) + data[offset + i] - end - return result -end - -local function fieldUnsignedLoad(field, data, offset, size) - field.value = fieldGetValue(data, offset, size) - field.min = fieldGetValue(data, offset+size, size) - field.max = fieldGetValue(data, offset+2*size, size) - field.default = fieldGetValue(data, offset+3*size, size) - field.unit, offset = fieldGetString(data, offset+4*size) - field.step = 1 -end - -local function fieldUnsignedToSigned(field, size) - local bandval = bit32.lshift(0x80, (size-1)*8) - field.value = field.value - bit32.band(field.value, bandval) * 2 - field.min = field.min - bit32.band(field.min, bandval) * 2 - field.max = field.max - bit32.band(field.max, bandval) * 2 - field.default = field.default - bit32.band(field.default, bandval) * 2 -end - - local function fieldSignedLoad(field, data, offset, size) - fieldUnsignedLoad(field, data, offset, size) - fieldUnsignedToSigned(field, size) -end - -local function fieldIntSave(index, value, size) - local frame = { deviceId, 0xEA, index } - for i=size-1, 0, -1 do - frame[#frame + 1] = (bit32.rshift(value, 8*i) % 256) - end - crossfireTelemetryPush(0x2D, frame) -end - -local function fieldUnsignedSave(field, size) - local value = field.value - fieldIntSave(field.id, value, size) -end - -local function fieldSignedSave(field, size) - local value = field.value - if value < 0 then - value = bit32.lshift(0x100, (size-1)*8) + value - end - fieldIntSave(field.id, value, size) -end - -local function fieldIntDisplay(field, y, attr) - lcd.drawNumber(140, y, field.value, LEFT + attr) - lcd.drawText(lcd.getLastPos(), y, field.unit, attr) -end - --- UINT8 -local function fieldUint8Load(field, data, offset) - fieldUnsignedLoad(field, data, offset, 1) -end - -local function fieldUint8Save(field) - fieldUnsignedSave(field, 1) -end - --- INT8 -local function fieldInt8Load(field, data, offset) - fieldSignedLoad(field, data, offset, 1) -end - -local function fieldInt8Save(field) - fieldSignedSave(field, 1) -end - --- UINT16 -local function fieldUint16Load(field, data, offset) - fieldUnsignedLoad(field, data, offset, 2) -end - -local function fieldUint16Save(field) - fieldUnsignedSave(field, 2) -end - --- INT16 -local function fieldInt16Load(field, data, offset) - fieldSignedLoad(field, data, offset, 2) -end - -local function fieldInt16Save(field) - fieldSignedSave(field, 2) -end - --- FLOAT -local function fieldFloatLoad(field, data, offset) - field.value = fieldGetValue(data, offset, 4) - field.min = fieldGetValue(data, offset+4, 4) - field.max = fieldGetValue(data, offset+8, 4) - field.default = fieldGetValue(data, offset+12, 4) - fieldUnsignedToSigned(field, 4) - field.prec = data[offset+16] - if field.prec > 3 then - field.prec = 3 - end - field.step = fieldGetValue(data, offset+17, 4) - field.unit, offset = fieldGetString(data, offset+21) -end - -local function formatFloat(num, decimals) - local mult = 10^(decimals or 0) - local val = num / mult - return string.format("%." .. decimals .. "f", val) -end - -local function fieldFloatDisplay(field, y, attr) - lcd.drawText(140, y, formatFloat(field.value, field.prec), LEFT + attr) - lcd.drawText(lcd.getLastPos(), y, field.unit, attr) -end - -local function fieldFloatSave(field) - fieldUnsignedSave(field, 4) -end - --- TEXT SELECTION -local function fieldTextSelectionLoad(field, data, offset) - local values - values, offset = fieldGetString(data, offset) - if values ~= "" then - field.values = split(values) - end - field.value = data[offset] - field.min = data[offset+1] - field.max = data[offset+2] - field.default = data[offset+3] - field.unit, offset = fieldGetString(data, offset+4) -end - -local function fieldTextSelectionSave(field) - crossfireTelemetryPush(0x2D, { deviceId, 0xEA, field.id, field.value }) -end - -local function fieldTextSelectionDisplay(field, y, attr) - lcd.drawText(140, y, field.values[field.value+1], attr) - lcd.drawText(lcd.getLastPos(), y, field.unit, attr) -end - --- STRING -local function fieldStringLoad(field, data, offset) - field.value, offset = fieldGetString(data, offset) - if #data >= offset then - field.maxlen = data[offset] - end -end - -local function fieldStringSave(field) - local frame = { deviceId, 0xEA, field.id } - for i=1, string.len(field.value) do - frame[#frame + 1] = string.byte(field.value, i) - end - frame[#frame + 1] = 0 - crossfireTelemetryPush(0x2D, frame) -end - -local function fieldStringDisplay(field, y, attr) - if edit == true and attr then - lcd.drawText(140, y, field.value, FIXEDWIDTH) - lcd.drawText(134+6*charIndex, y, string.sub(field.value, charIndex, charIndex), FIXEDWIDTH + attr) - else - lcd.drawText(140, y, field.value, attr) - end -end - -local function fieldCommandLoad(field, data, offset) - field.status = data[offset] - field.timeout = data[offset+1] - field.info, offset = fieldGetString(data, offset+2) - if field.status == 0 then - fieldPopup = nil - end -end - -local function fieldCommandSave(field) - if field.status == 0 then - field.status = 1 - crossfireTelemetryPush(0x2D, { deviceId, 0xEA, field.id, field.status }) - fieldPopup = field - fieldTimeout = getTime() + field.timeout - end -end - -local function fieldCommandDisplay(field, y, attr) - lcd.drawText(0, y, field.name, attr) - if field.info ~= "" then - lcd.drawText(140, y, "[" .. field.info .. "]") - end -end - -local functions = { - { load=fieldUint8Load, save=fieldUint8Save, display=fieldIntDisplay }, - { load=fieldInt8Load, save=fieldInt8Save, display=fieldIntDisplay }, - { load=fieldUint16Load, save=fieldUint16Save, display=fieldIntDisplay }, - { load=fieldInt16Load, save=fieldInt16Save, display=fieldIntDisplay }, - nil, - nil, - nil, - nil, - { load=fieldFloatLoad, save=fieldFloatSave, display=fieldFloatDisplay }, - { load=fieldTextSelectionLoad, save=fieldTextSelectionSave, display=fieldTextSelectionDisplay }, - { load=fieldStringLoad, save=fieldStringSave, display=fieldStringDisplay }, - nil, - { load=fieldStringLoad, save=fieldStringSave, display=fieldStringDisplay }, - { load=fieldCommandLoad, save=fieldCommandSave, display=fieldCommandDisplay }, -} - -local function parseParameterInfoMessage(data) - if data[2] ~= deviceId or data[3] ~= fieldId then - fieldData = {} - fieldChunk = 0 - return - end - local field = fields[fieldId] - local chunks = data[4] - for i=5, #data do - fieldData[#fieldData + 1] = data[i] - end - if chunks > 0 then - fieldChunk = fieldChunk + 1 - else - fieldChunk = 0 - field.id = fieldId - field.parent = fieldData[1] - field.type = fieldData[2] % 128 - field.hidden = (bit32.rshift(fieldData[2], 7) == 1) - local name, i = fieldGetString(fieldData, 3) - if name ~= "" then - local indent = "" - local parent = field.parent - while parent ~= 0 do - indent = indent .. " " - parent = fields[parent].parent - end - field.name = indent .. name - end - if functions[field.type+1] then - functions[field.type+1].load(field, fieldData, i) - end - if not fieldPopup then - if lineIndex == 0 and field.hidden ~= true and field.type and field.type ~= 11 and field.type ~= 12 then - initLineIndex() - end - fieldId = 1 + (fieldId % #fields) - end - fieldData = {} - end -end - -local function refreshNext() - local command, data = crossfireTelemetryPop() - if command == nil then - local time = getTime() - if fieldPopup then - if time > fieldTimeout then - crossfireTelemetryPush(0x2D, { deviceId, 0xEA, fieldPopup.id, 6 }) - fieldTimeout = time + fieldPopup.timeout - end - elseif time > fieldTimeout and not edit then - crossfireTelemetryPush(0x2C, { deviceId, 0xEA, fieldId, fieldChunk }) - fieldTimeout = time + 200 -- 2s - end - elseif command == 0x29 then - parseDeviceInfoMessage(data) - elseif command == 0x2B then - parseParameterInfoMessage(data) - fieldTimeout = 0 - end -end - --- Main -local function runDevicePage(event) - if event == EVT_VIRTUAL_EXIT then -- exit script - if edit == true then - edit = false - local field = getField(lineIndex) - fieldTimeout = getTime() + 200 -- 2s - fieldId, fieldChunk = field.id, 0 - fieldData = {} - functions[field.type+1].save(field) - else - return "crossfire.lua" - end - elseif event == EVT_VIRTUAL_ENTER then -- toggle editing/selecting current field - local field = getField(lineIndex) - if field.name then - if field.type == 10 then - if edit == false then - edit = true - charIndex = 1 - else - charIndex = charIndex + 1 - end - elseif field.type < 11 then - edit = not edit - end - if edit == false then - fieldTimeout = getTime() + 200 -- 2s - fieldId, fieldChunk = field.id, 0 - fieldData = {} - functions[field.type+1].save(field) - end - end - elseif edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - incrField(1) - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - incrField(-1) - end - else - if event == EVT_VIRTUAL_NEXT then - selectField(1) - elseif event == EVT_VIRTUAL_PREV then - selectField(-1) - end - end - - lcd.clear() - lcd.drawScreenTitle(deviceName, 0, 0) - for y = 1, 7 do - local field = getField(pageOffset+y) - if not field then - break - elseif field.name == nil then - lcd.drawText(0, 1+8*y, "...") - else - local attr = lineIndex == (pageOffset+y) and ((edit == true and BLINK or 0) + INVERS) or 0 - lcd.drawText(0, 1+8*y, field.name) - if functions[field.type+1] then - functions[field.type+1].display(field, 1+8*y, attr) - end - end - end - - return 0 -end - -local function runPopupPage(event) - local result - if fieldPopup.status == 3 then - result = popupConfirmation(fieldPopup.info, event) - else - result = popupWarning(fieldPopup.info, event) - end - if result == "OK" then - crossfireTelemetryPush(0x2D, { deviceId, 0xEA, fieldPopup.id, 4 }) - elseif result == "CANCEL" then - crossfireTelemetryPush(0x2D, { deviceId, 0xEA, fieldPopup.id, 5 }) - end - return 0 -end - --- Init -local function init() - lineIndex, edit = 0, false -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - end - - local result - if fieldPopup ~= nil then - result = runPopupPage(event) - else - result = runDevicePage(event) - end - - refreshNext() - - return result -end - -return { init=init, run=run } diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/FrSky GaSuite.lua b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/FrSky GaSuite.lua deleted file mode 100755 index e0497f00f..000000000 --- a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/FrSky GaSuite.lua +++ /dev/null @@ -1,515 +0,0 @@ - ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - -local version = "v1.1" - -local VALUE = 0 -local COMBO = 1 -local FLPOI = 2 - - -local edit = false -local page = 1 -local current = 1 --row -local refreshState = 0 -local refreshIndex = 0 -local refreshIndex3 = 0 -local pageOffset = 0 -local pages = {} -local fields = {} -local modifications = {} -local thistime = getTime() -local lastTime = thistime -local margin = 1 -local spacing = 8 -local configFields = {} -local counter = 0 -local appId = 0 - -local function drawScreenTitle(title,page, pages) - if math.fmod(math.floor(getTime()/100),10) == 0 then - title = version - end - if LCD_W == 480 then - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, title, MENU_COLOR) - lcd.drawText(LCD_W-40, 5, page.."/"..pages, MENU_COLOR) - else - lcd.drawScreenTitle(title, page, pages) - end -end - -local interfaceconfig = { - {"Sensor group select", VALUE, appId, nil, 0, 15}, -} - -local settingsFields = { - {"Software version", FLPOT, 0x0c, nil, 1, 100 }, - {"Physical ID", VALUE, 0x01, nil, 0, 26 }, - {"Application IDgroup", VALUE, 0x0D, nil, 0, 15 }, - {"Data rate(*100ms)", VALUE, 0x22, nil, 1, 255 }, -} - -local telemetryFields = { - {"TEMP1(C/F)", VALUE, 0x90, nil, -30, 600}, - {"TEMP2(C/F)", VALUE, 0x91, nil, -30, 600}, - {"SPEED(r/min)", VALUE, 0x92, nil, 0, 100000}, - {"Residual Volume(mL)", VALUE, 0x93, nil, 0, 60000}, - {"Residual Percent(%)", VALUE, 0x94, nil, 0, 100}, - {"FLOW(mL/min)", VALUE, 0x95, nil, 0, 2000}, - {"Max Flow(mL/min)", VALUE, 0x96, nil, 0, 2000}, - {"Avg Flow(mL/min)", VALUE, 0x97, nil, 0, 2000}, -} - --- Change display attribute to current field -local function addField(step) - local field = fields[current] - local min, max - if field[2] == VALUE then - min = field[5] - max = field[6] - elseif field[2] == COMBO then - min = 0 - max = #(field[5]) - 1 - end - if field[2] ~= FLPOT then --only read ? - if field[2] == VALUE and field[6] > 256 then - if field[4] > 1000 then - step = step * 50 - field[4] = math.floor(field[4]/50) - field[4] = field[4] *50 - elseif field[4] > 500 then - step = step * 20 - field[4] = math.floor(field[4]/20) - field[4] = field[4] *20 - elseif field[4] > 200 then - step = step * 10 - field[4] = math.floor(field[4]/10) - field[4] = field[4] *10 - else - step = step * 1 - field[4] = math.floor(field[4]/1) - field[4] = field[4] *1 - end - end - if (step < 0 and field[4] > min) or (step > 0 and field[4] < max) then - field[4] = field[4] + step - end - else - field[4] = field[4] - end -end - --- Select the next or previous page -local function selectPage(step) - page = 1 + ((page + step - 1 + #pages) % #pages) - refreshIndex = 0 - pageOffset = 0 -end - --- Select the next or previous editable field -local function selectField(step) - current = current + step - if current > #fields then - current = #fields - elseif current < 1 then - current = 1 - end - if current > 7 + pageOffset then - pageOffset = current - 7 - elseif current <= pageOffset then - pageOffset = current - 1 - end -end - -local function drawProgressBar() - if LCD_W == 480 then - local width = (300 * refreshIndex) / #fields - lcd.drawRectangle(100, 10, 300, 6) - lcd.drawFilledRectangle(102, 13, width, 2); - else - local width = (60 * refreshIndex) / #fields - lcd.drawRectangle(45, 1, 60, 6) - lcd.drawFilledRectangle(47, 3, width, 2); - end -end - --- Redraw the current page -local function redrawFieldsPage() - lcd.clear() - drawScreenTitle("GasSuit", page, #pages) - if refreshIndex < #fields then - drawProgressBar() - end - for index = 1, 7, 1 do - local field = fields[pageOffset+index] - if field == nil then - break - end - local attr = current == (pageOffset+index) and ((edit == true and BLINK or 0) + INVERS) or 0 - lcd.drawText(1, margin+ spacing * index, field[1]) - if field[4] == nil then - lcd.drawText(LCD_W, margin+ spacing * index, "---", attr + RIGHT) - else - if field[2] == VALUE then - if (field[3] == 0x90 or field[3] == 0x91) and field[4] == 500 then - lcd.drawText(LCD_W, margin+ spacing * index, "---", attr + RIGHT) - else - - lcd.drawNumber(LCD_W, margin+ spacing * index, field[4] , attr + RIGHT) - end - elseif field[2] == COMBO then - if field[4] >= 0 and field[4] < #(field[5]) then - lcd.drawText(LCD_W, margin+ spacing * index, field[5][1+field[4]], attr + RIGHT) - end - elseif field[2] == FLPOT then - lcd.drawText(LCD_W, margin+ spacing * index, field[4], attr + RIGHT) - end - end - end -end - -local function telemetryRead(fieldx) - return sportTelemetryPush(0x1b, 0x30, appId, fieldx) -end - -local function telemetryListen(fieldx) - return sportTelemetryPush(0x1b, 0, 0, 0) -end - -local function telemetryWrite(fieldx, valuex) - return sportTelemetryPush(0x1b, 0x31, appId, fieldx + valuex*256) -end - -local telemetryPopTimeout = 0 -local function refreshNext() - if refreshState == 0 and page ~= 3 then -- - if #modifications > 0 then -- - if modifications[1][1] ~= 0x0c then - if modifications[1][1] == 0x22 then - modifications[1][2] = modifications[1][2] + 0xf00 - end - local modificationstmp = modifications[1][2] - if modifications[1][1] == 0x8a or modifications[1][1] == 0x8b then - if configFields[11][4]== 1 then - modificationstmp = (modifications[1][2] - 32)*10 - modificationstmp = math.floor(modificationstmp/18) - end - end - telemetryWrite(modifications[1][1], modificationstmp) - refreshIndex = 0 - end - modifications[1] = nil - elseif refreshIndex < #fields then - local field = fields[refreshIndex + 1] - if telemetryRead(field[3]) == true then - refreshState = 1 - telemetryPopTimeout = getTime() + 80 - end - end - elseif refreshState == 0 and page == 3 then - if #modifications > 0 then - if modifications[1][1] == 0x96 or modifications[1][1] == 0x97 or modifications[1][1] == 0x93 then - telemetryWrite(modifications[1][1], 0) - end - modifications[1] = nil - elseif refreshIndex < #fields then - local field = fields[refreshIndex + 1] - if telemetryRead(field[3]) == true then - refreshState = 1 - telemetryPopTimeout = getTime() + 20 - end - elseif refreshIndex >= #fields then - refreshIndex = 0 - refreshState = 0 - end - elseif refreshState == 1 and page ~= 3 then - local physicalId, primId, dataId, value = sportTelemetryPop() - if primId == 0x32 and dataId >= 0x0d00 and dataId <= 0x0d7f then - local fieldId = value % 256 - local field = fields[refreshIndex + 1] - if fieldId == field[3] then - local value = math.floor(value / 256) - if field[2] == COMBO then - for index = 1, #(field[6]), 1 do - if value == field[6][index] then - value = index - 1 - break - end - end - elseif field[2] == VALUE then - value = value -- - field[8] + field[5] - end - if field[1] == "Software version" then - local flo_string = string.char(value/16%16 + 48).."."..string.char(value%16 + 48) - fields[refreshIndex + 1][4] = flo_string - else - fields[refreshIndex + 1][4] = value - end - refreshIndex = refreshIndex + 1 - refreshState = 0 - end - elseif getTime() > telemetryPopTimeout then - refreshState = 0 - end - elseif refreshState == 1 and page == 3 then - local pageID3 = 0 - local physicalId3, primId3, dataId3, value3 = sportTelemetryPop() - if value3 ~= nil then - pageID3 = value3 % 256 - value3 = math.floor(value3 / 0x100) - end - if primId3 == 0x32 and value3 ~= nil then - if pageID3 == fields[refreshIndex + 1][3] then - local field = fields[refreshIndex + 1] - if field[2] == COMBO and #field == 6 then - for index = 1, #(field[6]), 1 do - if value3 == field[6][index] then - value3 = index - 1 - break - end - end - elseif field[2] == VALUE then - if field[3] == 0x90 or field[3] == 0x91 then - value3 = math.floor(value3 % 0x10000) - if value3 > 0xf000 then - value3 = value3 - 0x10000 - end - if configFields[11][4]== 1 and (field[3] == 0x90 or field[3] == 0x91) then - value3 =(value3*18) - value3 = math.floor(value3/10)+32 - end - else - value3 = value3 - end - end - fields[refreshIndex + 1][4] = value3 - refreshIndex = refreshIndex + 1 - refreshState = 0 - end - elseif getTime() > telemetryPopTimeout then - refreshState = 0 - end - end -end - -local function updateField(field) - local value = field[4] - if field[2] == COMBO and #field == 6 then - value = field[6][1+value] - elseif field[2] == VALUE and #field == 6 then - value = value -- + field[8] - field[5] - elseif field[2] == FLPOT then - value = 0 - end - modifications[#modifications+1] = {field[3], value} -end - --- Main1 -local function runFieldsPage(event) - if event == EVT_VIRTUAL_EXIT then - return 2 - elseif event == EVT_VIRTUAL_ENTER then - if fields[current][4] ~= nil then - edit = not edit - if edit == false then - updateField(fields[current]) - end - end - elseif edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - addField(1) - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - addField(-1) - end - else - if event == EVT_VIRTUAL_NEXT then - selectField(1) - elseif event == EVT_VIRTUAL_PREV then - selectField(-1) - end - end - redrawFieldsPage() - return 0 -end - -local function runConfigPage(event) - fields = configFields - local result = runFieldsPage(event) - return result -end - -local function runSettingsPage(event) - fields = settingsFields - return runFieldsPage(event) -end - -local function runTelemetryPage(event) - fields = telemetryFields - return runFieldsPage(event) -end - --- Init -local function init() - current, edit, refreshState, refreshIndex = 1, false, 0, 0 - if LCD_W == 480 then - margin = 10 - spacing = 20 - end - if LCD_W == 128 then - configFields = { - {"CDI off speed limit", VALUE, 0x81, nil, 10,10000}, -- 1 - {"Milliliter per pulse", VALUE, 0x80, nil, 1, 2000}, -- 2 - {"Volume", VALUE, 0x83, nil, 10,60000}, -- 3 - -- {"Flow trigger", VALUE, 0x84, nil, 5, 50 }, - -- {"Flow Reset", COMBO, 0x85, nil, { "ON", "OFF" }, {1 , 0}}, - {"Auto Reset", COMBO, 0x8d, nil, { "ON", "OFF" }, {0 , 1}}, -- 4 - {"Reset settings", COMBO, 0x86, nil,{ "YES", "NO" }, {1 , 0} }, -- 5 - {"Volume alarm(%)", VALUE, 0x87, nil, 0, 90 }, -- 6 - {"Max.Flow alarm", VALUE, 0x88, nil, 0, 2000 }, -- 7 - {"Over speed alarm", VALUE, 0x89, nil, 0, 10000 }, -- 8 - {"Over temp1 alarm", VALUE, 0x8a, nil, 0, 600 }, -- 9 - {"Over temp2 alarm", VALUE, 0x8b, nil, 0, 600 }, -- 10 - {"Temperature C/F", COMBO, 0x8c, nil,{ "C", "F" }, {0 , 1} }, -- 11 - } - else - configFields = { - {"CDI off speed limit(*100RPM)", VALUE, 0x81, nil, 10,10000}, - {"Milliliter per pulse(*0.001mL/pul)", VALUE, 0x80, nil, 1, 2000}, - {"Volume(mL)", VALUE, 0x83, nil, 10,60000}, - -- {"Flow trigger(mL/min)", VALUE, 0x84, nil, 5, 50 }, - -- {"Flow Reset", COMBO, 0x85, nil, { "ON", "OFF" }, {1 , 0}}, - {"Auto Reset", COMBO, 0x8d, nil, { "ON", "OFF" }, {0 , 1}}, - {"Reset to factory settings", COMBO, 0x86, nil,{ "YES", "NO" }, {1 , 0} }, - {"Volume alarm(%)", VALUE, 0x87, nil, 0, 90 }, - {"Max.Flow alarm(mL/min)", VALUE, 0x88, nil, 0, 2000 }, - {"Over speed alarm(*100RPM)", VALUE, 0x89, nil, 0, 10000 }, - {"Over temperature1 alarm(C/F)", VALUE, 0x8a, nil, 0, 600 }, - {"Over temperature2 alarm(C/F)", VALUE, 0x8b, nil, 0, 600 }, - {"Temperature Celsius/Fahrenheit", COMBO, 0x8c, nil,{ "C", "F" }, {0 , 1} }, - } - end - - pages = { - runConfigPage, - runSettingsPage, - runTelemetryPage, - } - - -- Warning : GaSuite tool requires Temp2 to be connected and discovered for script to work - for index = 1, 40, 1 do - local sensor = model.getSensor(index) - if sensor ~= nil and sensor.id >= 0x0d10 and sensor.id <= 0x0d1f then - appId = sensor.id - break - end - end - - if appId == 0 then - error("No GasSuit sensor in this model!") - end -end - -local function background() - local tonefrq,tonelength,tonepause - thistime = getTime() - lastTime = thistime - refreshNext() - if page == 3 then --alarm - local alarmnum = 0 - if fields[3][4] ~= nil and configFields[9][4] ~= nil then - local speedtest = fields[3][4] - local speedover = configFields[9][4]*100 - if speedtest >= speedover then - tonefrq = 800 + math.max(0,math.floor((speedtest - speedover)/10)) - tonelength = 50 + math.max(0,(150 - math.floor((speedtest - speedover)/10))) - tonepause = tonelength - playTone(tonefrq, tonelength, tonepause, PLAY_BACKGROUND,10) - alarmnum = alarmnum + 1 - end - end - if fields[5][4] ~= nil and configFields[7][4] ~= nil then - local Residualtest = fields[5][4] - local Residualline = configFields[6][4] - if Residualtest < Residualline then - tonefrq = 400 - tonelength = 100 - tonepause = 1000 + math.floor( Residualline - Residualtest )*30 - playTone(tonefrq, tonelength, tonepause, PLAY_BACKGROUND,10) - alarmnum = alarmnum + 1 - end - end - if fields[6][4] ~= nil and configFields[8][4] ~= nil then - local Flowtest = fields[6][4] - local Flowover = configFields[7][4] - if Flowtest > Flowover then - tonefrq = 400 - tonelength = 100 - tonepause = 200 - playTone(tonefrq, tonelength, tonepause, PLAY_BACKGROUND,10) - alarmnum = alarmnum + 1 - end - end - if fields[1][4] ~= nil and configFields[10][4] ~= nil then - local temp1test = fields[1][4] -- - local temp1over = configFields[9][4] - if temp1test > temp1over and (temp1test ~= 500 and temp1test ~= 932) then - tonefrq = 2000 - tonelength = 100 - tonepause = 900 - playTone(tonefrq, tonelength, tonepause, PLAY_BACKGROUND,10) - alarmnum = alarmnum + 1 - end - end - if fields[2][4] ~= nil and configFields[11][4] ~= nil then - local temp2test = fields[2][4] - local temp2over = configFields[10][4] - if temp2test > temp2over and (temp2test ~= 500 and temp2test ~= 932) then - tonefrq = 2000 - tonelength = 300 - tonepause = 700 - playTone(tonefrq, tonelength, tonepause, PLAY_BACKGROUND,10) - alarmnum = alarmnum + 1 - end - end - if alarmnum > 1 then - playTone(2000, 100, 100, PLAY_BACKGROUND,10) - end - alarmnum = 0 - end -end - -local function run(event) - if event == nil then - error("Cannot be run as a sensor script!") - return 2 - elseif event == EVT_VIRTUAL_NEXT_PAGE then - selectPage(1) - elseif event == EVT_VIRTUAL_PREV_PAGE then - killEvents(event); - selectPage(-1) - end - local result = pages[page](event) - if page ~= 3 then - refreshNext() - end - background() - return result -end - -return { init=init, background=background, run=run } diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/FrSky RB30_RB40.lua b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/FrSky RB30_RB40.lua deleted file mode 100644 index 213faa6cf..000000000 --- a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/FrSky RB30_RB40.lua +++ /dev/null @@ -1,464 +0,0 @@ ---- - ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------ # # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - -local version = "v1.01" - -local VALUE = 0 -local COMBO = 1 - -local edit = false -local page = 1 -local current = 1 -local refreshState = 0 -local refreshIndex = 0 -local pageOffset = 0 -local pages = {} -local fields = {} -local modifications = {} -local margin = 1 -local spacing = 8 -local numberPerPage = 7 - -local configFields = { - { "Self_stable mode", COMBO, 0x80, nil, { "disable", "enable"} }, - { "Sbus out", COMBO, 0x81, nil, { "disable", "enable"} }, - { "VOut1(V)", VALUE, 0xB2, nil, 50, 84}, - { "VOut2(V)", VALUE, 0xB3, nil, 50, 84}, -} - - -local failsafeFields = { - { "CH1 failsafe", VALUE, 0x82, 150, 80, 220}, - { "CH2 failsafe", VALUE, 0x82, 150, 80, 220}, - { "CH3 failsafe", VALUE, 0x83, 150, 80, 220}, - { "CH4 failsafe", VALUE, 0x83, 150, 80, 220}, - { "CH5 failsafe", VALUE, 0x84, 150, 80, 220}, - { "CH6 failsafe", VALUE, 0x84, 150, 80, 220}, - { "CH7 failsafe", VALUE, 0x85, 150, 80, 220}, - { "CH8 failsafe", VALUE, 0x85, 150, 80, 220}, - { "CH9 failsafe", VALUE, 0x86, 150, 80, 220}, - { "CH10 failsafe", VALUE, 0x86, 150, 80, 220}, - { "CH11 failsafe", VALUE, 0x87, 150, 80, 220}, - { "CH12 failsafe", VALUE, 0x87, 150, 80, 220}, - { "CH13 failsafe", VALUE, 0x88, 150, 80, 220}, - { "CH14 failsafe", VALUE, 0x88, 150, 80, 220}, - { "CH15 failsafe", VALUE, 0x89, 150, 80, 220}, - { "CH16 failsafe", VALUE, 0x89, 150, 80, 220}, - { "CH17 failsafe", VALUE, 0x8A, 150, 80, 220}, - { "CH18 failsafe", VALUE, 0x8A, 150, 80, 220}, - { "CH19 failsafe", VALUE, 0x8B, 150, 80, 220}, - { "CH20 failsafe", VALUE, 0x8B, 150, 80, 220}, - { "CH21 failsafe", VALUE, 0x8C, 150, 80, 220}, - { "CH22 failsafe", VALUE, 0x8C, 150, 80, 220}, - { "CH23 failsafe", VALUE, 0x8D, 150, 80, 220}, - { "CH24 failsafe", VALUE, 0x8D, 150, 80, 220}, -} - -local rx1PinMapFields = { - { "CH1 RX1 map", VALUE, 0x8E, 1, 0, 16}, - { "CH2 RX1 map", VALUE, 0x8E, 2, 0, 16}, - { "CH3 RX1 map", VALUE, 0x8F, 3, 0, 16}, - { "CH4 RX1 map", VALUE, 0x8F, 4, 0, 16}, - { "CH5 RX1 map", VALUE, 0x90, 5, 0, 16}, - { "CH6 RX1 map", VALUE, 0x90, 6, 0, 16}, - { "CH7 RX1 map", VALUE, 0x91, 7, 0, 16}, - { "CH8 RX1 map", VALUE, 0x91, 8, 0, 16}, - { "CH9 RX1 map", VALUE, 0x92, 9, 0, 16}, - { "CH10 RX1 map", VALUE, 0x92, 10, 0, 16}, - { "CH11 RX1 map", VALUE, 0x93, 11, 0, 16}, - { "CH12 RX1 map", VALUE, 0x93, 12, 0, 16}, - { "CH13 RX1 map", VALUE, 0x94, 13, 0, 16}, - { "CH14 RX1 map", VALUE, 0x94, 14, 0, 16}, - { "CH15 RX1 map", VALUE, 0x95, 15, 0, 16}, - { "CH16 RX1 map", VALUE, 0x95, 16, 0, 16}, - { "CH17 RX1 map", VALUE, 0x96, 1, 0, 16}, - { "CH18 RX1 map", VALUE, 0x96, 2, 0, 16}, - { "CH19 RX1 map", VALUE, 0x97, 3, 0, 16}, - { "CH20 RX1 map", VALUE, 0x97, 4, 0, 16}, - { "CH21 RX1 map", VALUE, 0x98, 5, 0, 16}, - { "CH22 RX1 map", VALUE, 0x98, 6, 0, 16}, - { "CH23 RX1 map", VALUE, 0x99, 7, 0, 16}, - { "CH24 RX1 map", VALUE, 0x99, 8, 0, 16}, -} - -local rx2PinMapFields = { - { "CH1 RX2 map", VALUE, 0x9A, 1, 0, 16}, - { "CH2 RX2 map", VALUE, 0x9A, 2, 0, 16}, - { "CH3 RX2 map", VALUE, 0x9B, 3, 0, 16}, - { "CH4 RX2 map", VALUE, 0x9B, 4, 0, 16}, - { "CH5 RX2 map", VALUE, 0x9C, 5, 0, 16}, - { "CH6 RX2 map", VALUE, 0x9C, 6, 0, 16}, - { "CH7 RX2 map", VALUE, 0x9D, 7, 0, 16}, - { "CH8 RX2 map", VALUE, 0x9D, 8, 0, 16}, - { "CH9 RX2 map", VALUE, 0x9E, 9, 0, 16}, - { "CH10 RX2 map", VALUE, 0x9E, 10, 0, 16}, - { "CH11 RX2 map", VALUE, 0x9F, 11, 0, 16}, - { "CH12 RX2 map", VALUE, 0x9F, 12, 0, 16}, - { "CH13 RX2 map", VALUE, 0xA0, 13, 0, 16}, - { "CH14 RX2 map", VALUE, 0xA0, 14, 0, 16}, - { "CH15 RX2 map", VALUE, 0xA1, 15, 0, 16}, - { "CH16 RX2 map", VALUE, 0xA0, 16, 0, 16}, - { "CH17 RX2 map", VALUE, 0xA2, 1, 0, 16}, - { "CH18 RX2 map", VALUE, 0xA2, 2, 0, 16}, - { "CH19 RX2 map", VALUE, 0xA3, 3, 0, 16}, - { "CH20 RX2 map", VALUE, 0xA3, 4, 0, 16}, - { "CH21 RX2 map", VALUE, 0xA4, 5, 0, 16}, - { "CH22 RX2 map", VALUE, 0xA4, 6, 0, 16}, - { "CH23 RX2 map", VALUE, 0xA5, 7, 0, 16}, - { "CH24 RX2 map", VALUE, 0xA5, 8, 0, 16}, -} - -local rx3PinMapFields = { - { "CH1 RX3 map", VALUE, 0xA6, 1, 0, 16}, - { "CH2 RX3 map", VALUE, 0xA6, 2, 0, 16}, - { "CH3 RX3 map", VALUE, 0xA7, 3, 0, 16}, - { "CH4 RX3 map", VALUE, 0xA7, 4, 0, 16}, - { "CH5 RX3 map", VALUE, 0xA8, 5, 0, 16}, - { "CH6 RX3 map", VALUE, 0xA8, 6, 0, 16}, - { "CH7 RX3 map", VALUE, 0xA9, 7, 0, 16}, - { "CH8 RX3 map", VALUE, 0xA9, 8, 0, 16}, - { "CH9 RX3 map", VALUE, 0xAA, 9, 0, 16}, - { "CH10 RX3 map", VALUE, 0xAA, 10, 0, 16}, - { "CH11 RX3 map", VALUE, 0xAB, 11, 0, 16}, - { "CH12 RX3 map", VALUE, 0xAB, 12, 0, 16}, - { "CH13 RX3 map", VALUE, 0xAC, 13, 0, 16}, - { "CH14 RX3 map", VALUE, 0xAC, 14, 0, 16}, - { "CH15 RX3 map", VALUE, 0xAD, 15, 0, 16}, - { "CH16 RX3 map", VALUE, 0xAD, 16, 0, 16}, - { "CH17 RX3 map", VALUE, 0xAE, 1, 0, 16}, - { "CH18 RX3 map", VALUE, 0xAE, 2, 0, 16}, - { "CH19 RX3 map", VALUE, 0xAF, 3, 0, 16}, - { "CH20 RX3 map", VALUE, 0xAF, 4, 0, 16}, - { "CH21 RX3 map", VALUE, 0xB0, 5, 0, 16}, - { "CH22 RX3 map", VALUE, 0xB0, 6, 0, 16}, - { "CH23 RX3 map", VALUE, 0xB1, 7, 0, 16}, - { "CH24 RX3 map", VALUE, 0xB1, 8, 0, 16}, -} - - - - -local function drawScreenTitle(title, page, pages) - if math.fmod(math.floor(getTime() / 100), 10) == 0 then - title = version - end - if LCD_W == 480 then - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, title, MENU_TITLE_COLOR) - lcd.drawText(LCD_W - 40, 5, page .. "/" .. pages, MENU_TITLE_COLOR) - else - lcd.drawScreenTitle(title, page, pages) - end -end - --- Change display attribute to current field -local function addField(step) - local field = fields[current] - local min, max - if field[2] == VALUE then - min = field[5] - max = field[6] - elseif field[2] == COMBO then - min = 0 - max = #(field[5]) - 1 - end - if page == 2 and step < 0 and field[4] == min then - field[4] = 0 - elseif page == 2 and step > 0 and field[4] == 0 then - field[4] = min - else - if (step < 0 and field[4] > min) or (step > 0 and field[4] < max) then - field[4] = field[4] + step - end - end -end - --- Select the next or previous page -local function selectPage(step) - local pagesNum = #pages - if configFields[1][4] == 1 then - pagesNum = 1 - elseif configFields[2][4] == 1 then - pagesNum = pagesNum - 1 - end - page = 1 + ((page + step - 1 + pagesNum) % pagesNum) - refreshIndex = 0 - pageOffset = 0 -end - --- Select the next or previous editable field -local function selectField(step) - current = 1 + ((current + step - 1 + #fields) % #fields) - if current > numberPerPage + pageOffset then - pageOffset = current - numberPerPage - elseif current <= pageOffset then - pageOffset = current - 1 - end -end - -local function drawProgressBar() - if LCD_W == 480 then - local width = (300 * refreshIndex) / #fields - lcd.drawRectangle(100, 10, 300, 6) - lcd.drawFilledRectangle(102, 12, width, 2) - else - local width = (60 * refreshIndex) / #fields - lcd.drawRectangle(45, 1, 60, 6) - lcd.drawFilledRectangle(47, 3, width, 2) - end -end - --- Redraw the current page -local function redrawFieldPage() - lcd.clear() - - local pagesNum = #pages - if configFields[1][4] == 1 then - pagesNum = 1 - elseif configFields[2][4] == 1 then - pagesNum = pagesNum - 1 - end - drawScreenTitle("RB30/RB40", page, pagesNum) - - if refreshIndex < #fields then - drawProgressBar() - end - - for index = 1, numberPerPage, 1 do - local field = fields[pageOffset + index] - if field == nil then - break - end - - local attr = current == (pageOffset + index) and ((edit == true and BLINK or 0) + INVERS) or 0 - - lcd.drawText(1, margin + spacing * index, field[1], attr) - - if field[4] == nil then - lcd.drawText(LCD_W, margin + spacing * index, "---", RIGHT + attr) - else - if field[2] == VALUE then - if page == 2 then - if field[4] == 0 then - lcd.drawText(LCD_W, margin + spacing * index, "No pulse", RIGHT + attr) - else - lcd.drawNumber(LCD_W, margin + spacing * index, field[4] * 10, RIGHT + attr) - end - else - if field[4] == 0 then - lcd.drawText(LCD_W, margin + spacing * index, "No map", RIGHT + attr) - else - if field[3] == 0xB2 or field[3] == 0xB3 then - lcd.drawNumber(LCD_W, margin + spacing * index, field[4] , attr + RIGHT + PREC1) - else - lcd.drawNumber(LCD_W, margin + spacing * index, field[4], RIGHT + attr) - end - end - end - elseif field[2] == COMBO then - if field[4] >= 0 and field[4] < #(field[5]) then - lcd.drawText(LCD_W, margin + spacing * index, field[5][field[4] + 1], RIGHT + attr) - end - end - end - end -end - -local function telemetryIdle(field) - return sportTelemetryPush(0x1C, 0x21, 0x0b80, field) -end - -local function telemetryUnIdle(field) - return sportTelemetryPush(0x1C, 0x20, 0x0b80, field) -end - -local function telemetryRead(field) - return sportTelemetryPush(0x1C, 0x30, 0x0b80, field) -end - -local function telemetryWrite(field, value) - return sportTelemetryPush(0x1C, 0x31, 0x0b80, field + value * 256) -end - -local telemetryPopTimeout = 0 -local function refreshNext() - if refreshState == 0 then - if #modifications > 0 then - telemetryWrite(modifications[1][1], modifications[1][2]) - modifications[1] = nil - refreshIndex = 0 - refreshState = 0 - elseif refreshIndex < #fields then - local field = fields[refreshIndex + 1] - if page > 1 then - field = fields[refreshIndex + 2] - end - if telemetryRead(field[3]) == true then - refreshState = 1 - telemetryPopTimeout = getTime() + 100 -- normal delay is 500ms - end - end - elseif refreshState == 1 then - local physicalId, primId, dataId, value = sportTelemetryPop() - if primId == 0x32 and (dataId >= 0x0b80 or dataId <= 0x0b8f) then - local fieldId = value % 256 - local field = fields[refreshIndex + 1] - if fieldId == field[3] then - value = math.floor(value / 256) - if field[2] == COMBO then - fields[refreshIndex + 1][4] = value - else - fields[refreshIndex + 1][4] = value % 256 - if page > 1 then - value = math.floor(value / 256) - fields[refreshIndex + 2][4] = value - end - end - if page > 1 then - refreshIndex = refreshIndex + 2 - else - refreshIndex = refreshIndex + 1 - end - refreshState = 0 - end - elseif getTime() > telemetryPopTimeout then - fields[refreshIndex + 1][4] = nil - if page > 1 then - fields[refreshIndex + 2][4] = nil - refreshIndex = refreshIndex + 2 - else - refreshIndex = refreshIndex + 1 - end - refreshState = 0 - end - end -end - -local function updateField(field) - local value = field[4] - if field[2] == COMBO and #field == 6 then - value = field[6][1 + value] - elseif field[2] == VALUE and #field == 8 then - value = value + field[8] - field[5] - end - - if page > 1 then - if current % 2 == 1 then - value = value + fields[current + 1][4] * 256 - elseif current % 2 == 0 then - value = fields[current - 1][4] + value * 256 - end - end - modifications[#modifications + 1] = { field[3], value } -end - --- Main -local function runFieldsPage(event) - if event == EVT_VIRTUAL_EXIT then -- exit script - telemetryUnIdle(0x80) - return 2 - elseif event == EVT_VIRTUAL_ENTER then -- toggle editing/selecting current field - if fields[current][4] ~= nil then - edit = not edit - if edit == false then - updateField(fields[current]) - end - end - elseif edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - addField(1) - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - addField(-1) - end - else - if event == EVT_VIRTUAL_NEXT then - selectField(1) - elseif event == EVT_VIRTUAL_PREV then - selectField(-1) - end - end - redrawFieldPage() - return 0 -end - -local function runConfigPage(event) - fields = configFields - return runFieldsPage(event) -end - -local function runFailsafePage(event) - fields = failsafeFields - return runFieldsPage(event) -end - -local function runRx1PinMapPage(event) - fields = rx1PinMapFields - return runFieldsPage(event) -end - -local function runRx2PinMapPage(event) - fields = rx2PinMapFields - return runFieldsPage(event) -end - -local function runRx3PinMapPage(event) - fields = rx3PinMapFields - return runFieldsPage(event) -end - --- Init -local function init() - current, edit, refreshState, refreshIndex = 1, false, 0, 0 - if LCD_W == 480 then - margin = 10 - spacing = 20 - numberPerPage = 12 - end - pages = { - runConfigPage, - runFailsafePage, - runRx1PinMapPage, - runRx2PinMapPage, - runRx3PinMapPage - } - telemetryIdle(0x80) -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_NEXT_PAGE then - if edit == false then - selectPage(1) - end - elseif event == EVT_VIRTUAL_PREV_PAGE then - if edit == false then - killEvents(event) - selectPage(-1) - end - end - - local result = pages[page](event) - refreshNext() - - return result -end - -return { init = init, run = run } - diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/FrSky SBEC.lua b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/FrSky SBEC.lua deleted file mode 100644 index 4e05de057..000000000 --- a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/FrSky SBEC.lua +++ /dev/null @@ -1,284 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - -local version = "v1.2" - -local VALUE = 0 -local COMBO = 1 - -local edit = false -local page = 1 -local current = 1 --row -local refreshState = 0 -local refreshIndex = 0 -local pageOffset = 0 -local pages = {} -local fields = {} -local modifications = {} -local margin = 1 -local spacing = 8 -local appId = 0 - -local function drawScreenTitle(title,page, pages) - if math.fmod(math.floor(getTime()/100),10) == 0 then - title = version - end - if LCD_W == 480 then - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, title, MENU_COLOR) - lcd.drawText(LCD_W-40, 5, page.."/"..pages, MENU_COLOR) - else - lcd.drawScreenTitle(title, page, pages) - end -end - -local settingsFields = { - {"SBEC OUTPUT (V)", VALUE, 0x80, nil, 50, 84 }, - {"Physical ID", VALUE, 0x01, nil, 0, 26 }, - {"Application IDgroup", VALUE, 0x0D, nil, 0, 15 }, - {"Data rate(*100ms)", VALUE, 0x22, nil, 1, 255 }, -} - --- Change display attribute to current field -local function addField(step) - local field = fields[current] - local min, max - if field[2] == VALUE then - min = field[5] - max = field[6] - elseif field[2] == COMBO then - min = 0 - max = #(field[5]) - 1 - end - if field[2] ~= FLPOT then --only read ? - if field[2] == VALUE and field[6] > 256 then - if field[4] > 1000 then - step = step * 50 - field[4] = math.floor(field[4]/50) - field[4] = field[4] *50 - elseif field[4] > 500 then - step = step * 20 - field[4] = math.floor(field[4]/20) - field[4] = field[4] *20 - elseif field[4] > 200 then - step = step * 10 - field[4] = math.floor(field[4]/10) - field[4] = field[4] *10 - else - step = step * 1 - field[4] = math.floor(field[4]/1) - field[4] = field[4] *1 - end - end - if (step < 0 and field[4] > min) or (step > 0 and field[4] < max) then - field[4] = field[4] + step - end - else - field[4] = field[4] - end -end - - --- Select the next or previous editable field -local function selectField(step) - current = current + step - if current > #fields then - current = #fields - elseif current < 1 then - current = 1 - end - if current > 7 + pageOffset then - pageOffset = current - 7 - elseif current <= pageOffset then - pageOffset = current - 1 - end -end - -local function drawProgressBar() - if LCD_W == 480 then - local width = (300 * refreshIndex) / #fields - lcd.drawRectangle(100, 10, 300, 6) - lcd.drawFilledRectangle(102, 13, width, 2); - else - local width = (60 * refreshIndex) / #fields - lcd.drawRectangle(45, 1, 60, 6) - lcd.drawFilledRectangle(47, 3, width, 2); - end -end - --- Redraw the current page -local function redrawFieldsPage() - lcd.clear() - drawScreenTitle("SBEC", page, #pages) - if refreshIndex < #fields then - drawProgressBar() - end - for index = 1, 7, 1 do - local field = fields[pageOffset+index] - if field == nil then - break - end - local attr = current == (pageOffset+index) and ((edit == true and BLINK or 0) + INVERS) or 0 - lcd.drawText(1, margin+ spacing * index, field[1]) - if field[4] == nil then - lcd.drawText(LCD_W, margin+ spacing * index, "---", attr + RIGHT) - else - if field[2] == VALUE then - if field[3] == 0x80 then - lcd.drawNumber(LCD_W, margin+ spacing * index, field[4] , attr + RIGHT + PREC1) - else - lcd.drawNumber(LCD_W, margin+ spacing * index, field[4] , attr + RIGHT) - end - end - end - end -end - -local function telemetryRead(fieldx) - return sportTelemetryPush(0x17, 0x30, appId, fieldx) -end - -local function telemetryIdle(field) - return sportTelemetryPush(0x17, 0x21, appId, field) -end - -local function telemetryUnIdle(field) - return sportTelemetryPush(0x17, 0x20, appId, field) -end - -local function telemetryWrite(fieldx, valuex) - return sportTelemetryPush(0x17, 0x31, appId, fieldx + valuex*256) -end - -local telemetryPopTimeout = 0 -local function refreshNext() - if refreshState == 0 then - if #modifications > 0 then - local modificationstmp = modifications[1][2] - telemetryWrite(modifications[1][1], modificationstmp) - refreshIndex = 0 - modifications[1] = nil - elseif refreshIndex < #fields then - local field = fields[refreshIndex + 1] - if telemetryRead(field[3]) == true then - refreshState = 1 - telemetryPopTimeout = getTime() + 80 - end - end - elseif refreshState == 1 then - local physicalId, primId, dataId, value = sportTelemetryPop() - if primId == 0x32 and dataId == appId then - local fieldId = value % 256 - local field = fields[refreshIndex + 1] - if fieldId == field[3] then - local value = math.floor(value / 256) - if field[2] == VALUE then - value = value - end - - fields[refreshIndex + 1][4] = value - refreshIndex = refreshIndex + 1 - refreshState = 0 - end - elseif getTime() > telemetryPopTimeout then - refreshState = 0 - end - end -end - -local function updateField(field) - local value = field[4] - if field[2] == VALUE and #field == 6 then - value = value - end - modifications[#modifications+1] = {field[3], value} -end - --- Main1 -local function runFieldsPage(event) - if event == EVT_VIRTUAL_EXIT then - telemetryUnIdle(0x80) - return 2 - elseif event == EVT_VIRTUAL_ENTER then - if fields[current][4] ~= nil then - edit = not edit - if edit == false then - updateField(fields[current]) - end - end - elseif edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - addField(1) - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - addField(-1) - end - else - if event == EVT_VIRTUAL_NEXT then - selectField(1) - elseif event == EVT_VIRTUAL_PREV then - selectField(-1) - end - end - redrawFieldsPage() - return 0 -end - -local function runSettingsPage(event) - fields = settingsFields - return runFieldsPage(event) -end - --- Init -local function init() - current, edit, refreshState, refreshIndex = 1, false, 0, 0 - if LCD_W == 480 then - margin = 10 - spacing = 20 - end - - pages = { - runSettingsPage, - } - - for index = 1, 40, 1 do - local sensor = model.getSensor(index) - if sensor ~= nil and sensor.id >= 0x0e50 and sensor.id <= 0x0e5f then - appId = sensor.id - break - end - end - - if appId == 0 then - error("No SBEC sensor in this model!") - end - - telemetryIdle(0x80) -end - -local function run(event) - if event == nil then - error("Cannot run as a model script!") - return 2 - end - local result = pages[page](event) - - refreshNext() - - return result -end - -return { init=init, background=background, run=run } diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/FrSky SxR.lua b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/FrSky SxR.lua deleted file mode 100755 index 7bbf9a13d..000000000 --- a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/FrSky SxR.lua +++ /dev/null @@ -1,363 +0,0 @@ ---- - ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------ # # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - -local version = "v2.00" - -local VALUE = 0 -local COMBO = 1 - -local COLUMN_2 = 300 - -local edit = false -local page = 1 -local current = 1 -local refreshState = 0 -local refreshIndex = 0 -local calibrationState = 0 -local pageOffset = 0 -local calibrationStep = 0 -local pages = {} -local fields = {} -local modifications = {} -local wingBitmaps = {} -local mountBitmaps = {} -local margin = 1 -local spacing = 8 -local counter = 0 - -local configFields = { - { "Wing type", COMBO, 0x80, nil, { "Normal", "Delta", "VTail" } }, - { "Mounting type", COMBO, 0x81, nil, { "Horz", "Horz rev.", "Vert", "Vert rev." } }, -} - -local wingBitmapsFile = { "/SCRIPTS/TOOLS/bmp/plane.bmp", "/SCRIPTS/TOOLS/bmp/delta.bmp", "/SCRIPTS/TOOLS/bmp/vtail.bmp" } -local mountBitmapsFile = { "/SCRIPTS/TOOLS/bmp/horz.bmp", "/SCRIPTS/TOOLS/bmp/horz-r.bmp", "/SCRIPTS/TOOLS/bmp/vert.bmp", "/SCRIPTS/TOOLS/bmp/vert-r.bmp" } - -local settingsFields = { - {"SxR functions", COMBO, 0x9C, nil, { "Disable", "Enable" } }, - {"Quick Mode:", COMBO, 0xAA, nil, { "Disable", "Enable" } }, - {"CH5 mode", COMBO, 0xA8, nil, { "AIL2", "AUX1" } }, - {"CH6 mode", COMBO, 0xA9, nil, { "ELE2", "AUX2" } }, - {"AIL direction", COMBO, 0x82, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"ELE direction", COMBO, 0x83, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"RUD direction", COMBO, 0x84, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"AIL2 direction", COMBO, 0x9A, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"ELE2 direction", COMBO, 0x9B, nil, { "Normal", "Invers" }, { 255, 0 } }, - {"AIL stab gain", VALUE, 0x85, nil, 0, 200, "%"}, - {"ELE stab gain", VALUE, 0x86, nil, 0, 200, "%"}, - {"RUD stab gain", VALUE, 0x87, nil, 0, 200, "%"}, - {"AIL autolvl gain", VALUE, 0x88, nil, 0, 200, "%"}, - {"ELE autolvl gain", VALUE, 0x89, nil, 0, 200, "%"}, - {"ELE hover gain", VALUE, 0x8C, nil, 0, 200, "%"}, - {"RUD hover gain", VALUE, 0x8D, nil, 0, 200, "%"}, - {"AIL knife gain", VALUE, 0x8E, nil, 0, 200, "%"}, - {"RUD knife gain", VALUE, 0x90, nil, 0, 200, "%"}, - {"AIL autolvl offset", VALUE, 0x91, nil, -20, 20, "%", 0x6C}, - {"ELE autolvl offset", VALUE, 0x92, nil, -20, 20, "%", 0x6C}, - {"ELE hover offset", VALUE, 0x95, nil, -20, 20, "%", 0x6C}, - {"RUD hover offset", VALUE, 0x96, nil, -20, 20, "%", 0x6C}, - {"AIL knife offset", VALUE, 0x97, nil, -20, 20, "%", 0x6C}, - {"RUD knife offset", VALUE, 0x99, nil, -20, 20, "%", 0x6C}, -} - -local calibrationFields = { - { "X:", VALUE, 0x9E, 0, -100, 100, "%" }, - { "Y:", VALUE, 0x9F, 0, -100, 100, "%" }, - { "Z:", VALUE, 0xA0, 0, -100, 100, "%" } -} - -local function drawScreenTitle(title, page, pages) - if math.fmod(math.floor(getTime() / 100), 10) == 0 then - title = version - end - if LCD_W == 480 then - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, title, MENU_COLOR) - lcd.drawText(LCD_W - 40, 5, page .. "/" .. pages, MENU_COLOR) - else - lcd.drawScreenTitle(title, page, pages) - end -end - --- Change display attribute to current field -local function addField(step) - local field = fields[current] - local min, max - if field[2] == VALUE then - min = field[5] - max = field[6] - elseif field[2] == COMBO then - min = 0 - max = #(field[5]) - 1 - end - if (step < 0 and field[4] > min) or (step > 0 and field[4] < max) then - field[4] = field[4] + step - end -end - --- Select the next or previous page -local function selectPage(step) - page = 1 + ((page + step - 1 + #pages) % #pages) - refreshIndex = 0 - calibrationStep = 0 - pageOffset = 0 -end - --- Select the next or previous editable field -local function selectField(step) - current = 1 + ((current + step - 1 + #fields) % #fields) - if current > 7 + pageOffset then - pageOffset = current - 7 - elseif current <= pageOffset then - pageOffset = current - 1 - end -end - -local function drawProgressBar() - if LCD_W == 480 then - local width = (300 * refreshIndex) / #fields - lcd.drawRectangle(100, 10, 300, 6) - lcd.drawFilledRectangle(102, 13, width, 2); - else - local width = (60 * refreshIndex) / #fields - lcd.drawRectangle(45, 1, 60, 6) - lcd.drawFilledRectangle(47, 3, width, 2); - end -end - --- Redraw the current page -local function redrawFieldsPage(event) - lcd.clear() - drawScreenTitle("SxR", page, #pages) - - if refreshIndex < #fields then - drawProgressBar() - end - - for index = 1, 10, 1 do - local field = fields[pageOffset + index] - if field == nil then - break - end - - local attr = current == (pageOffset + index) and ((edit == true and BLINK or 0) + INVERS) or 0 - - lcd.drawText(1, margin + spacing * index, field[1], attr) - - if field[4] == nil then - lcd.drawText(LCD_W, margin + spacing * index, "---", RIGHT + attr) - else - if field[2] == VALUE then - lcd.drawNumber(LCD_W, margin + spacing * index, field[4], RIGHT + attr) - elseif field[2] == COMBO then - if field[4] >= 0 and field[4] < #(field[5]) then - lcd.drawText(LCD_W, margin + spacing * index, field[5][1 + field[4]], RIGHT + attr) - end - end - end - end -end - -local function telemetryRead(field) - return sportTelemetryPush(0x17, 0x30, 0x0C30, field) -end - -local function telemetryWrite(field, value) - return sportTelemetryPush(0x17, 0x31, 0x0C30, field + value * 256) -end - -local telemetryPopTimeout = 0 -local function refreshNext() - if refreshState == 0 then - if calibrationState == 1 then - if telemetryWrite(0x9D, calibrationStep) == true then - refreshState = 1 - calibrationState = 2 - telemetryPopTimeout = getTime() + 120 -- normal delay is 500ms - end - elseif #modifications > 0 then - telemetryWrite(modifications[1][1], modifications[1][2]) - modifications[1] = nil - elseif refreshIndex < #fields then - local field = fields[refreshIndex + 1] - if telemetryRead(field[3]) == true then - refreshState = 1 - telemetryPopTimeout = getTime() + 80 -- normal delay is 500ms - end - end - elseif refreshState == 1 then - local physicalId, primId, dataId, value = sportTelemetryPop() - if physicalId == 0x1A and primId == 0x32 and dataId == 0x0C30 then - local fieldId = value % 256 - if calibrationState == 2 then - if fieldId == 0x9D then - refreshState = 0 - calibrationState = 0 - calibrationStep = (calibrationStep + 1) % 7 - end - else - local field = fields[refreshIndex + 1] - if fieldId == field[3] then - local value = math.floor(value / 256) - if field[3] == 0xAA then - value = bit32.band(value, 0x0001) - end - if field[3] >= 0x9E and field[3] <= 0xA0 then - local b1 = value % 256 - local b2 = math.floor(value / 256) - value = b1 * 256 + b2 - value = value - bit32.band(value, 0x8000) * 2 - end - if field[2] == COMBO and #field == 6 then - for index = 1, #(field[6]), 1 do - if value == field[6][index] then - value = index - 1 - break - end - end - elseif field[2] == VALUE and #field == 8 then - value = value - field[8] + field[5] - end - fields[refreshIndex + 1][4] = value - refreshIndex = refreshIndex + 1 - refreshState = 0 - end - end - elseif getTime() > telemetryPopTimeout then - fields[refreshIndex + 1][4] = nil - refreshIndex = refreshIndex + 1 - refreshState = 0 - calibrationState = 0 - end - end -end - -local function updateField(field) - local value = field[4] - if field[2] == COMBO and #field == 6 then - value = field[6][1 + value] - elseif field[2] == VALUE and #field == 8 then - value = value + field[8] - field[5] - end - modifications[#modifications + 1] = { field[3], value } -end - --- Main -local function runFieldsPage(event) - if event == EVT_VIRTUAL_EXIT then -- exit script - return 2 - elseif event == EVT_VIRTUAL_ENTER then -- toggle editing/selecting current field - if fields[current][4] ~= nil then - edit = not edit - if edit == false then - updateField(fields[current]) - end - end - elseif edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - addField(1) - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - addField(-1) - end - else - if event == EVT_VIRTUAL_NEXT then - selectField(1) - elseif event == EVT_VIRTUAL_PREV then - selectField(-1) - end - end - redrawFieldsPage(event) - return 0 -end - -local function runConfigPage(event) - fields = configFields - local result = runFieldsPage(event) - if LCD_W == 128 then - local mountText = { "Label is facing the sky", "Label is facing ground", "Label is left when", "Label is right when" } - if fields[2][4] ~= nil then - lcd.drawText(1, 30, "Pins toward tail") - lcd.drawText(1, 40, mountText[1 + fields[2][4]]) - if fields[2][4] > 1 then - lcd.drawText(1, 50, "looking from the tail") - end - end - else - if fields[1][4] ~= nil then - if LCD_W == 480 then - if wingBitmaps[1 + fields[1][4]] == nil then - wingBitmaps[1 + fields[1][4]] = Bitmap.open(wingBitmapsFile[1 + fields[1][4]]) - end - lcd.drawBitmap(wingBitmaps[1 + fields[1][4]], 10, 90) - else - lcd.drawPixmap(20, 28, wingBitmapsFile[1 + fields[1][4]]) - end - end - if fields[2][4] ~= nil then - if LCD_W == 480 then - if mountBitmaps[1 + fields[2][4]] == nil then - mountBitmaps[1 + fields[2][4]] = Bitmap.open(mountBitmapsFile[1 + fields[2][4]]) - end - lcd.drawBitmap(mountBitmaps[1 + fields[2][4]], 190, 110) - else - lcd.drawPixmap(128, 28, mountBitmapsFile[1 + fields[2][4]]) - end - end - end - return result -end - -local function runSettingsPage(event) - fields = settingsFields - return runFieldsPage(event) -end - --- Init -local function init() - current, edit, refreshState, refreshIndex = 1, false, 0, 0 - if LCD_W == 480 then - margin = 10 - spacing = 20 - wingBitmapsFile = { "/SCRIPTS/TOOLS/img/plane_b.png", "/SCRIPTS/TOOLS/img/delta_b.png", "/SCRIPTS/TOOLS/img/planev_b.png" } - mountBitmapsFile = { "/SCRIPTS/TOOLS/img/up.png", "/SCRIPTS/TOOLS/img/down.png", "/SCRIPTS/TOOLS/img/vert.png", "/SCRIPTS/TOOLS/img/vert-r.png" } - end - pages = { - runConfigPage, - runSettingsPage, - } -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_NEXT_PAGE then - selectPage(1) - elseif event == EVT_VIRTUAL_PREV_PAGE then - killEvents(event); - selectPage(-1) - end - - local result = pages[page](event) - refreshNext() - - return result -end - -return { init = init, run = run } - diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/Graupner HoTT.lua b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/Graupner HoTT.lua deleted file mode 100644 index d0a7d4af8..000000000 --- a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/Graupner HoTT.lua +++ /dev/null @@ -1,171 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - - ---############################################################################### --- Multi buffer for HoTT description --- To start operation: --- Write "HoTT" at address 0..3 --- Write 0xFF at address 4 will request the buffer to be cleared --- Write 0x0F at address 5 --- Read buffer from address 6 access the RX text for 168 bytes, 21 caracters --- by 8 lines --- Write at address 5 sends an order to the RX: 0xXF=start, 0xX7=prev page, --- 0xXE=next page, 0xX9=enter, 0xXD=next or 0xXB=prev with X being the sensor --- to request data from 8=RX only, 9=Vario, A=GPS, B=Cust, C=ESC, D=GAM, E=EAM --- Write at address 4 the value 0xFF will request the buffer to be cleared --- !! Before exiting the script must write 0 at address 0 for normal operation !! ---############################################################################### - -HoTT_Sensor = 0 -Timer_128 = 100 - -local function HoTT_Release() - multiBuffer( 0, 0 ) -end - -local function HoTT_Send(button) - multiBuffer( 5, 0x80+(HoTT_Sensor*16) + button) -end - -local function HoTT_Sensor_Inc() - local detected_sensors=multiBuffer( 4 ) - local a - if detected_sensors ~= 0xFF then - repeat - HoTT_Sensor=(HoTT_Sensor+1)%7 -- Switch to next sensor - if HoTT_Sensor ~= 0 then - a = math.floor(detected_sensors/ (2^(HoTT_Sensor-1))) -- shift right - end - until HoTT_Sensor==0 or a % 2 == 1 - HoTT_Send( 0x0F ) - end -end - -local function HoTT_Draw_LCD() - local i - local value - local line - local result - local offset=0 - - local sensor_name = { "", "+Vario", "+GPS", "+Cust", "+ESC", "+GAM", "+EAM" } - - lcd.clear() - - if LCD_W == 480 then - --Draw title - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, "Graupner HoTT: config RX" .. sensor_name[HoTT_Sensor+1] .. " - Menu cycle Sensors", MENU_TITLE_COLOR) - --Draw RX Menu - if multiBuffer( 4 ) == 0xFF then - lcd.drawText(10,50,"No HoTT telemetry...", BLINK) - else - for line = 0, 7, 1 do - for i = 0, 21-1, 1 do - value=multiBuffer( line*21+6+i ) - if value > 0x80 then - value = value - 0x80 - lcd.drawText(10+i*16,32+20*line,string.char(value).." ",INVERS) - else - lcd.drawText(10+i*16,32+20*line,string.char(value)) - end - end - end - end - else - --Draw RX Menu on LCD_W=128 - if multiBuffer( 4 ) == 0xFF then - lcd.drawText(2,17,"No HoTT telemetry...",SMLSIZE) - else - if Timer_128 ~= 0 then - --Intro page - Timer_128 = Timer_128 - 1 - lcd.drawScreenTitle("Graupner Hott",0,0) - lcd.drawText(2,17,"Configuration of RX" .. sensor_name[HoTT_Sensor+1] ,SMLSIZE) - lcd.drawText(2,37,"Press menu to cycle Sensors" ,SMLSIZE) - else - --Menu page - for line = 0, 7, 1 do - for i = 0, 21-1, 1 do - value=multiBuffer( line*21+6+i ) - if value > 0x80 then - value = value - 0x80 - lcd.drawText(2+i*6,1+8*line,string.char(value).." ",SMLSIZE+INVERS) - else - lcd.drawText(2+i*6,1+8*line,string.char(value),SMLSIZE) - end - end - end - end - end - end -end - --- Init -local function HoTT_Init() - --Set protocol to talk to - multiBuffer( 0, string.byte('H') ) - --test if value has been written - if multiBuffer( 0 ) ~= string.byte('H') then - error("Not enough memory!") - return 2 - end - multiBuffer( 1, string.byte('o') ) - multiBuffer( 2, string.byte('T') ) - multiBuffer( 3, string.byte('T') ) - --Request init of the RX buffer - multiBuffer( 4, 0xFF ) - --Request RX to send the config menu - HoTT_Send( 0x0F ) - HoTT_Sensor = 0; - HoTT_Detected_Sensors=0; - Timer_128 = 100 -end - --- Main -local function HoTT_Run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_EXIT then - HoTT_Release() - return 2 - else - if event == EVT_VIRTUAL_PREV_PAGE then - killEvents(event) - HoTT_Send( 0x07 ) - elseif event == EVT_VIRTUAL_ENTER then - HoTT_Send( 0x09 ) - elseif event == EVT_VIRTUAL_PREV then - HoTT_Send( 0x0B ) - elseif event == EVT_VIRTUAL_NEXT then - HoTT_Send( 0x0D ) - elseif event == EVT_VIRTUAL_NEXT_PAGE then - HoTT_Send( 0x0E ) - elseif event == EVT_VIRTUAL_MENU then - Timer_128 = 100 - HoTT_Sensor_Inc() - else - HoTT_Send( 0x0F ) - end - HoTT_Draw_LCD() - return 0 - end -end - -return { init=HoTT_Init, run=HoTT_Run } diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/MultiChan.txt b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/MultiChan.txt deleted file mode 100644 index 305451422..000000000 --- a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/MultiChan.txt +++ /dev/null @@ -1,192 +0,0 @@ -24,0,Assan,Std,0,CH5,CH6,CH7,CH8 -14,0,Bayang,Std,1,Flip,RTH,Pict,Video,HLess,Invert,Rates,n-a,n-a,AnAux1,AnAux2 -14,1,Bayang,H8S3D,1,Flip,RTH,Pict,Video,HLess,Invert,Rates -14,2,Bayang,X16_AH,1,Flip,RTH,Pict,Video,HLess,Invert,Rates,TakeOf -14,3,Bayang,IRDRONE,1,Flip,RTH,Pict,Video,HLess,Invert,Rates,TakeOf,EmStop -14,4,Bayang,DHD_D4,1,Flip,RTH,Pict,Video,HLess,Invert,Rates,TakeOf,EmStop -14,5,Bayang,QX100,1,Flip,RTH,Pict,Video,HLess,Invert,Rates,TakeOf,EmStop -59,0,BayangRX,RX,1,AnAux1,AnAux2,Flip,RTH,Pict,Video -59,1,BayangRX,CPPM,1,AnAux1,AnAux2,Flip,RTH,Pict,Video -41,0,Bugs,3-6-8,0,Arm,Angle,Flip,Pict,Video,LED -42,0,BugsMini,Mini,0,Arm,Angle,Flip,Pict,Video,LED -42,1,BugsMini,3H,0,Arm,Angle,Flip,Pict,Video,LED,AltHol -34,0,Cabell,V3,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -34,1,Cabell,V3Telem,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -13,0,CG023,Std,1,Flip,Light,Pict,Video,HLess -13,1,CG023,YD829,1,Flip,n-a,Pict,Video,HLess -37,0,Corona,COR_V1,0,CH5,CH6,CH7,CH8 -37,1,Corona,COR_V2,0,CH5,CH6,CH7,CH8 -37,2,Corona,FD_V3,0,CH5,CH6,CH7,CH8 -12,0,CX10,Green,1,Flip,Rate -12,1,CX10,Blue,1,Flip,Rate,Pict,Video -12,2,CX10,DM007,1,Flip,Mode,Pict,Video,HLess -12,4,CX10,JC3015_1,1,Flip,Mode,Pict,Video -12,5,CX10,JC3015_2,1,Flip,Mode,LED,DFlip -12,6,CX10,MK33041,1,Flip,Mode,Pict,Video,HLess,RTH -7,0,Devo,8CH,0,CH5,CH6,CH7,CH8 -7,1,Devo,10CH,0,CH5,CH6,CH7,CH8,CH9,CH10 -7,2,Devo,12CH,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12 -7,3,Devo,6CH,0,CH5,CH6 -7,4,Devo,7CH,0,CH5,CH6,CH7 -33,0,DM022,Std,1,Flip,LED,Cam1,Cam2,HLess,RTH,RLow -6,0,DSM,2_22,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,n-a,ThKill -6,1,DSM,2_11,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,n-a,ThKill -6,2,DSM,X_22,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,n-a,ThKill -6,3,DSM,X_11,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,n-a,ThKill -6,4,DSM,AUTO,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,n-a,ThKill -70,0,DSM_RX,RX,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12 -70,1,DSM_RX,CPPM,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12 -45,0,E01X,E012,1,n-a,Flip,n-a,HLess,RTH -45,1,E01X,E015,1,Arm,Flip,LED,HLess,RTH -16,0,ESKY,Std,0,Gyro,Pitch -16,1,ESKY,ET4,0,Gyro,Pitch -35,0,ESKY150,4CH,0 -35,1,ESKY150,7CH,0,FMode,Aux6,Aux7 -69,0,ESKY150V2,Std,0,CH5_RA,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -1,0,Flysky,Flysky,0,CH5,CH6,CH7,CH8 -1,1,Flysky,V9x9,1,Flip,Light,Pict,Video -1,2,Flysky,V6x6,1,Flip,Light,Pict,Video,HLess,RTH,XCAL,YCAL -1,3,Flysky,V912,1,BtmBtn,TopBtn -1,4,Flysky,CX20,0,CH5,CH6,CH7 -28,0,Flysky_AFHDS2A,PWM_IBUS,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 -28,1,Flysky_AFHDS2A,PPM_IBUS,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 -28,2,Flysky_AFHDS2A,PWM_SBUS,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 -28,3,Flysky_AFHDS2A,PPM_SBUS,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 -28,4,Flysky_AFHDS2A,PWM_IB16,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -28,5,Flysky_AFHDS2A,PPM_IB16,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -56,0,Flysky2A_RX,RX,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 -56,1,Flysky2A_RX,CPPM,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 -53,0,Height,5ch,0,Gear -53,1,Height,8ch,0,Gear,Gyro,Flap,Light -25,0,FrSkyV,V8,0,CH5,CH6,CH7,CH8 -3,0,FrSkyD,D8,0,CH5,CH6,CH7,CH8 -3,0,FrSkyD,D8Cloned,0,CH5,CH6,CH7,CH8 -67,0,FrSkyL,LR12,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12 -67,1,FrSkyL,LR12_6CH,0,CH5,CH6 -15,0,FrSkyX,D16_FCC,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -15,1,FrSkyX,D16_8CH_FCC,0,CH5,CH6,CH7,CH8 -15,2,FrSkyX,D16_LBT,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -15,3,FrSkyX,D16_8CH_LBT,0,CH5,CH6,CH7,CH8 -15,4,FrSkyX,D16Cloned,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -15,5,FrSkyX,D16Cloned_8CH,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -64,0,FrSkyX2,D16_FCC,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -64,1,FrSkyX2,D16_8CH_FCC,0,CH5,CH6,CH7,CH8 -64,2,FrSkyX2,D16_LBT,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -64,3,FrSkyX2,D16_8CH_LBT,1,CH5,CH6,CH7,CH8 -64,4,FrSkyX2,D16Cloned,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -64,5,FrSkyX2,D16Cloned_8CH,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -65,0,FrSkyR9,R9_915,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -65,1,FrSkyR9,R9_868,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -65,2,FrSkyR9,R9_915_8CH,0,CH5,CH6,CH7,CH8 -65,3,FrSkyR9,R9_968_8CH,0,CH5,CH6,CH7,CH8 -55,0,FrSkyRX,RX,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -55,1,FrSkyRX,CloneTX,0 -55,2,FrSkyRX,EraseTX,0 -55,3,FrSkyRX,CPPM,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -58,0,FX816,P38,1 -20,0,FY326,FY326,1,Flip,RTH,HLess,Expert,Calib -20,1,FY326,FY319,1,Flip,RTH,HLess,Expert,Calib -23,0,FY326,FY326,1,Flip,RTH,HLess,Expert -47,0,GD00x,V1,1,Trim,LED,Rate -47,1,GD00x,V2,1,Trim,LED,Rate -32,0,GW008,FY326,1,Flip -36,0,H8_3D,Std,1,Flip,Light,Pict,Video,RTH,FlMode,Cal1 -36,1,H8_3D,H20H,1,Flip,Light,Pict,Video,Opt1,Opt2,Cal1,Cal2,Gimbal -36,2,H8_3D,H20,1,Flip,Light,Pict,Video,Opt1,Opt2,Cal1,Cal2,Gimbal -36,3,H8_3D,H30,1,Flip,Light,Pict,Video,Opt1,Opt2,Cal1,Cal2,Gimbal -4,0,Hisky,Std,0,Gear,Pitch,Gyro,CH8 -4,1,Hisky,HK310,0,Aux -39,0,Hitec,Opt_Fw,0,CH5,CH6,CH7,CH8,CH9 -39,1,Hitec,Opt_Hub,0,CH5,CH6,CH7,CH8,CH9 -39,2,Hitec,Minima,0,CH5,CH6,CH7,CH8,CH9 -26,0,Hontai,Std,1,Flip,LED,Pict,Video,HLess,RTH,Calib -26,1,Hontai,JJRCX1,1,Flip,Arm,Pict,Video,HLess,RTH,Calib -26,2,Hontai,X5C1,1,Flip,Arm,Pict,Video,HLess,RTH,Calib -26,3,Hontai,FQ777_951,1,Flip,Arm,Pict,Video,HLess,RTH,Calib -57,0,HoTT,Sync,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -57,1,HoTT,No_Sync,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -2,0,Hubsan,H107,1,Flip,Light,Pict,Video,HLess -2,1,Hubsan,H301,0,RTH,Light,Stab,Video -2,2,Hubsan,H501,0,RTH,Light,Pict,Video,HLess,GPS_H,ALT_H,Flip,FModes -22,0,J6Pro,Std,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12 -71,0,JJRC345,JJRC345,1,Flip,HLess,RTH,LED,UNK1,UNK2,UNK3 -71,1,JJRC345,SkyTmblr,1,Flip,HLess,RTH,LED,UNK1,UNK2,UNK3 -49,0,KF606,Std,1,Trim -9,0,KN,WLToys,0,DRate,THold,IdleUp,Gyro,Ttrim,Atrim,Etrim -9,1,KN,Feilun,0,DRate,THold,IdleUp,Gyro,Ttrim,Atrim,Etrim -73,0,Kyosho,Std,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14 -18,0,MJXQ,WHL08,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate -18,1,MJXQ,X600,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate -18,2,MJXQ,X800,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate -18,3,MJXQ,H26D,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate -18,4,MJXQ,E010,1,Flip,LED,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate -18,5,MJXQ,H26WH,1,Flip,Arm,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate -18,6,MJXQ,Phoenix,1,Flip,Arm,Pict,Video,HLess,RTH,AuFlip,Pan,Tilt,Rate -17,0,MT99XX,Std,1,Flip,LED,Pict,Video,HLess -17,1,MT99XX,H7,1,Flip,LED,Pict,Video,HLess -17,2,MT99XX,YZ,1,Flip,LED,Pict,Video,HLess -17,3,MT99XX,LS,1,Flip,Invert,Pict,Video,HLess -17,4,MT99XX,FY805,1,Flip,n-a,n-a,n-a,HLess -17,5,MT99XX,A180,0,3D_6G -17,6,MT99XX,Dragon,0,Mode,RTH -44,0,NCC1701,Std,1,Warp -77,0,OMP,M2,0,THold,IdleUp,6G_3D -60,0,Pelikan,PRO_V4,0,CH5,CH6,CH7,CH8 -60,1,Pelikan,LITE_V4,0,CH5,CH6,CH7,CH8 -51,0,Potensic,A20,1,TakLan,Emerg,Mode,HLess -66,0,Propel,74-Z,1,LEDs,RollCW,RolCCW,Fire,Weapon,Calib,AltHol,TakeOf,Land,Train -29,0,Q2x2,Q222,1,Flip,LED,Mod2,Mod1,HLess,RTH,XCal,YCal -29,1,Q2x2,Q242,1,Flip,LED,Pict,Video,HLess,RTH,XCal,YCal -29,2,Q2x2,Q282,1,Flip,LED,Pict,Video,HLess,RTH,XCal,YCal -31,0,Q303,Q303,1,AltHol,Flip,Pict,Video,HLess,RTH,Gimbal -31,1,Q303,C35,1,Arm,VTX,Pict,Video,n-a,RTH,Gimbal -31,2,Q303,CX10D,1,Arm,Flip -31,3,Q303,CX10WD,1,Arm,Flip -72,0,Q90C,Std,0,FMode,VTX+ -74,0,RadioLink,Surface,0,CH5,CH6,CH7,CH8,FS_CH1,FS_CH2,FS_CH3,FS_CH4,FS_CH5,FS_CH6,FS_CH7,FS_CH8 -74,1,RadioLink,Air,0,CH5,CH6,CH7,CH8,FS_CH1,FS_CH2,FS_CH3,FS_CH4,FS_CH5,FS_CH6,FS_CH7,FS_CH8 -74,2,RadioLink,DumboRC,0,CH5,CH6,CH7,CH8,FS_CH1,FS_CH2,FS_CH3,FS_CH4,FS_CH5,FS_CH6,FS_CH7,FS_CH8 -76,0,Realacc,R11,1,Flip,Light,Calib,HLess,RTH,UNK -50,0,Redpine,Fast,0,sCH5,sCH6,sCH7,sCH8,sCH9,sCH10,sCH11,sCH12,sCH13,sCH14,sCH15,sCH16 -50,1,Redpine,Slow,0,sCH5,sCH6,sCH7,sCH8,sCH9,sCH10,sCH11,sCH12,sCH13,sCH14,sCH15,sCH16 -21,0,Futaba,SFHSS,0,CH5,CH6,CH7,CH8 -19,0,Shenqi,Cycle,1 -68,0,Skyartec,Std,0,CH5,CH6,CH7 -11,0,SLT,V1,0,Gear,Pitch -11,1,SLT,V2,0,CH5,CH6,CH7,CH8 -11,2,SLT,Q100,0,Rates,n-a,CH7,CH8,Mode,Flip,n-a,n-a,Calib -11,3,SLT,Q200,0,Rates,n-a,CH7,CH8,Mode,VidOn,VidOff,Calib -11,4,SLT,MR100,0,Rates,n-a,CH7,CH8,Mode,Flip,Video,Pict -10,0,Symax,Std,1,Flip,Rates,Pict,Video,HLess -10,1,Symax,X5C,1,Flip,Rates,Pict,Video,HLess -61,0,Tiger,Std,1,Flip,Light -43,0,Traxxas,6519,0 -5,0,V2x2,Std,1,Flip,Light,Pict,Video,HLess,CalX,CalY -5,1,V2x2,JXD506,1,Flip,Light,Pict,Video,HLess,StaSto,Emerg,Cam_UD -48,0,V761,3CH,0,Gyro,Calib,Flip,RtnAct,Rtn -48,1,V761,4CH,0,Gyro,Calib,Flip,RtnAct,Rtn -46,0,V911s,V911s,1,Calib -46,1,V911s,E119,1,Calib -22,0,WFLY,WFR0xS,0,CH5,CH6,CH7,CH8,CH9 -30,0,WK2x01,WK2801,0,CH5,CH6,CH7,CH8 -30,1,WK2x01,WK2401,0 -30,2,WK2x01,W6_5_1,0,Gear,Dis,Gyro -30,3,WK2x01,W6_6_1,0,Gear,Col,Gyro -30,4,WK2x01,W6HEL,0,Gear,Col,Gyro -30,5,WK2x01,W6HEL_I,0,Gear,Col,Gyro -62,0,XK,X450,1,FMode,TakeOf,Emerg,3D_6G,Pict,Video -62,1,XK,X420,1,FMode,TakeOf,Emerg,3D_6G,Pict,Video -8,0,YD717,Std,1,Flip,Light,Pict,Video,HLess -8,1,YD717,SkyWlkr,1,Flip,Light,Pict,Video,HLess -8,2,YD717,Simax4,1,Flip,Light,Pict,Video,HLess -8,3,YD717,XinXun,1,Flip,Light,Pict,Video,HLess -8,4,YD717,NiHui,1,Flip,Light,Pict,Video,HLess -52,0,ZSX,280,1,Light -78,0,M-Link,Std,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 -79,0,WFLY2,RF20x,0,CH5,CH6,CH7,CH8,CH9,CH10 -80,0,E016Hv2,E016Hv2,1,TakLan,EmStop,Flip,Calib,HLess,RTH -81,0,E010r5,E010r5,1,Flip,LED,CALIB,HLess,RTH,GLIDE -82,0,LOLI,Std,0,CH5,CH6,CH7,CH8,1SwSePpPw,2SwSePw,3SwSe,4SwSe,5SwSeSb,6SwSe,7SwSePw,8SwSe -83,0,E129,E129,1,TakLan,EmStop,TrimA,TrimE,TrimR -84,0,JOYSWAY,Std,0 -85,0,E016H,Std,1,Stop,Flip,n-a,HLess,RTH diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/MultiChannelsUpdater.lua b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/MultiChannelsUpdater.lua deleted file mode 100644 index 14902b782..000000000 --- a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/MultiChannelsUpdater.lua +++ /dev/null @@ -1,311 +0,0 @@ - -local toolName = "TNS|Multi chan namer|TNE" - ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - -local protocol_name = "" -local sub_protocol_name = "" -local bind_ch = 0 -local module_conf = {} -local module_pos = "Internal" -local file_ok = 0 -local done = 0 -local protocol = 0 -local sub_protocol = 0 -local f_seek = 0 -local channel_names={} -local num_search = "Searching" - -local function drawScreenTitle(title) - if LCD_W == 480 then - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, title, MENU_TITLE_COLOR) - else - lcd.drawScreenTitle(title, 0, 0) - end -end - -function bitand(a, b) - local result = 0 - local bitval = 1 - while a > 0 and b > 0 do - if a % 2 == 1 and b % 2 == 1 then -- test the rightmost bits - result = result + bitval -- set the current bit - end - bitval = bitval * 2 -- shift left - a = math.floor(a/2) -- shift right - b = math.floor(b/2) - end - return result -end - -local function Multi_Draw_LCD(event) - local line = 0 - - lcd.clear() - drawScreenTitle("Multi channels namer") - - --Display settings - local lcd_opt = 0 - if LCD_W == 480 then - x_pos = 10 - y_pos = 32 - y_inc = 20 - else - x_pos = 0 - y_pos = 9 - y_inc = 8 - lcd_opt = SMLSIZE - end - - --Multi Module detection - if module_conf["Type"] ~= 6 then - if LCD_W == 480 then - lcd.drawText(10,50,"No Multi module configured...", BLINK) - else - --Draw on LCD_W=128 - lcd.drawText(2,17,"No Multi module configured...",SMLSIZE) - end - return - else - lcd.drawText(x_pos, y_pos+y_inc*line,module_pos .. " Multi detected.", lcd_opt) - line = line + 1 - end - - --Channel order - if (ch_order == -1) then - lcd.drawText(x_pos, y_pos+y_inc*line,"Channels order can't be read from Multi...", lcd_opt) - line = line + 1 - end - - --Can't open file MultiChan.txt - if file_ok == 0 then - lcd.drawText(x_pos, y_pos+y_inc*line,"Can't read MultiChan.txt file...", lcd_opt) - return - end - - if ( protocol_name == "" or sub_protocol_name == "" ) and f_seek ~=-1 then - local f = io.open("/SCRIPTS/TOOLS/MultiChan.txt", "r") - if f == nil then return end - lcd.drawText(x_pos, y_pos+y_inc*line,num_search, lcd_opt) - num_search = num_search .. "." - if #num_search > 15 then - num_search = string.sub(num_search,1,9) - end - local proto = 0 - local sub_proto = 0 - local proto_name = "" - local sub_proto_name = "" - local channels = "" - local nbr_try = 0 - local nbr_car = 0 - repeat - io.seek(f, f_seek) - local data = io.read(f, 100) -- read 100 characters - if #data ==0 then - f_seek = -1 -- end of file - break - end - proto, sub_proto, proto_name, sub_proto_name, bind_ch, channels = string.match(data,'(%d+),(%d),([%w-_ ]+),([%w-_ ]+),(%d)(.+)') - if proto ~= nil and sub_proto ~= nil and protocol_name ~= nil and sub_protocol_name ~= nil and bind_ch ~= nil then - if tonumber(proto) == protocol and tonumber(sub_proto) == sub_protocol then - protocol_name = proto_name - sub_protocol_name = sub_proto_name - bind_ch = tonumber(bind_ch) - if channels ~= nil then - --extract channel names - nbr_car = string.find(channels, "\r") - if nbr_car == nil then nbr_car = string.find(channels, "\n") end - if nbr_car ~= nil then - channels = string.sub(channels,1,nbr_car-1) - end - local i = 5 - for k in string.gmatch(channels, ",([%w-_ ]+)") do - channel_names[i] = k - i = i + 1 - end - end - f_seek = -1 -- protocol found - break - end - end - if f_seek ~= -1 then - nbr_car = string.find(data, "\n") - if nbr_car == nil then nbr_car = string.find(data, "\r") end - if nbr_car == nil then - f_seek = -1 -- end of file - break - end - f_seek = f_seek + nbr_car -- seek to next line - nbr_try = nbr_try + 1 - end - until nbr_try > 20 or f_seek == -1 - io.close(f) - end - - if f_seek ~= -1 then - return -- continue searching... - end - - --Protocol & Sub_protocol - if protocol_name == "" or sub_protocol_name == "" then - lcd.drawText(x_pos, y_pos+y_inc*line,"Unknown protocol "..tostring(protocol).."/"..tostring(sub_protocol).." ...", lcd_opt) - return - elseif LCD_W > 128 then - lcd.drawText(x_pos, y_pos+y_inc*line,"Protocol: " .. protocol_name .. " / SubProtocol: " .. sub_protocol_name, lcd_opt) - line = line + 1 - else - lcd.drawText(x_pos, y_pos+y_inc*line,"Protocol: " .. protocol_name, lcd_opt) - line = line + 1 - lcd.drawText(x_pos, y_pos+y_inc*line,"SubProtocol: " .. sub_protocol_name, lcd_opt) - line = line + 1 - end - - text1="" - text2="" - for i,v in ipairs(channel_names) do - if i<=8 then - if i==1 then - text1 = v - else - text1=text1 .. "," .. v - end - else - if i==9 then - text2 = v - else - text2=text2 .. "," .. v - end - end - end - if LCD_W > 128 then - lcd.drawText(x_pos, y_pos+y_inc*line,"Channels: " .. text1, lcd_opt) - line = line + 1 - if text2 ~= "" then - lcd.drawText(x_pos*9, y_pos+y_inc*line,text2, lcd_opt) - line = line + 1 - end - end - - if event ~= EVT_VIRTUAL_ENTER and done == 0 then - lcd.drawText(x_pos, y_pos+y_inc*line," Save", lcd_opt + INVERS + BLINK) - return - end - - lcd.drawText(x_pos, y_pos+y_inc*line,"Setting channel names.", lcd_opt) - line = line + 1 - local output, nbr - if done == 0 then - for i,v in ipairs(channel_names) do - output = model.getOutput(i-1) - output["name"] = v - model.setOutput(i-1,output) - nbr = i - end - for i = nbr, 15 do - output = model.getOutput(i) - output["name"] = "n-a" - model.setOutput(i,output) - end - if bind_ch == 1 then - output = model.getOutput(15) - output["name"] = "BindCH" - model.setOutput(15,output) - end - done = 1 - end - lcd.drawText(x_pos, y_pos+y_inc*line,"Done!", lcd_opt) - line = line + 1 -end - --- Init -local function Multi_Init() - module_conf = model.getModule(0) - if module_conf["Type"] ~= 6 then - module_pos = "External" - module_conf = model.getModule(1) - if module_conf["Type"] ~= 6 then - return - end - end - - protocol = module_conf["protocol"] - sub_protocol = module_conf["subProtocol"] - - --Exceptions on first 4 channels... - local stick_names = { "Rud", "Ele", "Thr", "Ail" } - if ( protocol == 4 and sub_protocol == 1 ) or protocol == 19 or protocol == 52 then -- Hisky/HK310, Shenqi, ZSX - stick_names[2] = "n-a" - stick_names[4] = "n-a" - elseif protocol == 43 then -- Traxxas - stick_names[2] = "Aux4" - stick_names[4] = "Aux3" - elseif ( protocol == 48 and sub_protocol == 0 ) then -- V761 3CH - stick_names[4] = "n-a" - elseif protocol == 47 or protocol == 49 or protocol == 58 then -- GD00x, KF606, FX816 - stick_names[1] = "n-a" - stick_names[2] = "n-a" - end - - --Determine fist 4 channels order - local ch_order=module_conf["channelsOrder"] - if (ch_order == -1) then - channel_names[1] = stick_names[defaultChannel(0)+1] - channel_names[2] = stick_names[defaultChannel(1)+1] - channel_names[3] = stick_names[defaultChannel(2)+1] - channel_names[4] = stick_names[defaultChannel(3)+1] - else - channel_names[bitand(ch_order,3)+1] = stick_names[4] - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = stick_names[2] - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = stick_names[3] - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = stick_names[1] - end - - --Exceptions on first 4 channels... - if ( protocol == 73 or (protocol == 74 and sub_protocol == 0) ) then -- Kyosho or RadioLink Surface - channel_names[1] = "ST" - channel_names[2] = "THR" - channel_names[3] = "CH3" - channel_names[4] = "CH4" - end - - --Check MultiChan.txt - local f = io.open("/SCRIPTS/TOOLS/MultiChan.txt", "r") - if f == nil then return end - file_ok = 1 - io.close(f) -end - --- Main -local function Multi_Run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - else - Multi_Draw_LCD(event) - if event == EVT_VIRTUAL_EXIT then - return 2 - end - end - return 0 -end - -return { init=Multi_Init, run=Multi_Run } diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/MultiLOLI.lua b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/MultiLOLI.lua deleted file mode 100644 index 4d309e37e..000000000 --- a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/MultiLOLI.lua +++ /dev/null @@ -1,221 +0,0 @@ - -local toolName = "TNS|Multi LOLI RX config|TNE" - ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - -local loli_nok = false -local channels={ { 768, "PWM", 100, 102, "PPM", 50, -768, "Servo", 0, -2048, "Switch", -100 }, -- CH1 - { 768, "PWM", 100, -768, "Servo", 0, -2048, "Switch", -100 }, -- CH2 - { -768, "Servo", 0, -2048, "Switch", -100 }, -- CH3 - { -768, "Servo", 0, -2048, "Switch", -100 }, -- CH4 - { 102, "SBUS", 50, -768, "Servo", 0, -2048, "Switch", -100 }, -- CH5 - { -768, "Servo", 0, -2048, "Switch", -100 }, -- CH6 - { 768, "PWM", 100, -768, "Servo", 0, -2048, "Switch", -100 }, -- CH7 - { -768, "Servo", 0, -2048, "Switch", -100 } } -- CH8 - -local sel = 1 -local edit = false - -local blink = 0 -local BLINK_SPEED = 15 - -local function drawScreenTitle(title) - if LCD_W == 480 then - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, title, MENU_TITLE_COLOR) - else - lcd.drawScreenTitle(title, 0, 0) - end -end - -local function LOLI_Draw_LCD(event) - local line = 0 - - lcd.clear() - - --Display settings - local lcd_opt = 0 - if LCD_W == 480 then - drawScreenTitle("Multi - LOLI RX configuration tool") - x_pos = 152 - x_inc = 90 - y_pos = 40 - y_inc = 20 - else - x_pos = 5 - x_inc = 30 - y_pos = 1 - y_inc = 8 - lcd_opt = SMLSIZE - end - - --Multi Module detection - if loli_nok then - if LCD_W == 480 then - lcd.drawText(10,50,"The LOLI protocol is not selected...", lcd_opt) - else - --Draw on LCD_W=128 - lcd.drawText(2,17,"LOLI protocol not selected...",SMLSIZE) - end - return - end - - --Display current config - if LCD_W == 480 then - line = line + 1 - lcd.drawText(x_pos, y_pos+y_inc*line -2, "Channel", lcd_opt) - lcd.drawText(x_pos+x_inc, y_pos+y_inc*line -2, "Function", lcd_opt) - lcd.drawRectangle(x_pos-4, y_pos+y_inc*line -4 , 2*x_inc +2, 188) - lcd.drawLine(x_pos-4, y_pos+y_inc*line +18, x_pos-4 +2*x_inc +1, y_pos+y_inc*line +18, SOLID, 0) - lcd.drawLine(x_pos+x_inc -5, y_pos+y_inc*line -4, x_pos+x_inc -5, y_pos+y_inc*line -5 +188, SOLID, 0) - line = line + 1 - end - - local out - for i = 1, 8 do - out = getValue("ch"..(i+8)) - lcd.drawText(x_pos, y_pos+y_inc*line, "CH"..i, lcd_opt) - for j = 1, #channels[i], 3 do - if out > channels[i][j] then - if sel == i then - invert = INVERS - if edit == true then - blink = blink + 1 - if blink > BLINK_SPEED then - invert = 0 - if blink > BLINK_SPEED * 2 then - blink = 0 - end - end - end - else - invert = 0 - end - lcd.drawText(x_pos+x_inc, y_pos+y_inc*line, channels[i][j+1], lcd_opt + invert) - break - end - end - line = line + 1 - end -end - -local function LOLI_Change_Value(dir) - local pos = 0 - local out - --look for the current position - out = getValue("ch"..(sel+8)) - for j = 1, #channels[sel], 3 do - if out > channels[sel][j] then - pos = j - break - end - end - - --decrement or increment - if dir < 0 and pos > 1 then - pos = pos - 3 - elseif dir > 0 and pos + 3 < #channels[sel] then - pos = pos + 3 - else - return - end - - --delete all mixers for the selected channel - local num_mix = model.getMixesCount(sel-1 +8) - for i = 1, num_mix do - model.deleteMix(sel-1 +8, 0); - end - - --create new mixer - local source_max = getFieldInfo("cyc1") - - local val = { name = channels[sel][pos+1], - source = source_max.id - 1, -- MAX=100 on TX16S - weight = channels[sel][pos+2], - offset = 0, - switch = 0, - multiplex = 0, - curveType = 0, - curveValue = 0, - flightModes = 0, - carryTrim = false, - mixWarn = 0, - delayUp = 0, - delayDown = 0, - speedUp = 0, - speedDown = 0 } - model.insertMix(sel-1 +8, 0, val) -end - -local function LOLI_Menu(event) - if event == EVT_VIRTUAL_NEXT then - if edit == false then - -- not changing a value - if sel < 8 then - sel = sel + 1 - end - else - -- need to inc the value - LOLI_Change_Value(1) - end - elseif event == EVT_VIRTUAL_PREV then - if edit == false then - -- not changing a value - if sel > 1 then - sel = sel - 1 - end - else - -- need to dec the value - LOLI_Change_Value(-1) - end - elseif event == EVT_VIRTUAL_ENTER then - if edit == false then - edit = true - blink = BLINK_SPEED - else - edit = false - end - end -end - --- Init -local function LOLI_Init() - local module_conf = model.getModule(0) - if module_conf["Type"] ~= 6 or module_conf["protocol"] ~= 82 then - module_conf = model.getModule(1) - if module_conf["Type"] ~= 6 or module_conf["protocol"] ~= 82 then - loli_nok = true - end - end -end - --- Main -local function LOLI_Run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_EXIT then - return 2 - else - LOLI_Menu(event) - LOLI_Draw_LCD(event) - return 0 - end -end - -return { init=LOLI_Init, run=LOLI_Run } diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/back.bmp b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/back.bmp deleted file mode 100644 index a8996262c..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/back.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/delta.bmp b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/delta.bmp deleted file mode 100644 index ab94279c1..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/delta.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/done.bmp b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/done.bmp deleted file mode 100644 index 9ac501398..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/done.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/down.bmp b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/down.bmp deleted file mode 100644 index 97f9105ac..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/down.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/forward.bmp b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/forward.bmp deleted file mode 100644 index df769aef2..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/forward.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/horz-r.bmp b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/horz-r.bmp deleted file mode 100644 index 93ffdb0fc..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/horz-r.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/horz.bmp b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/horz.bmp deleted file mode 100644 index 4295e8475..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/horz.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/left.bmp b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/left.bmp deleted file mode 100644 index 8cc811fd1..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/left.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/plane.bmp b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/plane.bmp deleted file mode 100644 index b3e61bf5f..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/plane.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/right.bmp b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/right.bmp deleted file mode 100644 index 5fd52d475..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/right.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/up.bmp b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/up.bmp deleted file mode 100644 index dcffc4186..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/up.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/vert-r.bmp b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/vert-r.bmp deleted file mode 100644 index 763409ec4..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/vert-r.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/vert.bmp b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/vert.bmp deleted file mode 100644 index 5f1b91f05..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/vert.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/vtail.bmp b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/vtail.bmp deleted file mode 100644 index 6c7ec0b56..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/bmp/vtail.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/crossfire.lua b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/crossfire.lua deleted file mode 100644 index b19bb5ee2..000000000 --- a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/crossfire.lua +++ /dev/null @@ -1,42 +0,0 @@ -local toolName = "TNS|Crossfire configure|TNE" - ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - - - --- Init -local function init() -end - --- Run -local function run(event) - if event == nil then - error("Cannot run as a model script!") - return 2 - end - - if crossfireTelemetryPush() == nil then - error("Crossfire not available!") - return 2 - end - - chdir("/SCRIPTS/TOOLS/CROSSFIRE") - return "crossfire.lua" -end - -return { init=init, run=run } diff --git a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/readme.txt b/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/readme.txt deleted file mode 100644 index 20b95c415..000000000 --- a/radio/sdcard/taranis-x9/SCRIPTS/TOOLS/readme.txt +++ /dev/null @@ -1 +0,0 @@ -Scripts that need to be available in TOOLS menu should be in this directory diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/ailerons-0.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/ailerons-0.bmp deleted file mode 100644 index 7999159c6..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/ailerons-0.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/ailerons-1.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/ailerons-1.bmp deleted file mode 100644 index 171d52cf1..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/ailerons-1.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/ailerons-2.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/ailerons-2.bmp deleted file mode 100644 index 34a1e929b..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/ailerons-2.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/brakes-1.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/brakes-1.bmp deleted file mode 100644 index d8ca1c27a..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/brakes-1.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/brakes-2.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/brakes-2.bmp deleted file mode 100644 index dcfde4a88..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/brakes-2.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/confirm-plane.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/confirm-plane.bmp deleted file mode 100644 index 225dae79b..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/confirm-plane.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/confirm-tick.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/confirm-tick.bmp deleted file mode 100644 index dfecdb2de..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/confirm-tick.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/delta.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/delta.bmp deleted file mode 100644 index 25beb3bd1..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/delta.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/delta.lua b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/delta.lua deleted file mode 100644 index cf559c6b2..000000000 --- a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/delta.lua +++ /dev/null @@ -1,391 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### --- Delta Wizard pages -local ENGINE_PAGE = 0 -local ELEVONS_PAGE = 1 -local RUDDER_PAGE = 2 -local CONFIRMATION_PAGE = 3 - --- Navigation variables -local page = ENGINE_PAGE -local dirty = true -local edit = false -local field = 0 -local fieldsMax = 0 - --- Model settings -local engineMode = 1 -local thrCH1 = 0 -local elevCH1 = 0 -local elevCH2 = 0 -local elevonsMode = 0 -local rudderMode = 0 -local rudCH1 = 0 -local servoPage = nil - --- Common functions -local lastBlink = 0 -local function blinkChanged() - local time = getTime() % 128 - local blink = (time - time % 64) / 64 - if blink ~= lastBlink then - lastBlink = blink - return true - else - return false - end -end - -local function fieldIncDec(event, value, max, force) - if edit or force==true then - if event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - value = (value + max) - dirty = true - elseif event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - value = (value + max + 2) - dirty = true - end - value = (value % (max+1)) - end - return value -end - -local function valueIncDec(event, value, min, max) - if edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - if value < max then - value = (value + 1) - dirty = true - end - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - if value > min then - value = (value - 1) - dirty = true - end - end - end - return value -end - -local function navigate(event, fieldMax, prevPage, nextPage) - if event == EVT_VIRTUAL_ENTER then - edit = not edit - dirty = true - elseif edit then - if event == EVT_VIRTUAL_EXIT then - edit = false - dirty = true - elseif not dirty then - dirty = blinkChanged() - end - else - if event == EVT_PAGE_BREAK then - page = nextPage - field = 0 - dirty = true - elseif event == EVT_PAGE_LONG then - page = prevPage - field = 0 - killEvents(event); - dirty = true - else - field = fieldIncDec(event, field, fieldMax, true) - end - end -end - -local function getFieldFlags(position) - flags = 0 - if field == position then - flags = INVERS - if edit then - flags = INVERS + BLINK - end - end - return flags -end - -local function channelIncDec(event, value) - if not edit and event == EVT_VIRTUAL_MENU then - servoPage = value - dirty = true - else - value = valueIncDec(event, value, 0, 15) - end - return value -end - --- Init function -local function init() - rudCH1 = defaultChannel(0) - thrCH1 = defaultChannel(2) - elevCH1 = defaultChannel(1) - elevCH2 = defaultChannel(3) -end - --- Engine Menu -local engineModeItems = {"No", "Yes"} -local function drawEngineMenu() - lcd.clear() - lcd.drawText(1, 0, "Has your model got an engine?", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, GREY_DEFAULT+FILL_WHITE) - lcd.drawCombobox(0, 8, LCD_W/2, engineModeItems, engineMode, getFieldFlags(0)) - lcd.drawLine(LCD_W/2-1, 18, LCD_W/2-1, LCD_H-1, DOTTED, 0) - if engineMode == 0 then - -- No engine - lcd.drawPixmap(132, 8, "engine-0.bmp") - fieldsMax = 0 - else - -- 1 channel - lcd.drawPixmap(132, 8, "engine-1.bmp") - lcd.drawText(25, LCD_H-16, "Assign channel", 0); - lcd.drawText(LCD_W/2-19, LCD_H-8, ">>>", 0); - lcd.drawSource(151, LCD_H-8, MIXSRC_CH1+thrCH1, getFieldFlags(1)) - fieldsMax = 1 - end -end - -local function engineMenu(event) - if dirty then - dirty = false - drawEngineMenu() - end - - navigate(event, fieldsMax, page, page+1) - - if field==0 then - engineMode = fieldIncDec(event, engineMode, 1) - elseif field==1 then - thrCH1 = channelIncDec(event, thrCH1) - end -end - --- Elevons Menu -local elevonsModeItems = {"2 Channels..."} -local function drawElevonsMenu() - lcd.clear() - lcd.drawText(1, 0, "Select elevon channnels", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, GREY_DEFAULT+FILL_WHITE) - lcd.drawCombobox(0, 8, LCD_W/2, elevonsModeItems, elevonsMode, 0) - lcd.drawLine(LCD_W/2-1, 18, LCD_W/2-1, LCD_H-1, DOTTED, 0) - lcd.drawPixmap(110, 9, "elevons.bmp") - lcd.drawText(20, LCD_H-16, "Assign channels", 0); - lcd.drawText(LCD_W/2-19, LCD_H-8, ">>>", 0); - lcd.drawSource(116, LCD_H-8, MIXSRC_CH1+elevCH1, getFieldFlags(0)) - lcd.drawSource(175, LCD_H-8, MIXSRC_CH1+elevCH2, getFieldFlags(1)) - fieldsMax = 1 -end - -local function elevonsMenu(event) - if dirty then - dirty = false - drawElevonsMenu() - end - - navigate(event, fieldsMax, page-1, page+1) - - if field==0 then - elevCH1 = channelIncDec(event, elevCH1) - elseif field==1 then - elevCH2 = channelIncDec(event, elevCH2) - end -end - --- Rudder menu -local rudderModeItems = {"No", "Yes"} - -local function drawRudderMenu() - lcd.clear() - lcd.drawText(1, 0, "Has your model got a rudder?", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, GREY_DEFAULT+FILL_WHITE) - lcd.drawCombobox(0, 8, LCD_W/2, rudderModeItems, rudderMode, getFieldFlags(0)) - lcd.drawLine(LCD_W/2-1, 18, LCD_W/2-1, LCD_H-1, DOTTED, 0) - if rudderMode == 0 then - -- No rudder - lcd.drawPixmap(109, 14, "drudder-0.bmp") - fieldsMax = 0 - else - -- 1 channel - lcd.drawPixmap(109, 14, "drudder-1.bmp") - lcd.drawText(25, LCD_H-16, "Assign channel", 0); - lcd.drawText(LCD_W/2-19, LCD_H-8, ">>>", 0); - lcd.drawSource(190, LCD_H-55, MIXSRC_CH1+rudCH1, getFieldFlags(1)) - fieldsMax = 1 - end -end - -local function rudderMenu(event) - if dirty then - dirty = false - drawRudderMenu() - end - - navigate(event, fieldsMax, page-1, page+1) - - if field==0 then - rudderMode = fieldIncDec(event, rudderMode, 1) - elseif field==1 then - rudCH1 = channelIncDec(event, rudCH1) - end -end - --- Servo (limits) Menu -local function drawServoMenu(limits) - lcd.clear() - lcd.drawSource(1, 0, MIXSRC_CH1+servoPage, 0) - lcd.drawText(25, 0, "servo min/max/center/direction?", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, GREY_DEFAULT+FILL_WHITE) - lcd.drawLine(LCD_W/2-1, 8, LCD_W/2-1, LCD_H-1, DOTTED, 0) - lcd.drawText(LCD_W/2-19, LCD_H-8, ">>>", 0); - lcd.drawPixmap(122, 8, "servo.bmp") - lcd.drawNumber(140, 35, limits.min, PREC1+getFieldFlags(0)); - lcd.drawNumber(205, 35, limits.max, PREC1+getFieldFlags(1)); - lcd.drawNumber(170, 9, limits.offset, PREC1+getFieldFlags(2)); - if limits.revert == 0 then - lcd.drawText(129, 50, "\126", getFieldFlags(3)); - else - lcd.drawText(129, 50, "\127", getFieldFlags(3)); - end - fieldsMax = 3 -end - -local function servoMenu(event) - local limits = model.getOutput(servoPage) - - if dirty then - dirty = false - drawServoMenu(limits) - end - - navigate(event, fieldsMax, page, page) - - if edit then - if field==0 then - limits.min = valueIncDec(event, limits.min, -1000, 0) - elseif field==1 then - limits.max = valueIncDec(event, limits.max, 0, 1000) - elseif field==2 then - limits.offset = valueIncDec(event, limits.offset, -1000, 1000) - elseif field==3 then - limits.revert = fieldIncDec(event, limits.revert, 1) - end - model.setOutput(servoPage, limits) - elseif event == EVT_VIRTUAL_EXIT then - servoPage = nil - dirty = true - end -end - --- Confirmation Menu -local function addMix(channel, input, name, weight, index) - local mix = { source=input, name=name } - if weight ~= nil then - mix.weight = weight - end - if index == nil then - index = 0 - end - model.insertMix(channel, index, mix) -end - -local function applySettings() - model.defaultInputs() - model.deleteMixes() - if engineMode == 1 then - addMix(thrCH1, MIXSRC_FIRST_INPUT+defaultChannel(2), "Engine") - end - addMix(elevCH1, MIXSRC_FIRST_INPUT+defaultChannel(1), "D-EleL", 50) - addMix(elevCH1, MIXSRC_FIRST_INPUT+defaultChannel(3), "D-AilL", 50, 1) - addMix(elevCH2, MIXSRC_FIRST_INPUT+defaultChannel(1), "D-EleR", 50) - addMix(elevCH2, MIXSRC_FIRST_INPUT+defaultChannel(3), "D-AilR", -50, 1) - if rudderMode == 1 then - addMix(rudCH1, MIXSRC_FIRST_INPUT+defaultChannel(0), "Rudder") - end -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 - y = 12 - x = 120 - end - return x, y -end - -local function drawConfirmationMenu() - local x = 22 - local y = 12 - lcd.clear() - 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, "Throttle", thrCH1) - end - 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) - end - lcd.drawText(48, LCD_H-8, "Long [ENT] to confirm", 0); - lcd.drawFilledRectangle(0, LCD_H-9, LCD_W, 9, 0) - lcd.drawPixmap(LCD_W-18, LCD_H-17, "confirm-tick.bmp") - fieldsMax = 0 -end - -local function confirmationMenu(event) - if dirty then - dirty = false - drawConfirmationMenu() - end - - navigate(event, fieldsMax, RUDDER_PAGE, page) - - if event == EVT_VIRTUAL_EXIT then - return 2 - elseif event == EVT_VIRTUAL_ENTER_LONG then - killEvents(event) - applySettings() - return 2 - else - return 0 - end -end - --- Main - -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - end - if servoPage ~= nil then - servoMenu(event) - elseif page == ENGINE_PAGE then - engineMenu(event) - elseif page == ELEVONS_PAGE then - elevonsMenu(event) - elseif page == RUDDER_PAGE then - rudderMenu(event) - elseif page == CONFIRMATION_PAGE then - return confirmationMenu(event) - end - return 0 -end - -return { init=init, run=run } diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/drudder-0.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/drudder-0.bmp deleted file mode 100644 index d3160c1f1..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/drudder-0.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/drudder-1.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/drudder-1.bmp deleted file mode 100644 index 088ac0fb9..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/drudder-1.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/elevons.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/elevons.bmp deleted file mode 100644 index 428ea8313..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/elevons.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/engine-0.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/engine-0.bmp deleted file mode 100644 index 04198eef7..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/engine-0.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/engine-1.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/engine-1.bmp deleted file mode 100644 index 24a936cd4..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/engine-1.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/flaps-1.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/flaps-1.bmp deleted file mode 100644 index 788f3c5f0..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/flaps-1.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/flaps-2.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/flaps-2.bmp deleted file mode 100644 index 1b93f7c0a..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/flaps-2.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/heli.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/heli.bmp deleted file mode 100644 index 021f5484d..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/heli.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/mark.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/mark.bmp deleted file mode 100644 index 36db721c6..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/mark.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/multi-pitch.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/multi-pitch.bmp deleted file mode 100644 index 418bd4f09..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/multi-pitch.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/multi-roll.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/multi-roll.bmp deleted file mode 100644 index 6eecd901f..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/multi-roll.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/multi-thr.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/multi-thr.bmp deleted file mode 100644 index 7de06b650..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/multi-thr.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/multi-yaw.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/multi-yaw.bmp deleted file mode 100644 index ae08f8efd..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/multi-yaw.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/multi.lua b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/multi.lua deleted file mode 100644 index c78b982a9..000000000 --- a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/multi.lua +++ /dev/null @@ -1,454 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### --- Multicopter Wizard pages -local THROTTLE_PAGE = 0 -local ROLL_PAGE = 1 -local PITCH_PAGE = 2 -local YAW_PAGE = 3 -local ARM_PAGE = 4 -local BEEPER_PAGE = 5 -local MODE_PAGE = 6 -local CONFIRMATION_PAGE = 7 - --- Navigation variables -local page = THROTTLE_PAGE -local dirty = true -local edit = false -local field = 0 -local fieldsMax = 0 -local comboBoxMode = 0 -- Scrap variable -local validSwitch = {} - --- Model settings -local thrCH1 = 0 -local rollCH1 = 0 -local yawCH1 = 0 -local pitchCH1 = 0 -local armSW1 = 1 -local beeperSW1 = 1 -local modeSW1 = 1 -local switches = {"SA", "SB", "SC", "SD", "SE", "SF", "SG", "SH"} --- Common functions -local lastBlink = 0 -local function blinkChanged() - local time = getTime() % 128 - local blink = (time - time % 64) / 64 - if blink ~= lastBlink then - lastBlink = blink - return true - else - return false - end -end - -local function fieldIncDec(event, value, max, force) - if edit or force==true then - if event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - value = (value + max) - dirty = true - elseif event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - value = (value + max + 2) - dirty = true - end - value = (value % (max+1)) - end - return value -end - -local function valueIncDec(event, value, min, max) - if edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - if value < max then - value = (value + 1) - dirty = true - end - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - if value > min then - value = (value - 1) - dirty = true - end - end - end - return value -end - -local function navigate(event, fieldMax, prevPage, nextPage) - if event == EVT_VIRTUAL_ENTER then - edit = not edit - dirty = true - elseif edit then - if event == EVT_VIRTUAL_EXIT then - edit = false - dirty = true - elseif not dirty then - dirty = blinkChanged() - end - else - if event == EVT_PAGE_BREAK then - page = nextPage - field = 0 - dirty = true - elseif event == EVT_PAGE_LONG then - page = prevPage - field = 0 - killEvents(event); - dirty = true - else - field = fieldIncDec(event, field, fieldMax, true) - end - end -end - -local function getFieldFlags(position) - flags = 0 - if field == position then - flags = INVERS - if edit then - flags = INVERS + BLINK - end - end - return flags -end - -local function channelIncDec(event, value) - if not edit and event == EVT_VIRTUAL_MENU then - servoPage = value - dirty = true - else - value = valueIncDec(event, value, 0, 15) - end - return value -end - -local function switchValueIncDec(event, value, min, max) - if edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - if value < max then - value = (value + 1) - dirty = true - end - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - if value > min then - value = (value - 1) - dirty = true - end - end - end - return value -end - -local function switchIncDec(event, value) - if not edit and event == EVT_VIRTUAL_MENU then - servoPage = value - dirty = true - else - value = switchValueIncDec(event, value, 1, #validSwitch) - end - return value -end - --- Init function -local function init() - thrCH1 = defaultChannel(2) - rollCH1 = defaultChannel(3) - yawCH1 = defaultChannel(0) - pitchCH1 = defaultChannel(1) - local ver, radio, maj, minor, rev = getVersion() - -- if string.match(radio, "x7") then - -- validSwitch = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15} -- X7 : 3pos / 3pos / 3pos / 3pos / 2 pos - -- if string.match(radio, "xlite") then - -- validSwitch = {1, 2, 3, 4, 5, 6, 7, 9, 10, 12} -- xlite : 3pos / 3pos / 2pos / 2pos - -- else - validSwitch = {1, 2, 3, 4, 5, 6, 7 } -- X9 : 3pos / 3pos / 3pos / 3pos / 3 pos / 2 pos / 3pos -end - --- Throttle Menu -local function drawThrottleMenu() - lcd.clear() - lcd.drawText(1, 0, "Select multicopter throttle channel", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, GREY_DEFAULT+FILL_WHITE) - lcd.drawLine(LCD_W/2-1, 18, LCD_W/2-1, LCD_H-1, DOTTED, 0) - lcd.drawPixmap(120, 8, "multi-thr.bmp") - lcd.drawText(20, LCD_H-16, "Assign Throttle", 0); - lcd.drawText(20, LCD_H-8, "Channel", 0); - lcd.drawText(LCD_W/2-19, LCD_H-8, ">>>", 0); - lcd.drawSource(113, LCD_H-8, MIXSRC_CH1+thrCH1, getFieldFlags(0)) - fieldsMax = 0 -end - -local function throttleMenu(event) - if dirty then - dirty = false - drawThrottleMenu() - end - navigate(event, fieldsMax, page, page+1) - thrCH1 = channelIncDec(event, thrCH1) -end - --- Roll Menu -local function drawRollMenu() - lcd.clear() - lcd.drawText(1, 0, "Select multicopter roll channel", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, GREY_DEFAULT+FILL_WHITE) - lcd.drawLine(LCD_W/2-1, 18, LCD_W/2-1, LCD_H-1, DOTTED, 0) - lcd.drawPixmap(120, 8, "multi-roll.bmp") - lcd.drawText(20, LCD_H-16, "Assign Roll", 0); - lcd.drawText(20, LCD_H-8, "Channel", 0); - lcd.drawText(LCD_W/2-19, LCD_H-8, ">>>", 0); - lcd.drawSource(113, LCD_H-8, MIXSRC_CH1+rollCH1, getFieldFlags(0)) - fieldsMax = 0 -end - -local function rollMenu(event) - if dirty then - dirty = false - drawRollMenu() - end - navigate(event, fieldsMax, page-1, page+1) - rollCH1 = channelIncDec(event, rollCH1) -end - --- Pitch Menu -local function drawPitchMenu() - lcd.clear() - lcd.drawText(1, 0, "Select multicopter pitch channel", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, GREY_DEFAULT+FILL_WHITE) - lcd.drawLine(LCD_W/2-1, 18, LCD_W/2-1, LCD_H-1, DOTTED, 0) - lcd.drawPixmap(120, 8, "multi-pitch.bmp") - lcd.drawText(20, LCD_H-16, "Assign Pitch", 0); - lcd.drawText(20, LCD_H-8, "Channel", 0); - lcd.drawText(LCD_W/2-19, LCD_H-8, ">>>", 0); - lcd.drawSource(113, LCD_H-8, MIXSRC_CH1+pitchCH1, getFieldFlags(0)) - fieldsMax = 0 -end - -local function pitchMenu(event) - if dirty then - dirty = false - drawPitchMenu() - end - navigate(event, fieldsMax, page-1, page+1) - pitchCH1 = channelIncDec(event, pitchCH1) -end - --- Yaw Menu -local function drawYawMenu() - lcd.clear() - lcd.drawText(1, 0, "Select multicopter yaw channel", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, GREY_DEFAULT+FILL_WHITE) - lcd.drawLine(LCD_W/2-1, 18, LCD_W/2-1, LCD_H-1, DOTTED, 0) - lcd.drawPixmap(120, 8, "multi-yaw.bmp") - lcd.drawText(20, LCD_H-16, "Assign Yaw", 0); - lcd.drawText(20, LCD_H-8, "Channel", 0); - lcd.drawText(LCD_W/2-19, LCD_H-8, ">>>", 0); - lcd.drawSource(113, LCD_H-8, MIXSRC_CH1+yawCH1, getFieldFlags(0)) - fieldsMax = 0 -end - -local function yawMenu(event) - if dirty then - dirty = false - drawYawMenu() - end - navigate(event, fieldsMax, page-1, page+1) - yawCH1 = channelIncDec(event, yawCH1) -end - --- Arm Menu -local function drawArmMenu() - lcd.clear() - lcd.drawText(1, 0, "Select multicopter arm switch", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, GREY_DEFAULT+FILL_WHITE) - lcd.drawLine(LCD_W/2-1, 18, LCD_W/2-1, LCD_H-1, DOTTED, 0) - lcd.drawPixmap(120, 8, "multi-thr.bmp") - lcd.drawText(20, LCD_H-16, "Assign AUX1", 0); - lcd.drawText(20, LCD_H-8, "Switch", 0); - lcd.drawText(LCD_W/2-19, LCD_H-8, ">>>", 0); - lcd.drawText(113, LCD_H-8, switches[armSW1], getFieldFlags(0)) - fieldsMax = 0 -end - -local function armMenu(event) - if dirty then - dirty = false - drawArmMenu() - end - navigate(event, fieldsMax, page-1, page+1) - armSW1 = switchIncDec(event, armSW1) -end - --- Beeper Menu -local function drawbeeperMenu() - lcd.clear() - lcd.drawText(1, 0, "Select multicopter beeper switch", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, GREY_DEFAULT+FILL_WHITE) - lcd.drawLine(LCD_W/2-1, 18, LCD_W/2-1, LCD_H-1, DOTTED, 0) - lcd.drawPixmap(120, 8, "multi-thr.bmp") - lcd.drawText(20, LCD_H-16, "Assign AUX2", 0); - lcd.drawText(20, LCD_H-8, "Switch", 0); - lcd.drawText(LCD_W/2-19, LCD_H-8, ">>>", 0); - lcd.drawText(113, LCD_H-8, switches[beeperSW1], getFieldFlags(0)) - fieldsMax = 0 -end - -local function beeperMenu(event) - if dirty then - dirty = false - drawbeeperMenu() - end - navigate(event, fieldsMax, page-1, page+1) - beeperSW1 = switchIncDec(event, beeperSW1) -end - --- Mode Menu -local function drawmodeMenu() - lcd.clear() - lcd.drawText(1, 0, "Select multicopter mode switch", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, GREY_DEFAULT+FILL_WHITE) - lcd.drawLine(LCD_W/2-1, 18, LCD_W/2-1, LCD_H-1, DOTTED, 0) - lcd.drawPixmap(120, 8, "multi-thr.bmp") - lcd.drawText(20, LCD_H-16, "Assign AUX3", 0); - lcd.drawText(20, LCD_H-8, "Switch", 0); - lcd.drawText(LCD_W/2-19, LCD_H-8, ">>>", 0); - lcd.drawText(113, LCD_H-8, switches[modeSW1], getFieldFlags(0)) - fieldsMax = 0 -end - -local function modeMenu(event) - if dirty then - dirty = false - drawmodeMenu() - end - navigate(event, fieldsMax, page-1, page+1) - modeSW1 = switchIncDec(event, modeSW1) -end - --- Confirmation Menu -local function drawNextCHLine(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 - y = 12 - x = 120 - end - return x, y -end - -local function drawNextSWLine(x, y, label, switch) - lcd.drawText(x, y, label, 0); - lcd.drawText(x+76, y, ":", 0); - lcd.drawText(x+80, y, switches[switch], 0) - y = y + 8 - if y > 50 then - y = 12 - x = 120 - end - return x, y -end - -local function drawConfirmationMenu() - local x = 10 - local y = 12 - lcd.clear() - lcd.drawText(48, 1, "Ready to go?", 0); - lcd.drawFilledRectangle(0, 0, LCD_W, 9, 0) - x, y = drawNextCHLine(x, y, "Throttle", thrCH1) - x, y = drawNextCHLine(x, y, "Roll", rollCH1) - x, y = drawNextCHLine(x, y, "Pitch", pitchCH1) - x, y = drawNextCHLine(x, y, "Yaw", yawCH1) - x = 95 - y = 12 - x, y = drawNextSWLine(x, y, "Arm switch", armSW1) - x, y = drawNextSWLine(x, y, "Beeper switch", beeperSW1) - x, y = drawNextSWLine(x, y, "Mode switch", modeSW1) - lcd.drawText(48, LCD_H-8, "[Enter Long] to confirm", 0); - lcd.drawFilledRectangle(0, LCD_H-9, LCD_W, 9, 0) - lcd.drawPixmap(LCD_W-18, 0, "confirm-tick.bmp") - lcd.drawPixmap(0, LCD_H-17, "confirm-plane.bmp") - fieldsMax = 0 -end - -local function addMix(channel, input, name, weight, index) - local mix = { source=input, name=name } - if weight ~= nil then - mix.weight = weight - end - if index == nil then - index = 0 - end - model.insertMix(channel, index, mix) -end - -local function applySettings() - model.defaultInputs() - model.deleteMixes() - addMix(thrCH1, MIXSRC_FIRST_INPUT+defaultChannel(2), "Engine") - addMix(rollCH1, MIXSRC_FIRST_INPUT+defaultChannel(3), "Roll") - addMix(yawCH1, MIXSRC_FIRST_INPUT+defaultChannel(0), "Yaw") - addMix(pitchCH1, MIXSRC_FIRST_INPUT+defaultChannel(1), "Pitch") - addMix(4, MIXSRC_SA + armSW1 - 1, "Arm") - addMix(5, MIXSRC_SA + beeperSW1 - 1, "Beeper") - addMix(6, MIXSRC_SA + modeSW1 - 1, "Mode") -end - -local function confirmationMenu(event) - if dirty then - dirty = false - drawConfirmationMenu() - end - - navigate(event, fieldsMax, BEEPER_PAGE, page) - - if event == EVT_VIRTUAL_EXIT then - return 2 - elseif event == EVT_VIRTUAL_ENTER_LONG then - killEvents(event) - applySettings() - return 2 - else - return 0 - end -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - end - if page == THROTTLE_PAGE then - throttleMenu(event) - elseif page == ROLL_PAGE then - rollMenu(event) - elseif page == YAW_PAGE then - yawMenu(event) - elseif page == PITCH_PAGE then - pitchMenu(event) - elseif page == ARM_PAGE then - armMenu(event) - elseif page == MODE_PAGE then - modeMenu(event) - elseif page == BEEPER_PAGE then - beeperMenu(event) - elseif page == CONFIRMATION_PAGE then - return confirmationMenu(event) - end - return 0 -end - -return { init=init, run=run } diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/plane.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/plane.bmp deleted file mode 100644 index dde0e10be..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/plane.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/plane.lua b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/plane.lua deleted file mode 100644 index 7d20bd97e..000000000 --- a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/plane.lua +++ /dev/null @@ -1,587 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### --- Plane Wizard pages -local ENGINE_PAGE = 0 -local AILERONS_PAGE = 1 -local FLAPERONS_PAGE = 2 -local BRAKES_PAGE = 3 -local TAIL_PAGE = 4 -local CONFIRMATION_PAGE = 5 - --- Navigation variables -local page = ENGINE_PAGE -local dirty = true -local edit = false -local field = 0 -local fieldsMax = 0 - --- Model settings -local engineMode = 1 -local thrCH1 = 0 -local aileronsMode = 1 -local ailCH1 = 0 -local ailCH2 = 5 -local flapsMode = 0 -local flapsCH1 = 6 -local flapsCH2 = 7 -local brakesMode = 0 -local brakesCH1 = 8 -local brakesCH2 = 9 -local tailMode = 1 -local eleCH1 = 0 -local eleCH2 = 4 -local rudCH1 = 0 -local servoPage = nil - --- Common functions -local lastBlink = 0 -local function blinkChanged() - local time = getTime() % 128 - local blink = (time - time % 64) / 64 - if blink ~= lastBlink then - lastBlink = blink - return true - else - return false - end -end - -local function fieldIncDec(event, value, max, force) - if edit or force==true then - if event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - value = (value + max) - dirty = true - elseif event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - value = (value + max + 2) - dirty = true - end - value = (value % (max+1)) - end - return value -end - -local function valueIncDec(event, value, min, max) - if edit then - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - if value < max then - value = (value + 1) - dirty = true - end - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - if value > min then - value = (value - 1) - dirty = true - end - end - end - return value -end - -local function navigate(event, fieldMax, prevPage, nextPage) - if event == EVT_VIRTUAL_ENTER then - edit = not edit - dirty = true - elseif edit then - if event == EVT_VIRTUAL_EXIT then - edit = false - dirty = true - elseif not dirty then - dirty = blinkChanged() - end - else - if event == EVT_PAGE_BREAK then - page = nextPage - field = 0 - dirty = true - elseif event == EVT_PAGE_LONG then - page = prevPage - field = 0 - killEvents(event); - dirty = true - else - field = fieldIncDec(event, field, fieldMax, true) - end - end -end - -local function getFieldFlags(position) - flags = 0 - if field == position then - flags = INVERS - if edit then - flags = INVERS + BLINK - end - end - return flags -end - -local function channelIncDec(event, value) - if not edit and event == EVT_VIRTUAL_MENU then - servoPage = value - dirty = true - else - value = valueIncDec(event, value, 0, 15) - end - return value -end - --- Init function -local function init() - rudCH1 = defaultChannel(0) - eleCH1 = defaultChannel(1) - thrCH1 = defaultChannel(2) - ailCH1 = defaultChannel(3) -end - --- Engine Menu -local engineModeItems = {"No", "Yes"} -local function drawEngineMenu() - lcd.clear() - lcd.drawText(1, 0, "Has your model got an engine?", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, GREY_DEFAULT+FILL_WHITE) - lcd.drawCombobox(0, 8, LCD_W/2, engineModeItems, engineMode, getFieldFlags(0)) - lcd.drawLine(LCD_W/2-1, 18, LCD_W/2-1, LCD_H-1, DOTTED, 0) - if engineMode == 1 then - -- 1 channel - lcd.drawPixmap(132, 8, "engine-1.bmp") - lcd.drawText(25, LCD_H-16, "Assign channel", 0); - lcd.drawText(LCD_W/2-19, LCD_H-8, ">>>", 0); - lcd.drawSource(151, LCD_H-8, MIXSRC_CH1+thrCH1, getFieldFlags(1)) - fieldsMax = 1 - else - -- No engine - lcd.drawPixmap(132, 8, "engine-0.bmp") - fieldsMax = 0 - end -end - -local function engineMenu(event) - if dirty then - dirty = false - drawEngineMenu() - end - - navigate(event, fieldsMax, page, page+1) - - if field==0 then - engineMode = fieldIncDec(event, engineMode, 1) - elseif field==1 then - thrCH1 = channelIncDec(event, thrCH1) - end -end - --- Ailerons Menu -local aileronsModeItems = {"No", "Yes, 1 channel", "Yes, 2 channels"} -local function drawAileronsMenu() - lcd.clear() - lcd.drawText(1, 0, "Has your model got ailerons?", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, GREY_DEFAULT+FILL_WHITE) - lcd.drawCombobox(0, 8, LCD_W/2, aileronsModeItems, aileronsMode, getFieldFlags(0)) - lcd.drawLine(LCD_W/2-1, 18, LCD_W/2-1, LCD_H-1, DOTTED, 0) - if aileronsMode == 2 then - -- 2 channels - lcd.drawPixmap(112, 8, "ailerons-2.bmp") - lcd.drawText(20, LCD_H-16, "Assign channels", 0); - lcd.drawText(LCD_W/2-19, LCD_H-8, ">>>", 0); - lcd.drawSource(116, LCD_H-8, MIXSRC_CH1+ailCH1, getFieldFlags(1)) - lcd.drawSource(175, LCD_H-8, MIXSRC_CH1+ailCH2, getFieldFlags(2)) - fieldsMax = 2 - elseif aileronsMode == 1 then - -- 1 channel - lcd.drawPixmap(112, 8, "ailerons-1.bmp") - lcd.drawText(25, LCD_H-16, "Assign channel", 0); - lcd.drawText(LCD_W/2-19, LCD_H-8, ">>>", 0); - lcd.drawSource(151, LCD_H-8, MIXSRC_CH1+ailCH1, getFieldFlags(1)) - fieldsMax = 1 - else - -- No ailerons - lcd.drawPixmap(112, 8, "ailerons-0.bmp") - fieldsMax = 0 - end -end - -local function aileronsMenu(event) - if dirty then - dirty = false - drawAileronsMenu() - end - - navigate(event, fieldsMax, page-1, page+1) - - if field==0 then - aileronsMode = fieldIncDec(event, aileronsMode, 2) - elseif field==1 then - ailCH1 = channelIncDec(event, ailCH1) - elseif field==2 then - ailCH2 = channelIncDec(event, ailCH2) - end -end - --- Flaps Menu -local flapsModeItems = {"No", "Yes, 1 channel", "Yes, 2 channels"} -local function drawFlapsMenu() - lcd.clear() - lcd.drawText(1, 0, "Has your model got flaps?", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, GREY_DEFAULT+FILL_WHITE) - lcd.drawCombobox(0, 8, LCD_W/2, flapsModeItems, flapsMode, getFieldFlags(0)) - lcd.drawLine(LCD_W/2-1, 18, LCD_W/2-1, LCD_H-1, DOTTED, 0) - if flapsMode == 0 then - -- no flaps - lcd.drawPixmap(112, 8, "ailerons-0.bmp") - fieldsMax = 0 - elseif flapsMode == 1 then - -- 1 channel - lcd.drawPixmap(112, 8, "flaps-1.bmp") - lcd.drawText(25, LCD_H-16, "Assign channel", 0); - lcd.drawText(LCD_W/2-19, LCD_H-8, ">>>", 0); - lcd.drawSource(151, LCD_H-8, MIXSRC_CH1+flapsCH1, getFieldFlags(1)) - fieldsMax = 1 - elseif flapsMode == 2 then - -- 2 channels - lcd.drawPixmap(112, 8, "flaps-2.bmp") - lcd.drawText(20, LCD_H-16, "Assign channels", 0); - lcd.drawText(LCD_W/2-19, LCD_H-8, ">>>", 0); - lcd.drawSource(116, LCD_H-8, MIXSRC_CH1+flapsCH1, getFieldFlags(1)) - lcd.drawSource(175, LCD_H-8, MIXSRC_CH1+flapsCH2, getFieldFlags(2)) - fieldsMax = 2 - end -end - -local function flapsMenu(event) - if dirty then - dirty = false - drawFlapsMenu() - end - - navigate(event, fieldsMax, page-1, page+1) - - if field==0 then - flapsMode = fieldIncDec(event, flapsMode, 2) - elseif field==1 then - flapsCH1 = channelIncDec(event, flapsCH1) - elseif field==2 then - flapsCH2 = channelIncDec(event, flapsCH2) - end -end - --- Airbrakes Menu -local brakesModeItems = {"No", "Yes, 1 channel", "Yes, 2 channels"} -local function drawBrakesMenu() - lcd.clear() - lcd.drawText(1, 0, "Has your model got air brakes?", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, GREY_DEFAULT+FILL_WHITE) - lcd.drawCombobox(0, 8, LCD_W/2, brakesModeItems, brakesMode, getFieldFlags(0)) - lcd.drawLine(LCD_W/2-1, 18, LCD_W/2-1, LCD_H-1, DOTTED, 0) - if brakesMode == 0 then - -- no brakes - lcd.drawPixmap(112, 8, "ailerons-0.bmp") - fieldsMax = 0 - elseif brakesMode == 1 then - -- 1 channel - lcd.drawPixmap(112, 8, "brakes-1.bmp") - lcd.drawText(25, LCD_H-16, "Assign channel", 0); - lcd.drawText(LCD_W/2-19, LCD_H-8, ">>>", 0); - lcd.drawSource(151, LCD_H-8, MIXSRC_CH1+brakesCH1, getFieldFlags(1)) - fieldsMax = 1 - elseif brakesMode == 2 then - -- 2 channels - lcd.drawPixmap(112, 8, "brakes-2.bmp") - lcd.drawText(20, LCD_H-16, "Assign channels", 0); - lcd.drawText(LCD_W/2-19, LCD_H-8, ">>>", 0); - lcd.drawSource(116, LCD_H-8, MIXSRC_CH1+brakesCH1, getFieldFlags(1)) - lcd.drawSource(175, LCD_H-8, MIXSRC_CH1+brakesCH2, getFieldFlags(2)) - fieldsMax = 2 - end -end - -local function brakesMenu(event) - if dirty then - dirty = false - drawBrakesMenu() - end - - navigate(event, fieldsMax, page-1, page+1) - - if field==0 then - brakesMode = fieldIncDec(event, brakesMode, 2) - elseif field==1 then - brakesCH1 = channelIncDec(event, brakesCH1) - elseif field==2 then - brakesCH2 = channelIncDec(event, brakesCH2) - end -end - --- Tail Menu -local tailModeItems = {"Ele(1ch)", "Ele(1ch) + Rud(1ch)", "Ele(2ch) + Rud(1ch)", "V-Tail(2ch)"} -local function drawTailMenu() - lcd.clear() - lcd.drawText(1, 0, "Which is the tail config on your model?", 0) - lcd.drawFilledRectangle(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-1, DOTTED, 0) - lcd.drawText(LCD_W/2-19, LCD_H-8, ">>>", 0); - if tailMode == 0 then - -- Elevator(1ch), no rudder... - lcd.drawPixmap(112, 8, "tail-e.bmp") - lcd.drawText(25, LCD_H-16, "Assign channel", 0); - lcd.drawSource(175, 30, MIXSRC_CH1+eleCH1, getFieldFlags(1)) - fieldsMax = 1 - elseif tailMode == 1 then - -- Elevator(1ch) + rudder... - lcd.drawPixmap(112, 8, "tail-er.bmp") - lcd.drawText(20, LCD_H-16, "Assign channels", 0); - lcd.drawSource(175, 30, MIXSRC_CH1+eleCH1, getFieldFlags(1)) - lcd.drawSource(175, 10, MIXSRC_CH1+rudCH1, getFieldFlags(2)) - fieldsMax = 2 - elseif tailMode == 2 then - -- Elevator(2ch) + rudder... - lcd.drawPixmap(112, 8, "tail-eer.bmp") - lcd.drawText(20, LCD_H-16, "Assign channels", 0); - lcd.drawSource(175, 30, MIXSRC_CH1+eleCH1, getFieldFlags(1)) - lcd.drawSource(175, 20, MIXSRC_CH1+eleCH2, getFieldFlags(2)) - lcd.drawSource(175, 10, MIXSRC_CH1+rudCH1, getFieldFlags(3)) - fieldsMax = 3 - else - -- V-Tail... - lcd.drawPixmap(112, 8, "tail-v.bmp") - lcd.drawText(20, LCD_H-16, "Assign channels", 0); - lcd.drawSource(175, 20, MIXSRC_CH1+eleCH1, getFieldFlags(1)) - lcd.drawSource(175, 10, MIXSRC_CH1+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 field==0 then - tailMode = fieldIncDec(event, tailMode, 3) - elseif field==1 then - eleCH1 = channelIncDec(event, eleCH1) - elseif (field==2 and tailMode==1) or field==3 then - rudCH1 = channelIncDec(event, rudCH1) - elseif field==2 then - eleCH2 = channelIncDec(event, eleCH2) - end -end - --- Servo (limits) Menu -local function drawServoMenu(limits) - lcd.clear() - lcd.drawSource(1, 0, MIXSRC_CH1+servoPage, 0) - lcd.drawText(25, 0, "servo min/max/center/direction?", 0) - lcd.drawFilledRectangle(0, 0, LCD_W, 8, GREY_DEFAULT+FILL_WHITE) - lcd.drawLine(LCD_W/2-1, 8, LCD_W/2-1, LCD_H-1, DOTTED, 0) - lcd.drawText(LCD_W/2-19, LCD_H-8, ">>>", 0); - lcd.drawPixmap(122, 8, "servo.bmp") - lcd.drawNumber(140, 35, limits.min, PREC1+getFieldFlags(0)); - lcd.drawNumber(205, 35, limits.max, PREC1+getFieldFlags(1)); - lcd.drawNumber(170, 9, limits.offset, PREC1+getFieldFlags(2)); - if limits.revert == 0 then - lcd.drawText(129, 50, "\126", getFieldFlags(3)); - else - lcd.drawText(129, 50, "\127", getFieldFlags(3)); - end - fieldsMax = 3 -end - -local function servoMenu(event) - local limits = model.getOutput(servoPage) - - if dirty then - dirty = false - drawServoMenu(limits) - end - - navigate(event, fieldsMax, page, page) - - if edit then - if field==0 then - limits.min = valueIncDec(event, limits.min, -1000, 0) - elseif field==1 then - limits.max = valueIncDec(event, limits.max, 0, 1000) - elseif field==2 then - limits.offset = valueIncDec(event, limits.offset, -1000, 1000) - elseif field==3 then - limits.revert = fieldIncDec(event, limits.revert, 1) - end - model.setOutput(servoPage, limits) - elseif event == EVT_VIRTUAL_EXIT then - servoPage = nil - dirty = true - end -end - --- Confirmation Menu -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 - y = 12 - x = 120 - end - return x, y -end - -local function drawConfirmationMenu() - local x = 22 - local y = 12 - lcd.clear() - 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, "Throttle", thrCH1) - end - if aileronsMode == 1 then - x, y = drawNextLine(x, y, "Ail", ailCH1) - elseif aileronsMode == 2 then - x, y = drawNextLine(x, y, "Ail L", ailCH1) - x, y = drawNextLine(x, y, "Ail R", ailCH2) - end - if flapsMode == 1 then - x, y = drawNextLine(x, y, "Flaps", flapsCH1) - elseif flapsMode == 2 then - x, y = drawNextLine(x, y, "Flap L", flapsCH1) - x, y = drawNextLine(x, y, "Flap R", flapsCH2) - end - if brakesMode == 1 then - x, y = drawNextLine(x, y, "Brakes", brakesCH1) - elseif brakesMode == 2 then - x, y = drawNextLine(x, y, "Brake L", brakesCH1) - x, y = drawNextLine(x, y, "Brake R", brakesCH2) - end - if tailMode == 3 then - x, y = drawNextLine(x, y, "V-Tail L", eleCH1) - x, y = drawNextLine(x, y, "V-Tail R", eleCH2) - else - x, y = drawNextLine(x, y, "Rudder", rudCH1) - if tailMode == 1 then - x, y = drawNextLine(x, y, "Elev", eleCH1) - elseif tailMode == 2 then - x, y = drawNextLine(x, y, "Elev L", eleCH1) - x, y = drawNextLine(x, y, "Elev R", eleCH2) - end - end - lcd.drawText(48, LCD_H-8, "Long [ENT] to confirm", 0); - lcd.drawFilledRectangle(0, LCD_H-9, LCD_W, 9, 0) - lcd.drawPixmap(LCD_W-18, LCD_H-17, "confirm-tick.bmp") - fieldsMax = 0 -end - -local function addMix(channel, input, name, weight, index) - local mix = { source=input, name=name } - if weight ~= nil then - mix.weight = weight - end - if index == nil then - index = 0 - end - model.insertMix(channel, index, mix) -end - -local function applySettings() - model.defaultInputs() - model.deleteMixes() - if engineMode > 0 then - addMix(thrCH1, MIXSRC_FIRST_INPUT+defaultChannel(2), "Engine") - end - if aileronsMode == 1 then - addMix(ailCH1, MIXSRC_FIRST_INPUT+defaultChannel(3), "Ail") - elseif aileronsMode == 2 then - 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, "Flaps") - elseif flapsMode == 2 then - addMix(flapsCH1, MIXSRC_SA, "FlapL") - addMix(flapsCH2, MIXSRC_SA, "FlapR") - end - if brakesMode == 1 then - addMix(brakesCH1, MIXSRC_SE, "Brakes") - elseif brakesMode == 2 then - addMix(brakesCH1, MIXSRC_SE, "BrakeL") - addMix(brakesCH2, MIXSRC_SE, "BrakeR") - 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(eleCH2, MIXSRC_FIRST_INPUT+defaultChannel(1), "V-EleR", 50) - addMix(eleCH2, MIXSRC_FIRST_INPUT+defaultChannel(0), "V-RudR", 50, 1) - else - if tailMode > 0 then - addMix(rudCH1, MIXSRC_FIRST_INPUT+defaultChannel(0), "Rudder") - end - if tailMode == 1 then - addMix(eleCH1, MIXSRC_FIRST_INPUT+defaultChannel(1), "Elev") - elseif tailMode == 2 then - addMix(eleCH1, MIXSRC_FIRST_INPUT+defaultChannel(1), "ElevL") - addMix(eleCH2, MIXSRC_FIRST_INPUT+defaultChannel(1), "ElevR") - end - end -end - -local function confirmationMenu(event) - if dirty then - dirty = false - drawConfirmationMenu() - end - - navigate(event, fieldsMax, TAIL_PAGE, page) - - if event == EVT_VIRTUAL_EXIT then - return 2 - elseif event == EVT_VIRTUAL_ENTER_LONG then - killEvents(event) - applySettings() - return 2 - else - return 0 - end -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - end - if servoPage ~= nil then - servoMenu(event) - elseif page == ENGINE_PAGE then - engineMenu(event) - elseif page == AILERONS_PAGE then - aileronsMenu(event) - elseif page == FLAPERONS_PAGE then - flapsMenu(event) - elseif page == BRAKES_PAGE then - brakesMenu(event) - elseif page == TAIL_PAGE then - tailMenu(event) - elseif page == CONFIRMATION_PAGE then - return confirmationMenu(event) - end - return 0 -end - -return { init=init, run=run } diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/quadri.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/quadri.bmp deleted file mode 100644 index 93c80ad8c..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/quadri.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/servo.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/servo.bmp deleted file mode 100644 index 92e9e2105..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/servo.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/tail-e.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/tail-e.bmp deleted file mode 100644 index 142a1252d..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/tail-e.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/tail-eer.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/tail-eer.bmp deleted file mode 100644 index 82d60c01a..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/tail-eer.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/tail-er.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/tail-er.bmp deleted file mode 100644 index c95afa795..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/tail-er.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/tail-v.bmp b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/tail-v.bmp deleted file mode 100644 index 93c4c95dd..000000000 Binary files a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/tail-v.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/wizard.lua b/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/wizard.lua deleted file mode 100644 index 7d330daae..000000000 --- a/radio/sdcard/taranis-x9/SCRIPTS/WIZARD/wizard.lua +++ /dev/null @@ -1,86 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### --- Navigation variables -local dirty = true - --- Model types -local modelType = 0 -local MODELTYPE_PLANE = 0 -local MODELTYPE_DELTA = 1 -local MODELTYPE_QUAD = 2 - --- Common functions -local function fieldIncDec(event, value, max) - if event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then - value = (value + max) - dirty = true - elseif event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then - value = (value + max + 2) - dirty = true - end - value = (value % (max+1)) - return value -end - --- Model Type Menu -local function modelTypeSurround(index) - lcd.drawRectangle(17+65*index, 14, 48, 48) - lcd.drawPixmap(22+65*index, 9, "mark.bmp") -end - -local function drawModelChoiceMenu() - lcd.clear() - lcd.drawScreenTitle("Select model type", 0, 0) - lcd.drawPixmap(21, 18, "plane.bmp") - lcd.drawPixmap(86, 18, "delta.bmp") - lcd.drawPixmap(151, 18, "quadri.bmp") - modelTypeSurround(modelType) -end - -local function modelTypeMenu(event) - if dirty == true then - drawModelChoiceMenu() - dirty = false - end - if event == EVT_VIRTUAL_ENTER then - if modelType == MODELTYPE_PLANE then - return "plane.lua" - elseif modelType == MODELTYPE_DELTA then - return "delta.lua" - elseif modelType == MODELTYPE_QUAD then - return "multi.lua" - end - dirty = true - else - modelType = fieldIncDec(event, modelType, 2) - end - return 0 -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - end - - if event == EVT_VIRTUAL_EXIT then - return 2 - end - return modelTypeMenu(event) -end - -return { run=run } diff --git a/radio/sdcard/taranis-x9/SCRIPTS/snake.lua b/radio/sdcard/taranis-x9/SCRIPTS/snake.lua deleted file mode 100644 index d3a1914bb..000000000 --- a/radio/sdcard/taranis-x9/SCRIPTS/snake.lua +++ /dev/null @@ -1,176 +0,0 @@ --------------------------------------------------------------- --- Classic snake game --- --- 2009 Led Lab @PUC-Rio www.eluaproject.net --- Dado Sutter --- Ives Negreiros --- To Benjamin ---------------------------------------------------------------- - -local xMax = math.floor( LCD_W / 6 ) - 1 -local yMax = math.floor( LCD_H / 8 ) - 1 -local game_map = {} - -local Head = {} -local Tail = {} - -local highscore = 0 -local size = 3 -Tail.x = 1 -Tail.y = 1 -Head.x = Tail.x + ( size - 1 ) -Head.y = Tail.y - -local Food = {} -Food.x = false -Food.y = false - -Head.dx = 1 -Head.dy = 0 -Tail.dx = Head.dx -Tail.dy = Head.dy -local direction = "right" -local score = 0 - -local function create_food() - Food.x, Food.y = math.random( xMax - 1), math.random( yMax - 1) - while game_map[ Food.x ][ Food.y ] do - Food.x, Food.y = math.random( xMax - 1 ), math.random( yMax - 1 ) - end - game_map[ Food.x ][ Food.y ] = "food" - lcd.drawText( Food.x * 6, Food.y * 8+2, "@", 0 ) -end - -local function eat_food() - playFile("/SCRIPTS/snake.wav") - lcd.drawText( Head.x * 6, Head.y * 8, " ", 0 ) - game_map[ Head.x ][ Head.y ] = nil - create_food() - score = score + 1 -end - -local function check_collision() - if Head.x < 0 or Head.x > xMax then - return true - elseif Head.y < 0 or Head.y > yMax then - return true - elseif ( ( game_map[ Head.x ][ Head.y ] ) and ( game_map[ Head.x ][ Head.y ] ~= "food" ) ) then - return true - end - return false -end - -local function move() - if game_map[ Tail.x ][ Tail.y ] == "right" then - Tail.dx = 1 - Tail.dy = 0 - elseif game_map[ Tail.x ][ Tail.y ] == "left" then - Tail.dx = -1 - Tail.dy = 0 - elseif game_map[ Tail.x ][ Tail.y ] == "up" then - Tail.dx = 0 - Tail.dy = -1 - elseif game_map[ Tail.x ][ Tail.y ] == "down" then - Tail.dx = 0 - Tail.dy = 1 - end - - game_map[ Head.x ][ Head.y ] = direction - Head.x = Head.x + Head.dx - Head.y = Head.y + Head.dy - - if Head.x < 0 or Head.x > xMax or Head.y < 0 or Head.y > yMax then - return - elseif game_map[ Head.x ][ Head.y ] == "food" then - eat_food() - else - lcd.drawText(Tail.x * 6, Tail.y * 8, " ", 16) - game_map[ Tail.x ][ Tail.y ] = nil - Tail.x = Tail.x + Tail.dx - Tail.y = Tail.y + Tail.dy - end - - lcd.drawText(Head.x * 6, Head.y * 8, "*", 0) -end - -local function init() - food = false - lcd.clear() - size = 3 - score = 0 - Tail.x = 1 - Tail.y = 1 - Head.x = Tail.x + ( size - 1 ) - Head.y = Tail.y - Head.dx = 1 - Head.dy = 0 - Tail.dx = Head.dx - Tail.dy = Head.dy - direction = "right" - - for i = 0, xMax, 1 do - game_map[ i ] = {} - end - - for i = 0, size - 1, 1 do - game_map[ Tail.x + ( i * Tail.dx ) ][ Tail.y + ( i * Tail.dy ) ] = direction - lcd.drawText( ( Tail.x + ( i * Tail.dx ) ) * 6, ( Tail.y + ( i * Tail.dy ) ) * 8, "*", 0 ) - end - - create_food() -end - -local snakeCounter = 0 - -local function run(event) - if event == nil then - raise("Cannot be run as a model script!") - end - - if event == EVT_VIRTUAL_EXIT then - return 2 - end - - snakeCounter = snakeCounter + 1 - if snakeCounter < 30 then - return 0 - end - - snakeCounter = 0 - - local dir = direction - if getValue('rud') > 100 and direction ~= "left" then - dir = "right" - Head.dx = 1 - Head.dy = 0 - end - if getValue('rud') < -100 and direction ~= "right" then - dir = "left" - Head.dx = -1 - Head.dy = 0 - end - if getValue('ele') > 100 and direction ~= "down" then - dir = "up" - Head.dx = 0 - Head.dy = -1 - end - if getValue('ele') < -100 and direction ~= "up" then - dir = "down" - Head.dx = 0 - Head.dy = 1 - end - - direction = dir - move() - - lcd.refresh() - - if check_collision() then - return 1 - end - - return 0 -end - -return { init=init, run=run } - diff --git a/radio/sdcard/taranis-x9/UTILITIES/MultiConfigExternal.lua b/radio/sdcard/taranis-x9/UTILITIES/MultiConfigExternal.lua deleted file mode 100644 index a8baf3d13..000000000 --- a/radio/sdcard/taranis-x9/UTILITIES/MultiConfigExternal.lua +++ /dev/null @@ -1,499 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - - ---############################################################################### --- Multi buffer for Config description --- To start operation: --- Write 0xFF at address 4 will request the buffer to be cleared --- Write "Conf" at address 0..3 --- Read --- Read at address 12 gives the current config page --- Read at address 13..172 gives the current data of the page = 8 lines * 20 caracters --- Write --- Write at address 5..11 the command --- Write 0x01 at address 4 will send the command to the module --- !! Before exiting the script must write 0 at address 0 for normal operation !! ---############################################################################### - -local Version = "v0.1" -local Focus = -1 -local Page = 0 -local Edit = -1 -local Edit_pos = 1 -local Menu = { {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""} } -local Menu_value = {} -local Blink = 0 -local Module = {} -local InitialProtocol = 0 - -function bitand(a, b) - local result = 0 - local bitval = 1 - while a > 0 and b > 0 do - if a % 2 == 1 and b % 2 == 1 then -- test the rightmost bits - result = result + bitval -- set the current bit - end - bitval = bitval * 2 -- shift left - a = math.floor(a/2) -- shift right - b = math.floor(b/2) - end - return result -end - -local function Config_Send(page, line, value) - local i - i = (page*16) + line - multiBuffer( 5, i ) - for i = 1 , 6 , 1 do - multiBuffer( 5+i, value[i] ) - end - multiBuffer( 4, 1 ) -end - -local function Config_Release() - Module.protocol = InitialProtocol - model.setModule(1, Module) - - local i - for i = 3 , 0 , -1 do - multiBuffer( i, 0 ) - end -end - -local function Config_Page( ) - Config_Send(Page, 0, { 0, 0, 0, 0, 0, 0 }) -end - -local function Config_Draw_Edit( event ) - local i - local text - - if Menu[Focus].field_type == 0xD0 then - -- Editable Hex value - if Edit == -1 then - -- Init - Edit = 0 - Edit_pos = 1 - Blink = 0 - for i = 1, Menu[Focus].field_len, 1 do - Menu_value[i] = Menu[Focus].field_value[i] - end - end - if Edit == 0 then - -- Not editing value - if event == EVT_VIRTUAL_ENTER then - if Edit_pos > Menu[Focus].field_len then - -- Save or Cancel - Edit = -1 - if Edit_pos == Menu[Focus].field_len + 1 then - -- Save - Config_Send(Page, Focus, Menu_value) - end - return - else - -- Switch to edit mode - Edit = 1 - end - elseif event == EVT_VIRTUAL_PREV and Edit_pos > 1 then - -- Move cursor - Edit_pos = Edit_pos - 1 - elseif event == EVT_VIRTUAL_NEXT and Edit_pos < Menu[Focus].field_len + 2 then - -- Move cursor - Edit_pos = Edit_pos + 1 - end - else - -- Editing value - if event == EVT_VIRTUAL_ENTER then - -- End edit - Edit = 0 - elseif event == EVT_VIRTUAL_PREV then - -- Change value - Menu_value[Edit_pos] = Menu_value[Edit_pos] - 1 - elseif event == EVT_VIRTUAL_NEXT then - -- Change value - Menu_value[Edit_pos] = Menu_value[Edit_pos] + 1 - end - --Blink - Blink = Blink + 1 - if Blink > 30 then - Blink = 0 - end - end - --Display - if LCD_W == 480 then - lcd.drawRectangle(160-1, 100-1, 160+2, 55+2, TEXT_COLOR) - lcd.drawFilledRectangle(160, 100, 160, 55, TEXT_BGCOLOR) - else - lcd.clear() - end - for i = 1, Menu[Focus].field_len, 1 do - if i==Edit_pos and (Edit ~= 1 or Blink > 15) then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(170+12*2*(i-1), 110, string.format('%02X', Menu_value[i]), attrib) - else - lcd.drawText(17+6*2*(i-1), 10, string.format('%02X', Menu_value[i]), attrib + SMLSIZE) - end - end - if Edit_pos == Menu[Focus].field_len + 1 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(170, 130, "Save", attrib) - else - lcd.drawText(17, 30, "Save", attrib + SMLSIZE) - end - if Edit_pos == Menu[Focus].field_len + 2 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(260, 130, "Cancel", attrib) - else - lcd.drawText(77, 30, "Cancel", attrib + SMLSIZE) - end - - elseif Menu[Focus].field_type == 0x90 then - -- Action text - if Edit == -1 then - -- Init - Edit = 0 - Edit_pos = 2 - end - if event == EVT_VIRTUAL_ENTER then - -- Exit - Edit = -1 - if Edit_pos == 1 then - -- Yes - Config_Send(Page, Focus, { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA } ) - end - return - elseif event == EVT_VIRTUAL_PREV and Edit_pos > 1 then - -- Switch to Yes - Edit_pos = Edit_pos - 1 - elseif event == EVT_VIRTUAL_NEXT and Edit_pos < 2 then - -- Switch to No - Edit_pos = Edit_pos + 1 - end - -- Display - if LCD_W == 480 then - lcd.drawRectangle(160-1, 100-1, 160+2, 55+2, TEXT_COLOR) - lcd.drawFilledRectangle(160, 100, 160, 55, TEXT_BGCOLOR) - else - lcd.clear() - end - if LCD_W == 480 then - lcd.drawText(170, 110, Menu[Focus].field_text .. "?") - else - lcd.drawText(17, 10, Menu[Focus].field_text .. "?", SMLSIZE) - end - if Edit_pos == 1 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(170, 130, "Yes", attrib) - else - lcd.drawText(17, 30, "Yes", attrib + SMLSIZE) - end - if Edit_pos == 2 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(260, 130, "No", attrib) - else - lcd.drawText(77, 30, "No", attrib) - end - end -end - -local function Config_Next_Prev( event ) --- Next Prev on main menu - local line - if event == EVT_VIRTUAL_PREV then - for line = Focus - 1, 1, -1 do - if Menu[line].field_type >= 0x80 and Menu[line].field_type ~= 0xA0 and Menu[line].field_type ~= 0xC0 then - Focus = line - break - end - end - elseif event == EVT_VIRTUAL_NEXT then - for line = Focus + 1, 7, 1 do - if Menu[line].field_type >= 0x80 and Menu[line].field_type ~= 0xA0 and Menu[line].field_type ~= 0xC0 then - Focus = line - break - end - end - end -end - -local function Config_Draw_Menu() --- Main menu - local i - local value - local line - local length - local text - - lcd.clear() - - if LCD_W == 480 then - --Draw title - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, "Multi Config " .. Version, MENU_TITLE_COLOR) - if multiBuffer(13) == 0x00 then - lcd.drawText(10,50,"No Config telemetry...", BLINK) - end - else - --Draw on LCD_W=128 - lcd.drawText(1, 0, "Multi Config " .. Version, SMLSIZE) - if multiBuffer(13) == 0x00 then - lcd.drawText(2,17,"No Config telemetry...",SMLSIZE) - end - end - - if multiBuffer(13) ~= 0x00 then - if LCD_W == 480 then - --Draw firmware version and channels order - local ch_order = multiBuffer(17) - local channel_names = {} - channel_names[bitand(ch_order,3)+1] = "A" - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = "E" - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = "T" - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = "R" - lcd.drawText(150, 5, "Firmware v" .. multiBuffer(13) .. "." .. multiBuffer(14) .. "." .. multiBuffer(15) .. "." .. multiBuffer(16), MENU_TITLE_COLOR) - --lcd.drawText(150, 5, "Firmware v" .. multiBuffer(13) .. "." .. multiBuffer(14) .. "." .. multiBuffer(15) .. "." .. multiBuffer(16) .. " " .. channel_names[1] .. channel_names[2] .. channel_names[3] .. channel_names[4], MENU_TITLE_COLOR) - else - lcd.drawText(76, 0, "/Fw" .. multiBuffer(13) .. "." .. multiBuffer(14) .. "." .. multiBuffer(15) .. "." .. multiBuffer(16),SMLSIZE) -- .. " " .. channel_names[1] .. channel_names[2] .. channel_names[3] .. channel_names[4]) - end - - --Draw Menu - for line = 1, 7, 1 do - --Clear line info - Menu[line].text = "" - Menu[line].field_type = 0 - Menu[line].field_len = 0 - for i = 1, 7, 1 do - Menu[line].field_value[i] = 0 - end - Menu[line].field_text = "" - length = 0 - --Read line from buffer - for i = 0, 20-1, 1 do - value=multiBuffer( line*20+13+i ) - if value == 0 then - break -- end of line - end - if value > 0x80 and Menu[line].field_type == 0 then - -- Read field type - Menu[line].field_type = bitand(value, 0xF0) - Menu[line].field_len = bitand(value, 0x0F) - length = Menu[line].field_len - if Menu[line].field_type ~= 0xA0 and Menu[line].field_type ~= 0xC0 and Focus == -1 then - -- First actionnable field if nothing was selected - Focus = line; - end - else - if Menu[line].field_type == 0 then - -- Text - Menu[line].text = Menu[line].text .. string.char(value) - else - -- Menu specific fields - length = length - 1 - if Menu[line].field_type == 0x80 or Menu[line].field_type == 0x90 then - Menu[line].field_text = Menu[line].field_text .. string.char(value) - else - Menu[line].field_value[Menu[line].field_len-length] = value - end - if length == 0 then - -- End of fields - break - end - end - end - end - -- Display menu text - if Menu[line].text ~= "" then - if Menu[line].field_type == 0xA0 or Menu[line].field_type == 0xB0 or Menu[line].field_type == 0xC0 or Menu[line].field_type == 0xD0 then - Menu[line].text = Menu[line].text .. ":" - end - if LCD_W == 480 then - lcd.drawText(10,32+20*line,Menu[line].text ) - else - lcd.drawText(2,1+8*line,Menu[line].text,SMLSIZE) - end - end - -- Display specific fields - if line == Focus then - attrib = INVERS - else - attrib = 0 - end - if Menu[line].field_type == 0x80 or Menu[line].field_type == 0x90 then - -- Text - if LCD_W == 480 then - lcd.drawText(10+9*#Menu[line].text, 32+20*line, Menu[line].field_text, attrib) - else - lcd.drawText(2+5*#Menu[line].text, 1+8*line, Menu[line].field_text, SMLSIZE + attrib) - end - elseif Menu[line].field_type == 0xA0 or Menu[line].field_type == 0xB0 then - -- Decimal value - value = 0 - for i = 1, Menu[line].field_len, 1 do - value = value*256 + value - end - if LCD_W == 480 then - lcd.drawText(10+9*#Menu[line].text, 32+20*line, value, attrib) - else - lcd.drawText(2+5*#Menu[line].text, 1+8*line, value, SMLSIZE + attrib) - end - elseif Menu[line].field_type == 0xC0 or Menu[line].field_type == 0xD0 then - -- Hex value - text="" - for i = 1, Menu[line].field_len, 1 do - text = text .. string.format('%02X ', Menu[line].field_value[i]) - end - if LCD_W == 480 then - lcd.drawText(10+9*#Menu[line].text, 32+20*line, text, attrib) - else - lcd.drawText(2+5*#Menu[line].text, 1+8*line, text, SMLSIZE + attrib) - end - end - end - end -end - --- Init -local function Config_Init() - --get Module settings and set to config - Module = model.getModule(1) - InitialProtocol = Module.protocol - Module.protocol = 86 - model.setModule(1, Module) - for i = 0, 10, 1 do end - --Set protocol to talk to - multiBuffer( 0, string.byte('C') ) - --test if value has been written - if multiBuffer( 0 ) ~= string.byte('C') then - error("Not enough memory!") - return 2 - end - --Request init of the buffer - multiBuffer( 4, 0xFF ) - --Continue buffer init - multiBuffer( 1, string.byte('o') ) - multiBuffer( 2, string.byte('n') ) - multiBuffer( 3, string.byte('f') ) - - -- Test set - -- multiBuffer( 12, 0 ) - -- multiBuffer( 13, 1 ) - -- multiBuffer( 14, 3 ) - -- multiBuffer( 15, 2 ) - -- multiBuffer( 16, 62 ) - -- multiBuffer( 17, 0 + 1*4 + 2*16 + 3*64) - - -- multiBuffer( 33, string.byte('G') ) - -- multiBuffer( 34, string.byte('l') ) - -- multiBuffer( 35, string.byte('o') ) - -- multiBuffer( 36, string.byte('b') ) - -- multiBuffer( 37, string.byte('a') ) - -- multiBuffer( 38, string.byte('l') ) - -- multiBuffer( 39, string.byte(' ') ) - -- multiBuffer( 40, string.byte('I') ) - -- multiBuffer( 41, string.byte('D') ) - -- multiBuffer( 42, 0xD0 + 4 ) - -- multiBuffer( 43, 0x12 ) - -- multiBuffer( 44, 0x34 ) - -- multiBuffer( 45, 0x56 ) - -- multiBuffer( 46, 0x78 ) - -- multiBuffer( 47, 0x9A ) - -- multiBuffer( 48, 0xBC ) - - -- multiBuffer( 53, 0x90 + 9 ) - -- multiBuffer( 54, string.byte('R') ) - -- multiBuffer( 55, string.byte('e') ) - -- multiBuffer( 56, string.byte('s') ) - -- multiBuffer( 57, string.byte('e') ) - -- multiBuffer( 58, string.byte('t') ) - -- multiBuffer( 59, string.byte(' ') ) - -- multiBuffer( 60, string.byte('G') ) - -- multiBuffer( 61, string.byte('I') ) - -- multiBuffer( 62, string.byte('D') ) - -- multiBuffer( 63, 0x00 ) -end - --- Main -local function Config_Run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_EXIT then - Config_Release() - return 2 - else - Config_Draw_Menu() - if ( event == EVT_VIRTUAL_PREV_PAGE or event == EVT_VIRTUAL_NEXT_PAGE ) and Edit < 1 then - -- Not editing, ok to change page - if event == EVT_VIRTUAL_PREV_PAGE then - killEvents(event) - if Page > 0 then - --Page = Page - 1 - --Config_Page() - end - else - --Page = Page + 1 - --Config_Page() - end - end - if Focus > 0 then - -- At least one line has an action - if Edit >= 0 then - -- Currently editing - Config_Draw_Edit( event ) - elseif event == EVT_VIRTUAL_ENTER then - -- Switch to edit - Config_Draw_Edit( 0 ) - elseif event == EVT_VIRTUAL_PREV or event == EVT_VIRTUAL_NEXT then - -- Main menu selection - Config_Next_Prev( event ) - end - end - return 0 - end -end - -return { init=Config_Init, run=Config_Run } diff --git a/radio/sdcard/taranis-x9/UTILITIES/MultiConfigInternal.lua b/radio/sdcard/taranis-x9/UTILITIES/MultiConfigInternal.lua deleted file mode 100644 index 29ced006c..000000000 --- a/radio/sdcard/taranis-x9/UTILITIES/MultiConfigInternal.lua +++ /dev/null @@ -1,499 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### - - ---############################################################################### --- Multi buffer for Config description --- To start operation: --- Write 0xFF at address 4 will request the buffer to be cleared --- Write "Conf" at address 0..3 --- Read --- Read at address 12 gives the current config page --- Read at address 13..172 gives the current data of the page = 8 lines * 20 caracters --- Write --- Write at address 5..11 the command --- Write 0x01 at address 4 will send the command to the module --- !! Before exiting the script must write 0 at address 0 for normal operation !! ---############################################################################### - -local Version = "v0.1" -local Focus = -1 -local Page = 0 -local Edit = -1 -local Edit_pos = 1 -local Menu = { {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""}, - {text = "", field_type = 0, field_len = 0, field_value = {}, field_text = ""} } -local Menu_value = {} -local Blink = 0 -local Module = {} -local InitialProtocol = 0 - -function bitand(a, b) - local result = 0 - local bitval = 1 - while a > 0 and b > 0 do - if a % 2 == 1 and b % 2 == 1 then -- test the rightmost bits - result = result + bitval -- set the current bit - end - bitval = bitval * 2 -- shift left - a = math.floor(a/2) -- shift right - b = math.floor(b/2) - end - return result -end - -local function Config_Send(page, line, value) - local i - i = (page*16) + line - multiBuffer( 5, i ) - for i = 1 , 6 , 1 do - multiBuffer( 5+i, value[i] ) - end - multiBuffer( 4, 1 ) -end - -local function Config_Release() - Module.protocol = InitialProtocol - model.setModule(0, Module) - - local i - for i = 3 , 0 , -1 do - multiBuffer( i, 0 ) - end -end - -local function Config_Page( ) - Config_Send(Page, 0, { 0, 0, 0, 0, 0, 0 }) -end - -local function Config_Draw_Edit( event ) - local i - local text - - if Menu[Focus].field_type == 0xD0 then - -- Editable Hex value - if Edit == -1 then - -- Init - Edit = 0 - Edit_pos = 1 - Blink = 0 - for i = 1, Menu[Focus].field_len, 1 do - Menu_value[i] = Menu[Focus].field_value[i] - end - end - if Edit == 0 then - -- Not editing value - if event == EVT_VIRTUAL_ENTER then - if Edit_pos > Menu[Focus].field_len then - -- Save or Cancel - Edit = -1 - if Edit_pos == Menu[Focus].field_len + 1 then - -- Save - Config_Send(Page, Focus, Menu_value) - end - return - else - -- Switch to edit mode - Edit = 1 - end - elseif event == EVT_VIRTUAL_PREV and Edit_pos > 1 then - -- Move cursor - Edit_pos = Edit_pos - 1 - elseif event == EVT_VIRTUAL_NEXT and Edit_pos < Menu[Focus].field_len + 2 then - -- Move cursor - Edit_pos = Edit_pos + 1 - end - else - -- Editing value - if event == EVT_VIRTUAL_ENTER then - -- End edit - Edit = 0 - elseif event == EVT_VIRTUAL_PREV then - -- Change value - Menu_value[Edit_pos] = Menu_value[Edit_pos] - 1 - elseif event == EVT_VIRTUAL_NEXT then - -- Change value - Menu_value[Edit_pos] = Menu_value[Edit_pos] + 1 - end - --Blink - Blink = Blink + 1 - if Blink > 30 then - Blink = 0 - end - end - --Display - if LCD_W == 480 then - lcd.drawRectangle(160-1, 100-1, 160+2, 55+2, TEXT_COLOR) - lcd.drawFilledRectangle(160, 100, 160, 55, TEXT_BGCOLOR) - else - lcd.clear() - end - for i = 1, Menu[Focus].field_len, 1 do - if i==Edit_pos and (Edit ~= 1 or Blink > 15) then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(170+12*2*(i-1), 110, string.format('%02X', Menu_value[i]), attrib) - else - lcd.drawText(17+6*2*(i-1), 10, string.format('%02X', Menu_value[i]), attrib + SMLSIZE) - end - end - if Edit_pos == Menu[Focus].field_len + 1 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(170, 130, "Save", attrib) - else - lcd.drawText(17, 30, "Save", attrib + SMLSIZE) - end - if Edit_pos == Menu[Focus].field_len + 2 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(260, 130, "Cancel", attrib) - else - lcd.drawText(77, 30, "Cancel", attrib + SMLSIZE) - end - - elseif Menu[Focus].field_type == 0x90 then - -- Action text - if Edit == -1 then - -- Init - Edit = 0 - Edit_pos = 2 - end - if event == EVT_VIRTUAL_ENTER then - -- Exit - Edit = -1 - if Edit_pos == 1 then - -- Yes - Config_Send(Page, Focus, { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA } ) - end - return - elseif event == EVT_VIRTUAL_PREV and Edit_pos > 1 then - -- Switch to Yes - Edit_pos = Edit_pos - 1 - elseif event == EVT_VIRTUAL_NEXT and Edit_pos < 2 then - -- Switch to No - Edit_pos = Edit_pos + 1 - end - -- Display - if LCD_W == 480 then - lcd.drawRectangle(160-1, 100-1, 160+2, 55+2, TEXT_COLOR) - lcd.drawFilledRectangle(160, 100, 160, 55, TEXT_BGCOLOR) - else - lcd.clear() - end - if LCD_W == 480 then - lcd.drawText(170, 110, Menu[Focus].field_text .. "?") - else - lcd.drawText(17, 10, Menu[Focus].field_text .. "?", SMLSIZE) - end - if Edit_pos == 1 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(170, 130, "Yes", attrib) - else - lcd.drawText(17, 30, "Yes", attrib + SMLSIZE) - end - if Edit_pos == 2 then - attrib = INVERS - else - attrib = 0 - end - if LCD_W == 480 then - lcd.drawText(260, 130, "No", attrib) - else - lcd.drawText(77, 30, "No", attrib) - end - end -end - -local function Config_Next_Prev( event ) --- Next Prev on main menu - local line - if event == EVT_VIRTUAL_PREV then - for line = Focus - 1, 1, -1 do - if Menu[line].field_type >= 0x80 and Menu[line].field_type ~= 0xA0 and Menu[line].field_type ~= 0xC0 then - Focus = line - break - end - end - elseif event == EVT_VIRTUAL_NEXT then - for line = Focus + 1, 7, 1 do - if Menu[line].field_type >= 0x80 and Menu[line].field_type ~= 0xA0 and Menu[line].field_type ~= 0xC0 then - Focus = line - break - end - end - end -end - -local function Config_Draw_Menu() --- Main menu - local i - local value - local line - local length - local text - - lcd.clear() - - if LCD_W == 480 then - --Draw title - lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR) - lcd.drawText(1, 5, "Multi Config " .. Version, MENU_TITLE_COLOR) - if multiBuffer(13) == 0x00 then - lcd.drawText(10,50,"No Config telemetry...", BLINK) - end - else - --Draw on LCD_W=128 - lcd.drawText(1, 0, "Multi Config " .. Version, SMLSIZE) - if multiBuffer(13) == 0x00 then - lcd.drawText(2,17,"No Config telemetry...",SMLSIZE) - end - end - - if multiBuffer(13) ~= 0x00 then - if LCD_W == 480 then - --Draw firmware version and channels order - local ch_order = multiBuffer(17) - local channel_names = {} - channel_names[bitand(ch_order,3)+1] = "A" - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = "E" - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = "T" - ch_order = math.floor(ch_order/4) - channel_names[bitand(ch_order,3)+1] = "R" - lcd.drawText(150, 5, "Firmware v" .. multiBuffer(13) .. "." .. multiBuffer(14) .. "." .. multiBuffer(15) .. "." .. multiBuffer(16), MENU_TITLE_COLOR) - --lcd.drawText(150, 5, "Firmware v" .. multiBuffer(13) .. "." .. multiBuffer(14) .. "." .. multiBuffer(15) .. "." .. multiBuffer(16) .. " " .. channel_names[1] .. channel_names[2] .. channel_names[3] .. channel_names[4], MENU_TITLE_COLOR) - else - lcd.drawText(76, 0, "/Fw" .. multiBuffer(13) .. "." .. multiBuffer(14) .. "." .. multiBuffer(15) .. "." .. multiBuffer(16),SMLSIZE) -- .. " " .. channel_names[1] .. channel_names[2] .. channel_names[3] .. channel_names[4]) - end - - --Draw Menu - for line = 1, 7, 1 do - --Clear line info - Menu[line].text = "" - Menu[line].field_type = 0 - Menu[line].field_len = 0 - for i = 1, 7, 1 do - Menu[line].field_value[i] = 0 - end - Menu[line].field_text = "" - length = 0 - --Read line from buffer - for i = 0, 20-1, 1 do - value=multiBuffer( line*20+13+i ) - if value == 0 then - break -- end of line - end - if value > 0x80 and Menu[line].field_type == 0 then - -- Read field type - Menu[line].field_type = bitand(value, 0xF0) - Menu[line].field_len = bitand(value, 0x0F) - length = Menu[line].field_len - if Menu[line].field_type ~= 0xA0 and Menu[line].field_type ~= 0xC0 and Focus == -1 then - -- First actionnable field if nothing was selected - Focus = line; - end - else - if Menu[line].field_type == 0 then - -- Text - Menu[line].text = Menu[line].text .. string.char(value) - else - -- Menu specific fields - length = length - 1 - if Menu[line].field_type == 0x80 or Menu[line].field_type == 0x90 then - Menu[line].field_text = Menu[line].field_text .. string.char(value) - else - Menu[line].field_value[Menu[line].field_len-length] = value - end - if length == 0 then - -- End of fields - break - end - end - end - end - -- Display menu text - if Menu[line].text ~= "" then - if Menu[line].field_type == 0xA0 or Menu[line].field_type == 0xB0 or Menu[line].field_type == 0xC0 or Menu[line].field_type == 0xD0 then - Menu[line].text = Menu[line].text .. ":" - end - if LCD_W == 480 then - lcd.drawText(10,32+20*line,Menu[line].text ) - else - lcd.drawText(2,1+8*line,Menu[line].text,SMLSIZE) - end - end - -- Display specific fields - if line == Focus then - attrib = INVERS - else - attrib = 0 - end - if Menu[line].field_type == 0x80 or Menu[line].field_type == 0x90 then - -- Text - if LCD_W == 480 then - lcd.drawText(10+9*#Menu[line].text, 32+20*line, Menu[line].field_text, attrib) - else - lcd.drawText(2+5*#Menu[line].text, 1+8*line, Menu[line].field_text, SMLSIZE + attrib) - end - elseif Menu[line].field_type == 0xA0 or Menu[line].field_type == 0xB0 then - -- Decimal value - value = 0 - for i = 1, Menu[line].field_len, 1 do - value = value*256 + value - end - if LCD_W == 480 then - lcd.drawText(10+9*#Menu[line].text, 32+20*line, value, attrib) - else - lcd.drawText(2+5*#Menu[line].text, 1+8*line, value, SMLSIZE + attrib) - end - elseif Menu[line].field_type == 0xC0 or Menu[line].field_type == 0xD0 then - -- Hex value - text="" - for i = 1, Menu[line].field_len, 1 do - text = text .. string.format('%02X ', Menu[line].field_value[i]) - end - if LCD_W == 480 then - lcd.drawText(10+9*#Menu[line].text, 32+20*line, text, attrib) - else - lcd.drawText(2+5*#Menu[line].text, 1+8*line, text, SMLSIZE + attrib) - end - end - end - end -end - --- Init -local function Config_Init() - --get Module settings and set to config - Module = model.getModule(0) - InitialProtocol = Module.protocol - Module.protocol = 86 - model.setModule(0, Module) - for i = 0, 10, 1 do end - --Set protocol to talk to - multiBuffer( 0, string.byte('C') ) - --test if value has been written - if multiBuffer( 0 ) ~= string.byte('C') then - error("Not enough memory!") - return 2 - end - --Request init of the buffer - multiBuffer( 4, 0xFF ) - --Continue buffer init - multiBuffer( 1, string.byte('o') ) - multiBuffer( 2, string.byte('n') ) - multiBuffer( 3, string.byte('f') ) - - -- Test set - -- multiBuffer( 12, 0 ) - -- multiBuffer( 13, 1 ) - -- multiBuffer( 14, 3 ) - -- multiBuffer( 15, 2 ) - -- multiBuffer( 16, 62 ) - -- multiBuffer( 17, 0 + 1*4 + 2*16 + 3*64) - - -- multiBuffer( 33, string.byte('G') ) - -- multiBuffer( 34, string.byte('l') ) - -- multiBuffer( 35, string.byte('o') ) - -- multiBuffer( 36, string.byte('b') ) - -- multiBuffer( 37, string.byte('a') ) - -- multiBuffer( 38, string.byte('l') ) - -- multiBuffer( 39, string.byte(' ') ) - -- multiBuffer( 40, string.byte('I') ) - -- multiBuffer( 41, string.byte('D') ) - -- multiBuffer( 42, 0xD0 + 4 ) - -- multiBuffer( 43, 0x12 ) - -- multiBuffer( 44, 0x34 ) - -- multiBuffer( 45, 0x56 ) - -- multiBuffer( 46, 0x78 ) - -- multiBuffer( 47, 0x9A ) - -- multiBuffer( 48, 0xBC ) - - -- multiBuffer( 53, 0x90 + 9 ) - -- multiBuffer( 54, string.byte('R') ) - -- multiBuffer( 55, string.byte('e') ) - -- multiBuffer( 56, string.byte('s') ) - -- multiBuffer( 57, string.byte('e') ) - -- multiBuffer( 58, string.byte('t') ) - -- multiBuffer( 59, string.byte(' ') ) - -- multiBuffer( 60, string.byte('G') ) - -- multiBuffer( 61, string.byte('I') ) - -- multiBuffer( 62, string.byte('D') ) - -- multiBuffer( 63, 0x00 ) -end - --- Main -local function Config_Run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_EXIT then - Config_Release() - return 2 - else - Config_Draw_Menu() - if ( event == EVT_VIRTUAL_PREV_PAGE or event == EVT_VIRTUAL_NEXT_PAGE ) and Edit < 1 then - -- Not editing, ok to change page - if event == EVT_VIRTUAL_PREV_PAGE then - killEvents(event) - if Page > 0 then - --Page = Page - 1 - --Config_Page() - end - else - --Page = Page + 1 - --Config_Page() - end - end - if Focus > 0 then - -- At least one line has an action - if Edit >= 0 then - -- Currently editing - Config_Draw_Edit( event ) - elseif event == EVT_VIRTUAL_ENTER then - -- Switch to edit - Config_Draw_Edit( 0 ) - elseif event == EVT_VIRTUAL_PREV or event == EVT_VIRTUAL_NEXT then - -- Main menu selection - Config_Next_Prev( event ) - end - end - return 0 - end -end - -return { init=Config_Init, run=Config_Run } diff --git a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/SxR_Calibrate.lua b/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/SxR_Calibrate.lua deleted file mode 100644 index a9c636f30..000000000 --- a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/SxR_Calibrate.lua +++ /dev/null @@ -1,277 +0,0 @@ ----- ######################################################################### ----- # # ----- # Copyright (C) OpenTX # ------# # ----- # License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html # ----- # # ----- # This program is free software; you can redistribute it and/or modify # ----- # it under the terms of the GNU General Public License version 2 as # ----- # published by the Free Software Foundation. # ----- # # ----- # This program is distributed in the hope that it will be useful # ----- # but WITHOUT ANY WARRANTY; without even the implied warranty of # ----- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # ----- # GNU General Public License for more details. # ----- # # ----- ######################################################################### -local VALUE = 0 -local COMBO = 1 - -local COLUMN_2 = 150 - -local edit = false -local page = 1 -local current = 1 -local refreshState = 0 -local refreshIndex = 0 -local calibrationState = 0 -local pageOffset = 0 -local calibrationStep = 0 -local pages = {} -local fields = {} -local modifications = {} - -local calibrationFields = { - {"X:", VALUE, 0x9E, 0, -100, 100, "%"}, - {"Y:", VALUE, 0x9F, 0, -100, 100, "%"}, - {"Z:", VALUE, 0xA0, 0, -100, 100, "%"} -} - -local function drawProgressBar() - local width = (140 * refreshIndex) / #fields - lcd.drawRectangle(30, 1, 144, 6) - lcd.drawFilledRectangle(32, 3, width, 2); -end - --- Select the next or previous page -local function selectPage(step) - page = 1 + ((page + step - 1 + #pages) % #pages) - refreshIndex = 0 - calibrationStep = 0 - pageOffset = 0 -end - --- Draw initial warning page -local function runWarningPage(event) - lcd.clear() - lcd.drawScreenTitle("SxR", page, #pages) - lcd.drawText(0, 10, "Warning: this will start SxR calibration", SMLSIZE) - lcd.drawText(0, 20, "This need to be run only once. You need a SxR,", SMLSIZE) - lcd.drawText(0, 30, "power supply and a flat level surface (desk,...)", SMLSIZE) - lcd.drawText(0, 40, "Press [Enter] when ready", SMLSIZE) - lcd.drawText(0, 50, "Press [Exit] when cancel", SMLSIZE) - if event == EVT_VIRTUAL_ENTER then - selectPage(1) - return 0 - elseif event == EVT_VIRTUAL_EXIT then - return 2 - end - return 0 -end - --- Redraw the current page -local function redrawFieldsPage() - lcd.clear() - lcd.drawScreenTitle("SxR", page, #pages) - - if refreshIndex < #fields then - drawProgressBar() - end - - for index = 1, 7, 1 do - local field = fields[pageOffset+index] - if field == nil then - break - end - - local attr = current == (pageOffset+index) and ((edit == true and BLINK or 0) + INVERS) or 0 - - lcd.drawText(0, 1+8*index, field[1]) - - if field[4] == nil then - lcd.drawText(COLUMN_2, 1+8*index, "---", attr) - else - if field[2] == VALUE then - lcd.drawNumber(COLUMN_2, 1+8*index, field[4], LEFT + attr) - elseif field[2] == COMBO then - if field[4] >= 0 and field[4] < #(field[5]) then - lcd.drawText(COLUMN_2, 1+8*index, field[5][1+field[4]], attr) - end - end - end - end -end - -local function telemetryRead(field) - return sportTelemetryPush(0x17, 0x30, 0x0C30, field) -end - -local function telemetryWrite(field, value) - return sportTelemetryPush(0x17, 0x31, 0x0C30, field + value*256) -end - -local telemetryPopTimeout = 0 -local function refreshNext() - if refreshState == 0 then - if calibrationState == 1 then - if telemetryWrite(0x9D, calibrationStep) == true then - refreshState = 1 - calibrationState = 2 - telemetryPopTimeout = getTime() + 80 -- normal delay is 500ms - end - elseif #modifications > 0 then - telemetryWrite(modifications[1][1], modifications[1][2]) - modifications[1] = nil - elseif refreshIndex < #fields then - local field = fields[refreshIndex + 1] - if telemetryRead(field[3]) == true then - refreshState = 1 - telemetryPopTimeout = getTime() + 80 -- normal delay is 500ms - end - end - elseif refreshState == 1 then - local physicalId, primId, dataId, value = sportTelemetryPop() - if physicalId == 0x1A and primId == 0x32 and dataId == 0x0C30 then - local fieldId = value % 256 - if calibrationState == 2 then - if fieldId == 0x9D then - refreshState = 0 - calibrationState = 0 - calibrationStep = (calibrationStep + 1) % 7 - end - else - local field = fields[refreshIndex + 1] - if fieldId == field[3] then - local value = math.floor(value / 256) - value = bit32.band(value, 0xffff) - if field[3] >= 0x9E and field[3] <= 0xA0 then - local b1 = value % 256 - local b2 = math.floor(value / 256) - value = b1*256 + b2 - value = value - bit32.band(value, 0x8000) * 2 - end - if field[2] == COMBO and #field == 6 then - for index = 1, #(field[6]), 1 do - if value == field[6][index] then - value = index - 1 - break - end - end - elseif field[2] == VALUE and #field == 8 then - value = value - field[8] + field[5] - end - fields[refreshIndex + 1][4] = value - refreshIndex = refreshIndex + 1 - refreshState = 0 - end - end - elseif getTime() > telemetryPopTimeout then - refreshState = 0 - calibrationState = 0 - end - end -end - -local function updateField(field) - local value = field[4] - if field[2] == COMBO and #field == 6 then - value = field[6][1+value] - elseif field[2] == VALUE and #field == 8 then - value = value + field[8] - field[5] - end - modifications[#modifications+1] = { field[3], value } -end - --- Main -local function runFieldsPage(event) - if event == EVT_VIRTUAL_EXIT then -- exit script - return 2 - elseif event == EVT_VIRTUAL_ENTER then -- toggle editing/selecting current field - if fields[current][4] ~= nil then - edit = not edit - if edit == false then - updateField(fields[current]) - end - end - elseif edit then - if event == EVT_VIRTUAL_NEXT or event == EVT_VIRTUAL_NEXT_REP then - addField(1) - elseif event == EVT_VIRTUAL_PREV or event == EVT_VIRTUAL_PREV_REP then - addField(-1) - end - else - if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REP then - selectField(1) - elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REP then - selectField(-1) - end - end - redrawFieldsPage() - return 0 -end - -local calibrationPositionsBitmaps = { "bmp/up.bmp", "bmp/down.bmp", "bmp/left.bmp", "bmp/right.bmp", "bmp/forward.bmp", "bmp/back.bmp" } - -local function runCalibrationPage(event) - fields = calibrationFields - if refreshIndex == #fields then - refreshIndex = 0 - end - lcd.clear() - lcd.drawScreenTitle("SxR", page, #pages) - if(calibrationStep < 6) then - lcd.drawText(0, 9, "Turn the SxR as shown", 0) - lcd.drawPixmap(10, 19, calibrationPositionsBitmaps[1 + calibrationStep]) - for index = 1, 3, 1 do - local field = fields[index] - lcd.drawText(80, 12+10*index, field[1], 0) - lcd.drawNumber(90, 12+10*index, field[4]/10, LEFT+PREC2) - end - - local attr = calibrationState == 0 and INVERS or 0 - lcd.drawText(0, 56, "Press [Enter] when ready", attr) - else - lcd.drawText(0, 9, "Calibration completed", 0) - lcd.drawPixmap(10, 19, "bmp/done.bmp") - lcd.drawText(0, 56, "Press [Exit] when ready", attr) - end - if calibrationStep > 6 and (event == EVT_VIRTUAL_ENTER or event == EVT_VIRTUAL_EXIT) then - return 2 - elseif event == EVT_VIRTUAL_ENTER then - calibrationState = 1 - elseif event == EVT_VIRTUAL_EXIT then - if calibrationStep > 0 then - calibrationStep = 0 - end - end - return 0 -end - --- Init -local function init() - current, edit, refreshState, refreshIndex = 1, false, 0, 0 - pages = { - runWarningPage, - runCalibrationPage - } -end - --- Main -local function run(event) - if event == nil then - error("Cannot be run as a model script!") - return 2 - elseif event == EVT_VIRTUAL_NEXT_PAGE then - selectPage(1) - elseif event == EVT_VIRTUAL_PREV_PAGE then - killEvents(event); - selectPage(-1) - end - - local result = pages[page](event) - refreshNext() - - return result -end - -return { init=init, run=run } diff --git a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/back.bmp b/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/back.bmp deleted file mode 100644 index a8996262c..000000000 Binary files a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/back.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/delta.bmp b/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/delta.bmp deleted file mode 100644 index ab94279c1..000000000 Binary files a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/delta.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/done.bmp b/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/done.bmp deleted file mode 100644 index 9ac501398..000000000 Binary files a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/done.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/down.bmp b/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/down.bmp deleted file mode 100644 index 97f9105ac..000000000 Binary files a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/down.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/forward.bmp b/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/forward.bmp deleted file mode 100644 index df769aef2..000000000 Binary files a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/forward.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/horz-r.bmp b/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/horz-r.bmp deleted file mode 100644 index 93ffdb0fc..000000000 Binary files a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/horz-r.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/horz.bmp b/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/horz.bmp deleted file mode 100644 index 4295e8475..000000000 Binary files a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/horz.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/left.bmp b/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/left.bmp deleted file mode 100644 index 8cc811fd1..000000000 Binary files a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/left.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/plane.bmp b/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/plane.bmp deleted file mode 100644 index b3e61bf5f..000000000 Binary files a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/plane.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/right.bmp b/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/right.bmp deleted file mode 100644 index 5fd52d475..000000000 Binary files a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/right.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/up.bmp b/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/up.bmp deleted file mode 100644 index dcffc4186..000000000 Binary files a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/up.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/vert-r.bmp b/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/vert-r.bmp deleted file mode 100644 index 763409ec4..000000000 Binary files a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/vert-r.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/vert.bmp b/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/vert.bmp deleted file mode 100644 index 5f1b91f05..000000000 Binary files a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/vert.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/vtail.bmp b/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/vtail.bmp deleted file mode 100644 index 6c7ec0b56..000000000 Binary files a/radio/sdcard/taranis-x9/UTILITIES/SxR Calibrate/bmp/vtail.bmp and /dev/null differ diff --git a/radio/sdcard/taranis-x9/edgetx.sdcard.version b/radio/sdcard/taranis-x9/edgetx.sdcard.version deleted file mode 100644 index a921c3b61..000000000 --- a/radio/sdcard/taranis-x9/edgetx.sdcard.version +++ /dev/null @@ -1 +0,0 @@ -2.4V0037