1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-23 00:05:22 +03:00

Remove VBat PID Compensation

Some api version check fixes

Remove blanck line

More api version fixes

Remove extra parentesix

Removing more parentexis

Rebase fixing
This commit is contained in:
Asizon 2020-07-06 18:49:19 +02:00
parent c59f49d160
commit d2ef89b6a3
3 changed files with 117 additions and 121 deletions

View file

@ -64,6 +64,8 @@ TABS.pid_tuning.initialize = function (callback) {
$('#content').load("./tabs/pid_tuning.html", process_html);
}
const vbatpidcompensationIsUsed = semver.gte(FC.CONFIG.apiVersion, "1.16.0") && semver.lt(FC.CONFIG.apiVersion, API_VERSION_1_44);
function pid_and_rc_to_form() {
self.setProfile();
if (semver.gte(FC.CONFIG.apiVersion, "1.20.0")) {
@ -106,9 +108,8 @@ TABS.pid_tuning.initialize = function (callback) {
$('.pid_tuning input[name="rc_expo"]').attr("rowspan", "3");
}
if (semver.gte(FC.CONFIG.apiVersion, "1.16.0")) {
$('input[id="vbatpidcompensation"]').prop('checked', FC.ADVANCED_TUNING.vbatPidCompensation !== 0);
}
$('.vbatpidcompensation').toggle(vbatpidcompensationIsUsed);
$('input[id="vbatpidcompensation"]').prop('checked', FC.ADVANCED_TUNING.vbatPidCompensation !== 0);
if (semver.gte(FC.CONFIG.apiVersion, "1.16.0")) {
$('#pid-tuning .delta select').val(FC.ADVANCED_TUNING.deltaMethod);
@ -822,7 +823,7 @@ TABS.pid_tuning.initialize = function (callback) {
FC.FILTER_CONFIG.dterm_lowpass_hz = parseInt($('.pid_filter input[name="dtermLowpassFrequency"]').val());
FC.FILTER_CONFIG.yaw_lowpass_hz = parseInt($('.pid_filter input[name="yawLowpassFrequency"]').val());
if (semver.gte(FC.CONFIG.apiVersion, "1.16.0")) {
if (vbatpidcompensationIsUsed) {
const element = $('input[id="vbatpidcompensation"]');
const value = element.is(':checked') ? 1 : 0;
let analyticsValue = undefined;