Mission Planner 1.2.5

add experimental antenna tracker find
add new apparam eeprom reader
add ground alt display to hud
mod stats
modify guided mode alt selection.
test flight planner tab on flight data tab
move some functions to the right click menu
add xplanes data in/out setup to be automatic.
add better mission upload handeling.
This commit is contained in:
Michael Oborne 2012-08-12 12:25:22 +08:00
parent fa1b72adc5
commit b04d76049c
35 changed files with 1332 additions and 869 deletions

View File

@ -110,7 +110,7 @@ namespace ArdupilotMega.Antenna
// conver the angle into a 0-255 value
byte target = (byte)((((PointAtAngle / range) * 2.0) * 127 + centerpos) * _panreverse);
Console.WriteLine("P " + Angle + " " + target + " " + PointAtAngle);
// Console.WriteLine("P " + Angle + " " + target + " " + PointAtAngle);
var buffer = new byte[] { 0xff, PanAddress, target };
ComPort.Write(buffer, 0, buffer.Length);

View File

@ -55,6 +55,7 @@
this.BUT_connect = new ArdupilotMega.Controls.MyButton();
this.LBL_pantrim = new System.Windows.Forms.Label();
this.LBL_tilttrim = new System.Windows.Forms.Label();
this.BUT_find = new ArdupilotMega.Controls.MyButton();
((System.ComponentModel.ISupportInitialize)(this.TRK_pantrim)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.TRK_tilttrim)).BeginInit();
this.SuspendLayout();
@ -222,10 +223,18 @@
resources.ApplyResources(this.LBL_tilttrim, "LBL_tilttrim");
this.LBL_tilttrim.Name = "LBL_tilttrim";
//
// BUT_find
//
resources.ApplyResources(this.BUT_find, "BUT_find");
this.BUT_find.Name = "BUT_find";
this.BUT_find.UseVisualStyleBackColor = true;
this.BUT_find.Click += new System.EventHandler(this.BUT_find_Click);
//
// Tracker
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.BUT_find);
this.Controls.Add(this.LBL_tilttrim);
this.Controls.Add(this.LBL_pantrim);
this.Controls.Add(this.label12);
@ -288,5 +297,6 @@
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Label LBL_pantrim;
private System.Windows.Forms.Label LBL_tilttrim;
private Controls.MyButton BUT_find;
}
}

View File

@ -224,5 +224,81 @@ namespace ArdupilotMega.Antenna
{
saveconfig();
}
private void BUT_find_Click(object sender, EventArgs e)
{
System.Threading.ThreadPool.QueueUserWorkItem(tm1_Tick);
}
void tm1_Tick(object item)
{
float snr = MainV2.cs.localsnrdb;
float best = snr;
float tilt = 0;
float pan = 0;
this.Invoke((MethodInvoker)delegate
{
tilt = TRK_tilttrim.Value;
pan = TRK_pantrim.Value;
});
// scan entire range withing 30 degrees
float ans = checkpos((pan - float.Parse(TXT_panrange.Text) / 4), (pan + float.Parse(TXT_panrange.Text) / 4) - 1, 30);
// scan new range within 30 - little overlap
ans = checkpos((-30 + ans), (30 + ans), 5);
// scan new range
ans = checkpos((-5 + ans), (5 + ans), 1);
setpan(ans);
}
void setpan(float no)
{
this.Invoke((MethodInvoker)delegate
{
try
{
TRK_pantrim.Value = (int)no;
TRK_pantrim_Scroll(null, null);
}
catch { return; }
});
}
float checkpos(float start, float end,float scale)
{
float lastsnr = 0;
float best = 0;
setpan(start);
System.Threading.Thread.Sleep(4000);
for (float n = start; n < end; n += scale)
{
setpan(n);
System.Threading.Thread.Sleep(2000);
Console.WriteLine("Angle " + n + " snr " + MainV2.cs.localsnrdb);
if (MainV2.cs.localsnrdb > lastsnr)
{
best = n;
lastsnr = MainV2.cs.localsnrdb;
}
}
return best;
}
}
}

View File

@ -147,7 +147,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;CMB_interface.ZOrder" xml:space="preserve">
<value>25</value>
<value>26</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -174,7 +174,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>24</value>
<value>25</value>
</data>
<data name="CMB_baudrate.Items" xml:space="preserve">
<value>4800</value>
@ -219,7 +219,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;CMB_baudrate.ZOrder" xml:space="preserve">
<value>21</value>
<value>22</value>
</data>
<data name="CMB_serialport.Location" type="System.Drawing.Point, System.Drawing">
<value>210, 10</value>
@ -240,7 +240,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;CMB_serialport.ZOrder" xml:space="preserve">
<value>23</value>
<value>24</value>
</data>
<data name="TRK_pantrim.Location" type="System.Drawing.Point, System.Drawing">
<value>153, 81</value>
@ -261,7 +261,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;TRK_pantrim.ZOrder" xml:space="preserve">
<value>20</value>
<value>21</value>
</data>
<data name="TXT_panrange.Location" type="System.Drawing.Point, System.Drawing">
<value>83, 81</value>
@ -285,7 +285,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;TXT_panrange.ZOrder" xml:space="preserve">
<value>19</value>
<value>20</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -312,7 +312,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>18</value>
<value>19</value>
</data>
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -339,7 +339,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<value>17</value>
<value>18</value>
</data>
<data name="label5.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -366,7 +366,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label5.ZOrder" xml:space="preserve">
<value>13</value>
<value>14</value>
</data>
<data name="label6.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -393,7 +393,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label6.ZOrder" xml:space="preserve">
<value>14</value>
<value>15</value>
</data>
<data name="TXT_tiltrange.Location" type="System.Drawing.Point, System.Drawing">
<value>83, 157</value>
@ -417,7 +417,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;TXT_tiltrange.ZOrder" xml:space="preserve">
<value>15</value>
<value>16</value>
</data>
<data name="TRK_tilttrim.Location" type="System.Drawing.Point, System.Drawing">
<value>153, 157</value>
@ -438,7 +438,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;TRK_tilttrim.ZOrder" xml:space="preserve">
<value>16</value>
<value>17</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -465,7 +465,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>12</value>
<value>13</value>
</data>
<data name="label7.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -492,7 +492,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label7.ZOrder" xml:space="preserve">
<value>11</value>
<value>12</value>
</data>
<data name="CHK_revpan.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -519,7 +519,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;CHK_revpan.ZOrder" xml:space="preserve">
<value>10</value>
<value>11</value>
</data>
<data name="CHK_revtilt.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -546,7 +546,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;CHK_revtilt.ZOrder" xml:space="preserve">
<value>9</value>
<value>10</value>
</data>
<data name="TXT_pwmrangepan.Location" type="System.Drawing.Point, System.Drawing">
<value>83, 107</value>
@ -570,7 +570,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;TXT_pwmrangepan.ZOrder" xml:space="preserve">
<value>8</value>
<value>9</value>
</data>
<data name="TXT_pwmrangetilt.Location" type="System.Drawing.Point, System.Drawing">
<value>83, 183</value>
@ -594,7 +594,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;TXT_pwmrangetilt.ZOrder" xml:space="preserve">
<value>7</value>
<value>8</value>
</data>
<data name="label8.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -621,7 +621,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label8.ZOrder" xml:space="preserve">
<value>6</value>
<value>7</value>
</data>
<data name="label9.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -648,7 +648,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label9.ZOrder" xml:space="preserve">
<value>5</value>
<value>6</value>
</data>
<data name="label10.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -675,7 +675,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label10.ZOrder" xml:space="preserve">
<value>3</value>
<value>4</value>
</data>
<data name="label11.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -702,7 +702,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label11.ZOrder" xml:space="preserve">
<value>4</value>
<value>5</value>
</data>
<data name="label12.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -732,7 +732,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;label12.ZOrder" xml:space="preserve">
<value>2</value>
<value>3</value>
</data>
<data name="BUT_connect.Location" type="System.Drawing.Point, System.Drawing">
<value>476, 9</value>
@ -750,13 +750,13 @@
<value>BUT_connect</value>
</data>
<data name="&gt;&gt;BUT_connect.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4491.33622, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4605.34402, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_connect.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;BUT_connect.ZOrder" xml:space="preserve">
<value>22</value>
<value>23</value>
</data>
<data name="LBL_pantrim.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -783,7 +783,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;LBL_pantrim.ZOrder" xml:space="preserve">
<value>1</value>
<value>2</value>
</data>
<data name="LBL_tilttrim.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -810,6 +810,30 @@
<value>$this</value>
</data>
<data name="&gt;&gt;LBL_tilttrim.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="BUT_find.Location" type="System.Drawing.Point, System.Drawing">
<value>509, 51</value>
</data>
<data name="BUT_find.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 28</value>
</data>
<data name="BUT_find.TabIndex" type="System.Int32, mscorlib">
<value>31</value>
</data>
<data name="BUT_find.Text" xml:space="preserve">
<value>Find Trim (3DR Radio)</value>
</data>
<data name="&gt;&gt;BUT_find.Name" xml:space="preserve">
<value>BUT_find</value>
</data>
<data name="&gt;&gt;BUT_find.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4605.34402, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_find.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;BUT_find.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@ -825,6 +849,6 @@
<value>Tracker</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.BackstageView.BackStageViewContentPanel, ArdupilotMegaPlanner, Version=1.1.4491.33622, Culture=neutral, PublicKeyToken=null</value>
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

View File

@ -236,11 +236,11 @@ namespace ArdupilotMega.Arduino
AP_PARAM_GROUP
};
static string[] type_names = new string[] {
internal static string[] type_names = new string[] {
"NONE", "INT8", "INT16", "INT32", "FLOAT", "VECTOR3F", "VECTOR6F","MATRIX6F", "GROUP"
};
static byte type_size(ap_var_type type)
internal static byte type_size(ap_var_type type)
{
switch (type) {
case ap_var_type.AP_PARAM_NONE:
@ -369,6 +369,50 @@ namespace ArdupilotMega.Arduino
}
}
}
if (buffer[0] == 'P' && buffer[1] == 'A' && buffer[2] == 6) // ap param
{
int pos = 4;
byte key = 0;
while (pos < (1024 * 4))
{
key = buffer[pos];
pos++;
if (key == 0xff)
{
log.InfoFormat("end sentinal at {0}", pos - 1);
break;
}
int type = buffer[pos] & 0x3f; // 6 bits
uint group = BitConverter.ToUInt32(buffer, pos);//((byte)(buffer[pos]) >> 6) | ((byte)(buffer[pos + 1]) << 8) | ((byte)(buffer[pos + 2]) << 16); // 18 bits
group = (group >> 6) & 0x3ffff;
pos++;
pos++;
pos++;
int size = ArduinoDetect.type_size((ArduinoDetect.ap_var_type)Enum.Parse(typeof(ArduinoDetect.ap_var_type), type.ToString()));
Console.Write("{0:X4}: type {1} ({2}) key {3} group_element {4} size {5} value ", pos - 4, type, ArduinoDetect.type_names[type], key, group, size);
if (key == 0)
{
//Array.Reverse(buffer, pos, 2);
return BitConverter.ToUInt16(buffer, pos);
}
for (int i = 0; i < size; i++)
{
Console.Write(" {0:X2}", buffer[pos]);
pos++;
}
Console.WriteLine();
}
}
}
return -1;
}

View File

@ -30,7 +30,7 @@ namespace ArdupilotMega.Comms
void toggleDTR();
// Properties
//Stream BaseStream { get; }
Stream BaseStream { get; }
int BaudRate { get; set; }
//bool BreakState { get; set; }
int BytesToRead { get; }

View File

@ -16,15 +16,15 @@ namespace ArdupilotMega.Comms
{
private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
TcpClient client = new TcpClient();
BufferedStream clientbuf;
IPEndPoint RemoteIpEndPoint = new IPEndPoint(IPAddress.Any, 0);
byte[] rbuffer = new byte[0];
int rbufferread = 0;
int retrys = 3;
public int WriteBufferSize { get; set; }
public int WriteTimeout { get; set; }
public bool RtsEnable { get; set; }
public Stream BaseStream { get { return this.BaseStream; } }
~TcpSerial()
{
@ -63,7 +63,7 @@ namespace ArdupilotMega.Comms
public int BytesToRead
{
get { return client.Available + rbuffer.Length - rbufferread; }
get { /*Console.WriteLine(DateTime.Now.Millisecond + " tcp btr " + (client.Available + rbuffer.Length - rbufferread));*/ return (int)client.Available; }
}
public int BytesToWrite { get { return 0; } }
@ -95,13 +95,16 @@ namespace ArdupilotMega.Comms
if (ArdupilotMega.MainV2.config["TCP_host"] != null)
host = ArdupilotMega.MainV2.config["TCP_host"].ToString();
if (System.Windows.Forms.DialogResult.Cancel == ArdupilotMega.Common.InputBox("remote host", "Enter host name/ip (ensure remote end is already started)", ref host))
if (!MainV2.MONO)
{
throw new Exception("Canceled by request");
}
if (System.Windows.Forms.DialogResult.Cancel == ArdupilotMega.Common.InputBox("remote Port", "Enter remote port", ref dest))
{
throw new Exception("Canceled by request");
if (System.Windows.Forms.DialogResult.Cancel == ArdupilotMega.Common.InputBox("remote host", "Enter host name/ip (ensure remote end is already started)", ref host))
{
throw new Exception("Canceled by request");
}
if (System.Windows.Forms.DialogResult.Cancel == ArdupilotMega.Common.InputBox("remote Port", "Enter remote port", ref dest))
{
throw new Exception("Canceled by request");
}
}
Port = dest;
@ -114,6 +117,8 @@ namespace ArdupilotMega.Comms
client.NoDelay = true;
client.Client.NoDelay = true;
clientbuf = new BufferedStream(client.GetStream());
VerifyConnected();
return;
@ -132,7 +137,9 @@ namespace ArdupilotMega.Comms
// this should only happen if we have established a connection in the first place
if (client != null && retrys > 0)
{
log.Info("tcp reconnect");
client.Connect(ArdupilotMega.MainV2.config["TCP_host"].ToString(), int.Parse(ArdupilotMega.MainV2.config["TCP_port"].ToString()));
clientbuf = new BufferedStream(client.GetStream());
retrys--;
}
@ -147,7 +154,14 @@ namespace ArdupilotMega.Comms
{
if (length < 1) { return 0; }
return client.Client.Receive(readto, offset, length, SocketFlags.None);
return client.Client.Receive(readto, offset, length, SocketFlags.None);
/*
byte[] temp = new byte[length];
clientbuf.Read(temp, 0, length);
temp.CopyTo(readto, offset);
return length;*/
}
catch { throw new Exception("Socket Closed"); }
}
@ -212,7 +226,7 @@ namespace ArdupilotMega.Comms
public void DiscardInBuffer()
{
VerifyConnected();
int size = client.Available;
int size = (int)client.Available;
byte[] crap = new byte[size];
log.InfoFormat("TcpSerial DiscardInBuffer {0}",size);
Read(crap, 0, size);

View File

@ -21,6 +21,7 @@ namespace ArdupilotMega.Comms
public int WriteBufferSize { get; set; }
public int WriteTimeout { get; set; }
public bool RtsEnable { get; set; }
public Stream BaseStream { get { return this.BaseStream; } }
~UdpSerial()
{

View File

@ -46,7 +46,7 @@
"38400",
"57600",
"115200"});
this.cmb_Baud.Location = new System.Drawing.Point(130, 12);
this.cmb_Baud.Location = new System.Drawing.Point(130, 4);
this.cmb_Baud.Name = "cmb_Baud";
this.cmb_Baud.Size = new System.Drawing.Size(70, 21);
this.cmb_Baud.TabIndex = 0;
@ -54,7 +54,7 @@
// cmb_ConnectionType
//
this.cmb_ConnectionType.FormattingEnabled = true;
this.cmb_ConnectionType.Location = new System.Drawing.Point(79, 39);
this.cmb_ConnectionType.Location = new System.Drawing.Point(79, 31);
this.cmb_ConnectionType.Name = "cmb_ConnectionType";
this.cmb_ConnectionType.Size = new System.Drawing.Size(121, 21);
this.cmb_ConnectionType.TabIndex = 1;
@ -63,7 +63,7 @@
// cmb_Connection
//
this.cmb_Connection.FormattingEnabled = true;
this.cmb_Connection.Location = new System.Drawing.Point(3, 12);
this.cmb_Connection.Location = new System.Drawing.Point(3, 4);
this.cmb_Connection.Name = "cmb_Connection";
this.cmb_Connection.Size = new System.Drawing.Size(121, 21);
this.cmb_Connection.TabIndex = 2;
@ -72,7 +72,7 @@
//
this.linkLabel1.AutoSize = true;
this.linkLabel1.Image = global::ArdupilotMega.Properties.Resources.bg;
this.linkLabel1.Location = new System.Drawing.Point(3, 55);
this.linkLabel1.Location = new System.Drawing.Point(3, 44);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(63, 13);
this.linkLabel1.TabIndex = 3;
@ -90,7 +90,7 @@
this.Controls.Add(this.cmb_ConnectionType);
this.Controls.Add(this.cmb_Baud);
this.Name = "ConnectionControl";
this.Size = new System.Drawing.Size(230, 76);
this.Size = new System.Drawing.Size(230, 60);
this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.ConnectionControl_MouseClick);
this.ResumeLayout(false);
this.PerformLayout();

View File

