From f9030a07aebf03b1a0727c5fb08f3406227a8b21 Mon Sep 17 00:00:00 2001 From: Bob Long Date: Sun, 1 Oct 2023 11:47:47 -0400 Subject: [PATCH] FlightPlanner: fix homealt unit bugs - `processToScreen` redundantly converted units; the values in the datagrid cells should already be in display units - `savewaypoints` did not convert back from display units before saving --- GCSViews/FlightPlanner.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/GCSViews/FlightPlanner.cs b/GCSViews/FlightPlanner.cs index 121f8d6ad6..2e5bd12e78 100644 --- a/GCSViews/FlightPlanner.cs +++ b/GCSViews/FlightPlanner.cs @@ -1,4 +1,4 @@ -using DotSpatial.Data; +using DotSpatial.Data; using DotSpatial.Projections; using GeoUtility.GeoSystem; using GeoUtility.GeoSystem.Base; @@ -5300,8 +5300,7 @@ private void processToScreen(List cmds, bool append = false) cellhome = Commands.Rows[0].Cells[Lon.Index] as DataGridViewTextBoxCell; TXT_homelng.Text = (double.Parse(cellhome.Value.ToString())).ToString(); cellhome = Commands.Rows[0].Cells[Alt.Index] as DataGridViewTextBoxCell; - TXT_homealt.Text = - (double.Parse(cellhome.Value.ToString()) * CurrentState.multiplieralt).ToString(); + TXT_homealt.Text = double.Parse(cellhome.Value.ToString()).ToString("0.00"); } } } @@ -5739,7 +5738,7 @@ private void savewaypoints() "\t" + double.Parse(TXT_homelng.Text).ToString("0.0000000", new CultureInfo("en-US")) + "\t" + - double.Parse(TXT_homealt.Text).ToString("0.000000", new CultureInfo("en-US")) + + (double.Parse(TXT_homealt.Text) / CurrentState.multiplieralt).ToString("0.000000", new CultureInfo("en-US")) + "\t1"); } catch (Exception ex)