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

remove dd an ff switch

This commit is contained in:
Mark Haslinghuis 2021-10-09 01:39:02 +02:00
parent 348198d9be
commit ae8eebf644
No known key found for this signature in database
GPG key ID: 198B0F616296A584
3 changed files with 9 additions and 41 deletions

View file

@ -400,14 +400,6 @@ TuningSliders.legacyUpdateFilterSlidersDisplay = function() {
}
};
TuningSliders.updateSwitchBoxes = function() {
const FF_SWITCH = FC.ADVANCED_TUNING.feedforwardRoll || FC.ADVANCED_TUNING.feedforwardPitch || FC.ADVANCED_TUNING.feedforwardYaw;
$('input[id="feedforwardGroup"]').prop('checked', FF_SWITCH).trigger('change');
const DMIN_SWITCH = FC.PIDS[0][2] !== FC.ADVANCED_TUNING.dMinRoll || FC.PIDS[1][2] !== FC.ADVANCED_TUNING.dMinPitch || FC.PIDS[2][2] !== FC.ADVANCED_TUNING.dMinYaw;
$('#dMinSwitch').prop('checked', DMIN_SWITCH).trigger('change');
};
TuningSliders.updateSlidersWarning = function(slidersUnavailable = false) {
const WARNING_P_GAIN = 70;
let WARNING_I_GAIN = 120;
@ -664,7 +656,6 @@ TuningSliders.calculateNewPids = function(updateSlidersOnly = false) {
.then(() => {
this.updateFormPids(updateSlidersOnly);
this.updateSlidersWarning();
this.updateSwitchBoxes();
});
} else {
this.legacyCalculatePids(updateSlidersOnly);

View file

@ -499,10 +499,6 @@ TABS.pid_tuning.initialize = function (callback) {
// Feedforward
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
const feedforwardGroupCheck = $('input[id="feedforwardGroup"]');
const PID_FEEDFORWARD = FC.ADVANCED_TUNING.feedforwardRoll || FC.ADVANCED_TUNING.feedforwardPitch || FC.ADVANCED_TUNING.feedforwardYaw;
feedforwardGroupCheck.prop('checked', PID_FEEDFORWARD);
$('.feedforwardGroupCheckbox').addClass('switchery-disabled');
$('select[id="feedforwardAveraging"]').val(FC.ADVANCED_TUNING.feedforward_averaging);
$('input[name="feedforwardSmoothFactor"]').val(FC.ADVANCED_TUNING.feedforward_smooth_factor);
$('input[name="feedforwardBoost"]').val(FC.ADVANCED_TUNING.feedforward_boost);
@ -529,10 +525,6 @@ TABS.pid_tuning.initialize = function (callback) {
$('.thrustLinearization .suboption').toggle(checked);
}).change();
} else {
const checkbox = document.getElementById('feedforwardGroup');
if (checkbox.parentNode) {
checkbox.parentNode.removeChild(checkbox);
}
$('.vbatSagCompensation').hide();
$('.thrustLinearization').hide();
@ -628,7 +620,10 @@ TABS.pid_tuning.initialize = function (callback) {
const dMinSwitch = $('#dMinSwitch');
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
$('.dMinGroupCheckbox').addClass('switchery-disabled');
const box = document.getElementById('dMinSwitch');
if (box.parentNode) {
box.parentNode.removeChild(box);
}
$('.dMinDisabledNote').hide();
} else {
dMinSwitch.prop('checked', FC.ADVANCED_TUNING.dMinRoll > 0 || FC.ADVANCED_TUNING.dMinPitch > 0 || FC.ADVANCED_TUNING.dMinYaw > 0);
@ -1938,15 +1933,15 @@ TABS.pid_tuning.initialize = function (callback) {
TuningSliders.updateFormPids();
TuningSliders.updatePidSlidersDisplay();
const allowRP = !!setMode;
const allowY = setMode !== 1;
const disableRP = !!setMode;
const disableY = setMode > 1;
$('#pid_main .ROLL .pid_data input, #pid_main .PITCH .pid_data input').each(function() {
$(this).prop('disabled', allowRP);
$(this).prop('disabled', disableRP);
});
$('#pid_main .YAW .pid_data input').each(function() {
$(this).prop('disabled', allowY);
$(this).prop('disabled', disableY);
});
}).trigger('change');
}
@ -2013,7 +2008,6 @@ TABS.pid_tuning.initialize = function (callback) {
}
}
TuningSliders.calculateNewPids();
self.updateGuiElements();
self.analyticsChanges['PidTuningSliders'] = "On";
});
if (semver.lt(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
@ -2758,23 +2752,6 @@ TABS.pid_tuning.updatePIDColors = function(clear = false) {
setTuningElementColor($('.pid_tuning .YAW input[name="f"]'), FC.ADVANCED_TUNING_ACTIVE.feedforwardYaw, FC.ADVANCED_TUNING.feedforwardYaw);
};
TABS.pid_tuning.updateGuiElements = function() {
const rollF = parseInt($('.pid_tuning .ROLL input[name="f"]').val());
const pitchF = parseInt($('.pid_tuning .PITCH input[name="f"]').val());
const yawF = parseInt($('.pid_tuning .YAW input[name="f"]').val());
const FF_SWITCH = rollF || pitchF || yawF;
$('input[id="feedforwardGroup"]').prop('checked', FF_SWITCH).trigger('change');
const dRoll = parseInt($('.pid_tuning .ROLL input[name="d"]').val());
const dPitch = parseInt($('.pid_tuning .PITCH input[name="d"]').val());
const dYaw = parseInt($('.pid_tuning .YAW input[name="d"]').val());
const dMinRoll = parseInt($('.pid_tuning input[name="dMinRoll"]').val());
const dMinPitch = parseInt($('.pid_tuning input[name="dMinPitch"]').val());
const dMinYaw = parseInt($('.pid_tuning input[name="dMinYaw"]').val());
const DMAX_GAIN_SWITCH = dRoll !== dMinRoll || dPitch !== dMinPitch || dYaw !== dMinYaw;
$('#dMinSwitch').prop('checked', DMAX_GAIN_SWITCH).trigger('change');
};
TABS.pid_tuning.changeRatesType = function(rateTypeID) {
const self = this;
const dialogRatesType = $('.dialogRatesType')[0];