Skip to content

Commit

Permalink
add nautical miles for unit
Browse files Browse the repository at this point in the history
  • Loading branch information
iltis42 committed Jan 3, 2024
1 parent 1900cce commit 5595720
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion main/SetupMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ void SetupMenu::options_menu_create_units( MenuEntry *top ){
SetupMenuSelect * dst = new SetupMenuSelect( PROGMEM"Distance", RST_NONE , 0, true, &dst_unit );
dst->addEntry( PROGMEM"KiloMeter (km)");
dst->addEntry( PROGMEM"KiloFeet (kft)");
dst->addEntry( PROGMEM"Miles (mi)");
dst->addEntry( PROGMEM"NauticalMiles (nm)");
top->addEntry( dst );
}

Expand Down
6 changes: 3 additions & 3 deletions main/Units.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class Units {
return( d );
else if( dst_unit.get() == DST_UNIT_FT ) // ft
return( d*3.28084 );
else if( dst_unit.get() == DST_UNIT_MILES ) // mi
return( d*0.621371 );
else if( dst_unit.get() == DST_UNIT_MILES ) // nautical miles, nm
return( d*0.539957 );
else
ESP_LOGE(FNAME,"Wrong unit for Distance");
return d;
Expand Down Expand Up @@ -240,7 +240,7 @@ class Units {
else if( u == DST_UNIT_FT ) // kilo-feet
return( "kft" );
else if( u == DST_UNIT_MILES ) // Miles mi
return( "mi" );
return( "nm" );
else
ESP_LOGE(FNAME,"Wrong unit for distance %d", u );
return "nan";
Expand Down

0 comments on commit 5595720

Please sign in to comment.