Skip to content

Commit

Permalink
Add dynamic notch disabled warning
Browse files Browse the repository at this point in the history
  • Loading branch information
IvoFPV committed Aug 11, 2019
1 parent b39f7df commit 065d717
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions locales/en/messages.json
Expand Up @@ -3126,6 +3126,9 @@
"pidTuningDynamicNotchFilterHelp": {
"message": "Dynamic Notch Filter tracks peak motors noise frequency and places one or two notch filters with their center at that frequency."
},
"pidTuningDynamicNotchFilterDisabledWarning": {
"message": "<span class=\"message-negative\">Warning:</span> Dynamic Notch Filter is disabled, please enable it as a feature in the Configuration tab to show related settings."
},
"pidTuningDynamicNotchRange": {
"message": "Dynamic Notch Filter Range"
},
Expand Down
6 changes: 6 additions & 0 deletions src/js/tabs/pid_tuning.js
Expand Up @@ -1819,9 +1819,15 @@ TABS.pid_tuning.updateFilterWarning = function() {
var dtermDynamicLowpassEnabled = $('input[id="dtermLowpassDynEnabled"]').is(':checked');
var dtermLowpass1Enabled = $('input[id="dtermLowpassEnabled"]').is(':checked');
var warning_e = $('#pid-tuning .filterWarning');
var warningDynamicNotch_e = $('#pid-tuning .dynamicNotchWarning');
if (!(gyroDynamicLowpassEnabled || gyroLowpass1Enabled) || !(dtermDynamicLowpassEnabled || dtermLowpass1Enabled)) {
warning_e.show();
} else {
warning_e.hide();
}
if (FEATURE_CONFIG.features.isEnabled('DYNAMIC_FILTER')) {
warningDynamicNotch_e.hide();
} else {
warningDynamicNotch_e.show();
}
}
5 changes: 5 additions & 0 deletions src/tabs/pid_tuning.html
Expand Up @@ -696,6 +696,11 @@
<p i18n="filterWarning"></p>
</div>
</div>
<div class="note dynamicNotchWarning">
<div class="note_spacer">
<p i18n="pidTuningDynamicNotchFilterDisabledWarning"></p>
</div>
</div>

<div class="cf_column two_columns">
<div class="gui_box grey topspacer pid_filter two_columns_first">
Expand Down

0 comments on commit 065d717

Please sign in to comment.