AP_OSD: add option to convert to miless at 5280ft vs 10000ft
This commit is contained in:
parent
1ccbe0d0df
commit
2939efe2c6
@ -82,7 +82,7 @@ const AP_Param::GroupInfo AP_OSD::var_info[] = {
|
||||
// @Param: _OPTIONS
|
||||
// @DisplayName: OSD Options
|
||||
// @Description: This sets options that change the display
|
||||
// @Bitmask: 0:UseDecimalPack, 1:InvertedWindPointer, 2:InvertedAHRoll
|
||||
// @Bitmask: 0:UseDecimalPack, 1:InvertedWindPointer, 2:InvertedAHRoll, 3:Convert feet to miles at 5280ft instead of 10000ft
|
||||
// @User: Standard
|
||||
AP_GROUPINFO("_OPTIONS", 8, AP_OSD, options, OPTION_DECIMAL_PACK),
|
||||
|
||||
|
@ -475,6 +475,7 @@ public:
|
||||
OPTION_DECIMAL_PACK = 1U<<0,
|
||||
OPTION_INVERTED_WIND = 1U<<1,
|
||||
OPTION_INVERTED_AH_ROLL = 1U<<2,
|
||||
OPTION_IMPERIAL_MILES = 1U<<3,
|
||||
};
|
||||
|
||||
enum {
|
||||
|
@ -1503,7 +1503,7 @@ void AP_OSD_Screen::draw_distance(uint8_t x, uint8_t y, float distance)
|
||||
char unit_icon = u_icon(DISTANCE);
|
||||
float distance_scaled = u_scale(DISTANCE, distance);
|
||||
const char *fmt = "%4.0f%c";
|
||||
if (distance_scaled > 9999.0f) {
|
||||
if (distance_scaled > 9999.0f || (osd->units == AP_OSD::UNITS_IMPERIAL && distance_scaled > 5280.0f && (osd->options & AP_OSD::OPTION_IMPERIAL_MILES))) {
|
||||
distance_scaled = u_scale(DISTANCE_LONG, distance);
|
||||
unit_icon= u_icon(DISTANCE_LONG);
|
||||
//try to pack as many useful info as possible
|
||||
|
Loading…
Reference in New Issue
Block a user