mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-26 17:55:24 +03:00
Prevent changing profiles is settings are not saved
This commit is contained in:
parent
27ad23c970
commit
f893a87073
3 changed files with 45 additions and 72 deletions
|
@ -45,7 +45,7 @@ const D_MIN_RATIO = 0.85;
|
|||
|
||||
TuningSliders.saveInitialSettings = function () {
|
||||
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
|
||||
this.initialSettings.sliderPidsMode = FC.TUNING_SLIDERS.slider_pids_mode;
|
||||
this.initialSettings.sliderPidsModeSelect = FC.TUNING_SLIDERS.slider_pids_mode;
|
||||
this.initialSettings.sliderDGain = FC.TUNING_SLIDERS.slider_d_gain / 100;
|
||||
this.initialSettings.sliderPIGain = FC.TUNING_SLIDERS.slider_pi_gain / 100;
|
||||
this.initialSettings.sliderFeedforwardGain = FC.TUNING_SLIDERS.slider_feedforward_gain / 100;
|
||||
|
@ -63,11 +63,7 @@ TuningSliders.saveInitialSettings = function () {
|
|||
|
||||
TuningSliders.restoreInitialSettings = function () {
|
||||
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
|
||||
if (this.sliderModeHasChanged && this.initialSetting.sliderPidsMode !== this.sliderPidsmode) {
|
||||
$('#sliderPidsModeSelect').val(this.initialSettings.sliderPidsMode).trigger('change');
|
||||
}
|
||||
|
||||
FC.TUNING_SLIDERS.slider_pids_mode = this.initialSettings.sliderPidsMode;
|
||||
FC.TUNING_SLIDERS.slider_pids_mode = this.initialSettings.sliderPidsModeSelect;
|
||||
|
||||
FC.TUNING_SLIDERS.slider_d_gain = Math.round(this.initialSettings.sliderDGain * 20) * 5;
|
||||
FC.TUNING_SLIDERS.slider_pi_gain = Math.round(this.initialSettings.sliderPIGain * 20) * 5;
|
||||
|
@ -88,12 +84,12 @@ TuningSliders.restoreInitialSettings = function () {
|
|||
.then(() => MSP.promise(MSPCodes.MSP_PID_ADVANCED))
|
||||
.then(() => MSP.promise(MSPCodes.MSP_FILTER_CONFIG))
|
||||
.then(() => {
|
||||
TABS.pid_tuning.configChanges = {};
|
||||
if (GUI.active_tab === 'pid_tuning') {
|
||||
this.updateFormPids();
|
||||
TABS.pid_tuning.updatePIDColors();
|
||||
}
|
||||
});
|
||||
TABS.pid_tuning.sliderRetainConfiguration = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue