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

Auto merged - #2504 at Tue, 22 Jun 2021 20:25:12 GMT

Update Dshot Bidir autodefaults and dynamic notch options
This commit is contained in:
J Blackman 2021-06-23 06:25:12 +10:00 committed by GitHub
commit 676b284c5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 35 deletions

View file

@ -373,6 +373,7 @@ TABS.pid_tuning.initialize = function (callback) {
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_42)) {
const dynamicNotchWidthPercent_e = $('.pid_filter input[name="dynamicNotchWidthPercent"]');
const dynamicNotchQ_e = $('.pid_filter input[name="dynamicNotchQ"]');
const dynamicNotchCount_e = $('.pid_filter input[name="dynamicNotchCount"]');
$('.smartfeedforward').hide();
@ -385,8 +386,7 @@ TABS.pid_tuning.initialize = function (callback) {
$('.pid_filter select[name="dynamicNotchRange"]').val(FC.FILTER_CONFIG.dyn_notch_range);
dynamicNotchWidthPercent_e.val(FC.FILTER_CONFIG.dyn_notch_width_percent);
dynamicNotchQ_e.val(FC.FILTER_CONFIG.dyn_notch_q);
$('.pid_filter input[name="dynamicNotchCount"]').val(FC.FILTER_CONFIG.dyn_notch_count);
$('.pid_filter input[name="dynamicNotchBandwidthHz"]').val(FC.FILTER_CONFIG.dyn_notch_bandwidth_hz);
dynamicNotchCount_e.val(FC.FILTER_CONFIG.dyn_notch_count);
$('.pid_filter input[name="dynamicNotchMinHz"]').val(FC.FILTER_CONFIG.dyn_notch_min_hz);
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_43)) {
$('.pid_filter input[name="dynamicNotchMinHz"]').attr("max","250");
@ -397,10 +397,8 @@ TABS.pid_tuning.initialize = function (callback) {
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
$('.dynamicNotchHelp').attr('title', i18n.getMessage('pidTuningMultiDynamicNotchFilterHelp'));
$('.dynamicNotchWidthPercent').hide();
$('.dynamicNotchQ').hide();
} else {
$('.dynamicNotchCount').hide();
$('.dynamicNotchBandwidthHz').hide();
}
$('.rpmFilter').toggle(FC.MOTOR_CONFIG.use_dshot_telemetry);
@ -422,18 +420,21 @@ TABS.pid_tuning.initialize = function (callback) {
if (checked !== (FC.FILTER_CONFIG.gyro_rpm_notch_harmonics !== 0)) { // if rpmFilterEnabled is not the same value as saved in the fc
if (checked) {
dynamicNotchWidthPercent_e.val(FILTER_DEFAULT.dyn_notch_width_percent_rpm);
dynamicNotchCount_e.val(FILTER_DEFAULT.dyn_notch_count_rpm);
dynamicNotchQ_e.val(FILTER_DEFAULT.dyn_notch_q_rpm);
dynamicNotchWidthPercent_e.val(FILTER_DEFAULT.dyn_notch_width_percent_rpm);
} else {
dynamicNotchWidthPercent_e.val(FILTER_DEFAULT.dyn_notch_width_percent);
dynamicNotchCount_e.val(FILTER_DEFAULT.dyn_notch_count);
dynamicNotchQ_e.val(FILTER_DEFAULT.dyn_notch_q);
dynamicNotchWidthPercent_e.val(FILTER_DEFAULT.dyn_notch_width_percent);
}
showDialogDynFiltersChange();
} else { // same value, return saved values
dynamicNotchWidthPercent_e.val(FC.FILTER_CONFIG.dyn_notch_width_percent);
dynamicNotchCount_e.val(FC.FILTER_CONFIG.dyn_notch_count);
dynamicNotchQ_e.val(FC.FILTER_CONFIG.dyn_notch_q);
dynamicNotchWidthPercent_e.val(FC.FILTER_CONFIG.dyn_notch_width_percent);
}
}).prop('checked', FC.FILTER_CONFIG.gyro_rpm_notch_harmonics != 0).change();
@ -1002,7 +1003,6 @@ TABS.pid_tuning.initialize = function (callback) {
FC.ADVANCED_TUNING.vbat_sag_compensation = $('input[id="vbatSagCompensation"]').is(':checked') ? parseInt($('input[name="vbatSagValue"]').val()) : 0;
FC.ADVANCED_TUNING.thrustLinearization = $('input[id="thrustLinearization"]').is(':checked') ? parseInt($('input[name="thrustLinearValue"]').val()) : 0;
FC.FILTER_CONFIG.dyn_notch_count = parseInt($('.pid_filter input[name="dynamicNotchCount"]').val());
FC.FILTER_CONFIG.dyn_notch_bandwidth_hz = parseInt($('.pid_filter input[name="dynamicNotchBandwidthHz"]').val());
}
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {