diff options
author | breadoven <56191411+breadoven@users.noreply.github.com> | 2022-09-20 13:36:55 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-20 13:36:55 +0300 |
commit | 010e62587567e9ef6d483d412596ce485e47966d (patch) | |
tree | bdaa9cf59c9a429f9edf6af41b6bfe587f98fb93 | |
parent | 47ea653217958d374c5272dc25493efb12e40885 (diff) | |
parent | 15010118445fe76382e052b2ffee60fba3f3d9f9 (diff) |
Merge pull request #1610 from breadoven/abo_multi_mission_index_adjustment
Multi mission index adjustment
-rwxr-xr-x | _locales/en/messages.json | 3 | ||||
-rw-r--r-- | tabs/adjustments.html | 11 | ||||
-rw-r--r-- | tabs/auxiliary.js | 20 | ||||
-rw-r--r-- | tabs/osd.js | 9 |
4 files changed, 26 insertions, 17 deletions
diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 0f8660b6..45cec7a6 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1745,6 +1745,9 @@ "adjustmentsFunction58": { "message": "Fixed Wing Level Trim" }, + "adjustmentsFunction59": { + "message": "Multi Mission Index Adjustment" + }, "adjustmentsSave": { "message": "Save" }, diff --git a/tabs/adjustments.html b/tabs/adjustments.html index 03769f7d..6cc87d6a 100644 --- a/tabs/adjustments.html +++ b/tabs/adjustments.html @@ -81,7 +81,7 @@ <option value="26" i18n="adjustmentsFunction26"></option> <!-- Manual RC Pitch/Roll Expo --> <option value="27" i18n="adjustmentsFunction27"></option> <!-- Manual RC Yaw Expo --> </optgroup> - + <optgroup i18n_label="adjustmentsGroupPIDTuning"> <option value="6" i18n="adjustmentsFunction6"></option> <!-- Pitch & Roll P --> <option value="7" i18n="adjustmentsFunction7"></option> <!-- Pitch & Roll I --> @@ -103,7 +103,7 @@ <option value="55" i18n="adjustmentsFunction55"></option> <!-- TPA Breakpoint --> <option value="57" i18n="adjustmentsFunction57"></option> <!-- FW TPA Time Const --> </optgroup> - + <optgroup i18n_label="adjustmentsGroupNavigationFlight"> <option value="34" i18n="adjustmentsFunction34"></option> <!-- Board Roll--> <option value="35" i18n="adjustmentsFunction35"></option> <!-- Board Pitch--> @@ -112,7 +112,7 @@ <option value="33" i18n="adjustmentsFunction33"></option> <!-- FW Pitch to Throttle --> <option value="52" i18n="adjustmentsFunction52"></option> <!-- FW min thr down pitch --> <option value="56" i18n="adjustmentsFunction56"></option> <!-- Control Smoothness --> - + <option value="36" i18n="adjustmentsFunction36"></option> <!-- Level P --> <option value="37" i18n="adjustmentsFunction37"></option> <!-- Level I --> <option value="38" i18n="adjustmentsFunction38"></option> <!-- Level D --> @@ -130,9 +130,10 @@ <option value="50" i18n="adjustmentsFunction50"></option> <!-- VEL Z I --> <option value="51" i18n="adjustmentsFunction51"></option> <!-- VEL Z D --> </optgroup> - + <optgroup i18n_label="adjustmentsGroupMisc"> - <option value="53" i18n="adjustmentsFunction53"></option> <!-- VTX Power --> + <option value="53" i18n="adjustmentsFunction53"></option> <!-- VTX Power --> + <option value="59" i18n="adjustmentsFunction59"></option> <!-- WP Mission Index --> </optgroup> </select></td> <td class="adjustmentSlot"><select class="slot"> diff --git a/tabs/auxiliary.js b/tabs/auxiliary.js index 2f1a27d6..7d749eca 100644 --- a/tabs/auxiliary.js +++ b/tabs/auxiliary.js @@ -46,7 +46,7 @@ TABS.auxiliary.initialize = function (callback) { modeSections["Multi-rotor"] = ["FPV ANGLE MIX", "TURTLE", "MC BRAKING", "HEADFREE", "HEADADJ"]; modeSections["OSD Modes"] = ["OSD OFF", "OSD ALT 1", "OSD ALT 2", "OSD ALT 3"]; modeSections["FPV Camera Modes"] = ["CAMSTAB", "CAMERA CONTROL 1", "CAMERA CONTROL 2", "CAMERA CONTROL 3"]; - modeSections["Misc Modes"] = ["BEEPER", "LEDS OFF", "LIGHTS", "HOME RESET", "WP PLANNER", "BLACKBOX", "FAILSAFE", "KILLSWITCH", "TELEMETRY", "MSP RC OVERRIDE", "USER1", "USER2"]; + modeSections["Misc Modes"] = ["BEEPER", "LEDS OFF", "LIGHTS", "HOME RESET", "WP PLANNER", "MISSION CHANGE", "BLACKBOX", "FAILSAFE", "KILLSWITCH", "TELEMETRY", "MSP RC OVERRIDE", "USER1", "USER2"]; function sort_modes_for_display() { // Sort the modes @@ -57,7 +57,7 @@ TABS.auxiliary.initialize = function (callback) { for (i=0; i<AUX_CONFIG.length; i++) { tmpAUX_CONFIG[i] = AUX_CONFIG[i]; - tmpAUX_CONFIG_IDS[i] = AUX_CONFIG_IDS[i]; + tmpAUX_CONFIG_IDS[i] = AUX_CONFIG_IDS[i]; } AUX_CONFIG = []; @@ -71,7 +71,7 @@ TABS.auxiliary.initialize = function (callback) { AUX_CONFIG[sortedID] = tmpAUX_CONFIG[j]; AUX_CONFIG_IDS[sortedID] = tmpAUX_CONFIG_IDS[j]; ORIG_AUX_CONFIG_IDS[sortedID++] = j; - + break; } } @@ -111,11 +111,11 @@ TABS.auxiliary.initialize = function (callback) { var modeTemplate = $('#tab-auxiliary-templates .mode'); var newMode = modeTemplate.clone(); var modeName = AUX_CONFIG[modeIndex]; - + // If the runcam split peripheral is used, then adjust the boxname(BOXCAMERA1, BOXCAMERA2, BOXCAMERA3) // If platform is fixed wing, rename POS HOLD to LOITER modeName = adjustBoxNameIfPeripheralWithModeID(modeId, modeName); - + $(newMode).attr('id', 'mode-' + modeIndex); $(newMode).find('.name').text(modeName); @@ -385,7 +385,7 @@ TABS.auxiliary.initialize = function (callback) { for (var i = 0; i < AUX_CONFIG.length; i++) { var modeElement = $('#mode-' + i); let inRange = false; - + if (modeElement.find(' .range').length == 0) { // if the mode is unused, skip it modeElement.removeClass('off').removeClass('on'); @@ -415,7 +415,7 @@ TABS.auxiliary.initialize = function (callback) { inRange = true; } } - + if (inRange) { $('.mode .name').eq(modeElement.data('index')).data('modeElement').removeClass('on').addClass('inRange').removeClass('off'); @@ -435,7 +435,7 @@ TABS.auxiliary.initialize = function (callback) { } else { $('.acroEnabled').removeClass('on').addClass('off'); } - + let hideUnused = hideUnusedModes && hasUsedMode; for (let i = 0; i < AUX_CONFIG.length; i++) { let modeElement = $('#mode-' + i); @@ -443,7 +443,7 @@ TABS.auxiliary.initialize = function (callback) { modeElement.toggle(!hideUnused); } } - + $(".modeSection").each(function() { $(this).toggle(!hideUnused); }); @@ -459,7 +459,7 @@ TABS.auxiliary.initialize = function (callback) { }) .prop("checked", !!result.hideUnusedModes) .change(); - }); + }); // update ui instantly on first load update_ui(); diff --git a/tabs/osd.js b/tabs/osd.js index 179b5756..44bd89d3 100644 --- a/tabs/osd.js +++ b/tabs/osd.js @@ -1883,6 +1883,11 @@ OSD.constants = { id: 135, preview: 'LEVEL ' + FONT.embed_dot('5.4') }, + { + name: 'MISSION_INDEX', + id: 139, + preview: 'WP NO 7' + }, ] }, { @@ -2053,7 +2058,7 @@ OSD.updateDisplaySize = function () { var item = OSD.msp.helpers.unpack.position(origPos[jj]); // leave element alone if outside of screen (enable and disable element to relocate to 0,0) if (item.x < OSD.data.display_size.x && item.y < OSD.data.display_size.y) { - items[jj] = item; + items[jj] = item; } } } @@ -3126,7 +3131,7 @@ function updateCraftName() { for (let si = 0; si < generalGroup.items.length; si++) { if (generalGroup.items[si].name == "CRAFT_NAME") { let craftNameText = $('#craft_name').val(); - + if (craftNameText == "") { generalGroup.items[si].preview = "CRAFT_NAME"; } else { |