|
|
|
@ -77,6 +77,14 @@ TABS.receiver.initialize = function (callback) {
|
|
|
|
|
// translate to user-selected language
|
|
|
|
|
localize();
|
|
|
|
|
|
|
|
|
|
if (semver.lt(CONFIG.flightControllerVersion, '1.9.1')) {
|
|
|
|
|
rcmap_options = $('select[name="rcmap_helper"] option');
|
|
|
|
|
for (i = 0; i < rcmap_options.length; ++i) {
|
|
|
|
|
option = rcmap_options[i];
|
|
|
|
|
option.setAttribute("value", option.getAttribute("value") + "5678");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// fill in data from RC_tuning
|
|
|
|
|
$('.tunings .throttle input[name="mid"]').val(RC_tuning.throttle_MID.toFixed(2));
|
|
|
|
|
$('.tunings .throttle input[name="expo"]').val(RC_tuning.throttle_EXPO.toFixed(2));
|
|
|
|
@ -152,9 +160,9 @@ TABS.receiver.initialize = function (callback) {
|
|
|
|
|
$(window).on('resize', self.resize).resize(); // trigger so labels get correctly aligned on creation
|
|
|
|
|
|
|
|
|
|
// handle rcmap & rssi aux channel
|
|
|
|
|
var strBuffer = [];
|
|
|
|
|
var strBuffer = [], rcMapLetters = FC.getRcMapLetters();
|
|
|
|
|
for (var i = 0; i < RC_MAP.length; i++) {
|
|
|
|
|
strBuffer[RC_MAP[i]] = FC.getRcMapLetters()[i];
|
|
|
|
|
strBuffer[RC_MAP[i]] = rcMapLetters[i];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// reconstruct
|
|
|
|
@ -183,29 +191,12 @@ TABS.receiver.initialize = function (callback) {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$rcMap.focusout(function () {
|
|
|
|
|
var val = $(this).val(),
|
|
|
|
|
strBuffer = val.split(''),
|
|
|
|
|
duplicityBuffer = [];
|
|
|
|
|
|
|
|
|
|
if (val.length != 8) {
|
|
|
|
|
$(this).val(last_valid);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// check if characters inside are all valid, also check for duplicity
|
|
|
|
|
for (var i = 0; i < val.length; i++) {
|
|
|
|
|
if (FC.getRcMapLetters().indexOf(strBuffer[i]) < 0) {
|
|
|
|
|
if (!FC.isRcMapValid($(this).val()))
|
|
|
|
|
$(this).val(last_valid);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (duplicityBuffer.indexOf(strBuffer[i]) < 0) {
|
|
|
|
|
duplicityBuffer.push(strBuffer[i]);
|
|
|
|
|
} else {
|
|
|
|
|
$(this).val(last_valid);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$rcMap.on('input change', function() {
|
|
|
|
|
$(this).css("color", FC.isRcMapValid($(this).val()) ? "" : "#FF0000");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// handle helper
|
|
|
|
|