Merge pull request #2418 from haslinghuis/DminSwitchPatch

Fix DminSwitch
10.8-maintenance
Michael Keller 2021-02-19 00:52:52 +13:00 committed by GitHub
commit 9c29379534
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 10 deletions

View File

@ -1803,24 +1803,24 @@ TABS.pid_tuning.initialize = function (callback) {
$('#sliderPidsModeSelect').val(FC.TUNING_SLIDERS.slider_pids_mode);
$('#dMinSwitch').change(function() {
if (semver.lt(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
if (semver.lt(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
$('#dMinSwitch').change(function() {
TuningSliders.setDMinFeatureEnabled($(this).is(':checked'));
// switch dmin and dmax values on dmin on/off if sliders available
if (!TuningSliders.pidSlidersUnavailable) {
if (TuningSliders.dMinFeatureEnabled) {
ADVANCED_TUNING.dMinRoll = FC.PIDs[0][2];
ADVANCED_TUNING.dMinPitch = FC.PIDs[1][2];
ADVANCED_TUNING.dMinYaw = FC.PIDs[2][2];
FC.ADVANCED_TUNING.dMinRoll = FC.PIDS[0][2];
FC.ADVANCED_TUNING.dMinPitch = FC.PIDS[1][2];
FC.ADVANCED_TUNING.dMinYaw = FC.PIDS[2][2];
} else {
FC.PIDs[0][2] = ADVANCED_TUNING.dMinRoll;
FC.PIDs[1][2] = ADVANCED_TUNING.dMinPitch;
FC.PIDs[2][2] = ADVANCED_TUNING.dMinYaw;
FC.PIDS[0][2] = FC.ADVANCED_TUNING.dMinRoll;
FC.PIDS[1][2] = FC.ADVANCED_TUNING.dMinPitch;
FC.PIDS[2][2] = FC.ADVANCED_TUNING.dMinYaw;
}
TuningSliders.calculateNewPids();
}
}
});
});
}
// integrated yaw doesn't work with sliders therefore sliders are disabled
$('input[id="useIntegratedYaw"]').change(() => TuningSliders.updatePidSlidersDisplay());