@ -150,6 +150,9 @@ namespace ArdupilotMega.Controls
[System.ComponentModel.Browsable(true), System.ComponentModel.Category("Values")]
public DateTime datetime { get { return _datetime; } set { if (_datetime != value) { _datetime = value; this.Invalidate(); } } }
[System.ComponentModel.Browsable(true), System.ComponentModel.Category("Values")]
public float groundalt { get; set; }
[System.ComponentModel.Browsable(true), System.ComponentModel.Category("Values")]
public int status { get; set; }
@ -1245,6 +1248,8 @@ namespace ArdupilotMega.Controls
greenPen.Color = Color.FromArgb(255, greenPen.Color);
}
bool ground = false;
for (int a = (int)start; a <= (_alt + viewrange / 2); a += 1)
{
if (a == Math.Round(_targetalt) && _targetalt != 0)
@ -1252,12 +1257,21 @@ namespace ArdupilotMega.Controls
greenPen.Width = 6;
graphicsObject.DrawLine(greenPen, scrollbg.Left, scrollbg.Top - space * (a - start), scrollbg.Left + scrollbg.Width, scrollbg.Top - space * (a - start));
}
// ground doesnt appear if we are not in view or below ground level
if (a == Math.Round(groundalt) && groundalt != 0 && ground == false)
{
graphicsObject.FillRectangle(new SolidBrush(Color.FromArgb(100,Color.BurlyWood)), new RectangleF(scrollbg.Left, scrollbg.Top - space * (a - start), scrollbg.Width, (space * (a - start))));
}
if (a % 5 == 0)
{
//Console.WriteLine(a + " " + scrollbg.Left + " " + (scrollbg.Top - space * (a - start)) + " " + (scrollbg.Left + 20) + " " + (scrollbg.Top - space * (a - start)));
graphicsObject.DrawLine(whitePen, scrollbg.Left, scrollbg.Top - space * (a - start), scrollbg.Left + 10, scrollbg.Top - space * (a - start));
drawstring(graphicsObject, a.ToString().PadLeft(5), font, fontsize, whiteBrush, scrollbg.Left + 0 + (int)(0 * fontoffset), scrollbg.Top - space * (a - start) - 6 - fontoffset);
}
}
greenPen.Width = 4;

View File

@ -13,7 +13,7 @@ namespace ArdupilotMega.Controls
{
public partial class MainSwitcher : UserControl
{
List<Screen> screens = new List<Screen>();
public List<Screen> screens = new List<Screen>();
Screen current;
public MainSwitcher()

View File

@ -18,11 +18,18 @@ namespace ArdupilotMega.Controls
int noofchars = 0;
bool autosize = false;
SolidBrush s = new SolidBrush(Color.White);
SolidBrush b = new SolidBrush(Color.Black);
StringFormat stringFormat = new StringFormat();
[System.ComponentModel.Browsable(true)]
public bool resize { get { return autosize; } set { autosize = value; } }
public MyLabel()
{
stringFormat.Alignment = StringAlignment.Near;
stringFormat.LineAlignment = StringAlignment.Center;
}
public override string Text
@ -81,30 +88,45 @@ namespace ArdupilotMega.Controls
base.OnVisibleChanged(e);
}
public override Color BackColor
{
get
{
return base.BackColor;
}
set
{
base.BackColor = value;
b = new SolidBrush(value);
this.Invalidate();
}
}
SolidBrush s = new SolidBrush(Color.White);
SolidBrush b = new SolidBrush(Color.Black);
StringFormat stringFormat = new StringFormat();
public override System.Drawing.Color ForeColor
{
get
{
return base.ForeColor;
}
set
{
base.ForeColor = value;
s = new SolidBrush(value);
this.Invalidate();
}
}
protected override void OnPaint(PaintEventArgs e)
{
// TextRenderer.DrawText(e.Graphics, label, this.Font, new Point(0, 0), ForeColor);
stringFormat.Alignment = StringAlignment.Near;
stringFormat.LineAlignment = StringAlignment.Center;
s = new SolidBrush(ForeColor);
e.Graphics.DrawString(label, this.Font, s, new PointF(0, this.Height / 2.0f), stringFormat);
}
protected override void OnPaintBackground(PaintEventArgs pevent)
{
b = new SolidBrush(BackColor);
pevent.Graphics.FillRectangle(b, this.ClientRectangle);
base.OnPaintBackground(pevent);

View File

@ -13,7 +13,7 @@ namespace System.Windows.Forms
{
/// <summary>
/// implement an on closing event to tidy up enviroment.
/// Using preedefined refrence as can easerly change betwen form and user control this way.
/// Using preedefined refrence as can easerly change between form and user control this way.
/// </summary>
public event FormClosingEventHandler FormClosing;

View File

@ -109,6 +109,7 @@ namespace ArdupilotMega.Controls
// timer1
//
this.timer1.Enabled = true;
this.timer1.Interval = 200;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// ProgressReporterDialogue

View File

@ -202,7 +202,10 @@ namespace ArdupilotMega
public ushort rcoverridech7 { get; set; }
public ushort rcoverridech8 { get; set; }
public float HomeAlt { get { return (float)HomeLocation.Alt; } set { } }
internal PointLatLngAlt HomeLocation = new PointLatLngAlt();
public float DistToMAV
{
get

View File

@ -51,7 +51,7 @@ namespace ArdupilotMega
} catch {CustomMessageBox.Show("Invalid BaudRate"); return;}
try {
comPort.Open();
} catch {CustomMessageBox.Show("Error Connecting\nif using com0com please rename the ports to COM??"); return;}
} catch (Exception ex) {CustomMessageBox.Show("Error Connecting\nif using com0com please rename the ports to COM??\n" + ex.ToString()); return;}
string alt = "100";
@ -159,7 +159,7 @@ namespace ArdupilotMega
{
MainV2.giveComport = true;
MainV2.comPort.setWP(gotohere, 0, MAVLink.MAV_FRAME.GLOBAL_RELATIVE_ALT, (byte)2);
MainV2.comPort.setGuidedModeWP(gotohere);
GCSViews.FlightData.GuidedModeWP = new PointLatLngAlt(gotohere);

View File

@ -404,18 +404,19 @@ namespace ArdupilotMega.GCSViews
}
catch (Exception ex) { lbl_status.Text = "Failed download"; CustomMessageBox.Show("Failed to download new firmware : " + ex.ToString()); return; }
System.Threading.ThreadPool.QueueUserWorkItem(fwtype, temp);
System.Threading.ThreadPool.QueueUserWorkItem(apmtype, temp.name + "!" + board);
UploadFlash(Path.GetDirectoryName(Application.ExecutablePath) + Path.DirectorySeparatorChar + @"firmware.hex", board);
}
void fwtype(object temp)
void apmtype(object temp)
{
software sw = (software)temp;
try
{
// Create a request using a URL that can receive a post.
WebRequest request = WebRequest.Create("http://vps.oborne.me/" + sw.name);
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("http://vps.oborne.me/axs/ax.pl?" + (string)temp);
//request.AllowAutoRedirect = true;
request.UserAgent = MainV2.instance.Text + " (res" + MainV2.instance.Width + "x" + MainV2.instance.Height + "; " + Environment.OSVersion.VersionString + ")";
request.Timeout = 10000;
// Set the Method property of the request to POST.
request.Method = "GET";

View File

@ -12,7 +12,9 @@
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.goHereToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.flyToHereAltToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pointCameraHereToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.flightPlannerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MainH = new System.Windows.Forms.SplitContainer();
this.SubMainLeft = new System.Windows.Forms.SplitContainer();
this.hud1 = new ArdupilotMega.Controls.HUD();
@ -110,7 +112,9 @@
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.goHereToolStripMenuItem,
this.pointCameraHereToolStripMenuItem});
this.flyToHereAltToolStripMenuItem,
this.pointCameraHereToolStripMenuItem,
this.flightPlannerToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
resources.ApplyResources(this.contextMenuStrip1, "contextMenuStrip1");
//
@ -120,12 +124,24 @@
resources.ApplyResources(this.goHereToolStripMenuItem, "goHereToolStripMenuItem");
this.goHereToolStripMenuItem.Click += new System.EventHandler(this.goHereToolStripMenuItem_Click);
//
// flyToHereAltToolStripMenuItem
//
this.flyToHereAltToolStripMenuItem.Name = "flyToHereAltToolStripMenuItem";
resources.ApplyResources(this.flyToHereAltToolStripMenuItem, "flyToHereAltToolStripMenuItem");
this.flyToHereAltToolStripMenuItem.Click += new System.EventHandler(this.flyToHereAltToolStripMenuItem_Click);
//
// pointCameraHereToolStripMenuItem
//
this.pointCameraHereToolStripMenuItem.Name = "pointCameraHereToolStripMenuItem";
resources.ApplyResources(this.pointCameraHereToolStripMenuItem, "pointCameraHereToolStripMenuItem");
this.pointCameraHereToolStripMenuItem.Click += new System.EventHandler(this.pointCameraHereToolStripMenuItem_Click);
//
// flightPlannerToolStripMenuItem
//
this.flightPlannerToolStripMenuItem.Name = "flightPlannerToolStripMenuItem";
resources.ApplyResources(this.flightPlannerToolStripMenuItem, "flightPlannerToolStripMenuItem");
this.flightPlannerToolStripMenuItem.Click += new System.EventHandler(this.flightPlannerToolStripMenuItem_Click);
//
// MainH
//
this.MainH.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
@ -173,6 +189,7 @@
this.hud1.DataBindings.Add(new System.Windows.Forms.Binding("disttowp", this.bindingSource1, "wp_dist", true));
this.hud1.DataBindings.Add(new System.Windows.Forms.Binding("gpsfix", this.bindingSource1, "gpsstatus", true));
this.hud1.DataBindings.Add(new System.Windows.Forms.Binding("gpshdop", this.bindingSource1, "gpshdop", true));
this.hud1.DataBindings.Add(new System.Windows.Forms.Binding("groundalt", this.bindingSource1, "HomeAlt", true));
this.hud1.DataBindings.Add(new System.Windows.Forms.Binding("groundcourse", this.bindingSource1, "groundcourse", true));
this.hud1.DataBindings.Add(new System.Windows.Forms.Binding("groundspeed", this.bindingSource1, "groundspeed", true));
this.hud1.DataBindings.Add(new System.Windows.Forms.Binding("heading", this.bindingSource1, "yaw", true));
@ -195,6 +212,7 @@
resources.ApplyResources(this.hud1, "hud1");
this.hud1.gpsfix = 0F;
this.hud1.gpshdop = 0F;
this.hud1.groundalt = 0F;
this.hud1.groundcourse = 0F;
this.hud1.groundspeed = 0F;
this.hud1.heading = 0F;
@ -1040,6 +1058,7 @@
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.ContextMenuStrip = this.contextMenuStrip1;
this.splitContainer1.Panel2.Controls.Add(this.lbl_winddir);
this.splitContainer1.Panel2.Controls.Add(this.lbl_windvel);
this.splitContainer1.Panel2.Controls.Add(this.lbl_hdop);
@ -1346,5 +1365,7 @@
private Controls.QuickView quickView4;
private Controls.QuickView quickView6;
private Controls.QuickView quickView5;
private System.Windows.Forms.ToolStripMenuItem flyToHereAltToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem flightPlannerToolStripMenuItem;
}
}

View File

@ -227,6 +227,11 @@ namespace ArdupilotMega.GCSViews
hud1.Enabled = true;
hud1.Dock = DockStyle.Fill;
foreach (Control ctl in splitContainer1.Panel2.Controls)
{
ctl.Visible = true;
}
}
public void Deactivate()
@ -312,7 +317,7 @@ namespace ArdupilotMega.GCSViews
if (MainV2.giveComport == true)
{
System.Threading.Thread.Sleep(20);
System.Threading.Thread.Sleep(100);
continue;
}
if (!comPort.BaseStream.IsOpen)
@ -571,7 +576,7 @@ namespace ArdupilotMega.GCSViews
if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane)
{
routes.Markers[0] = (new GMapMarkerPlane(currentloc, MainV2.cs.yaw, MainV2.cs.groundcourse, MainV2.cs.nav_bearing, MainV2.cs.target_bearing, gMapControl1));
routes.Markers[0] = (new GMapMarkerPlane(currentloc, MainV2.cs.yaw, MainV2.cs.groundcourse, MainV2.cs.nav_bearing, MainV2.cs.target_bearing, gMapControl1) { ToolTipText = MainV2.cs.alt.ToString("0"), ToolTipMode = MarkerTooltipMode.Always });
}
else if (MainV2.cs.firmware == MainV2.Firmwares.ArduRover)
{
@ -1040,30 +1045,12 @@ namespace ArdupilotMega.GCSViews
return;
}
string alt = "100";
if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2)
if (GuidedModeWP.Alt == 0)
{
alt = (10 * MainV2.cs.multiplierdist).ToString("0");
}
else
{
alt = (100 * MainV2.cs.multiplierdist).ToString("0");
}
flyToHereAltToolStripMenuItem_Click(null, null);
if (MainV2.config.ContainsKey("guided_alt"))
alt = MainV2.config["guided_alt"].ToString();
if (DialogResult.Cancel == Common.InputBox("Enter Alt", "Enter Guided Mode Alt", ref alt))
return;
MainV2.config["guided_alt"] = alt;
int intalt = (int)(100 * MainV2.cs.multiplierdist);
if (!int.TryParse(alt, out intalt))
{
CustomMessageBox.Show("Bad Alt");
return;
if (GuidedModeWP.Alt == 0)
return;
}
if (gotolocation.Lat == 0 || gotolocation.Lng == 0)
@ -1075,19 +1062,15 @@ namespace ArdupilotMega.GCSViews
Locationwp gotohere = new Locationwp();
gotohere.id = (byte)MAVLink.MAV_CMD.WAYPOINT;
gotohere.alt = (float)(intalt / MainV2.cs.multiplierdist); // back to m
gotohere.alt = (float)(GuidedModeWP.Alt); // back to m
gotohere.lat = (float)(gotolocation.Lat);
gotohere.lng = (float)(gotolocation.Lng);
try
{
MainV2.giveComport = true;
MainV2.comPort.setWP(gotohere, 0, MAVLink.MAV_FRAME.GLOBAL_RELATIVE_ALT, (byte)2);
MainV2.comPort.setGuidedModeWP(gotohere);
GuidedModeWP = new PointLatLngAlt(gotohere.lat, gotohere.lng, gotohere.alt,"Guided Mode");
MainV2.giveComport = false;
}
catch (Exception ex) { MainV2.giveComport = false; CustomMessageBox.Show("Error sending command : " + ex.Message); }
@ -2150,5 +2133,98 @@ print 'Roll complete'
((Form)((CheckBox)sender).Parent).Close();
}
}
private void flyToHereAltToolStripMenuItem_Click(object sender, EventArgs e)
{
string alt = "100";
if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2)
{
alt = (10 * MainV2.cs.multiplierdist).ToString("0");
}
else
{
alt = (100 * MainV2.cs.multiplierdist).ToString("0");
}
if (MainV2.config.ContainsKey("guided_alt"))
alt = MainV2.config["guided_alt"].ToString();
if (DialogResult.Cancel == Common.InputBox("Enter Alt", "Enter Guided Mode Alt", ref alt))
return;
MainV2.config["guided_alt"] = alt;
int intalt = (int)(100 * MainV2.cs.multiplierdist);
if (!int.TryParse(alt, out intalt))
{
CustomMessageBox.Show("Bad Alt");
return;
}
GuidedModeWP.Alt = intalt;
if (MainV2.cs.mode == "Guided")
{
MainV2.comPort.setGuidedModeWP(new Locationwp() { alt = (float)GuidedModeWP.Alt, lat = (float)GuidedModeWP.Lat, lng = (float)GuidedModeWP.Lng });
}
}
private void flightPlannerToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Control ctl in splitContainer1.Panel2.Controls)
{
ctl.Visible = false;
}
foreach (MainSwitcher.Screen sc in MainV2.View.screens)
{
if (sc.Name == "FlightPlanner")
{
MyButton but = new MyButton() { Location = new Point(splitContainer1.Panel2.Width / 2, 0), Text = "Close" };
but.Click += new EventHandler(but_Click);
splitContainer1.Panel2.Controls.Add(but);
splitContainer1.Panel2.Controls.Add(sc.Control);
ThemeManager.ApplyThemeTo(sc.Control);
sc.Control.Dock = DockStyle.Fill;
sc.Control.Visible = true;
if (sc.Control is IActivate)
{
((IActivate)(sc.Control)).Activate();
}
but.BringToFront();
break;
}
}
}
void but_Click(object sender, EventArgs e)
{
foreach (MainSwitcher.Screen sc in MainV2.View.screens)
{
if (sc.Name == "FlightPlanner")
{
splitContainer1.Panel2.Controls.Remove(sc.Control);
splitContainer1.Panel2.Controls.Remove((Control)sender);
sc.Control.Visible = false;
if (sc.Control is IDeactivate)
{
((IDeactivate)(sc.Control)).Deactivate();
}
break;
}
}
foreach (Control ctl in splitContainer1.Panel2.Controls)
{
ctl.Visible = true;
}
}
}
}

View File

