Enable dynamic notch warning (#3253)
parent
d233d8c4ac
commit
51ed2ddb51
|
@ -4027,6 +4027,9 @@
|
||||||
"pidTuningDynamicNotchFilterDisabledWarning": {
|
"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."
|
"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": {
|
"pidTuningDynamicNotchRange": {
|
||||||
"message": "Dynamic Notch Filter Range"
|
"message": "Dynamic Notch Filter Range"
|
||||||
},
|
},
|
||||||
|
|
|
@ -747,6 +747,9 @@
|
||||||
padding-top: 2px;
|
padding-top: 2px;
|
||||||
padding-bottom: 2px;
|
padding-bottom: 2px;
|
||||||
}
|
}
|
||||||
|
.dynamicNotchNyquistWarningNote {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
.note-button {
|
.note-button {
|
||||||
td {
|
td {
|
||||||
&:nth-child(n) {
|
&:nth-child(n) {
|
||||||
|
|
|
@ -67,14 +67,8 @@ pid_tuning.initialize = function (callback) {
|
||||||
mspHelper.crunch(MSPCodes.MSP2_GET_TEXT, MSPCodes.PID_PROFILE_NAME)) : true)
|
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,
|
.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)
|
mspHelper.crunch(MSPCodes.MSP2_GET_TEXT, MSPCodes.RATE_PROFILE_NAME)) : true)
|
||||||
.then(() => {
|
.then(() => semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44) ? MSP.promise(MSPCodes.MSP_SIMPLIFIED_TUNING) : true)
|
||||||
let promise;
|
.then(() => semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44) ? MSP.promise(MSPCodes.MSP_ADVANCED_CONFIG) : true)
|
||||||
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
|
|
||||||
promise = MSP.promise(MSPCodes.MSP_SIMPLIFIED_TUNING);
|
|
||||||
}
|
|
||||||
|
|
||||||
return promise;
|
|
||||||
})
|
|
||||||
.then(() => MSP.send_message(MSPCodes.MSP_MIXER_CONFIG, false, false, load_html));
|
.then(() => MSP.send_message(MSPCodes.MSP_MIXER_CONFIG, false, false, load_html));
|
||||||
|
|
||||||
function load_html() {
|
function load_html() {
|
||||||
|
@ -2704,20 +2698,11 @@ pid_tuning.updateFilterWarning = function() {
|
||||||
const dtermLowpass1Enabled = !dtermLowpassFilterMode;
|
const dtermLowpass1Enabled = !dtermLowpassFilterMode;
|
||||||
const warningE = $('#pid-tuning .filterWarning');
|
const warningE = $('#pid-tuning .filterWarning');
|
||||||
const warningDynamicNotchE = $('#pid-tuning .dynamicNotchWarning');
|
const warningDynamicNotchE = $('#pid-tuning .dynamicNotchWarning');
|
||||||
if (!(gyroDynamicLowpassEnabled || gyroLowpass1Enabled) || !(dtermDynamicLowpassEnabled || dtermLowpass1Enabled)) {
|
const warningDynamicNotchNyquistE = $('#pid-tuning .dynamicNotchNyquistWarningNote');
|
||||||
warningE.show();
|
|
||||||
} else {
|
warningE.toggle(!(gyroDynamicLowpassEnabled || gyroLowpass1Enabled) || !(dtermDynamicLowpassEnabled || dtermLowpass1Enabled));
|
||||||
warningE.hide();
|
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)));
|
||||||
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();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pid_tuning.updatePIDColors = function(clear = false) {
|
pid_tuning.updatePIDColors = function(clear = false) {
|
||||||
|
|
|
@ -1518,6 +1518,9 @@
|
||||||
<div i18n="pidTuningDynamicNotchFilterGroup"></div>
|
<div i18n="pidTuningDynamicNotchFilterGroup"></div>
|
||||||
<div class="helpicon cf_tip dynamicNotchHelp" i18n_title="pidTuningDynamicNotchFilterHelp"></div>
|
<div class="helpicon cf_tip dynamicNotchHelp" i18n_title="pidTuningDynamicNotchFilterHelp"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="note dynamicNotchNyquistWarningNote">
|
||||||
|
<p i18n="pidTuningDynamicNotchFilterNyquistWarning"></p>
|
||||||
|
</div>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue