public ElevationProfile(List<PointLatLngAlt> locs, double homealt, GCSViews.FlightPlanner.altmode altmode)
{
InitializeComponent();
this.altmode = altmode;
planlocs = locs;
for (int a = 0; a < planlocs.Count; a++)
{
if (planlocs[a] == null || planlocs[a].Tag != null && planlocs[a].Tag.Contains("ROI"))
{
planlocs.RemoveAt(a);
a--;
}
}
if (planlocs.Count <= 1)
{
CustomMessageBox.Show("Please plan something first", Strings.ERROR);
return;
}
// get total distance
distance = 0;
PointLatLngAlt lastloc = null;
foreach (PointLatLngAlt loc in planlocs)
{
if (loc == null)
continue;
if (lastloc != null)
{
distance += (int) loc.GetDistance(lastloc);
}
lastloc = loc;
}
this.homealt = homealt/CurrentState.multiplierdist;
Form frm = Common.LoadingBox("Loading", "using alt data");
gelocs = getGEAltPath(planlocs);
srtmlocs = getSRTMAltPath(planlocs);
frm.Close();
MissionPlanner.Utilities.Tracking.AddPage(this.GetType().ToString(), this.Text);
}