@ -127,14 +127,26 @@
<data name="goHereToolStripMenuItem.Text" xml:space="preserve">
<value>Fly To Here</value>
</data>
<data name="flyToHereAltToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>174, 22</value>
</data>
<data name="flyToHereAltToolStripMenuItem.Text" xml:space="preserve">
<value>Fly To Here Alt</value>
</data>
<data name="pointCameraHereToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>174, 22</value>
</data>
<data name="pointCameraHereToolStripMenuItem.Text" xml:space="preserve">
<value>Point Camera Here</value>
</data>
<data name="flightPlannerToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>174, 22</value>
</data>
<data name="flightPlannerToolStripMenuItem.Text" xml:space="preserve">
<value>Flight Planner</value>
</data>
<data name="contextMenuStrip1.Size" type="System.Drawing.Size, System.Drawing">
<value>175, 70</value>
<value>175, 92</value>
</data>
<data name="&gt;&gt;contextMenuStrip1.Name" xml:space="preserve">
<value>contextMenuStrip1</value>
@ -226,7 +238,7 @@
<value>hud1</value>
</data>
<data name="&gt;&gt;hud1.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.HUD, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.HUD, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;hud1.Parent" xml:space="preserve">
<value>SubMainLeft.Panel1</value>
@ -262,7 +274,7 @@
<value>quickView6</value>
</data>
<data name="&gt;&gt;quickView6.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;quickView6.Parent" xml:space="preserve">
<value>tabQuick</value>
@ -283,7 +295,7 @@
<value>quickView5</value>
</data>
<data name="&gt;&gt;quickView5.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;quickView5.Parent" xml:space="preserve">
<value>tabQuick</value>
@ -304,7 +316,7 @@
<value>quickView4</value>
</data>
<data name="&gt;&gt;quickView4.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;quickView4.Parent" xml:space="preserve">
<value>tabQuick</value>
@ -325,7 +337,7 @@
<value>quickView3</value>
</data>
<data name="&gt;&gt;quickView3.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;quickView3.Parent" xml:space="preserve">
<value>tabQuick</value>
@ -346,7 +358,7 @@
<value>quickView2</value>
</data>
<data name="&gt;&gt;quickView2.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;quickView2.Parent" xml:space="preserve">
<value>tabQuick</value>
@ -367,7 +379,7 @@
<value>quickView1</value>
</data>
<data name="&gt;&gt;quickView1.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;quickView1.Parent" xml:space="preserve">
<value>tabQuick</value>
@ -421,7 +433,7 @@
<value>BUT_script</value>
</data>
<data name="&gt;&gt;BUT_script.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_script.Parent" xml:space="preserve">
<value>tabActions</value>
@ -454,7 +466,7 @@
<value>BUT_joystick</value>
</data>
<data name="&gt;&gt;BUT_joystick.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_joystick.Parent" xml:space="preserve">
<value>tabActions</value>
@ -484,7 +496,7 @@
<value>BUT_quickmanual</value>
</data>
<data name="&gt;&gt;BUT_quickmanual.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_quickmanual.Parent" xml:space="preserve">
<value>tabActions</value>
@ -514,7 +526,7 @@
<value>BUT_quickrtl</value>
</data>
<data name="&gt;&gt;BUT_quickrtl.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_quickrtl.Parent" xml:space="preserve">
<value>tabActions</value>
@ -544,7 +556,7 @@
<value>BUT_quickauto</value>
</data>
<data name="&gt;&gt;BUT_quickauto.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_quickauto.Parent" xml:space="preserve">
<value>tabActions</value>
@ -598,7 +610,7 @@
<value>BUT_setwp</value>
</data>
<data name="&gt;&gt;BUT_setwp.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_setwp.Parent" xml:space="preserve">
<value>tabActions</value>
@ -649,7 +661,7 @@
<value>BUT_setmode</value>
</data>
<data name="&gt;&gt;BUT_setmode.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_setmode.Parent" xml:space="preserve">
<value>tabActions</value>
@ -679,7 +691,7 @@
<value>BUT_clear_track</value>
</data>
<data name="&gt;&gt;BUT_clear_track.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_clear_track.Parent" xml:space="preserve">
<value>tabActions</value>
@ -730,7 +742,7 @@
<value>BUT_Homealt</value>
</data>
<data name="&gt;&gt;BUT_Homealt.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_Homealt.Parent" xml:space="preserve">
<value>tabActions</value>
@ -760,7 +772,7 @@
<value>BUT_RAWSensor</value>
</data>
<data name="&gt;&gt;BUT_RAWSensor.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_RAWSensor.Parent" xml:space="preserve">
<value>tabActions</value>
@ -790,7 +802,7 @@
<value>BUTrestartmission</value>
</data>
<data name="&gt;&gt;BUTrestartmission.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUTrestartmission.Parent" xml:space="preserve">
<value>tabActions</value>
@ -820,7 +832,7 @@
<value>BUTactiondo</value>
</data>
<data name="&gt;&gt;BUTactiondo.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUTactiondo.Parent" xml:space="preserve">
<value>tabActions</value>
@ -874,7 +886,7 @@
<value>Gvspeed</value>
</data>
<data name="&gt;&gt;Gvspeed.Type" xml:space="preserve">
<value>AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;Gvspeed.Parent" xml:space="preserve">
<value>tabGauges</value>
@ -904,7 +916,7 @@
<value>Gheading</value>
</data>
<data name="&gt;&gt;Gheading.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.HSI, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.HSI, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;Gheading.Parent" xml:space="preserve">
<value>tabGauges</value>
@ -934,7 +946,7 @@
<value>Galt</value>
</data>
<data name="&gt;&gt;Galt.Type" xml:space="preserve">
<value>AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;Galt.Parent" xml:space="preserve">
<value>tabGauges</value>
@ -967,7 +979,7 @@
<value>Gspeed</value>
</data>
<data name="&gt;&gt;Gspeed.Type" xml:space="preserve">
<value>AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;Gspeed.Parent" xml:space="preserve">
<value>tabGauges</value>
@ -1051,7 +1063,7 @@
<value>lbl_playbackspeed</value>
</data>
<data name="&gt;&gt;lbl_playbackspeed.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_playbackspeed.Parent" xml:space="preserve">
<value>tabTLogs</value>
@ -1078,7 +1090,7 @@
<value>lbl_logpercent</value>
</data>
<data name="&gt;&gt;lbl_logpercent.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_logpercent.Parent" xml:space="preserve">
<value>tabTLogs</value>
@ -1105,7 +1117,7 @@
<value>NUM_playbackspeed</value>
</data>
<data name="&gt;&gt;NUM_playbackspeed.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyTrackBar, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyTrackBar, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;NUM_playbackspeed.Parent" xml:space="preserve">
<value>tabTLogs</value>
@ -1132,7 +1144,7 @@
<value>BUT_log2kml</value>
</data>
<data name="&gt;&gt;BUT_log2kml.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_log2kml.Parent" xml:space="preserve">
<value>tabTLogs</value>
@ -1186,7 +1198,7 @@
<value>BUT_playlog</value>
</data>
<data name="&gt;&gt;BUT_playlog.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_playlog.Parent" xml:space="preserve">
<value>tabTLogs</value>
@ -1213,7 +1225,7 @@
<value>BUT_loadtelem</value>
</data>
<data name="&gt;&gt;BUT_loadtelem.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_loadtelem.Parent" xml:space="preserve">
<value>tabTLogs</value>
@ -1399,7 +1411,7 @@
<value>lbl_winddir</value>
</data>
<data name="&gt;&gt;lbl_winddir.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_winddir.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
@ -1429,7 +1441,7 @@
<value>lbl_windvel</value>
</data>
<data name="&gt;&gt;lbl_windvel.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_windvel.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
@ -1462,7 +1474,7 @@
<value>lbl_hdop</value>
</data>
<data name="&gt;&gt;lbl_hdop.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_hdop.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
@ -1495,7 +1507,7 @@
<value>lbl_sats</value>
</data>
<data name="&gt;&gt;lbl_sats.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_sats.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
@ -1667,7 +1679,7 @@
<value>gMapControl1</value>
</data>
<data name="&gt;&gt;gMapControl1.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.myGMAP, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.myGMAP, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;gMapControl1.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
@ -1730,7 +1742,7 @@
<value>TXT_lat</value>
</data>
<data name="&gt;&gt;TXT_lat.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;TXT_lat.Parent" xml:space="preserve">
<value>panel1</value>
@ -1787,7 +1799,7 @@
<value>label1</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>panel1</value>
@ -1817,7 +1829,7 @@
<value>TXT_long</value>
</data>
<data name="&gt;&gt;TXT_long.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;TXT_long.Parent" xml:space="preserve">
<value>panel1</value>
@ -1847,7 +1859,7 @@
<value>TXT_alt</value>
</data>
<data name="&gt;&gt;TXT_alt.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;TXT_alt.Parent" xml:space="preserve">
<value>panel1</value>
@ -2048,7 +2060,7 @@
<value>label6</value>
</data>
<data name="&gt;&gt;label6.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;label6.Parent" xml:space="preserve">
<value>$this</value>
@ -2074,12 +2086,24 @@
<data name="&gt;&gt;goHereToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;flyToHereAltToolStripMenuItem.Name" xml:space="preserve">
<value>flyToHereAltToolStripMenuItem</value>
</data>
<data name="&gt;&gt;flyToHereAltToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;pointCameraHereToolStripMenuItem.Name" xml:space="preserve">
<value>pointCameraHereToolStripMenuItem</value>
</data>
<data name="&gt;&gt;pointCameraHereToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;flightPlannerToolStripMenuItem.Name" xml:space="preserve">
<value>flightPlannerToolStripMenuItem</value>
</data>
<data name="&gt;&gt;flightPlannerToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;recordHudToAVIToolStripMenuItem.Name" xml:space="preserve">
<value>recordHudToAVIToolStripMenuItem</value>
</data>
@ -2144,6 +2168,6 @@
<value>FlightData</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.MyUserControl, ArdupilotMegaPlanner10, Version=1.1.4602.32614, Culture=neutral, PublicKeyToken=null</value>
<value>System.Windows.Forms.MyUserControl, ArdupilotMegaPlanner10, Version=1.1.4606.24956, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>

View File

@ -86,14 +86,9 @@
this.TXT_mouselat = new System.Windows.Forms.TextBox();
this.comboBoxMapType = new System.Windows.Forms.ComboBox();
this.lbl_status = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.panelWaypoints = new BSE.Windows.Forms.Panel();
this.splitter1 = new BSE.Windows.Forms.Splitter();
this.BUT_loadkml = new ArdupilotMega.Controls.MyButton();
this.BUT_zoomto = new ArdupilotMega.Controls.MyButton();
this.BUT_Camera = new ArdupilotMega.Controls.MyButton();
this.BUT_grid = new ArdupilotMega.Controls.MyButton();
this.BUT_Prefetch = new ArdupilotMega.Controls.MyButton();
this.button1 = new ArdupilotMega.Controls.MyButton();
this.BUT_Add = new ArdupilotMega.Controls.MyButton();
this.panelAction = new BSE.Windows.Forms.Panel();
@ -104,6 +99,7 @@
this.MainMap = new ArdupilotMega.Controls.myGMAP();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.deleteWPToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.setROIToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.loiterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.loiterForeverToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.loitertimeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -111,10 +107,8 @@
this.jumpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.jumpstartToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.jumpwPToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.createWpCircleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.clearMissionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.ContextMeasure = new System.Windows.Forms.ToolStripMenuItem();
this.rotateMapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.polygonToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addPolygonPointToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.clearPolygonToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -126,7 +120,15 @@
this.setReturnLocationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.loadFromFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveToFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.clearMissionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.autoWPToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.createWpCircleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.gridToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mapToolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ContextMeasure = new System.Windows.Forms.ToolStripMenuItem();
this.rotateMapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.zoomToToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.prefetchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.kMLOverlayToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.trackBar1 = new ArdupilotMega.Controls.MyTrackBar();
this.label11 = new System.Windows.Forms.Label();
this.panelBASE = new System.Windows.Forms.Panel();
@ -504,23 +506,15 @@
resources.ApplyResources(this.lbl_status, "lbl_status");
this.lbl_status.Name = "lbl_status";
//
// textBox1
//
resources.ApplyResources(this.textBox1, "textBox1");
this.textBox1.Name = "textBox1";
//
// panelWaypoints
//
this.panelWaypoints.AssociatedSplitter = this.splitter1;
resources.ApplyResources(this.panelWaypoints, "panelWaypoints");
this.panelWaypoints.BackColor = System.Drawing.Color.Transparent;
this.panelWaypoints.CaptionFont = new System.Drawing.Font("Segoe UI", 11.75F, System.Drawing.FontStyle.Bold);
this.panelWaypoints.CaptionHeight = 21;
this.panelWaypoints.ColorScheme = BSE.Windows.Forms.ColorScheme.Custom;
this.panelWaypoints.Controls.Add(this.BUT_loadkml);
this.panelWaypoints.Controls.Add(this.BUT_zoomto);
this.panelWaypoints.Controls.Add(this.BUT_Camera);
this.panelWaypoints.Controls.Add(this.BUT_grid);
this.panelWaypoints.Controls.Add(this.BUT_Prefetch);
this.panelWaypoints.Controls.Add(this.CHK_altmode);
this.panelWaypoints.Controls.Add(this.LBL_WPRad);
this.panelWaypoints.Controls.Add(this.button1);
@ -546,7 +540,6 @@
this.panelWaypoints.CustomColors.ContentGradientBegin = System.Drawing.SystemColors.ButtonFace;
this.panelWaypoints.CustomColors.ContentGradientEnd = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(252)))), ((int)(((byte)(252)))));
this.panelWaypoints.CustomColors.InnerBorderColor = System.Drawing.SystemColors.Window;
resources.ApplyResources(this.panelWaypoints, "panelWaypoints");
this.panelWaypoints.ForeColor = System.Drawing.SystemColors.ControlText;
this.panelWaypoints.Image = null;
this.panelWaypoints.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
@ -565,22 +558,6 @@
this.splitter1.Name = "splitter1";
this.splitter1.TabStop = false;
//
// BUT_loadkml
//
resources.ApplyResources(this.BUT_loadkml, "BUT_loadkml");
this.BUT_loadkml.Name = "BUT_loadkml";
this.toolTip1.SetToolTip(this.BUT_loadkml, resources.GetString("BUT_loadkml.ToolTip"));
this.BUT_loadkml.UseVisualStyleBackColor = true;
this.BUT_loadkml.Click += new System.EventHandler(this.BUT_loadkml_Click);
//
// BUT_zoomto
//
resources.ApplyResources(this.BUT_zoomto, "BUT_zoomto");
this.BUT_zoomto.Name = "BUT_zoomto";
this.toolTip1.SetToolTip(this.BUT_zoomto, resources.GetString("BUT_zoomto.ToolTip"));
this.BUT_zoomto.UseVisualStyleBackColor = true;
this.BUT_zoomto.Click += new System.EventHandler(this.BUT_zoomto_Click);
//
// BUT_Camera
//
resources.ApplyResources(this.BUT_Camera, "BUT_Camera");
@ -589,22 +566,6 @@
this.BUT_Camera.UseVisualStyleBackColor = true;
this.BUT_Camera.Click += new System.EventHandler(this.BUT_Camera_Click);
//
// BUT_grid
//
resources.ApplyResources(this.BUT_grid, "BUT_grid");
this.BUT_grid.Name = "BUT_grid";
this.toolTip1.SetToolTip(this.BUT_grid, resources.GetString("BUT_grid.ToolTip"));
this.BUT_grid.UseVisualStyleBackColor = true;
this.BUT_grid.Click += new System.EventHandler(this.BUT_grid_Click);
//
// BUT_Prefetch
//
resources.ApplyResources(this.BUT_Prefetch, "BUT_Prefetch");
this.BUT_Prefetch.Name = "BUT_Prefetch";
this.toolTip1.SetToolTip(this.BUT_Prefetch, resources.GetString("BUT_Prefetch.ToolTip"));
this.BUT_Prefetch.UseVisualStyleBackColor = true;
this.BUT_Prefetch.Click += new System.EventHandler(this.BUT_Prefetch_Click);
//
// button1
//
resources.ApplyResources(this.button1, "button1");
@ -628,7 +589,6 @@
this.panelAction.CaptionFont = new System.Drawing.Font("Segoe UI", 11.75F, System.Drawing.FontStyle.Bold);
this.panelAction.CaptionHeight = 21;
this.panelAction.ColorScheme = BSE.Windows.Forms.ColorScheme.Custom;
this.panelAction.Controls.Add(this.textBox1);
this.panelAction.Controls.Add(this.panel5);
this.panelAction.Controls.Add(this.panel1);
this.panelAction.Controls.Add(this.panel2);
@ -720,15 +680,15 @@
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.deleteWPToolStripMenuItem,
this.setROIToolStripMenuItem,
this.loiterToolStripMenuItem,
this.jumpToolStripMenuItem,
this.createWpCircleToolStripMenuItem,
this.clearMissionToolStripMenuItem,
this.toolStripSeparator1,
this.ContextMeasure,
this.rotateMapToolStripMenuItem,
this.polygonToolStripMenuItem,
this.geoFenceToolStripMenuItem,
this.clearMissionToolStripMenuItem});
this.autoWPToolStripMenuItem,
this.mapToolToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
resources.ApplyResources(this.contextMenuStrip1, "contextMenuStrip1");
//
@ -738,6 +698,12 @@
resources.ApplyResources(this.deleteWPToolStripMenuItem, "deleteWPToolStripMenuItem");
this.deleteWPToolStripMenuItem.Click += new System.EventHandler(this.deleteWPToolStripMenuItem_Click);
//
// setROIToolStripMenuItem
//
this.setROIToolStripMenuItem.Name = "setROIToolStripMenuItem";
resources.ApplyResources(this.setROIToolStripMenuItem, "setROIToolStripMenuItem");
this.setROIToolStripMenuItem.Click += new System.EventHandler(this.setROIToolStripMenuItem_Click);
//
// loiterToolStripMenuItem
//
this.loiterToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -785,29 +751,17 @@
resources.ApplyResources(this.jumpwPToolStripMenuItem, "jumpwPToolStripMenuItem");
this.jumpwPToolStripMenuItem.Click += new System.EventHandler(this.jumpwPToolStripMenuItem_Click);
//
// createWpCircleToolStripMenuItem
// clearMissionToolStripMenuItem
//
this.createWpCircleToolStripMenuItem.Name = "createWpCircleToolStripMenuItem";
resources.ApplyResources(this.createWpCircleToolStripMenuItem, "createWpCircleToolStripMenuItem");
this.createWpCircleToolStripMenuItem.Click += new System.EventHandler(this.createWpCircleToolStripMenuItem_Click);
this.clearMissionToolStripMenuItem.Name = "clearMissionToolStripMenuItem";
resources.ApplyResources(this.clearMissionToolStripMenuItem, "clearMissionToolStripMenuItem");
this.clearMissionToolStripMenuItem.Click += new System.EventHandler(this.clearMissionToolStripMenuItem_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
//
// ContextMeasure
//
this.ContextMeasure.Name = "ContextMeasure";
resources.ApplyResources(this.ContextMeasure, "ContextMeasure");
this.ContextMeasure.Click += new System.EventHandler(this.ContextMeasure_Click);
//
// rotateMapToolStripMenuItem
//
this.rotateMapToolStripMenuItem.Name = "rotateMapToolStripMenuItem";
resources.ApplyResources(this.rotateMapToolStripMenuItem, "rotateMapToolStripMenuItem");
this.rotateMapToolStripMenuItem.Click += new System.EventHandler(this.rotateMapToolStripMenuItem_Click);
//
// polygonToolStripMenuItem
//
this.polygonToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -881,11 +835,63 @@
resources.ApplyResources(this.saveToFileToolStripMenuItem, "saveToFileToolStripMenuItem");
this.saveToFileToolStripMenuItem.Click += new System.EventHandler(this.saveToFileToolStripMenuItem_Click);
//
// clearMissionToolStripMenuItem
// autoWPToolStripMenuItem
//
this.clearMissionToolStripMenuItem.Name = "clearMissionToolStripMenuItem";
resources.ApplyResources(this.clearMissionToolStripMenuItem, "clearMissionToolStripMenuItem");
this.clearMissionToolStripMenuItem.Click += new System.EventHandler(this.clearMissionToolStripMenuItem_Click);
this.autoWPToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.createWpCircleToolStripMenuItem,
this.gridToolStripMenuItem});
this.autoWPToolStripMenuItem.Name = "autoWPToolStripMenuItem";
resources.ApplyResources(this.autoWPToolStripMenuItem, "autoWPToolStripMenuItem");
//
// createWpCircleToolStripMenuItem
//
this.createWpCircleToolStripMenuItem.Name = "createWpCircleToolStripMenuItem";
resources.ApplyResources(this.createWpCircleToolStripMenuItem, "createWpCircleToolStripMenuItem");
//
// gridToolStripMenuItem
//
this.gridToolStripMenuItem.Name = "gridToolStripMenuItem";
resources.ApplyResources(this.gridToolStripMenuItem, "gridToolStripMenuItem");
this.gridToolStripMenuItem.Click += new System.EventHandler(this.gridToolStripMenuItem_Click);
//
// mapToolToolStripMenuItem
//
this.mapToolToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ContextMeasure,
this.rotateMapToolStripMenuItem,
this.zoomToToolStripMenuItem,
this.prefetchToolStripMenuItem,
this.kMLOverlayToolStripMenuItem});
this.mapToolToolStripMenuItem.Name = "mapToolToolStripMenuItem";
resources.ApplyResources(this.mapToolToolStripMenuItem, "mapToolToolStripMenuItem");
//
// ContextMeasure
//
this.ContextMeasure.Name = "ContextMeasure";
resources.ApplyResources(this.ContextMeasure, "ContextMeasure");
//
// rotateMapToolStripMenuItem
//
this.rotateMapToolStripMenuItem.Name = "rotateMapToolStripMenuItem";
resources.ApplyResources(this.rotateMapToolStripMenuItem, "rotateMapToolStripMenuItem");
//
// zoomToToolStripMenuItem
//
this.zoomToToolStripMenuItem.Name = "zoomToToolStripMenuItem";
resources.ApplyResources(this.zoomToToolStripMenuItem, "zoomToToolStripMenuItem");
this.zoomToToolStripMenuItem.Click += new System.EventHandler(this.zoomToToolStripMenuItem_Click);
//
// prefetchToolStripMenuItem
//
this.prefetchToolStripMenuItem.Name = "prefetchToolStripMenuItem";
resources.ApplyResources(this.prefetchToolStripMenuItem, "prefetchToolStripMenuItem");
this.prefetchToolStripMenuItem.Click += new System.EventHandler(this.prefetchToolStripMenuItem_Click);
//
// kMLOverlayToolStripMenuItem
//
this.kMLOverlayToolStripMenuItem.Name = "kMLOverlayToolStripMenuItem";
resources.ApplyResources(this.kMLOverlayToolStripMenuItem, "kMLOverlayToolStripMenuItem");
this.kMLOverlayToolStripMenuItem.Click += new System.EventHandler(this.kMLOverlayToolStripMenuItem_Click);
//
// trackBar1
//
@ -928,7 +934,6 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.Control;
this.Controls.Add(this.panelBASE);
this.MinimumSize = new System.Drawing.Size(1008, 461);
this.Name = "FlightPlanner";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FlightPlanner_FormClosing);
this.Load += new System.EventHandler(this.Planner_Load);
@ -1003,12 +1008,8 @@
private BSE.Windows.Forms.Splitter splitter1;
private System.Windows.Forms.Panel panelBASE;
private System.Windows.Forms.Label lbl_homedist;
private ArdupilotMega.Controls.MyButton BUT_Prefetch;
private ArdupilotMega.Controls.MyButton BUT_grid;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem ContextMeasure;
private System.Windows.Forms.ToolTip toolTip1;
private System.Windows.Forms.ToolStripMenuItem rotateMapToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem clearMissionToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem polygonToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem addPolygonPointToolStripMenuItem;
@ -1034,8 +1035,6 @@
private System.Windows.Forms.DataGridViewButtonColumn Delete;
private System.Windows.Forms.DataGridViewImageColumn Up;
private System.Windows.Forms.DataGridViewImageColumn Down;
private ArdupilotMega.Controls.MyButton BUT_zoomto;
private ArdupilotMega.Controls.MyButton BUT_loadkml;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.ToolStripMenuItem geoFenceToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem GeoFencedownloadToolStripMenuItem;
@ -1045,6 +1044,15 @@
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem GeoFenceuploadToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
private System.Windows.Forms.ToolStripMenuItem setROIToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem autoWPToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem createWpCircleToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem gridToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem mapToolToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ContextMeasure;
private System.Windows.Forms.ToolStripMenuItem rotateMapToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem zoomToToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem prefetchToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem kMLOverlayToolStripMenuItem;
}
}

