1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-17 13:25:24 +03:00

Merge pull request #402 from mikeller/reorder_mixer_list

Reordered mixer list for better useability.
This commit is contained in:
Michael Keller 2017-01-29 23:47:43 +13:00 committed by GitHub
commit cc58529045
2 changed files with 33 additions and 30 deletions

View file

@ -2,35 +2,34 @@
// generate mixer // generate mixer
var mixerList = [ var mixerList = [
{name: 'Tricopter', model: 'tricopter', image: 'tri'}, {name: 'Tricopter', pos: 3, model: 'tricopter', image: 'tri'},
{name: 'Quad +', model: 'quad_x', image: 'quad_p'}, {name: 'Quad +', pos: 2, model: 'quad_x', image: 'quad_p'},
{name: 'Quad X', model: 'quad_x', image: 'quad_x'}, {name: 'Quad X', pos: 0, model: 'quad_x', image: 'quad_x'},
{name: 'Bicopter', model: 'custom', image: 'bicopter'}, {name: 'Bicopter', pos: 16, model: 'custom', image: 'bicopter'},
{name: 'Gimbal', model: 'custom', image: 'custom'}, {name: 'Gimbal', pos: 4, model: 'custom', image: 'custom'},
{name: 'Y6', model: 'y6', image: 'y6'}, {name: 'Y6', pos: 20, model: 'y6', image: 'y6'},
{name: 'Hex +', model: 'hex_plus', image: 'hex_p'}, {name: 'Hex +', pos: 5, model: 'hex_plus', image: 'hex_p'},
{name: 'Flying Wing', model: 'custom', image: 'flying_wing'}, {name: 'Flying Wing', pos: 10, model: 'custom', image: 'flying_wing'},
{name: 'Y4', model: 'y4', image: 'y4'}, {name: 'Y4', pos: 19, model: 'y4', image: 'y4'},
{name: 'Hex X', model: 'hex_x', image: 'hex_x'}, {name: 'Hex X', pos: 6, model: 'hex_x', image: 'hex_x'},
{name: 'Octo X8', model: 'custom', image: 'octo_x8'}, {name: 'Octo X8', pos: 21, model: 'custom', image: 'octo_x8'},
{name: 'Octo Flat +', model: 'custom', image: 'octo_flat_p'}, {name: 'Octo Flat +', pos: 8, model: 'custom', image: 'octo_flat_p'},
{name: 'Octo Flat X', model: 'custom', image: 'octo_flat_x'}, {name: 'Octo Flat X', pos: 9, model: 'custom', image: 'octo_flat_x'},
{name: 'Airplane', model: 'custom', image: 'airplane'}, {name: 'Airplane', pos: 11, model: 'custom', image: 'airplane'},
{name: 'Heli 120', model: 'custom', image: 'custom'}, {name: 'Heli 120', pos: 12, model: 'custom', image: 'custom'},
{name: 'Heli 90', model: 'custom', image: 'custom'}, {name: 'Heli 90', pos: 13, model: 'custom', image: 'custom'},
{name: 'V-tail Quad', model: 'quad_vtail', image: 'vtail_quad'}, {name: 'V-tail Quad', pos: 17, model: 'quad_vtail', image: 'vtail_quad'},
{name: 'Hex H', model: 'custom', image: 'custom'}, {name: 'Hex H', pos: 7, model: 'custom', image: 'custom'},
{name: 'PPM to SERVO', model: 'custom', image: 'custom'}, {name: 'PPM to SERVO', pos: 22, model: 'custom', image: 'custom'},
{name: 'Dualcopter', model: 'custom', image: 'custom'}, {name: 'Dualcopter', pos: 15, model: 'custom', image: 'custom'},
{name: 'Singlecopter', model: 'custom', image: 'custom'}, {name: 'Singlecopter', pos: 14, model: 'custom', image: 'custom'},
{name: 'A-tail Quad', model: 'quad_atail', image: 'atail_quad'}, {name: 'A-tail Quad', pos: 18, model: 'quad_atail', image: 'atail_quad'},
{name: 'Custom', model: 'custom', image: 'custom'}, {name: 'Custom', pos: 23, model: 'custom', image: 'custom'},
{name: 'Custom Airplane', model: 'custom', image: 'custom'}, {name: 'Custom Airplane', pos: 24, model: 'custom', image: 'custom'},
{name: 'Custom Tricopter', model: 'custom', image: 'custom'}, {name: 'Custom Tricopter', pos: 25, model: 'custom', image: 'custom'},
{name: 'Quad X 1234', model: 'quad_x', image: 'quad_x_1234'} {name: 'Quad X 1234', pos: 1, model: 'quad_x', image: 'quad_x_1234'}
]; ];
// 3D model // 3D model
var Model = function (wrapper, canvas) { var Model = function (wrapper, canvas) {
var useWebGLRenderer = this.canUseWebGLRenderer(); var useWebGLRenderer = this.canUseWebGLRenderer();
@ -106,7 +105,7 @@ Model.prototype.canUseWebGLRenderer = function () {
// and webgl will be supported if gpu supports it by default (canary 40.0.2175.0), keep an eye on this one // and webgl will be supported if gpu supports it by default (canary 40.0.2175.0), keep an eye on this one
var detector_canvas = document.createElement('canvas'); var detector_canvas = document.createElement('canvas');
return window.WebGLRenderingContext && (detector_canvas.getContext('webgl') || detector_canvas.getContext('experimental-webgl')) return window.WebGLRenderingContext && (detector_canvas.getContext('webgl') || detector_canvas.getContext('experimental-webgl'));
}; };
Model.prototype.rotateTo = function (x, y, z) { Model.prototype.rotateTo = function (x, y, z) {

View file

@ -143,8 +143,12 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
function process_html() { function process_html() {
var mixer_list_e = $('select.mixerList'); var mixer_list_e = $('select.mixerList');
for (var i = 0; i < mixerList.length; i++) { for (var selectIndex = 0; selectIndex < mixerList.length; selectIndex++) {
mixer_list_e.append('<option value="' + (i + 1) + '">' + mixerList[i].name + '</option>'); mixerList.forEach(function (mixerEntry, mixerIndex) {
if (mixerEntry.pos === selectIndex) {
mixer_list_e.append('<option value="' + (mixerIndex + 1) + '">' + mixerEntry.name + '</option>');
}
});
} }
mixer_list_e.change(function () { mixer_list_e.change(function () {