Skip to content

Commit 9c29379

Browse files
authored
Merge pull request #2418 from haslinghuis/DminSwitchPatch
Fix DminSwitch
2 parents 4165f58 + 4392e57 commit 9c29379

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/js/tabs/pid_tuning.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -1803,24 +1803,24 @@ TABS.pid_tuning.initialize = function (callback) {
18031803

18041804
$('#sliderPidsModeSelect').val(FC.TUNING_SLIDERS.slider_pids_mode);
18051805

1806-
$('#dMinSwitch').change(function() {
1807-
if (semver.lt(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
1806+
if (semver.lt(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
1807+
$('#dMinSwitch').change(function() {
18081808
TuningSliders.setDMinFeatureEnabled($(this).is(':checked'));
18091809
// switch dmin and dmax values on dmin on/off if sliders available
18101810
if (!TuningSliders.pidSlidersUnavailable) {
18111811
if (TuningSliders.dMinFeatureEnabled) {
1812-
ADVANCED_TUNING.dMinRoll = FC.PIDs[0][2];
1813-
ADVANCED_TUNING.dMinPitch = FC.PIDs[1][2];
1814-
ADVANCED_TUNING.dMinYaw = FC.PIDs[2][2];
1812+
FC.ADVANCED_TUNING.dMinRoll = FC.PIDS[0][2];
1813+
FC.ADVANCED_TUNING.dMinPitch = FC.PIDS[1][2];
1814+
FC.ADVANCED_TUNING.dMinYaw = FC.PIDS[2][2];
18151815
} else {
1816-
FC.PIDs[0][2] = ADVANCED_TUNING.dMinRoll;
1817-
FC.PIDs[1][2] = ADVANCED_TUNING.dMinPitch;
1818-
FC.PIDs[2][2] = ADVANCED_TUNING.dMinYaw;
1816+
FC.PIDS[0][2] = FC.ADVANCED_TUNING.dMinRoll;
1817+
FC.PIDS[1][2] = FC.ADVANCED_TUNING.dMinPitch;
1818+
FC.PIDS[2][2] = FC.ADVANCED_TUNING.dMinYaw;
18191819
}
18201820
TuningSliders.calculateNewPids();
18211821
}
1822-
}
1823-
});
1822+
});
1823+
}
18241824

18251825
// integrated yaw doesn't work with sliders therefore sliders are disabled
18261826
$('input[id="useIntegratedYaw"]').change(() => TuningSliders.updatePidSlidersDisplay());

0 commit comments

Comments
 (0)