1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-23 16:25:19 +03:00

Cleanup Sensor setup

This commit is contained in:
Pawel Spychalski (DzikuVx) 2021-08-13 10:49:30 +02:00
parent 1d5b7808d5
commit e52aa154b0
3 changed files with 12 additions and 61 deletions

View file

@ -863,9 +863,6 @@ var FC = {
getAccelerometerNames: function () {
return [ "NONE", "AUTO", "ADXL345", "MPU6050", "MMA845x", "BMA280", "LSM303DLHC", "MPU6000", "MPU6500", "MPU9250", "BMI160", "ICM20689", "FAKE"];
},
getMagnetometerNames: function () {
return ["NONE", "AUTO", "HMC5883", "AK8975", "GPSMAG", "MAG3110", "AK8963", "IST8310", "QMC5883", "MPU9250", "IST8308", "LIS3MDL", "MSP", "FAKE"];
},
getBarometerNames: function () {
if (semver.gte(CONFIG.flightControllerVersion, "2.6.0")) {
return ["NONE", "AUTO", "BMP085", "MS5611", "BMP280", "MS5607", "LPS25H", "SPL06", "BMP388", "DPS310", "MSP", "FAKE"];

View file

@ -14,39 +14,39 @@
<div class="spacer_box">
<div class="select">
<select id="sensor-acc"></select>
<select id="sensor-acc" data-setting="acc_hardware"></select>
<label for="sensor-acc"> <span data-i18n="sensorAccelerometer"></span></label>
</div>
<div class="select">
<select id="sensor-mag"></select>
<select id="sensor-mag" data-setting="mag_hardware" />
<label for="sensor-mag"> <span data-i18n="sensorMagnetometer"></span></label>
</div>
<div class="select">
<select id="sensor-baro"></select>
<select id="sensor-baro" data-setting="baro_hardware"></select>
<label for="sensor-baro"> <span data-i18n="sensorBarometer"></span></label>
</div>
<div class="select">
<select id="sensor-pitot"></select>
<select id="sensor-pitot" data-setting="pitot_hardware"></select>
<label for="sensor-pitot"> <span data-i18n="sensorPitot"></span></label>
</div>
<div class="select">
<select id="sensor-rangefinder"></select>
<select id="sensor-rangefinder" data-setting="rangefinder_hardware"></select>
<label for="sensor-rangefinder"> <span data-i18n="sensorRangefinder"></span></label>
</div>
<div class="select">
<select id="sensor-opflow"></select>
<select id="sensor-opflow" data-setting="opflow_hardware"></select>
<label for="sensor-opflow"> <span data-i18n="sensorOpflow"></span></label>
</div>
<div id="i2c_speed-info" class="info-box"></div>
<div class="select">
<select id="i2c_speed" data-setting="i2c_speed" />
<label for="looptime">
<label for="i2c_speed">
<span data-i18n="configurationI2cSpeed"></span>
</label>
<div class="helpicon cf_tip" data-i18n_title="configurationI2cSpeedHelp"></div>

View file

@ -1,4 +1,4 @@
/*global chrome,GUI,FC_CONFIG,$,mspHelper,googleAnalytics,ADVANCED_CONFIG*/
/*global chrome,GUI,FC_CONFIG,$,mspHelper,googleAnalytics,ADVANCED_CONFIG,VTX_CONFIG,CONFIG,MSPChainerClass*/
'use strict';
TABS.configuration = {};
@ -37,7 +37,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
mspHelper.loadSensorAlignment,
mspHelper.loadAdvancedConfig,
mspHelper.loadINAVPidConfig,
mspHelper.loadSensorConfig,
mspHelper.loadVTXConfig,
mspHelper.loadMixerConfig,
loadCraftName,
@ -59,7 +58,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
mspHelper.saveLooptimeConfig,
mspHelper.saveAdvancedConfig,
mspHelper.saveINAVPidConfig,
mspHelper.saveSensorConfig,
mspHelper.saveVTXConfig,
saveCraftName,
mspHelper.saveMiscV2,
@ -314,50 +312,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
$i2cSpeed.change();
var $sensorAcc = $('#sensor-acc'),
$sensorMag = $('#sensor-mag'),
$sensorBaro = $('#sensor-baro'),
$sensorPitot = $('#sensor-pitot'),
$sensorRangefinder = $('#sensor-rangefinder'),
$sensorOpflow = $('#sensor-opflow');
GUI.fillSelect($sensorAcc, FC.getAccelerometerNames());
$sensorAcc.val(SENSOR_CONFIG.accelerometer);
$sensorAcc.change(function () {
SENSOR_CONFIG.accelerometer = $sensorAcc.val();
});
GUI.fillSelect($sensorMag, FC.getMagnetometerNames());
$sensorMag.val(SENSOR_CONFIG.magnetometer);
$sensorMag.change(function () {
SENSOR_CONFIG.magnetometer = $sensorMag.val();
});
GUI.fillSelect($sensorBaro, FC.getBarometerNames());
$sensorBaro.val(SENSOR_CONFIG.barometer);
$sensorBaro.change(function () {
SENSOR_CONFIG.barometer = $sensorBaro.val();
});
GUI.fillSelect($sensorPitot, FC.getPitotNames());
$sensorPitot.val(SENSOR_CONFIG.pitot);
$sensorPitot.change(function () {
SENSOR_CONFIG.pitot = $sensorPitot.val();
});
GUI.fillSelect($sensorRangefinder, FC.getRangefinderNames());
$sensorRangefinder.val(SENSOR_CONFIG.rangefinder);
$sensorRangefinder.change(function () {
SENSOR_CONFIG.rangefinder = $sensorRangefinder.val();
});
GUI.fillSelect($sensorOpflow, FC.getOpticalFlowNames());
$sensorOpflow.val(SENSOR_CONFIG.opflow);
$sensorOpflow.change(function () {
SENSOR_CONFIG.opflow = $sensorOpflow.val();
});
$('#3ddeadbandlow').val(REVERSIBLE_MOTORS.deadband_low);
$('#3ddeadbandhigh').val(REVERSIBLE_MOTORS.deadband_high);
$('#3dneutral').val(REVERSIBLE_MOTORS.neutral);
@ -407,10 +361,10 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
googleAnalytics.sendEvent('Setting', 'Looptime', FC_CONFIG.loopTime);
googleAnalytics.sendEvent('Setting', 'I2CSpeed', $('#i2c_speed').children("option:selected").text());
googleAnalytics.sendEvent('Board', 'Accelerometer', FC.getAccelerometerNames()[SENSOR_CONFIG.accelerometer]);
googleAnalytics.sendEvent('Board', 'Magnetometer', FC.getMagnetometerNames()[SENSOR_CONFIG.magnetometer]);
googleAnalytics.sendEvent('Board', 'Barometer', FC.getBarometerNames()[SENSOR_CONFIG.barometer]);
googleAnalytics.sendEvent('Board', 'Pitot', FC.getPitotNames()[SENSOR_CONFIG.pitot]);
googleAnalytics.sendEvent('Board', 'Accelerometer', $('#sensor-acc').children("option:selected").text());
googleAnalytics.sendEvent('Board', 'Magnetometer', $('#sensor-mag').children("option:selected").text());
googleAnalytics.sendEvent('Board', 'Barometer', $('#sensor-baro').children("option:selected").text());
googleAnalytics.sendEvent('Board', 'Pitot', $('#sensor-pitot').children("option:selected").text());
for (var i = 0; i < features.length; i++) {
var featureName = features[i].name;