1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-16 12:55:14 +03:00

Auto merged - #2522 at Sun, 01 Aug 2021 04:17:08 GMT

Added latest Rc Smoothing changes
This commit is contained in:
J Blackman 2021-08-01 14:17:09 +10:00 committed by GitHub
commit 2d268ee115
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 193 additions and 156 deletions

View file

@ -1679,19 +1679,19 @@
"receiverRcSmoothingManual": { "receiverRcSmoothingManual": {
"message": "Manual" "message": "Manual"
}, },
"receiverRcSmoothingAutoSmoothness": { "receiverRcSmoothingAutoFactor": {
"message": "Auto Smoothness", "message": "Auto Factor",
"description": "Auto Smoothness parameter for RC smoothing" "description": "Auto Factor parameter for RC smoothing"
}, },
"receiverRcSmoothingAutoSmoothnessHelp": { "receiverRcSmoothingAutoFactorHelp": {
"message": "Adjusts the Auto smoothing calculation, 10 is the default smoothing to delay ratio. Increasing the number will smooth RC inputs more, while also adding delay. This may be useful for unreliable RC connections or for cinematic flying.<br>Be careful with numbers approaching 50, input delay will become noticeable.<br>Use the CLI command rc_smoothing_info while TX and RX are powered to see the automatically calculated RC smoothing cutoffs. ", "message": "Adjusts the Auto factor calculation, 10 is the default factor to delay ratio. Increasing the number will smooth RC inputs more, while also adding delay. This may be useful for unreliable RC connections or for cinematic flying.<br>Be careful with numbers approaching 50, input delay will become noticeable.<br>Use the CLI command rc_smoothing_info while TX and RX are powered to see the automatically calculated RC smoothing cutoffs. ",
"description": "Auto Smoothness parameter help message" "description": "Auto Factor parameter help message"
}, },
"receiverRcDerivativeTypeSelect": { "receiverRcFeedforwardTypeSelect": {
"message": "Derivative Cutoff Type" "message": "FeedForward Cutoff Type"
}, },
"receiverRcInputTypeSelect": { "receiverRcSetpointTypeSelect": {
"message": "Input Cutoff Type" "message": "Setpoint Cutoff Type"
}, },
"receiverRcSmoothingInterpolation": { "receiverRcSmoothingInterpolation": {
"message": "Interpolation" "message": "Interpolation"
@ -1702,43 +1702,43 @@
"receiverRcSmoothingTypeHelp": { "receiverRcSmoothingTypeHelp": {
"message": "Type of RC smoothing used" "message": "Type of RC smoothing used"
}, },
"rcSmoothingInputCutoffHelp": { "rcSmoothingSetpointCutoffHelp": {
"message": "The cutoff frequency in Hz used by the input filter. Using lower values will result in smoother inputs and are more appropriate for slower receiver protocols. Most users should leave this at 0 corresponding to \"Auto\"." "message": "The cutoff frequency in Hz used by the setpoint filter. Using lower values will result in smoother inputs and are more appropriate for slower receiver protocols. Most users should leave this at 0 corresponding to \"Auto\"."
}, },
"rcSmoothingDerivativeCutoffHelp": { "rcSmoothingFeedforwardCutoffHelp": {
"message": "The cutoff frequency in Hz used by the setpoint derivative filter. Using lower values will result in smoother inputs and are more appropriate for slower receiver protocols. Most users should leave this at 0 corresponding to \"Auto\"." "message": "The cutoff frequency in Hz used by the feedforward filter. Using lower values will result in smoother inputs and are more appropriate for slower receiver protocols. Most users should leave this at 0 corresponding to \"Auto\"."
}, },
"rcSmoothingChannelsSmoothedHelp": { "rcSmoothingChannelsSmoothedHelp": {
"message": "The channels smoothing applies to" "message": "The channels smoothing applies to"
}, },
"rcSmoothingDerivativeTypeHelp": { "rcSmoothingFeedforwardTypeHelp": {
"message": "The type of filtering method used for the setpoint derivative. Starting with 4.2 the default value of \"Auto\" is recommended. For 4.1 and earlier most users should use the default \"BIQUAD\" value as it provides a good balance between smoothness and delay. \"PT1\" reduces the delay slightly but provides less smoothing." "message": "The type of filtering method used for the feedforward. Starting with 4.2 the default value of \"Auto\" is recommended. For 4.1 and earlier most users should use the default \"BIQUAD\" value as it provides a good balance between smoothness and delay. \"PT1\" reduces the delay slightly but provides less smoothing."
}, },
"rcSmoothingInputTypeHelp": { "rcSmoothingSetpointTypeHelp": {
"message": "The type of filtering method used for the input. Most users should use the default \"BIQUAD\" value as it provides a good balance between smoothness and delay. \"PT1\" reduces the delay slightly but provides less smoothing." "message": "The type of filtering method used for the setpoint. Most users should use the default \"BIQUAD\" value as it provides a good balance between smoothness and delay. \"PT1\" reduces the delay slightly but provides less smoothing."
}, },
"receiverRcSmoothingInputManual": { "receiverRcSmoothingSetpointManual": {
"message": "Selects whether the input filter cutoff frequency is automatically calculated (recommended) or manually selected by the user. Using \"Manual\" is not recommended for receiver protocols like Crossfire which can change in flight." "message": "Selects whether the setpoint filter cutoff frequency is automatically calculated (recommended) or manually selected by the user. Using \"Manual\" is not recommended for receiver protocols like Crossfire which can change in flight."
}, },
"receiverRcSmoothingDerivativeManual": { "receiverRcSmoothingFeedforwardManual": {
"message": "Selects whether the setpoint derivative filter cutoff frequency is automatically calculated (recommended) or manually selected by the user. Using \"Manual\" is not recommended for receiver protocols like Crossfire which can change in flight." "message": "Selects whether the feedforward filter cutoff frequency is automatically calculated (recommended) or manually selected by the user. Using \"Manual\" is not recommended for receiver protocols like Crossfire which can change in flight."
}, },
"receiverRcSmoothingInputHz": { "receiverRcSmoothingSetpointHz": {
"message": "Input Cutoff Frequency" "message": "Setpoint Cutoff Frequency"
}, },
"receiverRcSmoothingDerivativeCutoff": { "receiverRcSmoothingFeedforwardCutoff": {
"message": "Derivative Cutoff Frequency" "message": "FeedForward Cutoff Frequency"
}, },
"receiverRcInputType": { "receiverRcSetpointType": {
"message": "Input Filter Type" "message": "Setpoint Filter Type"
}, },
"receiverRcDerivativeType": { "receiverRcFeedforwardType": {
"message": "Derivative Filter Type" "message": "Feedforward Filter Type"
}, },
"receiverRcSmoothingDerivativeTypeOff": { "receiverRcSmoothingFeedforwardTypeOff": {
"message": "Off" "message": "Off"
}, },
"receiverRcSmoothingDerivativeTypeAuto": { "receiverRcSmoothingFeedforwardTypeAuto": {
"message": "Auto" "message": "Auto"
}, },
"receiverRcSmoothingChannel": { "receiverRcSmoothingChannel": {
@ -1771,6 +1771,9 @@
"receiverRcInterpolationInterval": { "receiverRcInterpolationInterval": {
"message": "RC Interpolation Interval [ms]" "message": "RC Interpolation Interval [ms]"
}, },
"receiverRcSmoothingMode": {
"message": "Smoothing Mode"
},
"pidTuningFeedforwardTransition": { "pidTuningFeedforwardTransition": {
"message": "Transition" "message": "Transition"
}, },

View file

@ -540,12 +540,13 @@ const FC = {
rxSpiRfChannelCount: 0, rxSpiRfChannelCount: 0,
fpvCamAngleDegrees: 0, fpvCamAngleDegrees: 0,
rcSmoothingType: 0, rcSmoothingType: 0,
rcSmoothingInputCutoff: 0, rcSmoothingSetpointCutoff: 0,
rcSmoothingDerivativeCutoff: 0, rcSmoothingFeedforwardCutoff: 0,
rcSmoothingInputType: 0, rcSmoothingInputType: 0,
rcSmoothingDerivativeType: 0, rcSmoothingDerivativeType: 0,
rcSmoothingAutoSmoothness: 0, rcSmoothingAutoFactor: 0,
usbCdcHidType: 0, usbCdcHidType: 0,
rcSmoothingMode: 0,
}; };
this.FAILSAFE_CONFIG = { this.FAILSAFE_CONFIG = {

View file

@ -976,13 +976,16 @@ MspHelper.prototype.process_data = function(dataHandler) {
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_40)) { if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_40)) {
FC.RX_CONFIG.rcInterpolationChannels = data.readU8(); FC.RX_CONFIG.rcInterpolationChannels = data.readU8();
FC.RX_CONFIG.rcSmoothingType = data.readU8(); FC.RX_CONFIG.rcSmoothingType = data.readU8();
FC.RX_CONFIG.rcSmoothingInputCutoff = data.readU8(); FC.RX_CONFIG.rcSmoothingSetpointCutoff = data.readU8();
FC.RX_CONFIG.rcSmoothingDerivativeCutoff = data.readU8(); FC.RX_CONFIG.rcSmoothingFeedforwardCutoff = data.readU8();
FC.RX_CONFIG.rcSmoothingInputType = data.readU8(); FC.RX_CONFIG.rcSmoothingInputType = data.readU8();
FC.RX_CONFIG.rcSmoothingDerivativeType = data.readU8(); FC.RX_CONFIG.rcSmoothingDerivativeType = data.readU8();
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_42)) { if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_42)) {
FC.RX_CONFIG.usbCdcHidType = data.readU8(); FC.RX_CONFIG.usbCdcHidType = data.readU8();
FC.RX_CONFIG.rcSmoothingAutoSmoothness = data.readU8(); FC.RX_CONFIG.rcSmoothingAutoFactor = data.readU8();
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
FC.RX_CONFIG.rcSmoothingMode = data.readU8();
}
} }
} }
} else { } else {
@ -1882,13 +1885,16 @@ MspHelper.prototype.crunch = function(code) {
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_40)) { if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_40)) {
buffer.push8(FC.RX_CONFIG.rcInterpolationChannels) buffer.push8(FC.RX_CONFIG.rcInterpolationChannels)
.push8(FC.RX_CONFIG.rcSmoothingType) .push8(FC.RX_CONFIG.rcSmoothingType)
.push8(FC.RX_CONFIG.rcSmoothingInputCutoff) .push8(FC.RX_CONFIG.rcSmoothingSetpointCutoff)
.push8(FC.RX_CONFIG.rcSmoothingDerivativeCutoff) .push8(FC.RX_CONFIG.rcSmoothingFeedforwardCutoff)
.push8(FC.RX_CONFIG.rcSmoothingInputType) .push8(FC.RX_CONFIG.rcSmoothingInputType)
.push8(FC.RX_CONFIG.rcSmoothingDerivativeType); .push8(FC.RX_CONFIG.rcSmoothingDerivativeType);
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_42)) { if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_42)) {
buffer.push8(FC.RX_CONFIG.usbCdcHidType) buffer.push8(FC.RX_CONFIG.usbCdcHidType)
.push8(FC.RX_CONFIG.rcSmoothingAutoSmoothness); .push8(FC.RX_CONFIG.rcSmoothingAutoFactor);
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
buffer.push8(FC.RX_CONFIG.rcSmoothingMode);
}
} }
} }
} }