View File

@ -40,7 +40,6 @@ namespace ArdupilotMega.GCSViews
public static List<PointLatLngAlt> pointlist = new List<PointLatLngAlt>(); // used to calc distance
static public Object thisLock = new Object();
private TextBox textBox1;
private ComponentResourceManager rm = new ComponentResourceManager(typeof(FlightPlanner));
private Dictionary<string, string[]> cmdParamNames = new Dictionary<string, string[]>();
@ -1420,7 +1419,11 @@ namespace ArdupilotMega.GCSViews
temp.p3 = (float)(double.Parse(Commands.Rows[a].Cells[Param3.Index].Value.ToString()));
temp.p4 = (float)(double.Parse(Commands.Rows[a].Cells[Param4.Index].Value.ToString()));
port.setWP(temp, (ushort)(a + 1), frame, 0);
MAVLink.MAV_MISSION_RESULT ans = port.setWP(temp, (ushort)(a + 1), frame, 0);
if (ans != MAVLink.MAV_MISSION_RESULT.MAV_MISSION_ACCEPTED)
{
throw new Exception("Upload WPs Failed " + Commands.Rows[a].Cells[Command.Index].Value.ToString() + " " + Enum.Parse(typeof(MAVLink.MAV_MISSION_RESULT), ans.ToString()));
}
}
port.setWPACK();
@ -2434,42 +2437,7 @@ namespace ArdupilotMega.GCSViews
private void BUT_Prefetch_Click(object sender, EventArgs e)
{
RectLatLng area = MainMap.SelectedArea;
if (area.IsEmpty)
{
DialogResult res = CustomMessageBox.Show("No ripp area defined, ripp displayed on screen?", "Rip", MessageBoxButtons.YesNo);
if (res == DialogResult.Yes)
{
area = MainMap.CurrentViewArea;
}
}
if (!area.IsEmpty)
{
DialogResult res = CustomMessageBox.Show("Ready ripp at Zoom = " + (int)MainMap.Zoom + " ?", "GMap.NET", MessageBoxButtons.YesNo);
for (int i = 1; i <= MainMap.MaxZoom; i++)
{
if (res == DialogResult.Yes)
{
TilePrefetcher obj = new TilePrefetcher();
obj.ShowCompleteMessage = false;
obj.Start(area, MainMap.Projection, i, MainMap.MapType, 100);
}
else if (res == DialogResult.No)
{
continue;
}
else if (res == DialogResult.Cancel)
{
break;
}
}
}
else
{
CustomMessageBox.Show("Select map area holding ALT", "GMap.NET", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
/// <summary>
@ -2527,232 +2495,7 @@ namespace ArdupilotMega.GCSViews
private void BUT_grid_Click(object sender, EventArgs e)
{
polygongridmode = false;
if (drawnpolygon == null || drawnpolygon.Points.Count == 0)
{
CustomMessageBox.Show("Right click the map to draw a polygon", "Area", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
// ensure points/latlong are current
MainMap.Zoom = (int)MainMap.Zoom;
MainMap.Refresh();
GMapPolygon area = drawnpolygon;
area.Points.Add(area.Points[0]); // make a full loop
RectLatLng arearect = getPolyMinMax(area);
if (area.Distance > 0)
{
PointLatLng topright = new PointLatLng(arearect.LocationTopLeft.Lat, arearect.LocationRightBottom.Lng);
PointLatLng bottomleft = new PointLatLng(arearect.LocationRightBottom.Lat, arearect.LocationTopLeft.Lng);
double diagdist = MainMap.Manager.GetDistance(arearect.LocationTopLeft, arearect.LocationRightBottom) * 1000;
double heightdist = MainMap.Manager.GetDistance(arearect.LocationTopLeft, bottomleft) * 1000;
double widthdist = MainMap.Manager.GetDistance(arearect.LocationTopLeft, topright) * 1000;
string alt = (100 * MainV2.cs.multiplierdist).ToString("0");
Common.InputBox("Altitude", "Relative Altitude", ref alt);
string distance = (50 * MainV2.cs.multiplierdist).ToString("0");
Common.InputBox("Distance", "Distance between lines", ref distance);
//string overshoot = (30 * MainV2.cs.multiplierdist).ToString("0");
//Common.InputBox("Overshoot", "Enter of line overshoot amount", ref overshoot);
string angle = (90).ToString("0");
Common.InputBox("Angle", "Enter the line direction (0-180)", ref angle);
double tryme = 0;
if (!double.TryParse(angle, out tryme))
{
CustomMessageBox.Show("Invalid Angle");
return;
}
if (!double.TryParse(alt, out tryme))
{
CustomMessageBox.Show("Invalid Alt");
return;
}
if (!double.TryParse(distance, out tryme))
{
CustomMessageBox.Show("Invalid Distance");
return;
}
#if DEBUG
//Commands.Rows.Clear();
#endif
// get x y components
double x1 = Math.Cos((double.Parse(angle)) * deg2rad); // needs to mod for long scale
double y1 = Math.Sin((double.Parse(angle)) * deg2rad);
// get x y step amount in lat lng from m
double latdiff = arearect.HeightLat / ((heightdist / (double.Parse(distance) * (y1) / MainV2.cs.multiplierdist)));
double lngdiff = arearect.WidthLng / ((widthdist / (double.Parse(distance) * (x1) / MainV2.cs.multiplierdist)));
double latlngdiff = Math.Sqrt(latdiff * latdiff + lngdiff * lngdiff);
double fulllatdiff = arearect.HeightLat * x1 * 2;
double fulllngdiff = arearect.WidthLng * y1 * 2;
// lat - up down
// lng - left right
int overshootdist = 0;// (int)(double.Parse(overshoot) / MainV2.cs.multiplierdist);
int altitude = (int)(double.Parse(alt) / MainV2.cs.multiplierdist);
double overshootdistlng = arearect.WidthLng / widthdist * overshootdist;
bool dir = false;
int count = 0;
double x = bottomleft.Lat - Math.Abs(fulllatdiff);
double y = bottomleft.Lng - Math.Abs(fulllngdiff);
log.InfoFormat("{0} < {1} {2} < {3}", x, (topright.Lat), y, (topright.Lng));
while (x < (topright.Lat + Math.Abs(fulllatdiff)) && y < (topright.Lng + Math.Abs(fulllngdiff)))
{
if (double.Parse(angle) < 45)
{
x = bottomleft.Lat;
y += latlngdiff;
}
else if (double.Parse(angle) > 135)
{
x = arearect.LocationTopLeft.Lat; //arearect.LocationTopLeft.Lat;
y += latlngdiff;
}
else if (double.Parse(angle) > 90)
{
y = bottomleft.Lng; //arearect.LocationTopLeft.Lat;
x += latlngdiff;
}
else
{
y = bottomleft.Lng;
x += latlngdiff;
}
//callMe(x , y, 0);
//callMe(x + (fulllatdiff), y + (fulllngdiff), 0);
//continue;
PointLatLng closestlatlong = PointLatLng.Zero;
PointLatLng farestlatlong = PointLatLng.Zero;
double noc = double.MaxValue;
double nof = double.MinValue;
if (dir)
{
double ax = x;
double ay = y;
double bx = x + fulllatdiff;
double by = y + fulllngdiff;
int a = -1;
PointLatLng newlatlong = PointLatLng.Zero;
foreach (PointLatLng pnt in area.Points)
{
a++;
if (a == 0)
{
continue;
}
newlatlong = FindLineIntersection(area.Points[a - 1], area.Points[a], new PointLatLng(ax, ay), new PointLatLng(bx, by));
if (!newlatlong.IsZero)
{
if (noc > MainMap.Manager.GetDistance(new PointLatLng(ax, ay), newlatlong))
{
closestlatlong.Lat = newlatlong.Lat;
closestlatlong.Lng = newlatlong.Lng;
noc = MainMap.Manager.GetDistance(new PointLatLng(ax, ay), newlatlong);
}
if (nof < MainMap.Manager.GetDistance(new PointLatLng(ax, ay), newlatlong))
{
farestlatlong.Lat = newlatlong.Lat;
farestlatlong.Lng = newlatlong.Lng;
nof = MainMap.Manager.GetDistance(new PointLatLng(ax, ay), newlatlong);
}
}
}
if (!farestlatlong.IsZero)
callMe(farestlatlong.Lat, farestlatlong.Lng, altitude);
if (!closestlatlong.IsZero)
callMe(closestlatlong.Lat, closestlatlong.Lng - overshootdistlng, altitude);
//callMe(x, topright.Lng, altitude);
//callMe(x, bottomleft.Lng - overshootdistlng, altitude);
}
else
{
double ax = x;
double ay = y;
double bx = x + fulllatdiff;
double by = y + fulllngdiff;
int a = -1;
PointLatLng newlatlong = PointLatLng.Zero;
foreach (PointLatLng pnt in area.Points)
{
a++;
if (a == 0)
{
continue;
}
newlatlong = FindLineIntersection(area.Points[a - 1], area.Points[a], new PointLatLng(ax, ay), new PointLatLng(bx, by));
if (!newlatlong.IsZero)
{
if (noc > MainMap.Manager.GetDistance(new PointLatLng(ax, ay), newlatlong))
{
closestlatlong.Lat = newlatlong.Lat;
closestlatlong.Lng = newlatlong.Lng;
noc = MainMap.Manager.GetDistance(new PointLatLng(ax, ay), newlatlong);
}
if (nof < MainMap.Manager.GetDistance(new PointLatLng(ax, ay), newlatlong))
{
farestlatlong.Lat = newlatlong.Lat;
farestlatlong.Lng = newlatlong.Lng;
nof = MainMap.Manager.GetDistance(new PointLatLng(ax, ay), newlatlong);
}
}
}
if (!closestlatlong.IsZero)
callMe(closestlatlong.Lat, closestlatlong.Lng, altitude);
if (!farestlatlong.IsZero)
callMe(farestlatlong.Lat, farestlatlong.Lng + overshootdistlng, altitude);
//callMe(x, bottomleft.Lng, altitude);
//callMe(x, topright.Lng + overshootdistlng, altitude);
}
dir = !dir;
count++;
if (Commands.RowCount > 150)
{
CustomMessageBox.Show("Stopping at 150 WP's");
break;
}
}
//drawnpolygon.Points.Clear();
//drawnpolygons.Markers.Clear();
MainMap.Refresh();
}
}
private void label4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
@ -3027,64 +2770,12 @@ namespace ArdupilotMega.GCSViews
private void BUT_zoomto_Click(object sender, EventArgs e)
{
string place = "Perth Airport, Australia";
if (DialogResult.OK == Common.InputBox("Location", "Enter your location", ref place))
{
GeoCoderStatusCode status = MainMap.SetCurrentPositionByKeywords(place);
if (status != GeoCoderStatusCode.G_GEO_SUCCESS)
{
CustomMessageBox.Show("Google Maps Geocoder can't find: '" + place + "', reason: " + status.ToString(), "GMap.NET", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
else
{
MainMap.Zoom = 15;
}
}
}
private void BUT_loadkml_Click(object sender, EventArgs e)
{
OpenFileDialog fd = new OpenFileDialog();
fd.Filter = "Google Earth KML (*.kml)|*.kml";
fd.DefaultExt = ".kml";
DialogResult result = fd.ShowDialog();
string file = fd.FileName;
if (file != "")
{
try
{
kmlpolygons.Polygons.Clear();
kmlpolygons.Routes.Clear();
FlightData.kmlpolygons.Routes.Clear();
FlightData.kmlpolygons.Polygons.Clear();
string kml = new StreamReader(File.OpenRead(file)).ReadToEnd();
kml = kml.Replace("<Snippet/>", "");
var parser = new SharpKml.Base.Parser();
parser.ElementAdded += parser_ElementAdded;
parser.ParseString(kml, true);
if (DialogResult.Yes == CustomMessageBox.Show("Do you want to load this into the flight data screen?", "Load data", MessageBoxButtons.YesNo))
{
foreach (var temp in kmlpolygons.Polygons)
{
FlightData.kmlpolygons.Polygons.Add(temp);
}
foreach (var temp in kmlpolygons.Routes)
{
FlightData.kmlpolygons.Routes.Add(temp);
}
}
}
catch (Exception ex) { CustomMessageBox.Show("Bad KML File :" + ex.ToString()); }
}
}
@ -3502,5 +3193,352 @@ namespace ArdupilotMega.GCSViews
{
timer1.Stop();
}
private void setROIToolStripMenuItem_Click(object sender, EventArgs e)
{
selectedrow = Commands.Rows.Add();
Commands.Rows[selectedrow].Cells[Command.Index].Value = MAVLink.MAV_CMD.ROI.ToString();
//Commands.Rows[selectedrow].Cells[Param1.Index].Value = time;
ChangeColumnHeader(MAVLink.MAV_CMD.ROI.ToString());
setfromGE(end.Lat, end.Lng, (int)float.Parse(TXT_DefaultAlt.Text));
writeKML();
}
private void gridToolStripMenuItem_Click(object sender, EventArgs e)
{
polygongridmode = false;
if (drawnpolygon == null || drawnpolygon.Points.Count == 0)
{
CustomMessageBox.Show("Right click the map to draw a polygon", "Area", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
// ensure points/latlong are current
MainMap.Zoom = (int)MainMap.Zoom;
MainMap.Refresh();
GMapPolygon area = drawnpolygon;
area.Points.Add(area.Points[0]); // make a full loop
RectLatLng arearect = getPolyMinMax(area);
if (area.Distance > 0)
{
PointLatLng topright = new PointLatLng(arearect.LocationTopLeft.Lat, arearect.LocationRightBottom.Lng);
PointLatLng bottomleft = new PointLatLng(arearect.LocationRightBottom.Lat, arearect.LocationTopLeft.Lng);
double diagdist = MainMap.Manager.GetDistance(arearect.LocationTopLeft, arearect.LocationRightBottom) * 1000;
double heightdist = MainMap.Manager.GetDistance(arearect.LocationTopLeft, bottomleft) * 1000;
double widthdist = MainMap.Manager.GetDistance(arearect.LocationTopLeft, topright) * 1000;
string alt = (100 * MainV2.cs.multiplierdist).ToString("0");
Common.InputBox("Altitude", "Relative Altitude", ref alt);
string distance = (50 * MainV2.cs.multiplierdist).ToString("0");
Common.InputBox("Distance", "Distance between lines", ref distance);
//string overshoot = (30 * MainV2.cs.multiplierdist).ToString("0");
//Common.InputBox("Overshoot", "Enter of line overshoot amount", ref overshoot);
string angle = (90).ToString("0");
Common.InputBox("Angle", "Enter the line direction (0-180)", ref angle);
double tryme = 0;
if (!double.TryParse(angle, out tryme))
{
CustomMessageBox.Show("Invalid Angle");
return;
}
if (!double.TryParse(alt, out tryme))
{
CustomMessageBox.Show("Invalid Alt");
return;
}
if (!double.TryParse(distance, out tryme))
{
CustomMessageBox.Show("Invalid Distance");
return;
}
#if DEBUG
//Commands.Rows.Clear();
#endif
// get x y components
double x1 = Math.Cos((double.Parse(angle)) * deg2rad); // needs to mod for long scale
double y1 = Math.Sin((double.Parse(angle)) * deg2rad);
// get x y step amount in lat lng from m
double latdiff = arearect.HeightLat / ((heightdist / (double.Parse(distance) * (y1) / MainV2.cs.multiplierdist)));
double lngdiff = arearect.WidthLng / ((widthdist / (double.Parse(distance) * (x1) / MainV2.cs.multiplierdist)));
double latlngdiff = Math.Sqrt(latdiff * latdiff + lngdiff * lngdiff);
double fulllatdiff = arearect.HeightLat * x1 * 2;
double fulllngdiff = arearect.WidthLng * y1 * 2;
// lat - up down
// lng - left right
int overshootdist = 0;// (int)(double.Parse(overshoot) / MainV2.cs.multiplierdist);
int altitude = (int)(double.Parse(alt) / MainV2.cs.multiplierdist);
double overshootdistlng = arearect.WidthLng / widthdist * overshootdist;
bool dir = false;
int count = 0;
double x = bottomleft.Lat - Math.Abs(fulllatdiff);
double y = bottomleft.Lng - Math.Abs(fulllngdiff);
log.InfoFormat("{0} < {1} {2} < {3}", x, (topright.Lat), y, (topright.Lng));
while (x < (topright.Lat + Math.Abs(fulllatdiff)) && y < (topright.Lng + Math.Abs(fulllngdiff)))
{
if (double.Parse(angle) < 45)
{
x = bottomleft.Lat;
y += latlngdiff;
}
else if (double.Parse(angle) > 135)
{
x = arearect.LocationTopLeft.Lat; //arearect.LocationTopLeft.Lat;
y += latlngdiff;
}
else if (double.Parse(angle) > 90)
{
y = bottomleft.Lng; //arearect.LocationTopLeft.Lat;
x += latlngdiff;
}
else
{
y = bottomleft.Lng;
x += latlngdiff;
}
//callMe(x , y, 0);
//callMe(x + (fulllatdiff), y + (fulllngdiff), 0);
//continue;
PointLatLng closestlatlong = PointLatLng.Zero;
PointLatLng farestlatlong = PointLatLng.Zero;
double noc = double.MaxValue;
double nof = double.MinValue;
if (dir)
{
double ax = x;
double ay = y;
double bx = x + fulllatdiff;
double by = y + fulllngdiff;
int a = -1;
PointLatLng newlatlong = PointLatLng.Zero;
foreach (PointLatLng pnt in area.Points)
{
a++;
if (a == 0)
{
continue;
}
newlatlong = FindLineIntersection(area.Points[a - 1], area.Points[a], new PointLatLng(ax, ay), new PointLatLng(bx, by));
if (!newlatlong.IsZero)
{
if (noc > MainMap.Manager.GetDistance(new PointLatLng(ax, ay), newlatlong))
{
closestlatlong.Lat = newlatlong.Lat;
closestlatlong.Lng = newlatlong.Lng;
noc = MainMap.Manager.GetDistance(new PointLatLng(ax, ay), newlatlong);
}
if (nof < MainMap.Manager.GetDistance(new PointLatLng(ax, ay), newlatlong))
{
farestlatlong.Lat = newlatlong.Lat;
farestlatlong.Lng = newlatlong.Lng;
nof = MainMap.Manager.GetDistance(new PointLatLng(ax, ay), newlatlong);
}
}
}
if (!farestlatlong.IsZero)
callMe(farestlatlong.Lat, farestlatlong.Lng, altitude);
if (!closestlatlong.IsZero)
callMe(closestlatlong.Lat, closestlatlong.Lng - overshootdistlng, altitude);
//callMe(x, topright.Lng, altitude);
//callMe(x, bottomleft.Lng - overshootdistlng, altitude);
}
else
{
double ax = x;
double ay = y;
double bx = x + fulllatdiff;
double by = y + fulllngdiff;
int a = -1;
PointLatLng newlatlong = PointLatLng.Zero;
foreach (PointLatLng pnt in area.Points)
{
a++;
if (a == 0)
{
continue;
}
newlatlong = FindLineIntersection(area.Points[a - 1], area.Points[a], new PointLatLng(ax, ay), new PointLatLng(bx, by));
if (!newlatlong.IsZero)
{
if (noc > MainMap.Manager.GetDistance(new PointLatLng(ax, ay), newlatlong))
{
closestlatlong.Lat = newlatlong.Lat;
closestlatlong.Lng = newlatlong.Lng;
noc = MainMap.Manager.GetDistance(new PointLatLng(ax, ay), newlatlong);
}
if (nof < MainMap.Manager.GetDistance(new PointLatLng(ax, ay), newlatlong))
{
farestlatlong.Lat = newlatlong.Lat;
farestlatlong.Lng = newlatlong.Lng;
nof = MainMap.Manager.GetDistance(new PointLatLng(ax, ay), newlatlong);
}
}
}
if (!closestlatlong.IsZero)
callMe(closestlatlong.Lat, closestlatlong.Lng, altitude);
if (!farestlatlong.IsZero)
callMe(farestlatlong.Lat, farestlatlong.Lng + overshootdistlng, altitude);
//callMe(x, bottomleft.Lng, altitude);
//callMe(x, topright.Lng + overshootdistlng, altitude);
}
dir = !dir;
count++;
if (Commands.RowCount > 150)
{
CustomMessageBox.Show("Stopping at 150 WP's");
break;
}
}
//drawnpolygon.Points.Clear();
//drawnpolygons.Markers.Clear();
MainMap.Refresh();
}
}
private void zoomToToolStripMenuItem_Click(object sender, EventArgs e)
{
string place = "Perth Airport, Australia";
if (DialogResult.OK == Common.InputBox("Location", "Enter your location", ref place))
{
GeoCoderStatusCode status = MainMap.SetCurrentPositionByKeywords(place);
if (status != GeoCoderStatusCode.G_GEO_SUCCESS)
{
CustomMessageBox.Show("Google Maps Geocoder can't find: '" + place + "', reason: " + status.ToString(), "GMap.NET", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
else
{
MainMap.Zoom = 15;
}
}
}
private void prefetchToolStripMenuItem_Click(object sender, EventArgs e)
{
RectLatLng area = MainMap.SelectedArea;
if (area.IsEmpty)
{
DialogResult res = CustomMessageBox.Show("No ripp area defined, ripp displayed on screen?", "Rip", MessageBoxButtons.YesNo);
if (res == DialogResult.Yes)
{
area = MainMap.CurrentViewArea;
}
}
if (!area.IsEmpty)
{
DialogResult res = CustomMessageBox.Show("Ready ripp at Zoom = " + (int)MainMap.Zoom + " ?", "GMap.NET", MessageBoxButtons.YesNo);
for (int i = 1; i <= MainMap.MaxZoom; i++)
{
if (res == DialogResult.Yes)
{
TilePrefetcher obj = new TilePrefetcher();
obj.ShowCompleteMessage = false;
obj.Start(area, MainMap.Projection, i, MainMap.MapType, 100);
}
else if (res == DialogResult.No)
{
continue;
}
else if (res == DialogResult.Cancel)
{
break;
}
}
}
else
{
CustomMessageBox.Show("Select map area holding ALT", "GMap.NET", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
private void kMLOverlayToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog fd = new OpenFileDialog();
fd.Filter = "Google Earth KML (*.kml)|*.kml";
fd.DefaultExt = ".kml";
DialogResult result = fd.ShowDialog();
string file = fd.FileName;
if (file != "")
{
try
{
kmlpolygons.Polygons.Clear();
kmlpolygons.Routes.Clear();
FlightData.kmlpolygons.Routes.Clear();
FlightData.kmlpolygons.Polygons.Clear();
string kml = new StreamReader(File.OpenRead(file)).ReadToEnd();
kml = kml.Replace("<Snippet/>", "");
var parser = new SharpKml.Base.Parser();
parser.ElementAdded += parser_ElementAdded;
parser.ParseString(kml, true);
if (DialogResult.Yes == CustomMessageBox.Show("Do you want to load this into the flight data screen?", "Load data", MessageBoxButtons.YesNo))
{
foreach (var temp in kmlpolygons.Polygons)
{
FlightData.kmlpolygons.Polygons.Add(temp);
}
foreach (var temp in kmlpolygons.Routes)
{
FlightData.kmlpolygons.Routes.Add(temp);
}
}
}
catch (Exception ex) { CustomMessageBox.Show("Bad KML File :" + ex.ToString()); }
}
}
}
}

View File

@ -148,7 +148,7 @@
<value>panelWaypoints</value>
</data>
<data name="&gt;&gt;CHK_altmode.ZOrder" xml:space="preserve">
<value>5</value>
<value>1</value>
</data>
<data name="CHK_holdalt.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -178,7 +178,7 @@
<value>panelWaypoints</value>
</data>
<data name="&gt;&gt;CHK_holdalt.ZOrder" xml:space="preserve">
<value>10</value>
<value>6</value>
</data>
<data name="Commands.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Bottom, Left, Right</value>
@ -322,10 +322,10 @@
<value>10, 55</value>
</data>
<data name="Commands.RowHeadersWidth" type="System.Int32, mscorlib">
<value>75</value>
<value>35</value>
</data>
<data name="Commands.Size" type="System.Drawing.Size, System.Drawing">
<value>862, 89</value>
<value>601, 89</value>
</data>
<data name="Commands.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
@ -340,7 +340,7 @@
<value>panelWaypoints</value>
</data>
<data name="&gt;&gt;Commands.ZOrder" xml:space="preserve">
<value>12</value>
<value>8</value>
</data>
<data name="CHK_geheight.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -370,7 +370,7 @@
<value>panelWaypoints</value>
</data>
<data name="&gt;&gt;CHK_geheight.ZOrder" xml:space="preserve">
<value>14</value>
<value>10</value>
</data>
<data name="TXT_WPRad.Location" type="System.Drawing.Point, System.Drawing">
<value>23, 36</value>
@ -394,7 +394,7 @@
<value>panelWaypoints</value>
</data>
<data name="&gt;&gt;TXT_WPRad.ZOrder" xml:space="preserve">
<value>15</value>
<value>11</value>
</data>
<data name="TXT_DefaultAlt.Location" type="System.Drawing.Point, System.Drawing">
<value>154, 36</value>
@ -418,7 +418,7 @@
<value>panelWaypoints</value>
</data>
<data name="&gt;&gt;TXT_DefaultAlt.ZOrder" xml:space="preserve">
<value>13</value>
<value>9</value>
</data>
<data name="LBL_WPRad.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -448,7 +448,7 @@
<value>panelWaypoints</value>
</data>
<data name="&gt;&gt;LBL_WPRad.ZOrder" xml:space="preserve">
<value>6</value>
<value>2</value>
</data>
<data name="LBL_defalutalt.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -478,7 +478,7 @@
<value>panelWaypoints</value>
</data>
<data name="&gt;&gt;LBL_defalutalt.ZOrder" xml:space="preserve">
<value>11</value>
<value>7</value>
</data>
<data name="TXT_loiterrad.Location" type="System.Drawing.Point, System.Drawing">
<value>89, 36</value>
@ -502,7 +502,7 @@
<value>panelWaypoints</value>
</data>
<data name="&gt;&gt;TXT_loiterrad.ZOrder" xml:space="preserve">
<value>9</value>
<value>5</value>
</data>
<data name="label5.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -532,7 +532,7 @@
<value>panelWaypoints</value>
</data>
<data name="&gt;&gt;label5.ZOrder" xml:space="preserve">
<value>8</value>
<value>4</value>
</data>
<data name="panel5.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Bottom, Right</value>
@ -556,7 +556,7 @@
<value>BUT_write</value>
</data>
<data name="&gt;&gt;BUT_write.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4606.25609, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_write.Parent" xml:space="preserve">
<value>panel5</value>
@ -583,7 +583,7 @@
<value>BUT_read</value>
</data>
<data name="&gt;&gt;BUT_read.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4606.25609, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_read.Parent" xml:space="preserve">
<value>panel5</value>
@ -610,7 +610,7 @@
<value>SaveFile</value>
</data>
<data name="&gt;&gt;SaveFile.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4606.25609, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;SaveFile.Parent" xml:space="preserve">
<value>panel5</value>
@ -637,7 +637,7 @@
<value>BUT_loadwpfile</value>
</data>
<data name="&gt;&gt;BUT_loadwpfile.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4606.25609, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_loadwpfile.Parent" xml:space="preserve">
<value>panel5</value>
@ -664,7 +664,7 @@
<value>panelAction</value>
</data>
<data name="&gt;&gt;panel5.ZOrder" xml:space="preserve">
<value>1</value>
<value>0</value>
</data>
<data name="panel1.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Bottom, Right</value>
@ -871,7 +871,7 @@
<value>panelAction</value>
</data>
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<value>2</value>
<value>1</value>
</data>
<data name="dataGridViewImageColumn1.HeaderText" xml:space="preserve">
<value>Up</value>
@ -1114,7 +1114,7 @@
<value>panelAction</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>3</value>
<value>2</value>
</data>
<data name="comboBoxMapType.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Bottom, Right</value>
@ -1144,7 +1144,7 @@
<value>panelAction</value>
</data>
<data name="&gt;&gt;comboBoxMapType.ZOrder" xml:space="preserve">
<value>4</value>
<value>3</value>
</data>
<data name="lbl_status.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Bottom, Right</value>
@ -1177,40 +1177,7 @@
<value>panelAction</value>
</data>
<data name="&gt;&gt;lbl_status.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="textBox1.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Bottom, Right</value>
</data>
<data name="textBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>7, 25</value>
</data>
<data name="textBox1.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="textBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>117, 103</value>
</data>
<data name="textBox1.TabIndex" type="System.Int32, mscorlib">
<value>48</value>
</data>
<data name="textBox1.Text" xml:space="preserve">
<value>1. Connect
2. Read WP's if you need to.
3. Ensure your Home location and ALT is set
4. Click on the map to start adding WP's</value>
</data>
<data name="&gt;&gt;textBox1.Name" xml:space="preserve">
<value>textBox1</value>
</data>
<data name="&gt;&gt;textBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;textBox1.Parent" xml:space="preserve">
<value>panelAction</value>
</data>
<data name="&gt;&gt;textBox1.ZOrder" xml:space="preserve">
<value>0</value>
<value>4</value>
</data>
<data name="splitter1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
@ -1222,7 +1189,7 @@
<value>0, 310</value>
</data>
<data name="splitter1.Size" type="System.Drawing.Size, System.Drawing">
<value>878, 3</value>
<value>617, 3</value>
</data>
<data name="splitter1.TabIndex" type="System.Int32, mscorlib">
<value>50</value>
@ -1239,71 +1206,14 @@
<data name="&gt;&gt;splitter1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="BUT_loadkml.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="BUT_loadkml.Location" type="System.Drawing.Point, System.Drawing">
<value>800, 25</value>
</data>
<data name="BUT_loadkml.Size" type="System.Drawing.Size, System.Drawing">
<value>58, 23</value>
</data>
<data name="BUT_loadkml.TabIndex" type="System.Int32, mscorlib">
<value>54</value>
</data>
<data name="BUT_loadkml.Text" xml:space="preserve">
<value>KML overlay</value>
</data>
<data name="BUT_loadkml.ToolTip" xml:space="preserve">
<value>Get Camera settings for overlap</value>
</data>
<data name="&gt;&gt;BUT_loadkml.Name" xml:space="preserve">
<value>BUT_loadkml</value>
</data>
<data name="&gt;&gt;BUT_loadkml.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_loadkml.Parent" xml:space="preserve">
<value>panelWaypoints</value>
</data>
<data name="&gt;&gt;BUT_loadkml.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="BUT_zoomto.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="BUT_zoomto.Location" type="System.Drawing.Point, System.Drawing">
<value>732, 26</value>
</data>
<data name="BUT_zoomto.Size" type="System.Drawing.Size, System.Drawing">
<value>62, 23</value>
</data>
<data name="BUT_zoomto.TabIndex" type="System.Int32, mscorlib">
<value>53</value>
</data>
<data name="BUT_zoomto.Text" xml:space="preserve">
<value>Zoom To</value>
</data>
<data name="BUT_zoomto.ToolTip" xml:space="preserve">
<value>Get Camera settings for overlap</value>
</data>
<data name="&gt;&gt;BUT_zoomto.Name" xml:space="preserve">
<value>BUT_zoomto</value>
</data>
<data name="&gt;&gt;BUT_zoomto.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_zoomto.Parent" xml:space="preserve">
<value>panelWaypoints</value>
</data>
<data name="&gt;&gt;BUT_zoomto.ZOrder" xml:space="preserve">
<value>1</value>
<data name="panelWaypoints.AutoScroll" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="BUT_Camera.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="BUT_Camera.Location" type="System.Drawing.Point, System.Drawing">
<value>678, 26</value>
<value>562, 26</value>
</data>
<data name="BUT_Camera.Size" type="System.Drawing.Size, System.Drawing">
<value>48, 23</value>
@ -1321,73 +1231,13 @@
<value>BUT_Camera</value>
</data>
<data name="&gt;&gt;BUT_Camera.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4606.25609, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_Camera.Parent" xml:space="preserve">
<value>panelWaypoints</value>
</data>
<data name="&gt;&gt;BUT_Camera.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="BUT_grid.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="BUT_grid.Location" type="System.Drawing.Point, System.Drawing">
<value>624, 26</value>
</data>
<data name="BUT_grid.Size" type="System.Drawing.Size, System.Drawing">
<value>48, 23</value>
</data>
<data name="BUT_grid.TabIndex" type="System.Int32, mscorlib">
<value>51</value>
</data>
<data name="BUT_grid.Text" xml:space="preserve">
<value>Grid</value>
</data>
<data name="BUT_grid.ToolTip" xml:space="preserve">
<value>Draws a grid over a pre defined area with a given spacing</value>
</data>
<data name="&gt;&gt;BUT_grid.Name" xml:space="preserve">
<value>BUT_grid</value>
</data>
<data name="&gt;&gt;BUT_grid.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_grid.Parent" xml:space="preserve">
<value>panelWaypoints</value>
</data>
<data name="&gt;&gt;BUT_grid.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="BUT_Prefetch.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="BUT_Prefetch.Location" type="System.Drawing.Point, System.Drawing">
<value>562, 26</value>
</data>
<data name="BUT_Prefetch.Size" type="System.Drawing.Size, System.Drawing">
<value>56, 23</value>
</data>
<data name="BUT_Prefetch.TabIndex" type="System.Int32, mscorlib">
<value>50</value>
</data>
<data name="BUT_Prefetch.Text" xml:space="preserve">
<value>Prefetch</value>
</data>
<data name="BUT_Prefetch.ToolTip" xml:space="preserve">
<value>Pre Caches a part of the map based on a box you draw</value>
</data>
<data name="&gt;&gt;BUT_Prefetch.Name" xml:space="preserve">
<value>BUT_Prefetch</value>
</data>
<data name="&gt;&gt;BUT_Prefetch.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_Prefetch.Parent" xml:space="preserve">
<value>panelWaypoints</value>
</data>
<data name="&gt;&gt;BUT_Prefetch.ZOrder" xml:space="preserve">
<value>4</value>
<value>0</value>
</data>
<data name="button1.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -1411,13 +1261,13 @@
<value>button1</value>
</data>
<data name="&gt;&gt;button1.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4606.25609, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;button1.Parent" xml:space="preserve">
<value>panelWaypoints</value>
</data>
<data name="&gt;&gt;button1.ZOrder" xml:space="preserve">
<value>7</value>
<value>3</value>
</data>
<data name="BUT_Add.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -1441,13 +1291,13 @@
<value>BUT_Add</value>
</data>
<data name="&gt;&gt;BUT_Add.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4606.25609, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_Add.Parent" xml:space="preserve">
<value>panelWaypoints</value>
</data>
<data name="&gt;&gt;BUT_Add.ZOrder" xml:space="preserve">
<value>16</value>
<value>12</value>
</data>
<data name="panelWaypoints.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
@ -1456,7 +1306,7 @@
<value>0, 313</value>
</data>
<data name="panelWaypoints.Size" type="System.Drawing.Size, System.Drawing">
<value>878, 148</value>
<value>617, 148</value>
</data>
<data name="panelWaypoints.TabIndex" type="System.Int32, mscorlib">
<value>49</value>
@ -1480,7 +1330,7 @@
<value>Right</value>
</data>
<data name="panelAction.Location" type="System.Drawing.Point, System.Drawing">
<value>878, 0</value>
<value>617, 0</value>
</data>
<data name="panelAction.Size" type="System.Drawing.Size, System.Drawing">
<value>130, 461</value>
@ -1600,11 +1450,17 @@
<value>17, 17</value>
</metadata>
<data name="deleteWPToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>167, 22</value>
<value>148, 22</value>
</data>
<data name="deleteWPToolStripMenuItem.Text" xml:space="preserve">
<value>Delete WP</value>
</data>
<data name="setROIToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>148, 22</value>
</data>
<data name="setROIToolStripMenuItem.Text" xml:space="preserve">
<value>Set ROI</value>
</data>
<data name="loiterForeverToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>113, 22</value>
</data>
@ -1624,7 +1480,7 @@
<value>Circles</value>
</data>
<data name="loiterToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>167, 22</value>
<value>148, 22</value>
</data>
<data name="loiterToolStripMenuItem.Text" xml:space="preserve">
<value>Loiter</value>
@ -1642,31 +1498,19 @@
<value>WP #</value>
</data>
<data name="jumpToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>167, 22</value>
<value>148, 22</value>
</data>
<data name="jumpToolStripMenuItem.Text" xml:space="preserve">
<value>Jump</value>
</data>
<data name="createWpCircleToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>167, 22</value>
<data name="clearMissionToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>148, 22</value>
</data>
<data name="createWpCircleToolStripMenuItem.Text" xml:space="preserve">
<value>Create Wp Circle</value>
<data name="clearMissionToolStripMenuItem.Text" xml:space="preserve">
<value>Clear Mission</value>
</data>
<data name="toolStripSeparator1.Size" type="System.Drawing.Size, System.Drawing">
<value>164, 6</value>
</data>
<data name="ContextMeasure.Size" type="System.Drawing.Size, System.Drawing">
<value>167, 22</value>
</data>
<data name="ContextMeasure.Text" xml:space="preserve">
<value>Measure Distance</value>
</data>
<data name="rotateMapToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>167, 22</value>
</data>
<data name="rotateMapToolStripMenuItem.Text" xml:space="preserve">
<value>Rotate Map</value>
<value>145, 6</value>
</data>
<data name="addPolygonPointToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>174, 22</value>
@ -1681,7 +1525,7 @@
<value>Clear Polygon</value>
</data>
<data name="polygonToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>167, 22</value>
<value>148, 22</value>
</data>
<data name="polygonToolStripMenuItem.Text" xml:space="preserve">
<value>Draw Polygon</value>
@ -1726,19 +1570,67 @@
<value>Save to File</value>
</data>
<data name="geoFenceToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>167, 22</value>
<value>148, 22</value>
</data>
<data name="geoFenceToolStripMenuItem.Text" xml:space="preserve">
<value>Geo-Fence</value>
</data>
<data name="clearMissionToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<data name="createWpCircleToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>162, 22</value>
</data>
<data name="createWpCircleToolStripMenuItem.Text" xml:space="preserve">
<value>Create Wp Circle</value>
</data>
<data name="gridToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>162, 22</value>
</data>
<data name="gridToolStripMenuItem.Text" xml:space="preserve">
<value>Grid</value>
</data>
<data name="autoWPToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>148, 22</value>
</data>
<data name="autoWPToolStripMenuItem.Text" xml:space="preserve">
<value>Auto WP</value>
</data>
<data name="ContextMeasure.Size" type="System.Drawing.Size, System.Drawing">
<value>167, 22</value>
</data>
<data name="clearMissionToolStripMenuItem.Text" xml:space="preserve">
<value>Clear Mission</value>
<data name="ContextMeasure.Text" xml:space="preserve">
<value>Measure Distance</value>
</data>
<data name="rotateMapToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>167, 22</value>
</data>
<data name="rotateMapToolStripMenuItem.Text" xml:space="preserve">
<value>Rotate Map</value>
</data>
<data name="zoomToToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>167, 22</value>
</data>
<data name="zoomToToolStripMenuItem.Text" xml:space="preserve">
<value>Zoom To</value>
</data>
<data name="prefetchToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>167, 22</value>
</data>
<data name="prefetchToolStripMenuItem.Text" xml:space="preserve">
<value>Prefetch</value>
</data>
<data name="kMLOverlayToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>167, 22</value>
</data>
<data name="kMLOverlayToolStripMenuItem.Text" xml:space="preserve">
<value>KML Overlay</value>
</data>
<data name="mapToolToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>148, 22</value>
</data>
<data name="mapToolToolStripMenuItem.Text" xml:space="preserve">
<value>Map Tool</value>
</data>
<data name="contextMenuStrip1.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 230</value>
<value>149, 208</value>
</data>
<data name="&gt;&gt;contextMenuStrip1.Name" xml:space="preserve">
<value>contextMenuStrip1</value>
@ -1750,7 +1642,7 @@
<value>0, 0</value>
</data>
<data name="MainMap.Size" type="System.Drawing.Size, System.Drawing">
<value>838, 306</value>
<value>577, 306</value>
</data>
<data name="MainMap.streamjpg" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
@ -1904,7 +1796,7 @@
<value>MainMap</value>
</data>
<data name="&gt;&gt;MainMap.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.myGMAP, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.myGMAP, ArdupilotMegaPlanner10, Version=1.1.4606.25609, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;MainMap.Parent" xml:space="preserve">
<value>panelMap</value>
@ -1919,7 +1811,7 @@
<value>NoControl</value>
</data>
<data name="trackBar1.Location" type="System.Drawing.Point, System.Drawing">
<value>847, 21</value>
<value>586, 21</value>
</data>
<data name="trackBar1.Orientation" type="System.Windows.Forms.Orientation, System.Windows.Forms">
<value>Vertical</value>
@ -1934,7 +1826,7 @@
<value>trackBar1</value>
</data>
<data name="&gt;&gt;trackBar1.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyTrackBar, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyTrackBar, ArdupilotMegaPlanner10, Version=1.1.4606.25609, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;trackBar1.Parent" xml:space="preserve">
<value>panelMap</value>
@ -1952,7 +1844,7 @@
<value>NoControl</value>
</data>
<data name="label11.Location" type="System.Drawing.Point, System.Drawing">
<value>844, 5</value>
<value>583, 5</value>
</data>
<data name="label11.Size" type="System.Drawing.Size, System.Drawing">
<value>34, 13</value>
@ -1982,7 +1874,7 @@
<value>0, 0</value>
</data>
<data name="panelMap.Size" type="System.Drawing.Size, System.Drawing">
<value>878, 313</value>
<value>617, 313</value>
</data>
<data name="panelMap.TabIndex" type="System.Int32, mscorlib">
<value>51</value>
@ -2009,7 +1901,7 @@
<value>0, 0</value>
</data>
<data name="panelBASE.Size" type="System.Drawing.Size, System.Drawing">
<value>1008, 461</value>
<value>747, 461</value>
</data>
<data name="panelBASE.TabIndex" type="System.Int32, mscorlib">
<value>52</value>
@ -2039,7 +1931,7 @@
<value>0, 0, 0, 0</value>
</data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>1008, 461</value>
<value>747, 461</value>
</data>
<data name="&gt;&gt;Command.Name" xml:space="preserve">
<value>Command</value>
@ -2125,6 +2017,12 @@
<data name="&gt;&gt;deleteWPToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;setROIToolStripMenuItem.Name" xml:space="preserve">
<value>setROIToolStripMenuItem</value>
</data>
<data name="&gt;&gt;setROIToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;loiterToolStripMenuItem.Name" xml:space="preserve">
<value>loiterToolStripMenuItem</value>
</data>
@ -2167,10 +2065,10 @@
<data name="&gt;&gt;jumpwPToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;createWpCircleToolStripMenuItem.Name" xml:space="preserve">
<value>createWpCircleToolStripMenuItem</value>
<data name="&gt;&gt;clearMissionToolStripMenuItem.Name" xml:space="preserve">
<value>clearMissionToolStripMenuItem</value>
</data>
<data name="&gt;&gt;createWpCircleToolStripMenuItem.Type" xml:space="preserve">
<data name="&gt;&gt;clearMissionToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolStripSeparator1.Name" xml:space="preserve">
@ -2179,18 +2077,6 @@
<data name="&gt;&gt;toolStripSeparator1.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;ContextMeasure.Name" xml:space="preserve">
<value>ContextMeasure</value>
</data>
<data name="&gt;&gt;ContextMeasure.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;rotateMapToolStripMenuItem.Name" xml:space="preserve">
<value>rotateMapToolStripMenuItem</value>
</data>
<data name="&gt;&gt;rotateMapToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;polygonToolStripMenuItem.Name" xml:space="preserve">
<value>polygonToolStripMenuItem</value>
</data>
@ -2257,10 +2143,58 @@
<data name="&gt;&gt;saveToFileToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;clearMissionToolStripMenuItem.Name" xml:space="preserve">
<value>clearMissionToolStripMenuItem</value>
<data name="&gt;&gt;autoWPToolStripMenuItem.Name" xml:space="preserve">
<value>autoWPToolStripMenuItem</value>
</data>
<data name="&gt;&gt;clearMissionToolStripMenuItem.Type" xml:space="preserve">
<data name="&gt;&gt;autoWPToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;createWpCircleToolStripMenuItem.Name" xml:space="preserve">
<value>createWpCircleToolStripMenuItem</value>
</data>
<data name="&gt;&gt;createWpCircleToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;gridToolStripMenuItem.Name" xml:space="preserve">
<value>gridToolStripMenuItem</value>
</data>
<data name="&gt;&gt;gridToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;mapToolToolStripMenuItem.Name" xml:space="preserve">
<value>mapToolToolStripMenuItem</value>
</data>
<data name="&gt;&gt;mapToolToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;ContextMeasure.Name" xml:space="preserve">
<value>ContextMeasure</value>
</data>
<data name="&gt;&gt;ContextMeasure.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;rotateMapToolStripMenuItem.Name" xml:space="preserve">
<value>rotateMapToolStripMenuItem</value>
</data>
<data name="&gt;&gt;rotateMapToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;zoomToToolStripMenuItem.Name" xml:space="preserve">
<value>zoomToToolStripMenuItem</value>
</data>
<data name="&gt;&gt;zoomToToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;prefetchToolStripMenuItem.Name" xml:space="preserve">
<value>prefetchToolStripMenuItem</value>
</data>
<data name="&gt;&gt;prefetchToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;kMLOverlayToolStripMenuItem.Name" xml:space="preserve">
<value>kMLOverlayToolStripMenuItem</value>
</data>
<data name="&gt;&gt;kMLOverlayToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolTip1.Name" xml:space="preserve">
@ -2279,6 +2213,6 @@
<value>FlightPlanner</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.MyUserControl, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
<value>System.Windows.Forms.MyUserControl, ArdupilotMegaPlanner10, Version=1.1.4606.25609, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>

View File

@ -38,6 +38,7 @@
//
resources.ApplyResources(this.richTextBox1, "richTextBox1");
this.richTextBox1.Cursor = System.Windows.Forms.Cursors.Default;
this.richTextBox1.DetectUrls = false;
this.richTextBox1.Name = "richTextBox1";
//
// CHK_showconsole

View File

@ -196,7 +196,7 @@
<value>BUT_updatecheck</value>
</data>
<data name="&gt;&gt;BUT_updatecheck.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.0.0.0, Culture=neutral, PublicKeyToken=38326cb7e06851fc</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4605.13518, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_updatecheck.Parent" xml:space="preserve">
<value>$this</value>
@ -204,9 +204,9 @@
<data name="&gt;&gt;BUT_updatecheck.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib">
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 13</value>
</data>
@ -220,7 +220,7 @@
<value>Help</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.MyUserControl, ArdupilotMegaPlanner, Version=1.0.0.0, Culture=neutral, PublicKeyToken=38326cb7e06851fc</value>
<value>System.Windows.Forms.MyUserControl, ArdupilotMegaPlanner10, Version=1.1.4605.13518, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="help_text" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Welcome_to_Michael_Oborne.rtf;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>

View File

@ -16,6 +16,8 @@ using System.Reflection;
using ArdupilotMega.Controls;
using System.Drawing.Drawing2D;
using ArdupilotMega.HIL;
// Written by Michael Oborne
namespace ArdupilotMega.GCSViews
{
@ -697,6 +699,10 @@ namespace ArdupilotMega.GCSViews
XplanesSEND = new UdpClient(simIP, simPort);
OutputLog.AppendText("Sending to port UDP " + simPort + " (planner->sim)\n");
setupXplane();
OutputLog.AppendText("Sent xplane settings\n");
}
private void SetupUDPMavLink()
@ -778,19 +784,29 @@ namespace ArdupilotMega.GCSViews
sitldata.speedN = DATA[21][3];// (DATA[3][7] * 0.44704 * Math.Sin(sitldata.heading * deg2rad));
sitldata.speedE = -DATA[21][5];// (DATA[3][7] * 0.44704 * Math.Cos(sitldata.heading * deg2rad));
// YLScsDrawing.Drawing3d.Vector3d accel3D = HIL.QuadCopter.RPY_to_XYZ(DATA[18][1], DATA[18][0], 0, -9.8); //DATA[18][2]
Matrix3 dcm = new Matrix3();
dcm.from_euler(sitldata.rollDeg * deg2rad, sitldata.pitchDeg * deg2rad, sitldata.yawDeg * deg2rad);
// float turnrad = (float)(((DATA[3][7] * 0.44704) * (DATA[3][7] * 0.44704) * 1.943844) / (float)(11.26 * Math.Tan(sitldata.rollDeg * deg2rad))) * ft2m;
// rad = tas^2 / (tan(angle) * G)
float turnrad = (float)(((DATA[3][7] * 0.44704) * (DATA[3][7] * 0.44704)) / (float)(9.8f * Math.Tan(sitldata.rollDeg * deg2rad)));
// float centripaccel = (float)((DATA[3][7] * 0.44704) * (DATA[3][7] * 0.44704)) / turnrad;
float gload = (float)(1 / Math.Cos(sitldata.rollDeg * deg2rad)); // calculated Gs
// YLScsDrawing.Drawing3d.Vector3d cent3D = HIL.QuadCopter.RPY_to_XYZ(DATA[18][1] - 90, 0, 0, centripaccel);
// a = v^2/r
float centripaccel = (float)((DATA[3][7] * 0.44704) * (DATA[3][7] * 0.44704)) / turnrad;
// accel3D -= cent3D;
Vector3 accel_body = dcm.transposed() * (new Vector3(0, 0, -9.8));
// sitldata.xAccel = accel3D.X;
// sitldata.yAccel = accel3D.Y;
// sitldata.zAccel = accel3D.Z;
Vector3 centrip_accel = new Vector3(0, centripaccel * Math.Cos(sitldata.rollDeg * deg2rad), centripaccel * Math.Sin(sitldata.rollDeg * deg2rad));
accel_body -= centrip_accel;
sitldata.xAccel = DATA[4][5] * 9.8;
sitldata.yAccel = DATA[4][6] * 9.8;
sitldata.zAccel = (0 - DATA[4][4]) * 9.8;
Console.WriteLine(accel_body.ToString());
Console.WriteLine(" {0} {1} {2}",sitldata.xAccel, sitldata.yAccel, sitldata.zAccel);
}
else if (receviedbytes == 0x64) // FG binary udp
@ -908,6 +924,9 @@ namespace ArdupilotMega.GCSViews
sitldata.speedE = fdm.v_north * ft2m;
sitldata.airspeed = fdm.vcas * 0.5144444f;// knots to m/s
if (RAD_JSBSim.Checked)
sitldata.airspeed = fdm.vcas * 0.3048f;// fps to m/s
}
else
@ -1425,6 +1444,72 @@ namespace ArdupilotMega.GCSViews
}
}
void setupXplane()
{
if (RAD_softXplanes.Checked)
{
// sending only 1 packet instead of many.
byte[] Xplane = new byte[5 + 4 * 8];
Xplane[0] = (byte)'D';
Xplane[1] = (byte)'S';
Xplane[2] = (byte)'E';
Xplane[3] = (byte)'L';
Xplane[4] = 0;
if (CHK_xplane10.Checked)
{
int pos = 5;
Xplane[pos] = 0x3;
pos += 4;
Xplane[pos] = 0x4;
pos += 4;
Xplane[pos] = 0x6;
pos += 4;
Xplane[pos] = 0x10;
pos += 4;
Xplane[pos] = 0x11;
pos += 4;
Xplane[pos] = 0x12;
pos += 4;
Xplane[pos] = 0x14;
pos += 4;
Xplane[pos] = 0x15;
pos += 4;
}
else
{
int pos = 5;
Xplane[pos] = 0x3;
pos += 4;
Xplane[pos] = 0x4;
pos += 4;
Xplane[pos] = 0x6;
pos += 4;
Xplane[pos] = 0x11;
pos += 4;
Xplane[pos] = 0x12;
pos += 4;
Xplane[pos] = 0x13;
pos += 4;
Xplane[pos] = 0x14;
pos += 4;
Xplane[pos] = 0x15;
pos += 4;
}
try
{
XplanesSEND.Send(Xplane, Xplane.Length);
}
catch (Exception e) { log.Info("Xplanes udp send error " + e.Message); }
}
}
byte[] StructureToByteArray(object obj)
{

View File

@ -107,7 +107,6 @@ namespace ArdupilotMega.HIL
private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
QuadCopter self;
int framecount = 0;
DateTime seconds = DateTime.Now;
double[] motor_speed = null;

View File

@ -78,11 +78,13 @@
this.MainMenu.Size = new System.Drawing.Size(1008, 76);
this.MainMenu.TabIndex = 5;
this.MainMenu.Text = "menuStrip1";
this.MainMenu.MouseLeave += new System.EventHandler(this.MainMenu_MouseLeave);
//
// MenuFlightData
//
this.MenuFlightData.AutoSize = false;
this.MenuFlightData.BackgroundImage = global::ArdupilotMega.Properties.Resources.data;
this.MenuFlightData.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.MenuFlightData.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.MenuFlightData.ImageTransparentColor = System.Drawing.Color.Magenta;
this.MenuFlightData.Margin = new System.Windows.Forms.Padding(0);
@ -95,6 +97,7 @@
//
this.MenuFlightPlanner.AutoSize = false;
this.MenuFlightPlanner.BackgroundImage = global::ArdupilotMega.Properties.Resources.planner;
this.MenuFlightPlanner.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.MenuFlightPlanner.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.MenuFlightPlanner.ImageTransparentColor = System.Drawing.Color.Magenta;
this.MenuFlightPlanner.Margin = new System.Windows.Forms.Padding(0);
@ -109,6 +112,7 @@
//
this.MenuConfiguration.AutoSize = false;
this.MenuConfiguration.BackgroundImage = global::ArdupilotMega.Properties.Resources.configuration;
this.MenuConfiguration.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.MenuConfiguration.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.MenuConfiguration.ImageTransparentColor = System.Drawing.Color.Magenta;
this.MenuConfiguration.Margin = new System.Windows.Forms.Padding(0);
@ -123,6 +127,7 @@
//
this.MenuSimulation.AutoSize = false;
this.MenuSimulation.BackgroundImage = global::ArdupilotMega.Properties.Resources.simulation;
this.MenuSimulation.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.MenuSimulation.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.MenuSimulation.ImageTransparentColor = System.Drawing.Color.Magenta;
this.MenuSimulation.Margin = new System.Windows.Forms.Padding(0);
@ -137,6 +142,7 @@
//
this.MenuFirmware.AutoSize = false;
this.MenuFirmware.BackgroundImage = global::ArdupilotMega.Properties.Resources.firmware;
this.MenuFirmware.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.MenuFirmware.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.MenuFirmware.ImageTransparentColor = System.Drawing.Color.Magenta;
this.MenuFirmware.Margin = new System.Windows.Forms.Padding(0);
@ -151,6 +157,7 @@
//
this.MenuTerminal.AutoSize = false;
this.MenuTerminal.BackgroundImage = global::ArdupilotMega.Properties.Resources.terminal;
this.MenuTerminal.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.MenuTerminal.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.MenuTerminal.ImageTransparentColor = System.Drawing.Color.Magenta;
this.MenuTerminal.Margin = new System.Windows.Forms.Padding(0);
@ -165,6 +172,7 @@
//
this.MenuHelp.AutoSize = false;
this.MenuHelp.BackgroundImage = global::ArdupilotMega.Properties.Resources.help;
this.MenuHelp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.MenuHelp.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.MenuHelp.ImageTransparentColor = System.Drawing.Color.Magenta;
this.MenuHelp.Margin = new System.Windows.Forms.Padding(0);
@ -180,6 +188,7 @@
this.MenuConnect.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
this.MenuConnect.AutoSize = false;
this.MenuConnect.BackgroundImage = global::ArdupilotMega.Properties.Resources.connect;
this.MenuConnect.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.MenuConnect.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.MenuConnect.ImageTransparentColor = System.Drawing.Color.Magenta;
this.MenuConnect.Margin = new System.Windows.Forms.Padding(0);
@ -187,7 +196,6 @@
this.MenuConnect.Padding = new System.Windows.Forms.Padding(0, 0, 72, 72);
this.MenuConnect.Size = new System.Drawing.Size(76, 76);
this.MenuConnect.Click += new System.EventHandler(this.MenuConnect_Click);
this.MenuConnect.MouseHover += new System.EventHandler(this.MenuConnect_MouseHover);
//
// toolStripConnectionControl
//
@ -216,6 +224,7 @@
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainV2_FormClosing);
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MainV2_FormClosed);
this.Load += new System.EventHandler(this.MainV2_Load);
this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.MainV2_MouseMove);
this.Resize += new System.EventHandler(this.MainV2_Resize);
this.MainMenu.ResumeLayout(false);
this.MainMenu.PerformLayout();

View File

@ -102,6 +102,9 @@ namespace ArdupilotMega
/// used to call anything as needed.
/// </summary>
public static MainV2 instance = null;
public static MainSwitcher View;
/// <summary>
/// used to feed in a network link kml to the http server
/// </summary>
@ -163,6 +166,8 @@ namespace ArdupilotMega
InitializeComponent();
View = MyView;
_connectionControl = toolStripConnectionControl.ConnectionControl;
_connectionControl.CMB_baudrate.TextChanged += this.CMB_baudrate_TextChanged;
_connectionControl.CMB_baudrate.SelectedIndexChanged += this.CMB_baudrate_SelectedIndexChanged;
@ -2050,6 +2055,12 @@ namespace ArdupilotMega
/// <returns></returns>
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == Keys.F12)
{
MenuConnect_Click(null, null);
return true;
}
if (keyData == (Keys.Control | Keys.F)) // temp
{
Form frm = new temp();
@ -2253,9 +2264,15 @@ namespace ArdupilotMega
CMB_serialport_Click(sender, e);
}
private void MenuConnect_MouseHover(object sender, EventArgs e)
private void MainMenu_MouseLeave(object sender, EventArgs e)
{
//MainMenu.Visible = false;
}
private void MainV2_MouseMove(object sender, MouseEventArgs e)
{
// if (e.Y < 50)
// MainMenu.Visible = true;
}
}
}

View File

@ -179,7 +179,7 @@
</value>
</data>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>47</value>
<value>46</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>

View File

@ -705,6 +705,8 @@ namespace ArdupilotMega
DateTime lastmessage = DateTime.MinValue;
//hires.Stopwatch stopwatch = new hires.Stopwatch();
do
{
@ -731,11 +733,13 @@ namespace ArdupilotMega
throw new Exception("Timeout on read - getParamList " + got.Count + " " + param_total + "\n\nYour serial link isn't fast enough\n");
}
//Console.WriteLine(DateTime.Now.Millisecond + " gp0 ");
byte[] buffer = readPacket();
//Console.WriteLine(DateTime.Now.Millisecond + " gp1 ");
if (buffer.Length > 5)
{
//stopwatch.Reset();
//stopwatch.Start();
// stopwatch.Start();
if (buffer[5] == MAVLINK_MSG_ID_PARAM_VALUE)
{
restart = DateTime.Now;
@ -763,16 +767,22 @@ namespace ArdupilotMega
continue;
}
log.Info(DateTime.Now.Millisecond + " got param " + (par.param_index) + " of " + (par.param_count) + " name: " + paramID);
//Console.WriteLine(DateTime.Now.Millisecond + " gp2 ");
//Console.WriteLine(DateTime.Now.Millisecond + " gp " + BaseStream.BytesToRead);
if (!MainV2.MONO)
log.Info(DateTime.Now.Millisecond + " got param " + (par.param_index) + " of " + (par.param_count) + " name: " + paramID);
//Console.WriteLine(DateTime.Now.Millisecond + " gp2a ");
modifyParamForDisplay(true, paramID, ref par.param_value);
param[paramID] = (par.param_value);
//Console.WriteLine(DateTime.Now.Millisecond + " gp2b ");
param_count++;
got.Add(par.param_index);
Console.WriteLine(DateTime.Now.Millisecond + " gp1 " + BaseStream.BytesToRead);
//Console.WriteLine(DateTime.Now.Millisecond + " gp3 ");
this.frmProgressReporter.UpdateProgressAndStatus((got.Count * 100) / param_total, "Got param " + paramID);
@ -785,8 +795,8 @@ namespace ArdupilotMega
//Console.WriteLine(DateTime.Now + " PC paramlist " + buffer[5] + " want " + MAVLINK_MSG_ID_PARAM_VALUE + " btr " + BaseStream.BytesToRead);
}
//stopwatch.Stop();
//Console.WriteLine("Time elapsed: {0}", stopwatch.Elapsed);
Console.WriteLine(DateTime.Now.Millisecond + " gp2 " + BaseStream.BytesToRead);
// Console.WriteLine("Time elapsed: {0}", stopwatch.Elapsed);
// Console.WriteLine(DateTime.Now.Millisecond + " gp4 " + BaseStream.BytesToRead);
}
} while (got.Count < param_total);
@ -1777,7 +1787,7 @@ namespace ArdupilotMega
/// <param name="index">wp no</param>
/// <param name="frame">global or relative</param>
/// <param name="current">0 = no , 2 = guided mode</param>
public void setWP(Locationwp loc, ushort index, MAV_FRAME frame, byte current)
public MAV_MISSION_RESULT setWP(Locationwp loc, ushort index, MAV_FRAME frame, byte current)
{
MainV2.giveComport = true;
#if MAVLINK10
@ -1900,7 +1910,7 @@ namespace ArdupilotMega
log.Info("set wp " + index + " ACK 47 : " + buffer[5] + " ans " + Enum.Parse(typeof(MAV_MISSION_RESULT), ans.type.ToString()));
break;
return (MAV_MISSION_RESULT)ans.type;
}
else if (buffer[5] == MAVLINK_MSG_ID_MISSION_REQUEST)
{
@ -1913,7 +1923,8 @@ namespace ArdupilotMega
{
log.Info("set wp doing " + index + " req " + ans.seq + " REQ 40 : " + buffer[5]);
MainV2.giveComport = false;
break;
return MAV_MISSION_RESULT.MAV_MISSION_ACCEPTED;
}
else
{
@ -1954,6 +1965,29 @@ namespace ArdupilotMega
#endif
}
}
// return MAV_MISSION_RESULT.MAV_MISSION_INVALID;
}
public void setGuidedModeWP(Locationwp gotohere)
{
if (gotohere.alt == 0 || gotohere.lat == 0 || gotohere.lng == 0)
return;
MainV2.giveComport = true;
try
{
gotohere.id =(byte)MAV_CMD.WAYPOINT;
MAV_MISSION_RESULT ans = MainV2.comPort.setWP(gotohere, 0, MAVLink.MAV_FRAME.GLOBAL_RELATIVE_ALT, (byte)2);
if (ans != MAV_MISSION_RESULT.MAV_MISSION_ACCEPTED)
throw new Exception("Guided Mode Failed");
}
catch (Exception ex) { log.Error(ex); }
MainV2.giveComport = false;
}
public void setMountConfigure(MAV_MOUNT_MODE mountmode, bool stabroll, bool stabpitch, bool stabyaw)
@ -2060,10 +2094,14 @@ namespace ArdupilotMega
int readcount = 0;
lastbad = new byte[2];
byte[] headbuffer = new byte[6];
BaseStream.ReadTimeout = 1200; // 1200 ms between chars - the gps detection requires this.
DateTime start = DateTime.Now;
//Console.WriteLine(DateTime.Now.Millisecond + " SR0 " + BaseStream.BytesToRead);
try
{
// test fabs idea - http://diydrones.com/profiles/blogs/flying-with-joystick?commentId=705844%3AComment%3A818712&xg_source=msg_com_blogpost
@ -2078,7 +2116,7 @@ namespace ArdupilotMega
lock (readlock)
{
// Console.WriteLine(DateTime.Now.Millisecond + " SR " + BaseStream.BytesToRead);
//Console.WriteLine(DateTime.Now.Millisecond + " SR1 " + BaseStream.BytesToRead);
while (BaseStream.IsOpen || logreadmode)
{
@ -2123,22 +2161,26 @@ namespace ArdupilotMega
DateTime to = DateTime.Now.AddMilliseconds(BaseStream.ReadTimeout);
// Console.WriteLine(DateTime.Now.Millisecond + " SR1a " + BaseStream.BytesToRead);
while (BaseStream.BytesToRead <= 0)
{
if (DateTime.Now > to)
{
log.InfoFormat("MAVLINK: S wait time out btr {0} len {1}", BaseStream.BytesToRead, length);
log.InfoFormat("MAVLINK: 1 wait time out btr {0} len {1}", BaseStream.BytesToRead, length);
throw new Exception("Timeout");
}
// System.Threading.Thread.Sleep(1);
System.Threading.Thread.Sleep(1);
//Console.WriteLine(DateTime.Now.Millisecond + " SR0b " + BaseStream.BytesToRead);
}
//Console.WriteLine(DateTime.Now.Millisecond + " SR1 " + BaseStream.BytesToRead);
//Console.WriteLine(DateTime.Now.Millisecond + " SR1a " + BaseStream.BytesToRead);
if (BaseStream.IsOpen)
{
buffer[count] = (byte)BaseStream.ReadByte();
BaseStream.Read(buffer, count, 1);
if (rawlogfile != null && rawlogfile.BaseStream.CanWrite)
rawlogfile.Write(buffer[count]);
}
//Console.WriteLine(DateTime.Now.Millisecond + " SR1b " + BaseStream.BytesToRead);
}
}
catch (Exception e) { log.Info("MAVLink readpacket read error: " + e.ToString()); break; }
@ -2163,8 +2205,31 @@ namespace ArdupilotMega
//Console.WriteLine(DateTime.Now.Millisecond + " SR2 " + BaseStream.BytesToRead);
// check for a header
if (buffer[0] == 'U' || buffer[0] == 254)
{
// if we have the header, and no other chars, get the length and packet identifiers
if (count == 0 && !logreadmode)
{
DateTime to = DateTime.Now.AddMilliseconds(BaseStream.ReadTimeout);
while (BaseStream.BytesToRead < 5)
{
if (DateTime.Now > to)
{
log.InfoFormat("MAVLINK: 2 wait time out btr {0} len {1}", BaseStream.BytesToRead, length);
throw new Exception("Timeout");
}
System.Threading.Thread.Sleep(1);
//Console.WriteLine(DateTime.Now.Millisecond + " SR0b " + BaseStream.BytesToRead);
}
int read = BaseStream.Read(buffer, 1, 5);
count = read;
if (rawlogfile != null && rawlogfile.BaseStream.CanWrite)
rawlogfile.Write(buffer,1,read);
}
// packet length
length = buffer[1] + 6 + 2 - 2; // data + header + checksum - U - length
if (count >= 5 || logreadmode)
{
@ -2198,10 +2263,10 @@ namespace ArdupilotMega
{
if (DateTime.Now > to)
{
log.InfoFormat("MAVLINK: L wait time out btr {0} len {1}", BaseStream.BytesToRead, length);
log.InfoFormat("MAVLINK: 3 wait time out btr {0} len {1}", BaseStream.BytesToRead, length);
break;
}
//Console.WriteLine("data " + 0 + " " + length + " aval " + BaseStream.BytesToRead);
System.Threading.Thread.Sleep(1);
}
if (BaseStream.IsOpen)
{
@ -2213,7 +2278,6 @@ namespace ArdupilotMega
}
}
}
//Console.WriteLine("data " + read + " " + length + " aval " + this.BytesToRead);
count = length + 2;
}
catch { break; }
@ -2315,31 +2379,40 @@ namespace ArdupilotMega
}
else
{
byte packetSeqNo = buffer[2];
int expectedPacketSeqNo = ((recvpacketcount + 1) % 0x100);
if (packetSeqNo != expectedPacketSeqNo)
if (buffer[5] == MAVLINK_MSG_ID_SIMSTATE)
{
synclost++; // actualy sync loss's
int numLost = 0;
if (packetSeqNo < ((recvpacketcount + 1))) // recvpacketcount = 255 then 10 < 256 = true if was % 0x100 this would fail
{
numLost = 0x100 - expectedPacketSeqNo + packetSeqNo;
}
else
{
numLost = packetSeqNo - recvpacketcount;
}
packetslost += numLost;
WhenPacketLost.OnNext(numLost);
log.InfoFormat("lost {0} pkts {1}", packetSeqNo, (int)packetslost);
// sitl injects a packet with a bad sequence number
}
else
{
if (packetSeqNo != expectedPacketSeqNo)
{
synclost++; // actualy sync loss's
int numLost = 0;
packetsnotlost++;
if (packetSeqNo < ((recvpacketcount + 1))) // recvpacketcount = 255 then 10 < 256 = true if was % 0x100 this would fail
{
numLost = 0x100 - expectedPacketSeqNo + packetSeqNo;
}
else
{
numLost = packetSeqNo - recvpacketcount;
}
packetslost += numLost;
WhenPacketLost.OnNext(numLost);
recvpacketcount = packetSeqNo;
log.InfoFormat("lost {0} pkts {1}", packetSeqNo, (int)packetslost);
}
packetsnotlost++;
recvpacketcount = packetSeqNo;
}
WhenPacketReceived.OnNext(1);
// Console.WriteLine(DateTime.Now.Millisecond);
}

