Skip to content

Commit

Permalink
chore: Remove obsolete language defines, single source for telemetry …
Browse files Browse the repository at this point in the history
…sensor names (#3119)

* - all telemetry sensor name definitions in one place (untranslated.h)

- all telemetry sensor name definitions follow the naming convention STR_SENSOR_<sensor>
- eliminated one redundant definition
- editorial updates to telemetry protocols code to reflect the naming convention changes
- re-introduced translations in da.h (STR_SENSOR_THROTTLE and STR_SENSOR_SPEED)
- re-introduced translation in it.h (STR_SENSOR_GPSDATETIME)
- re-introduced translation for fr.h ( STR_SENSOR_BATT)
- saved 160 Bytes of flash

* removed obsolete translation

saved 280 byte flash memory in total

* finally removed extern const char STR_MENUTEMPLATES[]; definition

adjusted da.h, fr.h, it.h local sensor name definitions to naming conventions STR_SENSOR_<senosr>

* corrected merge

removed obsolete #ifdef

* some more obsolete ones

* added TW and CN translation for TR_PERIOD and TR_INTERVAL

fixed problem in /radio/src/gui/colorlcd/fullscreen_dialog.cpp preventing builds for CZ, IT and FR languages
  • Loading branch information
mha1 authored Feb 10, 2023
1 parent be3f8d7 commit 2470ced
Show file tree
Hide file tree
Showing 24 changed files with 394 additions and 3,636 deletions.
4 changes: 2 additions & 2 deletions radio/src/telemetry/crossfire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ const CrossfireSensor crossfireSensors[] = {
{LINK_RX_ID, 0, STR_SENSOR_RX_RSSI_PERC, UNIT_PERCENT, 0},
{LINK_RX_ID, 1, STR_SENSOR_RX_RF_POWER, UNIT_DBM, 0},
{LINK_TX_ID, 0, STR_SENSOR_TX_RSSI_PERC, UNIT_PERCENT, 0},
{LINK_TX_ID, 1, STR_SENSOR_TX_RF_POWER, UNIT_DBM, 0},
{LINK_TX_ID, 1, STR_SENSOR_TX_POWER, UNIT_DBM, 0},
{LINK_TX_ID, 2, STR_SENSOR_TX_FPS, UNIT_HERTZ, 0},
{BATTERY_ID, 0, STR_SENSOR_BATT, UNIT_VOLTS, 1},
{BATTERY_ID, 1, STR_SENSOR_CURR, UNIT_AMPS, 1},
{BATTERY_ID, 2, STR_SENSOR_CAPACITY, UNIT_MAH, 0},
{BATTERY_ID, 3, STR_BATT_PERCENT, UNIT_PERCENT, 0},
{BATTERY_ID, 3, STR_SENSOR_BATT_PERCENT, UNIT_PERCENT, 0},
{GPS_ID, 0, STR_SENSOR_GPS, UNIT_GPS_LATITUDE, 0},
{GPS_ID, 0, STR_SENSOR_GPS, UNIT_GPS_LONGITUDE, 0},
{GPS_ID, 2, STR_SENSOR_GSPD, UNIT_KMH, 1},
Expand Down
8 changes: 4 additions & 4 deletions radio/src/telemetry/flysky_ibus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ const FlySkySensor flySkySensors[] = {
{AFHDS2A_ID_FLIGHT_MODE, STR_SENSOR_FLIGHT_MODE, UNIT_RAW, 0}, // 2 bytes index
{AFHDS2A_ID_PRES, STR_SENSOR_PRES, UNIT_RAW, 2}, // 4 bytes In fact Temperature + Pressure -> Altitude
{AFHDS2A_ID_PRES | 0x100, STR_SENSOR_TEMP2, UNIT_CELSIUS, 1}, // 2 bytes Temperature
{AFHDS3_FRM_TEMP, STR_TEMP2, UNIT_CELSIUS, 1}, // 2 bytes temperature
{AFHDS3_FRM_EXT_V, STR_TXV, UNIT_VOLTS, 2}, // 2 bytes voltage
{AFHDS3_FRM_TEMP, STR_SENSOR_TEMP2, UNIT_CELSIUS, 1}, // 2 bytes temperature
{AFHDS3_FRM_EXT_V, STR_SENSOR_TXV, UNIT_VOLTS, 2}, // 2 bytes voltage
{AFHDS2A_ID_ODO1, STR_SENSOR_ODO1, UNIT_METERS, 2}, // 2 bytes Odometer1 -- some magic with 330 needed
{AFHDS2A_ID_ODO2, STR_SENSOR_ODO2, UNIT_METERS, 2}, // 2 bytes Odometer2 -- some magic with 330 needed
{AFHDS2A_ID_SPE, STR_SENSOR_ASPD, UNIT_KMH, 2}, // 2 bytes Speed km/h -- some magic with 330 needed
Expand All @@ -138,8 +138,8 @@ const FlySkySensor flySkySensors[] = {
{AFHDS2A_ID_GPS_LON, STR_SENSOR_GPS, UNIT_RAW, 7}, // 4 bytes signed WGS84 in degrees * 1E7
{AFHDS2A_ID_GPS_ALT, STR_SENSOR_GPSALT, UNIT_METERS, 2}, // 4 bytes signed GPS alt m*100
{AFHDS2A_ID_ALT, STR_SENSOR_ALT, UNIT_METERS, 2}, // 4 bytes signed Alt m*100
{AFHDS2A_ID_RX_SIG_AFHDS3, STR_RX_QUALITY, UNIT_RAW, 0}, // RX error rate
{AFHDS2A_ID_RX_SNR_AFHDS3, STR_RX_SNR, UNIT_DB, 1}, // RX SNR
{AFHDS2A_ID_RX_SIG_AFHDS3, STR_SENSOR_RX_QUALITY, UNIT_RAW, 0}, // RX error rate
{AFHDS2A_ID_RX_SNR_AFHDS3, STR_SENSOR_RX_SNR, UNIT_DB, 1}, // RX SNR
{AFHDS2A_ID_RX_SNR, STR_SENSOR_RX_SNR, UNIT_DB, 0}, // RX SNR
{AFHDS2A_ID_RX_NOISE, STR_SENSOR_RX_NOISE, UNIT_DB, 0}, // RX Noise
{AFHDS2A_ID_RX_RSSI, STR_SENSOR_RSSI, UNIT_DB, 0}, // RX RSSI (0xfc)
Expand Down
28 changes: 14 additions & 14 deletions radio/src/telemetry/frsky_sport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct FrSkySportSensor {
};

const FrSkySportSensor sportSensors[] = {
{ VALID_FRAME_RATE_ID, VALID_FRAME_RATE_ID, 0, STR_VFR, UNIT_PERCENT, 0 },
{ VALID_FRAME_RATE_ID, VALID_FRAME_RATE_ID, 0, STR_SENSOR_VFR, UNIT_PERCENT, 0 },
{ RSSI_ID, RSSI_ID, 0, STR_SENSOR_RSSI, UNIT_DB, 0 },
#if defined(MULTIMODULE)
{ TX_RSSI_ID, TX_RSSI_ID, 0, STR_SENSOR_TX_RSSI , UNIT_DB , 0 },
Expand Down Expand Up @@ -86,19 +86,19 @@ const FrSkySportSensor sportSensors[] = {
{ GASSUIT_AVG_FLOW_FIRST_ID, GASSUIT_AVG_FLOW_LAST_ID, 0, STR_SENSOR_GASSUIT_AVG_FLOW, UNIT_MILLILITERS_PER_MINUTE, 0 },
{ SBEC_POWER_FIRST_ID, SBEC_POWER_LAST_ID, 0, STR_SENSOR_SBEC_VOLTAGE, UNIT_VOLTS, 2 },
{ SBEC_POWER_FIRST_ID, SBEC_POWER_LAST_ID, 1, STR_SENSOR_SBEC_CURRENT, UNIT_AMPS, 2 },
{ RB3040_OUTPUT_FIRST_ID, RB3040_OUTPUT_LAST_ID, 0, STR_RB3040_EXTRA_STATE, UNIT_TEXT, 0 },
{ RB3040_CH1_2_FIRST_ID, RB3040_CH1_2_LAST_ID, 0, STR_RB3040_CHANNEL1, UNIT_AMPS, 2 },
{ RB3040_CH1_2_FIRST_ID, RB3040_CH1_2_LAST_ID, 1, STR_RB3040_CHANNEL2, UNIT_AMPS, 2 },
{ RB3040_CH3_4_FIRST_ID, RB3040_CH3_4_LAST_ID, 0, STR_RB3040_CHANNEL3, UNIT_AMPS, 2 },
{ RB3040_CH3_4_FIRST_ID, RB3040_CH3_4_LAST_ID, 1, STR_RB3040_CHANNEL4, UNIT_AMPS, 2 },
{ RB3040_CH5_6_FIRST_ID, RB3040_CH5_6_LAST_ID, 0, STR_RB3040_CHANNEL5, UNIT_AMPS, 2 },
{ RB3040_CH5_6_FIRST_ID, RB3040_CH5_6_LAST_ID, 1, STR_RB3040_CHANNEL6, UNIT_AMPS, 2 },
{ RB3040_CH7_8_FIRST_ID, RB3040_CH7_8_LAST_ID, 0, STR_RB3040_CHANNEL7, UNIT_AMPS, 2 },
{ RB3040_CH7_8_FIRST_ID, RB3040_CH7_8_LAST_ID, 1, STR_RB3040_CHANNEL8, UNIT_AMPS, 2 },
{ SERVO_FIRST_ID, SERVO_LAST_ID, 0, STR_SERVO_CURRENT, UNIT_AMPS, 1 },
{ SERVO_FIRST_ID, SERVO_LAST_ID, 1, STR_SERVO_VOLTAGE, UNIT_VOLTS, 1 },
{ SERVO_FIRST_ID, SERVO_LAST_ID, 2, STR_SERVO_TEMPERATURE, UNIT_CELSIUS, 0 },
{ SERVO_FIRST_ID, SERVO_LAST_ID, 3, STR_SERVO_STATUS, UNIT_TEXT, 0 },
{ RB3040_OUTPUT_FIRST_ID, RB3040_OUTPUT_LAST_ID, 0, STR_SENSOR_RB3040_EXTRA_STATE, UNIT_TEXT, 0 },
{ RB3040_CH1_2_FIRST_ID, RB3040_CH1_2_LAST_ID, 0, STR_SENSOR_RB3040_CHANNEL1, UNIT_AMPS, 2 },
{ RB3040_CH1_2_FIRST_ID, RB3040_CH1_2_LAST_ID, 1, STR_SENSOR_RB3040_CHANNEL2, UNIT_AMPS, 2 },
{ RB3040_CH3_4_FIRST_ID, RB3040_CH3_4_LAST_ID, 0, STR_SENSOR_RB3040_CHANNEL3, UNIT_AMPS, 2 },
{ RB3040_CH3_4_FIRST_ID, RB3040_CH3_4_LAST_ID, 1, STR_SENSOR_RB3040_CHANNEL4, UNIT_AMPS, 2 },
{ RB3040_CH5_6_FIRST_ID, RB3040_CH5_6_LAST_ID, 0, STR_SENSOR_RB3040_CHANNEL5, UNIT_AMPS, 2 },
{ RB3040_CH5_6_FIRST_ID, RB3040_CH5_6_LAST_ID, 1, STR_SENSOR_RB3040_CHANNEL6, UNIT_AMPS, 2 },
{ RB3040_CH7_8_FIRST_ID, RB3040_CH7_8_LAST_ID, 0, STR_SENSOR_RB3040_CHANNEL7, UNIT_AMPS, 2 },
{ RB3040_CH7_8_FIRST_ID, RB3040_CH7_8_LAST_ID, 1, STR_SENSOR_RB3040_CHANNEL8, UNIT_AMPS, 2 },
{ SERVO_FIRST_ID, SERVO_LAST_ID, 0, STR_SENSOR_SERVO_CURRENT, UNIT_AMPS, 1 },
{ SERVO_FIRST_ID, SERVO_LAST_ID, 1, STR_SENSOR_SERVO_VOLTAGE, UNIT_VOLTS, 1 },
{ SERVO_FIRST_ID, SERVO_LAST_ID, 2, STR_SENSOR_SERVO_TEMPERATURE, UNIT_CELSIUS, 0 },
{ SERVO_FIRST_ID, SERVO_LAST_ID, 3, STR_SENSOR_SERVO_STATUS, UNIT_TEXT, 0 },
{ 0, 0, 0, nullptr, UNIT_RAW, 0 } // sentinel
};

Expand Down
48 changes: 24 additions & 24 deletions radio/src/telemetry/ghost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,30 +63,30 @@ enum
};

const GhostSensor ghostSensors[] = {
{GHOST_ID_RX_RSSI, STR_RSSI, UNIT_DB, 0},
{GHOST_ID_RX_LQ, STR_RX_QUALITY, UNIT_PERCENT, 0},
{GHOST_ID_RX_SNR, STR_RX_SNR, UNIT_DB, 0},

{GHOST_ID_FRAME_RATE, STR_FRAME_RATE, UNIT_RAW, 0},
{GHOST_ID_TX_POWER, STR_TX_POWER, UNIT_MILLIWATTS, 0},
{GHOST_ID_RF_MODE, STR_RF_MODE, UNIT_TEXT, 0},
{GHOST_ID_TOTAL_LATENCY, STR_TOTAL_LATENCY, UNIT_RAW, 0},

{GHOST_ID_VTX_FREQ, STR_VTX_FREQ, UNIT_RAW, 0},
{GHOST_ID_VTX_POWER, STR_VTX_PWR, UNIT_RAW, 0},
{GHOST_ID_VTX_CHAN, STR_VTX_CHAN, UNIT_RAW, 0},
{GHOST_ID_VTX_BAND, STR_VTX_BAND, UNIT_TEXT, 0},

{GHOST_ID_PACK_VOLTS, STR_BATT, UNIT_VOLTS, 2},
{GHOST_ID_PACK_AMPS, STR_CURR, UNIT_AMPS, 2},
{GHOST_ID_PACK_MAH, STR_CAPACITY, UNIT_MAH, 0},

{GHOST_ID_GPS_LAT, STR_GPS, UNIT_GPS_LATITUDE, 0},
{GHOST_ID_GPS_LONG, STR_GPS, UNIT_GPS_LONGITUDE, 0},
{GHOST_ID_GPS_GSPD, STR_GSPD, UNIT_KMH, 1},
{GHOST_ID_GPS_HDG, STR_HDG, UNIT_DEGREE, 3},
{GHOST_ID_GPS_ALT, STR_ALT, UNIT_METERS, 0},
{GHOST_ID_GPS_SATS, STR_SATELLITES, UNIT_RAW, 0},
{GHOST_ID_RX_RSSI, STR_SENSOR_RSSI, UNIT_DB, 0},
{GHOST_ID_RX_LQ, STR_SENSOR_RX_QUALITY, UNIT_PERCENT, 0},
{GHOST_ID_RX_SNR, STR_SENSOR_RX_SNR, UNIT_DB, 0},

{GHOST_ID_FRAME_RATE, STR_SENSOR_FRAME_RATE, UNIT_RAW, 0},
{GHOST_ID_TX_POWER, STR_SENSOR_TX_POWER, UNIT_MILLIWATTS, 0},
{GHOST_ID_RF_MODE, STR_SENSOR_RF_MODE, UNIT_TEXT, 0},
{GHOST_ID_TOTAL_LATENCY, STR_SENSOR_TOTAL_LATENCY, UNIT_RAW, 0},

{GHOST_ID_VTX_FREQ, STR_SENSOR_VTX_FREQ, UNIT_RAW, 0},
{GHOST_ID_VTX_POWER, STR_SENSOR_VTX_PWR, UNIT_RAW, 0},
{GHOST_ID_VTX_CHAN, STR_SENSOR_VTX_CHAN, UNIT_RAW, 0},
{GHOST_ID_VTX_BAND, STR_SENSOR_VTX_BAND, UNIT_TEXT, 0},

{GHOST_ID_PACK_VOLTS, STR_SENSOR_BATT, UNIT_VOLTS, 2},
{GHOST_ID_PACK_AMPS, STR_SENSOR_CURR, UNIT_AMPS, 2},
{GHOST_ID_PACK_MAH, STR_SENSOR_CAPACITY, UNIT_MAH, 0},

{GHOST_ID_GPS_LAT, STR_GPS, UNIT_GPS_LATITUDE, 0},
{GHOST_ID_GPS_LONG, STR_GPS, UNIT_GPS_LONGITUDE, 0},
{GHOST_ID_GPS_GSPD, STR_SENSOR_GSPD, UNIT_KMH, 1},
{GHOST_ID_GPS_HDG, STR_SENSOR_HDG, UNIT_DEGREE, 3},
{GHOST_ID_GPS_ALT, STR_SENSOR_GPSALT, UNIT_METERS, 0},
{GHOST_ID_GPS_SATS, STR_SENSOR_SATELLITES, UNIT_RAW, 0},

{0x00, NULL, UNIT_RAW, 0},
};
Expand Down
Loading

0 comments on commit 2470ced

Please sign in to comment.