add serial rx type configuration write/read working

10.3.x-maintenance
cTn 2014-09-17 17:02:16 +02:00
parent a6adfe5c7d
commit ce53bc99f2
4 changed files with 43 additions and 5 deletions

View File

@ -342,7 +342,6 @@
"configurationBattery": {
"message": "Battery"
},
"configurationBatteryMinimum": {
"message": "Minimum Cell Voltage"
},
@ -352,8 +351,12 @@
"configurationBatteryScale": {
"message": "Voltage Scale"
},
"configurationGPS": {
"message": "GPS"
},
"configurationSerialRX": {
"message": "Serial Receiver"
},
"configurationEepromSaved": {
"message": "EEPROM <span style=\"color: green\">saved</span>"
},

View File

@ -73,6 +73,11 @@
margin-left: 10px;
line-height: 20px;
}
.tab-configuration .serialRX {
width: 125px;
border: 1px solid silver;
}
.tab-configuration .buttons {
position: fixed;

View File

@ -108,7 +108,15 @@
</div>
</div>
<div class="clear-both"></div>
<div class="leftWrapper">
<div class="groupTitle" i18n="configurationGPS"></div>
</div>
<div class="rightWrapper">
<div class="groupTitle" i18n="configurationSerialRX"></div>
<select class="serialRX" size="4">
</select>
</div>
<div class="clear-both"></div>
<div class="buttons">
<a class="save" href="#" i18n="configurationButtonSave"></a>
</div>

View File

@ -89,7 +89,7 @@ TABS.configuration.initialize = function (callback) {
$('.mixerPreview img').attr('src', './images/motor_order/' + mixerList[val - 1].image + '.svg');
});
// select current configuration
// select current mixer configuration
mixer_list_e.val(BF_CONFIG.mixerConfiguration).change();
// generate features
@ -119,6 +119,28 @@ TABS.configuration.initialize = function (callback) {
features_e.append(element);
}
// generate serial RX
var serialRXtypes = [
'SPEKTRUM1024',
'SPEKTRUM2048',
'SBUS',
'SUMD'
];
var serialRX_e = $('select.serialRX');
for (var i = 0; i < serialRXtypes.length; i++) {
serialRX_e.append('<option value="' + (i) + '">' + serialRXtypes[i] + '</option>');
}
serialRX_e.change(function() {
var val = parseInt($(this).val());
BF_CONFIG.serialrx_type = val;
});
// select current serial RX type
serialRX_e.val(BF_CONFIG.serialrx_type);
// fill board alignment
$('input[name="board_align_roll"]').val(BF_CONFIG.board_align_roll);
$('input[name="board_align_pitch"]').val(BF_CONFIG.board_align_pitch);