From c6a910131422e18934fa2d9c9130e6358f294c22 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Sun, 23 Jan 2022 14:18:03 +1000 Subject: [PATCH] fix: Companion simulator breakage from #1480 --- companion/src/firmwares/telem_data.h | 61 ++++++++++++++++++++++ companion/src/simulation/telemetrysimu.cpp | 1 + 2 files changed, 62 insertions(+) diff --git a/companion/src/firmwares/telem_data.h b/companion/src/firmwares/telem_data.h index 74a4600a2..b58f2251a 100644 --- a/companion/src/firmwares/telem_data.h +++ b/companion/src/firmwares/telem_data.h @@ -91,6 +91,67 @@ struct TelemetryScriptData { char filename[8+1]; }; +// from radio/src/dataconstants.h +#define TELEM_LABEL_LEN 4 +enum TelemetryUnit { + UNIT_RAW, + UNIT_VOLTS, + UNIT_AMPS, + UNIT_MILLIAMPS, + UNIT_KTS, + 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, + UNIT_WATTS, + UNIT_MILLIWATTS, + UNIT_DB, + UNIT_RPMS, + UNIT_G, + UNIT_DEGREE, + UNIT_RADIANS, + UNIT_MILLILITERS, + UNIT_FLOZ, + UNIT_MILLILITERS_PER_MINUTE, + UNIT_HERTZ, + UNIT_MS, + UNIT_US, + UNIT_KM, + UNIT_DBM, + UNIT_MAX = UNIT_DBM, + 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_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_DATETIME_YEAR, + UNIT_DATETIME_DAY_MONTH, + UNIT_DATETIME_HOUR_MIN, + UNIT_DATETIME_SEC +}; + enum TelemetryScreenEnum { TELEMETRY_SCREEN_NONE, TELEMETRY_SCREEN_NUMBERS, diff --git a/companion/src/simulation/telemetrysimu.cpp b/companion/src/simulation/telemetrysimu.cpp index ea95ab2e0..86be5b09d 100644 --- a/companion/src/simulation/telemetrysimu.cpp +++ b/companion/src/simulation/telemetrysimu.cpp @@ -22,6 +22,7 @@ #include "ui_telemetrysimu.h" #include "appdata.h" #include "simulatorinterface.h" +#include "telem_data.h" #include "radio/src/telemetry/frsky.h" #include