mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 16:25:22 +03:00
Remove Google Analytics (#3148)
This commit is contained in:
parent
96aeab67f4
commit
b6d8efc9f8
24 changed files with 30 additions and 743 deletions
|
@ -1,180 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
const Analytics = function (trackingId, userId, appName, appVersion, gitRevision, os, checkForDebugVersions, optOut, debugMode, buildType) {
|
||||
this._trackingId = trackingId;
|
||||
|
||||
this.setOptOut(optOut);
|
||||
|
||||
this._googleAnalytics = googleAnalytics;
|
||||
|
||||
this._googleAnalytics.initialize(this._trackingId, {
|
||||
storage: 'none',
|
||||
clientId: userId,
|
||||
debug: !!debugMode,
|
||||
});
|
||||
|
||||
// Make it work for the Chrome App:
|
||||
this._googleAnalytics.set('forceSSL', true);
|
||||
this._googleAnalytics.set('transport', 'xhr');
|
||||
|
||||
// Make it work for NW.js:
|
||||
this._googleAnalytics.set('checkProtocolTask', null);
|
||||
|
||||
this._googleAnalytics.set('appName', appName);
|
||||
this._googleAnalytics.set('appVersion', debugMode ? `${appVersion}-debug` : appVersion);
|
||||
|
||||
this.EVENT_CATEGORIES = {
|
||||
APPLICATION: 'Application',
|
||||
FLIGHT_CONTROLLER: 'FlightController',
|
||||
FLASHING: 'Flashing',
|
||||
};
|
||||
|
||||
this.DATA = {
|
||||
BOARD_TYPE: 'boardType',
|
||||
API_VERSION: 'apiVersion',
|
||||
FIRMWARE_TYPE: 'firmwareType',
|
||||
FIRMWARE_VERSION: 'firmwareVersion',
|
||||
FIRMWARE_NAME: 'firmwareName',
|
||||
FIRMWARE_SOURCE: 'firmwareSource',
|
||||
FIRMWARE_CHANNEL: 'firmwareChannel',
|
||||
FIRMWARE_ERASE_ALL: 'firmwareEraseAll',
|
||||
FIRMWARE_SIZE: 'firmwareSize',
|
||||
MCU_ID: 'mcuId',
|
||||
LOGGING_STATUS: 'loggingStatus',
|
||||
LOG_SIZE: 'logSize',
|
||||
TARGET_NAME: 'targetName',
|
||||
BOARD_NAME: 'boardName',
|
||||
MANUFACTURER_ID: 'manufacturerId',
|
||||
MCU_TYPE: 'mcuType',
|
||||
};
|
||||
|
||||
this.DIMENSIONS = {
|
||||
CONFIGURATOR_OS: 1,
|
||||
BOARD_TYPE: 2,
|
||||
FIRMWARE_TYPE: 3,
|
||||
FIRMWARE_VERSION: 4,
|
||||
API_VERSION: 5,
|
||||
FIRMWARE_NAME: 6,
|
||||
FIRMWARE_SOURCE: 7,
|
||||
FIRMWARE_ERASE_ALL: 8,
|
||||
CONFIGURATOR_EXPERT_MODE: 9,
|
||||
FIRMWARE_CHANNEL: 10,
|
||||
LOGGING_STATUS: 11,
|
||||
MCU_ID: 12,
|
||||
CONFIGURATOR_CHANGESET_ID: 13,
|
||||
CONFIGURATOR_USE_DEBUG_VERSIONS: 14,
|
||||
TARGET_NAME: 15,
|
||||
BOARD_NAME: 16,
|
||||
MANUFACTURER_ID: 17,
|
||||
MCU_TYPE: 18,
|
||||
CONFIGURATOR_BUILD_TYPE: 19,
|
||||
};
|
||||
|
||||
this.METRICS = {
|
||||
FIRMWARE_SIZE: 1,
|
||||
LOG_SIZE: 2,
|
||||
};
|
||||
|
||||
this.setDimension(this.DIMENSIONS.CONFIGURATOR_OS, os);
|
||||
this.setDimension(this.DIMENSIONS.CONFIGURATOR_CHANGESET_ID, gitRevision);
|
||||
this.setDimension(this.DIMENSIONS.CONFIGURATOR_USE_DEBUG_VERSIONS, checkForDebugVersions);
|
||||
this.setDimension(this.DIMENSIONS.CONFIGURATOR_BUILD_TYPE, buildType);
|
||||
|
||||
this.resetFlightControllerData();
|
||||
this.resetFirmwareData();
|
||||
};
|
||||
|
||||
Analytics.prototype.setDimension = function (dimension, value) {
|
||||
const dimensionName = `dimension${dimension}`;
|
||||
this._googleAnalytics.custom(dimensionName, value);
|
||||
};
|
||||
|
||||
Analytics.prototype.setMetric = function (metric, value) {
|
||||
const metricName = `metric${metric}`;
|
||||
this._googleAnalytics.custom(metricName, value);
|
||||
};
|
||||
|
||||
Analytics.prototype.sendEvent = function (category, action, options) {
|
||||
this._googleAnalytics.event(category, action, options);
|
||||
};
|
||||
|
||||
Analytics.prototype.sendChangeEvents = function (category, changeList) {
|
||||
for (const actionName in changeList) {
|
||||
if (changeList.hasOwnProperty(actionName)) {
|
||||
const actionValue = changeList[actionName];
|
||||
if (actionValue !== undefined) {
|
||||
this.sendEvent(category, actionName, { eventLabel: actionValue });
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Analytics.prototype.sendSaveAndChangeEvents = function (category, changeList, tabName) {
|
||||
this.sendEvent(category, 'Save', {
|
||||
eventLabel: tabName,
|
||||
eventValue: Object.keys(changeList).length,
|
||||
});
|
||||
this.sendChangeEvents(category, changeList);
|
||||
};
|
||||
|
||||
Analytics.prototype.sendAppView = function (viewName) {
|
||||
this._googleAnalytics.screenview(viewName);
|
||||
};
|
||||
|
||||
Analytics.prototype.sendTiming = function (category, timing, value) {
|
||||
this._googleAnalytics.timing(category, timing, value);
|
||||
};
|
||||
|
||||
Analytics.prototype.sendException = function (message) {
|
||||
this._googleAnalytics.exception(message);
|
||||
};
|
||||
|
||||
Analytics.prototype.setOptOut = function (optOut) {
|
||||
window[`ga-disable-${this._trackingId}`] = !!optOut;
|
||||
};
|
||||
|
||||
Analytics.prototype._rebuildFlightControllerEvent = function () {
|
||||
this.setDimension(this.DIMENSIONS.BOARD_TYPE, this._flightControllerData[this.DATA.BOARD_TYPE]);
|
||||
this.setDimension(this.DIMENSIONS.FIRMWARE_TYPE, this._flightControllerData[this.DATA.FIRMWARE_TYPE]);
|
||||
this.setDimension(this.DIMENSIONS.FIRMWARE_VERSION, this._flightControllerData[this.DATA.FIRMWARE_VERSION]);
|
||||
this.setDimension(this.DIMENSIONS.API_VERSION, this._flightControllerData[this.DATA.API_VERSION]);
|
||||
this.setDimension(this.DIMENSIONS.LOGGING_STATUS, this._flightControllerData[this.DATA.LOGGING_STATUS]);
|
||||
this.setDimension(this.DIMENSIONS.MCU_ID, this._flightControllerData[this.DATA.MCU_ID]);
|
||||
this.setMetric(this.METRICS.LOG_SIZE, this._flightControllerData[this.DATA.LOG_SIZE]);
|
||||
this.setDimension(this.DIMENSIONS.TARGET_NAME, this._flightControllerData[this.DATA.TARGET_NAME]);
|
||||
this.setDimension(this.DIMENSIONS.BOARD_NAME, this._flightControllerData[this.DATA.BOARD_NAME]);
|
||||
this.setDimension(this.DIMENSIONS.MANUFACTURER_ID, this._flightControllerData[this.DATA.MANUFACTURER_ID]);
|
||||
this.setDimension(this.DIMENSIONS.MCU_TYPE, this._flightControllerData[this.DATA.MCU_TYPE]);
|
||||
};
|
||||
|
||||
Analytics.prototype.setFlightControllerData = function (property, value) {
|
||||
this._flightControllerData[property] = value;
|
||||
|
||||
this._rebuildFlightControllerEvent();
|
||||
};
|
||||
|
||||
Analytics.prototype.resetFlightControllerData = function () {
|
||||
this._flightControllerData = {};
|
||||
|
||||
this._rebuildFlightControllerEvent();
|
||||
};
|
||||
|
||||
Analytics.prototype._rebuildFirmwareEvent = function () {
|
||||
this.setDimension(this.DIMENSIONS.FIRMWARE_NAME, this._firmwareData[this.DATA.FIRMWARE_NAME]);
|
||||
this.setDimension(this.DIMENSIONS.FIRMWARE_SOURCE, this._firmwareData[this.DATA.FIRMWARE_SOURCE]);
|
||||
this.setDimension(this.DIMENSIONS.FIRMWARE_ERASE_ALL, this._firmwareData[this.DATA.FIRMWARE_ERASE_ALL]);
|
||||
this.setDimension(this.DIMENSIONS.FIRMWARE_CHANNEL, this._firmwareData[this.DATA.FIRMWARE_CHANNEL]);
|
||||
this.setMetric(this.METRICS.FIRMWARE_SIZE, this._firmwareData[this.DATA.FIRMWARE_SIZE]);
|
||||
};
|
||||
|
||||
Analytics.prototype.setFirmwareData = function (property, value) {
|
||||
this._firmwareData[property] = value;
|
||||
|
||||
this._rebuildFirmwareEvent();
|
||||
};
|
||||
|
||||
Analytics.prototype.resetFirmwareData = function () {
|
||||
this._firmwareData = {};
|
||||
|
||||
this._rebuildFirmwareEvent();
|
||||
};
|
|
@ -51,8 +51,6 @@ CliAutoComplete.setEnabled = function(enable) {
|
|||
};
|
||||
|
||||
CliAutoComplete.initialize = function($textarea, sendLine, writeToOutput) {
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.APPLICATION, 'CliAutoComplete', this.configEnabled);
|
||||
|
||||
this.$textarea = $textarea;
|
||||
this.forceOpen = false;
|
||||
this.sendLine = sendLine;
|
||||
|
|
|
@ -39,23 +39,14 @@ const Features = function (config) {
|
|||
|
||||
self._features = features;
|
||||
self._featureMask = 0;
|
||||
|
||||
self._analyticsChanges = {};
|
||||
};
|
||||
|
||||
Features.prototype.getMask = function () {
|
||||
const self = this;
|
||||
|
||||
analytics.sendChangeEvents(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, self._analyticsChanges);
|
||||
self._analyticsChanges = {};
|
||||
|
||||
return self._featureMask;
|
||||
return this._featureMask;
|
||||
};
|
||||
|
||||
Features.prototype.setMask = function (featureMask) {
|
||||
const self = this;
|
||||
|
||||
self._featureMask = featureMask;
|
||||
this._featureMask = featureMask;
|
||||
};
|
||||
|
||||
Features.prototype.isEnabled = function (featureName) {
|
||||
|
@ -168,33 +159,25 @@ Features.prototype.updateData = function (featureElement) {
|
|||
|
||||
if (featureElement.attr('type') === 'checkbox') {
|
||||
const bit = featureElement.data('bit');
|
||||
let featureValue;
|
||||
|
||||
if (featureElement.is(':checked')) {
|
||||
self._featureMask = bit_set(self._featureMask, bit);
|
||||
featureValue = 'On';
|
||||
} else {
|
||||
self._featureMask = bit_clear(self._featureMask, bit);
|
||||
featureValue = 'Off';
|
||||
}
|
||||
self._analyticsChanges[`Feature${self.findFeatureByBit(bit).name}`] = featureValue;
|
||||
} else if (featureElement.prop('localName') === 'select') {
|
||||
const controlElements = featureElement.children();
|
||||
const selectedBit = featureElement.val();
|
||||
|
||||
if (selectedBit !== -1) {
|
||||
let selectedFeature;
|
||||
for (const controlElement of controlElements) {
|
||||
const bit = controlElement.value;
|
||||
if (selectedBit === bit) {
|
||||
self._featureMask = bit_set(self._featureMask, bit);
|
||||
selectedFeature = self.findFeatureByBit(bit);
|
||||
} else {
|
||||
self._featureMask = bit_clear(self._featureMask, bit);
|
||||
}
|
||||
}
|
||||
if (selectedFeature) {
|
||||
self._analyticsChanges[`FeatureGroup-${selectedFeature.group}`] = selectedFeature.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -225,7 +225,6 @@ function configuration_backup(callback) {
|
|||
return;
|
||||
}
|
||||
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, 'Backup');
|
||||
console.log('Write SUCCESSFUL');
|
||||
if (callback) callback();
|
||||
};
|
||||
|
@ -308,8 +307,6 @@ function configuration_restore(callback) {
|
|||
configuration.FEATURE_CONFIG.features = features;
|
||||
}
|
||||
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, 'Restore');
|
||||
|
||||
configuration_upload(configuration, callback);
|
||||
} else {
|
||||
GUI.log(i18n.getMessage('backupFileIncompatible'));
|
||||
|
|
|
@ -57,66 +57,13 @@ function appReady() {
|
|||
i18n.init(function() {
|
||||
startProcess();
|
||||
|
||||
checkSetupAnalytics(function (analyticsService) {
|
||||
analyticsService.sendEvent(analyticsService.EVENT_CATEGORIES.APPLICATION, 'SelectedLanguage', i18n.selectedLanguage);
|
||||
});
|
||||
|
||||
initializeSerialBackend();
|
||||
|
||||
$('.connect_b a.connect').removeClass('disabled');
|
||||
$('.firmware_b a.flash').removeClass('disabled');
|
||||
});
|
||||
}
|
||||
|
||||
function checkSetupAnalytics(callback) {
|
||||
if (!analytics) {
|
||||
setTimeout(function () {
|
||||
const result = ConfigStorage.get(['userId', 'analyticsOptOut', 'checkForConfiguratorUnstableVersions' ]);
|
||||
if (!analytics) {
|
||||
setupAnalytics(result);
|
||||
}
|
||||
|
||||
callback(analytics);
|
||||
});
|
||||
} else if (callback) {
|
||||
callback(analytics);
|
||||
}
|
||||
}
|
||||
|
||||
function getBuildType() {
|
||||
return GUI.Mode;
|
||||
}
|
||||
|
||||
function setupAnalytics(result) {
|
||||
let userId;
|
||||
if (result.userId) {
|
||||
userId = result.userId;
|
||||
} else {
|
||||
const uid = new ShortUniqueId();
|
||||
userId = uid.randomUUID(13);
|
||||
|
||||
ConfigStorage.set({ 'userId': userId });
|
||||
}
|
||||
|
||||
const optOut = !!result.analyticsOptOut;
|
||||
const checkForDebugVersions = !!result.checkForConfiguratorUnstableVersions;
|
||||
|
||||
const debugMode = typeof process === "object" && process.versions['nw-flavor'] === 'sdk';
|
||||
|
||||
window.analytics = new Analytics('UA-123002063-1', userId, CONFIGURATOR.productName, CONFIGURATOR.version, CONFIGURATOR.gitRevision, GUI.operating_system,
|
||||
checkForDebugVersions, optOut, debugMode, getBuildType());
|
||||
|
||||
function logException(exception) {
|
||||
analytics.sendException(exception.stack);
|
||||
}
|
||||
|
||||
if (typeof process === "object") {
|
||||
process.on('uncaughtException', logException);
|
||||
}
|
||||
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.APPLICATION, 'AppStart', { sessionControl: 'start' });
|
||||
|
||||
$('.connect_b a.connect').removeClass('disabled');
|
||||
$('.firmware_b a.flash').removeClass('disabled');
|
||||
}
|
||||
|
||||
function closeSerial() {
|
||||
// automatically close the port when application closes
|
||||
const connectionId = serial.connectionId;
|
||||
|
@ -177,8 +124,6 @@ function closeHandler() {
|
|||
this.hide();
|
||||
}
|
||||
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.APPLICATION, 'AppClose', { sessionControl: 'end' });
|
||||
|
||||
closeSerial();
|
||||
|
||||
if (!GUI.isCordova()) {
|
||||
|
@ -313,10 +258,6 @@ function startProcess() {
|
|||
GUI.tab_switch_in_progress = false;
|
||||
}
|
||||
|
||||
checkSetupAnalytics(function (analyticsService) {
|
||||
analyticsService.sendAppView(tab);
|
||||
});
|
||||
|
||||
switch (tab) {
|
||||
case 'landing':
|
||||
import("./tabs/landing").then(({ landing }) =>
|
||||
|
@ -573,9 +514,6 @@ function startProcess() {
|
|||
|
||||
$(expertModeCheckbox).on("change", () => {
|
||||
const checked = $(expertModeCheckbox).is(':checked');
|
||||
checkSetupAnalytics(function (analyticsService) {
|
||||
analyticsService.setDimension(analyticsService.DIMENSIONS.CONFIGURATOR_EXPERT_MODE, checked ? 'On' : 'Off');
|
||||
});
|
||||
|
||||
if (FC.FEATURE_CONFIG && FC.FEATURE_CONFIG.features !== 0) {
|
||||
updateTabList(FC.FEATURE_CONFIG.features);
|
||||
|
@ -619,10 +557,6 @@ function startProcess() {
|
|||
|
||||
function setDarkTheme(enabled) {
|
||||
DarkTheme.setConfig(enabled);
|
||||
|
||||
checkSetupAnalytics(function (analyticsService) {
|
||||
analyticsService.sendEvent(analyticsService.EVENT_CATEGORIES.APPLICATION, 'DarkTheme', enabled);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
@ -788,8 +722,6 @@ function showErrorDialog(message) {
|
|||
|
||||
// TODO: all of these are used as globals in other parts.
|
||||
// once moved to modules extract to own module.
|
||||
window.googleAnalytics = analytics;
|
||||
window.analytics = null;
|
||||
window.showErrorDialog = showErrorDialog;
|
||||
window.generateFilename = generateFilename;
|
||||
window.updateTabList = updateTabList;
|
||||
|
@ -797,4 +729,3 @@ window.isExpertModeEnabled = isExpertModeEnabled;
|
|||
window.checkForConfiguratorUpdates = checkForConfiguratorUpdates;
|
||||
window.setDarkTheme = setDarkTheme;
|
||||
window.appReady = appReady;
|
||||
window.checkSetupAnalytics = checkSetupAnalytics;
|
||||
|
|
|
@ -157,16 +157,9 @@ function finishClose(finishedCallback) {
|
|||
|
||||
const wasConnected = CONFIGURATOR.connectionValid;
|
||||
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, 'Disconnected');
|
||||
if (connectionTimestamp) {
|
||||
const connectedTime = Date.now() - connectionTimestamp;
|
||||
analytics.sendTiming(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, 'Connected', connectedTime);
|
||||
}
|
||||
// close reset to custom defaults dialog
|
||||
$('#dialogResetToCustomDefaults')[0].close();
|
||||
|
||||
analytics.resetFlightControllerData();
|
||||
|
||||
serial.disconnect(onClosed);
|
||||
|
||||
MSP.disconnect_cleanup();
|
||||
|
@ -249,18 +242,13 @@ function onOpen(openInfo) {
|
|||
console.log(`Requesting configuration data`);
|
||||
|
||||
MSP.send_message(MSPCodes.MSP_API_VERSION, false, false, function () {
|
||||
analytics.setFlightControllerData(analytics.DATA.API_VERSION, FC.CONFIG.apiVersion);
|
||||
|
||||
GUI.log(i18n.getMessage('apiVersionReceived', [FC.CONFIG.apiVersion]));
|
||||
|
||||
if (semver.gte(FC.CONFIG.apiVersion, CONFIGURATOR.API_VERSION_ACCEPTED)) {
|
||||
|
||||
MSP.send_message(MSPCodes.MSP_FC_VARIANT, false, false, function () {
|
||||
analytics.setFlightControllerData(analytics.DATA.FIRMWARE_TYPE, FC.CONFIG.flightControllerIdentifier);
|
||||
if (FC.CONFIG.flightControllerIdentifier === 'BTFL') {
|
||||
MSP.send_message(MSPCodes.MSP_FC_VERSION, false, false, function () {
|
||||
analytics.setFlightControllerData(analytics.DATA.FIRMWARE_VERSION, FC.CONFIG.flightControllerVersion);
|
||||
|
||||
GUI.log(i18n.getMessage('fcInfoReceived', [FC.CONFIG.flightControllerIdentifier, FC.CONFIG.flightControllerVersion]));
|
||||
|
||||
MSP.send_message(MSPCodes.MSP_BUILD_INFO, false, false, function () {
|
||||
|
@ -271,8 +259,6 @@ function onOpen(openInfo) {
|
|||
});
|
||||
});
|
||||
} else {
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, 'ConnectionRefusedFirmwareType', FC.CONFIG.flightControllerIdentifier);
|
||||
|
||||
const dialog = $('.dialogConnectWarning')[0];
|
||||
|
||||
$('.dialogConnectWarning-content').html(i18n.getMessage('firmwareTypeNotSupported'));
|
||||
|
@ -287,8 +273,6 @@ function onOpen(openInfo) {
|
|||
}
|
||||
});
|
||||
} else {
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, 'ConnectionRefusedFirmwareVersion', FC.CONFIG.apiVersion);
|
||||
|
||||
const dialog = $('.dialogConnectWarning')[0];
|
||||
|
||||
$('.dialogConnectWarning-content').html(i18n.getMessage('firmwareVersionNotSupported', [CONFIGURATOR.API_VERSION_ACCEPTED]));
|
||||
|
@ -303,8 +287,6 @@ function onOpen(openInfo) {
|
|||
}
|
||||
});
|
||||
} else {
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, 'SerialPortFailed');
|
||||
|
||||
console.log('Failed to open serial port');
|
||||
GUI.log(i18n.getMessage('serialPortOpenFail'));
|
||||
|
||||
|
@ -341,20 +323,12 @@ function abortConnect() {
|
|||
}
|
||||
|
||||
function processBoardInfo() {
|
||||
analytics.setFlightControllerData(analytics.DATA.BOARD_TYPE, FC.CONFIG.boardIdentifier);
|
||||
analytics.setFlightControllerData(analytics.DATA.TARGET_NAME, FC.CONFIG.targetName);
|
||||
analytics.setFlightControllerData(analytics.DATA.BOARD_NAME, FC.CONFIG.boardName);
|
||||
analytics.setFlightControllerData(analytics.DATA.MANUFACTURER_ID, FC.CONFIG.manufacturerId);
|
||||
analytics.setFlightControllerData(analytics.DATA.MCU_TYPE, FC.getMcuType());
|
||||
|
||||
GUI.log(i18n.getMessage('boardInfoReceived', [FC.getHardwareName(), FC.CONFIG.boardVersion]));
|
||||
|
||||
if (bit_check(FC.CONFIG.targetCapabilities, FC.TARGET_CAPABILITIES_FLAGS.SUPPORTS_CUSTOM_DEFAULTS) && bit_check(FC.CONFIG.targetCapabilities, FC.TARGET_CAPABILITIES_FLAGS.HAS_CUSTOM_DEFAULTS) && FC.CONFIG.configurationState === FC.CONFIGURATION_STATES.DEFAULTS_BARE) {
|
||||
const dialog = $('#dialogResetToCustomDefaults')[0];
|
||||
|
||||
$('#dialogResetToCustomDefaults-acceptbtn').click(function() {
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, 'AcceptResetToCustomDefaults');
|
||||
|
||||
const buffer = [];
|
||||
buffer.push(mspHelper.RESET_TYPES.CUSTOM_DEFAULTS);
|
||||
MSP.send_message(MSPCodes.MSP_RESET_CONF, buffer, false);
|
||||
|
@ -367,8 +341,6 @@ function processBoardInfo() {
|
|||
});
|
||||
|
||||
$('#dialogResetToCustomDefaults-cancelbtn').click(function() {
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, 'CancelResetToCustomDefaults');
|
||||
|
||||
dialog.close();
|
||||
|
||||
setConnectionTimeout();
|
||||
|
@ -385,15 +357,12 @@ function processBoardInfo() {
|
|||
}
|
||||
|
||||
function checkReportProblems() {
|
||||
const PROBLEM_ANALYTICS_EVENT = 'ProblemFound';
|
||||
const problemItemTemplate = $('#dialogReportProblems-listItemTemplate');
|
||||
|
||||
function checkReportProblem(problemName, problemDialogList) {
|
||||
if (bit_check(FC.CONFIG.configurationProblems, FC.CONFIGURATION_PROBLEM_FLAGS[problemName])) {
|
||||
problemItemTemplate.clone().html(i18n.getMessage(`reportProblemsDialog${problemName}`)).appendTo(problemDialogList);
|
||||
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, PROBLEM_ANALYTICS_EVENT, problemName);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -410,9 +379,6 @@ function checkReportProblems() {
|
|||
problemItemTemplate.clone().html(i18n.getMessage(`reportProblemsDialog${problemName}`,
|
||||
[CONFIGURATOR.latestVersion, CONFIGURATOR.latestVersionReleaseUrl, CONFIGURATOR.getDisplayVersion(), FC.CONFIG.flightControllerVersion])).appendTo(problemDialogList);
|
||||
needsProblemReportingDialog = true;
|
||||
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, PROBLEM_ANALYTICS_EVENT,
|
||||
`${problemName};${CONFIGURATOR.API_VERSION_MAX_SUPPORTED};${FC.CONFIG.apiVersion}`);
|
||||
}
|
||||
|
||||
needsProblemReportingDialog = checkReportProblem('MOTOR_PROTOCOL_DISABLED', problemDialogList) || needsProblemReportingDialog;
|
||||
|
@ -440,8 +406,6 @@ function processUid() {
|
|||
MSP.send_message(MSPCodes.MSP_UID, false, false, function () {
|
||||
const uniqueDeviceIdentifier = FC.CONFIG.uid[0].toString(16) + FC.CONFIG.uid[1].toString(16) + FC.CONFIG.uid[2].toString(16);
|
||||
|
||||
analytics.setFlightControllerData(analytics.DATA.MCU_ID, objectHash.sha1(uniqueDeviceIdentifier));
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, 'Connected');
|
||||
connectionTimestamp = Date.now();
|
||||
GUI.log(i18n.getMessage('uniqueDeviceIdReceived', [uniqueDeviceIdentifier]));
|
||||
|
||||
|
|
|
@ -50,7 +50,6 @@ function getCliCommand(command, cliBuffer) {
|
|||
function copyToClipboard(text) {
|
||||
function onCopySuccessful() {
|
||||
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, 'CliCopyToClipboard', text.length);
|
||||
const button = TABS.cli.GUI.copyButton;
|
||||
const origText = button.text();
|
||||
const origWidth = button.css("width");
|
||||
|
@ -168,8 +167,6 @@ cli.initialize = function (callback) {
|
|||
if (self.outputHistory.length > 0 && writer.length === 0) {
|
||||
writer.write(new Blob([self.outputHistory], {type: 'text/plain'}));
|
||||
} else {
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, 'CliSave', self.outputHistory.length);
|
||||
|
||||
console.log('write complete');
|
||||
}
|
||||
};
|
||||
|
@ -214,8 +211,6 @@ cli.initialize = function (callback) {
|
|||
function executeSnippet(fileName) {
|
||||
const commands = previewArea.val();
|
||||
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, 'CliExecuteFromFile', fileName);
|
||||
|
||||
executeCommands(commands);
|
||||
self.GUI.snippetPreviewWindow.close();
|
||||
}
|
||||
|
|
|
@ -2,12 +2,10 @@ import semver from 'semver';
|
|||
import { i18n } from '../localization';
|
||||
|
||||
const configuration = {
|
||||
analyticsChanges: {},
|
||||
// intended
|
||||
};
|
||||
|
||||
configuration.initialize = function (callback) {
|
||||
const self = this;
|
||||
|
||||
if (GUI.active_tab != 'configuration') {
|
||||
GUI.active_tab = 'configuration';
|
||||
GUI.configuration_loaded = true;
|
||||
|
@ -49,8 +47,6 @@ configuration.initialize = function (callback) {
|
|||
load_serial_config();
|
||||
|
||||
function process_html() {
|
||||
self.analyticsChanges = {};
|
||||
|
||||
const features_e = $('.tab-configuration .features');
|
||||
|
||||
FC.FEATURE_CONFIG.features.generateElements(features_e);
|
||||
|
@ -129,39 +125,15 @@ configuration.initialize = function (callback) {
|
|||
orientation_mag_e.val(FC.SENSOR_ALIGNMENT.align_mag);
|
||||
|
||||
orientation_gyro_e.change(function () {
|
||||
let value = parseInt($(this).val());
|
||||
|
||||
let newValue = undefined;
|
||||
if (value !== FC.SENSOR_ALIGNMENT.align_gyro) {
|
||||
newValue = $(this).find('option:selected').text();
|
||||
}
|
||||
self.analyticsChanges['GyroAlignment'] = newValue;
|
||||
|
||||
FC.SENSOR_ALIGNMENT.align_gyro = value;
|
||||
FC.SENSOR_ALIGNMENT.align_gyro = parseInt($(this).val());
|
||||
});
|
||||
|
||||
orientation_acc_e.change(function () {
|
||||
let value = parseInt($(this).val());
|
||||
|
||||
let newValue = undefined;
|
||||
if (value !== FC.SENSOR_ALIGNMENT.align_acc) {
|
||||
newValue = $(this).find('option:selected').text();
|
||||
}
|
||||
self.analyticsChanges['AccAlignment'] = newValue;
|
||||
|
||||
FC.SENSOR_ALIGNMENT.align_acc = value;
|
||||
FC.SENSOR_ALIGNMENT.align_acc = parseInt($(this).val());
|
||||
});
|
||||
|
||||
orientation_mag_e.change(function () {
|
||||
let value = parseInt($(this).val());
|
||||
|
||||
let newValue = undefined;
|
||||
if (value !== FC.SENSOR_ALIGNMENT.align_mag) {
|
||||
newValue = $(this).find('option:selected').text();
|
||||
}
|
||||
self.analyticsChanges['MagAlignment'] = newValue;
|
||||
|
||||
FC.SENSOR_ALIGNMENT.align_mag = value;
|
||||
FC.SENSOR_ALIGNMENT.align_mag = parseInt($(this).val());
|
||||
});
|
||||
|
||||
// Multi gyro config
|
||||
|
@ -205,27 +177,11 @@ configuration.initialize = function (callback) {
|
|||
$('.gyro_alignment_inputs_notfound').toggle(!detected_gyro_1 && !detected_gyro_2);
|
||||
|
||||
orientation_gyro_1_align_e.change(function () {
|
||||
let value = parseInt($(this).val());
|
||||
|
||||
let newValue = undefined;
|
||||
if (value !== FC.SENSOR_ALIGNMENT.gyro_1_align) {
|
||||
newValue = $(this).find('option:selected').text();
|
||||
}
|
||||
self.analyticsChanges['Gyro1Alignment'] = newValue;
|
||||
|
||||
FC.SENSOR_ALIGNMENT.gyro_1_align = value;
|
||||
FC.SENSOR_ALIGNMENT.gyro_1_align = parseInt($(this).val());
|
||||
});
|
||||
|
||||
orientation_gyro_2_align_e.change(function () {
|
||||
let value = parseInt($(this).val());
|
||||
|
||||
let newValue = undefined;
|
||||
if (value !== FC.SENSOR_ALIGNMENT.gyro_2_align) {
|
||||
newValue = $(this).find('option:selected').text();
|
||||
}
|
||||
self.analyticsChanges['Gyro2Alignment'] = newValue;
|
||||
|
||||
FC.SENSOR_ALIGNMENT.gyro_2_align = value;
|
||||
FC.SENSOR_ALIGNMENT.gyro_2_align = parseInt($(this).val());
|
||||
});
|
||||
|
||||
// Gyro and PID update
|
||||
|
@ -489,20 +445,10 @@ configuration.initialize = function (callback) {
|
|||
|
||||
const value = parseInt(pidSelectElement.val());
|
||||
|
||||
if (value !== FC.PID_ADVANCED_CONFIG.pid_process_denom) {
|
||||
const newFrequency = pidSelectElement.find('option:selected').text();
|
||||
self.analyticsChanges['PIDLoopSettings'] = `denominator: ${value} | frequency: ${newFrequency}`;
|
||||
} else {
|
||||
self.analyticsChanges['PIDLoopSettings'] = undefined;
|
||||
}
|
||||
|
||||
FC.PID_ADVANCED_CONFIG.pid_process_denom = value;
|
||||
|
||||
FC.RX_CONFIG.fpvCamAngleDegrees = parseInt($('input[name="fpvCamAngleDegrees"]').val());
|
||||
|
||||
analytics.sendSaveAndChangeEvents(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, self.analyticsChanges, 'configuration');
|
||||
self.analyticsChanges = {};
|
||||
|
||||
// fill some data
|
||||
FC.GPS_CONFIG.auto_baud = $('input[name="gps_auto_baud"]').is(':checked') ? 1 : 0;
|
||||
FC.GPS_CONFIG.auto_config = $('input[name="gps_auto_config"]').is(':checked') ? 1 : 0;
|
||||
|
|
|
@ -98,7 +98,6 @@ firmware_flasher.initialize = function (callback) {
|
|||
self.parsed_hex = data;
|
||||
|
||||
if (self.parsed_hex) {
|
||||
analytics.setFirmwareData(analytics.DATA.FIRMWARE_SIZE, self.parsed_hex.bytes_total);
|
||||
showLoadedHex(key);
|
||||
} else {
|
||||
self.flashingMessage(i18n.getMessage('firmwareFlasherHexCorrupted'), self.FLASH_MESSAGE_TYPES.INVALID);
|
||||
|
@ -231,8 +230,6 @@ firmware_flasher.initialize = function (callback) {
|
|||
i18n.localizePage();
|
||||
|
||||
buildType_e.change(function() {
|
||||
analytics.setFirmwareData(analytics.DATA.FIRMWARE_CHANNEL, $('option:selected', this).text());
|
||||
|
||||
$("a.load_remote_file").addClass('disabled');
|
||||
const build_type = $(this).val();
|
||||
|
||||
|
@ -451,13 +448,9 @@ firmware_flasher.initialize = function (callback) {
|
|||
function flashFirmware(firmware) {
|
||||
const options = {};
|
||||
|
||||
let eraseAll = false;
|
||||
if ($('input.erase_chip').is(':checked')) {
|
||||
options.erase_chip = true;
|
||||
|
||||
eraseAll = true;
|
||||
}
|
||||
analytics.setFirmwareData(analytics.DATA.FIRMWARE_ERASE_ALL, eraseAll.toString());
|
||||
|
||||
if (!$('option:selected', portPickerElement).data().isDFU) {
|
||||
if (String(portPickerElement.val()) !== '0') {
|
||||
|
@ -474,16 +467,12 @@ firmware_flasher.initialize = function (callback) {
|
|||
baud = parseInt($('#flash_manual_baud_rate').val());
|
||||
}
|
||||
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLASHING, 'Flashing', self.fileName || null);
|
||||
|
||||
STM32.connect(port, baud, firmware, options);
|
||||
} else {
|
||||
console.log('Please select valid serial port');
|
||||
GUI.log(i18n.getMessage('firmwareFlasherNoValidPort'));
|
||||
}
|
||||
} else {
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLASHING, 'Flashing', self.fileName || null);
|
||||
|
||||
STM32DFU.connect(usbDevices, firmware, options);
|
||||
}
|
||||
}
|
||||
|
@ -684,9 +673,6 @@ firmware_flasher.initialize = function (callback) {
|
|||
self.enableFlashing(false);
|
||||
self.developmentFirmwareLoaded = false;
|
||||
|
||||
analytics.setFirmwareData(analytics.DATA.FIRMWARE_CHANNEL, undefined);
|
||||
analytics.setFirmwareData(analytics.DATA.FIRMWARE_SOURCE, 'file');
|
||||
|
||||
chrome.fileSystem.chooseEntry({
|
||||
type: 'openFile',
|
||||
accepts: [
|
||||
|
@ -708,7 +694,6 @@ firmware_flasher.initialize = function (callback) {
|
|||
console.log('Loading file from:', path);
|
||||
|
||||
fileEntry.file(function (file) {
|
||||
analytics.setFirmwareData(analytics.DATA.FIRMWARE_NAME, file.name);
|
||||
const reader = new FileReader();
|
||||
|
||||
reader.onloadend = function(e) {
|
||||
|
@ -722,7 +707,6 @@ firmware_flasher.initialize = function (callback) {
|
|||
self.parsed_hex = data;
|
||||
|
||||
if (self.parsed_hex) {
|
||||
analytics.setFirmwareData(analytics.DATA.FIRMWARE_SIZE, self.parsed_hex.bytes_total);
|
||||
self.localFirmwareLoaded = true;
|
||||
|
||||
showLoadedHex(file.name);
|
||||
|
@ -769,8 +753,6 @@ firmware_flasher.initialize = function (callback) {
|
|||
self.localFirmwareLoaded = false;
|
||||
self.developmentFirmwareLoaded = buildTypesToShow[$('select[name="build_type"]').val()].tag === 'firmwareFlasherOptionLabelBuildTypeDevelopment';
|
||||
|
||||
analytics.setFirmwareData(analytics.DATA.FIRMWARE_SOURCE, 'http');
|
||||
|
||||
if ($('select[name="firmware_version"]').val() === "0") {
|
||||
GUI.log(i18n.getMessage('firmwareFlasherNoFirmwareSelected'));
|
||||
return;
|
||||
|
@ -831,8 +813,6 @@ firmware_flasher.initialize = function (callback) {
|
|||
self.releaseLoader.requestBuild(request, (info) => {
|
||||
console.info("Build requested:", info);
|
||||
|
||||
analytics.setFirmwareData(analytics.DATA.FIRMWARE_NAME, info.file);
|
||||
|
||||
updateStatus('Pending', info.key, 0, false);
|
||||
let retries = 1;
|
||||
self.releaseLoader.requestBuildStatus(info.key, (status) => {
|
||||
|
@ -876,10 +856,7 @@ firmware_flasher.initialize = function (callback) {
|
|||
}
|
||||
|
||||
function requestLegacyBuild(summary) {
|
||||
const fileName = summary.file;
|
||||
|
||||
analytics.setFirmwareData(analytics.DATA.FIRMWARE_NAME, fileName);
|
||||
self.releaseLoader.loadTargetHex(summary.url, (hex) => onLoadSuccess(hex, fileName), onLoadFailed);
|
||||
self.releaseLoader.loadTargetHex(summary.url, (hex) => onLoadSuccess(hex, summary.file), onLoadFailed);
|
||||
}
|
||||
|
||||
if (self.summary) { // undefined while list is loading or while running offline
|
||||
|
@ -905,7 +882,6 @@ firmware_flasher.initialize = function (callback) {
|
|||
if (!exitDfuElement.hasClass('disabled')) {
|
||||
exitDfuElement.addClass("disabled");
|
||||
if (!GUI.connect_lock) { // button disabled while flashing is in progress
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLASHING, 'ExitDfu', null);
|
||||
try {
|
||||
console.log('Closing DFU');
|
||||
STM32DFU.connect(usbDevices, self.parsed_hex, { exitDfu: true });
|
||||
|
@ -1060,11 +1036,7 @@ firmware_flasher.initialize = function (callback) {
|
|||
// onwriteend will be fired again when truncation is finished
|
||||
truncated = true;
|
||||
writer.truncate(blob.size);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLASHING, 'SaveFirmware', path);
|
||||
};
|
||||
|
||||
writer.write(blob);
|
||||
|
@ -1142,8 +1114,6 @@ firmware_flasher.cleanup = function (callback) {
|
|||
$('div#flashbutton a.flash_state').removeClass('active');
|
||||
$('div#flashbutton a.flash').removeClass('active');
|
||||
|
||||
analytics.resetFirmwareData();
|
||||
|
||||
if (callback) callback();
|
||||
};
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ const motors = {
|
|||
previousDshotBidir: null,
|
||||
previousFilterDynQ: null,
|
||||
previousFilterDynCount: null,
|
||||
analyticsChanges: {},
|
||||
configHasChanged: false,
|
||||
configChanges: {},
|
||||
feature3DEnabled: false,
|
||||
|
@ -232,7 +231,6 @@ motors.initialize = async function (callback) {
|
|||
|
||||
self.feature3DEnabled = FC.FEATURE_CONFIG.features.isEnabled('3D');
|
||||
const motorsEnableTestModeElement = $('#motorsEnableTestMode');
|
||||
self.analyticsChanges = {};
|
||||
|
||||
motorsEnableTestModeElement.prop('checked', false).trigger('change');
|
||||
|
||||
|
@ -354,15 +352,8 @@ motors.initialize = async function (callback) {
|
|||
reverseMotorSwitchElement.prop('checked', FC.MIXER_CONFIG.reverseMotorDir !== 0).change();
|
||||
|
||||
mixerListElement.change(function () {
|
||||
const mixerValue = parseInt($(this).val());
|
||||
FC.MIXER_CONFIG.mixer = parseInt($(this).val());
|
||||
|
||||
let newValue;
|
||||
if (mixerValue !== FC.MIXER_CONFIG.mixer) {
|
||||
newValue = $(this).find('option:selected').text();
|
||||
}
|
||||
self.analyticsChanges['Mixer'] = newValue;
|
||||
|
||||
FC.MIXER_CONFIG.mixer = mixerValue;
|
||||
refreshMixerPreview();
|
||||
});
|
||||
|
||||
|
@ -683,10 +674,7 @@ motors.initialize = async function (callback) {
|
|||
self.previousFilterDynCount = FC.FILTER_CONFIG.dyn_notch_count;
|
||||
|
||||
dshotBidirElement.on("change", function () {
|
||||
const value = $(this).prop('checked');
|
||||
const newValue = (value !== FC.MOTOR_CONFIG.use_dshot_telemetry) ? 'On' : 'Off';
|
||||
self.analyticsChanges['BidirectionalDshot'] = newValue;
|
||||
FC.MOTOR_CONFIG.use_dshot_telemetry = value;
|
||||
FC.MOTOR_CONFIG.use_dshot_telemetry = $(this).prop('checked');
|
||||
|
||||
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
|
||||
const rpmFilterIsDisabled = FC.FILTER_CONFIG.gyro_rpm_notch_harmonics === 0;
|
||||
|
@ -780,17 +768,7 @@ motors.initialize = async function (callback) {
|
|||
|
||||
escProtocolElement.val(FC.PID_ADVANCED_CONFIG.fast_pwm_protocol + 1);
|
||||
|
||||
escProtocolElement.on("change", function () {
|
||||
const escProtocolValue = parseInt($(this).val()) - 1;
|
||||
|
||||
let newValue = undefined;
|
||||
if (escProtocolValue !== FC.PID_ADVANCED_CONFIG.fast_pwm_protocol) {
|
||||
newValue = $(this).find('option:selected').text();
|
||||
}
|
||||
self.analyticsChanges['EscProtocol'] = newValue;
|
||||
|
||||
updateVisibility();
|
||||
}).trigger("change");
|
||||
escProtocolElement.on("change", () => updateVisibility()).trigger("change");
|
||||
|
||||
//trigger change dshotBidir and ESC_SENSOR to show/hide Motor Poles tab
|
||||
dshotBidirElement.change(updateVisibility).trigger("change");
|
||||
|
@ -1137,8 +1115,6 @@ motors.initialize = async function (callback) {
|
|||
}
|
||||
await MSP.promise(MSPCodes.MSP_EEPROM_WRITE);
|
||||
|
||||
analytics.sendSaveAndChangeEvents(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, self.analyticsChanges, 'motors');
|
||||
self.analyticsChanges = {};
|
||||
self.configHasChanged = false;
|
||||
|
||||
reboot();
|
||||
|
|
|
@ -136,8 +136,6 @@ onboard_logging.initialize = function (callback) {
|
|||
.toggleClass("msc-supported", true);
|
||||
|
||||
$('a.onboardLoggingRebootMsc').click(function () {
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, 'RebootMsc');
|
||||
|
||||
const buffer = [];
|
||||
if (GUI.operating_system === "Linux") {
|
||||
// Reboot into MSC using UTC time offset instead of user timezone
|
||||
|
@ -405,38 +403,26 @@ onboard_logging.initialize = function (callback) {
|
|||
$('a.onboardLoggingRebootMsc').removeClass('disabled');
|
||||
}
|
||||
|
||||
let loggingStatus;
|
||||
switch (FC.SDCARD.state) {
|
||||
case MSP.SDCARD_STATE_NOT_PRESENT:
|
||||
$(".sdcard-status").text(i18n.getMessage('sdcardStatusNoCard'));
|
||||
loggingStatus = 'SdCard: NotPresent';
|
||||
break;
|
||||
break;
|
||||
case MSP.SDCARD_STATE_FATAL:
|
||||
$(".sdcard-status").html(i18n.getMessage('sdcardStatusReboot'));
|
||||
loggingStatus = 'SdCard: Error';
|
||||
break;
|
||||
break;
|
||||
case MSP.SDCARD_STATE_READY:
|
||||
$(".sdcard-status").text(i18n.getMessage('sdcardStatusReady'));
|
||||
loggingStatus = 'SdCard: Ready';
|
||||
break;
|
||||
break;
|
||||
case MSP.SDCARD_STATE_CARD_INIT:
|
||||
$(".sdcard-status").text(i18n.getMessage('sdcardStatusStarting'));
|
||||
loggingStatus = 'SdCard: Init';
|
||||
break;
|
||||
break;
|
||||
case MSP.SDCARD_STATE_FS_INIT:
|
||||
$(".sdcard-status").text(i18n.getMessage('sdcardStatusFileSystem'));
|
||||
loggingStatus = 'SdCard: FsInit';
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
$(".sdcard-status").text(i18n.getMessage('sdcardStatusUnknown',[FC.SDCARD.state]));
|
||||
}
|
||||
|
||||
if (dataflashPresent && FC.SDCARD.state === MSP.SDCARD_STATE_NOT_PRESENT) {
|
||||
loggingStatus = 'Dataflash';
|
||||
analytics.setFlightControllerData(analytics.DATA.LOG_SIZE, FC.DATAFLASH.usedSize);
|
||||
}
|
||||
analytics.setFlightControllerData(analytics.DATA.LOGGING_STATUS, loggingStatus);
|
||||
|
||||
if (FC.SDCARD.supported && !sdcardTimer) {
|
||||
// Poll for changes in SD card status
|
||||
sdcardTimer = setTimeout(function() {
|
||||
|
@ -468,9 +454,8 @@ onboard_logging.initialize = function (callback) {
|
|||
}
|
||||
|
||||
function mark_saving_dialog_done(startTime, totalBytes, totalBytesCompressed) {
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, 'SaveDataflash');
|
||||
|
||||
const totalTime = (new Date().getTime() - startTime) / 1000;
|
||||
|
||||
console.log(`Received ${totalBytes} bytes in ${totalTime.toFixed(2)}s (${
|
||||
(totalBytes / totalTime / 1024).toFixed(2)}kB / s) with block size ${self.blockSize}.`);
|
||||
if (!isNaN(totalBytesCompressed)) {
|
||||
|
@ -630,9 +615,6 @@ onboard_logging.initialize = function (callback) {
|
|||
};
|
||||
|
||||
onboard_logging.cleanup = function (callback) {
|
||||
analytics.setFlightControllerData(analytics.DATA.LOGGING_STATUS, undefined);
|
||||
analytics.setFlightControllerData(analytics.DATA.LOG_SIZE, undefined);
|
||||
|
||||
if (sdcardTimer) {
|
||||
clearTimeout(sdcardTimer);
|
||||
sdcardTimer = false;
|
||||
|
|
|
@ -12,7 +12,6 @@ options.initialize = function (callback) {
|
|||
TABS.options.initPermanentExpertMode();
|
||||
TABS.options.initRememberLastTab();
|
||||
TABS.options.initCheckForConfiguratorUnstableVersions();
|
||||
TABS.options.initAnalyticsOptOut();
|
||||
TABS.options.initCliAutoComplete();
|
||||
TABS.options.initShowAllSerialDevices();
|
||||
TABS.options.initShowVirtualMode();
|
||||
|
@ -81,31 +80,6 @@ options.initCheckForConfiguratorUnstableVersions = function () {
|
|||
});
|
||||
};
|
||||
|
||||
options.initAnalyticsOptOut = function () {
|
||||
const result = ConfigStorage.get('analyticsOptOut');
|
||||
if (result.analyticsOptOut) {
|
||||
$('div.analyticsOptOut input').prop('checked', true);
|
||||
}
|
||||
|
||||
$('div.analyticsOptOut input').change(function () {
|
||||
const checked = $(this).is(':checked');
|
||||
|
||||
ConfigStorage.set({'analyticsOptOut': checked});
|
||||
|
||||
checkSetupAnalytics(function (analyticsService) {
|
||||
if (checked) {
|
||||
analyticsService.sendEvent(analyticsService.EVENT_CATEGORIES.APPLICATION, 'OptOut');
|
||||
}
|
||||
|
||||
analyticsService.setOptOut(checked);
|
||||
|
||||
if (!checked) {
|
||||
analyticsService.sendEvent(analyticsService.EVENT_CATEGORIES.APPLICATION, 'OptIn');
|
||||
}
|
||||
});
|
||||
}).change();
|
||||
};
|
||||
|
||||
options.initCliAutoComplete = function () {
|
||||
$('div.cliAutoComplete input')
|
||||
.prop('checked', CliAutoComplete.configEnabled)
|
||||
|
|
|
@ -2560,7 +2560,7 @@ OSD.GUI.preview = {
|
|||
};
|
||||
|
||||
const osd = {
|
||||
analyticsChanges: {},
|
||||
// intentional
|
||||
};
|
||||
|
||||
osd.initialize = function(callback) {
|
||||
|
@ -2838,11 +2838,6 @@ osd.initialize = function(callback) {
|
|||
|
||||
fieldChanged.enabled = !fieldChanged.enabled;
|
||||
|
||||
if (self.analyticsChanges[`OSDStatistic${fieldChanged.name}`] === undefined) {
|
||||
self.analyticsChanges[`OSDStatistic${fieldChanged.name}`] = 0;
|
||||
}
|
||||
self.analyticsChanges[`OSDStatistic${fieldChanged.name}`] += fieldChanged.enabled ? 1 : -1;
|
||||
|
||||
MSP.promise(MSPCodes.MSP_SET_OSD_CONFIG, OSD.msp.encodeStatistics(fieldChanged))
|
||||
.then(updateOsdView);
|
||||
}),
|
||||
|
@ -2880,11 +2875,6 @@ osd.initialize = function(callback) {
|
|||
const fieldChanged = $(this).data('field');
|
||||
fieldChanged.enabled = !fieldChanged.enabled;
|
||||
|
||||
if (self.analyticsChanges[`OSDWarning${fieldChanged.name}`] === undefined) {
|
||||
self.analyticsChanges[`OSDWarning${fieldChanged.name}`] = 0;
|
||||
}
|
||||
self.analyticsChanges[`OSDWarning${fieldChanged.name}`] += fieldChanged.enabled ? 1 : -1;
|
||||
|
||||
MSP.promise(MSPCodes.MSP_SET_OSD_CONFIG, OSD.msp.encodeOther())
|
||||
.then(updateOsdView);
|
||||
}),
|
||||
|
@ -3002,11 +2992,6 @@ osd.initialize = function(callback) {
|
|||
const $position = $(this).parent().find(`.position.${fieldChanged.name}`);
|
||||
fieldChanged.isVisible[profile] = !fieldChanged.isVisible[profile];
|
||||
|
||||
if (self.analyticsChanges[`OSDElement${fieldChanged.name}`] === undefined) {
|
||||
self.analyticsChanges[`OSDElement${fieldChanged.name}`] = 0;
|
||||
}
|
||||
self.analyticsChanges[`OSDElement${fieldChanged.name}`] += fieldChanged.isVisible[profile] ? 1 : -1;
|
||||
|
||||
if (fieldChanged.isVisible[OSD.getCurrentPreviewProfile()]) {
|
||||
$position.show();
|
||||
} else {
|
||||
|
@ -3246,20 +3231,6 @@ osd.initialize = function(callback) {
|
|||
setTimeout(() => {
|
||||
$(this).html(oldText);
|
||||
}, 1500);
|
||||
|
||||
Object.keys(self.analyticsChanges).forEach(function(change) {
|
||||
const value = self.analyticsChanges[change];
|
||||
if (value > 0) {
|
||||
self.analyticsChanges[change] = 'On';
|
||||
} else if (value < 0) {
|
||||
self.analyticsChanges[change] = 'Off';
|
||||
} else {
|
||||
self.analyticsChanges[change] = undefined;
|
||||
}
|
||||
});
|
||||
|
||||
analytics.sendSaveAndChangeEvents(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, self.analyticsChanges, 'osd');
|
||||
self.analyticsChanges = {};
|
||||
});
|
||||
|
||||
// font preview window
|
||||
|
@ -3374,8 +3345,6 @@ osd.initialize = function(callback) {
|
|||
}
|
||||
});
|
||||
|
||||
self.analyticsChanges = {};
|
||||
|
||||
MSP.promise(MSPCodes.MSP_RX_CONFIG)
|
||||
.finally(() => {
|
||||
GUI.content_ready(callback);
|
||||
|
|
|
@ -16,7 +16,6 @@ const pid_tuning = {
|
|||
SETPOINT_WEIGHT_RANGE_HIGH: 20,
|
||||
SETPOINT_WEIGHT_RANGE_LEGACY: 2.54,
|
||||
activeSubtab: 'pid',
|
||||
analyticsChanges: {},
|
||||
|
||||
CONFIGURATOR_PIDS: [],
|
||||
CONFIGURATOR_ADVANCED_TUNING: {},
|
||||
|
@ -1093,15 +1092,7 @@ pid_tuning.initialize = function (callback) {
|
|||
FC.FILTER_CONFIG.yaw_lowpass_hz = parseInt($('.pid_filter input[name="yawLowpassFrequency"]').val());
|
||||
|
||||
if (vbatpidcompensationIsUsed) {
|
||||
const element = $('input[id="vbatpidcompensation"]');
|
||||
const value = element.is(':checked') ? 1 : 0;
|
||||
let analyticsValue = undefined;
|
||||
if (value !== FC.ADVANCED_TUNING.vbatPidCompensation) {
|
||||
analyticsValue = element.is(':checked');
|
||||
}
|
||||
self.analyticsChanges['VbatPidCompensation'] = analyticsValue;
|
||||
|
||||
FC.ADVANCED_TUNING.vbatPidCompensation = value;
|
||||
FC.ADVANCED_TUNING.vbatPidCompensation = $('input[id="vbatpidcompensation"]').is(':checked') ? 1 : 0;
|
||||
}
|
||||
|
||||
FC.ADVANCED_TUNING.deltaMethod = $('#pid-tuning .delta select').val();
|
||||
|
@ -1196,15 +1187,7 @@ pid_tuning.initialize = function (callback) {
|
|||
FC.ADVANCED_TUNING.motorOutputLimit = parseInt($('.tab-pid_tuning input[name="motorLimit"]').val());
|
||||
FC.ADVANCED_TUNING.autoProfileCellCount = parseInt($('.tab-pid_tuning select[name="cellCount"]').val());
|
||||
FC.ADVANCED_TUNING.idleMinRpm = parseInt($('input[name="idleMinRpm-number"]').val());
|
||||
|
||||
const selectedRatesType = $('select[id="ratesType"]').val(); // send analytics for rates type
|
||||
let selectedRatesTypeName = undefined;
|
||||
if (selectedRatesType !== FC.RC_TUNING.rates_type) {
|
||||
selectedRatesTypeName = $('select[id="ratesType"]').find('option:selected').text();
|
||||
}
|
||||
self.analyticsChanges['RatesType'] = selectedRatesTypeName;
|
||||
|
||||
FC.RC_TUNING.rates_type = selectedRatesType;
|
||||
FC.RC_TUNING.rates_type = $('select[id="ratesType"]').val();
|
||||
}
|
||||
|
||||
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
|
||||
|
@ -1991,7 +1974,6 @@ pid_tuning.initialize = function (callback) {
|
|||
}
|
||||
|
||||
self.calculateNewPids();
|
||||
self.analyticsChanges['PidTuningSliders'] = "On";
|
||||
});
|
||||
|
||||
// reset to middle with double click
|
||||
|
@ -2083,11 +2065,9 @@ pid_tuning.initialize = function (callback) {
|
|||
if (slider.is('#sliderGyroFilterMultiplier')) {
|
||||
TuningSliders.sliderGyroFilterMultiplier = sliderValue;
|
||||
self.calculateNewGyroFilters();
|
||||
self.analyticsChanges['GyroFilterTuningSlider'] = "On";
|
||||
} else if (slider.is('#sliderDTermFilterMultiplier')) {
|
||||
TuningSliders.sliderDTermFilterMultiplier = sliderValue;
|
||||
self.calculateNewDTermFilters();
|
||||
self.analyticsChanges['DTermFilterTuningSlider'] = "On";
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -2116,13 +2096,6 @@ pid_tuning.initialize = function (callback) {
|
|||
} else {
|
||||
TuningSliders.updateFilterSlidersDisplay();
|
||||
}
|
||||
|
||||
if (TuningSliders.GyroSliderUnavailable) {
|
||||
self.analyticsChanges['GyroFilterTuningSlider'] = "Off";
|
||||
}
|
||||
if (TuningSliders.DTermSliderUnavailable) {
|
||||
self.analyticsChanges['DTermFilterTuningSlider'] = "Off";
|
||||
}
|
||||
});
|
||||
|
||||
// update on filter switch changes
|
||||
|
@ -2169,8 +2142,6 @@ pid_tuning.initialize = function (callback) {
|
|||
if ($('input[id="useIntegratedYaw"]').is(':checked')) {
|
||||
$('input[id="useIntegratedYaw"]').prop('checked', true).click();
|
||||
}
|
||||
|
||||
self.analyticsChanges['PidTuningSliders'] = "On";
|
||||
});
|
||||
|
||||
// enable Filter sliders button (legacy sliders)
|
||||
|
@ -2181,23 +2152,18 @@ pid_tuning.initialize = function (callback) {
|
|||
$('input[id="gyroLowpassEnabled"]').prop('checked', true).click();
|
||||
$('input[id="gyroLowpass2Enabled"]').prop('checked', false).click();
|
||||
TuningSliders.resetGyroFilterSlider();
|
||||
|
||||
self.analyticsChanges['GyroFilterTuningSlider'] = "On";
|
||||
}
|
||||
if (TuningSliders.DTermSliderUnavailable) {
|
||||
$('input[id="dtermLowpassDynEnabled"]').prop('checked', false).click();
|
||||
$('input[id="dtermLowpassEnabled"]').prop('checked', true).click();
|
||||
$('input[id="dtermLowpass2Enabled"]').prop('checked', false).click();
|
||||
TuningSliders.resetDTermFilterSlider();
|
||||
|
||||
self.analyticsChanges['DTermFilterTuningSlider'] = "On";
|
||||
}
|
||||
});
|
||||
|
||||
// update on pid table inputs
|
||||
$('#pid_main input').on('input', function() {
|
||||
TuningSliders.updatePidSlidersDisplay();
|
||||
self.analyticsChanges['PidTuningSliders'] = "Off";
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -2239,9 +2205,6 @@ pid_tuning.initialize = function (callback) {
|
|||
|
||||
self.refresh();
|
||||
});
|
||||
|
||||
analytics.sendSaveAndChangeEvents(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, self.analyticsChanges, 'pid_tuning');
|
||||
self.analyticsChanges = {};
|
||||
});
|
||||
|
||||
// Setup model for rates preview
|
||||
|
@ -2258,8 +2221,6 @@ pid_tuning.initialize = function (callback) {
|
|||
MSP.send_message(MSPCodes.MSP_STATUS_EX, false, false, self.checkUpdateProfile(true));
|
||||
}, 500, true);
|
||||
|
||||
self.analyticsChanges = {};
|
||||
|
||||
GUI.content_ready(callback);
|
||||
TABS.pid_tuning.isHtmlProcessing = false;
|
||||
}
|
||||
|
|
|
@ -2,12 +2,10 @@ import semver from 'semver';
|
|||
import { i18n } from "../localization";
|
||||
|
||||
const ports = {
|
||||
analyticsChanges: {},
|
||||
// intentional
|
||||
};
|
||||
|
||||
ports.initialize = function (callback) {
|
||||
const self = this;
|
||||
|
||||
let board_definition = {};
|
||||
|
||||
const functionRules = [
|
||||
|
@ -119,8 +117,6 @@ ports.initialize = function (callback) {
|
|||
}
|
||||
|
||||
function update_ui() {
|
||||
self.analyticsChanges = {};
|
||||
|
||||
$(".tab-ports").addClass("supported");
|
||||
|
||||
const VCP_PORT_IDENTIFIER = 20;
|
||||
|
@ -261,19 +257,6 @@ ports.initialize = function (callback) {
|
|||
lastMspSelected = functionName;
|
||||
}
|
||||
}
|
||||
|
||||
if (column === 'telemetry') {
|
||||
const initialValue = functionName;
|
||||
selectElement.on('change', function () {
|
||||
const telemetryValue = $(this).val();
|
||||
|
||||
let newValue;
|
||||
if (telemetryValue !== initialValue) {
|
||||
newValue = $(this).find('option:selected').text();
|
||||
}
|
||||
self.analyticsChanges['Telemetry'] = newValue;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -319,14 +302,10 @@ ports.initialize = function (callback) {
|
|||
});
|
||||
|
||||
if (lastVtxControlSelected !== vtxControlSelected) {
|
||||
self.analyticsChanges['VtxControl'] = vtxControlSelected;
|
||||
|
||||
lastVtxControlSelected = vtxControlSelected;
|
||||
}
|
||||
|
||||
if (lastMspSelected !== mspControlSelected) {
|
||||
self.analyticsChanges['MspControl'] = mspControlSelected;
|
||||
|
||||
lastMspSelected = mspControlSelected;
|
||||
}
|
||||
|
||||
|
@ -355,9 +334,6 @@ ports.initialize = function (callback) {
|
|||
}
|
||||
|
||||
function on_save_handler() {
|
||||
analytics.sendSaveAndChangeEvents(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, self.analyticsChanges, 'ports');
|
||||
self.analyticsChanges = {};
|
||||
|
||||
// update configuration based on current ui state
|
||||
FC.SERIAL_CONFIG.ports = [];
|
||||
|
||||
|
|
|
@ -2,17 +2,10 @@ import { i18n } from '../localization';
|
|||
|
||||
const power = {
|
||||
supported: false,
|
||||
analyticsChanges: {},
|
||||
};
|
||||
|
||||
power.initialize = function (callback) {
|
||||
const self = this;
|
||||
|
||||
if (GUI.active_tab != 'power') {
|
||||
GUI.active_tab = 'power';
|
||||
// Disabled on merge into betaflight-configurator
|
||||
//googleAnalytics.sendAppView('Power');
|
||||
}
|
||||
GUI.active_tab = 'power';
|
||||
|
||||
if (GUI.calibrationManager) {
|
||||
GUI.calibrationManager.destroy();
|
||||
|
@ -111,14 +104,6 @@ power.initialize = function (callback) {
|
|||
$(`input[name="vbatresdivmultiplier-${index}"]`).val(voltageDataSource[index].vbatresdivmultiplier);
|
||||
}
|
||||
|
||||
$('input[name="vbatscale-0"]').change(function () {
|
||||
const value = parseInt($(this).val());
|
||||
|
||||
if (value !== voltageDataSource[0].vbatscale) {
|
||||
self.analyticsChanges['PowerVBatUpdated'] = value;
|
||||
}
|
||||
});
|
||||
|
||||
// amperage meters
|
||||
if (FC.BATTERY_CONFIG.currentMeterSource == 0) {
|
||||
$('.boxAmperageConfiguration').hide();
|
||||
|
@ -169,26 +154,6 @@ power.initialize = function (callback) {
|
|||
$(`input[name="amperageoffset-${index}"]`).val(currentDataSource[index].offset);
|
||||
}
|
||||
|
||||
$('input[name="amperagescale-0"]').change(function () {
|
||||
if (FC.BATTERY_CONFIG.currentMeterSource === 1) {
|
||||
let value = parseInt($(this).val());
|
||||
|
||||
if (value !== currentDataSource[0].scale) {
|
||||
self.analyticsChanges['PowerAmperageUpdated'] = value;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('input[name="amperagescale-1"]').change(function () {
|
||||
if (FC.BATTERY_CONFIG.currentMeterSource === 2) {
|
||||
let value = parseInt($(this).val());
|
||||
|
||||
if (value !== currentDataSource[1].scale) {
|
||||
self.analyticsChanges['PowerAmperageUpdated'] = value;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if(FC.BATTERY_CONFIG.voltageMeterSource == 1 || FC.BATTERY_CONFIG.currentMeterSource == 1 || FC.BATTERY_CONFIG.currentMeterSource == 2) {
|
||||
$('.calibration').show();
|
||||
} else {
|
||||
|
@ -432,14 +397,6 @@ power.initialize = function (callback) {
|
|||
$('output[name="amperagenewscale"').val(amperagenewscale);
|
||||
|
||||
$('a.applycalibration').click(function() {
|
||||
if (vbatscalechanged) {
|
||||
self.analyticsChanges['PowerVBatUpdated'] = 'Calibrated';
|
||||
}
|
||||
|
||||
if (amperagescalechanged) {
|
||||
self.analyticsChanges['PowerAmperageUpdated'] = 'Calibrated';
|
||||
}
|
||||
|
||||
calibrationconfirmed = true;
|
||||
GUI.calibrationManagerConfirmation.close();
|
||||
updateDisplay(FC.VOLTAGE_METER_CONFIGS, FC.CURRENT_METER_CONFIGS);
|
||||
|
@ -471,8 +428,6 @@ power.initialize = function (callback) {
|
|||
FC.BATTERY_CONFIG.vbatwarningcellvoltage = parseFloat($('input[name="warningcellvoltage"]').val());
|
||||
FC.BATTERY_CONFIG.capacity = parseInt($('input[name="capacity"]').val());
|
||||
|
||||
analytics.sendSaveAndChangeEvents(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, self.analyticsChanges, 'power');
|
||||
|
||||
save_power_config();
|
||||
});
|
||||
|
||||
|
@ -507,9 +462,6 @@ power.initialize = function (callback) {
|
|||
|
||||
function process_html() {
|
||||
initDisplay();
|
||||
|
||||
self.analyticsChanges = {};
|
||||
|
||||
// translate to user-selected language
|
||||
i18n.localizePage();
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ const MD5 = require('md5.js');
|
|||
|
||||
const receiver = {
|
||||
rateChartHeight: 117,
|
||||
analyticsChanges: {},
|
||||
needReboot: false,
|
||||
elrsPassphraseEnabled: false,
|
||||
};
|
||||
|
@ -76,8 +75,6 @@ receiver.initialize = function (callback) {
|
|||
MSP.send_message(MSPCodes.MSP_FEATURE_CONFIG, false, false, get_rc_data);
|
||||
|
||||
function process_html() {
|
||||
self.analyticsChanges = {};
|
||||
|
||||
const featuresElement = $('.tab-receiver .features');
|
||||
|
||||
FC.FEATURE_CONFIG.features.generateElements(featuresElement);
|
||||
|
@ -243,12 +240,9 @@ receiver.initialize = function (callback) {
|
|||
serialRxSelectElement.change(function () {
|
||||
const serialRxValue = parseInt($(this).val());
|
||||
|
||||
let newValue;
|
||||
if (serialRxValue !== FC.RX_CONFIG.serialrx_provider) {
|
||||
newValue = $(this).find('option:selected').text();
|
||||
updateSaveButton(true);
|
||||
}
|
||||
tab.analyticsChanges['SerialRx'] = newValue;
|
||||
|
||||
FC.RX_CONFIG.serialrx_provider = serialRxValue;
|
||||
});
|
||||
|
@ -308,12 +302,9 @@ receiver.initialize = function (callback) {
|
|||
spiRxElement.change(function () {
|
||||
const value = parseInt($(this).val());
|
||||
|
||||
let newValue = undefined;
|
||||
if (value !== FC.RX_CONFIG.rxSpiProtocol) {
|
||||
newValue = $(this).find('option:selected').text();
|
||||
updateSaveButton(true);
|
||||
}
|
||||
tab.analyticsChanges['SPIRXProtocol'] = newValue;
|
||||
|
||||
FC.RX_CONFIG.rxSpiProtocol = value;
|
||||
});
|
||||
|
@ -505,9 +496,6 @@ receiver.initialize = function (callback) {
|
|||
}
|
||||
}
|
||||
|
||||
analytics.sendSaveAndChangeEvents(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, tab.analyticsChanges, 'receiver');
|
||||
tab.analyticsChanges = {};
|
||||
|
||||
MSP.send_message(MSPCodes.MSP_SET_RX_MAP, mspHelper.crunch(MSPCodes.MSP_SET_RX_MAP), false, save_rssi_config);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,9 +7,7 @@ const setup = {
|
|||
setup.initialize = function (callback) {
|
||||
const self = this;
|
||||
|
||||
if (GUI.active_tab != 'setup') {
|
||||
GUI.active_tab = 'setup';
|
||||
}
|
||||
GUI.active_tab = 'setup';
|
||||
|
||||
function load_status() {
|
||||
MSP.send_message(MSPCodes.MSP_STATUS, false, false, load_mixer_config);
|
||||
|
|
|
@ -5,11 +5,7 @@ const setup_osd = {
|
|||
|
||||
setup_osd.initialize = function (callback) {
|
||||
|
||||
if (GUI.active_tab != 'setup_osd') {
|
||||
GUI.active_tab = 'setup_osd';
|
||||
// Disabled on merge into betaflight-configurator
|
||||
//googleAnalytics.sendAppView('Setup OSD');
|
||||
}
|
||||
GUI.active_tab = 'setup_osd';
|
||||
|
||||
function load_status() {
|
||||
MSP.send_message(MSPCodes.MSP_STATUS, false, false, load_html);
|
||||
|
|
|
@ -109,8 +109,6 @@ transponder.initialize = function(callback) {
|
|||
/////////////////////////////////////////////
|
||||
|
||||
GUI.active_tab = 'transponder';
|
||||
// Disabled on merge into betaflight-configurator
|
||||
//googleAnalytics.sendAppView('Transponder');
|
||||
|
||||
// transponder supported added in MSP API Version 1.16.0
|
||||
if (FC.CONFIG) {
|
||||
|
|
|
@ -9,7 +9,6 @@ const vtx = {
|
|||
MAX_BAND_CHANNELS_VALUES: 8,
|
||||
VTXTABLE_BAND_LIST: [],
|
||||
VTXTABLE_POWERLEVEL_LIST: [],
|
||||
analyticsChanges: {},
|
||||
updating: true,
|
||||
env: new djv(),
|
||||
get _DEVICE_STATUS_UPDATE_INTERVAL_NAME() {
|
||||
|
@ -54,9 +53,7 @@ vtx.initialize = function (callback) {
|
|||
GUI.active_tab = 'vtx';
|
||||
}
|
||||
|
||||
self.analyticsChanges = {};
|
||||
|
||||
this.supported = semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_42);
|
||||
self.supported = semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_42);
|
||||
|
||||
if (!this.supported) {
|
||||
load_html();
|
||||
|
@ -402,13 +399,6 @@ vtx.initialize = function (callback) {
|
|||
}
|
||||
|
||||
$("#vtx_table_channels").on('input', showHideBandChannels).trigger('input');
|
||||
$("#vtx_table").change(function() {
|
||||
let fromScratch = true;
|
||||
if (self.analyticsChanges['VtxTableLoadFromClipboard'] !== undefined || self.analyticsChanges['VtxTableLoadFromFile'] !== undefined) {
|
||||
fromScratch = false;
|
||||
}
|
||||
self.analyticsChanges['VtxTableEdit'] = fromScratch ? 'modificationOnly' : 'fromTemplate';
|
||||
});
|
||||
|
||||
/*** Helper functions */
|
||||
|
||||
|
@ -644,7 +634,6 @@ vtx.initialize = function (callback) {
|
|||
|
||||
// we get here at the end of the truncate method, change to the new end
|
||||
writer.onwriteend = function() {
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, 'VtxTableLuaSave', text.length);
|
||||
console.log('Write VTX table lua file end');
|
||||
GUI.log(i18n.getMessage('vtxSavedLuaFileOk'));
|
||||
};
|
||||
|
@ -695,7 +684,6 @@ vtx.initialize = function (callback) {
|
|||
|
||||
// we get here at the end of the truncate method, change to the new end
|
||||
writer.onwriteend = function() {
|
||||
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, 'VtxTableSave', text.length);
|
||||
console.log(vtxConfig);
|
||||
console.log('Write VTX file end');
|
||||
GUI.log(i18n.getMessage('vtxSavedFileOk'));
|
||||
|
@ -746,9 +734,6 @@ vtx.initialize = function (callback) {
|
|||
|
||||
TABS.vtx.vtxTableSavePending = true;
|
||||
|
||||
self.analyticsChanges['VtxTableLoadFromClipboard'] = undefined;
|
||||
self.analyticsChanges['VtxTableLoadFromFile'] = file.name;
|
||||
|
||||
console.log('Load VTX file end');
|
||||
GUI.log(i18n.getMessage('vtxLoadFileOk'));
|
||||
},
|
||||
|
@ -796,9 +781,6 @@ vtx.initialize = function (callback) {
|
|||
|
||||
TABS.vtx.vtxTableSavePending = true;
|
||||
|
||||
self.analyticsChanges['VtxTableLoadFromFile'] = undefined;
|
||||
self.analyticsChanges['VtxTableLoadFromClipboard'] = text.length;
|
||||
|
||||
console.log('Load VTX clipboard end');
|
||||
GUI.log(i18n.getMessage('vtxLoadClipboardOk'));
|
||||
},
|
||||
|
@ -832,8 +814,6 @@ vtx.initialize = function (callback) {
|
|||
// Start MSP saving
|
||||
save_vtx_config();
|
||||
|
||||
analytics.sendSaveAndChangeEvents(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, self.analyticsChanges, 'vtx');
|
||||
|
||||
function save_vtx_config() {
|
||||
MSP.send_message(MSPCodes.MSP_SET_VTX_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_VTX_CONFIG), false, save_vtx_powerlevels);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue