Skip to content

Commit

Permalink
FlightPlanner: fix homealt unit bugs
Browse files Browse the repository at this point in the history
- `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
  • Loading branch information
robertlong13 authored and meee1 committed Oct 2, 2023
1 parent 5611152 commit f9030a0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 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 @@ -5300,8 +5300,7 @@ private void processToScreen(List<Locationwp> 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");
}
}
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f9030a0

Please sign in to comment.