Align companion telemetry sensor units to radio (#7653)

* Align cpn sensor units to radio

* Add cpn conversion for sensor unit
This commit is contained in:
Neil Horne
2020-05-31 16:46:56 +02:00
committed by GitHub
parent c3f0e2ea88
commit ad83a78901
2 changed files with 24 additions and 3 deletions
@@ -1983,6 +1983,12 @@ class SensorField: public TransformedField {
sensor.unit++;
}
if (version < 219) {
if (sensor.unit > SensorData::UNIT_FLOZ) {
sensor.unit += 11;
}
}
qCDebug(eepromImport) << QString("imported %1").arg(internalField.getName());
}
+18 -3
View File
@@ -74,10 +74,13 @@ class SensorData {
UNIT_METERS_PER_SECOND,
UNIT_FEET_PER_SECOND,
UNIT_KMH,
UNIT_SPEED = UNIT_KMH,
UNIT_MPH,
UNIT_METERS,
UNIT_DIST = UNIT_METERS,
UNIT_FEET,
UNIT_CELSIUS,
UNIT_TEMPERATURE = UNIT_CELSIUS,
UNIT_FAHRENHEIT,
UNIT_PERCENT,
UNIT_MAH,
@@ -91,18 +94,30 @@ class SensorData {
UNIT_MILLILITERS,
UNIT_FLOZ,
UNIT_MILLILITERS_PER_MINUTE,
UNIT_MAX = UNIT_MILLILITERS_PER_MINUTE,
UNIT_SPARE1,
UNIT_SPARE2,
UNIT_SPARE3,
UNIT_SPARE4,
UNIT_SPARE5,
UNIT_SPARE6,
UNIT_SPARE7,
UNIT_SPARE8,
UNIT_SPARE9,
UNIT_SPARE10,
UNIT_HOURS,
UNIT_MINUTES,
UNIT_SECONDS,
// FrSky format used for these fields, could be another format in the future
UNIT_FIRST_VIRTUAL,
UNIT_FIRST_VIRTUAL,
UNIT_CELLS = UNIT_FIRST_VIRTUAL,
UNIT_DATETIME,
UNIT_GPS,
UNIT_BITFIELD,
UNIT_TEXT,
// Internal units (not stored in sensor unit)
UNIT_GPS_LONGITUDE,
UNIT_GPS_LATITUDE,
UNIT_GPS_LONGITUDE_EW,
UNIT_GPS_LATITUDE_NS,
UNIT_DATETIME_YEAR,
UNIT_DATETIME_DAY_MONTH,
UNIT_DATETIME_HOUR_MIN,