Enable dynamic notch warning (#3253)

10.9-maintenance
haslinghuis 2023-01-17 13:27:22 +01:00 committed by GitHub
parent d233d8c4ac
commit 51ed2ddb51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 22 deletions

View File

@ -4027,6 +4027,9 @@
"pidTuningDynamicNotchFilterDisabledWarning": {
"message": "<strong>Notice:</strong> The dynamic notch filter is disabled. In order to configure and use it, please enable the 'DYNAMIC_FILTER' feature in the '$t(configurationFeatures.message)' section of the '$t(tabConfiguration.message)' tab. Also make sure the PID looprate is at least 2kHz."
},
"pidTuningDynamicNotchFilterNyquistWarning": {
"message": "The dynamic notch filter is disabled. In order to use it, please make sure the PID loop frequency is set to at least 2Khz in the '$t(tabConfiguration.message)' tab."
},
"pidTuningDynamicNotchRange": {
"message": "Dynamic Notch Filter Range"
},

View File

@ -747,6 +747,9 @@
padding-top: 2px;
padding-bottom: 2px;
}
.dynamicNotchNyquistWarningNote {
margin: 0;
}
.note-button {
td {
&:nth-child(n) {

View File

@ -67,14 +67,8 @@ pid_tuning.initialize = function (callback) {
mspHelper.crunch(MSPCodes.MSP2_GET_TEXT, MSPCodes.PID_PROFILE_NAME)) : true)
.then(() => semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_45) ? MSP.promise(MSPCodes.MSP2_GET_TEXT,
mspHelper.crunch(MSPCodes.MSP2_GET_TEXT, MSPCodes.RATE_PROFILE_NAME)) : true)
.then(() => {
let promise;
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
promise = MSP.promise(MSPCodes.MSP_SIMPLIFIED_TUNING);
}
return promise;
})
.then(() => semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44) ? MSP.promise(MSPCodes.MSP_SIMPLIFIED_TUNING) : true)
.then(() => semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44) ? MSP.promise(MSPCodes.MSP_ADVANCED_CONFIG) : true)
.then(() => MSP.send_message(MSPCodes.MSP_MIXER_CONFIG, false, false, load_html));
function load_html() {
@ -2704,20 +2698,11 @@ pid_tuning.updateFilterWarning = function() {
const dtermLowpass1Enabled = !dtermLowpassFilterMode;
const warningE = $('#pid-tuning .filterWarning');
const warningDynamicNotchE = $('#pid-tuning .dynamicNotchWarning');
if (!(gyroDynamicLowpassEnabled || gyroLowpass1Enabled) || !(dtermDynamicLowpassEnabled || dtermLowpass1Enabled)) {
warningE.show();
} else {
warningE.hide();
}
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_42) && semver.lt(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
if (FC.FEATURE_CONFIG.features.isEnabled('DYNAMIC_FILTER')) {
warningDynamicNotchE.hide();
} else {
warningDynamicNotchE.show();
}
} else {
warningDynamicNotchE.hide();
}
const warningDynamicNotchNyquistE = $('#pid-tuning .dynamicNotchNyquistWarningNote');
warningE.toggle(!(gyroDynamicLowpassEnabled || gyroLowpass1Enabled) || !(dtermDynamicLowpassEnabled || dtermLowpass1Enabled));
warningDynamicNotchNyquistE.toggle(semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44) && (FC.CONFIG.sampleRateHz / FC.PID_ADVANCED_CONFIG.pid_process_denom < 2000));
warningDynamicNotchE.toggle(FC.FEATURE_CONFIG.features.isEnabled('DYNAMIC_FILTER') && (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_42) && semver.lt(FC.CONFIG.apiVersion, API_VERSION_1_44)));
};
pid_tuning.updatePIDColors = function(clear = false) {

View File

@ -1518,6 +1518,9 @@
<div i18n="pidTuningDynamicNotchFilterGroup"></div>
<div class="helpicon cf_tip dynamicNotchHelp" i18n_title="pidTuningDynamicNotchFilterHelp"></div>
</div>
<div class="note dynamicNotchNyquistWarningNote">
<p i18n="pidTuningDynamicNotchFilterNyquistWarning"></p>
</div>
</th>
</tr>