Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for PR #8401 #1621

Merged
merged 2 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion js/fc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,10 @@ var FC = {
7: "Horizon",
8: "Air",
9: "USER 1",
10: "USER 2"
10: "USER 2",
11: "Course Hold",
12: "USER 3",
13: "USER 4",
}
},
4: {
Expand Down
22 changes: 19 additions & 3 deletions js/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,27 @@ GUI_control.prototype.renderOperandValue = function ($container, operandMetadata
$t.append('<option value="' + i + '">' + i + '</option>');
}
} else if (operandMetadata.type == "dictionary") {
for (let k in operandMetadata.values) {
if (operandMetadata.values.hasOwnProperty(k)) {
$t.append('<option value="' + k + '">' + operandMetadata.values[k] + '</option>');
let operandValues = [];

for (let j in operandMetadata.values) {
if (operandMetadata.values.hasOwnProperty(j)) {
operandValues[parseInt(j,10)] = {
id: parseInt(j, 10),
name: operandMetadata.values[j],
};
}
}

operandValues.sort((a, b) => {
let ovAN = a.name.toLowerCase(),
ovBN = b.name.toLowerCase();

return (ovAN < ovBN) ? -1 : 1;
});

operandValues.forEach( val => {
$t.append('<option value="' + val.id + '">' + val.name + '</option>');
});
}

$t.val(value);
Expand Down
2 changes: 1 addition & 1 deletion tabs/auxiliary.js
Original file line number Diff line number Diff line change
Expand Up @@ -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", "MISSION CHANGE", "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", "USER3", "USER4"];

function sort_modes_for_display() {
// Sort the modes
Expand Down