View File

@ -25,9 +25,9 @@ namespace ArdupilotMega
public const bool MAVLINK_NEED_BYTE_SWAP = (MAVLINK_ENDIAN == MAVLINK_LITTLE_ENDIAN);
public byte[] MAVLINK_MESSAGE_LENGTHS = new byte[] {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 9, 34, 26, 46, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 0, 33, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 8, 4, 12, 15, 13, 6, 15, 14, 0, 12, 3, 8, 28, 36, 3, 9, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 30, 18, 18, 51, 9, 0};
public byte[] MAVLINK_MESSAGE_LENGTHS = new byte[] {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 9, 34, 26, 46, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 0, 33, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 8, 4, 12, 15, 13, 6, 15, 14, 0, 12, 3, 8, 28, 44, 3, 9, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 30, 18, 18, 51, 9, 0};
public byte[] MAVLINK_MESSAGE_CRCS = new byte[] {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 30, 240, 183, 130, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 0, 152, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 219, 208, 188, 84, 22, 19, 21, 134, 0, 78, 68, 189, 127, 42, 21, 21, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 49, 170, 44, 83, 46, 0};
public byte[] MAVLINK_MESSAGE_CRCS = new byte[] {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 30, 240, 183, 130, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 0, 152, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 219, 208, 188, 84, 22, 19, 21, 134, 0, 78, 68, 189, 127, 111, 21, 21, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 49, 170, 44, 83, 46, 0};
public Type[] MAVLINK_MESSAGE_INFO = new Type[] {typeof( mavlink_heartbeat_t ), typeof( mavlink_sys_status_t ), typeof( mavlink_system_time_t ), null, typeof( mavlink_ping_t ), typeof( mavlink_change_operator_control_t ), typeof( mavlink_change_operator_control_ack_t ), typeof( mavlink_auth_key_t ), null, null, null, typeof( mavlink_set_mode_t ), null, null, null, null, null, null, null, null, typeof( mavlink_param_request_read_t ), typeof( mavlink_param_request_list_t ), typeof( mavlink_param_value_t ), typeof( mavlink_param_set_t ), typeof( mavlink_gps_raw_int_t ), typeof( mavlink_gps_status_t ), typeof( mavlink_scaled_imu_t ), typeof( mavlink_raw_imu_t ), typeof( mavlink_raw_pressure_t ), typeof( mavlink_scaled_pressure_t ), typeof( mavlink_attitude_t ), typeof( mavlink_attitude_quaternion_t ), typeof( mavlink_local_position_ned_t ), typeof( mavlink_global_position_int_t ), typeof( mavlink_rc_channels_scaled_t ), typeof( mavlink_rc_channels_raw_t ), typeof( mavlink_servo_output_raw_t ), typeof( mavlink_mission_request_partial_list_t ), typeof( mavlink_mission_write_partial_list_t ), typeof( mavlink_mission_item_t ), typeof( mavlink_mission_request_t ), typeof( mavlink_mission_set_current_t ), typeof( mavlink_mission_current_t ), typeof( mavlink_mission_request_list_t ), typeof( mavlink_mission_count_t ), typeof( mavlink_mission_clear_all_t ), typeof( mavlink_mission_item_reached_t ), typeof( mavlink_mission_ack_t ), typeof( mavlink_set_gps_global_origin_t ), typeof( mavlink_gps_global_origin_t ), typeof( mavlink_set_local_position_setpoint_t ), typeof( mavlink_local_position_setpoint_t ), typeof( mavlink_global_position_setpoint_int_t ), typeof( mavlink_set_global_position_setpoint_int_t ), typeof( mavlink_safety_set_allowed_area_t ), typeof( mavlink_safety_allowed_area_t ), typeof( mavlink_set_roll_pitch_yaw_thrust_t ), typeof( mavlink_set_roll_pitch_yaw_speed_thrust_t ), typeof( mavlink_roll_pitch_yaw_thrust_setpoint_t ), typeof( mavlink_roll_pitch_yaw_speed_thrust_setpoint_t ), typeof( mavlink_set_quad_motors_setpoint_t ), typeof( mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t ), typeof( mavlink_nav_controller_output_t ), typeof( mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t ), typeof( mavlink_state_correction_t ), null, typeof( mavlink_request_data_stream_t ), typeof( mavlink_data_stream_t ), null, typeof( mavlink_manual_control_t ), typeof( mavlink_rc_channels_override_t ), null, null, null, typeof( mavlink_vfr_hud_t ), null, typeof( mavlink_command_long_t ), typeof( mavlink_command_ack_t ), null, null, null, null, null, null, null, null, null, null, null, typeof( mavlink_local_position_ned_system_global_offset_t ), typeof( mavlink_hil_state_t ), typeof( mavlink_hil_controls_t ), typeof( mavlink_hil_rc_inputs_raw_t ), null, null, null, null, null, null, null, typeof( mavlink_optical_flow_t ), typeof( mavlink_global_vision_position_estimate_t ), typeof( mavlink_vision_position_estimate_t ), typeof( mavlink_vision_speed_estimate_t ), typeof( mavlink_vicon_position_estimate_t ), null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, typeof( mavlink_sensor_offsets_t ), typeof( mavlink_set_mag_offsets_t ), typeof( mavlink_meminfo_t ), typeof( mavlink_ap_adc_t ), typeof( mavlink_digicam_configure_t ), typeof( mavlink_digicam_control_t ), typeof( mavlink_mount_configure_t ), typeof( mavlink_mount_control_t ), typeof( mavlink_mount_status_t ), null, typeof( mavlink_fence_point_t ), typeof( mavlink_fence_fetch_point_t ), typeof( mavlink_fence_status_t ), typeof( mavlink_ahrs_t ), typeof( mavlink_simstate_t ), typeof( mavlink_hwstatus_t ), typeof( mavlink_radio_t ), typeof( mavlink_limits_status_t ), null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, typeof( mavlink_memory_vect_t ), typeof( mavlink_debug_vect_t ), typeof( mavlink_named_value_float_t ), typeof( mavlink_named_value_int_t ), typeof( mavlink_statustext_t ), typeof( mavlink_debug_t ), null};
@ -933,7 +933,8 @@ namespace ArdupilotMega
public Single ygyro;
/// <summary> Angular speed around Z axis rad/s </summary>
public Single zgyro;
public Single lat;
public Single lng;
};

