servos i18n support

10.3.x-maintenance
cTn 2014-05-06 23:57:57 +02:00
parent efb481227c
commit 67a25c96d3
4 changed files with 70 additions and 25 deletions

View File

@ -323,5 +323,48 @@
},
"auxiliaryEepromSaved": {
"message": "EEPROM <span style=\"color: green\">saved</span>"
},
"servosModel": {
"message": "Model:"
},
"servosChangeDirection": {
"message": "Change Direction in TX To Match"
},
"servosGyroAccelDirection": {
"message": "Gyroscope / Accelerometer Direction"
},
"servosName": {
"message": "Name"
},
"servosMid": {
"message": "MID"
},
"servosMin": {
"message": "MIN"
},
"servosMax": {
"message": "MAX"
},
"servosDirection": {
"message": "Direction"
},
"servosLiveMode": {
"message": "Enable Live mode:"
},
"servosButtonSave": {
"message": "Save"
},
"servosModelNoSupport": {
"message": "This model doesn't support servos"
},
"servosNormal": {
"message": "Normal"
},
"servosReverse": {
"message": "Reverse"
},
"servosEepromSave": {
"message": "EEPROM <span style=\"color: green\">saved</span>"
}
}

View File

@ -53,7 +53,9 @@
vertical-align: middle;
}
.tab-servos table input[type="number"] {
width: 65px;
display: block;
width: calc(100% - 5px);
height: 20px;
padding-right: 5px;

View File

@ -1,13 +1,13 @@
<div class="tab-servos">
Model: <strong class="model"></strong>
<span i18n="servosModel"></span> <strong class="model"></strong>
<div class="supported_wrapper">
<div class="title">Change Direction in TX To Match</div>
<div class="title" i18n="servosChangeDirection"></div>
<table class="fields">
<tr class="main">
<th style="">Name</th>
<th style="width: 70px">MID</th>
<th style="width: 70px">MIN</th>
<th style="width: 70px">MAX</th>
<th width="20%" i18n="servosName"></th>
<th i18n="servosMid"></th>
<th i18n="servosMin"></th>
<th i18n="servosMax"></th>
<th style="width: 40px">CH-1</th>
<th style="width: 40px">CH-2</th>
<th style="width: 40px">CH-3</th>
@ -16,21 +16,21 @@
<th style="width: 40px">AUX2</th>
<th style="width: 40px">AUX3</th>
<th style="width: 40px">AUX4</th>
<th style="width: 200px">Direction</th>
<th style="width: 200px" i18n="servosDirection"></th>
</tr>
</table>
<div class="direction_wrapper">
<div class="title" style="width: 258px">Gyroscope / Accelerometer Direction</div>
<div class="title" style="width: 258px" i18n="servosGyroAccelDirection"></div>
<table class="directions" style="width: 260px">
<tr class="main">
<th style="width: 200px">Name</th>
<th>Direction</th>
<th style="width: 200px" i18n="servosName"></th>
<th i18n="servosDirection"></th>
</tr>
</table>
</div>
<div class="live">
<span>Enable Live mode: </span><input type="checkbox" />
<span i18n="servosLiveMode"></span> <input type="checkbox" />
</div>
<a class="update" href="#" title="">Save</a>
<a class="update" href="#" i18n="servosButtonSave"></a>
</div>
</div>

View File

@ -37,8 +37,8 @@ function tab_initialize_servos() {
<td class="name" style="text-align: center">' + name + '</td>\
<td class="direction" style="text-align: right">\
<select name="direction">\
<option value="0">Normal</option>\
<option value="1">Reverse</option>\
<option value="0">' + chrome.i18n.getMessage('servosNormal') + '</option>\
<option value="1">' + chrome.i18n.getMessage('servosReverse') + '</option>\
</select>\
</td>\
</tr>\
@ -180,7 +180,7 @@ function tab_initialize_servos() {
if (save_to_eeprom) {
// Save changes to EEPROM
send_message(MSP_codes.MSP_EEPROM_WRITE, false, false, function() {
GUI.log('EEPROM <span style="color: green">saved</span>');
GUI.log(chrome.i18n.getMessage('servosEepromSave'));
var element = $('a.update');
element.addClass('success');
@ -201,7 +201,7 @@ function tab_initialize_servos() {
switch (CONFIG.multiType) {
case 1: // TRI
// looking ok so far
model.html('TRI');
model.text('TRI');
process_directions('YAW', 5, 0);
@ -209,7 +209,7 @@ function tab_initialize_servos() {
break;
case 4: // BI
// looking ok so far
model.html('BI');
model.text('BI');
process_directions('L YAW', 4, 1);
process_directions('R YAW', 5, 1);
@ -221,7 +221,7 @@ function tab_initialize_servos() {
break;
case 5: // Gimbal
// needs to be verified
model.html('Gimbal');
model.text('Gimbal');
// rate
process_servos('Pitch Servo', '', 0, 2);
@ -229,7 +229,7 @@ function tab_initialize_servos() {
break;
case 8: // Flying Wing
// looking ok so far
model.html('Flying Wing');
model.text('Flying Wing');
process_directions('L ROLL', 3, 1);
process_directions('R ROLL', 4, 1);
@ -240,7 +240,7 @@ function tab_initialize_servos() {
process_servos('Right Wing', '', 4, false);
break;
case 14: // Airplane
model.html('Airplane');
model.text('Airplane');
// rate
process_servos('Wing 1', '', 3, 2);
@ -250,7 +250,7 @@ function tab_initialize_servos() {
break;
case 20: // Dualcopter
// looking ok so far
model.html('Dualcopter');
model.text('Dualcopter');
process_directions('PITCH', 4, 0);
process_directions('ROLL', 5, 0);
@ -260,7 +260,7 @@ function tab_initialize_servos() {
break;
case 21: // Singlecopter
// looking ok so far
model.html('Singlecopter');
model.text('Singlecopter');
process_servos('Right', 'R YAW', 3, true);
process_servos('Left', 'L YAW', 4, true);
@ -269,13 +269,13 @@ function tab_initialize_servos() {
break;
default:
model.html("This model doesn't support servos");
model.text(chrome.i18n.getMessage('servosModelNoSupport'));
// implementation of feature servo_tilt
if (AUX_CONFIG.indexOf('CAMSTAB') > -1 || AUX_CONFIG.indexOf('CAMTRIG') > -1) {
// Gimbal on
// needs to be verified
model.html('Gimbal / Tilt Servos');
model.text('Gimbal / Tilt Servos');
// rate
process_servos('Pitch Servo', '', 0, 2);