View file

@ -417,15 +417,15 @@ TABS.receiver.initialize = function (callback) {
} }
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_40)) { if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_40)) {
FC.RX_CONFIG.rcSmoothingInputCutoff = parseInt($('input[name="rcSmoothingInputHz-number"]').val()); FC.RX_CONFIG.rcSmoothingSetpointCutoff = parseInt($('input[name="rcSmoothingSetpointHz-number"]').val());
FC.RX_CONFIG.rcSmoothingDerivativeCutoff = parseInt($('input[name="rcSmoothingDerivativeCutoff-number"]').val()); FC.RX_CONFIG.rcSmoothingFeedforwardCutoff = parseInt($('input[name="rcSmoothingFeedforwardCutoff-number"]').val());
FC.RX_CONFIG.rcSmoothingDerivativeType = parseInt($('select[name="rcSmoothingDerivativeType-select"]').val()); FC.RX_CONFIG.rcSmoothingDerivativeType = parseInt($('select[name="rcSmoothingFeedforwardType-select"]').val());
FC.RX_CONFIG.rcInterpolationChannels = parseInt($('select[name="rcSmoothingChannels-select"]').val()); FC.RX_CONFIG.rcInterpolationChannels = parseInt($('select[name="rcSmoothingChannels-select"]').val());
FC.RX_CONFIG.rcSmoothingInputType = parseInt($('select[name="rcSmoothingInputType-select"]').val()); FC.RX_CONFIG.rcSmoothingInputType = parseInt($('select[name="rcSmoothingSetpointType-select"]').val());
} }
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_42)) { if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_42)) {
FC.RX_CONFIG.rcSmoothingAutoSmoothness = parseInt($('input[name="rcSmoothingAutoSmoothness-number"]').val()); FC.RX_CONFIG.rcSmoothingAutoFactor = parseInt($('input[name="rcSmoothingAutoFactor-number"]').val());
} }
function save_rssi_config() { function save_rssi_config() {
@ -526,98 +526,99 @@ TABS.receiver.initialize = function (callback) {
$(".bind_btn").toggle(showBindButton); $(".bind_btn").toggle(showBindButton);
// RC Smoothing // RC Smoothing
const smoothingOnOff = ((semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) ?
FC.RX_CONFIG.rcSmoothingMode : FC.RX_CONFIG.rcSmoothingType);
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_40)) { if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_40)) {
$('.tab-receiver .rcSmoothing').show(); $('.tab-receiver .rcSmoothing').show();
const rc_smoothing_protocol_e = $('select[name="rcSmoothing-select"]'); const rc_smoothing_protocol_e = $('select[name="rcSmoothing-select"]');
rc_smoothing_protocol_e.change(function () { rc_smoothing_protocol_e.change(function () {
FC.RX_CONFIG.rcSmoothingType = $(this).val(); if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
FC.RX_CONFIG.rcSmoothingMode = parseFloat($(this).val());
} else {
FC.RX_CONFIG.rcSmoothingType = parseFloat($(this).val());
}
updateInterpolationView(); updateInterpolationView();
}); });
rc_smoothing_protocol_e.val(FC.RX_CONFIG.rcSmoothingType); rc_smoothing_protocol_e.val(smoothingOnOff);
const rcSmoothingNumberElement = $('input[name="rcSmoothingInputHz-number"]'); const rcSmoothingNumberElement = $('input[name="rcSmoothingSetpointHz-number"]');
const rcSmoothingDerivativeNumberElement = $('input[name="rcSmoothingDerivativeCutoff-number"]'); const rcSmoothingFeedforwardNumberElement = $('input[name="rcSmoothingFeedforwardCutoff-number"]');
rcSmoothingNumberElement.val(FC.RX_CONFIG.rcSmoothingInputCutoff); rcSmoothingNumberElement.val(FC.RX_CONFIG.rcSmoothingSetpointCutoff);
rcSmoothingDerivativeNumberElement.val(FC.RX_CONFIG.rcSmoothingDerivativeCutoff); rcSmoothingFeedforwardNumberElement.val(FC.RX_CONFIG.rcSmoothingFeedforwardCutoff);
$('.tab-receiver .rcSmoothing-input-cutoff').show(); $('.tab-receiver .rcSmoothing-setpoint-cutoff').show();
$('select[name="rcSmoothing-input-manual-select"]').val("1"); $('select[name="rcSmoothing-setpoint-manual-select"]').val("1");
if (FC.RX_CONFIG.rcSmoothingInputCutoff == 0) { if (FC.RX_CONFIG.rcSmoothingSetpointCutoff === 0) {
$('.tab-receiver .rcSmoothing-input-cutoff').hide(); $('.tab-receiver .rcSmoothing-setpoint-cutoff').hide();
$('select[name="rcSmoothing-input-manual-select"]').val("0"); $('select[name="rcSmoothing-setpoint-manual-select"]').val("0");
} }
$('select[name="rcSmoothing-input-manual-select"]').change(function () { $('select[name="rcSmoothing-setpoint-manual-select"]').change(function () {
if ($(this).val() == 0) { if ($(this).val() === "0") {
rcSmoothingNumberElement.val(0); rcSmoothingNumberElement.val(0);
$('.tab-receiver .rcSmoothing-input-cutoff').hide(); $('.tab-receiver .rcSmoothing-setpoint-cutoff').hide();
} }
if ($(this).val() == 1) { if ($(this).val() === "1") {
rcSmoothingNumberElement.val(FC.RX_CONFIG.rcSmoothingInputCutoff); rcSmoothingNumberElement.val(FC.RX_CONFIG.rcSmoothingSetpointCutoff);
$('.tab-receiver .rcSmoothing-input-cutoff').show(); $('.tab-receiver .rcSmoothing-setpoint-cutoff').show();
} }
}).change(); }).change();
$('.tab-receiver .rcSmoothing-derivative-cutoff').show(); $('.tab-receiver .rcSmoothing-feedforward-cutoff').show();
$('select[name="rcSmoothing-input-derivative-select"]').val("1"); $('select[name="rcSmoothing-feedforward-select"]').val("1");
if (FC.RX_CONFIG.rcSmoothingDerivativeCutoff == 0) { if (FC.RX_CONFIG.rcSmoothingFeedforwardCutoff === 0) {
$('select[name="rcSmoothing-input-derivative-select"]').val("0"); $('select[name="rcSmoothing-feedforward-select"]').val("0");
$('.tab-receiver .rcSmoothing-derivative-cutoff').hide(); $('.tab-receiver .rcSmoothing-feedforward-cutoff').hide();
} }
$('select[name="rcSmoothing-input-derivative-select"]').change(function () { $('select[name="rcSmoothing-feedforward-select"]').change(function () {
if ($(this).val() == 0) { if ($(this).val() === "0") {
$('.tab-receiver .rcSmoothing-derivative-cutoff').hide(); $('.tab-receiver .rcSmoothing-feedforward-cutoff').hide();
rcSmoothingDerivativeNumberElement.val(0); rcSmoothingFeedforwardNumberElement.val(0);
} }
if ($(this).val() == 1) { if ($(this).val() === "1") {
$('.tab-receiver .rcSmoothing-derivative-cutoff').show(); $('.tab-receiver .rcSmoothing-feedforward-cutoff').show();
rcSmoothingDerivativeNumberElement.val(FC.RX_CONFIG.rcSmoothingDerivativeCutoff); rcSmoothingFeedforwardNumberElement.val(FC.RX_CONFIG.rcSmoothingFeedforwardCutoff);
} }
}).change(); }).change();
const rcSmoothingDerivativeType = $('select[name="rcSmoothingDerivativeType-select"]'); const rcSmoothingFeedforwardType = $('select[name="rcSmoothingFeedforwardType-select"]');
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_43)) { if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_43)) {
rcSmoothingDerivativeType.append($(`<option value="3">${i18n.getMessage("receiverRcSmoothingDerivativeTypeAuto")}</option>`)); rcSmoothingFeedforwardType.append($(`<option value="3">${i18n.getMessage("receiverRcSmoothingFeedforwardTypeAuto")}</option>`));
} }
rcSmoothingDerivativeType.val(FC.RX_CONFIG.rcSmoothingDerivativeType); rcSmoothingFeedforwardType.val(FC.RX_CONFIG.rcSmoothingDerivativeType);
const rcSmoothingChannels = $('select[name="rcSmoothingChannels-select"]'); const rcSmoothingChannels = $('select[name="rcSmoothingChannels-select"]');
rcSmoothingChannels.val(FC.RX_CONFIG.rcInterpolationChannels); rcSmoothingChannels.val(FC.RX_CONFIG.rcInterpolationChannels);
const rcSmoothingInputType = $('select[name="rcSmoothingInputType-select"]'); const rcSmoothingSetpointType = $('select[name="rcSmoothingSetpointType-select"]');
rcSmoothingInputType.val(FC.RX_CONFIG.rcSmoothingInputType); rcSmoothingSetpointType.val(FC.RX_CONFIG.rcSmoothingInputType);
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_42)) { if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_42)) {
$('select[name="rcSmoothing-input-manual-select"], select[name="rcSmoothing-input-derivative-select"]').change(function() { $('select[name="rcSmoothing-setpoint-manual-select"], select[name="rcSmoothing-feedforward-select"]').change(function() {
if ($('select[name="rcSmoothing-input-manual-select"]').val() == 0 || $('select[name="rcSmoothing-input-derivative-select"]').val() == 0) { if ($('select[name="rcSmoothing-setpoint-manual-select"]').val() === "0" || $('select[name="rcSmoothing-feedforward-select"]').val() === "0") {
$('.tab-receiver .rcSmoothing-auto-smoothness').show(); $('.tab-receiver .rcSmoothing-auto-factor').show();
} else { } else {
$('.tab-receiver .rcSmoothing-auto-smoothness').hide(); $('.tab-receiver .rcSmoothing-auto-factor').hide();
} }
}); });
$('select[name="rcSmoothing-input-manual-select"]').change(); $('select[name="rcSmoothing-setpoint-manual-select"]').change();
const rcSmoothingAutoSmoothness = $('input[name="rcSmoothingAutoSmoothness-number"]'); const rcSmoothingAutoFactor = $('input[name="rcSmoothingAutoFactor-number"]');
rcSmoothingAutoSmoothness.val(FC.RX_CONFIG.rcSmoothingAutoSmoothness); rcSmoothingAutoFactor.val(FC.RX_CONFIG.rcSmoothingAutoFactor);
} else { } else {
$('.tab-receiver .rcSmoothing-auto-smoothness').hide(); $('.tab-receiver .rcSmoothing-auto-factor').hide();
} }
updateInterpolationView(); updateInterpolationView();
} else { } else {
$('.tab-receiver .rcInterpolation').show(); $('.tab-receiver .rcInterpolation').show();
$('.tab-receiver .rcSmoothing-derivative-cutoff').hide(); $('.tab-receiver .rcSmoothing-feedforward-cutoff').hide();
$('.tab-receiver .rcSmoothing-input-cutoff').hide(); $('.tab-receiver .rcSmoothing-setpoint-cutoff').hide();
$('.tab-receiver .rcSmoothing-derivative-type').hide(); $('.tab-receiver .rcSmoothing-feedforward-type').hide();
$('.tab-receiver .rcSmoothing-input-type').hide(); $('.tab-receiver .rcSmoothing-setpoint-type').hide();
$('.tab-receiver .rcSmoothing-derivative-manual').hide(); $('.tab-receiver .rcSmoothing-feedforward-manual').hide();
$('.tab-receiver .rcSmoothing-input-manual').hide(); $('.tab-receiver .rcSmoothing-setpoint-manual').hide();
$('.tab-receiver .rc-smoothing-type').hide(); $('.tab-receiver .rc-smoothing-type').hide();
$('.tab-receiver .rcSmoothing-auto-smoothness').hide(); $('.tab-receiver .rcSmoothing-auto-factor').hide();
}
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
$('.tab-receiver .rcSmoothing-derivative-type').hide();
$('.tab-receiver .rcSmoothing-input-type').hide();
$('.tab-receiver input[name="rcSmoothingAutoSmoothness-number"]').attr("max", "250");
} }
// Only show the MSP control sticks if the MSP Rx feature is enabled // Only show the MSP control sticks if the MSP Rx feature is enabled
@ -867,33 +868,56 @@ TABS.receiver.updateRcInterpolationParameters = function () {
}; };
function updateInterpolationView() { function updateInterpolationView() {
const smoothingOnOff = ((semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) ?
FC.RX_CONFIG.rcSmoothingMode : FC.RX_CONFIG.rcSmoothingType);
$('.tab-receiver .rcInterpolation').hide(); $('.tab-receiver .rcInterpolation').hide();
$('.tab-receiver .rcSmoothing-derivative-cutoff').show(); $('.tab-receiver .rcSmoothing-feedforward-cutoff').show();
$('.tab-receiver .rcSmoothing-input-cutoff').show(); $('.tab-receiver .rcSmoothing-setpoint-cutoff').show();
$('.tab-receiver .rcSmoothing-derivative-type').show(); $('.tab-receiver .rcSmoothing-feedforward-type').show();
$('.tab-receiver .rcSmoothing-input-type').show(); $('.tab-receiver .rcSmoothing-setpoint-type').show();
$('.tab-receiver .rcSmoothing-derivative-manual').show(); $('.tab-receiver .rcSmoothing-feedforward-manual').show();
$('.tab-receiver .rcSmoothing-input-manual').show(); $('.tab-receiver .rcSmoothing-setpoint-manual').show();
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_42)) { if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_42)) {
if (FC.RX_CONFIG.rcSmoothingDerivativeCutoff == 0 || FC.RX_CONFIG.rcSmoothingInputCutoff == 0) { if (FC.RX_CONFIG.rcSmoothingFeedforwardCutoff === 0 || FC.RX_CONFIG.rcSmoothingSetpointCutoff === 0) {
$('.tab-receiver .rcSmoothing-auto-smoothness').show(); $('.tab-receiver .rcSmoothing-auto-factor').show();
} }
} }
if (FC.RX_CONFIG.rcSmoothingType == 0) { if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
$('.tab-receiver .rcInterpolation').show(); $('.tab-receiver .rcSmoothing-feedforward-type').hide();
$('.tab-receiver .rcSmoothing-derivative-cutoff').hide(); $('.tab-receiver .rcSmoothing-setpoint-type').hide();
$('.tab-receiver .rcSmoothing-input-cutoff').hide(); $('.tab-receiver .rc-smoothing-channels').hide();
$('.tab-receiver .rcSmoothing-derivative-type').hide(); $('.tab-receiver input[name="rcSmoothingAutoFactor-number"]').attr("max", "250");
$('.tab-receiver .rcSmoothing-input-type').hide(); $('.tab-receiver .rcSmoothingType').hide();
$('.tab-receiver .rcSmoothing-derivative-manual').hide(); $('.tab-receiver .rcSmoothingOff').text(i18n.getMessage('off'));
$('.tab-receiver .rcSmoothing-input-manual').hide(); $('.tab-receiver .rcSmoothingOn').text(i18n.getMessage('on'));
$('.tab-receiver .rcSmoothing-auto-smoothness').hide(); } else {
$('.tab-receiver .rcSmoothingMode').hide();
} }
if (FC.RX_CONFIG.rcSmoothingDerivativeCutoff == 0) {
$('.tab-receiver .rcSmoothing-derivative-cutoff').hide(); if (smoothingOnOff === 0) {
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
$('.tab-receiver .rcSmoothing-feedforward-cutoff').hide();
$('.tab-receiver .rcSmoothing-setpoint-cutoff').hide();
$('.tab-receiver .rcSmoothing-feedforward-manual').hide();
$('.tab-receiver .rcSmoothing-setpoint-manual').hide();
$('.tab-receiver .rcSmoothing-auto-factor').hide();
} else {
$('.tab-receiver .rcInterpolation').show();
$('.tab-receiver .rcSmoothing-feedforward-cutoff').hide();
$('.tab-receiver .rcSmoothing-setpoint-cutoff').hide();
$('.tab-receiver .rcSmoothing-feedforward-type').hide();
$('.tab-receiver .rcSmoothing-setpoint-type').hide();
$('.tab-receiver .rcSmoothing-feedforward-manual').hide();
$('.tab-receiver .rcSmoothing-setpoint-manual').hide();
$('.tab-receiver .rcSmoothing-auto-factor').hide();
}
} }
if (FC.RX_CONFIG.rcSmoothingInputCutoff == 0) { if (FC.RX_CONFIG.rcSmoothingFeedforwardCutoff === 0) {
$('.tab-receiver .rcSmoothing-input-cutoff').hide(); $('.tab-receiver .rcSmoothing-feedforward-cutoff').hide();
}
if (FC.RX_CONFIG.rcSmoothingSetpointCutoff === 0) {
$('.tab-receiver .rcSmoothing-setpoint-cutoff').hide();
} }
} }

