merge multiType name and multiType diagram switch into one

10.3.x-maintenance
cTn 2014-08-16 00:11:25 +02:00
parent 6264fd4245
commit 14bb0b5dca
1 changed files with 15 additions and 52 deletions

View File

@ -44,17 +44,20 @@ TABS.initial_setup.initialize = function (callback) {
$('input[name="pitch"]').val(CONFIG.accelerometerTrims[0]); $('input[name="pitch"]').val(CONFIG.accelerometerTrims[0]);
$('input[name="roll"]').val(CONFIG.accelerometerTrims[1]); $('input[name="roll"]').val(CONFIG.accelerometerTrims[1]);
// Display multiType // Display multiType and motor diagram (if such exist)
var str = ''; var str = '';
switch (CONFIG.multiType) { switch (CONFIG.multiType) {
case 1: // TRI case 1: // TRI
str = 'TRI'; str = 'TRI';
$('.modelMixDiagram').attr('src', './images/motor_order/tri.svg').addClass('modelMixTri');
break; break;
case 2: // QUAD + case 2: // QUAD +
str = 'Quad +'; str = 'Quad +';
$('.modelMixDiagram').attr('src', './images/motor_order/quadp.svg').addClass('modelMixQuadP');
break; break;
case 3: // QUAD X case 3: // QUAD X
str = 'Quad X'; str = 'Quad X';
$('.modelMixDiagram').attr('src', './images/motor_order/quadx.svg').addClass('modelMixQuadX');
break; break;
case 4: // BI case 4: // BI
str = 'BI'; str = 'BI';
@ -64,26 +67,32 @@ TABS.initial_setup.initialize = function (callback) {
break; break;
case 6: // Y6 case 6: // Y6
str = 'Y6'; str = 'Y6';
$('.modelMixDiagram').attr('src', './images/motor_order/y6.svg').addClass('modelMixY6');
break; break;
case 7: // HEX 6 case 7: // HEX 6
str = 'HEX 6'; str = 'HEX 6';
$('.modelMixDiagram').attr('src', './images/motor_order/hex6p.svg').addClass('modelMixHex6P');
break; break;
case 8: // FLYING_WING case 8: // FLYING_WING
str = 'Flying Wing'; str = 'Flying Wing';
break; break;
case 9: // Y4 case 9: // Y4
str = 'Y4'; str = 'Y4';
$('.modelMixDiagram').attr('src', './images/motor_order/y4.svg').addClass('modelMixY4');
break; break;
case 10: // HEX6 X case 10: // HEX6 X
str = 'HEX6 X'; str = 'HEX6 X';
$('.modelMixDiagram').attr('src', './images/motor_order/hex6x.svg').addClass('modelMixHex6X');
break; break;
case 11: // OCTO X8 case 11: // OCTO X8
case 12: case 12:
case 13: case 13:
str = 'OCTO X8'; str = 'OCTO X8';
$('.modelMixDiagram').attr('src', './images/motor_order/octox.svg').addClass('modelMixOctoX');
break; break;
case 14: // AIRPLANE case 14: // AIRPLANE
str = 'Airplane'; str = 'Airplane';
$('.modelMixDiagram').attr('src', './images/motor_order/airplane.svg').addClass('modelMixAirplane');
break; break;
case 15: // Heli 120 case 15: // Heli 120
str = 'Heli 120'; str = 'Heli 120';
@ -93,74 +102,28 @@ TABS.initial_setup.initialize = function (callback) {
break; break;
case 17: // Vtail case 17: // Vtail
str = 'Vtail'; str = 'Vtail';
$('.modelMixDiagram').attr('src', './images/motor_order/vtail.svg').addClass('modelMixVtail');
break; break;
case 18: // HEX6 H case 18: // HEX6 H
str = 'HEX6 H'; str = 'HEX6 H';
$('.modelMixDiagram').attr("src", './images/motor_order/custom.svg').addClass('modelMixCustom');
break; break;
case 19: // PPM to SERVO case 19: // PPM to SERVO
str = 'PPM to SERVO'; str = 'PPM to SERVO';
$('.modelMixDiagram').attr("src", './images/motor_order/custom.svg').addClass('modelMixCustom');
break; break;
case 20: // Dualcopter case 20: // Dualcopter
str = 'Dualcopter'; str = 'Dualcopter';
$('.modelMixDiagram').attr("src", './images/motor_order/custom.svg').addClass('modelMixCustom');
break; break;
case 21: // Singlecopter case 21: // Singlecopter
str = 'Singlecopter'; str = 'Singlecopter';
$('.modelMixDiagram').attr("src", './images/motor_order/custom.svg').addClass('modelMixCustom');
break; break;
} }
$('span.model').text(chrome.i18n.getMessage('initialSetupModel', [str])); $('span.model').text(chrome.i18n.getMessage('initialSetupModel', [str]));
// Model Mix Diagram selection
switch (CONFIG.multiType) {
case 1: // TRI
$(".modelMixDiagram").attr("src","./images/motor_order/tri.svg").addClass('modelMixTri');
break;
case 2: // QUAD +
$(".modelMixDiagram").attr("src","./images/motor_order/quadp.svg").addClass('modelMixQuadP');
break;
case 3: // QUAD X
$(".modelMixDiagram").attr("src","./images/motor_order/quadx.svg").addClass('modelMixQuadX');
break;
case 6: // Y6
$(".modelMixDiagram").attr("src","./images/motor_order/y6.svg").addClass('modelMixY6');
break;
case 7: // HEX 6
$(".modelMixDiagram").attr("src","./images/motor_order/hex6p.svg").addClass('modelMixHex6P');
break;
case 9: // Y4
$(".modelMixDiagram").attr("src","./images/motor_order/y4.svg").addClass('modelMixY4');
break;
case 10: // HEX6 X
$(".modelMixDiagram").attr("src","./images/motor_order/hex6x.svg").addClass('modelMixHex6X');
break;
case 11: // OCTO X8
case 12:
case 13:
$(".modelMixDiagram").attr("src","./images/motor_order/octox.svg").addClass('modelMixOctoX');
break;
case 4: // BI
case 5: // GIMBAL
case 8: // FLYING_WING
case 14: // AIRPLANE
$(".modelMixDiagram").attr("src","./images/motor_order/airplane.svg").addClass('modelMixAirplane');
break;
case 15: // Heli 120
case 16: // Heli 90
case 17: // Vtail
$(".modelMixDiagram").attr("src","./images/motor_order/vtail.svg").addClass('modelMixVtail');
break;
case 18: // HEX6 H
case 19: // PPM to SERVO
case 20: // Dualcopter
case 21: // Singlecopter
$(".modelMixDiagram").attr("src","./images/motor_order/custom.svg").addClass('modelMixCustom');
break;
default:
$(".modelMixDiagram").attr("src","./images/motor_order/custom.svg").addClass('modelMixCustom');
break;
}
// Heading // Heading
$('span.heading').text(chrome.i18n.getMessage('initialSetupheading', [0])); $('span.heading').text(chrome.i18n.getMessage('initialSetupheading', [0]));