View File

@ -34,5 +34,5 @@ using System.Resources;
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.*")]
[assembly: AssemblyFileVersion("1.2.4")]
[assembly: AssemblyFileVersion("1.2.5")]
[assembly: NeutralResourcesLanguageAttribute("")]

View File

@ -32,8 +32,6 @@
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.BUT_paramgen = new ArdupilotMega.Controls.MyButton();
this.BUT_magcalib = new ArdupilotMega.Controls.MyButton();
this.BUT_ant_track = new ArdupilotMega.Controls.MyButton();
this.BUT_follow_me = new ArdupilotMega.Controls.MyButton();
this.BUT_georefimage = new ArdupilotMega.Controls.MyButton();
this.BUT_lang_edit = new ArdupilotMega.Controls.MyButton();
@ -80,7 +78,7 @@
//
// BUT_paramgen
//
this.BUT_paramgen.Location = new System.Drawing.Point(323, 118);
this.BUT_paramgen.Location = new System.Drawing.Point(459, 185);
this.BUT_paramgen.Name = "BUT_paramgen";
this.BUT_paramgen.Size = new System.Drawing.Size(75, 23);
this.BUT_paramgen.TabIndex = 20;
@ -88,28 +86,9 @@
this.BUT_paramgen.UseVisualStyleBackColor = true;
this.BUT_paramgen.Click += new System.EventHandler(this.BUT_paramgen_Click);
//
// BUT_magcalib
//
this.BUT_magcalib.Location = new System.Drawing.Point(119, 164);
this.BUT_magcalib.Name = "BUT_magcalib";
this.BUT_magcalib.Size = new System.Drawing.Size(96, 23);
this.BUT_magcalib.TabIndex = 19;
this.BUT_magcalib.Text = "Mag Calib";
this.BUT_magcalib.Click += new System.EventHandler(this.BUT_magcalib_Click);
//
// BUT_ant_track
//
this.BUT_ant_track.Location = new System.Drawing.Point(404, 164);
this.BUT_ant_track.Name = "BUT_ant_track";
this.BUT_ant_track.Size = new System.Drawing.Size(75, 23);
this.BUT_ant_track.TabIndex = 18;
this.BUT_ant_track.Text = "Antenna Tracker";
this.BUT_ant_track.UseVisualStyleBackColor = true;
this.BUT_ant_track.Click += new System.EventHandler(this.BUT_ant_track_Click);
//
// BUT_follow_me
//
this.BUT_follow_me.Location = new System.Drawing.Point(485, 164);
this.BUT_follow_me.Location = new System.Drawing.Point(378, 185);
this.BUT_follow_me.Name = "BUT_follow_me";
this.BUT_follow_me.Size = new System.Drawing.Size(75, 23);
this.BUT_follow_me.TabIndex = 17;
@ -119,7 +98,7 @@
//
// BUT_georefimage
//
this.BUT_georefimage.Location = new System.Drawing.Point(221, 164);
this.BUT_georefimage.Location = new System.Drawing.Point(195, 185);
this.BUT_georefimage.Name = "BUT_georefimage";
this.BUT_georefimage.Size = new System.Drawing.Size(96, 23);
this.BUT_georefimage.TabIndex = 0;
@ -128,7 +107,7 @@
//
// BUT_lang_edit
//
this.BUT_lang_edit.Location = new System.Drawing.Point(323, 164);
this.BUT_lang_edit.Location = new System.Drawing.Point(297, 185);
this.BUT_lang_edit.Name = "BUT_lang_edit";
this.BUT_lang_edit.Size = new System.Drawing.Size(75, 23);
this.BUT_lang_edit.TabIndex = 16;
@ -261,8 +240,6 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(685, 285);
this.Controls.Add(this.BUT_paramgen);
this.Controls.Add(this.BUT_magcalib);
this.Controls.Add(this.BUT_ant_track);
this.Controls.Add(this.BUT_follow_me);
this.Controls.Add(this.BUT_georefimage);
this.Controls.Add(this.BUT_lang_edit);
@ -309,8 +286,6 @@
private ArdupilotMega.Controls.MyButton BUT_lang_edit;
private ArdupilotMega.Controls.MyButton BUT_georefimage;
private ArdupilotMega.Controls.MyButton BUT_follow_me;
private ArdupilotMega.Controls.MyButton BUT_ant_track;
private ArdupilotMega.Controls.MyButton BUT_magcalib;
private Controls.MyButton BUT_paramgen;
}
}

View File

@ -895,19 +895,11 @@ namespace ArdupilotMega
si.Show();
}
private void BUT_ant_track_Click(object sender, EventArgs e)
{
new Antenna.Tracker().Show();
}
private void BUT_magcalib_Click(object sender, EventArgs e)
{
MagCalib.ProcessLog();
}
private void BUT_paramgen_Click(object sender, EventArgs e)
{
ParameterMetaDataParser.GetParameterInformation();
}
}
}