Skip to content

Commit

Permalink
FlightPlanner: consistent "0.00" format for TXT_homealt
Browse files Browse the repository at this point in the history
Some places converted the text at full precision, and another place rounded to integer. This brings them all in line
  • Loading branch information
robertlong13 authored and meee1 committed Oct 2, 2023
1 parent f9030a0 commit 3d44e1a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions GCSViews/FlightPlanner.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using DotSpatial.Data;
using DotSpatial.Data;
using DotSpatial.Projections;
using GeoUtility.GeoSystem;
using GeoUtility.GeoSystem.Base;
Expand Down Expand Up @@ -741,7 +741,7 @@ public void callMeDrag(string pointno, double lat, double lng, int alt)
{
// auto update home alt
updateUndoBuffer(true);
TXT_homealt.Text = (srtm.getAltitude(lat, lng).alt * CurrentState.multiplieralt).ToString();
TXT_homealt.Text = (srtm.getAltitude(lat, lng).alt * CurrentState.multiplieralt).ToString("0.00");

TXT_homelat.Text = lat.ToString();
TXT_homelng.Text = lng.ToString();
Expand Down Expand Up @@ -4238,7 +4238,7 @@ public void label4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
if (MainV2.comPort.MAV.cs.lat != 0)
{
TXT_homealt.Text = (MainV2.comPort.MAV.cs.altasl).ToString("0");
TXT_homealt.Text = (MainV2.comPort.MAV.cs.altasl).ToString("0.00");
TXT_homelat.Text = MainV2.comPort.MAV.cs.lat.ToString();
TXT_homelng.Text = MainV2.comPort.MAV.cs.lng.ToString();

Expand Down Expand Up @@ -6245,7 +6245,7 @@ public void setHomeHereToolStripMenuItem_Click(object sender, EventArgs e)
{
TXT_homealt.Text =
(srtm.getAltitude(MouseDownStart.Lat, MouseDownStart.Lng).alt * CurrentState.multiplieralt)
.ToString("0");
.ToString("0.00");
TXT_homelat.Text = MouseDownStart.Lat.ToString();
TXT_homelng.Text = MouseDownStart.Lng.ToString();
}
Expand Down Expand Up @@ -6788,7 +6788,7 @@ private void updateHomeText()

TXT_homelng.Text = MainV2.comPort.MAV.cs.HomeLocation.Lng.ToString();

TXT_homealt.Text = MainV2.comPort.MAV.cs.HomeLocation.Alt.ToString();
TXT_homealt.Text = MainV2.comPort.MAV.cs.HomeLocation.Alt.ToString("0.00");

writeKML();
}
Expand All @@ -6799,7 +6799,7 @@ private void updateHomeText()

TXT_homelng.Text = MainV2.comPort.MAV.cs.PlannedHomeLocation.Lng.ToString();

TXT_homealt.Text = MainV2.comPort.MAV.cs.PlannedHomeLocation.Alt.ToString();
TXT_homealt.Text = MainV2.comPort.MAV.cs.PlannedHomeLocation.Alt.ToString("0.00");

writeKML();
}
Expand Down

0 comments on commit 3d44e1a

Please sign in to comment.