View file

@ -156,15 +156,18 @@
<tr class="rc-smoothing-type"> <tr class="rc-smoothing-type">
<td> <td>
<select name="rcSmoothing-select"> <select name="rcSmoothing-select">
<option value="0" i18n="receiverRcSmoothingInterpolation"></option> <option class="rcSmoothingOff" value="0" i18n="receiverRcSmoothingInterpolation"></option>
<option value="1" i18n="receiverRcSmoothingFilter"></option> <option class="rcSmoothingOn" value="1" i18n="receiverRcSmoothingFilter"></option>
</select> </select>
</td> </td>
<td colspan="2"> <td colspan="2">
<div> <div>
<label> <label class="rcSmoothingType">
<span i18n="receiverRcSmoothingType"></span> <span i18n="receiverRcSmoothingType"></span>
</label> </label>
<label class="rcSmoothingMode">
<span i18n="receiverRcSmoothingMode"></span>
</label>
</div> </div>
</td> </td>
</tr> </tr>
@ -186,9 +189,9 @@
</div> </div>
</td> </td>
</tr> </tr>
<tr class="rcSmoothing-input-manual"> <tr class="rcSmoothing-setpoint-manual">
<td> <td>
<select name="rcSmoothing-input-manual-select"> <select name="rcSmoothing-setpoint-manual-select">
<option value="0" i18n="receiverRcSmoothingAuto"></option> <option value="0" i18n="receiverRcSmoothingAuto"></option>
<option value="1" i18n="receiverRcSmoothingManual"></option> <option value="1" i18n="receiverRcSmoothingManual"></option>
</select> </select>
@ -196,28 +199,28 @@
<td> <td>
<div> <div>
<label> <label>
<span i18n="receiverRcInputTypeSelect"></span> <span i18n="receiverRcSetpointTypeSelect"></span>
</label> </label>
</div> </div>
</td> </td>
<td> <td>
<div class="helpicon cf_tip" i18n_title="receiverRcSmoothingInputManual"></div> <div class="helpicon cf_tip" i18n_title="receiverRcSmoothingSetpointManual"></div>
</td> </td>
</tr> </tr>
<tr class="rcSmoothing-input-manual"> <tr class="rcSmoothing-setpoint-manual">
<td class="rcSmoothing-input-cutoff"><input type="number" name="rcSmoothingInputHz-number" step="1" min="1" max="255"/></td> <td class="rcSmoothing-setpoint-cutoff"><input type="number" name="rcSmoothingSetpointHz-number" step="1" min="1" max="255"/></td>
<td class="rcSmoothing-input-cutoff" colspan="2"> <td class="rcSmoothing-setpoint-cutoff" colspan="2">
<div> <div>
<label> <label>
<span i18n="receiverRcSmoothingInputHz"></span> <span i18n="receiverRcSmoothingSetpointHz"></span>
</label> </label>
<div class="helpicon cf_tip" i18n_title="rcSmoothingInputCutoffHelp"></div> <div class="helpicon cf_tip" i18n_title="rcSmoothingSetpointCutoffHelp"></div>
</div> </div>
</td> </td>
</tr> </tr>
<tr class="rcSmoothing-input-type"> <tr class="rcSmoothing-setpoint-type">
<td> <td>
<select name="rcSmoothingInputType-select"> <select name="rcSmoothingSetpointType-select">
<option value="0">PT1</option> <option value="0">PT1</option>
<option value="1">BIQUAD</option> <option value="1">BIQUAD</option>
</select> </select>
@ -225,17 +228,17 @@
<td> <td>
<div> <div>
<label> <label>
<span i18n="receiverRcInputType"></span> <span i18n="receiverRcSetpointType"></span>
</label> </label>
</div> </div>
</td> </td>
<td> <td>
<div class="helpicon cf_tip" i18n_title="rcSmoothingInputTypeHelp"></div> <div class="helpicon cf_tip" i18n_title="rcSmoothingSetpointTypeHelp"></div>
</td> </td>
</tr> </tr>
<tr class="rcSmoothing-derivative-manual"> <tr class="rcSmoothing-feedforward-manual">
<td> <td>
<select name="rcSmoothing-input-derivative-select"> <select name="rcSmoothing-feedforward-select">
<option value="0" i18n="receiverRcSmoothingAuto"></option> <option value="0" i18n="receiverRcSmoothingAuto"></option>
<option value="1" i18n="receiverRcSmoothingManual"></option> <option value="1" i18n="receiverRcSmoothingManual"></option>
</select> </select>
@ -243,29 +246,29 @@
<td> <td>
<div> <div>
<label> <label>
<span i18n="receiverRcDerivativeTypeSelect"></span> <span i18n="receiverRcFeedforwardTypeSelect"></span>
</label> </label>
</div> </div>
</td> </td>
<td> <td>
<div class="helpicon cf_tip" i18n_title="receiverRcSmoothingDerivativeManual"></div> <div class="helpicon cf_tip" i18n_title="receiverRcSmoothingFeedforwardManual"></div>
</td> </td>
</tr> </tr>
<tr class="rcSmoothing-derivative-manual"> <tr class="rcSmoothing-feedforward-manual">
<td class="rcSmoothing-derivative-cutoff"><input type="number" name="rcSmoothingDerivativeCutoff-number" step="1" min="1" max="255"/></td> <td class="rcSmoothing-feedforward-cutoff"><input type="number" name="rcSmoothingFeedforwardCutoff-number" step="1" min="1" max="255"/></td>
<td colspan="2" class="rcSmoothing-derivative-cutoff"> <td colspan="2" class="rcSmoothing-feedforward-cutoff">
<div> <div>
<label> <label>
<span i18n="receiverRcSmoothingDerivativeCutoff"></span> <span i18n="receiverRcSmoothingFeedforwardCutoff"></span>
</label> </label>
<div class="helpicon cf_tip" i18n_title="rcSmoothingDerivativeCutoffHelp"></div> <div class="helpicon cf_tip" i18n_title="rcSmoothingFeedforwardCutoffHelp"></div>
</div> </div>
</td> </td>
</tr> </tr>
<tr class="rcSmoothing-input-type"> <tr class="rcSmoothing-setpoint-type">
<td> <td>
<select name="rcSmoothingDerivativeType-select"> <select name="rcSmoothingFeedforwardType-select">
<option value="0" i18n="receiverRcSmoothingDerivativeTypeOff"></option> <option value="0" i18n="receiverRcSmoothingFeedforwardTypeOff"></option>
<option value="1">PT1</option> <option value="1">PT1</option>
<option value="2">BIQUAD</option> <option value="2">BIQUAD</option>
</select> </select>
@ -273,27 +276,27 @@
<td> <td>
<div> <div>
<label> <label>
<span i18n="receiverRcDerivativeType"></span> <span i18n="receiverRcFeedforwardType"></span>
</label> </label>
</div> </div>
</td> </td>
<td> <td>
<div class="helpicon cf_tip" i18n_title="rcSmoothingDerivativeTypeHelp"></div> <div class="helpicon cf_tip" i18n_title="rcSmoothingFeedforwardTypeHelp"></div>
</td> </td>
</tr> </tr>
<tr class="rcSmoothing-auto-smoothness"> <tr class="rcSmoothing-auto-factor">
<td> <td>
<input type="number" name="rcSmoothingAutoSmoothness-number" step="1" min="0" max="50"> <input type="number" name="rcSmoothingAutoFactor-number" step="1" min="0" max="50">
</td> </td>
<td> <td>
<div> <div>
<label> <label>
<span i18n="receiverRcSmoothingAutoSmoothness"></span> <span i18n="receiverRcSmoothingAutoFactor"></span>
</label> </label>
</div> </div>
</td> </td>
<td> <td>
<div class="helpicon cf_tip" i18n_title="receiverRcSmoothingAutoSmoothnessHelp"></div> <div class="helpicon cf_tip" i18n_title="receiverRcSmoothingAutoFactorHelp"></div>
</td> </td>
</tr> </tr>
<tr class="rcInterpolation"> <tr class="rcInterpolation">