mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-19 22:35:17 +03:00
Add dyn notch to UI try2
This commit is contained in:
parent
7e371ee49e
commit
b39f7df5f7
6 changed files with 153 additions and 0 deletions
|
@ -352,8 +352,20 @@ TABS.pid_tuning.initialize = function (callback) {
|
|||
if (semver.gte(CONFIG.apiVersion, "1.42.0")) {
|
||||
$('.smartfeedforward').hide();
|
||||
$('.itermRelaxCutoff').show();
|
||||
|
||||
if (FEATURE_CONFIG.features.isEnabled('DYNAMIC_FILTER')) {
|
||||
$('.dynamicNotch').show();
|
||||
} else {
|
||||
$('.dynamicNotch').hide();
|
||||
}
|
||||
|
||||
$('.pid_filter select[name="dynamicNotchRange"]').val(FILTER_CONFIG.dyn_notch_range);
|
||||
$('.pid_filter input[name="dynamicNotchWidthPercent"]').val(FILTER_CONFIG.dyn_notch_width_percent);
|
||||
$('.pid_filter input[name="dynamicNotchQ"]').val(FILTER_CONFIG.dyn_notch_q);
|
||||
$('.pid_filter input[name="dynamicNotchMinHz"]').val(FILTER_CONFIG.dyn_notch_min_hz);
|
||||
} else {
|
||||
$('.itermRelaxCutoff').hide();
|
||||
$('.dynamicNotch').hide();
|
||||
}
|
||||
|
||||
$('input[id="useIntegratedYaw"]').change(function() {
|
||||
|
@ -685,6 +697,12 @@ TABS.pid_tuning.initialize = function (callback) {
|
|||
ADVANCED_TUNING.useIntegratedYaw = $('input[id="useIntegratedYaw"]').is(':checked') ? 1 : 0;
|
||||
}
|
||||
|
||||
if (semver.gte(CONFIG.apiVersion, "1.42.0")) {
|
||||
FILTER_CONFIG.dyn_notch_range = parseInt($('.pid_filter select[name="dynamicNotchRange"]').val());
|
||||
FILTER_CONFIG.dyn_notch_width_percent = parseInt($('.pid_filter input[name="dynamicNotchWidthPercent"]').val());
|
||||
FILTER_CONFIG.dyn_notch_q = parseInt($('.pid_filter input[name="dynamicNotchQ"]').val());
|
||||
FILTER_CONFIG.dyn_notch_min_hz = parseInt($('.pid_filter input[name="dynamicNotchMinHz"]').val());
|
||||
}
|
||||
}
|
||||
|
||||
function showAllPids() {
|
||||
|
@ -1068,6 +1086,22 @@ TABS.pid_tuning.initialize = function (callback) {
|
|||
dtermFilterSelect.append('<option value="' + key + '">' + value + '</option>');
|
||||
});
|
||||
}
|
||||
// Added in API 1.42.0
|
||||
function loadDynamicNotchRangeValues() {
|
||||
var dynamicNotchRangeValues = [
|
||||
"HIGH", "MEDIUM", "LOW", "AUTO",
|
||||
];
|
||||
return dynamicNotchRangeValues;
|
||||
}
|
||||
function populateDynamicNotchRangeSelect(selectDynamicNotchRangeValues) {
|
||||
var dynamicNotchRangeSelect = $('select[name="dynamicNotchRange"]');
|
||||
selectDynamicNotchRangeValues.forEach(function(value, key) {
|
||||
dynamicNotchRangeSelect.append('<option value="' + key + '">' + value + '</option>');
|
||||
});
|
||||
}
|
||||
if (semver.gte(CONFIG.apiVersion, "1.42.0")) {
|
||||
populateDynamicNotchRangeSelect(loadDynamicNotchRangeValues());
|
||||
}
|
||||
|
||||
populateFilterTypeSelector('gyroLowpassType', loadFilterTypeValues());
|
||||
populateFilterTypeSelector('gyroLowpassDynType', loadFilterTypeValues());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue