1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-19 22:35:15 +03:00

references to INAV 1.4 removed

This commit is contained in:
Pawel Spychalski (DzikuVx) 2018-05-07 20:56:00 +02:00
parent 47a063dccd
commit 757ca0f5a1
8 changed files with 182 additions and 241 deletions

View file

@ -519,14 +519,10 @@ var FC = {
); );
} }
if (semver.gte(CONFIG.flightControllerVersion, "1.4.0")) { features.push(
features.push( {bit: 28, group: 'esc-priority', name: 'PWM_OUTPUT_ENABLE', haveTip: true}
{bit: 28, group: 'esc-priority', name: 'PWM_OUTPUT_ENABLE', haveTip: true} );
);
} else {
$('.features.esc-priority').parent().hide();
}
/* /*
* Transponder disabled until not implemented in firmware * Transponder disabled until not implemented in firmware
*/ */

View file

@ -2477,19 +2477,11 @@ var mspHelper = (function (gui) {
}; };
self.loadFilterConfig = function (callback) { self.loadFilterConfig = function (callback) {
if (semver.gte(CONFIG.flightControllerVersion, "1.4.0")) { MSP.send_message(MSPCodes.MSP_FILTER_CONFIG, false, false, callback);
MSP.send_message(MSPCodes.MSP_FILTER_CONFIG, false, false, callback);
} else {
callback();
}
}; };
self.loadPidAdvanced = function (callback) { self.loadPidAdvanced = function (callback) {
if (semver.gte(CONFIG.flightControllerVersion, "1.4.0")) { MSP.send_message(MSPCodes.MSP_PID_ADVANCED, false, false, callback);
MSP.send_message(MSPCodes.MSP_PID_ADVANCED, false, false, callback);
} else {
callback();
}
}; };
self.loadRcTuningData = function (callback) { self.loadRcTuningData = function (callback) {
@ -2605,11 +2597,7 @@ var mspHelper = (function (gui) {
}; };
self.saveFilterConfig = function (callback) { self.saveFilterConfig = function (callback) {
if (semver.gte(CONFIG.flightControllerVersion, "1.4.0")) { MSP.send_message(MSPCodes.MSP_SET_FILTER_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_FILTER_CONFIG), false, callback);
MSP.send_message(MSPCodes.MSP_SET_FILTER_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_FILTER_CONFIG), false, callback);
} else {
callback();
}
}; };
self.savePidData = function (callback) { self.savePidData = function (callback) {
@ -2625,11 +2613,7 @@ var mspHelper = (function (gui) {
}; };
self.savePidAdvanced = function (callback) { self.savePidAdvanced = function (callback) {
if (semver.gte(CONFIG.flightControllerVersion, "1.4.0")) { MSP.send_message(MSPCodes.MSP_SET_PID_ADVANCED, mspHelper.crunch(MSPCodes.MSP_SET_PID_ADVANCED), false, callback);
MSP.send_message(MSPCodes.MSP_SET_PID_ADVANCED, mspHelper.crunch(MSPCodes.MSP_SET_PID_ADVANCED), false, callback);
} else {
callback();
}
}; };
self.saveBfConfig = function (callback) { self.saveBfConfig = function (callback) {

View file

@ -64,11 +64,7 @@ TABS.adjustments.initialize = function (callback) {
// update list of selected functions // update list of selected functions
var functionListOptions = $(functionList).find('option'); var functionListOptions = $(functionList).find('option');
var availableFunctionCount = 15; var availableFunctionCount = 21;
if (semver.gte(CONFIG.flightControllerVersion, '1.4.0')) {
availableFunctionCount = 21;
}
if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) { if (semver.gte(CONFIG.flightControllerVersion, '1.8.1')) {
availableFunctionCount = 32; availableFunctionCount = 32;

View file

@ -317,26 +317,26 @@
</div> </div>
<div class="spacer_box"> <div class="spacer_box">
<div class="select requires-v1_4"> <div class="select">
<select id="gyro-lpf"></select> <select id="gyro-lpf"></select>
<label for="gyro-lpf"> <span data-i18n="configurationGyroLpfTitle"></span></label> <label for="gyro-lpf"> <span data-i18n="configurationGyroLpfTitle"></span></label>
<div class="helpicon cf_tip" data-i18n_title="configurationGyroLpfHelp"></div> <div class="helpicon cf_tip" data-i18n_title="configurationGyroLpfHelp"></div>
</div> </div>
<div class="select requires-v1_4"> <div class="select">
<select id="async-mode"></select> <select id="async-mode"></select>
<label for="async-mode"> <span data-i18n="configurationAsyncMode"></span></label> <label for="async-mode"> <span data-i18n="configurationAsyncMode"></span></label>
<div class="helpicon cf_tip" data-i18n_title="configurationAsyncModeHelp"></div> <div class="helpicon cf_tip" data-i18n_title="configurationAsyncModeHelp"></div>
</div> </div>
<div id="gyro-sync-wrapper" class="checkbox requires-v1_4"> <div id="gyro-sync-wrapper" class="checkbox">
<input type="checkbox" id="gyro-sync-checkbox" class="toggle" /> <input type="checkbox" id="gyro-sync-checkbox" class="toggle" />
<label for="gyro-sync-checkbox"> <label for="gyro-sync-checkbox">
<span data-i18n="configurationGyroSyncTitle"></span> <span data-i18n="configurationGyroSyncTitle"></span>
</label> </label>
</div> </div>
<div id="gyro-frequency-wrapper" class="checkbox requires-v1_4"> <div id="gyro-frequency-wrapper" class="checkbox">
<select id="gyro-frequency"></select> <select id="gyro-frequency"></select>
<label for="gyro-frequency"> <label for="gyro-frequency">
<span data-i18n="configurationGyroFrequencyTitle"></span> <span data-i18n="configurationGyroFrequencyTitle"></span>
@ -344,7 +344,7 @@
<div class="helpicon cf_tip" data-i18n_title="configurationGyroFrequencyHelp"></div> <div class="helpicon cf_tip" data-i18n_title="configurationGyroFrequencyHelp"></div>
</div> </div>
<div id="accelerometer-frequency-wrapper" class="checkbox requires-v1_4"> <div id="accelerometer-frequency-wrapper" class="checkbox">
<select id="accelerometer-frequency"></select> <select id="accelerometer-frequency"></select>
<label for="accelerometer-frequency"> <label for="accelerometer-frequency">
<span data-i18n="configurationAccelerometerFrequencyTitle"></span> <span data-i18n="configurationAccelerometerFrequencyTitle"></span>
@ -352,7 +352,7 @@
<div class="helpicon cf_tip" data-i18n_title="configurationAccelerometerFrequencyHelp"></div> <div class="helpicon cf_tip" data-i18n_title="configurationAccelerometerFrequencyHelp"></div>
</div> </div>
<div id="attitude-frequency-wrapper" class="checkbox requires-v1_4"> <div id="attitude-frequency-wrapper" class="checkbox">
<select id="attitude-frequency"></select> <select id="attitude-frequency"></select>
<label for="attitude-frequency"> <label for="attitude-frequency">
<span data-i18n="configurationAttitudeFrequencyTitle"></span> <span data-i18n="configurationAttitudeFrequencyTitle"></span>

View file

@ -421,125 +421,111 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
var $looptime = $("#looptime"); var $looptime = $("#looptime");
if (semver.gte(CONFIG.flightControllerVersion, "1.4.0")) { var $gyroLpf = $("#gyro-lpf"),
$(".requires-v1_4").show(); $gyroSync = $("#gyro-sync-checkbox"),
$asyncMode = $('#async-mode'),
$gyroFrequency = $('#gyro-frequency'),
$accelerometerFrequency = $('#accelerometer-frequency'),
$attitudeFrequency = $('#attitude-frequency');
var $gyroLpf = $("#gyro-lpf"), var values = FC.getGyroLpfValues();
$gyroSync = $("#gyro-sync-checkbox"),
$asyncMode = $('#async-mode'),
$gyroFrequency = $('#gyro-frequency'),
$accelerometerFrequency = $('#accelerometer-frequency'),
$attitudeFrequency = $('#attitude-frequency');
var values = FC.getGyroLpfValues(); for (i in values) {
if (values.hasOwnProperty(i)) {
for (i in values) { //noinspection JSUnfilteredForInLoop
if (values.hasOwnProperty(i)) { $gyroLpf.append('<option value="' + i + '">' + values[i].label + '</option>');
//noinspection JSUnfilteredForInLoop
$gyroLpf.append('<option value="' + i + '">' + values[i].label + '</option>');
}
} }
$gyroLpf.val(INAV_PID_CONFIG.gyroscopeLpf);
$gyroSync.prop("checked", ADVANCED_CONFIG.gyroSync);
$gyroLpf.change(function () {
INAV_PID_CONFIG.gyroscopeLpf = $gyroLpf.val();
GUI.fillSelect(
$looptime,
FC.getLooptimes()[FC.getGyroLpfValues()[INAV_PID_CONFIG.gyroscopeLpf].tick].looptimes,
FC_CONFIG.loopTime,
'Hz'
);
$looptime.val(FC.getLooptimes()[FC.getGyroLpfValues()[INAV_PID_CONFIG.gyroscopeLpf].tick].defaultLooptime);
$looptime.change();
GUI.fillSelect($gyroFrequency, FC.getGyroFrequencies()[FC.getGyroLpfValues()[INAV_PID_CONFIG.gyroscopeLpf].tick].looptimes);
$gyroFrequency.val(FC.getLooptimes()[FC.getGyroLpfValues()[INAV_PID_CONFIG.gyroscopeLpf].tick].defaultLooptime);
$gyroFrequency.change();
});
$gyroLpf.change();
$looptime.val(FC_CONFIG.loopTime);
$looptime.change(function () {
FC_CONFIG.loopTime = $(this).val();
if (INAV_PID_CONFIG.asynchronousMode == 0) {
//All task running together
ADVANCED_CONFIG.gyroSyncDenominator = Math.floor(FC_CONFIG.loopTime / FC.getGyroLpfValues()[INAV_PID_CONFIG.gyroscopeLpf].tick);
}
});
$looptime.change();
$gyroFrequency.val(ADVANCED_CONFIG.gyroSyncDenominator * FC.getGyroLpfValues()[INAV_PID_CONFIG.gyroscopeLpf].tick);
$gyroFrequency.change(function () {
ADVANCED_CONFIG.gyroSyncDenominator = Math.floor($gyroFrequency.val() / FC.getGyroLpfValues()[INAV_PID_CONFIG.gyroscopeLpf].tick);
});
$gyroSync.change(function () {
if ($(this).is(":checked")) {
ADVANCED_CONFIG.gyroSync = 1;
} else {
ADVANCED_CONFIG.gyroSync = 0;
}
});
$gyroSync.change();
/*
* Async mode select
*/
GUI.fillSelect($asyncMode, FC.getAsyncModes());
$asyncMode.val(INAV_PID_CONFIG.asynchronousMode);
$asyncMode.change(function () {
INAV_PID_CONFIG.asynchronousMode = $asyncMode.val();
if (INAV_PID_CONFIG.asynchronousMode == 0) {
$('#gyro-sync-wrapper').show();
$('#gyro-frequency-wrapper').hide();
$('#accelerometer-frequency-wrapper').hide();
$('#attitude-frequency-wrapper').hide();
} else if (INAV_PID_CONFIG.asynchronousMode == 1) {
$('#gyro-sync-wrapper').hide();
$('#gyro-frequency-wrapper').show();
$('#accelerometer-frequency-wrapper').hide();
$('#attitude-frequency-wrapper').hide();
ADVANCED_CONFIG.gyroSync = 1;
} else {
$('#gyro-sync-wrapper').hide();
$('#gyro-frequency-wrapper').show();
$('#accelerometer-frequency-wrapper').show();
$('#attitude-frequency-wrapper').show();
ADVANCED_CONFIG.gyroSync = 1;
}
});
$asyncMode.change();
GUI.fillSelect($accelerometerFrequency, FC.getAccelerometerTaskFrequencies(), INAV_PID_CONFIG.accelerometerTaskFrequency, 'Hz');
$accelerometerFrequency.val(INAV_PID_CONFIG.accelerometerTaskFrequency);
$accelerometerFrequency.change(function () {
INAV_PID_CONFIG.accelerometerTaskFrequency = $accelerometerFrequency.val();
});
GUI.fillSelect($attitudeFrequency, FC.getAttitudeTaskFrequencies(), INAV_PID_CONFIG.attitudeTaskFrequency, 'Hz');
$attitudeFrequency.val(INAV_PID_CONFIG.attitudeTaskFrequency);
$attitudeFrequency.change(function () {
INAV_PID_CONFIG.attitudeTaskFrequency = $attitudeFrequency.val();
});
} else {
GUI.fillSelect($looptime, FC.getLooptimes()[125].looptimes, FC_CONFIG.loopTime, 'Hz');
$looptime.val(FC_CONFIG.loopTime);
$looptime.change(function () {
FC_CONFIG.loopTime = $(this).val();
});
$(".requires-v1_4").hide();
} }
$gyroLpf.val(INAV_PID_CONFIG.gyroscopeLpf);
$gyroSync.prop("checked", ADVANCED_CONFIG.gyroSync);
$gyroLpf.change(function () {
INAV_PID_CONFIG.gyroscopeLpf = $gyroLpf.val();
GUI.fillSelect(
$looptime,
FC.getLooptimes()[FC.getGyroLpfValues()[INAV_PID_CONFIG.gyroscopeLpf].tick].looptimes,
FC_CONFIG.loopTime,
'Hz'
);
$looptime.val(FC.getLooptimes()[FC.getGyroLpfValues()[INAV_PID_CONFIG.gyroscopeLpf].tick].defaultLooptime);
$looptime.change();
GUI.fillSelect($gyroFrequency, FC.getGyroFrequencies()[FC.getGyroLpfValues()[INAV_PID_CONFIG.gyroscopeLpf].tick].looptimes);
$gyroFrequency.val(FC.getLooptimes()[FC.getGyroLpfValues()[INAV_PID_CONFIG.gyroscopeLpf].tick].defaultLooptime);
$gyroFrequency.change();
});
$gyroLpf.change();
$looptime.val(FC_CONFIG.loopTime);
$looptime.change(function () {
FC_CONFIG.loopTime = $(this).val();
if (INAV_PID_CONFIG.asynchronousMode == 0) {
//All task running together
ADVANCED_CONFIG.gyroSyncDenominator = Math.floor(FC_CONFIG.loopTime / FC.getGyroLpfValues()[INAV_PID_CONFIG.gyroscopeLpf].tick);
}
});
$looptime.change();
$gyroFrequency.val(ADVANCED_CONFIG.gyroSyncDenominator * FC.getGyroLpfValues()[INAV_PID_CONFIG.gyroscopeLpf].tick);
$gyroFrequency.change(function () {
ADVANCED_CONFIG.gyroSyncDenominator = Math.floor($gyroFrequency.val() / FC.getGyroLpfValues()[INAV_PID_CONFIG.gyroscopeLpf].tick);
});
$gyroSync.change(function () {
if ($(this).is(":checked")) {
ADVANCED_CONFIG.gyroSync = 1;
} else {
ADVANCED_CONFIG.gyroSync = 0;
}
});
$gyroSync.change();
/*
* Async mode select
*/
GUI.fillSelect($asyncMode, FC.getAsyncModes());
$asyncMode.val(INAV_PID_CONFIG.asynchronousMode);
$asyncMode.change(function () {
INAV_PID_CONFIG.asynchronousMode = $asyncMode.val();
if (INAV_PID_CONFIG.asynchronousMode == 0) {
$('#gyro-sync-wrapper').show();
$('#gyro-frequency-wrapper').hide();
$('#accelerometer-frequency-wrapper').hide();
$('#attitude-frequency-wrapper').hide();
} else if (INAV_PID_CONFIG.asynchronousMode == 1) {
$('#gyro-sync-wrapper').hide();
$('#gyro-frequency-wrapper').show();
$('#accelerometer-frequency-wrapper').hide();
$('#attitude-frequency-wrapper').hide();
ADVANCED_CONFIG.gyroSync = 1;
} else {
$('#gyro-sync-wrapper').hide();
$('#gyro-frequency-wrapper').show();
$('#accelerometer-frequency-wrapper').show();
$('#attitude-frequency-wrapper').show();
ADVANCED_CONFIG.gyroSync = 1;
}
});
$asyncMode.change();
GUI.fillSelect($accelerometerFrequency, FC.getAccelerometerTaskFrequencies(), INAV_PID_CONFIG.accelerometerTaskFrequency, 'Hz');
$accelerometerFrequency.val(INAV_PID_CONFIG.accelerometerTaskFrequency);
$accelerometerFrequency.change(function () {
INAV_PID_CONFIG.accelerometerTaskFrequency = $accelerometerFrequency.val();
});
GUI.fillSelect($attitudeFrequency, FC.getAttitudeTaskFrequencies(), INAV_PID_CONFIG.attitudeTaskFrequency, 'Hz');
$attitudeFrequency.val(INAV_PID_CONFIG.attitudeTaskFrequency);
$attitudeFrequency.change(function () {
INAV_PID_CONFIG.attitudeTaskFrequency = $attitudeFrequency.val();
});
if (semver.gte(CONFIG.flightControllerVersion, "1.5.0")) { if (semver.gte(CONFIG.flightControllerVersion, "1.5.0")) {
var $sensorAcc = $('#sensor-acc'), var $sensorAcc = $('#sensor-acc'),

View file

@ -185,7 +185,7 @@
<input type="number" name="manual_yaw" class="rate-tpa_input" step="1" min="0" max="100" /> % <input type="number" name="manual_yaw" class="rate-tpa_input" step="1" min="0" max="100" /> %
</td> </td>
</tr> </tr>
<tr class="requires-v1_4"> <tr>
<th data-i18n="magHoldYawRate"></th> <th data-i18n="magHoldYawRate"></th>
<td > <td >
<input type="number" id="magHoldYawRate" class="rate-tpa_input" step="5" min="10" max="250" /> degrees per second <input type="number" id="magHoldYawRate" class="rate-tpa_input" step="5" min="10" max="250" /> degrees per second
@ -198,8 +198,8 @@
</div> </div>
</form> </form>
<div class="clear-both"></div> <div class="clear-both"></div>
<div class="tab_title requires-v1_4" data-i18n="tabFiltering" style="margin-top: 1em;"></div> <div class="tab_title" data-i18n="tabFiltering" style="margin-top: 1em;"></div>
<div class="cf_column half requires-v1_4"> <div class="cf_column half">
<table class="rate-tpa rate-tpa--filtering"> <table class="rate-tpa rate-tpa--filtering">
<tbody> <tbody>
<tr> <tr>
@ -249,7 +249,7 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="cf_column half requires-v1_4"> <div class="cf_column half">
<table class="spacer_left rate-tpa rate-tpa--filtering"> <table class="spacer_left rate-tpa rate-tpa--filtering">
<tbody> <tbody>
<tr> <tr>
@ -284,9 +284,9 @@
</table> </table>
</div> </div>
<div class="clear-both requires-v1_4"></div> <div class="clear-both"></div>
<div class="tab_title requires-v1_4" data-i18n="tabMisc" style="margin-top: 1em;"></div> <div class="tab_title" data-i18n="tabMisc" style="margin-top: 1em;"></div>
<div class="cf_column half requires-v1_4"> <div class="cf_column half">
<table class="rate-tpa rate-tpa--misc"> <table class="rate-tpa rate-tpa--misc">
<tr> <tr>
<th data-i18n="yawJumpPreventionLimit"></th> <th data-i18n="yawJumpPreventionLimit"></th>
@ -318,7 +318,7 @@
</tr> </tr>
</table> </table>
</div> </div>
<div class="cf_column half requires-v1_4"> <div class="cf_column half">
<table class="spacer_left rate-tpa rate-tpa--filtering"> <table class="spacer_left rate-tpa rate-tpa--filtering">
<tbody> <tbody>
<tr> <tr>

View file

@ -133,79 +133,73 @@ TABS.pid_tuning.initialize = function (callback) {
pid_and_rc_to_form(); pid_and_rc_to_form();
if (semver.gte(CONFIG.flightControllerVersion, "1.4.0")) { var $magHoldYawRate = $("#magHoldYawRate"),
var $magHoldYawRate = $("#magHoldYawRate"), $yawJumpPreventionLimit = $('#yawJumpPreventionLimit'),
$yawJumpPreventionLimit = $('#yawJumpPreventionLimit'), $yawPLimit = $('#yawPLimit'),
$yawPLimit = $('#yawPLimit'), $gyroSoftLpfHz = $('#gyroSoftLpfHz'),
$gyroSoftLpfHz = $('#gyroSoftLpfHz'), $accSoftLpfHz = $('#accSoftLpfHz'),
$accSoftLpfHz = $('#accSoftLpfHz'), $dtermLpfHz = $('#dtermLpfHz'),
$dtermLpfHz = $('#dtermLpfHz'), $yawLpfHz = $('#yawLpfHz'),
$yawLpfHz = $('#yawLpfHz'), $rollPitchItermIgnoreRate = $('#rollPitchItermIgnoreRate'),
$rollPitchItermIgnoreRate = $('#rollPitchItermIgnoreRate'), $yawItermIgnoreRate = $('#yawItermIgnoreRate'),
$yawItermIgnoreRate = $('#yawItermIgnoreRate'), $axisAccelerationLimitRollPitch = $('#axisAccelerationLimitRollPitch'),
$axisAccelerationLimitRollPitch = $('#axisAccelerationLimitRollPitch'), $axisAccelerationLimitYaw = $('#axisAccelerationLimitYaw');
$axisAccelerationLimitYaw = $('#axisAccelerationLimitYaw');
$magHoldYawRate.val(INAV_PID_CONFIG.magHoldRateLimit); $magHoldYawRate.val(INAV_PID_CONFIG.magHoldRateLimit);
$yawJumpPreventionLimit.val(INAV_PID_CONFIG.yawJumpPreventionLimit); $yawJumpPreventionLimit.val(INAV_PID_CONFIG.yawJumpPreventionLimit);
$yawPLimit.val(PID_ADVANCED.yawPLimit); $yawPLimit.val(PID_ADVANCED.yawPLimit);
$gyroSoftLpfHz.val(FILTER_CONFIG.gyroSoftLpfHz); $gyroSoftLpfHz.val(FILTER_CONFIG.gyroSoftLpfHz);
$accSoftLpfHz.val(INAV_PID_CONFIG.accSoftLpfHz); $accSoftLpfHz.val(INAV_PID_CONFIG.accSoftLpfHz);
$dtermLpfHz.val(FILTER_CONFIG.dtermLpfHz); $dtermLpfHz.val(FILTER_CONFIG.dtermLpfHz);
$yawLpfHz.val(FILTER_CONFIG.yawLpfHz); $yawLpfHz.val(FILTER_CONFIG.yawLpfHz);
$rollPitchItermIgnoreRate.val(PID_ADVANCED.rollPitchItermIgnoreRate); $rollPitchItermIgnoreRate.val(PID_ADVANCED.rollPitchItermIgnoreRate);
$yawItermIgnoreRate.val(PID_ADVANCED.yawItermIgnoreRate); $yawItermIgnoreRate.val(PID_ADVANCED.yawItermIgnoreRate);
$axisAccelerationLimitRollPitch.val(PID_ADVANCED.axisAccelerationLimitRollPitch * 10); $axisAccelerationLimitRollPitch.val(PID_ADVANCED.axisAccelerationLimitRollPitch * 10);
$axisAccelerationLimitYaw.val(PID_ADVANCED.axisAccelerationLimitYaw * 10); $axisAccelerationLimitYaw.val(PID_ADVANCED.axisAccelerationLimitYaw * 10);
$magHoldYawRate.change(function () { $magHoldYawRate.change(function () {
INAV_PID_CONFIG.magHoldRateLimit = parseInt($magHoldYawRate.val(), 10); INAV_PID_CONFIG.magHoldRateLimit = parseInt($magHoldYawRate.val(), 10);
}); });
$yawJumpPreventionLimit.change(function () { $yawJumpPreventionLimit.change(function () {
INAV_PID_CONFIG.yawJumpPreventionLimit = parseInt($yawJumpPreventionLimit.val(), 10); INAV_PID_CONFIG.yawJumpPreventionLimit = parseInt($yawJumpPreventionLimit.val(), 10);
}); });
$yawPLimit.change(function () { $yawPLimit.change(function () {
PID_ADVANCED.yawPLimit = parseInt($yawPLimit.val(), 10); PID_ADVANCED.yawPLimit = parseInt($yawPLimit.val(), 10);
}); });
$gyroSoftLpfHz.change(function () { $gyroSoftLpfHz.change(function () {
FILTER_CONFIG.gyroSoftLpfHz = parseInt($gyroSoftLpfHz.val(), 10); FILTER_CONFIG.gyroSoftLpfHz = parseInt($gyroSoftLpfHz.val(), 10);
}); });
$accSoftLpfHz.change(function () { $accSoftLpfHz.change(function () {
INAV_PID_CONFIG.accSoftLpfHz = parseInt($accSoftLpfHz.val(), 10); INAV_PID_CONFIG.accSoftLpfHz = parseInt($accSoftLpfHz.val(), 10);
}); });
$dtermLpfHz.change(function () { $dtermLpfHz.change(function () {
FILTER_CONFIG.dtermLpfHz = parseInt($dtermLpfHz.val(), 10); FILTER_CONFIG.dtermLpfHz = parseInt($dtermLpfHz.val(), 10);
}); });
$yawLpfHz.change(function () { $yawLpfHz.change(function () {
FILTER_CONFIG.yawLpfHz = parseInt($yawLpfHz.val(), 10); FILTER_CONFIG.yawLpfHz = parseInt($yawLpfHz.val(), 10);
}); });
$rollPitchItermIgnoreRate.change(function () { $rollPitchItermIgnoreRate.change(function () {
PID_ADVANCED.rollPitchItermIgnoreRate = parseInt($rollPitchItermIgnoreRate.val(), 10); PID_ADVANCED.rollPitchItermIgnoreRate = parseInt($rollPitchItermIgnoreRate.val(), 10);
}); });
$yawItermIgnoreRate.change(function () { $yawItermIgnoreRate.change(function () {
PID_ADVANCED.yawItermIgnoreRate = parseInt($yawItermIgnoreRate.val(), 10); PID_ADVANCED.yawItermIgnoreRate = parseInt($yawItermIgnoreRate.val(), 10);
}); });
$axisAccelerationLimitRollPitch.change(function () { $axisAccelerationLimitRollPitch.change(function () {
PID_ADVANCED.axisAccelerationLimitRollPitch = Math.round(parseInt($axisAccelerationLimitRollPitch.val(), 10) / 10); PID_ADVANCED.axisAccelerationLimitRollPitch = Math.round(parseInt($axisAccelerationLimitRollPitch.val(), 10) / 10);
}); });
$axisAccelerationLimitYaw.change(function () { $axisAccelerationLimitYaw.change(function () {
PID_ADVANCED.axisAccelerationLimitYaw = Math.round(parseInt($axisAccelerationLimitYaw.val(), 10) / 10); PID_ADVANCED.axisAccelerationLimitYaw = Math.round(parseInt($axisAccelerationLimitYaw.val(), 10) / 10);
}); });
$('.requires-v1_4').show();
} else {
$('.requires-v1_4').hide();
}
if (semver.gte(CONFIG.flightControllerVersion, "1.6.0")) { if (semver.gte(CONFIG.flightControllerVersion, "1.6.0")) {
$('.requires-v1_6').show(); $('.requires-v1_6').show();
@ -241,30 +235,15 @@ TABS.pid_tuning.initialize = function (callback) {
} }
function saveINAVPidConfig() { function saveINAVPidConfig() {
var next_callback = savePidAdvanced; MSP.send_message(MSPCodes.MSP_SET_INAV_PID, mspHelper.crunch(MSPCodes.MSP_SET_INAV_PID), false, savePidAdvanced);
if(semver.gte(CONFIG.flightControllerVersion, "1.4.0")) {
MSP.send_message(MSPCodes.MSP_SET_INAV_PID, mspHelper.crunch(MSPCodes.MSP_SET_INAV_PID), false, next_callback);
} else {
next_callback();
}
} }
function savePidAdvanced() { function savePidAdvanced() {
var next_callback = saveFilterConfig; MSP.send_message(MSPCodes.MSP_SET_PID_ADVANCED, mspHelper.crunch(MSPCodes.MSP_SET_PID_ADVANCED), false, saveFilterConfig);
if(semver.gte(CONFIG.flightControllerVersion, "1.4.0")) {
MSP.send_message(MSPCodes.MSP_SET_PID_ADVANCED, mspHelper.crunch(MSPCodes.MSP_SET_PID_ADVANCED), false, next_callback);
} else {
next_callback();
}
} }
function saveFilterConfig() { function saveFilterConfig() {
var next_callback = save_to_eeprom; MSP.send_message(MSPCodes.MSP_SET_FILTER_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_FILTER_CONFIG), false, save_to_eeprom);
if(semver.gte(CONFIG.flightControllerVersion, "1.4.0")) {
MSP.send_message(MSPCodes.MSP_SET_FILTER_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_FILTER_CONFIG), false, next_callback);
} else {
next_callback();
}
} }
function save_to_eeprom() { function save_to_eeprom() {

View file

@ -39,7 +39,7 @@ TABS.setup.initialize = function (callback) {
// translate to user-selected language // translate to user-selected language
localize(); localize();
if (semver.gte(CONFIG.flightControllerVersion, '1.4.0') && !FC.isMotorOutputEnabled()) { if (!FC.isMotorOutputEnabled()) {
GUI_control.prototype.log("<span style='color: red; font-weight: bolder'><strong>" + chrome.i18n.getMessage("logPwmOutputDisabled") + "</strong></span>"); GUI_control.prototype.log("<span style='color: red; font-weight: bolder'><strong>" + chrome.i18n.getMessage("logPwmOutputDisabled") + "</strong></span>");
} }