Skip to content

Commit

Permalink
FlighPlanner: When a WP changed to Takeoff zero out Lat,Lng (#3368)
Browse files Browse the repository at this point in the history
  • Loading branch information
EosBandi committed Jun 18, 2024
1 parent 3ae088f commit e49ec4c
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions GCSViews/FlightPlanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2502,6 +2502,14 @@ private void Commands_SelectionChangeCommitted(object sender, EventArgs e)
if (Commands.Rows[selectedrow].Cells[Alt.Index].Value != null &&
Commands.Rows[selectedrow].Cells[Alt.Index].Value.ToString() == "0")
Commands.Rows[selectedrow].Cells[Alt.Index].Value = TXT_DefaultAlt.Text;

//Zero out lat and lon since it is not used in the takeoff command
if (Commands.Rows[selectedrow].Cells[Lat.Index].Value != null)
Commands.Rows[selectedrow].Cells[Lat.Index].Value = "0";
if (Commands.Rows[selectedrow].Cells[Lon.Index].Value != null)
Commands.Rows[selectedrow].Cells[Lon.Index].Value = "0";


}

// default land to 0
Expand Down Expand Up @@ -3406,8 +3414,8 @@ public void FlightPlanner_Load(object sender, EventArgs e)

if (Settings.Instance["WMSTserver"] != null)
{
Task.Run(()=>{
try {
Task.Run(()=>{
try {
WMTSProvider.CustomWMTSURL = Settings.Instance["WMSTserver"];
WMTSProvider.LayerName = WMTSProvider.Layers[int.Parse(Settings.Instance["WMSTLayer"])];
this.BeginInvokeIfRequired(()=>{ MainMap.Core.ReloadMap(); });
Expand Down Expand Up @@ -5061,7 +5069,7 @@ private void processKML(Element Element, Document root = null)
}

return;
}
}
else if (Element is Folder)
{
foreach (var feat in ((Folder)Element).Features)
Expand Down Expand Up @@ -5143,10 +5151,10 @@ private void processKML(Element Element, Document root = null)
int color = ((Style)style).Line.Color.Value.Abgr;
// convert color from ABGR to ARGB
color = (int)((color & 0xFF00FF00) | ((color & 0x00FF0000) >> 16) | ((color & 0x000000FF) << 16));

// ABGR
return (Color.FromArgb(color), (int)((Style)style).Line.Width.Value);
}
}
}
}
return (Color.White, 2);
Expand Down

0 comments on commit e49ec4c

Please sign in to comment.