Merge pull request #7183 from TonyBlit/gps_flight_distance
Total Distance renamed to Flight Distance
This commit is contained in:
commit
586eef94e5
|
@ -87,7 +87,7 @@ OSD_Entry menuOsdActiveElemsEntries[] =
|
|||
{"GPS LON", OME_VISIBLE, NULL, &osdConfig_item_pos[OSD_GPS_LON], 0},
|
||||
{"HOME DIR", OME_VISIBLE, NULL, &osdConfig_item_pos[OSD_HOME_DIR], 0},
|
||||
{"HOME DIST", OME_VISIBLE, NULL, &osdConfig_item_pos[OSD_HOME_DIST], 0},
|
||||
{"TOTAL DIST", OME_VISIBLE, NULL, &osdConfig_item_pos[OSD_TOTAL_DIST], 0},
|
||||
{"FLIGHT DIST", OME_VISIBLE, NULL, &osdConfig_item_pos[OSD_FLIGHT_DIST], 0},
|
||||
#endif // GPS
|
||||
{"COMPASS BAR", OME_VISIBLE, NULL, &osdConfig_item_pos[OSD_COMPASS_BAR], 0},
|
||||
{"ALTITUDE", OME_VISIBLE, NULL, &osdConfig_item_pos[OSD_ALTITUDE], 0},
|
||||
|
|
|
@ -1057,7 +1057,7 @@ const clivalue_t valueTable[] = {
|
|||
{ "osd_gps_sats_pos", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 0, OSD_POSCFG_MAX }, PG_OSD_CONFIG, offsetof(osdConfig_t, item_pos[OSD_GPS_SATS]) },
|
||||
{ "osd_home_dir_pos", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 0, OSD_POSCFG_MAX }, PG_OSD_CONFIG, offsetof(osdConfig_t, item_pos[OSD_HOME_DIR]) },
|
||||
{ "osd_home_dist_pos", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 0, OSD_POSCFG_MAX }, PG_OSD_CONFIG, offsetof(osdConfig_t, item_pos[OSD_HOME_DIST]) },
|
||||
{ "osd_total_dist_pos", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 0, OSD_POSCFG_MAX }, PG_OSD_CONFIG, offsetof(osdConfig_t, item_pos[OSD_TOTAL_DIST]) },
|
||||
{ "osd_flight_dist_pos", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 0, OSD_POSCFG_MAX }, PG_OSD_CONFIG, offsetof(osdConfig_t, item_pos[OSD_FLIGHT_DIST]) },
|
||||
{ "osd_compass_bar_pos", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 0, OSD_POSCFG_MAX }, PG_OSD_CONFIG, offsetof(osdConfig_t, item_pos[OSD_COMPASS_BAR]) },
|
||||
{ "osd_altitude_pos", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 0, OSD_POSCFG_MAX }, PG_OSD_CONFIG, offsetof(osdConfig_t, item_pos[OSD_ALTITUDE]) },
|
||||
{ "osd_pid_roll_pos", VAR_UINT16 | MASTER_VALUE, .config.minmax = { 0, OSD_POSCFG_MAX }, PG_OSD_CONFIG, offsetof(osdConfig_t, item_pos[OSD_ROLL_PIDS]) },
|
||||
|
@ -1108,7 +1108,7 @@ const clivalue_t valueTable[] = {
|
|||
{ "osd_stat_max_esc_temp", VAR_UINT32 | MASTER_VALUE | MODE_BITSET, .config.bitpos = OSD_STAT_MAX_ESC_TEMP, PG_OSD_CONFIG, offsetof(osdConfig_t, enabled_stats)},
|
||||
{ "osd_stat_max_esc_rpm", VAR_UINT32 | MASTER_VALUE | MODE_BITSET, .config.bitpos = OSD_STAT_MAX_ESC_RPM, PG_OSD_CONFIG, offsetof(osdConfig_t, enabled_stats)},
|
||||
{ "osd_stat_min_link_quality", VAR_UINT32 | MASTER_VALUE | MODE_BITSET, .config.bitpos = OSD_STAT_MIN_LINK_QUALITY,PG_OSD_CONFIG, offsetof(osdConfig_t, enabled_stats)},
|
||||
{ "osd_stat_total_dist", VAR_UINT32 | MASTER_VALUE | MODE_BITSET, .config.bitpos = OSD_STAT_TOTAL_DISTANCE, PG_OSD_CONFIG, offsetof(osdConfig_t, enabled_stats)},
|
||||
{ "osd_stat_flight_dist", VAR_UINT32 | MASTER_VALUE | MODE_BITSET, .config.bitpos = OSD_STAT_FLIGHT_DISTANCE, PG_OSD_CONFIG, offsetof(osdConfig_t, enabled_stats)},
|
||||
#ifdef USE_OSD_PROFILES
|
||||
{ "osd_profile", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 1, OSD_PROFILE_COUNT }, PG_OSD_CONFIG, offsetof(osdConfig_t, osdProfileIndex) },
|
||||
#endif
|
||||
|
|
|
@ -643,7 +643,7 @@ static bool osdDrawSingleElement(uint8_t item)
|
|||
}
|
||||
break;
|
||||
|
||||
case OSD_TOTAL_DIST:
|
||||
case OSD_FLIGHT_DIST:
|
||||
if (STATE(GPS_FIX) && STATE(GPS_FIX_HOME)) {
|
||||
const int32_t distance = osdGetMetersToSelectedUnit(GPS_distanceFlownInCm / 100);
|
||||
tfp_sprintf(buff, "%d%c", distance, osdGetMetersToSelectedUnitSymbol());
|
||||
|
@ -1220,7 +1220,7 @@ static void osdDrawElements(void)
|
|||
osdDrawSingleElement(OSD_GPS_LON);
|
||||
osdDrawSingleElement(OSD_HOME_DIST);
|
||||
osdDrawSingleElement(OSD_HOME_DIR);
|
||||
osdDrawSingleElement(OSD_TOTAL_DIST);
|
||||
osdDrawSingleElement(OSD_FLIGHT_DIST);
|
||||
}
|
||||
#endif // GPS
|
||||
|
||||
|
@ -1704,10 +1704,10 @@ static void osdShowStats(uint16_t endBatteryVoltage)
|
|||
#endif
|
||||
|
||||
#ifdef USE_GPS
|
||||
if (osdStatGetState(OSD_STAT_TOTAL_DISTANCE) && featureIsEnabled(FEATURE_GPS)) {
|
||||
if (osdStatGetState(OSD_STAT_FLIGHT_DISTANCE) && featureIsEnabled(FEATURE_GPS)) {
|
||||
const uint32_t distanceFlown = GPS_distanceFlownInCm / 100;
|
||||
tfp_sprintf(buff, "%d%c", osdGetMetersToSelectedUnit(distanceFlown), osdGetMetersToSelectedUnitSymbol());
|
||||
osdDisplayStatisticLabel(top++, "TOTAL DISTANCE", buff);
|
||||
osdDisplayStatisticLabel(top++, "FLIGHT DISTANCE", buff);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ typedef enum {
|
|||
OSD_LOG_STATUS,
|
||||
OSD_FLIP_ARROW,
|
||||
OSD_LINK_QUALITY,
|
||||
OSD_TOTAL_DIST,
|
||||
OSD_FLIGHT_DIST,
|
||||
OSD_ITEM_COUNT // MUST BE LAST
|
||||
} osd_items_e;
|
||||
|
||||
|
@ -138,7 +138,7 @@ typedef enum {
|
|||
OSD_STAT_MAX_ESC_TEMP,
|
||||
OSD_STAT_MAX_ESC_RPM,
|
||||
OSD_STAT_MIN_LINK_QUALITY,
|
||||
OSD_STAT_TOTAL_DISTANCE,
|
||||
OSD_STAT_FLIGHT_DISTANCE,
|
||||
OSD_STAT_COUNT // MUST BE LAST
|
||||
} osd_stats_e;
|
||||
|
||||
|
|
|
@ -315,7 +315,7 @@ TEST(OsdTest, TestStatsImperial)
|
|||
osdStatSetState(OSD_STAT_TIMER_2, true);
|
||||
osdStatSetState(OSD_STAT_RTC_DATE_TIME, true);
|
||||
osdStatSetState(OSD_STAT_MAX_DISTANCE, true);
|
||||
osdStatSetState(OSD_STAT_TOTAL_DISTANCE, true);
|
||||
osdStatSetState(OSD_STAT_FLIGHT_DISTANCE, true);
|
||||
osdStatSetState(OSD_STAT_BLACKBOX_NUMBER, false);
|
||||
osdStatSetState(OSD_STAT_MAX_G_FORCE, false);
|
||||
osdStatSetState(OSD_STAT_MAX_ESC_TEMP, false);
|
||||
|
@ -398,7 +398,7 @@ TEST(OsdTest, TestStatsImperial)
|
|||
displayPortTestBufferSubstring(2, row++, "END BATTERY : 15.2%c", SYM_VOLT);
|
||||
displayPortTestBufferSubstring(2, row++, "MIN RSSI : 25%%");
|
||||
displayPortTestBufferSubstring(2, row++, "MAX ALTITUDE : 6.5%c", SYM_FT);
|
||||
displayPortTestBufferSubstring(2, row++, "TOTAL DISTANCE : 656%c", SYM_FT);
|
||||
displayPortTestBufferSubstring(2, row++, "FLIGHT DISTANCE : 656%c", SYM_FT);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -451,7 +451,7 @@ TEST(OsdTest, TestStatsMetric)
|
|||
displayPortTestBufferSubstring(2, row++, "END BATTERY : 15.2%c", SYM_VOLT);
|
||||
displayPortTestBufferSubstring(2, row++, "MIN RSSI : 25%%");
|
||||
displayPortTestBufferSubstring(2, row++, "MAX ALTITUDE : 2.0%c", SYM_M);
|
||||
displayPortTestBufferSubstring(2, row++, "TOTAL DISTANCE : 100%c", SYM_M);
|
||||
displayPortTestBufferSubstring(2, row++, "FLIGHT DISTANCE : 100%c", SYM_M);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue