mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-23 00:05:19 +03:00
Merge branch 'master' into msp-queue
This commit is contained in:
commit
e74645f497
20 changed files with 428 additions and 82 deletions
|
@ -1919,6 +1919,15 @@
|
||||||
"presetApplyDescription": {
|
"presetApplyDescription": {
|
||||||
"message": "Preset overwrites selected configuration values including mixer, filtering, PIDs and other. Settings like: flight modes, radio settings, failsafe and OSD are not changed. Applied values should <strong>NOT</strong> treated as final values, but entry points for final tuning. <br> Always check new configuration before flying!"
|
"message": "Preset overwrites selected configuration values including mixer, filtering, PIDs and other. Settings like: flight modes, radio settings, failsafe and OSD are not changed. Applied values should <strong>NOT</strong> treated as final values, but entry points for final tuning. <br> Always check new configuration before flying!"
|
||||||
},
|
},
|
||||||
|
"tabAdvancedTuning": {
|
||||||
|
"message": "Advanced tuning"
|
||||||
|
},
|
||||||
|
"advancedTuningSave": {
|
||||||
|
"message": "Save and Reboot"
|
||||||
|
},
|
||||||
|
"tabAdvancedTuningTitle": {
|
||||||
|
"message": "Advanced tuning"
|
||||||
|
},
|
||||||
"presetApplyHead": {
|
"presetApplyHead": {
|
||||||
"message": "Applies following settings:"
|
"message": "Applies following settings:"
|
||||||
},
|
},
|
||||||
|
@ -1958,7 +1967,71 @@
|
||||||
"dtermNotchCutoffHelp": {
|
"dtermNotchCutoffHelp": {
|
||||||
"message": "Defines band of filter. <br><br>Has to be kept below notch filter frequency."
|
"message": "Defines band of filter. <br><br>Has to be kept below notch filter frequency."
|
||||||
},
|
},
|
||||||
|
"positionHoldConfiguration": {
|
||||||
|
"message": "Basic Navigation Settings"
|
||||||
|
},
|
||||||
|
"userControlMode": {
|
||||||
|
"message": "User Control Mode"
|
||||||
|
},
|
||||||
|
"posholdMaxSpeed": {
|
||||||
|
"message": "Max. navigation speed [cm/s]"
|
||||||
|
},
|
||||||
|
"posholdMaxManualSpeed": {
|
||||||
|
"message": "Max. CRUISE speed [cm/s]"
|
||||||
|
},
|
||||||
|
"posholdMaxClimbRate": {
|
||||||
|
"message": "Max. navigation climb rate [cm/s]"
|
||||||
|
},
|
||||||
|
"posholdMaxManualClimbRate": {
|
||||||
|
"message": "Max. ALTHOLD climb rate [cm/s]"
|
||||||
|
},
|
||||||
|
"posholdMaxBankAngle": {
|
||||||
|
"message": "Multirotor max. banking angle [deg]"
|
||||||
|
},
|
||||||
|
"posholdHoverThrottle": {
|
||||||
|
"message": "Hover throttle"
|
||||||
|
},
|
||||||
|
"posholdHoverMidThrottle": {
|
||||||
|
"message": "Use mid. throttle for ALTHOLD"
|
||||||
|
},
|
||||||
|
"positionEstimatorConfiguration": {
|
||||||
|
"message": "Position Estimator"
|
||||||
|
},
|
||||||
|
"w_z_baro_p": {
|
||||||
|
"message": "Vertical Position Baro Weight"
|
||||||
|
},
|
||||||
|
"w_z_gps_p": {
|
||||||
|
"message": "Vertical Position GPS Weight"
|
||||||
|
},
|
||||||
|
"w_z_gps_v": {
|
||||||
|
"message": "Vertical Speed GPS Weight"
|
||||||
|
},
|
||||||
|
"w_xy_gps_p": {
|
||||||
|
"message": "Horizontal Position GPS Weight"
|
||||||
|
},
|
||||||
|
"w_xy_gps_v": {
|
||||||
|
"message": "Horizontal Speed GPS Weight"
|
||||||
|
},
|
||||||
|
"positionEstimatorConfigurationDisclaimer": {
|
||||||
|
"message": "Those value should be changed very carefully. In most cases there is not need to change them. For advanced users only!"
|
||||||
|
},
|
||||||
|
"gps_min_sats": {
|
||||||
|
"message": "Min. GPS sats for valid fix"
|
||||||
|
},
|
||||||
|
"use_gps_velned": {
|
||||||
|
"message": "Use GPS data for velocity calculation"
|
||||||
|
},
|
||||||
|
"use_gps_velned_help": {
|
||||||
|
"message": "Defined if iNav should use velocity data provided by GPS module for doing position and speed estimation. If set to OFF iNav will fallback to calculating velocity from GPS coordinates. Using native velocity data may improve performance on some GPS modules. Some GPS modules introduce significant delay and using native velocity may actually result in much worse performance."
|
||||||
|
},
|
||||||
|
"w_z_baro_p_help": {
|
||||||
|
"message": "When this value is set to <strong>0</strong>, barometer is not used for altitude computation"
|
||||||
|
},
|
||||||
|
"w_z_gos_p_help": {
|
||||||
|
"message": "When this value is set to <strong>0</strong>, GPS is not used for altitude computation"
|
||||||
|
},
|
||||||
"wirelessModeSwitch": {
|
"wirelessModeSwitch": {
|
||||||
"message": "Wireless mode"
|
"message": "Wireless mode"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,8 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var CONFIGURATOR = {
|
var CONFIGURATOR = {
|
||||||
'releaseDate': 1478083274093, // new Date().getTime() - Wed Nov 02 2016 20:41:30 GMT+1000
|
|
||||||
|
|
||||||
// all versions are specified and compared using semantic versioning http://semver.org/
|
// all versions are specified and compared using semantic versioning http://semver.org/
|
||||||
'apiVersionAccepted': '1.2.1',
|
'apiVersionAccepted': '1.2.1',
|
||||||
'backupRestoreMinApiVersionAccepted': '1.5.0',
|
'backupRestoreMinApiVersionAccepted': '1.5.0',
|
||||||
|
|
17
js/fc.js
17
js/fc.js
|
@ -44,6 +44,7 @@ var FILTER_CONFIG;
|
||||||
var SENSOR_STATUS;
|
var SENSOR_STATUS;
|
||||||
var SENSOR_CONFIG;
|
var SENSOR_CONFIG;
|
||||||
var NAV_POSHOLD;
|
var NAV_POSHOLD;
|
||||||
|
var POSITION_ESTIMATOR;
|
||||||
|
|
||||||
var FC = {
|
var FC = {
|
||||||
isRatesInDps: function () {
|
isRatesInDps: function () {
|
||||||
|
@ -337,6 +338,16 @@ var FC = {
|
||||||
nrf24rx_id: 0
|
nrf24rx_id: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
POSITION_ESTIMATOR = {
|
||||||
|
w_z_baro_p: null,
|
||||||
|
w_z_gps_p: null,
|
||||||
|
w_z_gps_v: null,
|
||||||
|
w_xy_gps_p: null,
|
||||||
|
w_xy_gps_v: null,
|
||||||
|
gps_min_sats: null,
|
||||||
|
use_gps_velned: null
|
||||||
|
};
|
||||||
|
|
||||||
FAILSAFE_CONFIG = {
|
FAILSAFE_CONFIG = {
|
||||||
failsafe_delay: 0,
|
failsafe_delay: 0,
|
||||||
failsafe_off_delay: 0,
|
failsafe_off_delay: 0,
|
||||||
|
@ -697,5 +708,11 @@ var FC = {
|
||||||
}
|
}
|
||||||
|
|
||||||
return retVal;
|
return retVal;
|
||||||
|
},
|
||||||
|
getUserControlMode: function () {
|
||||||
|
return [
|
||||||
|
"Attitude",
|
||||||
|
"Cruise"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -36,7 +36,8 @@ var GUI_control = function () {
|
||||||
'servos',
|
'servos',
|
||||||
'setup',
|
'setup',
|
||||||
'osd',
|
'osd',
|
||||||
'profiles'
|
'profiles',
|
||||||
|
'advanced_tuning'
|
||||||
];
|
];
|
||||||
this.allowedTabs = this.defaultAllowedTabsWhenDisconnected;
|
this.allowedTabs = this.defaultAllowedTabsWhenDisconnected;
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,9 @@ var MSPCodes = {
|
||||||
MSP_NAV_POSHOLD: 12,
|
MSP_NAV_POSHOLD: 12,
|
||||||
MSP_SET_NAV_POSHOLD: 13,
|
MSP_SET_NAV_POSHOLD: 13,
|
||||||
|
|
||||||
|
MSP_POSITION_ESTIMATION_CONFIG: 16,
|
||||||
|
MSP_SET_POSITION_ESTIMATION_CONFIG: 17,
|
||||||
|
|
||||||
// MSP commands for Cleanflight original features
|
// MSP commands for Cleanflight original features
|
||||||
MSP_CHANNEL_FORWARDING: 32,
|
MSP_CHANNEL_FORWARDING: 32,
|
||||||
MSP_SET_CHANNEL_FORWARDING: 33,
|
MSP_SET_CHANNEL_FORWARDING: 33,
|
||||||
|
|
|
@ -900,6 +900,20 @@ var mspHelper = (function (gui) {
|
||||||
console.log('NAV_POSHOLD saved');
|
console.log('NAV_POSHOLD saved');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MSPCodes.MSP_POSITION_ESTIMATION_CONFIG:
|
||||||
|
POSITION_ESTIMATOR.w_z_baro_p = data.getUint16(0, true) / 100;
|
||||||
|
POSITION_ESTIMATOR.w_z_gps_p = data.getUint16(2, true) / 100;
|
||||||
|
POSITION_ESTIMATOR.w_z_gps_v = data.getUint16(4, true) / 100;
|
||||||
|
POSITION_ESTIMATOR.w_xy_gps_p = data.getUint16(6, true) / 100;
|
||||||
|
POSITION_ESTIMATOR.w_xy_gps_v = data.getUint16(8, true) / 100;
|
||||||
|
POSITION_ESTIMATOR.gps_min_sats = data.getUint8(10);
|
||||||
|
POSITION_ESTIMATOR.use_gps_velned = data.getUint8(11);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MSPCodes.MSP_SET_POSITION_ESTIMATION_CONFIG:
|
||||||
|
console.log('POSITION_ESTIMATOR saved');
|
||||||
|
break;
|
||||||
|
|
||||||
case MSPCodes.MSP_SET_MODE_RANGE:
|
case MSPCodes.MSP_SET_MODE_RANGE:
|
||||||
console.log('Mode range saved');
|
console.log('Mode range saved');
|
||||||
break;
|
break;
|
||||||
|
@ -1227,6 +1241,26 @@ var mspHelper = (function (gui) {
|
||||||
buffer.push(highByte(NAV_POSHOLD.hoverThrottle));
|
buffer.push(highByte(NAV_POSHOLD.hoverThrottle));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MSPCodes.MSP_SET_POSITION_ESTIMATION_CONFIG:
|
||||||
|
buffer.push(lowByte(POSITION_ESTIMATOR.w_z_baro_p * 100));
|
||||||
|
buffer.push(highByte(POSITION_ESTIMATOR.w_z_baro_p * 100));
|
||||||
|
|
||||||
|
buffer.push(lowByte(POSITION_ESTIMATOR.w_z_gps_p * 100));
|
||||||
|
buffer.push(highByte(POSITION_ESTIMATOR.w_z_gps_p * 100));
|
||||||
|
|
||||||
|
buffer.push(lowByte(POSITION_ESTIMATOR.w_z_gps_v * 100));
|
||||||
|
buffer.push(highByte(POSITION_ESTIMATOR.w_z_gps_v * 100));
|
||||||
|
|
||||||
|
buffer.push(lowByte(POSITION_ESTIMATOR.w_xy_gps_p * 100));
|
||||||
|
buffer.push(highByte(POSITION_ESTIMATOR.w_xy_gps_p * 100));
|
||||||
|
|
||||||
|
buffer.push(lowByte(POSITION_ESTIMATOR.w_xy_gps_v * 100));
|
||||||
|
buffer.push(highByte(POSITION_ESTIMATOR.w_xy_gps_v * 100));
|
||||||
|
|
||||||
|
buffer.push(POSITION_ESTIMATOR.gps_min_sats);
|
||||||
|
buffer.push(POSITION_ESTIMATOR.use_gps_velned);
|
||||||
|
break;
|
||||||
|
|
||||||
case MSPCodes.MSP_SET_FILTER_CONFIG:
|
case MSPCodes.MSP_SET_FILTER_CONFIG:
|
||||||
buffer.push(FILTER_CONFIG.gyroSoftLpfHz);
|
buffer.push(FILTER_CONFIG.gyroSoftLpfHz);
|
||||||
|
|
||||||
|
@ -1945,5 +1979,37 @@ var mspHelper = (function (gui) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
self.loadNavPosholdConfig = function (callback) {
|
||||||
|
if (semver.gte(CONFIG.flightControllerVersion, "1.6.0")) {
|
||||||
|
MSP.send_message(MSPCodes.MSP_NAV_POSHOLD, false, false, callback);
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
self.saveNavPosholdConfig = function (callback) {
|
||||||
|
if (semver.gte(CONFIG.flightControllerVersion, "1.6.0")) {
|
||||||
|
MSP.send_message(MSPCodes.MSP_SET_NAV_POSHOLD, mspHelper.crunch(MSPCodes.MSP_SET_NAV_POSHOLD), false, callback);
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
self.loadPositionEstimationConfig = function (callback) {
|
||||||
|
if (semver.gte(CONFIG.flightControllerVersion, "1.6.0")) {
|
||||||
|
MSP.send_message(MSPCodes.MSP_POSITION_ESTIMATION_CONFIG, false, false, callback);
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
self.savePositionEstimationConfig = function (callback) {
|
||||||
|
if (semver.gte(CONFIG.flightControllerVersion, "1.6.0")) {
|
||||||
|
MSP.send_message(MSPCodes.MSP_SET_POSITION_ESTIMATION_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_POSITION_ESTIMATION_CONFIG), false, callback);
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
})(GUI);
|
})(GUI);
|
||||||
|
|
|
@ -288,6 +288,7 @@ function onOpen(openInfo) {
|
||||||
*/
|
*/
|
||||||
if (semver.lt(CONFIG.flightControllerVersion, "1.6.0")) {
|
if (semver.lt(CONFIG.flightControllerVersion, "1.6.0")) {
|
||||||
GUI.allowedTabs.splice(GUI.allowedTabs.indexOf('profiles'), 1);
|
GUI.allowedTabs.splice(GUI.allowedTabs.indexOf('profiles'), 1);
|
||||||
|
GUI.allowedTabs.splice(GUI.allowedTabs.indexOf('advanced_tuning'), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
onConnect();
|
onConnect();
|
||||||
|
@ -317,23 +318,25 @@ function onOpen(openInfo) {
|
||||||
console.log('Failed to open serial port');
|
console.log('Failed to open serial port');
|
||||||
GUI.log(chrome.i18n.getMessage('serialPortOpenFail'));
|
GUI.log(chrome.i18n.getMessage('serialPortOpenFail'));
|
||||||
|
|
||||||
$('div#connectbutton a.connect_state').text(chrome.i18n.getMessage('connect'));
|
var $connectButton = $('#connectbutton');
|
||||||
$('div#connectbutton a.connect').removeClass('active');
|
|
||||||
|
$connectButton.find('.connect_state').text(chrome.i18n.getMessage('connect'));
|
||||||
|
$connectButton.find('.connect').removeClass('active');
|
||||||
|
|
||||||
// unlock port select & baud
|
// unlock port select & baud
|
||||||
$('#port, #baud, #delay').prop('disabled', false);
|
$('#port, #baud, #delay').prop('disabled', false);
|
||||||
|
|
||||||
// reset data
|
// reset data
|
||||||
$('div#connectbutton a.connect').data("clicks", false);
|
$connectButton.find('.connect').data("clicks", false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onConnect() {
|
function onConnect() {
|
||||||
helper.timeout.remove('connecting'); // kill connecting timer
|
helper.timeout.remove('connecting'); // kill connecting timer
|
||||||
$('div#connectbutton a.connect_state').text(chrome.i18n.getMessage('disconnect')).addClass('active');
|
$('#connectbutton a.connect_state').text(chrome.i18n.getMessage('disconnect')).addClass('active');
|
||||||
$('div#connectbutton a.connect').addClass('active');
|
$('#connectbutton a.connect').addClass('active');
|
||||||
$('#tabs ul.mode-disconnected').hide();
|
$('.mode-disconnected').hide();
|
||||||
$('#tabs ul.mode-connected').show();
|
$('.mode-connected').show();
|
||||||
|
|
||||||
MSP.send_message(MSPCodes.MSP_DATAFLASH_SUMMARY, false, false);
|
MSP.send_message(MSPCodes.MSP_DATAFLASH_SUMMARY, false, false);
|
||||||
|
|
||||||
|
@ -363,8 +366,8 @@ function onClosed(result) {
|
||||||
GUI.log(chrome.i18n.getMessage('serialPortClosedFail'));
|
GUI.log(chrome.i18n.getMessage('serialPortClosedFail'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#tabs ul.mode-connected').hide();
|
$('.mode-connected').hide();
|
||||||
$('#tabs ul.mode-disconnected').show();
|
$('.mode-disconnected').show();
|
||||||
|
|
||||||
$('#sensor-status').hide();
|
$('#sensor-status').hide();
|
||||||
$('#portsinput').show();
|
$('#portsinput').show();
|
||||||
|
@ -491,35 +494,6 @@ function lowByte(num) {
|
||||||
return 0x00FF & num;
|
return 0x00FF & num;
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_dataflash_global() {
|
|
||||||
var supportsDataflash = DATAFLASH.totalSize > 0;
|
|
||||||
if (supportsDataflash) {
|
|
||||||
|
|
||||||
$(".noflash_global").css({
|
|
||||||
display: 'none'
|
|
||||||
});
|
|
||||||
|
|
||||||
$(".dataflash-contents_global").css({
|
|
||||||
display: 'block'
|
|
||||||
});
|
|
||||||
|
|
||||||
$(".dataflash-free_global").css({
|
|
||||||
width: (100 - (DATAFLASH.totalSize - DATAFLASH.usedSize) / DATAFLASH.totalSize * 100) + "%",
|
|
||||||
display: 'block'
|
|
||||||
});
|
|
||||||
$(".dataflash-free_global div").text('Dataflash: free ' + formatFilesize(DATAFLASH.totalSize - DATAFLASH.usedSize));
|
|
||||||
} else {
|
|
||||||
$(".noflash_global").css({
|
|
||||||
display: 'block'
|
|
||||||
});
|
|
||||||
|
|
||||||
$(".dataflash-contents_global").css({
|
|
||||||
display: 'none'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function specificByte(num, pos) {
|
function specificByte(num, pos) {
|
||||||
return 0x000000FF & (num >> (8 * pos));
|
return 0x000000FF & (num >> (8 * pos));
|
||||||
}
|
}
|
||||||
|
|
4
main.css
4
main.css
|
@ -1950,3 +1950,7 @@ select {
|
||||||
.jBox-Tooltip {
|
.jBox-Tooltip {
|
||||||
max-width: 180px;
|
max-width: 180px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.spacebottom {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
|
@ -98,6 +98,7 @@
|
||||||
<script type="text/javascript" src="./js/periodicStatusUpdater.js"></script>
|
<script type="text/javascript" src="./js/periodicStatusUpdater.js"></script>
|
||||||
<script type="text/javascript" src="./js/serial_queue.js"></script>
|
<script type="text/javascript" src="./js/serial_queue.js"></script>
|
||||||
<script type="text/javascript" src="./js/msp_balanced_interval.js"></script>
|
<script type="text/javascript" src="./js/msp_balanced_interval.js"></script>
|
||||||
|
<script type="text/javascript" src="./tabs/advanced_tuning.js"></script>
|
||||||
<title></title>
|
<title></title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -257,6 +258,8 @@
|
||||||
title="Failsafe"></a></li>
|
title="Failsafe"></a></li>
|
||||||
<li class="tab_pid_tuning"><a href="#" data-i18n="tabPidTuning" class="tabicon ic_pid"
|
<li class="tab_pid_tuning"><a href="#" data-i18n="tabPidTuning" class="tabicon ic_pid"
|
||||||
title="PID Tuning"></a></li>
|
title="PID Tuning"></a></li>
|
||||||
|
<li class="tab_advanced_tuning"><a href="#" data-i18n="tabAdvancedTuning" class="tabicon ic_advanced" title="Advanced Tuning"></a></li>
|
||||||
|
|
||||||
<li class="tab_receiver"><a href="#" data-i18n="tabReceiver" class="tabicon ic_rx" title="Receiver"></a>
|
<li class="tab_receiver"><a href="#" data-i18n="tabReceiver" class="tabicon ic_rx" title="Receiver"></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="tab_auxiliary"><a href="#" data-i18n="tabAuxiliary" class="tabicon ic_modes"
|
<li class="tab_auxiliary"><a href="#" data-i18n="tabAuxiliary" class="tabicon ic_modes"
|
||||||
|
|
22
main.js
22
main.js
|
@ -38,31 +38,12 @@ $(document).ready(function () {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check release time to inform people in case they are running old release
|
|
||||||
if (CONFIGURATOR.releaseDate > (new Date().getTime() - (86400000 * 60))) { // 1 day = 86400000 miliseconds, * 60 = 2 month window
|
|
||||||
console.log('Application version is valid for another: ' + Math.round((CONFIGURATOR.releaseDate - (new Date().getTime() - (86400000 * 60))) / 86400000) + ' days');
|
|
||||||
} else {
|
|
||||||
console.log('Application version expired');
|
|
||||||
GUI.log('You are using an old version of ' + chrome.runtime.getManifest().name + '. There may be a more recent version with improvements and fixes.');
|
|
||||||
}
|
|
||||||
|
|
||||||
chrome.storage.local.get('logopen', function (result) {
|
chrome.storage.local.get('logopen', function (result) {
|
||||||
if (result.logopen) {
|
if (result.logopen) {
|
||||||
$("#showlog").trigger('click');
|
$("#showlog").trigger('click');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// log webgl capability
|
|
||||||
// it would seem the webgl "enabling" through advanced settings will be ignored in the future
|
|
||||||
// and webgl will be supported if gpu supports it by default (canary 40.0.2175.0), keep an eye on this one
|
|
||||||
var canvas = document.createElement('canvas');
|
|
||||||
if (window.WebGLRenderingContext && (canvas.getContext('webgl') || canvas.getContext('experimental-webgl'))) {
|
|
||||||
googleAnalytics.sendEvent('Capability', 'WebGL', 'true');
|
|
||||||
} else {
|
|
||||||
googleAnalytics.sendEvent('Capability', 'WebGL', 'false');
|
|
||||||
}
|
|
||||||
|
|
||||||
// log library versions in console to make version tracking easier
|
// log library versions in console to make version tracking easier
|
||||||
console.log('Libraries: jQuery - ' + $.fn.jquery + ', d3 - ' + d3.version + ', three.js - ' + THREE.REVISION);
|
console.log('Libraries: jQuery - ' + $.fn.jquery + ', d3 - ' + d3.version + ', three.js - ' + THREE.REVISION);
|
||||||
|
|
||||||
|
@ -181,6 +162,9 @@ $(document).ready(function () {
|
||||||
case 'onboard_logging':
|
case 'onboard_logging':
|
||||||
TABS.onboard_logging.initialize(content_ready);
|
TABS.onboard_logging.initialize(content_ready);
|
||||||
break;
|
break;
|
||||||
|
case 'advanced_tuning':
|
||||||
|
TABS.advanced_tuning.initialize(content_ready);
|
||||||
|
break;
|
||||||
case 'cli':
|
case 'cli':
|
||||||
TABS.cli.initialize(content_ready);
|
TABS.cli.initialize(content_ready);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -112,7 +112,3 @@
|
||||||
.tab-adjustments .adjustment .functionSwitchChannel {
|
.tab-adjustments .adjustment .functionSwitchChannel {
|
||||||
width: 5%;
|
width: 5%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-adjustments .spacebottom {
|
|
||||||
margin-bottom: 15px;
|
|
||||||
}
|
|
||||||
|
|
0
tabs/advanced_tuning.css
Normal file
0
tabs/advanced_tuning.css
Normal file
135
tabs/advanced_tuning.html
Normal file
135
tabs/advanced_tuning.html
Normal file
|
@ -0,0 +1,135 @@
|
||||||
|
<div class="tab-configuration tab-advanced-tuning toolbar_fixed_bottom">
|
||||||
|
<div class="content_wrapper">
|
||||||
|
<div class="tab_title" data-i18n="tabAdvancedTuningTitle">Advanced tuning</div>
|
||||||
|
|
||||||
|
<div class="leftWrapper">
|
||||||
|
<div class="config-section gui_box grey">
|
||||||
|
<div class="gui_box_titlebar">
|
||||||
|
<div class="spacer_box_title" data-i18n="positionHoldConfiguration"></div>
|
||||||
|
</div>
|
||||||
|
<div class="spacer_box">
|
||||||
|
<div class="select">
|
||||||
|
<select id="user-control-mode"></select>
|
||||||
|
<label for="user-control-mode"> <span data-i18n="userControlMode"></span></label>
|
||||||
|
</div>
|
||||||
|
<div class="number">
|
||||||
|
<input id="max-speed" type="number" data-simple-bind="NAV_POSHOLD.maxSpeed" step="1" min="10" max="2000">
|
||||||
|
<label for="max-speed">
|
||||||
|
<span data-i18n="posholdMaxSpeed"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="number">
|
||||||
|
<input id="max-manual-speed" type="number" data-simple-bind="NAV_POSHOLD.maxManualSpeed" step="1" min="10" max="2000">
|
||||||
|
<label for="max-manual-speed">
|
||||||
|
<span data-i18n="posholdMaxManualSpeed"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="number">
|
||||||
|
<input id="max-climb-rate" type="number" data-simple-bind="NAV_POSHOLD.maxClimbRate" step="1" min="10" max="2000">
|
||||||
|
<label for="max-climb-rate">
|
||||||
|
<span data-i18n="posholdMaxClimbRate"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="number">
|
||||||
|
<input id="max-manual-climb-rate" type="number" data-simple-bind="NAV_POSHOLD.maxManualClimbRate" step="1" min="10" max="2000">
|
||||||
|
<label for="max-manual-climb-rate">
|
||||||
|
<span data-i18n="posholdMaxManualClimbRate"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="number">
|
||||||
|
<input id="max-bank-angle" type="number" data-simple-bind="NAV_POSHOLD.maxBankAngle" step="1" min="15" max="45">
|
||||||
|
<label for="max-bank-angle">
|
||||||
|
<span data-i18n="posholdMaxBankAngle"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="checkbox">
|
||||||
|
<input type="checkbox" id="use-mid-throttle" class="toggle" />
|
||||||
|
<label for="use-mid-throttle">
|
||||||
|
<span data-i18n="posholdHoverMidThrottle"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="number">
|
||||||
|
<input id="hover-throttle" type="number" data-simple-bind="NAV_POSHOLD.hoverThrottle" step="1" min="1000" max="2000">
|
||||||
|
<label for="hover-throttle">
|
||||||
|
<span data-i18n="posholdHoverThrottle"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="rightWrapper">
|
||||||
|
|
||||||
|
<div class="config-section gui_box grey">
|
||||||
|
<div class="gui_box_titlebar">
|
||||||
|
<div class="spacer_box_title" data-i18n="positionEstimatorConfiguration"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="spacer_box">
|
||||||
|
<div class="note spacebottom">
|
||||||
|
<div class="note_spacer" >
|
||||||
|
<p data-i18n="positionEstimatorConfigurationDisclaimer"></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="number">
|
||||||
|
<input id="w_z_baro_p" type="number" data-simple-bind="POSITION_ESTIMATOR.w_z_baro_p" step="0.01" min="0" max="10">
|
||||||
|
<label for="w_z_baro_p">
|
||||||
|
<span data-i18n="w_z_baro_p"></span>
|
||||||
|
</label>
|
||||||
|
<div class="helpicon cf_tip" data-i18n_title="w_z_baro_p_help"></div>
|
||||||
|
</div>
|
||||||
|
<div class="number">
|
||||||
|
<input id="w_z_gps_p" type="number" data-simple-bind="POSITION_ESTIMATOR.w_z_gps_p" step="0.01" min="0" max="10">
|
||||||
|
<label for="w_z_gps_p">
|
||||||
|
<span data-i18n="w_z_gps_p"></span>
|
||||||
|
</label>
|
||||||
|
<div class="helpicon cf_tip" data-i18n_title="w_z_gos_p_help"></div>
|
||||||
|
</div>
|
||||||
|
<div class="number">
|
||||||
|
<input id="w_z_gps_v" type="number" data-simple-bind="POSITION_ESTIMATOR.w_z_gps_v" step="0.01" min="0" max="10">
|
||||||
|
<label for="w_z_gps_v">
|
||||||
|
<span data-i18n="w_z_gps_v"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="number">
|
||||||
|
<input id="w_xy_gps_p" type="number" data-simple-bind="POSITION_ESTIMATOR.w_xy_gps_p" step="0.01" min="0" max="10">
|
||||||
|
<label for="w_xy_gps_p">
|
||||||
|
<span data-i18n="w_xy_gps_p"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="number">
|
||||||
|
<input id="w_xy_gps_v" type="number" data-simple-bind="POSITION_ESTIMATOR.w_xy_gps_v" step="0.01" min="0" max="10">
|
||||||
|
<label for="w_xy_gps_v">
|
||||||
|
<span data-i18n="w_xy_gps_v"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="number">
|
||||||
|
<input id="gps_min_sats" type="number" data-simple-bind="POSITION_ESTIMATOR.gps_min_sats" step="1" min="5" max="10">
|
||||||
|
<label for="gps_min_sats">
|
||||||
|
<span data-i18n="gps_min_sats"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="checkbox">
|
||||||
|
<input type="checkbox" id="use_gps_velned" class="toggle" />
|
||||||
|
<label for="use_gps_velned">
|
||||||
|
<span data-i18n="use_gps_velned"></span>
|
||||||
|
</label>
|
||||||
|
<div class="helpicon cf_tip" data-i18n_title="use_gps_velned_help"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="clear-both"></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="content_toolbar">
|
||||||
|
<div class="btn save_btn">
|
||||||
|
<a id="advanced-tuning-save-button" class="save" href="#" data-i18n="advancedTuningSave"></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
93
tabs/advanced_tuning.js
Normal file
93
tabs/advanced_tuning.js
Normal file
|
@ -0,0 +1,93 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
TABS.advanced_tuning = {};
|
||||||
|
|
||||||
|
TABS.advanced_tuning.initialize = function (callback) {
|
||||||
|
|
||||||
|
var loadChainer = new MSPChainerClass(),
|
||||||
|
saveChainer = new MSPChainerClass();
|
||||||
|
|
||||||
|
if (GUI.active_tab != 'advanced_tuning') {
|
||||||
|
GUI.active_tab = 'advanced_tuning';
|
||||||
|
googleAnalytics.sendAppView('AdvancedTuning');
|
||||||
|
}
|
||||||
|
|
||||||
|
loadChainer.setChain([
|
||||||
|
mspHelper.loadNavPosholdConfig,
|
||||||
|
mspHelper.loadPositionEstimationConfig
|
||||||
|
]);
|
||||||
|
loadChainer.setExitPoint(loadHtml);
|
||||||
|
loadChainer.execute();
|
||||||
|
|
||||||
|
saveChainer.setChain([
|
||||||
|
mspHelper.saveNavPosholdConfig,
|
||||||
|
mspHelper.savePositionEstimationConfig,
|
||||||
|
mspHelper.saveToEeprom
|
||||||
|
]);
|
||||||
|
saveChainer.setExitPoint(reboot);
|
||||||
|
|
||||||
|
function loadHtml() {
|
||||||
|
$('#content').load("./tabs/advanced_tuning.html", processHtml);
|
||||||
|
}
|
||||||
|
|
||||||
|
function reboot() {
|
||||||
|
//noinspection JSUnresolvedVariable
|
||||||
|
GUI.log(chrome.i18n.getMessage('configurationEepromSaved'));
|
||||||
|
GUI.tab_switch_cleanup(function () {
|
||||||
|
MSP.send_message(MSPCodes.MSP_SET_REBOOT, false, false, reinitialize);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function reinitialize() {
|
||||||
|
//noinspection JSUnresolvedVariable
|
||||||
|
GUI.log(chrome.i18n.getMessage('deviceRebooting'));
|
||||||
|
GUI.handleReconnect($('.tab_advanced_tuning a'));
|
||||||
|
}
|
||||||
|
|
||||||
|
function processHtml() {
|
||||||
|
|
||||||
|
var $userControlMode = $('#user-control-mode'),
|
||||||
|
$useMidThrottle = $("#use-mid-throttle"),
|
||||||
|
$useGpsVelned = $('#use_gps_velned');
|
||||||
|
|
||||||
|
GUI.fillSelect($userControlMode, FC.getUserControlMode(), NAV_POSHOLD.userControlMode);
|
||||||
|
$userControlMode.val(NAV_POSHOLD.userControlMode);
|
||||||
|
$userControlMode.change(function () {
|
||||||
|
NAV_POSHOLD.userControlMode = $userControlMode.val();
|
||||||
|
});
|
||||||
|
|
||||||
|
$useMidThrottle.prop("checked", NAV_POSHOLD.useThrottleMidForAlthold);
|
||||||
|
$useMidThrottle.change(function () {
|
||||||
|
if ($(this).is(":checked")) {
|
||||||
|
NAV_POSHOLD.useThrottleMidForAlthold = 1;
|
||||||
|
} else {
|
||||||
|
NAV_POSHOLD.useThrottleMidForAlthold = 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$useMidThrottle.change();
|
||||||
|
|
||||||
|
$useGpsVelned.prop("checked", POSITION_ESTIMATOR.use_gps_velned);
|
||||||
|
$useGpsVelned.change(function () {
|
||||||
|
if ($(this).is(":checked")) {
|
||||||
|
POSITION_ESTIMATOR.use_gps_velned = 1;
|
||||||
|
} else {
|
||||||
|
POSITION_ESTIMATOR.use_gps_velned = 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$useGpsVelned.change();
|
||||||
|
|
||||||
|
GUI.simpleBind();
|
||||||
|
|
||||||
|
localize();
|
||||||
|
|
||||||
|
$('#advanced-tuning-save-button').click(function () {
|
||||||
|
saveChainer.execute();
|
||||||
|
});
|
||||||
|
|
||||||
|
GUI.content_ready(callback);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
TABS.advanced_tuning.cleanup = function (callback) {
|
||||||
|
if (callback) callback();
|
||||||
|
};
|
|
@ -193,11 +193,6 @@
|
||||||
line-height: 28px;
|
line-height: 28px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-auxiliary .spacebottom {
|
|
||||||
margin-bottom: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@media only screen and (max-width: 1055px) , only screen and (max-device-width: 1055px) {
|
@media only screen and (max-width: 1055px) , only screen and (max-device-width: 1055px) {
|
||||||
.tab-auxiliary .fixed_band {
|
.tab-auxiliary .fixed_band {
|
||||||
width: calc(100% - -30px);
|
width: calc(100% - -30px);
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.config-section .number input,
|
||||||
.tab-configuration .number input {
|
.tab-configuration .number input {
|
||||||
width: 65px;
|
width: 65px;
|
||||||
padding-left: 3px;
|
padding-left: 3px;
|
||||||
|
@ -38,10 +39,12 @@
|
||||||
background-color: #ececec;
|
background-color: #ececec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.config-section input,
|
||||||
.tab-configuration input {
|
.tab-configuration input {
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.config-section .spacer_box,
|
||||||
.tab-configuration .spacer_box {
|
.tab-configuration .spacer_box {
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
float: left;
|
float: left;
|
||||||
|
@ -62,6 +65,8 @@
|
||||||
border-bottom: 1px solid #ddd;
|
border-bottom: 1px solid #ddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.config-section .number,
|
||||||
|
.config-section .select,
|
||||||
.tab-configuration .number,
|
.tab-configuration .number,
|
||||||
.tab-configuration .select,
|
.tab-configuration .select,
|
||||||
.tab-configuration .radio,
|
.tab-configuration .radio,
|
||||||
|
@ -75,6 +80,8 @@ hr {
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.config-section .number:last-child,
|
||||||
|
.config-section .select:last-child,
|
||||||
.tab-configuration .number:last-child,
|
.tab-configuration .number:last-child,
|
||||||
.tab-configuration .select:last-child,
|
.tab-configuration .select:last-child,
|
||||||
.tab-configuration .radio:last-child,
|
.tab-configuration .radio:last-child,
|
||||||
|
|
|
@ -426,7 +426,3 @@
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
border: 1px dotted white;
|
border: 1px dotted white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-led-strip .spacebottom {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
|
@ -90,10 +90,6 @@
|
||||||
border-right: 0px;
|
border-right: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-ports .spacebottom {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: 1055px) , only screen and (max-device-width: 1055px) {
|
@media only screen and (max-width: 1055px) , only screen and (max-device-width: 1055px) {
|
||||||
.tab-ports table thead tr:first-child {
|
.tab-ports table thead tr:first-child {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
TABS.ports = {};
|
TABS.ports = {};
|
||||||
|
|
||||||
TABS.ports.initialize = function (callback, scrollPosition) {
|
TABS.ports.initialize = function (callback, scrollPosition) {
|
||||||
var self = this;
|
|
||||||
|
|
||||||
var board_definition = {};
|
var board_definition = {};
|
||||||
|
|
||||||
var functionRules = [
|
var functionRules = [
|
||||||
|
@ -15,7 +13,7 @@ TABS.ports.initialize = function (callback, scrollPosition) {
|
||||||
{name: 'TELEMETRY_SMARTPORT', groups: ['telemetry'], maxPorts: 1},
|
{name: 'TELEMETRY_SMARTPORT', groups: ['telemetry'], maxPorts: 1},
|
||||||
{name: 'TELEMETRY_LTM', groups: ['telemetry'], sharableWith: ['msp'], notSharableWith: ['blackbox'], maxPorts: 1},
|
{name: 'TELEMETRY_LTM', groups: ['telemetry'], sharableWith: ['msp'], notSharableWith: ['blackbox'], maxPorts: 1},
|
||||||
{name: 'RX_SERIAL', groups: ['rx'], maxPorts: 1},
|
{name: 'RX_SERIAL', groups: ['rx'], maxPorts: 1},
|
||||||
{name: 'BLACKBOX', groups: ['logging', 'blackbox'], sharableWith: ['msp'], notSharableWith: ['telemetry'], maxPorts: 1},
|
{name: 'BLACKBOX', groups: ['logging', 'blackbox'], sharableWith: ['msp'], notSharableWith: ['telemetry'], maxPorts: 1}
|
||||||
];
|
];
|
||||||
|
|
||||||
if (semver.gte(CONFIG.flightControllerVersion, "1.2.0")) {
|
if (semver.gte(CONFIG.flightControllerVersion, "1.2.0")) {
|
||||||
|
@ -90,7 +88,6 @@ TABS.ports.initialize = function (callback, scrollPosition) {
|
||||||
$('#content').load("./tabs/ports.html", on_tab_loaded_handler);
|
$('#content').load("./tabs/ports.html", on_tab_loaded_handler);
|
||||||
|
|
||||||
board_definition = BOARD.find_board_definition(CONFIG.boardIdentifier);
|
board_definition = BOARD.find_board_definition(CONFIG.boardIdentifier);
|
||||||
console.log('Using board definition', board_definition);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,7 +220,7 @@ TABS.ports.initialize = function (callback, scrollPosition) {
|
||||||
// update configuration based on current ui state
|
// update configuration based on current ui state
|
||||||
SERIAL_CONFIG.ports = [];
|
SERIAL_CONFIG.ports = [];
|
||||||
|
|
||||||
var ports_e = $('.tab-ports .portConfiguration').each(function (portConfiguration_e) {
|
$('.tab-ports .portConfiguration').each(function () {
|
||||||
|
|
||||||
var portConfiguration_e = this;
|
var portConfiguration_e = this;
|
||||||
|
|
||||||
|
@ -238,6 +235,10 @@ TABS.ports.initialize = function (callback, scrollPosition) {
|
||||||
functions.push(telemetryFunction);
|
functions.push(telemetryFunction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (telemetryFunction.length > 0) {
|
||||||
|
googleAnalytics.sendEvent('Setting', 'Telemetry Protocol', telemetryFunction);
|
||||||
|
}
|
||||||
|
|
||||||
var serialPort = {
|
var serialPort = {
|
||||||
functions: functions,
|
functions: functions,
|
||||||
msp_baudrate: $(portConfiguration_e).find('.msp_baudrate').val(),
|
msp_baudrate: $(portConfiguration_e).find('.msp_baudrate').val(),
|
||||||
|
|
|
@ -371,11 +371,15 @@ TABS.profiles.initialize = function (callback, scrollPosition) {
|
||||||
$(this).parent().addClass('active');
|
$(this).parent().addClass('active');
|
||||||
|
|
||||||
$('#save-button').removeClass('disabled');
|
$('#save-button').removeClass('disabled');
|
||||||
|
|
||||||
|
googleAnalytics.sendEvent('Presets', 'Displayed', currentPreset.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#execute-button').click(function () {
|
$('#execute-button').click(function () {
|
||||||
applyAndSave();
|
applyAndSave();
|
||||||
OSD.GUI.jbox.close();
|
OSD.GUI.jbox.close();
|
||||||
|
|
||||||
|
googleAnalytics.sendEvent('Presets', 'Applied', currentPreset.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
localize();
|
localize();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue