mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 08:15:22 +03:00
Fix max cutoff when reactivating notch
This commit is contained in:
parent
ece187ca31
commit
b6fdc0ea06
1 changed files with 10 additions and 6 deletions
|
@ -304,7 +304,8 @@ TABS.pid_tuning.initialize = function (callback) {
|
||||||
var hz = FILTER_CONFIG.gyro_notch_hz > 0 ? FILTER_CONFIG.gyro_notch_hz : DEFAULT.gyro_notch_hz;
|
var hz = FILTER_CONFIG.gyro_notch_hz > 0 ? FILTER_CONFIG.gyro_notch_hz : DEFAULT.gyro_notch_hz;
|
||||||
var cutoff = FILTER_CONFIG.gyro_notch_cutoff > 0 ? FILTER_CONFIG.gyro_notch_cutoff : DEFAULT.gyro_notch_cutoff;
|
var cutoff = FILTER_CONFIG.gyro_notch_cutoff > 0 ? FILTER_CONFIG.gyro_notch_cutoff : DEFAULT.gyro_notch_cutoff;
|
||||||
|
|
||||||
$('.pid_filter input[name="gyroNotch1Frequency"]').val(checked ? hz : 0).attr('disabled', !checked);
|
$('.pid_filter input[name="gyroNotch1Frequency"]').val(checked ? hz : 0).attr('disabled', !checked)
|
||||||
|
.attr("min", checked ? 1 : 0).change();
|
||||||
$('.pid_filter input[name="gyroNotch1Cutoff"]').attr('disabled', !checked);
|
$('.pid_filter input[name="gyroNotch1Cutoff"]').attr('disabled', !checked);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -313,7 +314,8 @@ TABS.pid_tuning.initialize = function (callback) {
|
||||||
var hz = FILTER_CONFIG.gyro_notch2_hz > 0 ? FILTER_CONFIG.gyro_notch2_hz : DEFAULT.gyro_notch2_hz;
|
var hz = FILTER_CONFIG.gyro_notch2_hz > 0 ? FILTER_CONFIG.gyro_notch2_hz : DEFAULT.gyro_notch2_hz;
|
||||||
var cutoff = FILTER_CONFIG.gyro_notch2_cutoff > 0 ? FILTER_CONFIG.gyro_notch2_cutoff : DEFAULT.gyro_notch2_cutoff;
|
var cutoff = FILTER_CONFIG.gyro_notch2_cutoff > 0 ? FILTER_CONFIG.gyro_notch2_cutoff : DEFAULT.gyro_notch2_cutoff;
|
||||||
|
|
||||||
$('.pid_filter input[name="gyroNotch2Frequency"]').val(checked ? hz : 0).attr('disabled', !checked);
|
$('.pid_filter input[name="gyroNotch2Frequency"]').val(checked ? hz : 0).attr('disabled', !checked)
|
||||||
|
.attr("min", checked ? 1 : 0).change();
|
||||||
$('.pid_filter input[name="gyroNotch2Cutoff"]').attr('disabled', !checked);
|
$('.pid_filter input[name="gyroNotch2Cutoff"]').attr('disabled', !checked);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -322,7 +324,8 @@ TABS.pid_tuning.initialize = function (callback) {
|
||||||
var hz = FILTER_CONFIG.dterm_notch_hz > 0 ? FILTER_CONFIG.dterm_notch_hz : DEFAULT.dterm_notch_hz;
|
var hz = FILTER_CONFIG.dterm_notch_hz > 0 ? FILTER_CONFIG.dterm_notch_hz : DEFAULT.dterm_notch_hz;
|
||||||
var cutoff = FILTER_CONFIG.dterm_notch_cutoff > 0 ? FILTER_CONFIG.dterm_notch_cutoff : DEFAULT.dterm_notch_cutoff;
|
var cutoff = FILTER_CONFIG.dterm_notch_cutoff > 0 ? FILTER_CONFIG.dterm_notch_cutoff : DEFAULT.dterm_notch_cutoff;
|
||||||
|
|
||||||
$('.pid_filter input[name="dTermNotchFrequency"]').val(checked ? hz : 0).attr('disabled', !checked);
|
$('.pid_filter input[name="dTermNotchFrequency"]').val(checked ? hz : 0).attr('disabled', !checked)
|
||||||
|
.attr("min", checked ? 1 : 0).change();
|
||||||
$('.pid_filter input[name="dTermNotchCutoff"]').attr('disabled', !checked);
|
$('.pid_filter input[name="dTermNotchCutoff"]').attr('disabled', !checked);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -373,9 +376,10 @@ TABS.pid_tuning.initialize = function (callback) {
|
||||||
var cutoff = $(".pid_filter input[name='" + cutoffName + "']").val();
|
var cutoff = $(".pid_filter input[name='" + cutoffName + "']").val();
|
||||||
|
|
||||||
// Change the max and refresh the value if needed
|
// Change the max and refresh the value if needed
|
||||||
$(".pid_filter input[name='" + cutoffName + "']").attr("max",frecuency - 1);
|
var maxCutoff = frecuency == 0 ? 0 : frecuency - 1;
|
||||||
|
$(".pid_filter input[name='" + cutoffName + "']").attr("max", maxCutoff);
|
||||||
if (cutoff >= frecuency) {
|
if (cutoff >= frecuency) {
|
||||||
$(".pid_filter input[name='" + cutoffName + "']").val(frecuency - 1);
|
$(".pid_filter input[name='" + cutoffName + "']").val(maxCutoff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue