From 01aef0a822410ce6c2fdbf4271bc86e4ac388721 Mon Sep 17 00:00:00 2001 From: Frankie Arzu <32604366+frankiearzu@users.noreply.github.com> Date: Tue, 20 Dec 2022 03:12:34 -0600 Subject: [PATCH] Frankie dsm fwrd prg enhancements (#785) * #751 DSM Enhancements #751 DSM Forward Programming Enhancements (New GUI, etc) * Make both work on EdgeTx and OpenTX * #751 Turn OFF simulation by default Distribution code with RX simulation OFF Simulation should be only for Development * #751 Update Readme Documentation Updated the Readme.txt documentation and removed compiled luac file that was check in by mistake * #751 Fix problems With Reset RX 1. Fix problem when trying to Factory Reset. Enter Bind Mode. Save backup, Restore Backup 2. Found a way to advance on the Gyro initial Setup menus.. a bit of a hack, but works. 3. Handle RX resets properly. It needed after initial setup * #751 Cosmetic and Show Orientation Images #751 1. Fix problems when text contradictions between Menu/Line Headers and List Values 2. Show Images of RX orientations 3. Able to Hack getting into Initial Setup and other menus who was failing before 4. Custumize the way Flight Mode reports the Value on Screen * #751 add check for required libraries Add check that the required files in DSMLIB exist * #751 Write documentation about the protocol so that we don't forget later what we know, and enable others to understand the logs and maybe help solve problems. * #766 Change the way to detect that the files exist. now works on both ETX and OTX * #766 Strange Flickering in OTX Strange Flickering happening on OTX. Refreshing the screen on every cycle fixed the problem * #766 Change way of dectecting EdgeTX Change way of detecting OTX in multiple versions: OTX 2.3.14 and 2.3.15 * #766 make editable Gain Values Gains and other settings should be editable even when they are VALUE_NOCHANGING. Flight Mode is an exception that is handled properly. Right align numbers. * #766 More enhacements Added AR630 Make numbers right justified Cleanup some log messages and line types. Updated DSM FWD prog documentation * #751 more cosmetic things 1. Added AR10360T, 2. Simplify way to configured the hack for more receivers. 3. Change some texts on menus to march spektrum 4. Background color in Spektrum theme to match * #751 A few final changes 1. Update channel names to include channel number. i.e: Ch5 (Gear) 2, Fix flight mode display for Heli Receiver 3. i think the unknown lines are to request info about the TX settings * #751 1. Added Warning Screen 2. Correct handling of Unknown lines in Gyro Settings->Initial Setup * #751 New v0.51 version. - Added new menus to configure Model/Wing type. Without it, the initial setup will not work properly. * #751 More fixes on mixers and servo reverse -- Fix problem reversing servos when using vtail/delta mix -- Properly detect ch order of multimodule Co-authored-by: pascallanger --- Lua_scripts/DSM FwdPrg_05_BW.lua | 5 +- Lua_scripts/DSM FwdPrg_05_Color.lua | 4 +- Lua_scripts/DSMLIB/DsmFwPrgLib.lua | 61 ++++++++++++++++-- Lua_scripts/DSMLIB/DsmSetupLib.lua | 96 +++++++++++++++++++---------- Lua_scripts/DSMLIB/readme.md | 6 +- 5 files changed, 129 insertions(+), 43 deletions(-) diff --git a/Lua_scripts/DSM FwdPrg_05_BW.lua b/Lua_scripts/DSM FwdPrg_05_BW.lua index aa71f4a..43197e3 100644 --- a/Lua_scripts/DSM FwdPrg_05_BW.lua +++ b/Lua_scripts/DSM FwdPrg_05_BW.lua @@ -1,5 +1,6 @@ -local toolName = "TNS|DSM Forward Prog v0.51 (Text B&W) |TNE" -local VERSION = "v0.51" +local toolName = "TNS|DSM Forward Prog v0.52 (Text B&W) |TNE" +local VERSION = "v0.52" + ---- ######################################################################### ---- # # diff --git a/Lua_scripts/DSM FwdPrg_05_Color.lua b/Lua_scripts/DSM FwdPrg_05_Color.lua index b708f81..6cb7c92 100644 --- a/Lua_scripts/DSM FwdPrg_05_Color.lua +++ b/Lua_scripts/DSM FwdPrg_05_Color.lua @@ -1,5 +1,5 @@ -local toolName = "TNS|DSM Forward Prog v0.51 (Color+Touch) |TNE" -local VERSION = "v0.51" +local toolName = "TNS|DSM Forward Prog v0.52 (Color+Touch) |TNE" +local VERSION = "v0.52" ---- ######################################################################### ---- # # diff --git a/Lua_scripts/DSMLIB/DsmFwPrgLib.lua b/Lua_scripts/DSMLIB/DsmFwPrgLib.lua index cecb7fe..79f8d09 100644 --- a/Lua_scripts/DSMLIB/DsmFwPrgLib.lua +++ b/Lua_scripts/DSMLIB/DsmFwPrgLib.lua @@ -40,8 +40,8 @@ local DEBUG_ON = ... -- Get Debug_ON from parameters. -- 0=NO DEBUG, 1=HIGH LEVEL 2=MORE DETAILS -local LIB_VERSION = "0.51" -local TRANSLATE_AETR_TO_TAER = true -- TRANSLATE TX channel info from AETR to TAER +local LIB_VERSION = "0.52" + local Lib = { Init_Text = function (rxId) end } --RX IDs-- @@ -95,8 +95,14 @@ local CH_TYPE = { } local CH_MIX_TYPE = { - NONE = 0x00, - MIX_ELE = 0x20, -- For VTIAL and Delta-ELEVON + NORMAL = 0x00, + MIX_AIL_B = 0x10, -- Traileron B + MIX_ELE_A = 0x20, -- For VTIAL and Delta-ELEVON A + MIX_ELE_B_REV= 0x30, -- For VTIAL and Delta-ELEVON B + MIX_ELE_B = 0x40, -- For VTIAL and Delta-ELEVON B + MIX_ELE_A_REV= 0x50, -- For VTIAL and Delta-ELEVON A + MIX_AIL_B_REV= 0x60, -- Traileron B Rev + NORM_REV = 0x70 } local DISP_ATTR = { @@ -381,6 +387,7 @@ end local function channelType2String(byte1, byte2) local s = "" + if (byte2==0) then return s end; if (bit32.band(byte2,CH_TYPE.AIL)>0) then s=s.."AIL " end if (bit32.band(byte2,CH_TYPE.ELE)>0) then s=s.."ELE " end if (bit32.band(byte2,CH_TYPE.RUD)>0) then s=s.."RUD " end @@ -388,7 +395,15 @@ local function channelType2String(byte1, byte2) if (bit32.band(byte2,CH_TYPE.SLAVE)>0) then s=s.."SLAVE " end if (bit32.band(byte2,CH_TYPE.REVERSE)>0) then s=s.."REVERSE " end - if (bit32.band(byte1,CH_MIX_TYPE.MIX_ELE)>0) then s=s.."*MIX_ELE_0x20? " end + if (byte1==CH_MIX_TYPE.NORMAL) then s=s.." MIX_NOR" + elseif (byte1==CH_MIX_TYPE.MIX_AIL_B) then s=s.." MIX_AIL_B" + elseif (byte1==CH_MIX_TYPE.MIX_ELE_A) then s=s.." MIX_ELE_A" + elseif (byte1==CH_MIX_TYPE.MIX_ELE_B_REV) then s=s.." MIX_ELE_B_Rev" + elseif (byte1==CH_MIX_TYPE.MIX_ELE_B) then s=s.." MIX_ELE_B" + elseif (byte1==CH_MIX_TYPE.MIX_ELE_A_REV) then s=s.." MIX_ELE_A_Rev" + elseif (byte1==CH_MIX_TYPE.MIX_AIL_B_REV) then s=s.." MIX_AIL_B_Rev" + elseif (byte1==CH_MIX_TYPE.NORM_REV) then s=s.." MIX_NOR_Rev" + end return s; end @@ -530,7 +545,36 @@ end ------------------------------------------------------------------------------------------------- -- Read the model information from OTX/ETX + +local function getModuleChannelOrder(num) + --Determine fist 4 channels order + local channel_names={} + local stick_names = {[0]= "R", "E", "T", "A" } + local ch_order=num + if (ch_order == -1) then + channel_names[0] = stick_names[3] + channel_names[1] = stick_names[1] + channel_names[2] = stick_names[2] + channel_names[3] = stick_names[0] + else + channel_names[bit32.band(ch_order,3)] = stick_names[3] + ch_order = math.floor(ch_order/4) + channel_names[bit32.band(ch_order,3)] = stick_names[1] + ch_order = math.floor(ch_order/4) + channel_names[bit32.band(ch_order,3)] = stick_names[2] + ch_order = math.floor(ch_order/4) + channel_names[bit32.band(ch_order,3)] = stick_names[0] + end + + local s = "" + for i=0,3 do + s=s..channel_names[i] + end + return s +end + local function DSM_ReadTxModelData() + local TRANSLATE_AETR_TO_TAER=false local table = model.getInfo() -- Get the model name MODEL.modelName = table.name @@ -539,7 +583,12 @@ local function DSM_ReadTxModelData() if (module~=nil) then if (module.Type==6 ) then -- MULTI-MODULE local chOrder = module.channelsOrder - LOG_write("MultiChannel Ch Order: [%s]\n",chOrder) + local s = getModuleChannelOrder(chOrder) + LOG_write("MultiChannel Ch Order: [%s] %s\n",chOrder,s) + + if (s=="AETR") then TRANSLATE_AETR_TO_TAER=true + else TRANSLATE_AETR_TO_TAER=false + end end end diff --git a/Lua_scripts/DSMLIB/DsmSetupLib.lua b/Lua_scripts/DSMLIB/DsmSetupLib.lua index 38b9288..8140985 100644 --- a/Lua_scripts/DSMLIB/DsmSetupLib.lua +++ b/Lua_scripts/DSMLIB/DsmSetupLib.lua @@ -25,8 +25,8 @@ local DEBUG_ON, SIMULATION_ON = ... -- Get DebugON from parameters +local SETUP_LIB_VERSION = "0.52" -local SETUP_LIB_VERSION = "0.51" local DATA_PATH = "/SCRIPTS/TOOLS/DSMLIB/data/" -- Path to store model settings files local dsmLib = assert(loadScript("/SCRIPTS/TOOLS/DSMLIB/DsmFwPrgLib.lua"))(DEBUG_ON) @@ -115,7 +115,9 @@ local MEMU_VAR = { PORT7_MODE = 1026, PORT8_MODE = 1027, PORT9_MODE = 1028, - PORT10_MODE = 1019, + PORT10_MODE = 1029, + + DATA_END = 1040 } local SetupLib = {} @@ -133,10 +135,11 @@ local lastGoodMenu=0 local function printChannelSummary() -- Summary + print("CHANNEL INFORMATION") print("Aircraft:".. (aircraft_type_text[currAircraftType] or "--")) print("Wing Type:".. (wing_type_text[currWingType] or "--")) print("Tail Type:".. (tail_type_text[currTailType] or "--")) - print("Thr:".. (MODEL.PORT_TEXT[(MENU_DATA[MEMU_VAR.CH_THR] or 30)] or "--")) + print("Thr:".. (MODEL.PORT_TEXT[(MENU_DATA[MEMU_VAR.CH_THR] or 30)] or "--")) -- use fake ch30 for non existing channels print("LAil:".. (MODEL.PORT_TEXT[(MENU_DATA[MEMU_VAR.CH_L_AIL] or 30)] or "--")) print("RAil:".. (MODEL.PORT_TEXT[(MENU_DATA[MEMU_VAR.CH_R_AIL] or 30)] or "--")) print("LFlp:".. (MODEL.PORT_TEXT[(MENU_DATA[MEMU_VAR.CH_L_FLP] or 30)] or "--")) @@ -144,7 +147,16 @@ local function printChannelSummary() print("LEle:".. (MODEL.PORT_TEXT[(MENU_DATA[MEMU_VAR.CH_L_ELE] or 30)] or "--")) print("REle:".. (MODEL.PORT_TEXT[(MENU_DATA[MEMU_VAR.CH_R_ELE] or 30)] or "--")) print("LRud:".. (MODEL.PORT_TEXT[(MENU_DATA[MEMU_VAR.CH_L_RUD] or 30)] or "--")) - print("RRud:".. (MODEL.PORT_TEXT[(MENU_DATA[MEMU_VAR.CH_R_RUD] or 30)] or "--")) + print("RRud:".. (MODEL.PORT_TEXT[(MENU_DATA[MEMU_VAR.CH_R_RUD] or 30)] or "--")) +end + +local function printServoReverseInfo() + print("SERVO Normal/Reversed INFORMATION") + for i=0,10 do + local s="--" + if (MENU_DATA[MEMU_VAR.PORT1_MODE+i] or 0) == 0 then s="NORMAL" else s="REVERT" end + print(string.format("Port%d: %s", i+1, s)) + end end local function ST_PlaneWingInit(wingType) @@ -359,7 +371,7 @@ local function ST_Default_Data() print("Initializing Menu DATA") ST_AircraftInit(AIRCRAFT_TYPE.PLANE) - MENU_DATA[MEMU_VAR.CH_THR] = PORT.PORT1 + print("Initializing Servo Reverse from TX output settings") MENU_DATA[MEMU_VAR.PORT1_MODE] = CH_MODE_TYPE.NORMAL + MODEL.modelOutputChannel[PORT.PORT1].revert MENU_DATA[MEMU_VAR.PORT2_MODE] = CH_MODE_TYPE.NORMAL + MODEL.modelOutputChannel[PORT.PORT2].revert @@ -371,6 +383,9 @@ local function ST_Default_Data() MENU_DATA[MEMU_VAR.PORT8_MODE] = CH_MODE_TYPE.NORMAL + MODEL.modelOutputChannel[PORT.PORT8].revert MENU_DATA[MEMU_VAR.PORT9_MODE] = CH_MODE_TYPE.NORMAL + MODEL.modelOutputChannel[PORT.PORT9].revert MENU_DATA[MEMU_VAR.PORT10_MODE] = CH_MODE_TYPE.NORMAL + MODEL.modelOutputChannel[PORT.PORT10].revert + + printServoReverseInfo() + end ----------------------- FILE MANAGEMENT --------------------------------------------- @@ -429,6 +444,8 @@ function ST_LoadFileData() print(string.format("TAIL_TYPE(%d)=%s", MEMU_VAR.TAIL_TYPE, tail_type_text[currTailType])) printChannelSummary() + printServoReverseInfo() + -- No need to save right now menuDataChanged = false @@ -445,7 +462,7 @@ function ST_SaveFileData() local dataFile = io.open(DATA_PATH .. fname, "w") -- write File -- Foreach MENU_DATA with a value write Var_Id:Value into file - for i = 0, MEMU_VAR.PORT10_MODE do + for i = 0, MEMU_VAR.DATA_END do if (MENU_DATA[i]~=nil) then --print(string.format("Write MENU_DATA[%s] : %s",i,MENU_DATA[i])) io.write(dataFile,string.format("%s:%s\n",i,MENU_DATA[i])) @@ -462,52 +479,57 @@ local function CreateDSMPortChannelInfo() -- ELEVON if (b2==CH_TYPE.AIL+CH_TYPE.ELE) then return 0x20 end; -- 0x03 if (b2==CH_TYPE.AIL+CH_TYPE.ELE+CH_TYPE.REVERSE) then return 0x50 end; -- 0x23 + + -- Default normal/reverse behaviour if (b2==CH_TYPE.AIL+CH_TYPE.ELE+CH_TYPE.SLAVE) then return 0x00 end; -- 0x83 if (b2==CH_TYPE.AIL+CH_TYPE.ELE+CH_TYPE.SLAVE+CH_TYPE.REVERSE) then return 0x70 end; -- 0xA3 end + local function ApplyWingMixB(b2) + -- ELEVON + -- Default normal/reverse behaviour + if (b2==CH_TYPE.AIL+CH_TYPE.ELE) then return 0x00 end; -- 0x03 + if (b2==CH_TYPE.AIL+CH_TYPE.ELE+CH_TYPE.REVERSE) then return 0x70 end; -- 0x23 + + -- Difference with B + if (b2==CH_TYPE.AIL+CH_TYPE.ELE+CH_TYPE.SLAVE) then return 0x20 end; -- 0x83 + if (b2==CH_TYPE.AIL+CH_TYPE.ELE+CH_TYPE.SLAVE+CH_TYPE.REVERSE) then return 0x50 end; -- 0xA3 + end + local function ApplyTailMixA(b2) -- VTAIL + -- Default normal/reverse behaviour if (b2==CH_TYPE.RUD+CH_TYPE.ELE) then return 0x00 end; -- 0x06 if (b2==CH_TYPE.RUD+CH_TYPE.ELE+CH_TYPE.REVERSE) then return 0x70 end; -- 0x26 + if (b2==CH_TYPE.RUD+CH_TYPE.ELE+CH_TYPE.SLAVE) then return 0x20 end; -- 0x86 if (b2==CH_TYPE.RUD+CH_TYPE.ELE+CH_TYPE.SLAVE+CH_TYPE.REVERSE) then return 0x50 end; -- 0xA6 --TRAILERON - if (b2==CH_TYPE.AIL) then return 0x00 end; -- 0x01 + -- Default normal/reverse behaviour if (b2==CH_TYPE.AIL+CH_TYPE.ELE) then return 0x00 end; -- 0x03 - if (b2==CH_TYPE.AIL+CH_TYPE.REVERSE) then return 0x70 end; -- 0x21 if (b2==CH_TYPE.AIL+CH_TYPE.ELE+CH_TYPE.REVERSE) then return 0x70 end; -- 0x23 - if (b2==CH_TYPE.AIL+CH_TYPE.SLAVE) then return 0x00 end; -- 0x81 + if (b2==CH_TYPE.AIL+CH_TYPE.ELE+CH_TYPE.SLAVE) then return 0x10 end; -- 0x83 - if (b2==CH_TYPE.AIL+CH_TYPE.SLAVE+CH_TYPE.REVERSE) then return 0x70 end; -- 0xA1 if (b2==CH_TYPE.AIL+CH_TYPE.ELE+CH_TYPE.SLAVE+CH_TYPE.REVERSE) then return 0x60 end; -- 0xA3 end - local function ApplyWingMixB(b2) - -- ELEVON - if (b2==CH_TYPE.AIL+CH_TYPE.ELE) then return 0x00 end; -- 0x03 - if (b2==CH_TYPE.AIL+CH_TYPE.ELE+CH_TYPE.REVERSE) then return 0x70 end; -- 0x23 - if (b2==CH_TYPE.AIL+CH_TYPE.ELE+CH_TYPE.SLAVE) then return 0x20 end; -- 0x83 - if (b2==CH_TYPE.AIL+CH_TYPE.ELE+CH_TYPE.SLAVE+CH_TYPE.REVERSE) then return 0x50 end; -- 0xA3 - end - local function ApplyTailMixB(b2) -- VTAIL + -- Default normal/reverse behaviour if (b2==CH_TYPE.RUD+CH_TYPE.ELE) then return 0x00 end; -- 0x06 if (b2==CH_TYPE.RUD+CH_TYPE.ELE+CH_TYPE.REVERSE) then return 0x70 end; -- 0x26 + if (b2==CH_TYPE.RUD+CH_TYPE.ELE+CH_TYPE.SLAVE) then return 0x40 end; -- 0x86 if (b2==CH_TYPE.RUD+CH_TYPE.ELE+CH_TYPE.SLAVE+CH_TYPE.REVERSE) then return 0x30 end; -- 0xA6 --TAILERON - if (b2==CH_TYPE.AIL) then return 0x00 end; -- 0x01 if (b2==CH_TYPE.AIL+CH_TYPE.ELE) then return 0x10 end; -- 0x03 - if (b2==CH_TYPE.AIL+CH_TYPE.REVERSE) then return 0x70 end; -- 0x21 if (b2==CH_TYPE.AIL+CH_TYPE.ELE+CH_TYPE.REVERSE) then return 0x60 end; -- 0x23 - if (b2==CH_TYPE.AIL+CH_TYPE.SLAVE) then return 0x00 end; -- 0x81 + + -- Default normal/reverse behaviour if (b2==CH_TYPE.AIL+CH_TYPE.ELE+CH_TYPE.SLAVE) then return 0x00 end; -- 0x83 - if (b2==CH_TYPE.AIL+CH_TYPE.SLAVE+CH_TYPE.REVERSE) then return 0x70 end; -- 0xA1 if (b2==CH_TYPE.AIL+CH_TYPE.ELE+CH_TYPE.SLAVE+CH_TYPE.REVERSE) then return 0x70 end; -- 0xA3 end @@ -579,6 +601,7 @@ local function CreateDSMPortChannelInfo() -- Apply Gyro Reverse as needed for each channel as long as it is used for i=0, 9 do if (MENU_DATA[MEMU_VAR.PORT_BASE+i]==CH_MODE_TYPE.REVERSE and DSM_ChannelInfo[i][1]>0) then + DSM_ChannelInfo[i][0]=DSM_ChannelInfo[i][1]+0x70 -- ALL REVERSE is 0x70 for normal DSM_ChannelInfo[i][1]=DSM_ChannelInfo[i][1]+CH_TYPE.REVERSE end end @@ -594,22 +617,16 @@ local function CreateDSMPortChannelInfo() -- TRAILERRON: ELE + AIL if (tailType==TAIL_TYPE.TRAILERON_A) then - if (lAilCh~=nil) then DSM_ChannelInfo[lAilCh][1] = ApplyTailMixA(DSM_ChannelInfo[lAilCh][1]) end - if (rAilCh~=nil) then DSM_ChannelInfo[rAilCh][1] = ApplyTailMixA(DSM_ChannelInfo[rAilCh][1]) end - DSM_ChannelInfo[lElevCh][1] = ApplyTailMixA(DSM_ChannelInfo[lElevCh][1]) DSM_ChannelInfo[rElevCh][1] = ApplyTailMixA(DSM_ChannelInfo[rElevCh][1]) elseif (tailType==TAIL_TYPE.TRAILERON_B) then - if (lAilCh~=nil) then DSM_ChannelInfo[lAilCh][1] = ApplyTailMixB(DSM_ChannelInfo[lAilCh][1]) end - if (rAilCh~=nil) then DSM_ChannelInfo[rAilCh][1] = ApplyTailMixB(DSM_ChannelInfo[rAilCh][1]) end - DSM_ChannelInfo[lElevCh][1] = ApplyTailMixB(DSM_ChannelInfo[lElevCh][1]) DSM_ChannelInfo[rElevCh][1] = ApplyTailMixB(DSM_ChannelInfo[rElevCh][1]) end ---- ELEVON : AIL + ELE if (wingType==WING_TYPE.ELEVON_A) then - DSM_ChannelInfo[lAilCh][0] = ApplyWinglMixA(DSM_ChannelInfo[lAilCh][1]) + DSM_ChannelInfo[lAilCh][0] = ApplyWingMixA(DSM_ChannelInfo[lAilCh][1]) DSM_ChannelInfo[rAilCh][0] = ApplyWingMixA(DSM_ChannelInfo[rAilCh][1]) elseif (wingType==WING_TYPE.ELEVON_B) then DSM_ChannelInfo[lAilCh][0] = ApplyWingMixB(DSM_ChannelInfo[lAilCh][1]) @@ -671,7 +688,7 @@ local function ST_LoadMenu(menuId) local ctx = dsmLib.DSM_Context local function formatTXRevert(port) - return ((MODEL.modelOutputChannel[port].revert==0 and "(Tx:Normal)") or "(Tx:Reverted)") + return ((MODEL.modelOutputChannel[port].revert==0 and " (Tx:Normal)") or " (Tx:Reverted)") end clearMenuLines() @@ -817,13 +834,28 @@ local function ST_LoadMenu(menuId) elseif (menuId==0x1030) then printChannelSummary() - ctx.Menu = { MenuId = 0x1030, Text = "Gyro Channel Reverse (Needed? not saved yet)", PrevId = 0, NextId = 0, BackId = 0x1001, TextId=0 } + + ctx.Menu = { MenuId = 0x1030, Text = "Gyro Channel Reverse (Port 1-5)", PrevId = 0, NextId = 0x1031, BackId = 0x1001, TextId=0 } ctx.MenuLines[0] = { Type = LINE_TYPE.LIST_MENU_NC, Text=MODEL.PORT_TEXT[PORT.PORT1], TextId = 0, ValId = MEMU_VAR.PORT1_MODE, Min=300, Max=301, Def=300, Val=MENU_DATA[MEMU_VAR.PORT1_MODE], Format = formatTXRevert(PORT.PORT1) } ctx.MenuLines[1] = { Type = LINE_TYPE.LIST_MENU_NC, Text=MODEL.PORT_TEXT[PORT.PORT2], TextId = 0, ValId = MEMU_VAR.PORT2_MODE, Min=300, Max=301, Def=300, Val=MENU_DATA[MEMU_VAR.PORT2_MODE], Format = formatTXRevert(PORT.PORT2) } ctx.MenuLines[2] = { Type = LINE_TYPE.LIST_MENU_NC, Text=MODEL.PORT_TEXT[PORT.PORT3], TextId = 0, ValId = MEMU_VAR.PORT3_MODE, Min=300, Max=301, Def=300, Val=MENU_DATA[MEMU_VAR.PORT3_MODE], Format = formatTXRevert(PORT.PORT3) } ctx.MenuLines[3] = { Type = LINE_TYPE.LIST_MENU_NC, Text=MODEL.PORT_TEXT[PORT.PORT4], TextId = 0, ValId = MEMU_VAR.PORT4_MODE, Min=300, Max=301, Def=300, Val=MENU_DATA[MEMU_VAR.PORT4_MODE], Format = formatTXRevert(PORT.PORT4) } ctx.MenuLines[4] = { Type = LINE_TYPE.LIST_MENU_NC, Text=MODEL.PORT_TEXT[PORT.PORT5], TextId = 0, ValId = MEMU_VAR.PORT5_MODE, Min=300, Max=301, Def=300, Val=MENU_DATA[MEMU_VAR.PORT5_MODE], Format = formatTXRevert(PORT.PORT5) } - ctx.MenuLines[5] = { Type = LINE_TYPE.LIST_MENU_NC, Text=MODEL.PORT_TEXT[PORT.PORT6], TextId = 0, ValId = MEMU_VAR.PORT6_MODE, Min=300, Max=301, Def=300, Val=MENU_DATA[MEMU_VAR.PORT6_MODE], Format = formatTXRevert(PORT.PORT6) } + + ctx.MenuLines[6] = { Type = LINE_TYPE.MENU, Text=" Usually Rud/Ail needs to be the oposite of the TX", TextId = 0, ValId = 0x1030 } + + ctx.SelLine = 0 + lastGoodMenu = menuId + elseif (menuId==0x1031) then + printChannelSummary() + ctx.Menu = { MenuId = 0x1031, Text = "Gyro Channel Reverse (Port 6-10)", PrevId = 0x1030, NextId = 0, BackId = 0x1001, TextId=0 } + ctx.MenuLines[0] = { Type = LINE_TYPE.LIST_MENU_NC, Text=MODEL.PORT_TEXT[PORT.PORT6], TextId = 0, ValId = MEMU_VAR.PORT6_MODE, Min=300, Max=301, Def=300, Val=MENU_DATA[MEMU_VAR.PORT6_MODE], Format = formatTXRevert(PORT.PORT6) } + ctx.MenuLines[1] = { Type = LINE_TYPE.LIST_MENU_NC, Text=MODEL.PORT_TEXT[PORT.PORT7], TextId = 0, ValId = MEMU_VAR.PORT7_MODE, Min=300, Max=301, Def=300, Val=MENU_DATA[MEMU_VAR.PORT7_MODE], Format = formatTXRevert(PORT.PORT7) } + ctx.MenuLines[2] = { Type = LINE_TYPE.LIST_MENU_NC, Text=MODEL.PORT_TEXT[PORT.PORT8], TextId = 0, ValId = MEMU_VAR.PORT8_MODE, Min=300, Max=301, Def=300, Val=MENU_DATA[MEMU_VAR.PORT8_MODE], Format = formatTXRevert(PORT.PORT8) } + ctx.MenuLines[3] = { Type = LINE_TYPE.LIST_MENU_NC, Text=MODEL.PORT_TEXT[PORT.PORT9], TextId = 0, ValId = MEMU_VAR.PORT9_MODE, Min=300, Max=301, Def=300, Val=MENU_DATA[MEMU_VAR.PORT9_MODE], Format = formatTXRevert(PORT.PORT9) } + ctx.MenuLines[4] = { Type = LINE_TYPE.LIST_MENU_NC, Text=MODEL.PORT_TEXT[PORT.PORT10], TextId = 0, ValId = MEMU_VAR.PORT10_MODE, Min=300, Max=301, Def=300, Val=MENU_DATA[MEMU_VAR.PORT10_MODE], Format = formatTXRevert(PORT.PORT10) } + + ctx.MenuLines[6] = { Type = LINE_TYPE.MENU, Text=" Usually Rud/Ail needs to be the oposite of the TX", TextId = 0, ValId = 0x1031 } ctx.SelLine = 0 lastGoodMenu = menuId diff --git a/Lua_scripts/DSMLIB/readme.md b/Lua_scripts/DSMLIB/readme.md index 44ddab9..2cb26d7 100644 --- a/Lua_scripts/DSMLIB/readme.md +++ b/Lua_scripts/DSMLIB/readme.md @@ -125,8 +125,12 @@ If you go to the logs, you can see that the RX was correcting the value: 20.680 VALUE_CHANGE_END: RESPONSE MenuValue: UPDATED: L[#0 T=L_m1 VId=0x1000 Text="FM Channel"[0x78] Val=6|"Aux1" NL=(0->32,0,S=53) [53->85,53] MId=0x7CA6 ] - --- +# Version 0.52 +- Fix Reversing of Servos +- Properly detect Moltimodule Ch settings AETR +--- + # Version 0.51 - New Screens to Configure Model (Wing Type/Tail Tail, etc) - Finally got understanding that the previous unknown 0x05 lines are to send Model/Servo data to RX.