1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-19 22:35:17 +03:00

Merge pull request #1941 from mikeller/add_vbat_pid_compensation_analytics

Added VBat PID compensation to analytics.
This commit is contained in:
Michael Keller 2020-03-28 13:25:36 +13:00 committed by GitHub
commit 32ae35f245
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -760,7 +760,15 @@ TABS.pid_tuning.initialize = function (callback) {
} }
if (semver.gte(CONFIG.apiVersion, "1.16.0")) { if (semver.gte(CONFIG.apiVersion, "1.16.0")) {
ADVANCED_TUNING.vbatPidCompensation = $('input[id="vbatpidcompensation"]').is(':checked') ? 1 : 0; const element = $('input[id="vbatpidcompensation"]');
const value = element.is(':checked') ? 1 : 0;
let analyticsValue = undefined;
if (value !== ADVANCED_TUNING.vbatPidCompensation) {
analyticsValue = element.is(':checked');
}
self.analyticsChanges['VbatPidCompensation'] = analyticsValue;
ADVANCED_TUNING.vbatPidCompensation = value;
} }
if (semver.gte(CONFIG.apiVersion, "1.16.0")) { if (semver.gte(CONFIG.apiVersion, "1.16.0")) {
@ -867,7 +875,7 @@ TABS.pid_tuning.initialize = function (callback) {
ADVANCED_TUNING.idleMinRpm = parseInt($('input[name="idleMinRpm-number"]').val()); ADVANCED_TUNING.idleMinRpm = parseInt($('input[name="idleMinRpm-number"]').val());
const selectedRatesType = $('select[id="ratesType"]').val(); // send analytics for rates type const selectedRatesType = $('select[id="ratesType"]').val(); // send analytics for rates type
let selectedRatesTypeName = null; let selectedRatesTypeName = undefined;
if (selectedRatesType !== RC_tuning.rates_type) { if (selectedRatesType !== RC_tuning.rates_type) {
selectedRatesTypeName = $('select[id="ratesType"]').find('option:selected').text(); selectedRatesTypeName = $('select[id="ratesType"]').find('option:selected').text();
} }
@ -1665,8 +1673,6 @@ TABS.pid_tuning.initialize = function (callback) {
// filter and tuning sliders // filter and tuning sliders
TuningSliders.initialize(); TuningSliders.initialize();
self.analyticsChanges = {};
// UNSCALED non expert slider constrain values // UNSCALED non expert slider constrain values
const NON_EXPERT_SLIDER_MAX = 1.25; const NON_EXPERT_SLIDER_MAX = 1.25;
const NON_EXPERT_SLIDER_MIN = 0.7; const NON_EXPERT_SLIDER_MIN = 0.7;
@ -1919,6 +1925,8 @@ TABS.pid_tuning.initialize = function (callback) {
MSP.send_message(MSPCodes.MSP_STATUS); MSP.send_message(MSPCodes.MSP_STATUS);
}, 250, true); }, 250, true);
self.analyticsChanges = {};
GUI.content_ready(callback); GUI.content_ready(callback);
} }
}; };