forked from ArduPilot/MissionPlanner
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
809 additions
and
759 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -425,7 +425,6 @@ public static bool inverse(float[] x, float[] y, ushort dim) | |
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
using System; | ||
using System.Drawing; | ||
using GMap.NET; | ||
using GMap.NET.WindowsForms; | ||
|
||
namespace MissionPlanner.Maps | ||
{ | ||
[Serializable] | ||
public class GMapMarkerADSBPlane : GMapMarker | ||
{ | ||
private static readonly Bitmap icong = new Bitmap(global::MissionPlanner.Properties.Resources.FW_icons_2013_logos_01, new Size(40, 40)); | ||
private static readonly Bitmap iconr = new Bitmap(global::MissionPlanner.Properties.Resources.FW_icons_2013_logos_011, new Size(40, 40)); | ||
private static readonly Bitmap icono = new Bitmap(global::MissionPlanner.Properties.Resources.FW_icons_2013_logos_012, new Size(40, 40)); | ||
|
||
public float heading = 0; | ||
public AlertLevelOptions AlertLevel = AlertLevelOptions.Green; | ||
|
||
public enum AlertLevelOptions | ||
{ | ||
Green, | ||
Orange, | ||
Red | ||
} | ||
|
||
public GMapMarkerADSBPlane(PointLatLng p, float heading, AlertLevelOptions alert = AlertLevelOptions.Green) | ||
: base(p) | ||
{ | ||
this.AlertLevel = alert; | ||
this.heading = heading; | ||
Size = icong.Size; | ||
} | ||
|
||
public override void OnRender(Graphics g) | ||
{ | ||
var temp = g.Transform; | ||
g.TranslateTransform(LocalPosition.X, LocalPosition.Y); | ||
|
||
g.RotateTransform(-Overlay.Control.Bearing); | ||
|
||
try | ||
{ | ||
g.RotateTransform(heading); | ||
} | ||
catch | ||
{ | ||
} | ||
|
||
switch (AlertLevel) | ||
{ | ||
case AlertLevelOptions.Green: | ||
g.DrawImageUnscaled(icong, icong.Width/-2, icong.Height/-2); | ||
break; | ||
case AlertLevelOptions.Orange: | ||
g.DrawImageUnscaled(icono, icono.Width/-2, icono.Height/-2); | ||
break; | ||
case AlertLevelOptions.Red: | ||
g.DrawImageUnscaled(iconr, iconr.Width/-2, iconr.Height/-2); | ||
break; | ||
} | ||
|
||
g.Transform = temp; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System; | ||
using System.Drawing; | ||
using GMap.NET; | ||
using GMap.NET.WindowsForms; | ||
using MissionPlanner.Utilities; | ||
|
||
namespace MissionPlanner.Maps | ||
{ | ||
[Serializable] | ||
public class GMapMarkerAntennaTracker : GMapMarker | ||
{ | ||
private readonly Bitmap icon = global::MissionPlanner.Properties.Resources.Antenna_Tracker_01; | ||
|
||
float heading = 0; | ||
private float target = 0; | ||
|
||
public GMapMarkerAntennaTracker(PointLatLng p, float heading, float target) | ||
: base(p) | ||
{ | ||
Size = icon.Size; | ||
this.heading = heading; | ||
this.target = target; | ||
} | ||
|
||
public override void OnRender(Graphics g) | ||
{ | ||
var temp = g.Transform; | ||
g.TranslateTransform(LocalPosition.X, LocalPosition.Y); | ||
|
||
int length = 500; | ||
|
||
try | ||
{ | ||
// heading | ||
g.DrawLine(new Pen(Color.Red, 2), 0.0f, 0.0f, (float) Math.Cos((heading - 90)*MathHelper.deg2rad)*length, | ||
(float) Math.Sin((heading - 90)*MathHelper.deg2rad)*length); | ||
|
||
// target | ||
g.DrawLine(new Pen(Color.Orange, 2), 0.0f, 0.0f, (float) Math.Cos((target - 90)*MathHelper.deg2rad)*length, | ||
(float) Math.Sin((target - 90)*MathHelper.deg2rad)*length); | ||
} | ||
catch | ||
{ | ||
} | ||
|
||
g.DrawImage(icon, -20, -20, 40, 40); | ||
|
||
g.Transform = temp; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using System; | ||
using System.Drawing; | ||
using GMap.NET; | ||
using GMap.NET.WindowsForms; | ||
using MissionPlanner.Utilities; | ||
|
||
namespace MissionPlanner.Maps | ||
{ | ||
[Serializable] | ||
public class GMapMarkerBoat : GMapMarker | ||
{ | ||
static readonly System.Drawing.Size SizeSt = | ||
new System.Drawing.Size(global::MissionPlanner.Properties.Resources.boat.Width, | ||
global::MissionPlanner.Properties.Resources.boat.Height); | ||
|
||
float heading = 0; | ||
float cog = -1; | ||
float target = -1; | ||
float nav_bearing = -1; | ||
|
||
public GMapMarkerBoat(PointLatLng p, float heading, float cog, float nav_bearing, float target) | ||
: base(p) | ||
{ | ||
this.heading = heading; | ||
this.cog = cog; | ||
this.target = target; | ||
this.nav_bearing = nav_bearing; | ||
Size = SizeSt; | ||
} | ||
|
||
public override void OnRender(Graphics g) | ||
{ | ||
var temp = g.Transform; | ||
g.TranslateTransform(LocalPosition.X, LocalPosition.Y); | ||
|
||
g.RotateTransform(-Overlay.Control.Bearing); | ||
|
||
int length = 500; | ||
// anti NaN | ||
try | ||
{ | ||
g.DrawLine(new Pen(Color.Red, 2), 0.0f, 0.0f, (float)Math.Cos((heading - 90) * MathHelper.deg2rad) * length, | ||
(float)Math.Sin((heading - 90) * MathHelper.deg2rad) * length); | ||
} | ||
catch | ||
{ | ||
} | ||
g.DrawLine(new Pen(Color.Green, 2), 0.0f, 0.0f, (float)Math.Cos((nav_bearing - 90) * MathHelper.deg2rad) * length, | ||
(float)Math.Sin((nav_bearing - 90) * MathHelper.deg2rad) * length); | ||
g.DrawLine(new Pen(Color.Black, 2), 0.0f, 0.0f, (float)Math.Cos((cog - 90) * MathHelper.deg2rad) * length, | ||
(float)Math.Sin((cog - 90) * MathHelper.deg2rad) * length); | ||
g.DrawLine(new Pen(Color.Orange, 2), 0.0f, 0.0f, (float)Math.Cos((target - 90) * MathHelper.deg2rad) * length, | ||
(float)Math.Sin((target - 90) * MathHelper.deg2rad) * length); | ||
// anti NaN | ||
|
||
try | ||
{ | ||
g.RotateTransform(heading); | ||
} | ||
catch | ||
{ | ||
} | ||
g.DrawImageUnscaled(global::MissionPlanner.Properties.Resources.boat, | ||
global::MissionPlanner.Properties.Resources.boat.Width / -2, | ||
global::MissionPlanner.Properties.Resources.boat.Height / -2); | ||
|
||
g.Transform = temp; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
using System; | ||
using System.Drawing; | ||
using GMap.NET; | ||
using GMap.NET.WindowsForms; | ||
using MissionPlanner.Utilities; | ||
|
||
namespace MissionPlanner.Maps | ||
{ | ||
[Serializable] | ||
public class GMapMarkerHeli : GMapMarker | ||
{ | ||
private readonly Bitmap icon = global::MissionPlanner.Properties.Resources.heli; | ||
|
||
float heading = 0; | ||
float cog = -1; | ||
float target = -1; | ||
|
||
public GMapMarkerHeli(PointLatLng p, float heading, float cog, float target) | ||
: base(p) | ||
{ | ||
this.heading = heading; | ||
this.cog = cog; | ||
this.target = target; | ||
Size = icon.Size; | ||
} | ||
|
||
public override void OnRender(Graphics g) | ||
{ | ||
var temp = g.Transform; | ||
g.TranslateTransform(LocalPosition.X, LocalPosition.Y); | ||
|
||
int length = 500; | ||
// anti NaN | ||
try | ||
{ | ||
g.DrawLine(new Pen(Color.Red, 2), 0.0f, 0.0f, (float) Math.Cos((heading - 90)*MathHelper.deg2rad)*length, | ||
(float) Math.Sin((heading - 90)*MathHelper.deg2rad)*length); | ||
} | ||
catch | ||
{ | ||
} | ||
//g.DrawLine(new Pen(Color.Green, 2), 0.0f, 0.0f, (float)Math.Cos((nav_bearing - 90) * MathHelper.deg2rad) * length, (float)Math.Sin((nav_bearing - 90) * MathHelper.deg2rad) * length); | ||
g.DrawLine(new Pen(Color.Black, 2), 0.0f, 0.0f, (float) Math.Cos((cog - 90)*MathHelper.deg2rad)*length, | ||
(float) Math.Sin((cog - 90)*MathHelper.deg2rad)*length); | ||
g.DrawLine(new Pen(Color.Orange, 2), 0.0f, 0.0f, (float) Math.Cos((target - 90)*MathHelper.deg2rad)*length, | ||
(float) Math.Sin((target - 90)*MathHelper.deg2rad)*length); | ||
// anti NaN | ||
try | ||
{ | ||
g.RotateTransform(heading); | ||
} | ||
catch | ||
{ | ||
} | ||
g.DrawImageUnscaled(icon, icon.Width/-2 + 2, icon.Height/-2); | ||
|
||
g.Transform = temp; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.