diff --git a/Tools/ArdupilotMegaPlanner/ArduinoComms.cs b/Tools/ArdupilotMegaPlanner/ArduinoComms.cs index 7ea102e1baa333ae02c7b38f73fc1ae6212f440f..a685523550ad40551ff98b5f33a91862ce4d06ba 100644 --- a/Tools/ArdupilotMegaPlanner/ArduinoComms.cs +++ b/Tools/ArdupilotMegaPlanner/ArduinoComms.cs @@ -6,7 +6,7 @@ using System.IO; namespace ArdupilotMega { - public delegate void ProgressEventHandler(int progress); + public delegate void ProgressEventHandler(int progress,string status); /// <summary> /// Arduino STK interface diff --git a/Tools/ArdupilotMegaPlanner/ArduinoDetect.cs b/Tools/ArdupilotMegaPlanner/ArduinoDetect.cs index eabd5a73419bd4259cb3c4920076bcd7baa0d2e8..82d49c690b0dc9658eafda3bff6d0243fa5361bf 100644 --- a/Tools/ArdupilotMegaPlanner/ArduinoDetect.cs +++ b/Tools/ArdupilotMegaPlanner/ArduinoDetect.cs @@ -196,6 +196,47 @@ namespace ArdupilotMega return ""; } + public enum ap_var_type + { + AP_PARAM_NONE = 0, + AP_PARAM_INT8, + AP_PARAM_INT16, + AP_PARAM_INT32, + AP_PARAM_FLOAT, + AP_PARAM_VECTOR3F, + AP_PARAM_VECTOR6F, + AP_PARAM_MATRIX3F, + AP_PARAM_GROUP + }; + + static string[] type_names = new string[] { + "NONE", "INT8", "INT16", "INT32", "FLOAT", "VECTOR3F", "VECTOR6F","MATRIX6F", "GROUP" +}; + + static byte type_size(ap_var_type type) +{ + switch (type) { + case ap_var_type.AP_PARAM_NONE: + case ap_var_type.AP_PARAM_GROUP: + return 0; + case ap_var_type.AP_PARAM_INT8: + return 1; + case ap_var_type.AP_PARAM_INT16: + return 2; + case ap_var_type.AP_PARAM_INT32: + return 4; + case ap_var_type.AP_PARAM_FLOAT: + return 4; + case ap_var_type.AP_PARAM_VECTOR3F: + return 3*4; + case ap_var_type.AP_PARAM_VECTOR6F: + return 6*4; + case ap_var_type.AP_PARAM_MATRIX3F: + return 3*3*4; + } + return 0; +} + /// <summary> /// return the software id from eeprom /// </summary> @@ -223,7 +264,7 @@ namespace ArdupilotMega byte[] buffer = port.download(1024 * 4); port.Close(); - if (buffer[0] != 'A' || buffer[1] != 'P') // this is the apvar header + if (buffer[0] != 'A' && buffer[0] != 'P' || buffer[1] != 'P' && buffer[1] != 'A') // this is the apvar header { return -1; } @@ -263,6 +304,46 @@ namespace ArdupilotMega Console.WriteLine(); } } + + if (buffer[0] == 'P' && buffer[1] == 'A' && buffer[2] == 5) // ap param + { + int pos = 4; + byte key = 0; + while (pos < (1024 * 4)) + { + key = buffer[pos]; + pos++; + int group = buffer[pos]; + pos++; + int type = buffer[pos]; + pos++; + + int size = type_size((ap_var_type)Enum.Parse(typeof(ap_var_type), type.ToString())); + + + Console.Write("{0:X4}: type {1} ({2}) key {3} group {4} size {5}\n ", pos - 2, type, type_names[type], key, group, size); + + if (key == 0xff) + { + Console.WriteLine("end sentinal at {0}", pos - 2); + break; + } + + 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; } diff --git a/Tools/ArdupilotMegaPlanner/ArduinoSTK.cs b/Tools/ArdupilotMegaPlanner/ArduinoSTK.cs index 30a0e3182d75ec193593247c841398efe9e6657b..d16ab575a106529bfc0c1b8ed79f1acdd7bebffb 100644 --- a/Tools/ArdupilotMegaPlanner/ArduinoSTK.cs +++ b/Tools/ArdupilotMegaPlanner/ArduinoSTK.cs @@ -219,7 +219,7 @@ namespace ArdupilotMega if (Progress != null) - Progress((int)(((float)startaddress / (float)length) * 100)); + Progress((int)(((float)startaddress / (float)length) * 100),""); if (!sync()) { diff --git a/Tools/ArdupilotMegaPlanner/ArduinoSTKv2.cs b/Tools/ArdupilotMegaPlanner/ArduinoSTKv2.cs index a55251322b16be2760b1837d6c2ab6efb379854a..3483695ff38d762da9916abd0e80254436dfeb6d 100644 --- a/Tools/ArdupilotMegaPlanner/ArduinoSTKv2.cs +++ b/Tools/ArdupilotMegaPlanner/ArduinoSTKv2.cs @@ -262,7 +262,7 @@ namespace ArdupilotMega if (Progress != null) - Progress((int)(((float)startaddress / (float)length) * 100)); + Progress((int)(((float)startaddress / (float)length) * 100),""); if (command[1] != 0) { @@ -354,7 +354,7 @@ namespace ArdupilotMega if (Progress != null) - Progress((int)(((float)startaddress / (float)length) * 100)); + Progress((int)(((float)startaddress / (float)length) * 100),""); if (command[1] != 0) { diff --git a/Tools/ArdupilotMegaPlanner/ArdupilotMega.csproj b/Tools/ArdupilotMegaPlanner/ArdupilotMega.csproj index e00cfbd8f9cb679fededd12de12ffd63552aa551..a061f0914530563393b8a8d0d3bbf990e0e5f5f4 100644 --- a/Tools/ArdupilotMegaPlanner/ArdupilotMega.csproj +++ b/Tools/ArdupilotMegaPlanner/ArdupilotMega.csproj @@ -22,7 +22,7 @@ <UpdateMode>Background</UpdateMode> <UpdateInterval>7</UpdateInterval> <UpdateIntervalUnits>Days</UpdateIntervalUnits> - <UpdatePeriodically>false</UpdatePeriodically> + <UpdatePeriodically>true</UpdatePeriodically> <UpdateRequired>false</UpdateRequired> <MapFileExtensions>false</MapFileExtensions> <TargetCulture>en-US</TargetCulture> @@ -242,7 +242,7 @@ <Compile Include="CommsTCPSerial.cs" /> <Compile Include="CommsUdpSerial.cs" /> <Compile Include="Controls\ImageLabel.cs"> - <SubType>Component</SubType> + <SubType>UserControl</SubType> </Compile> <Compile Include="Controls\ImageLabel.Designer.cs"> <DependentUpon>ImageLabel.cs</DependentUpon> @@ -250,12 +250,20 @@ <Compile Include="Controls\myGMAP.cs"> <SubType>UserControl</SubType> </Compile> + <Compile Include="Controls\ProgressReporter.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="Controls\ProgressReporter.designer.cs"> + <DependentUpon>ProgressReporter.cs</DependentUpon> + </Compile> <Compile Include="Controls\XorPlus.cs"> <SubType>Form</SubType> </Compile> <Compile Include="Controls\XorPlus.Designer.cs"> <DependentUpon>XorPlus.cs</DependentUpon> </Compile> + <Compile Include="Mavlink\MavlinkCRC.cs" /> + <Compile Include="Mavlink\MavlinkUtil.cs" /> <Compile Include="SerialInput.cs"> <SubType>Form</SubType> </Compile> @@ -301,7 +309,6 @@ <DependentUpon>JoystickSetup.cs</DependentUpon> </Compile> <Compile Include="MAVLinkTypes.cs" /> - <Compile Include="MAVLinkTypesenum.cs" /> <Compile Include="Controls\MyButton.cs"> <SubType>Component</SubType> </Compile> @@ -312,7 +319,7 @@ <Compile Include="Controls\MyLabel.cs"> <SubType>Component</SubType> </Compile> - <Compile Include="MyUserControl.cs"> + <Compile Include="Controls\MyUserControl.cs"> <SubType>UserControl</SubType> </Compile> <Compile Include="ArduinoSTKv2.cs"> @@ -438,9 +445,54 @@ <EmbeddedResource Include="Controls\ImageLabel.resx"> <DependentUpon>ImageLabel.cs</DependentUpon> </EmbeddedResource> + <EmbeddedResource Include="Controls\ProgressReporter.resx"> + <DependentUpon>ProgressReporter.cs</DependentUpon> + </EmbeddedResource> <EmbeddedResource Include="Controls\XorPlus.resx"> <DependentUpon>XorPlus.cs</DependentUpon> </EmbeddedResource> + <EmbeddedResource Include="GCSViews\Configuration.es-ES.resx"> + <DependentUpon>Configuration.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="GCSViews\Firmware.es-ES.resx"> + <DependentUpon>Firmware.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="GCSViews\FlightData.es-ES.resx"> + <DependentUpon>FlightData.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="GCSViews\FlightPlanner.es-ES.resx"> + <DependentUpon>FlightPlanner.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="GCSViews\Help.es-ES.resx"> + <DependentUpon>Help.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="GCSViews\Simulation.es-ES.resx"> + <DependentUpon>Simulation.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="GCSViews\Terminal.es-ES.resx"> + <DependentUpon>Terminal.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="JoystickSetup.es-ES.resx"> + <DependentUpon>JoystickSetup.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="Log.es-ES.resx"> + <DependentUpon>Log.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="LogBrowse.es-ES.resx"> + <DependentUpon>LogBrowse.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="MavlinkLog.es-ES.resx"> + <DependentUpon>MavlinkLog.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="RAW_Sensor.es-ES.resx"> + <DependentUpon>RAW_Sensor.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="SerialInput.es-ES.resx"> + <DependentUpon>SerialInput.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="SerialInput.pl.resx"> + <DependentUpon>SerialInput.cs</DependentUpon> + </EmbeddedResource> <EmbeddedResource Include="SerialInput.resx"> <DependentUpon>SerialInput.cs</DependentUpon> </EmbeddedResource> @@ -713,6 +765,9 @@ <EmbeddedResource Include="SerialOutput.resx"> <DependentUpon>SerialOutput.cs</DependentUpon> </EmbeddedResource> + <EmbeddedResource Include="Setup\Setup.es-ES.resx"> + <DependentUpon>Setup.cs</DependentUpon> + </EmbeddedResource> <EmbeddedResource Include="Setup\Setup.fr.resx"> <DependentUpon>Setup.cs</DependentUpon> </EmbeddedResource> diff --git a/Tools/ArdupilotMegaPlanner/CommsSerialPort.cs b/Tools/ArdupilotMegaPlanner/CommsSerialPort.cs index 2eeb4cea1bd2ac4d76c66ad53924d62de59d1619..8b4101039fcd968df1b8a45a421b7a90fff2d78a 100644 --- a/Tools/ArdupilotMegaPlanner/CommsSerialPort.cs +++ b/Tools/ArdupilotMegaPlanner/CommsSerialPort.cs @@ -12,9 +12,15 @@ namespace ArdupilotMega public void toggleDTR() { - DtrEnable = false; - System.Threading.Thread.Sleep(100); - DtrEnable = true; + base.DtrEnable = false; + base.RtsEnable = false; + + System.Threading.Thread.Sleep(50); + + base.DtrEnable = true; + base.RtsEnable = true; + + System.Threading.Thread.Sleep(50); } } } diff --git a/Tools/ArdupilotMegaPlanner/CommsTCPSerial.cs b/Tools/ArdupilotMegaPlanner/CommsTCPSerial.cs index 006f3f343910502cdaede4d315ba3da7ddacfde3..8bfe204897cc82812197b7ca2d02438abd7ac0f7 100644 --- a/Tools/ArdupilotMegaPlanner/CommsTCPSerial.cs +++ b/Tools/ArdupilotMegaPlanner/CommsTCPSerial.cs @@ -81,11 +81,11 @@ namespace System.IO.Ports string host = "127.0.0.1"; if (Windows.Forms.DialogResult.Cancel == ArdupilotMega.Common.InputBox("remote host", "Enter host name/ip (ensure remote end is already started)", ref host)) { - return; + throw new Exception("Canceled by request"); } if (Windows.Forms.DialogResult.Cancel == ArdupilotMega.Common.InputBox("remote Port", "Enter remote port", ref dest)) { - return; + throw new Exception("Canceled by request"); } Port = dest; @@ -94,6 +94,8 @@ namespace System.IO.Ports client.NoDelay = true; client.Client.NoDelay = true; + VerifyConnected(); + return; } diff --git a/Tools/ArdupilotMegaPlanner/Controls/ImageLabel.cs b/Tools/ArdupilotMegaPlanner/Controls/ImageLabel.cs index a5524d2cd489e1f5fe25f46b8e172345a4880681..2b16d6337d72d13bc10383adbbad3fcdc528afe8 100644 --- a/Tools/ArdupilotMegaPlanner/Controls/ImageLabel.cs +++ b/Tools/ArdupilotMegaPlanner/Controls/ImageLabel.cs @@ -9,7 +9,7 @@ using System.Windows.Forms; namespace ArdupilotMega { - public partial class ImageLabel : ContainerControl + public partial class ImageLabel : UserControl //ContainerControl { public new event EventHandler Click; @@ -18,6 +18,9 @@ namespace ArdupilotMega public ImageLabel() { + text = ""; + picture = new Bitmap(640,480); + InitializeComponent(); } diff --git a/Tools/ArdupilotMegaPlanner/Controls/MyButton.cs b/Tools/ArdupilotMegaPlanner/Controls/MyButton.cs index 82f28d7e56c52daf3dfb5536fa9a28031b0fa5db..d95acf2373aa597802f65b23d0fbe5ac0894947f 100644 --- a/Tools/ArdupilotMegaPlanner/Controls/MyButton.cs +++ b/Tools/ArdupilotMegaPlanner/Controls/MyButton.cs @@ -17,56 +17,97 @@ namespace ArdupilotMega bool mouseover = false; bool mousedown = false; + bool inOnPaint = false; + protected override void OnPaint(PaintEventArgs pevent) { //base.OnPaint(pevent); - Graphics gr = pevent.Graphics; + if (inOnPaint) + return; - Rectangle outside = new Rectangle(0,0,this.Width,this.Height); + inOnPaint = true; - LinearGradientBrush linear = new LinearGradientBrush(outside,Color.FromArgb(0x94,0xc1,0x1f),Color.FromArgb(0xcd,0xe2,0x96),LinearGradientMode.Vertical); + try + { + Graphics gr = pevent.Graphics; - Pen mypen = new Pen(Color.FromArgb(0x79,0x94,0x29),2); + // gr.SmoothingMode = SmoothingMode.AntiAlias; - gr.FillRectangle(linear,outside); + Rectangle outside = new Rectangle(0, 0, this.Width, this.Height); - gr.DrawRectangle(mypen,outside); + LinearGradientBrush linear = new LinearGradientBrush(outside, Color.FromArgb(0x94, 0xc1, 0x1f), Color.FromArgb(0xcd, 0xe2, 0x96), LinearGradientMode.Vertical); - SolidBrush mybrush = new SolidBrush(Color.FromArgb(0x40,0x57,0x04)); + Pen mypen = new Pen(Color.FromArgb(0x79, 0x94, 0x29), 2); + /* + gr.FillRectangle(new SolidBrush(Color.FromArgb(0x26, 0x27, 0x28)), outside); - if (mouseover) - { - SolidBrush brush = new SolidBrush(Color.FromArgb(73, 0x2b, 0x3a, 0x03)); + GraphicsPath outline = new GraphicsPath(); - gr.FillRectangle(brush, 0, 0, this.Width, this.Height); - } - if (mousedown) - { - SolidBrush brush = new SolidBrush(Color.FromArgb(73, 0x2b, 0x3a, 0x03)); + float wid = this.Height / 5f; + float widright = wid + 1; - gr.FillRectangle(brush, 0, 0, this.Width, this.Height); - } + // tl + outline.AddArc(0, 0, wid, wid, 180, 90); + // top line + outline.AddLine(wid, 0, this.Width - widright, 0); + // tr + outline.AddArc(this.Width - widright, 0, wid, wid, 270, 90); + // br + outline.AddArc(this.Width - widright, this.Height - widright, wid, wid, 0, 90); + // bottom line + outline.AddLine(wid, this.Height - 1, this.Width - widright, this.Height - 1); + // bl + outline.AddArc(0, this.Height - widright, wid, wid, 90, 90); - if (!this.Enabled) - { - SolidBrush brush = new SolidBrush(Color.FromArgb(150, 0x2b, 0x3a, 0x03)); - gr.FillRectangle(brush, 0, 0, this.Width, this.Height); - } + gr.FillPath(linear, outline); + + gr.DrawPath(mypen, outline); + + */ + gr.FillRectangle(linear, outside); + gr.DrawRectangle(mypen, outside); - StringFormat stringFormat = new StringFormat(); - stringFormat.Alignment = StringAlignment.Center; - stringFormat.LineAlignment = StringAlignment.Center; - string display = this.Text; - int amppos = display.IndexOf('&'); - if (amppos != -1) - display = display.Remove(amppos,1); + SolidBrush mybrush = new SolidBrush(Color.FromArgb(0x40, 0x57, 0x04)); - gr.DrawString(display, this.Font, mybrush, outside, stringFormat); + if (mouseover) + { + SolidBrush brush = new SolidBrush(Color.FromArgb(73, 0x2b, 0x3a, 0x03)); + gr.FillRectangle(brush, 0, 0, this.Width, this.Height); + } + if (mousedown) + { + SolidBrush brush = new SolidBrush(Color.FromArgb(73, 0x2b, 0x3a, 0x03)); + + gr.FillRectangle(brush, 0, 0, this.Width, this.Height); + } + + if (!this.Enabled) + { + SolidBrush brush = new SolidBrush(Color.FromArgb(150, 0x2b, 0x3a, 0x03)); + + gr.FillRectangle(brush, 0, 0, this.Width, this.Height); + } + + + StringFormat stringFormat = new StringFormat(); + stringFormat.Alignment = StringAlignment.Center; + stringFormat.LineAlignment = StringAlignment.Center; + + string display = this.Text; + int amppos = display.IndexOf('&'); + if (amppos != -1) + display = display.Remove(amppos, 1); + + gr.DrawString(display, this.Font, mybrush, outside, stringFormat); + } + catch { } + + inOnPaint = false; } protected override void OnClick(EventArgs e) diff --git a/Tools/ArdupilotMegaPlanner/MyUserControl.cs b/Tools/ArdupilotMegaPlanner/Controls/MyUserControl.cs similarity index 95% rename from Tools/ArdupilotMegaPlanner/MyUserControl.cs rename to Tools/ArdupilotMegaPlanner/Controls/MyUserControl.cs index 83213fe8b7f3691c9a320a49b2c27aad8aaffebd..0a7a76479355c6d666a28be965265c6b1816cb8f 100644 --- a/Tools/ArdupilotMegaPlanner/MyUserControl.cs +++ b/Tools/ArdupilotMegaPlanner/Controls/MyUserControl.cs @@ -1,19 +1,19 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace System.Windows.Forms -{ - public class MyUserControl : System.Windows.Forms.UserControl - { - protected override void WndProc(ref Message m) - { - try - { - base.WndProc(ref m); - } - catch { } - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace System.Windows.Forms +{ + public class MyUserControl : System.Windows.Forms.UserControl + { + protected override void WndProc(ref Message m) + { + try + { + base.WndProc(ref m); + } + catch { } + } + } +} diff --git a/Tools/ArdupilotMegaPlanner/Controls/ProgressReporter.cs b/Tools/ArdupilotMegaPlanner/Controls/ProgressReporter.cs new file mode 100644 index 0000000000000000000000000000000000000000..33389e8c03aed18f4178e0c432912ebe917be523 --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/Controls/ProgressReporter.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace ArdupilotMega +{ + public partial class ProgressReporter : Form + { + bool cancel = false; + + public ProgressReporter() + { + InitializeComponent(); + cancel = false; + } + + private void btnCancel_Click(object sender, EventArgs e) + { + cancel = true; + this.Close(); + } + + public void updateProgressAndStatus(int progress, string status) + { + //Console.WriteLine(progress + " " + status); + + if (cancel) + { + throw new Exception("User Canceled"); + } + + if (this.IsDisposed) + { + return; + } + + try + { + this.Invoke((MethodInvoker)delegate + { + + lblProgressMessage.Text = status; + if (progress == -1) + { + this.progressBar1.Style = ProgressBarStyle.Marquee; + } + else + { + this.progressBar1.Style = ProgressBarStyle.Continuous; + this.progressBar1.Value = progress; + } + }); + } + catch { } + + System.Windows.Forms.Application.DoEvents(); + } + } +} diff --git a/Tools/ArdupilotMegaPlanner/Controls/ProgressReporter.designer.cs b/Tools/ArdupilotMegaPlanner/Controls/ProgressReporter.designer.cs new file mode 100644 index 0000000000000000000000000000000000000000..d24768765ecc9debe70472b7b7eacb17b424ae3b --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/Controls/ProgressReporter.designer.cs @@ -0,0 +1,94 @@ +using System.Windows.Forms; + +namespace ArdupilotMega +{ + partial class ProgressReporter + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.progressBar1 = new System.Windows.Forms.ProgressBar(); + this.lblProgressMessage = new System.Windows.Forms.Label(); + this.btnCancel = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // progressBar1 + // + this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.progressBar1.Location = new System.Drawing.Point(12, 82); + this.progressBar1.Name = "progressBar1"; + this.progressBar1.Size = new System.Drawing.Size(277, 13); + this.progressBar1.TabIndex = 0; + // + // lblProgressMessage + // + this.lblProgressMessage.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lblProgressMessage.Location = new System.Drawing.Point(13, 13); + this.lblProgressMessage.Name = "lblProgressMessage"; + this.lblProgressMessage.Size = new System.Drawing.Size(276, 66); + this.lblProgressMessage.TabIndex = 1; + this.lblProgressMessage.Text = "label1"; + // + // btnCancel + // + this.btnCancel.Location = new System.Drawing.Point(213, 109); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(75, 23); + this.btnCancel.TabIndex = 2; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // + // ProgressReporter + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(306, 144); + this.ControlBox = false; + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.lblProgressMessage); + this.Controls.Add(this.progressBar1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ProgressReporter"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Progress"; + this.ResumeLayout(false); + + } + + #endregion + + private ProgressBar progressBar1; + private System.Windows.Forms.Label lblProgressMessage; + private Button btnCancel; + } +} \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/test.resx b/Tools/ArdupilotMegaPlanner/Controls/ProgressReporter.resx similarity index 97% rename from Tools/ArdupilotMegaPlanner/GCSViews/test.resx rename to Tools/ArdupilotMegaPlanner/Controls/ProgressReporter.resx index 5ea0895e324fa7a86681adc56938bad2f2367ba0..7080a7d118e8cd7ec668e9bb0d8e90767e0c7a3c 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/test.resx +++ b/Tools/ArdupilotMegaPlanner/Controls/ProgressReporter.resx @@ -1,120 +1,120 @@ -<?xml version="1.0" encoding="utf-8"?> -<root> - <!-- - Microsoft ResX Schema - - Version 2.0 - - The primary goals of this format is to allow a simple XML format - that is mostly human readable. The generation and parsing of the - various data types are done through the TypeConverter classes - associated with the data types. - - Example: - - ... ado.net/XML headers & schema ... - <resheader name="resmimetype">text/microsoft-resx</resheader> - <resheader name="version">2.0</resheader> - <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> - <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> - <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> - <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> - <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> - <value>[base64 mime encoded serialized .NET Framework object]</value> - </data> - <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> - <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> - <comment>This is a comment</comment> - </data> - - There are any number of "resheader" rows that contain simple - name/value pairs. - - Each data row contains a name, and value. The row also contains a - type or mimetype. Type corresponds to a .NET class that support - text/value conversion through the TypeConverter architecture. - Classes that don't support this are serialized and stored with the - mimetype set. - - The mimetype is used for serialized objects, and tells the - ResXResourceReader how to depersist the object. This is currently not - extensible. For a given mimetype the value must be set accordingly: - - Note - application/x-microsoft.net.object.binary.base64 is the format - that the ResXResourceWriter will generate, however the reader can - read any of the formats listed below. - - mimetype: application/x-microsoft.net.object.binary.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.soap.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Soap.SoapFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.bytearray.base64 - value : The object must be serialized into a byte array - : using a System.ComponentModel.TypeConverter - : and then encoded with base64 encoding. - --> - <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> - <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> - <xsd:element name="root" msdata:IsDataSet="true"> - <xsd:complexType> - <xsd:choice maxOccurs="unbounded"> - <xsd:element name="metadata"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" /> - </xsd:sequence> - <xsd:attribute name="name" use="required" type="xsd:string" /> - <xsd:attribute name="type" type="xsd:string" /> - <xsd:attribute name="mimetype" type="xsd:string" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="assembly"> - <xsd:complexType> - <xsd:attribute name="alias" type="xsd:string" /> - <xsd:attribute name="name" type="xsd:string" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="data"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> - <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> - <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="resheader"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" /> - </xsd:complexType> - </xsd:element> - </xsd:choice> - </xsd:complexType> - </xsd:element> - </xsd:schema> - <resheader name="resmimetype"> - <value>text/microsoft-resx</value> - </resheader> - <resheader name="version"> - <value>2.0</value> - </resheader> - <resheader name="reader"> - <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <resheader name="writer"> - <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> </root> \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/Controls/myGMAP.cs b/Tools/ArdupilotMegaPlanner/Controls/myGMAP.cs index 8af08373f736430c1ece46c38cd7f71da1c7f2c5..38e37a84be36ece4f7ab1f7f62ad892f863dcbf3 100644 --- a/Tools/ArdupilotMegaPlanner/Controls/myGMAP.cs +++ b/Tools/ArdupilotMegaPlanner/Controls/myGMAP.cs @@ -7,15 +7,19 @@ namespace ArdupilotMega { class myGMAP : GMap.NET.WindowsForms.GMapControl { - public bool inOnPaint = false; + public bool inOnPaint = false; + string otherthread = ""; protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { if (inOnPaint) { - Console.WriteLine("Was in onpaint Gmap th:" + System.Threading.Thread.CurrentThread.Name); + Console.WriteLine("Was in onpaint Gmap th:" + System.Threading.Thread.CurrentThread.Name + " in " + otherthread); return; } + + otherthread = System.Threading.Thread.CurrentThread.Name; + inOnPaint = true; try diff --git a/Tools/ArdupilotMegaPlanner/CurrentState.cs b/Tools/ArdupilotMegaPlanner/CurrentState.cs index fa106366018da8aa0e38516c57bbfb00315eca4a..af78701f3f94ad7d1333ff23a7b203ca504cfa00 100644 --- a/Tools/ArdupilotMegaPlanner/CurrentState.cs +++ b/Tools/ArdupilotMegaPlanner/CurrentState.cs @@ -2,10 +2,11 @@ using System.Collections.Generic; using System.Text; using System.ComponentModel; +using ArdupilotMega.Mavlink; namespace ArdupilotMega { - public class CurrentState: ICloneable + public class CurrentState : ICloneable { // multipliers public float multiplierdist = 1; @@ -61,13 +62,13 @@ namespace ArdupilotMega public float altd100 { get { return (alt / 100) % 10; } } // accel - public float ax { get; set; } - public float ay { get; set; } - public float az { get; set; } + public float ax { get; set; } + public float ay { get; set; } + public float az { get; set; } // gyro - public float gx { get; set; } - public float gy { get; set; } - public float gz { get; set; } + public float gx { get; set; } + public float gy { get; set; } + public float gz { get; set; } // mag public float mx { get; set; } public float my { get; set; } @@ -77,14 +78,14 @@ namespace ArdupilotMega public float turnrate { get { if (groundspeed <= 1) return 0; return (roll * 9.8f) / groundspeed; } } //radio - public float ch1in { get; set; } - public float ch2in { get; set; } - public float ch3in { get; set; } - public float ch4in { get; set; } - public float ch5in { get; set; } - public float ch6in { get; set; } - public float ch7in { get; set; } - public float ch8in { get; set; } + public float ch1in { get; set; } + public float ch2in { get; set; } + public float ch3in { get; set; } + public float ch4in { get; set; } + public float ch5in { get; set; } + public float ch6in { get; set; } + public float ch7in { get; set; } + public float ch8in { get; set; } // motors public float ch1out { get; set; } @@ -95,8 +96,10 @@ namespace ArdupilotMega public float ch6out { get; set; } public float ch7out { get; set; } public float ch8out { get; set; } - public float ch3percent { - get { + public float ch3percent + { + get + { try { if (MainV2.comPort.param.ContainsKey("RC3_MIN")) @@ -108,10 +111,11 @@ namespace ArdupilotMega return 0; } } - catch { + catch + { return 0; } - } + } } //nav state @@ -121,7 +125,7 @@ namespace ArdupilotMega public float target_bearing { get; set; } public float wp_dist { get { return (_wpdist * multiplierdist); } set { _wpdist = value; } } public float alt_error { get { return _alt_error * multiplierdist; } set { _alt_error = value; } } - public float ber_error { get { return (target_bearing - yaw); } set { } } + public float ber_error { get { return (target_bearing - yaw); } set { } } public float aspd_error { get { return _aspd_error * multiplierspeed; } set { _aspd_error = value; } } public float xtrack_error { get; set; } public float wpno { get; set; } @@ -132,10 +136,10 @@ namespace ArdupilotMega float _alt_error; public float targetaltd100 { get { return ((alt + alt_error) / 100) % 10; } } - public float targetalt { get { return (float)Math.Round(alt + alt_error,0); } } + public float targetalt { get { return (float)Math.Round(alt + alt_error, 0); } } //airspeed_error = (airspeed_error - airspeed); - public float targetairspeed { get { return (float)Math.Round(airspeed + aspd_error / 100,0); } } + public float targetairspeed { get { return (float)Math.Round(airspeed + aspd_error / 100, 0); } } //message @@ -187,7 +191,6 @@ namespace ArdupilotMega public ushort rcoverridech8 { get; set; } internal PointLatLngAlt HomeLocation = new PointLatLngAlt(); - public float DistToMAV { get @@ -238,7 +241,6 @@ namespace ArdupilotMega return (float)bearing; } } - // current firmware public MainV2.Firmwares firmware = MainV2.Firmwares.ArduPlane; public float freemem { get; set; } @@ -259,6 +261,7 @@ namespace ArdupilotMega // reference public DateTime datetime { get; set; } + public CurrentState() { mode = ""; @@ -277,7 +280,7 @@ namespace ArdupilotMega private DateTime lastupdate = DateTime.Now; private DateTime lastwindcalc = DateTime.Now; - + public void UpdateCurrentSettings(System.Windows.Forms.BindingSource bs) { UpdateCurrentSettings(bs, false, MainV2.comPort); @@ -311,28 +314,22 @@ namespace ArdupilotMega try { - while (messages.Count > 5) - { - messages.RemoveAt(0); - } - + while (messages.Count > 5) + { + messages.RemoveAt(0); + } messages.Add(logdata + "\n"); } catch { } - mavinterface.packets[MAVLink.MAVLINK_MSG_ID_STATUSTEXT] = null; } - if (mavinterface.packets[MAVLink.MAVLINK_MSG_ID_RC_CHANNELS_SCALED] != null) // hil - { - var hil = new ArdupilotMega.MAVLink.__mavlink_rc_channels_scaled_t(); - - object temp = hil; + byte[] bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_RC_CHANNELS_SCALED]; - MAVLink.ByteArrayToStructure(mavinterface.packets[MAVLink.MAVLINK_MSG_ID_RC_CHANNELS_SCALED], ref temp, 6); - - hil = (MAVLink.__mavlink_rc_channels_scaled_t)(temp); + if (bytearray != null) // hil + { + var hil = bytearray.ByteArrayToStructure<MAVLink.__mavlink_rc_channels_scaled_t>(6); hilch1 = hil.chan1_scaled; hilch2 = hil.chan2_scaled; @@ -346,15 +343,11 @@ namespace ArdupilotMega //MAVLink.packets[MAVLink.MAVLINK_MSG_ID_RC_CHANNELS_SCALED] = null; } - if (mavinterface.packets[MAVLink.MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT] != null) - { - MAVLink.__mavlink_nav_controller_output_t nav = new MAVLink.__mavlink_nav_controller_output_t(); - - object temp = nav; - - MAVLink.ByteArrayToStructure(mavinterface.packets[MAVLink.MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT], ref temp, 6); + bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT]; - nav = (MAVLink.__mavlink_nav_controller_output_t)(temp); + if (bytearray != null) + { + var nav = bytearray.ByteArrayToStructure<MAVLink.__mavlink_nav_controller_output_t>(6); nav_roll = nav.nav_roll; nav_pitch = nav.nav_pitch; @@ -368,15 +361,12 @@ namespace ArdupilotMega //MAVLink.packets[MAVLink.MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT] = null; } #if MAVLINK10 - if (mavinterface.packets[ArdupilotMega.MAVLink.MAVLINK_MSG_ID_HEARTBEAT] != null) - { - ArdupilotMega.MAVLink.__mavlink_heartbeat_t hb = new ArdupilotMega.MAVLink.__mavlink_heartbeat_t(); - - object temp = hb; - - MAVLink.ByteArrayToStructure(mavinterface.packets[ArdupilotMega.MAVLink.MAVLINK_MSG_ID_HEARTBEAT], ref temp, 6); - hb = (ArdupilotMega.MAVLink.__mavlink_heartbeat_t)(temp); + + bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_HEARTBEAT]; + if (bytearray != null) + { + var hb = bytearray.ByteArrayToStructure<MAVLink.__mavlink_heartbeat_t>(6); string oldmode = mode; @@ -465,15 +455,10 @@ namespace ArdupilotMega } - if (mavinterface.packets[ArdupilotMega.MAVLink.MAVLINK_MSG_ID_SYS_STATUS] != null) + bytearray = mavinterface.packets[ArdupilotMega.MAVLink.MAVLINK_MSG_ID_SYS_STATUS]; + if (bytearray != null) { - ArdupilotMega.MAVLink.__mavlink_sys_status_t sysstatus = new ArdupilotMega.MAVLink.__mavlink_sys_status_t(); - - object temp = sysstatus; - - MAVLink.ByteArrayToStructure(mavinterface.packets[ArdupilotMega.MAVLink.MAVLINK_MSG_ID_SYS_STATUS], ref temp, 6); - - sysstatus = (ArdupilotMega.MAVLink.__mavlink_sys_status_t)(temp); + var sysstatus = bytearray.ByteArrayToStructure<MAVLink.__mavlink_sys_status_t>(6); battery_voltage = sysstatus.voltage_battery; battery_remaining = sysstatus.battery_remaining; @@ -484,15 +469,11 @@ namespace ArdupilotMega } #else - if (mavinterface.packets[ArdupilotMega.MAVLink.MAVLINK_MSG_ID_SYS_STATUS] != null) - { - ArdupilotMega.MAVLink.__mavlink_sys_status_t sysstatus = new ArdupilotMega.MAVLink.__mavlink_sys_status_t(); - - object temp = sysstatus; - - MAVLink.ByteArrayToStructure(mavinterface.packets[ArdupilotMega.MAVLink.MAVLINK_MSG_ID_SYS_STATUS], ref temp, 6); + bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_SYS_STATUS]; - sysstatus = (ArdupilotMega.MAVLink.__mavlink_sys_status_t)(temp); + if (bytearray != null) + { + var sysstatus = bytearray.ByteArrayToStructure<MAVLink.__mavlink_sys_status_t>(6); armed = sysstatus.status; @@ -603,34 +584,21 @@ namespace ArdupilotMega } //MAVLink.packets[ArdupilotMega.MAVLink.MAVLINK_MSG_ID_SYS_STATUS] = null; - } + } #endif - if (mavinterface.packets[MAVLink.MAVLINK_MSG_ID_SCALED_PRESSURE] != null) + bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_SCALED_PRESSURE]; + if (bytearray != null) { - var pres = new ArdupilotMega.MAVLink.__mavlink_scaled_pressure_t(); - - object temp = pres; - - MAVLink.ByteArrayToStructure(mavinterface.packets[MAVLink.MAVLINK_MSG_ID_SCALED_PRESSURE], ref temp, 6); - - pres = (MAVLink.__mavlink_scaled_pressure_t)(temp); - + var pres = bytearray.ByteArrayToStructure<MAVLink.__mavlink_scaled_pressure_t>(6); press_abs = pres.press_abs; - - press_temp = pres.temperature; - + press_temp = pres.temperature; } - if (mavinterface.packets[MAVLink.MAVLINK_MSG_ID_SENSOR_OFFSETS] != null) + bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_SENSOR_OFFSETS]; + if (bytearray != null) { - var sensofs = new ArdupilotMega.MAVLink.__mavlink_sensor_offsets_t(); - - object temp = sensofs; - - MAVLink.ByteArrayToStructure(mavinterface.packets[MAVLink.MAVLINK_MSG_ID_SENSOR_OFFSETS], ref temp, 6); - - sensofs = (MAVLink.__mavlink_sensor_offsets_t)(temp); + var sensofs = bytearray.ByteArrayToStructure<MAVLink.__mavlink_sensor_offsets_t>(6); mag_ofs_x = sensofs.mag_ofs_x; mag_ofs_y = sensofs.mag_ofs_y; @@ -650,15 +618,11 @@ namespace ArdupilotMega } - if (mavinterface.packets[MAVLink.MAVLINK_MSG_ID_ATTITUDE] != null) - { - var att = new ArdupilotMega.MAVLink.__mavlink_attitude_t(); - - object temp = att; - - MAVLink.ByteArrayToStructure(mavinterface.packets[MAVLink.MAVLINK_MSG_ID_ATTITUDE], ref temp, 6); + bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_ATTITUDE]; - att = (MAVLink.__mavlink_attitude_t)(temp); + if (bytearray != null) + { + var att = bytearray.ByteArrayToStructure<MAVLink.__mavlink_attitude_t>(6); roll = att.roll * rad2deg; pitch = att.pitch * rad2deg; @@ -669,15 +633,10 @@ namespace ArdupilotMega //MAVLink.packets[MAVLink.MAVLINK_MSG_ID_ATTITUDE] = null; } #if MAVLINK10 - if (mavinterface.packets[MAVLink.MAVLINK_MSG_ID_GPS_RAW_INT] != null) + bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_GPS_RAW_INT]; + if (bytearray != null) { - var gps = new MAVLink.__mavlink_gps_raw_int_t(); - - object temp = gps; - - MAVLink.ByteArrayToStructure(mavinterface.packets[MAVLink.MAVLINK_MSG_ID_GPS_RAW_INT], ref temp, 6); - - gps = (MAVLink.__mavlink_gps_raw_int_t)(temp); + var gps = bytearray.ByteArrayToStructure<MAVLink.__mavlink_gps_raw_int_t>(6); lat = gps.lat * 1.0e-7f; lng = gps.lon * 1.0e-7f; @@ -693,17 +652,12 @@ namespace ArdupilotMega //MAVLink.packets[MAVLink.MAVLINK_MSG_ID_GPS_RAW] = null; } - #else +#else - if (mavinterface.packets[MAVLink.MAVLINK_MSG_ID_GPS_RAW] != null) + bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_GPS_RAW]; + if (bytearray != null) { - var gps = new MAVLink.__mavlink_gps_raw_t(); - - object temp = gps; - - MAVLink.ByteArrayToStructure(mavinterface.packets[MAVLink.MAVLINK_MSG_ID_GPS_RAW], ref temp, 6); - - gps = (MAVLink.__mavlink_gps_raw_t)(temp); + var gps = bytearray.ByteArrayToStructure<MAVLink.__mavlink_gps_raw_t>(6); lat = gps.lat; lng = gps.lon; @@ -717,48 +671,33 @@ namespace ArdupilotMega groundspeed = gps.v; groundcourse = gps.hdg; - //MAVLink.packets[MAVLink.MAVLINK_MSG_ID_GPS_RAW] = null; - } + } #endif - if (mavinterface.packets[MAVLink.MAVLINK_MSG_ID_GPS_STATUS] != null) - { - var gps = new MAVLink.__mavlink_gps_status_t(); - - object temp = gps; - - MAVLink.ByteArrayToStructure(mavinterface.packets[MAVLink.MAVLINK_MSG_ID_GPS_STATUS], ref temp, 6); - - gps = (MAVLink.__mavlink_gps_status_t)(temp); + bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_GPS_STATUS]; + if (bytearray != null) + { + var gps = bytearray.ByteArrayToStructure<MAVLink.__mavlink_gps_status_t>(6); satcount = gps.satellites_visible; } - if (mavinterface.packets[MAVLink.MAVLINK_MSG_ID_GLOBAL_POSITION_INT] != null) - { - var loc = new MAVLink.__mavlink_global_position_int_t(); - - object temp = loc; - MAVLink.ByteArrayToStructure(mavinterface.packets[MAVLink.MAVLINK_MSG_ID_GLOBAL_POSITION_INT], ref temp, 6); - loc = (MAVLink.__mavlink_global_position_int_t)(temp); + byte[] bytes = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_GLOBAL_POSITION_INT]; + if (bytes != null) + { + var loc = bytearray.ByteArrayToStructure<MAVLink.__mavlink_global_position_int_t>(6); //alt = loc.alt / 1000.0f; lat = loc.lat / 10000000.0f; lng = loc.lon / 10000000.0f; - } #if MAVLINK10 - if (mavinterface.packets[ArdupilotMega.MAVLink.MAVLINK_MSG_ID_MISSION_CURRENT] != null) + bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_MISSION_CURRENT]; + if (bytearray != null) { - ArdupilotMega.MAVLink.__mavlink_mission_current_t wpcur = new ArdupilotMega.MAVLink.__mavlink_mission_current_t(); - - object temp = wpcur; - - MAVLink.ByteArrayToStructure(mavinterface.packets[ArdupilotMega.MAVLink.MAVLINK_MSG_ID_MISSION_CURRENT], ref temp, 6); - - wpcur = (ArdupilotMega.MAVLink.__mavlink_mission_current_t)(temp); - + var wpcur = bytearray.ByteArrayToStructure<MAVLink.__mavlink_mission_current_t>(6); + int oldwp = (int)wpno; wpno = wpcur.seq; @@ -770,31 +709,21 @@ namespace ArdupilotMega //MAVLink.packets[ArdupilotMega.MAVLink.MAVLINK_MSG_ID_WAYPOINT_CURRENT] = null; } - #else - if (mavinterface.packets[MAVLink.MAVLINK_MSG_ID_GLOBAL_POSITION] != null) - { - var loc = new MAVLink.__mavlink_global_position_t(); - - object temp = loc; - - MAVLink.ByteArrayToStructure(mavinterface.packets[MAVLink.MAVLINK_MSG_ID_GLOBAL_POSITION], ref temp, 6); - - loc = (MAVLink.__mavlink_global_position_t)(temp); +#else + bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_GLOBAL_POSITION]; + if (bytearray != null) + { + var loc = bytearray.ByteArrayToStructure<MAVLink.__mavlink_global_position_t>(6); alt = loc.alt; lat = loc.lat; lng = loc.lon; - } - if (mavinterface.packets[ArdupilotMega.MAVLink.MAVLINK_MSG_ID_WAYPOINT_CURRENT] != null) - { - ArdupilotMega.MAVLink.__mavlink_waypoint_current_t wpcur = new ArdupilotMega.MAVLink.__mavlink_waypoint_current_t(); - object temp = wpcur; - - MAVLink.ByteArrayToStructure(mavinterface.packets[ArdupilotMega.MAVLink.MAVLINK_MSG_ID_WAYPOINT_CURRENT], ref temp, 6); - - wpcur = (ArdupilotMega.MAVLink.__mavlink_waypoint_current_t)(temp); + bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_WAYPOINT_CURRENT]; + if (bytearray != null) + { + var wpcur = bytearray.ByteArrayToStructure<MAVLink.__mavlink_waypoint_current_t>(6); int oldwp = (int)wpno; @@ -806,18 +735,13 @@ namespace ArdupilotMega } //MAVLink.packets[ArdupilotMega.MAVLink.MAVLINK_MSG_ID_WAYPOINT_CURRENT] = null; - } - + } + #endif - if (mavinterface.packets[MAVLink.MAVLINK_MSG_ID_RC_CHANNELS_RAW] != null) + bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_RC_CHANNELS_RAW]; + if (bytearray != null) { - var rcin = new MAVLink.__mavlink_rc_channels_raw_t(); - - object temp = rcin; - - MAVLink.ByteArrayToStructure(mavinterface.packets[MAVLink.MAVLINK_MSG_ID_RC_CHANNELS_RAW], ref temp, 6); - - rcin = (MAVLink.__mavlink_rc_channels_raw_t)(temp); + var rcin = bytearray.ByteArrayToStructure<MAVLink.__mavlink_rc_channels_raw_t>(6); ch1in = rcin.chan1_raw; ch2in = rcin.chan2_raw; @@ -831,15 +755,10 @@ namespace ArdupilotMega //MAVLink.packets[MAVLink.MAVLINK_MSG_ID_RC_CHANNELS_RAW] = null; } - if (mavinterface.packets[MAVLink.MAVLINK_MSG_ID_SERVO_OUTPUT_RAW] != null) + bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_SERVO_OUTPUT_RAW]; + if (bytearray != null) { - var servoout = new MAVLink.__mavlink_servo_output_raw_t(); - - object temp = servoout; - - MAVLink.ByteArrayToStructure(mavinterface.packets[MAVLink.MAVLINK_MSG_ID_SERVO_OUTPUT_RAW], ref temp, 6); - - servoout = (MAVLink.__mavlink_servo_output_raw_t)(temp); + var servoout = bytearray.ByteArrayToStructure<MAVLink.__mavlink_servo_output_raw_t>(6); ch1out = servoout.servo1_raw; ch2out = servoout.servo2_raw; @@ -853,15 +772,11 @@ namespace ArdupilotMega //MAVLink.packets[MAVLink.MAVLINK_MSG_ID_SERVO_OUTPUT_RAW] = null; } - if (mavinterface.packets[MAVLink.MAVLINK_MSG_ID_RAW_IMU] != null) - { - var imu = new MAVLink.__mavlink_raw_imu_t(); - - object temp = imu; - - MAVLink.ByteArrayToStructure(mavinterface.packets[MAVLink.MAVLINK_MSG_ID_RAW_IMU], ref temp, 6); - imu = (MAVLink.__mavlink_raw_imu_t)(temp); + bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_RAW_IMU]; + if (bytearray != null) + { + var imu = bytearray.ByteArrayToStructure<MAVLink.__mavlink_raw_imu_t>(6); gx = imu.xgyro; gy = imu.ygyro; @@ -878,15 +793,10 @@ namespace ArdupilotMega //MAVLink.packets[MAVLink.MAVLINK_MSG_ID_RAW_IMU] = null; } - if (mavinterface.packets[MAVLink.MAVLINK_MSG_ID_SCALED_IMU] != null) + bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_SCALED_IMU]; + if (bytearray != null) { - var imu = new MAVLink.__mavlink_scaled_imu_t(); - - object temp = imu; - - MAVLink.ByteArrayToStructure(mavinterface.packets[MAVLink.MAVLINK_MSG_ID_SCALED_IMU], ref temp, 6); - - imu = (MAVLink.__mavlink_scaled_imu_t)(temp); + var imu = bytearray.ByteArrayToStructure<MAVLink.__mavlink_scaled_imu_t>(6); gx = imu.xgyro; gy = imu.ygyro; @@ -899,30 +809,17 @@ namespace ArdupilotMega //MAVLink.packets[MAVLink.MAVLINK_MSG_ID_RAW_IMU] = null; } - if (mavinterface.packets[MAVLink.MAVLINK_MSG_ID_VFR_HUD] != null) - { - MAVLink.__mavlink_vfr_hud_t vfr = new MAVLink.__mavlink_vfr_hud_t(); - - object temp = vfr; - - MAVLink.ByteArrayToStructure(mavinterface.packets[MAVLink.MAVLINK_MSG_ID_VFR_HUD], ref temp, 6); - vfr = (MAVLink.__mavlink_vfr_hud_t)(temp); + bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_VFR_HUD]; + if (bytearray != null) + { + var vfr = bytearray.ByteArrayToStructure<MAVLink.__mavlink_vfr_hud_t>(6); groundspeed = vfr.groundspeed; airspeed = vfr.airspeed; alt = vfr.alt; // this might include baro - /* - if (vfr.throttle > 150 || vfr.throttle < 0) - { - Console.WriteLine(0); - } - else - { - Console.WriteLine(vfr.throttle); - } - */ + //climbrate = vfr.climb; if ((DateTime.Now - lastalt).TotalSeconds >= 0.1 && oldalt != alt) @@ -938,22 +835,15 @@ namespace ArdupilotMega //MAVLink.packets[MAVLink.MAVLINK_MSG_ID_VFR_HUD] = null; } - if (mavinterface.packets[MAVLink.MAVLINK_MSG_ID_MEMINFO] != null) // hil + bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_MEMINFO]; + if (bytearray != null) { - var mem = new ArdupilotMega.MAVLink.__mavlink_meminfo_t(); - - object temp = mem; - - MAVLink.ByteArrayToStructure(mavinterface.packets[MAVLink.MAVLINK_MSG_ID_MEMINFO], ref temp, 6); - - mem = (MAVLink.__mavlink_meminfo_t)(temp); - + var mem = bytearray.ByteArrayToStructure<MAVLink.__mavlink_meminfo_t>(6); freemem = mem.freemem; brklevel = mem.brkval; - } - } + //Console.WriteLine(DateTime.Now.Millisecond + " start "); // update form try @@ -994,7 +884,7 @@ namespace ArdupilotMega We_fgo = We_fgo + Kw * We_error; double wind_dir = (Math.Atan2(We_fgo, Wn_fgo) * (180 / Math.PI)); - double wind_vel = (Math.Sqrt(Math.Pow(We_fgo,2) + Math.Pow(Wn_fgo,2))); + double wind_vel = (Math.Sqrt(Math.Pow(We_fgo, 2) + Math.Pow(Wn_fgo, 2))); wind_dir = (wind_dir + 360) % 360; diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/Configuration.Designer.cs b/Tools/ArdupilotMegaPlanner/GCSViews/Configuration.Designer.cs index 168229d9c2769e1692f7e65edd43d196695ab1f4..4c0332e32bd252c365daa1838dce764a22d1f2ca 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/Configuration.Designer.cs +++ b/Tools/ArdupilotMegaPlanner/GCSViews/Configuration.Designer.cs @@ -1137,7 +1137,8 @@ resources.GetString("TUNE.Items16"), resources.GetString("TUNE.Items17"), resources.GetString("TUNE.Items18"), - resources.GetString("TUNE.Items19")}); + resources.GetString("TUNE.Items19"), + resources.GetString("TUNE.Items20")}); resources.ApplyResources(this.TUNE, "TUNE"); this.TUNE.Name = "TUNE"; // diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/Configuration.cs b/Tools/ArdupilotMegaPlanner/GCSViews/Configuration.cs index ecd2272dec7c2b9c26e17a28567b730a9220f8f5..6970e2567d2912f5a3de4bd5a4c66b3322ac8a9a 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/Configuration.cs +++ b/Tools/ArdupilotMegaPlanner/GCSViews/Configuration.cs @@ -67,25 +67,29 @@ namespace ArdupilotMega.GCSViews // fix for dup name //XTRK_ANGLE_CD1.Name = "XTRK_ANGLE_CD"; XTRK_GAIN_SC1.Name = "XTRK_GAIN_SC"; - } - - private void Configuration_Load(object sender, EventArgs e) - { - startup = true; // enable disable relevbant hardware tabs if (MainV2.APMFirmware == MainV2.Firmwares.ArduPlane) { + this.ConfigTabs.SuspendLayout(); ConfigTabs.SelectedIndex = 0; TabAP.Enabled = true; TabAC.Enabled = false; + this.ConfigTabs.ResumeLayout(); } else { + this.ConfigTabs.SuspendLayout(); ConfigTabs.SelectedIndex = 1; TabAP.Enabled = false; TabAC.Enabled = true; + this.ConfigTabs.ResumeLayout(); } + } + + private void Configuration_Load(object sender, EventArgs e) + { + startup = true; // read tooltips if (tooltips.Count == 0) @@ -167,7 +171,7 @@ namespace ArdupilotMega.GCSViews // setup language selection CultureInfo ci = null; - foreach (string name in new string[] { "en-US", "zh-Hans", "zh-TW", "ru-RU", "Fr", "Pl", "it-IT" }) + foreach (string name in new string[] { "en-US", "zh-Hans", "zh-TW", "ru-RU", "Fr", "Pl", "it-IT", "es-ES" }) { ci = MainV2.getcultureinfo(name); if (ci != null) @@ -931,10 +935,16 @@ namespace ArdupilotMega.GCSViews ((MyButton)sender).Enabled = false; try { + MainV2.comPort.getParamList(); + + + + } catch { MessageBox.Show("Error: getting param list"); } + ((MyButton)sender).Enabled = true; startup = true; Configuration_Load(null, null); diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/Configuration.es-ES.resx b/Tools/ArdupilotMegaPlanner/GCSViews/Configuration.es-ES.resx new file mode 100644 index 0000000000000000000000000000000000000000..8ac89af4e79513dacc9e7bb769d1ae91f06930a9 --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/GCSViews/Configuration.es-ES.resx @@ -0,0 +1,600 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="CHK_speechaltwarning.Text" xml:space="preserve"> + <value>Advertencia Altitud</value> + </data> + <data name="label12.Text" xml:space="preserve"> + <value>HUD</value> + </data> + <data name="BUT_videostop.Text" xml:space="preserve"> + <value>Parar</value> + </data> + <data name="label49.Text" xml:space="preserve"> + <value>INT_MAX</value> + </data> + <data name="label10.Text" xml:space="preserve"> + <value>D</value> + </data> + <data name="CHK_speechbattery.Text" xml:space="preserve"> + <value>Advertencia BaterÃa</value> + </data> + <data name="CHK_enablespeech.Text" xml:space="preserve"> + <value>Permitir Habla</value> + </data> + <data name="label13.Text" xml:space="preserve"> + <value>IMAX</value> + </data> + <data name="label16.Text" xml:space="preserve"> + <value>P</value> + </data> + <data name="label11.Text" xml:space="preserve"> + <value>D</value> + </data> + <data name="label14.Text" xml:space="preserve"> + <value>IMAX</value> + </data> + <data name="label17.Text" xml:space="preserve"> + <value>D</value> + </data> + <data name="label88.Text" xml:space="preserve"> + <value>IMAX</value> + </data> + <data name="label15.Text" xml:space="preserve"> + <value>I</value> + </data> + <data name="label18.Text" xml:space="preserve"> + <value>Ganancia</value> + </data> + <data name="label19.Text" xml:space="preserve"> + <value>IMAX</value> + </data> + <data name="label82.Text" xml:space="preserve"> + <value>P</value> + </data> + <data name="label83.Text" xml:space="preserve"> + <value>P a T</value> + </data> + <data name="label20.Text" xml:space="preserve"> + <value>I</value> + </data> + <data name="label80.Text" xml:space="preserve"> + <value>Ganancia (cm)</value> + </data> + <data name="Value.HeaderText" xml:space="preserve"> + <value>Valor</value> + </data> + <data name="label21.Text" xml:space="preserve"> + <value>I</value> + </data> + <data name="label81.Text" xml:space="preserve"> + <value>Compensación de Cabeceo</value> + </data> + <data name="label22.Text" xml:space="preserve"> + <value>P</value> + </data> + <data name="label86.Text" xml:space="preserve"> + <value>I</value> + </data> + <data name="label23.Text" xml:space="preserve"> + <value>Longitud de Pista</value> + </data> + <data name="label87.Text" xml:space="preserve"> + <value>P</value> + </data> + <data name="label56.Text" xml:space="preserve"> + <value>P</value> + </data> + <data name="label24.Text" xml:space="preserve"> + <value>Waypoints</value> + </data> + <data name="label84.Text" xml:space="preserve"> + <value>IMAX</value> + </data> + <data name="CHK_speechcustom.Text" xml:space="preserve"> + <value>Intervalo de Tiempo</value> + </data> + <data name="label2.Text" xml:space="preserve"> + <value>FBW max</value> + </data> + <data name="label25.Text" xml:space="preserve"> + <value>P</value> + </data> + <data name="myLabel2.Text" xml:space="preserve"> + <value>Ch6 Opt</value> + </data> + <data name="label54.Text" xml:space="preserve"> + <value>D</value> + </data> + <data name="label3.Text" xml:space="preserve"> + <value>FBW min</value> + </data> + <data name="label26.Text" xml:space="preserve"> + <value>Formato Video</value> + </data> + <data name="label103.Text" xml:space="preserve"> + <value>Posición</value> + </data> + <data name="groupBox8.Text" xml:space="preserve"> + <value>Pid Servo Alabeo</value> + </data> + <data name="label57.Text" xml:space="preserve"> + <value>INT_MAX</value> + </data> + <data name="label27.Text" xml:space="preserve"> + <value>D</value> + </data> + <data name="label102.Text" xml:space="preserve"> + <value>Actitud</value> + </data> + <data name="groupBox9.Text" xml:space="preserve"> + <value>Pid Servo Cabeceo</value> + </data> + <data name="label52.Text" xml:space="preserve"> + <value>P</value> + </data> + <data name="label1.Text" xml:space="preserve"> + <value>Proporción</value> + </data> + <data name="label28.Text" xml:space="preserve"> + <value>IMAX</value> + </data> + <data name="label101.Text" xml:space="preserve"> + <value>Rates de TelemetrÃa</value> + </data> + <data name="groupBox6.Text" xml:space="preserve"> + <value>Cruce de corrección de la pista</value> + </data> + <data name="myLabel1.Text" xml:space="preserve"> + <value>Ch7 Opt</value> + </data> + <data name="label6.Text" xml:space="preserve"> + <value>Max</value> + </data> + <data name="label55.Text" xml:space="preserve"> + <value>I</value> + </data> + <data name="label29.Text" xml:space="preserve"> + <value>D</value> + </data> + <data name="groupBox7.Text" xml:space="preserve"> + <value>Mantener Altitud</value> + </data> + <data name="label50.Text" xml:space="preserve"> + <value>D</value> + </data> + <data name="label7.Text" xml:space="preserve"> + <value>Min</value> + </data> + <data name="label107.Text" xml:space="preserve"> + <value>RC</value> + </data> + <data name="groupBox4.Text" xml:space="preserve"> + <value>Nav WP</value> + </data> + <data name="label4.Text" xml:space="preserve"> + <value>Crucero</value> + </data> + <data name="label53.Text" xml:space="preserve"> + <value>INT_MAX</value> + </data> + <data name="groupBox5.Text" xml:space="preserve"> + <value>Rate de Acelerador</value> + </data> + <data name="label5.Text" xml:space="preserve"> + <value>FS Valor</value> + </data> + <data name="CHK_GDIPlus.ToolTip" xml:space="preserve"> + <value>OpenGL = DesactivadoGDI + = Activado</value> + </data> + <data name="groupBox2.Text" xml:space="preserve"> + <value>Angulos de Navegación</value> + </data> + <data name="label51.Text" xml:space="preserve"> + <value>I</value> + </data> + <data name="label104.Text" xml:space="preserve"> + <value>Modo/Estado</value> + </data> + <data name="CHK_hudshow.Text" xml:space="preserve"> + <value>Activar HUD superposición</value> + </data> + <data name="groupBox3.Text" xml:space="preserve"> + <value>Acelerador 0-100%</value> + </data> + <data name="BUT_load.Text" xml:space="preserve"> + <value>Cargar</value> + </data> + <data name="label8.Text" xml:space="preserve"> + <value>Crucero</value> + </data> + <data name="groupBox1.Text" xml:space="preserve"> + <value>Velocidad Aire m/s</value> + </data> + <data name="label9.Text" xml:space="preserve"> + <value>m/s</value> + </data> + <data name="Command.HeaderText" xml:space="preserve"> + <value>Comando</value> + </data> + <data name="label108.Text" xml:space="preserve"> + <value>Reiniciar APM</value> + </data> + <data name="label58.Text" xml:space="preserve"> + <value>D</value> + </data> + <data name="CHK_loadwponconnect.Text" xml:space="preserve"> + <value>Cargar waypoints en la conexión?</value> + </data> + <data name="label64.Text" xml:space="preserve"> + <value>P</value> + </data> + <data name="label65.Text" xml:space="preserve"> + <value>INT_MAX</value> + </data> + <data name="BUT_rerequestparams.ToolTip" xml:space="preserve"> + <value>Actualizar parametros del dispositivo</value> + </data> + <data name="label59.Text" xml:space="preserve"> + <value>I</value> + </data> + <data name="label66.Text" xml:space="preserve"> + <value>D</value> + </data> + <data name="label67.Text" xml:space="preserve"> + <value>I</value> + </data> + <data name="label60.Text" xml:space="preserve"> + <value>P</value> + </data> + <data name="label61.Text" xml:space="preserve"> + <value>INT_MAX</value> + </data> + <data name="label98.Text" xml:space="preserve"> + <value>Unidad Velocidad</value> + </data> + <data name="label62.Text" xml:space="preserve"> + <value>D</value> + </data> + <data name="CHK_speechwaypoint.Text" xml:space="preserve"> + <value>Waypoint</value> + </data> + <data name="label63.Text" xml:space="preserve"> + <value>I</value> + </data> + <data name="BUT_load.ToolTip" xml:space="preserve"> + <value>Parámetros de carga de archivo</value> + </data> + <data name="groupBox16.Text" xml:space="preserve"> + <value>Otras Mezclas</value> + </data> + <data name="groupBox19.Text" xml:space="preserve"> + <value>Perder el Tiempo</value> + </data> + <data name="label99.Text" xml:space="preserve"> + <value>NOTA: La pestaña de configuración no se muestran estas unidades, ya que son valores brutos.</value> + </data> + <data name="groupBox14.Text" xml:space="preserve"> + <value>EnergÃa / Alt Pid</value> + </data> + <data name="groupBox12.Text" xml:space="preserve"> + <value>Cabeceo de navegación como PID</value> + </data> + <data name="label92.Text" xml:space="preserve"> + <value>Dispositivo de Video</value> + </data> + <data name="label68.Text" xml:space="preserve"> + <value>P</value> + </data> + <data name="TabSetup.Text" xml:space="preserve"> + <value>Ajustes</value> + </data> + <data name="Default.HeaderText" xml:space="preserve"> + <value>Defecto</value> + </data> + <data name="groupBox15.Text" xml:space="preserve"> + <value>Xtrack Pids</value> + </data> + <data name="label69.Text" xml:space="preserve"> + <value>INT_MAX</value> + </data> + <data name="label30.Text" xml:space="preserve"> + <value>I</value> + </data> + <data name="groupBox10.Text" xml:space="preserve"> + <value>Pid Servo Guiñada</value> + </data> + <data name="label90.Text" xml:space="preserve"> + <value>I</value> + </data> + <data name="groupBox13.Text" xml:space="preserve"> + <value>Alt Nav Pid Cabeceo</value> + </data> + <data name="label93.Text" xml:space="preserve"> + <value>Idioma de interfaz de usuario</value> + </data> + <data name="label32.Text" xml:space="preserve"> + <value>IMAX </value> + </data> + <data name="label96.Text" xml:space="preserve"> + <value>Joystick</value> + </data> + <data name="CHK_GDIPlus.Text" xml:space="preserve"> + <value>GDI+ (tipo antiguo)</value> + </data> + <data name="label31.Text" xml:space="preserve"> + <value>P</value> + </data> + <data name="groupBox11.Text" xml:space="preserve"> + <value>Alabeo Pid Nav</value> + </data> + <data name="label91.Text" xml:space="preserve"> + <value>P</value> + </data> + <data name="label34.Text" xml:space="preserve"> + <value>I</value> + </data> + <data name="label94.Text" xml:space="preserve"> + <value>Color OSD</value> + </data> + <data name="label97.Text" xml:space="preserve"> + <value>Unidad Distancia</value> + </data> + <data name="label36.Text" xml:space="preserve"> + <value>IMAX</value> + </data> + <data name="label35.Text" xml:space="preserve"> + <value>P</value> + </data> + <data name="label95.Text" xml:space="preserve"> + <value>Habla</value> + </data> + <data name="label38.Text" xml:space="preserve"> + <value>Cabeceo Max</value> + </data> + <data name="label37.Text" xml:space="preserve"> + <value>Banco Max</value> + </data> + <data name="groupBox24.Text" xml:space="preserve"> + <value>Rate Cabeceo</value> + </data> + <data name="BUT_Joystick.Text" xml:space="preserve"> + <value>Joystick Setup</value> + </data> + <data name="groupBox25.Text" xml:space="preserve"> + <value>Rate Alabeo</value> + </data> + <data name="label39.Text" xml:space="preserve"> + <value>Cabeceo Min</value> + </data> + <data name="CHK_mavdebug.Text" xml:space="preserve"> + <value>Mavlink mensaje depuración</value> + </data> + <data name="groupBox20.Text" xml:space="preserve"> + <value>Estabilizar Guiñada</value> + </data> + <data name="groupBox21.Text" xml:space="preserve"> + <value>Estabilizar Cabeceo</value> + </data> + <data name="groupBox22.Text" xml:space="preserve"> + <value>Estabilizar Alabeo</value> + </data> + <data name="groupBox23.Text" xml:space="preserve"> + <value>Rate Guiñada</value> + </data> + <data name="label74.Text" xml:space="preserve"> + <value>D</value> + </data> + <data name="label76.Text" xml:space="preserve"> + <value>P</value> + </data> + <data name="BUT_save.Text" xml:space="preserve"> + <value>Guardar</value> + </data> + <data name="BUT_writePIDS.ToolTip" xml:space="preserve"> + <value>Escribir parametros cambiados en el dispositivo</value> + </data> + <data name="label75.Text" xml:space="preserve"> + <value>I</value> + </data> + <data name="label70.Text" xml:space="preserve"> + <value>D</value> + </data> + <data name="lblSTAB_D.Text" xml:space="preserve"> + <value>Estabilizar D</value> + </data> + <data name="label77.Text" xml:space="preserve"> + <value>I</value> + </data> + <data name="label72.Text" xml:space="preserve"> + <value>P</value> + </data> + <data name="CHK_lockrollpitch.Text" xml:space="preserve"> + <value>Bloquear los valores de cabeceo y Alabeo</value> + </data> + <data name="label71.Text" xml:space="preserve"> + <value>I</value> + </data> + <data name="label73.Text" xml:space="preserve"> + <value>INT_MAX</value> + </data> + <data name="TabPlanner.Text" xml:space="preserve"> + <value>Planificador</value> + </data> + <data name="BUT_writePIDS.Text" xml:space="preserve"> + <value>Escribir Parámetros</value> + </data> + <data name="TabAP.Text" xml:space="preserve"> + <value>ArduPlane</value> + </data> + <data name="label78.Text" xml:space="preserve"> + <value>Mezcla de Timón</value> + </data> + <data name="NUM_tracklength.ToolTip" xml:space="preserve"> + <value>En la ficha de datos de vuelo</value> + </data> + <data name="label79.Text" xml:space="preserve"> + <value>Angulo de Entrada</value> + </data> + <data name="CHK_resetapmonconnect.Text" xml:space="preserve"> + <value>Reiniciar APM al Conectar al USB</value> + </data> + <data name="mavScale.HeaderText" xml:space="preserve"> + <value>mavScale</value> + </data> + <data name="TabAC.Text" xml:space="preserve"> + <value>ArduCopter</value> + </data> + <data name="CHK_speechmode.Text" xml:space="preserve"> + <value>Modo</value> + </data> + <data name="RawValue.HeaderText" xml:space="preserve"> + <value>Valores Raw</value> + </data> + <data name="BUT_compare.Text" xml:space="preserve"> + <value>Comparar Parametros</value> + </data> + <data name="BUT_save.ToolTip" xml:space="preserve"> + <value>Guardar parametros a archivo</value> + </data> + <data name="label46.Text" xml:space="preserve"> + <value>P</value> + </data> + <data name="label47.Text" xml:space="preserve"> + <value>IMAX</value> + </data> + <data name="label45.Text" xml:space="preserve"> + <value>I</value> + </data> + <data name="label42.Text" xml:space="preserve"> + <value>P</value> + </data> + <data name="label43.Text" xml:space="preserve"> + <value>IMAX</value> + </data> + <data name="label41.Text" xml:space="preserve"> + <value>I</value> + </data> + <data name="BUT_rerequestparams.Text" xml:space="preserve"> + <value>Actualizar Parametros</value> + </data> + <data name="BUT_videostart.Text" xml:space="preserve"> + <value>Iniciar</value> + </data> +</root> \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/Configuration.resx b/Tools/ArdupilotMegaPlanner/GCSViews/Configuration.resx index 881a79be9f7d0b34c9654875619c357d7d4ad468..b0a640427bca3c690beb76c6dbc42047dda363e9 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/Configuration.resx +++ b/Tools/ArdupilotMegaPlanner/GCSViews/Configuration.resx @@ -2703,6 +2703,9 @@ <data name="TUNE.Items19" xml:space="preserve"> <value>CH6_OPTFLOW_KD</value> </data> + <data name="TUNE.Items20" xml:space="preserve"> + <value>CH6_NAV_I</value> + </data> <data name="TUNE.Location" type="System.Drawing.Point, System.Drawing"> <value>417, 336</value> </data> diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/Firmware.cs b/Tools/ArdupilotMegaPlanner/GCSViews/Firmware.cs index f3a3d9adf292eb4d62281e15abcdaacb62e4861f..94e42f21fe49a7010d7376bc1b4537fb3c8dfd82 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/Firmware.cs +++ b/Tools/ArdupilotMegaPlanner/GCSViews/Firmware.cs @@ -580,7 +580,7 @@ namespace ArdupilotMega.GCSViews MainV2.givecomport = false; } - void port_Progress(int progress) + void port_Progress(int progress,string status) { Console.WriteLine("Progress {0} ", progress); this.progress.Value = progress; diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/Firmware.es-ES.resx b/Tools/ArdupilotMegaPlanner/GCSViews/Firmware.es-ES.resx new file mode 100644 index 0000000000000000000000000000000000000000..f894ebeb281acf455214f9e9f0462ebd9bd19157 --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/GCSViews/Firmware.es-ES.resx @@ -0,0 +1,132 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="label2.Text" xml:space="preserve"> + <value>Images by Max Levine</value> + </data> + <data name="label1.Text" xml:space="preserve"> + <value>Por favor, haga clic en las imágenes de arriba para "versiones de vuelo"</value> + </data> + <data name="lbl_status.Text" xml:space="preserve"> + <value>Estado</value> + </data> + <data name="BUT_setup.Text" xml:space="preserve"> + <value>APM programa de instalación (plano y quad</value> + </data> +</root> \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.cs b/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.cs index 5094e64519f9bc580dbdf7261c3f9d9751da8991..b0424f888c66fb2ea1779d56f46ca80ee4f8b564 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.cs +++ b/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.cs @@ -302,14 +302,7 @@ namespace ArdupilotMega.GCSViews { if (threadrun == 0) { return; } - this.BeginInvoke((System.Windows.Forms.MethodInvoker)delegate() -{ - try - { - BUT_playlog.Text = "Pause"; - } - catch { } -}); + updatePlayPauseButton(true); if (comPort.BaseStream.IsOpen) MainV2.comPort.logreadmode = false; @@ -355,17 +348,11 @@ namespace ArdupilotMega.GCSViews } else { - if (threadrun == 0) { return; } - try - { - this.Invoke((System.Windows.Forms.MethodInvoker)delegate() - { - BUT_playlog.Text = "Play"; - }); - } - catch { } + updatePlayPauseButton(false); } + + try { //Console.WriteLine(DateTime.Now.Millisecond); @@ -406,7 +393,7 @@ namespace ArdupilotMega.GCSViews { System.Threading.Thread.Sleep(1); } - + if (trackPoints.Count > int.Parse(MainV2.config["NUM_tracklength"].ToString())) { trackPoints.RemoveRange(0, trackPoints.Count - int.Parse(MainV2.config["NUM_tracklength"].ToString())); @@ -426,10 +413,13 @@ namespace ArdupilotMega.GCSViews FlightPlanner.pointlist.AddRange(MainV2.comPort.wps); } - - routes.Markers.Clear(); - routes.Routes.Clear(); + while (gMapControl1.inOnPaint == true) + { + System.Threading.Thread.Sleep(1); + } + + updateClearRoutes(); route = new GMapRoute(trackPoints, "track"); //track.Stroke = Pens.Red; @@ -493,8 +483,6 @@ namespace ArdupilotMega.GCSViews gMapControl1.HoldInvalidation = false; gMapControl1.Invalidate(); - - Application.DoEvents(); } tracklast = DateTime.Now; @@ -505,9 +493,47 @@ namespace ArdupilotMega.GCSViews Console.WriteLine("FD Main loop exit"); } - private void updateBindingSource() + + // to prevent cross thread calls while in a draw and exception + private void updateClearRoutes() { + // not async this.Invoke((System.Windows.Forms.MethodInvoker)delegate() + { + routes.Markers.Clear(); + routes.Routes.Clear(); + }); + } + + private void updatePlayPauseButton(bool playing) + { + if (playing) + { + this.BeginInvoke((System.Windows.Forms.MethodInvoker)delegate() + { + try + { + BUT_playlog.Text = "Pause"; + } + catch { } + }); + } + else + { + this.BeginInvoke((System.Windows.Forms.MethodInvoker)delegate() + { + try + { + BUT_playlog.Text = "Play"; + } + catch { } + }); + } + } + + private void updateBindingSource() + { + this.BeginInvoke((System.Windows.Forms.MethodInvoker)delegate() { MainV2.cs.UpdateCurrentSettings(bindingSource1); }); diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.es-ES.resx b/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.es-ES.resx new file mode 100644 index 0000000000000000000000000000000000000000..048d6997a7dab3cac064e75f445e6662448ed99f --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.es-ES.resx @@ -0,0 +1,276 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="pointCameraHereToolStripMenuItem.Text" xml:space="preserve"> + <value>Punto de Cámara AquÃ</value> + </data> + <data name="BUT_setmode.ToolTip" xml:space="preserve"> + <value>Los cambios en el modo de la izquierda</value> + </data> + <data name="BUT_quickmanual.Text" xml:space="preserve"> + <value>&Manual</value> + </data> + <data name="BUT_playlog.Text" xml:space="preserve"> + <value>Play/Pause</value> + </data> + <data name="BUT_setwp.ToolTip" xml:space="preserve"> + <value>Cambia el waypoint de destino actual</value> + </data> + <data name="BUT_quickauto.ToolTip" xml:space="preserve"> + <value>Cambiar modo a Auto</value> + </data> + <data name="goHereToolStripMenuItem.Text" xml:space="preserve"> + <value>Volar a AquÃ</value> + </data> + <data name="lbl_windvel.ToolTip" xml:space="preserve"> + <value>Velocidad estimada del Viento</value> + </data> + <data name="BUT_RAWSensor.Text" xml:space="preserve"> + <value>Ver Sensor Raw</value> + </data> + <data name="BUTrestartmission.ToolTip" xml:space="preserve"> + <value>Reinicia la misión desde el principio</value> + </data> + <data name="TXT_alt.Text" xml:space="preserve"> + <value>0</value> + </data> + <data name="BUT_clear_track.ToolTip" xml:space="preserve"> + <value>Despeje el trayecto registrada en el mapa</value> + </data> + <data name="lbl_winddir.ToolTip" xml:space="preserve"> + <value>Dirección estimada del Viento</value> + </data> + <data name="lbl_windvel.Text" xml:space="preserve"> + <value>Vel: 0</value> + </data> + <data name="CB_tuning.ToolTip" xml:space="preserve"> + <value>Mostrar el gráfico de la afinación, mostrando actitudes de destino vs real</value> + </data> + <data name="TXT_long.Text" xml:space="preserve"> + <value>0</value> + </data> + <data name="BUT_log2kml.Text" xml:space="preserve"> + <value>Log > KML</value> + </data> + <data name="label1.Text" xml:space="preserve"> + <value>Zoom</value> + </data> + <data name="BUT_clear_track.Text" xml:space="preserve"> + <value>Limpiar Ruta</value> + </data> + <data name="dataGridViewImageColumn1.HeaderText" xml:space="preserve"> + <value>Up</value> + </data> + <data name="CHK_autopan.ToolTip" xml:space="preserve"> + <value>Hace que el autopan mapa basado en la ubicación actual</value> + </data> + <data name="BUT_script.Text" xml:space="preserve"> + <value>Script</value> + </data> + <data name="BUT_quickrtl.ToolTip" xml:space="preserve"> + <value>Cambiar modo a RTL</value> + </data> + <data name="tabGauges.Text" xml:space="preserve"> + <value>Indicadores</value> + </data> + <data name="CHK_autopan.Text" xml:space="preserve"> + <value>Auto Pan</value> + </data> + <data name="BUT_joystick.Text" xml:space="preserve"> + <value>Joystick</value> + </data> + <data name="Zoomlevel.ToolTip" xml:space="preserve"> + <value>Cambiar nivel de Zoom</value> + </data> + <data name="CB_tuning.Text" xml:space="preserve"> + <value>Tuning</value> + </data> + <data name="dataGridViewImageColumn2.HeaderText" xml:space="preserve"> + <value>Abajo</value> + </data> + <data name="BUTactiondo.Text" xml:space="preserve"> + <value>Hacer Acción</value> + </data> + <data name="BUTrestartmission.Text" xml:space="preserve"> + <value>Reiniciar Misión</value> + </data> + <data name="BUT_quickmanual.ToolTip" xml:space="preserve"> + <value>Cambiar Modo a Manual/Estabilizado</value> + </data> + <data name="BUT_RAWSensor.ToolTip" xml:space="preserve"> + <value>Ver Gyro primas y los valores de Accel y complementos primas de Radio y salidas</value> + </data> + <data name="Gspeed.ToolTip" xml:space="preserve"> + <value>Haga doble clic aquà para cambiar Max</value> + </data> + <data name="TXT_lat.Text" xml:space="preserve"> + <value>0</value> + </data> + <data name="tabActions.Text" xml:space="preserve"> + <value>Acciones</value> + </data> + <data name="BUTactiondo.ToolTip" xml:space="preserve"> + <value>Realizar la acción hacia la izquierda</value> + </data> + <data name="BUT_Homealt.Text" xml:space="preserve"> + <value>Establecer Altutid Casa</value> + </data> + <data name="lbl_winddir.Text" xml:space="preserve"> + <value>Dir: 0</value> + </data> + <data name="BUT_loadtelem.Text" xml:space="preserve"> + <value>Cargar Log</value> + </data> + <data name="BUT_joystick.ToolTip" xml:space="preserve"> + <value>Configurar y habilitar el joystick</value> + </data> + <data name="BUT_Homealt.ToolTip" xml:space="preserve"> + <value>Ajuste el alt de pantalla actual como 0, es decir, casa alt sea igual a 0</value> + </data> + <data name="recordHudToAVIToolStripMenuItem.Text" xml:space="preserve"> + <value>Grabar HUD en AVI</value> + </data> + <data name="tabStatus.Text" xml:space="preserve"> + <value>Estado</value> + </data> + <data name="BUT_quickauto.Text" xml:space="preserve"> + <value>&Auto</value> + </data> + <data name="BUT_setwp.Text" xml:space="preserve"> + <value>Establecer WP</value> + </data> + <data name="tabTLogs.Text" xml:space="preserve"> + <value>Logs TelemetrÃa</value> + </data> + <data name="lbl_logpercent.Text" xml:space="preserve"> + <value>0.00 %</value> + </data> + <data name="BUT_setmode.Text" xml:space="preserve"> + <value>Configurar el modo</value> + </data> + <data name="NUM_playbackspeed.ToolTip" xml:space="preserve"> + <value>Velocidad de Reproducción</value> + </data> + <data name="stopRecordToolStripMenuItem.Text" xml:space="preserve"> + <value>Parar Grabación</value> + </data> + <data name="BUT_quickrtl.Text" xml:space="preserve"> + <value>&RTL</value> + </data> +</root> \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/FlightPlanner.es-ES.resx b/Tools/ArdupilotMegaPlanner/GCSViews/FlightPlanner.es-ES.resx new file mode 100644 index 0000000000000000000000000000000000000000..dcbcfcd3801a5b5e19597f75998f64e1fa59ae45 --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/GCSViews/FlightPlanner.es-ES.resx @@ -0,0 +1,366 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="BUT_Camera.ToolTip" xml:space="preserve"> + <value>Obtener ajustes de la cámara de solapamiento</value> + </data> + <data name="CHK_geheight.Text" xml:space="preserve"> + <value>Verifique la altura</value> + </data> + <data name="lbl_homedist.Text" xml:space="preserve"> + <value>Casa</value> + </data> + <data name="BUT_grid.Text" xml:space="preserve"> + <value>CuadrÃcula</value> + </data> + <data name="label10.Text" xml:space="preserve"> + <value>Lat</value> + </data> + <data name="GeoFencedownloadToolStripMenuItem.Text" xml:space="preserve"> + <value>Descargar</value> + </data> + <data name="lbl_prevdist.Text" xml:space="preserve"> + <value>Prev</value> + </data> + <data name="label11.Text" xml:space="preserve"> + <value>Zoom</value> + </data> + <data name="TXT_loiterrad.Text" xml:space="preserve"> + <value>45</value> + </data> + <data name="comboBoxMapType.ToolTip" xml:space="preserve"> + <value>Cambiar el tipo de mapa actual</value> + </data> + <data name="Param4.HeaderText" xml:space="preserve"> + <value>P4</value> + </data> + <data name="loitertimeToolStripMenuItem.Text" xml:space="preserve"> + <value>Tiempo</value> + </data> + <data name="CHK_altmode.Text" xml:space="preserve"> + <value>Alt Absoluta</value> + </data> + <data name="BUT_loadkml.ToolTip" xml:space="preserve"> + <value>Obtener ajustes de la cámara de solapamiento</value> + </data> + <data name="LBL_defalutalt.Text" xml:space="preserve"> + <value>Altitud por Defecto</value> + </data> + <data name="Param2.HeaderText" xml:space="preserve"> + <value>P2</value> + </data> + <data name="rotateMapToolStripMenuItem.Text" xml:space="preserve"> + <value>Rotar Mapa</value> + </data> + <data name="Lat.HeaderText" xml:space="preserve"> + <value>Lat</value> + </data> + <data name="textBox1.Text" xml:space="preserve"> + <value>1. Connect2. Lea WP si es necesario.3. Asegúrese de que su posición de casa y ALT se ajusta4. Haga clic en el mapa para empezar a añadir WP</value> + </data> + <data name="SaveFile.Text" xml:space="preserve"> + <value>Guardar WP en Archivo</value> + </data> + <data name="label2.Text" xml:space="preserve"> + <value>Long</value> + </data> + <data name="label3.Text" xml:space="preserve"> + <value>Alt (abs)</value> + </data> + <data name="loiterForeverToolStripMenuItem.Text" xml:space="preserve"> + <value>Para Siempre</value> + </data> + <data name="Alt.HeaderText" xml:space="preserve"> + <value>Alt</value> + </data> + <data name="label7.Text" xml:space="preserve"> + <value>Ubicación del Ratón</value> + </data> + <data name="dataGridViewImageColumn1.HeaderText" xml:space="preserve"> + <value>Arriba</value> + </data> + <data name="label4.Text" xml:space="preserve"> + <value>Localización de Casa</value> + </data> + <data name="BUT_loadwpfile.Text" xml:space="preserve"> + <value>Cargar Archivo WP</value> + </data> + <data name="label5.Text" xml:space="preserve"> + <value>Radio Perder Tiempo</value> + </data> + <data name="jumpstartToolStripMenuItem.Text" xml:space="preserve"> + <value>Iniciar</value> + </data> + <data name="BUT_read.Text" xml:space="preserve"> + <value>Leer WPs</value> + </data> + <data name="GeoFenceuploadToolStripMenuItem.Text" xml:space="preserve"> + <value>Subir</value> + </data> + <data name="label8.Text" xml:space="preserve"> + <value>Alt</value> + </data> + <data name="LBL_WPRad.Text" xml:space="preserve"> + <value>Radio WP</value> + </data> + <data name="label9.Text" xml:space="preserve"> + <value>Long</value> + </data> + <data name="Command.HeaderText" xml:space="preserve"> + <value>Comandos</value> + </data> + <data name="Label1.Text" xml:space="preserve"> + <value>Lat</value> + </data> + <data name="lbl_status.Text" xml:space="preserve"> + <value>Estado</value> + </data> + <data name="setReturnLocationToolStripMenuItem.Text" xml:space="preserve"> + <value>Ajustar Localización de Retorno</value> + </data> + <data name="panelMap.Text" xml:space="preserve"> + <value>panel6</value> + </data> + <data name="clearPolygonToolStripMenuItem.Text" xml:space="preserve"> + <value>Limpiar Poligono</value> + </data> + <data name="panelAction.Text" xml:space="preserve"> + <value>Acción</value> + </data> + <data name="Param1.HeaderText" xml:space="preserve"> + <value>P1</value> + </data> + <data name="button1.ToolTip" xml:space="preserve"> + <value>Representar la actual misión contra los datos de Google Earth</value> + </data> + <data name="BUT_Prefetch.ToolTip" xml:space="preserve"> + <value>Pre Almacena en caché una parte del mapa sobre la base de una caja de dibujar</value> + </data> + <data name="Delete.ToolTipText" xml:space="preserve"> + <value>Elimina la Fila</value> + </data> + <data name="BUT_zoomto.ToolTip" xml:space="preserve"> + <value>Obtener ajustes de la cámara de solapamiento</value> + </data> + <data name="addPolygonPointToolStripMenuItem.Text" xml:space="preserve"> + <value>Añadir punto PolÃgono</value> + </data> + <data name="loiterToolStripMenuItem.Text" xml:space="preserve"> + <value>Perder el Tiempo</value> + </data> + <data name="Command.ToolTipText" xml:space="preserve"> + <value>Comando APM</value> + </data> + <data name="BUT_Add.Text" xml:space="preserve"> + <value>Agregar Abajo</value> + </data> + <data name="lbl_distance.Text" xml:space="preserve"> + <value>Distancia</value> + </data> + <data name="Down.ToolTipText" xml:space="preserve"> + <value>Mueve la fila de abajo</value> + </data> + <data name="BUT_write.Text" xml:space="preserve"> + <value>Escribir WPs</value> + </data> + <data name="BUT_loadkml.Text" xml:space="preserve"> + <value>Superponer KML</value> + </data> + <data name="dataGridViewImageColumn2.HeaderText" xml:space="preserve"> + <value>Abajo</value> + </data> + <data name="Lon.HeaderText" xml:space="preserve"> + <value>Lon</value> + </data> + <data name="polygonToolStripMenuItem.Text" xml:space="preserve"> + <value>Dibujar PolÃgono</value> + </data> + <data name="jumpToolStripMenuItem.Text" xml:space="preserve"> + <value>Saltar</value> + </data> + <data name="TXT_DefaultAlt.Text" xml:space="preserve"> + <value>100</value> + </data> + <data name="geoFenceToolStripMenuItem.Text" xml:space="preserve"> + <value>Geo-Valla</value> + </data> + <data name="saveToFileToolStripMenuItem.Text" xml:space="preserve"> + <value>Guardar a Archivo</value> + </data> + <data name="TXT_WPRad.Text" xml:space="preserve"> + <value>30</value> + </data> + <data name="Up.ToolTipText" xml:space="preserve"> + <value>Mueve la fila de arriba</value> + </data> + <data name="Up.HeaderText" xml:space="preserve"> + <value>Arriba</value> + </data> + <data name="Delete.HeaderText" xml:space="preserve"> + <value>Borrar</value> + </data> + <data name="loitercirclesToolStripMenuItem.Text" xml:space="preserve"> + <value>Circulos</value> + </data> + <data name="jumpwPToolStripMenuItem.Text" xml:space="preserve"> + <value>WP #</value> + </data> + <data name="deleteWPToolStripMenuItem.Text" xml:space="preserve"> + <value>Borrar WP</value> + </data> + <data name="panelWaypoints.Text" xml:space="preserve"> + <value>Waypoints</value> + </data> + <data name="BUT_grid.ToolTip" xml:space="preserve"> + <value>Dibuja una rejilla sobre un área predefinida con un espacio determinado</value> + </data> + <data name="BUT_zoomto.Text" xml:space="preserve"> + <value>Zoom a</value> + </data> + <data name="loadFromFileToolStripMenuItem.Text" xml:space="preserve"> + <value>Cargar desde archivo</value> + </data> + <data name="CHK_holdalt.Text" xml:space="preserve"> + <value>Mantener Altitud por defecto</value> + </data> + <data name="button1.Text" xml:space="preserve"> + <value>Grafico de Elevación</value> + </data> + <data name="clearMissionToolStripMenuItem.Text" xml:space="preserve"> + <value>Limpiar Misión</value> + </data> + <data name="BUT_Add.ToolTip" xml:space="preserve"> + <value>Agregar una lÃnea a la red de abajo</value> + </data> + <data name="Param3.HeaderText" xml:space="preserve"> + <value>P3</value> + </data> + <data name="BUT_Prefetch.Text" xml:space="preserve"> + <value>Prefetch</value> + </data> + <data name="ContextMeasure.Text" xml:space="preserve"> + <value>Medida de Distancia</value> + </data> + <data name="BUT_Camera.Text" xml:space="preserve"> + <value>Camara</value> + </data> + <data name="Down.HeaderText" xml:space="preserve"> + <value>Abajo</value> + </data> +</root> \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/Help.es-ES.resx b/Tools/ArdupilotMegaPlanner/GCSViews/Help.es-ES.resx new file mode 100644 index 0000000000000000000000000000000000000000..f802ef4521542bc70a1105252a91509a0e8b310d --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/GCSViews/Help.es-ES.resx @@ -0,0 +1,129 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="richTextBox1.Text" xml:space="preserve"> + <value /> + </data> + <data name="CHK_showconsole.Text" xml:space="preserve"> + <value>Mostrar Consola (reiniciar)</value> + </data> + <data name="BUT_updatecheck.Text" xml:space="preserve"> + <value>Comprobar Actualizaciones</value> + </data> +</root> \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/Simulation.cs b/Tools/ArdupilotMegaPlanner/GCSViews/Simulation.cs index 8c408cb277475be7c5a068f349014a5b3180babe..b805771ee822e3280747a8bfc1c9450f3ac09232 100644 --- a/Tools/ArdupilotMegaPlanner/GCSViews/Simulation.cs +++ b/Tools/ArdupilotMegaPlanner/GCSViews/Simulation.cs @@ -11,6 +11,7 @@ using System.Xml; // config file using System.Runtime.InteropServices; // dll imports using ZedGraph; // Graphs using ArdupilotMega; +using ArdupilotMega.Mavlink; using System.Reflection; using System.Drawing.Drawing2D; @@ -636,7 +637,7 @@ namespace ArdupilotMega.GCSViews if (hzcounttime.Second != DateTime.Now.Second) { - Console.WriteLine("SIM hz {0}", hzcount); + //Console.WriteLine("SIM hz {0}", hzcount); hzcount = 0; hzcounttime = DateTime.Now; } @@ -873,15 +874,7 @@ namespace ArdupilotMega.GCSViews { //FlightGear - object imudata = new fgIMUData(); - - MAVLink.ByteArrayToStructureEndian(data, ref imudata, 0); - - imudata = (fgIMUData)(imudata); - - - - fgIMUData imudata2 = (fgIMUData)imudata; + fgIMUData imudata2 = data.ByteArrayToStructureBigEndian<fgIMUData>(0); if (imudata2.magic != 0x4c56414d) return; @@ -931,13 +924,7 @@ namespace ArdupilotMega.GCSViews } else if (receviedbytes == 658) { - aeroin = new TDataFromAeroSimRC(); - - object temp = aeroin; - - MAVLink.ByteArrayToStructure(data, ref temp, 0); - - aeroin = (TDataFromAeroSimRC)(temp); + aeroin = data.ByteArrayToStructure<TDataFromAeroSimRC>(0); att.pitch = (aeroin.Model_fPitch); att.roll = (aeroin.Model_fRoll * -1); @@ -1005,13 +992,7 @@ namespace ArdupilotMega.GCSViews else if (receviedbytes == 408) { - FGNetFDM fdm = new FGNetFDM(); - - object temp = fdm; - - MAVLink.ByteArrayToStructureEndian(data, ref temp, 0); - - fdm = (FGNetFDM)(temp); + FGNetFDM fdm = data.ByteArrayToStructureBigEndian<FGNetFDM>(0); lastfdmdata = fdm; diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/Simulation.es-ES.resx b/Tools/ArdupilotMegaPlanner/GCSViews/Simulation.es-ES.resx new file mode 100644 index 0000000000000000000000000000000000000000..16bd7710295ad327e4dc2cae3a25a950e160b1d9 --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/GCSViews/Simulation.es-ES.resx @@ -0,0 +1,303 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="label12.Text" xml:space="preserve"> + <value>Alabeo</value> + </data> + <data name="label10.Text" xml:space="preserve"> + <value>Error Altitud</value> + </data> + <data name="CHKREV_roll.Text" xml:space="preserve"> + <value>Invertir Alabeo</value> + </data> + <data name="CHK_heli.Text" xml:space="preserve"> + <value>Heli</value> + </data> + <data name="label13.Text" xml:space="preserve"> + <value>Cabeceo</value> + </data> + <data name="label16.Text" xml:space="preserve"> + <value>Salida Ardupilot</value> + </data> + <data name="label11.Text" xml:space="preserve"> + <value>Plane IMU</value> + </data> + <data name="label14.Text" xml:space="preserve"> + <value>Guiñada</value> + </data> + <data name="RAD_JSBSim.ToolTip" xml:space="preserve"> + <value>Puede hacer Plane/Heli/Quads</value> + </data> + <data name="label17.Text" xml:space="preserve"> + <value>Frecuencia Actualización GPS</value> + </data> + <data name="label15.Text" xml:space="preserve"> + <value>Acelerador</value> + </data> + <data name="label18.Text" xml:space="preserve"> + <value>Estado Piloto Automatico</value> + </data> + <data name="label19.Text" xml:space="preserve"> + <value>WP</value> + </data> + <data name="CHKgraphroll.Text" xml:space="preserve"> + <value>Mostrar Alabeo</value> + </data> + <data name="label20.Text" xml:space="preserve"> + <value>Modo</value> + </data> + <data name="label21.Text" xml:space="preserve"> + <value>Simulador de Autoridad - Para aviones diff</value> + </data> + <data name="BUT_startfgquad.Text" xml:space="preserve"> + <value>Iniciar FG Quad</value> + </data> + <data name="label22.Text" xml:space="preserve"> + <value>Banancia Alabeo</value> + </data> + <data name="label23.Text" xml:space="preserve"> + <value>Ganancia Cabeceo</value> + </data> + <data name="CHK_quad.Text" xml:space="preserve"> + <value>Quad</value> + </data> + <data name="label24.Text" xml:space="preserve"> + <value>Ganancia Timón</value> + </data> + <data name="label2.Text" xml:space="preserve"> + <value>Longitud</value> + </data> + <data name="label25.Text" xml:space="preserve"> + <value>Ganancia Acelerador</value> + </data> + <data name="label3.Text" xml:space="preserve"> + <value>Altitud</value> + </data> + <data name="label26.Text" xml:space="preserve"> + <value>Estos</value> + </data> + <data name="label27.Text" xml:space="preserve"> + <value>son</value> + </data> + <data name="label1.Text" xml:space="preserve"> + <value>Latitud</value> + </data> + <data name="label28.Text" xml:space="preserve"> + <value>Solo SIM</value> + </data> + <data name="but_advsettings.Text" xml:space="preserve"> + <value>Ajustes IP Avanzados</value> + </data> + <data name="label6.Text" xml:space="preserve"> + <value>Cabeceo</value> + </data> + <data name="label29.Text" xml:space="preserve"> + <value>Nota:</value> + </data> + <data name="label7.Text" xml:space="preserve"> + <value>TÃtulo</value> + </data> + <data name="label4.Text" xml:space="preserve"> + <value>Plano GPS</value> + </data> + <data name="TXT_pitchgain.Text" xml:space="preserve"> + <value>10000</value> + </data> + <data name="label5.Text" xml:space="preserve"> + <value>Alabeo</value> + </data> + <data name="ConnectComPort.Text" xml:space="preserve"> + <value>Enlace Sim Inicio/Paro</value> + </data> + <data name="label8.Text" xml:space="preserve"> + <value>WPDist</value> + </data> + <data name="label9.Text" xml:space="preserve"> + <value>Teniendo ERR</value> + </data> + <data name="CHKdisplayall.Text" xml:space="preserve"> + <value>Mostrar Todo</value> + </data> + <data name="chkSensor.Text" xml:space="preserve"> + <value>Sensor</value> + </data> + <data name="SaveSettings.Text" xml:space="preserve"> + <value>Guardar Ajustes</value> + </data> + <data name="BUT_startfgplane.Text" xml:space="preserve"> + <value>Inicio Plano FG</value> + </data> + <data name="CHKgraphrudder.Text" xml:space="preserve"> + <value>Mostrar Timón</value> + </data> + <data name="label30.Text" xml:space="preserve"> + <value>Guiñada</value> + </data> + <data name="CHKREV_rudder.Text" xml:space="preserve"> + <value>Invertir Timón</value> + </data> + <data name="TXT_rollgain.Text" xml:space="preserve"> + <value>10000</value> + </data> + <data name="RAD_softFlightGear.ToolTip" xml:space="preserve"> + <value>Puede hacer con el modelo Avión y Quad</value> + </data> + <data name="CHKREV_pitch.Text" xml:space="preserve"> + <value>Intertir Cabeceo</value> + </data> + <data name="CHKgraphthrottle.Text" xml:space="preserve"> + <value>Mostrar Acelerador</value> + </data> + <data name="CHK_xplane10.Text" xml:space="preserve"> + <value>Xplane 10</value> + </data> + <data name="RAD_aerosimrc.Text" xml:space="preserve"> + <value>AeroSimRC</value> + </data> + <data name="CHKgraphpitch.Text" xml:space="preserve"> + <value>Mostrar Cabeceo</value> + </data> + <data name="OutputLog.Text" xml:space="preserve"> + <value /> + </data> + <data name="RAD_softFlightGear.Text" xml:space="preserve"> + <value>FlightGear</value> + </data> + <data name="TXT_throttlegain.Text" xml:space="preserve"> + <value>10000</value> + </data> + <data name="RAD_softXplanes.Text" xml:space="preserve"> + <value>X-plane</value> + </data> + <data name="RAD_JSBSim.Text" xml:space="preserve"> + <value>JSBSim</value> + </data> + <data name="TXT_ruddergain.Text" xml:space="preserve"> + <value>10000</value> + </data> + <data name="RAD_aerosimrc.ToolTip" xml:space="preserve"> + <value>Puede hacer de avión / Heli o Quads</value> + </data> + <data name="BUT_startxplane.Text" xml:space="preserve"> + <value>Iniciat Xplane</value> + </data> + <data name="RAD_softXplanes.ToolTip" xml:space="preserve"> + <value>Puede hacer Plano / Quad con el plugin</value> + </data> +</root> \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/Terminal.es-ES.resx b/Tools/ArdupilotMegaPlanner/GCSViews/Terminal.es-ES.resx new file mode 100644 index 0000000000000000000000000000000000000000..dfed30055da4fd165ea1c4cdc93bbc3970a5c09f --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/GCSViews/Terminal.es-ES.resx @@ -0,0 +1,138 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="BUTtests.Text" xml:space="preserve"> + <value>Tests</value> + </data> + <data name="Logs.Text" xml:space="preserve"> + <value>Descargar Log</value> + </data> + <data name="BUTradiosetup.Text" xml:space="preserve"> + <value>Ajustar Radio</value> + </data> + <data name="TXT_terminal.Text" xml:space="preserve"> + <value /> + </data> + <data name="BUT_logbrowse.Text" xml:space="preserve"> + <value>Buscar Log</value> + </data> + <data name="BUTsetupshow.Text" xml:space="preserve"> + <value>Mostrar Ajustes</value> + </data> +</root> \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/test.Designer.cs b/Tools/ArdupilotMegaPlanner/GCSViews/test.Designer.cs deleted file mode 100644 index fccf65b5da6427884a502556e2b9718d3ed9a277..0000000000000000000000000000000000000000 --- a/Tools/ArdupilotMegaPlanner/GCSViews/test.Designer.cs +++ /dev/null @@ -1,152 +0,0 @@ -namespace ArdupilotMega.GCSViews -{ - partial class test - { - /// <summary> - /// Required designer variable. - /// </summary> - private System.ComponentModel.IContainer components = null; - - /// <summary> - /// Clean up any resources being used. - /// </summary> - /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// <summary> - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// </summary> - private void InitializeComponent() - { - this.panel3 = new BSE.Windows.Forms.Panel(); - this.splitter1 = new BSE.Windows.Forms.Splitter(); - this.panel1 = new BSE.Windows.Forms.Panel(); - this.splitter2 = new BSE.Windows.Forms.Splitter(); - this.SuspendLayout(); - // - // panel3 - // - this.panel3.AssociatedSplitter = this.splitter1; - this.panel3.BackColor = System.Drawing.Color.Transparent; - this.panel3.CaptionFont = new System.Drawing.Font("Segoe UI", 11.75F, System.Drawing.FontStyle.Bold); - this.panel3.CaptionHeight = 27; - this.panel3.CustomColors.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(184)))), ((int)(((byte)(184)))), ((int)(((byte)(184))))); - this.panel3.CustomColors.CaptionCloseIcon = System.Drawing.SystemColors.ControlText; - this.panel3.CustomColors.CaptionExpandIcon = System.Drawing.SystemColors.ControlText; - this.panel3.CustomColors.CaptionGradientBegin = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(252)))), ((int)(((byte)(252))))); - this.panel3.CustomColors.CaptionGradientEnd = System.Drawing.SystemColors.ButtonFace; - this.panel3.CustomColors.CaptionGradientMiddle = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(248))))); - this.panel3.CustomColors.CaptionSelectedGradientBegin = System.Drawing.Color.FromArgb(((int)(((byte)(194)))), ((int)(((byte)(224)))), ((int)(((byte)(255))))); - this.panel3.CustomColors.CaptionSelectedGradientEnd = System.Drawing.Color.FromArgb(((int)(((byte)(194)))), ((int)(((byte)(224)))), ((int)(((byte)(255))))); - this.panel3.CustomColors.CaptionText = System.Drawing.SystemColors.ControlText; - this.panel3.CustomColors.CollapsedCaptionText = System.Drawing.SystemColors.ControlText; - this.panel3.CustomColors.ContentGradientBegin = System.Drawing.SystemColors.ButtonFace; - this.panel3.CustomColors.ContentGradientEnd = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(252)))), ((int)(((byte)(252))))); - this.panel3.CustomColors.InnerBorderColor = System.Drawing.SystemColors.Window; - this.panel3.Dock = System.Windows.Forms.DockStyle.Left; - this.panel3.ForeColor = System.Drawing.SystemColors.ControlText; - this.panel3.Image = null; - this.panel3.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical; - this.panel3.Location = new System.Drawing.Point(0, 0); - this.panel3.MinimumSize = new System.Drawing.Size(27, 27); - this.panel3.Name = "panel3"; - this.panel3.PanelStyle = BSE.Windows.Forms.PanelStyle.Default; - this.panel3.ShowExpandIcon = true; - this.panel3.Size = new System.Drawing.Size(194, 461); - this.panel3.TabIndex = 4; - this.panel3.Text = "panel3"; - this.panel3.ToolTipTextCloseIcon = null; - this.panel3.ToolTipTextExpandIconPanelCollapsed = null; - this.panel3.ToolTipTextExpandIconPanelExpanded = null; - // - // splitter1 - // - this.splitter1.BackColor = System.Drawing.Color.Transparent; - this.splitter1.Location = new System.Drawing.Point(194, 0); - this.splitter1.Name = "splitter1"; - this.splitter1.Size = new System.Drawing.Size(3, 461); - this.splitter1.TabIndex = 6; - this.splitter1.TabStop = false; - // - // panel1 - // - this.panel1.AssociatedSplitter = this.splitter2; - this.panel1.BackColor = System.Drawing.Color.Transparent; - this.panel1.CaptionFont = new System.Drawing.Font("Segoe UI", 11.75F, System.Drawing.FontStyle.Bold); - this.panel1.CaptionHeight = 27; - this.panel1.CustomColors.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(184)))), ((int)(((byte)(184)))), ((int)(((byte)(184))))); - this.panel1.CustomColors.CaptionCloseIcon = System.Drawing.SystemColors.ControlText; - this.panel1.CustomColors.CaptionExpandIcon = System.Drawing.SystemColors.ControlText; - this.panel1.CustomColors.CaptionGradientBegin = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(252)))), ((int)(((byte)(252))))); - this.panel1.CustomColors.CaptionGradientEnd = System.Drawing.SystemColors.ButtonFace; - this.panel1.CustomColors.CaptionGradientMiddle = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(248))))); - this.panel1.CustomColors.CaptionSelectedGradientBegin = System.Drawing.Color.FromArgb(((int)(((byte)(194)))), ((int)(((byte)(224)))), ((int)(((byte)(255))))); - this.panel1.CustomColors.CaptionSelectedGradientEnd = System.Drawing.Color.FromArgb(((int)(((byte)(194)))), ((int)(((byte)(224)))), ((int)(((byte)(255))))); - this.panel1.CustomColors.CaptionText = System.Drawing.SystemColors.ControlText; - this.panel1.CustomColors.CollapsedCaptionText = System.Drawing.SystemColors.ControlText; - this.panel1.CustomColors.ContentGradientBegin = System.Drawing.SystemColors.ButtonFace; - this.panel1.CustomColors.ContentGradientEnd = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(252)))), ((int)(((byte)(252))))); - this.panel1.CustomColors.InnerBorderColor = System.Drawing.SystemColors.Window; - this.panel1.Dock = System.Windows.Forms.DockStyle.Right; - this.panel1.ForeColor = System.Drawing.SystemColors.ControlText; - this.panel1.Image = null; - this.panel1.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical; - this.panel1.Location = new System.Drawing.Point(808, 0); - this.panel1.MinimumSize = new System.Drawing.Size(27, 27); - this.panel1.Name = "panel1"; - this.panel1.PanelStyle = BSE.Windows.Forms.PanelStyle.Default; - this.panel1.ShowExpandIcon = true; - this.panel1.Size = new System.Drawing.Size(200, 461); - this.panel1.TabIndex = 7; - this.panel1.Text = "panel1"; - this.panel1.ToolTipTextCloseIcon = null; - this.panel1.ToolTipTextExpandIconPanelCollapsed = null; - this.panel1.ToolTipTextExpandIconPanelExpanded = null; - // - // splitter2 - // - this.splitter2.BackColor = System.Drawing.Color.Transparent; - this.splitter2.Dock = System.Windows.Forms.DockStyle.Right; - this.splitter2.Location = new System.Drawing.Point(805, 0); - this.splitter2.Name = "splitter2"; - this.splitter2.Size = new System.Drawing.Size(3, 461); - this.splitter2.TabIndex = 8; - this.splitter2.TabStop = false; - // - // test - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.splitter2); - this.Controls.Add(this.panel1); - this.Controls.Add(this.splitter1); - this.Controls.Add(this.panel3); - this.MinimumSize = new System.Drawing.Size(1008, 461); - this.Name = "test"; - this.Size = new System.Drawing.Size(1008, 461); - this.Load += new System.EventHandler(this.test_Load); - this.ResumeLayout(false); - - } - - #endregion - - private BSE.Windows.Forms.Panel panel3; - private BSE.Windows.Forms.Splitter splitter1; - private BSE.Windows.Forms.Panel panel1; - private BSE.Windows.Forms.Splitter splitter2; - - - - } -} diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/test.cs b/Tools/ArdupilotMegaPlanner/GCSViews/test.cs deleted file mode 100644 index d61c4bd19f450d90b153ef5e96cf4eb439d058bf..0000000000000000000000000000000000000000 --- a/Tools/ArdupilotMegaPlanner/GCSViews/test.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Data; -using System.Linq; -using System.Text; -using System.Windows.Forms; - -namespace ArdupilotMega.GCSViews -{ - public partial class test : UserControl - { - public test() - { - InitializeComponent(); - } - - private void test_Load(object sender, EventArgs e) - { - panel3.Expand = false; - panel1.Expand = false; - } - - } -} - diff --git a/Tools/ArdupilotMegaPlanner/HUD.cs b/Tools/ArdupilotMegaPlanner/HUD.cs index 2b01f3242d88a317710f516faec2d402547adc6f..84f017696258f8b1a35767a636a48b2a2c410f1b 100644 --- a/Tools/ArdupilotMegaPlanner/HUD.cs +++ b/Tools/ArdupilotMegaPlanner/HUD.cs @@ -241,6 +241,7 @@ namespace hud } bool inOnPaint = false; + string otherthread = ""; protected override void OnPaint(PaintEventArgs e) { @@ -265,10 +266,12 @@ namespace hud if (inOnPaint) { - Console.WriteLine("Was in onpaint Hud th:" + System.Threading.Thread.CurrentThread.Name); + Console.WriteLine("Was in onpaint Hud th:" + System.Threading.Thread.CurrentThread.Name + " in " + otherthread); return; } + otherthread = System.Threading.Thread.CurrentThread.Name; + inOnPaint = true; starttime = DateTime.Now; diff --git a/Tools/ArdupilotMegaPlanner/JoystickSetup.es-ES.resx b/Tools/ArdupilotMegaPlanner/JoystickSetup.es-ES.resx new file mode 100644 index 0000000000000000000000000000000000000000..700190a0baebc97ba0e86f9c580e242129aa0940 --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/JoystickSetup.es-ES.resx @@ -0,0 +1,219 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="label12.Text" xml:space="preserve"> + <value>CH 7</value> + </data> + <data name="label10.Text" xml:space="preserve"> + <value>CH 5</value> + </data> + <data name="label13.Text" xml:space="preserve"> + <value>CH 8</value> + </data> + <data name="label11.Text" xml:space="preserve"> + <value>CH 6</value> + </data> + <data name="$this.Text" xml:space="preserve"> + <value>Joystick</value> + </data> + <data name="label2.Text" xml:space="preserve"> + <value>Cabeceo</value> + </data> + <data name="label3.Text" xml:space="preserve"> + <value>Acelerador</value> + </data> + <data name="expo_ch3.Text" xml:space="preserve"> + <value>0</value> + </data> + <data name="label1.Text" xml:space="preserve"> + <value>Alabeo</value> + </data> + <data name="label6.Text" xml:space="preserve"> + <value>Expo</value> + </data> + <data name="expo_ch1.Text" xml:space="preserve"> + <value>30</value> + </data> + <data name="label7.Text" xml:space="preserve"> + <value>Salida</value> + </data> + <data name="expo_ch2.Text" xml:space="preserve"> + <value>30</value> + </data> + <data name="label4.Text" xml:space="preserve"> + <value>Timón</value> + </data> + <data name="expo_ch7.Text" xml:space="preserve"> + <value>0</value> + </data> + <data name="label5.Text" xml:space="preserve"> + <value>Joystick</value> + </data> + <data name="expo_ch5.Text" xml:space="preserve"> + <value>0</value> + </data> + <data name="label8.Text" xml:space="preserve"> + <value>Controlador Ejes</value> + </data> + <data name="expo_ch6.Text" xml:space="preserve"> + <value>0</value> + </data> + <data name="label9.Text" xml:space="preserve"> + <value>Invertir</value> + </data> + <data name="expo_ch4.Text" xml:space="preserve"> + <value>30</value> + </data> + <data name="expo_ch8.Text" xml:space="preserve"> + <value>0</value> + </data> + <data name="BUT_save.Text" xml:space="preserve"> + <value>Guardar</value> + </data> + <data name="BUT_detch6.Text" xml:space="preserve"> + <value>Auto Detectar</value> + </data> + <data name="CHK_elevons.Text" xml:space="preserve"> + <value>Elevons</value> + </data> + <data name="BUT_detch7.Text" xml:space="preserve"> + <value>Auto Detectar</value> + </data> + <data name="BUT_detch4.Text" xml:space="preserve"> + <value>Auto Detectar</value> + </data> + <data name="BUT_detch5.Text" xml:space="preserve"> + <value>Auto Detectar</value> + </data> + <data name="BUT_detch2.Text" xml:space="preserve"> + <value>Auto Detectar</value> + </data> + <data name="BUT_detch3.Text" xml:space="preserve"> + <value>Auto Detectar</value> + </data> + <data name="BUT_detch1.Text" xml:space="preserve"> + <value>Auto Detectar</value> + </data> + <data name="BUT_detch8.Text" xml:space="preserve"> + <value>Auto Detectar</value> + </data> + <data name="BUT_enable.Text" xml:space="preserve"> + <value>Habilitar</value> + </data> +</root> \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/Log.es-ES.resx b/Tools/ArdupilotMegaPlanner/Log.es-ES.resx new file mode 100644 index 0000000000000000000000000000000000000000..5d92cbf075bccf185a218d18000f5a75b9dc08ab --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/Log.es-ES.resx @@ -0,0 +1,138 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="$this.Text" xml:space="preserve"> + <value>Log</value> + </data> + <data name="BUT_DLall.Text" xml:space="preserve"> + <value>Descargar todos los Logs</value> + </data> + <data name="BUT_redokml.Text" xml:space="preserve"> + <value>Recrear KML</value> + </data> + <data name="BUT_DLthese.Text" xml:space="preserve"> + <value>Descargar este Log</value> + </data> + <data name="BUT_clearlogs.Text" xml:space="preserve"> + <value>Limpiar Logs</value> + </data> + <data name="BUT_firstperson.Text" xml:space="preserve"> + <value>KML Primera Persona</value> + </data> +</root> \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/LogBrowse.es-ES.resx b/Tools/ArdupilotMegaPlanner/LogBrowse.es-ES.resx new file mode 100644 index 0000000000000000000000000000000000000000..fc31e41ec664f84f30ee3027646568664e899e3d --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/LogBrowse.es-ES.resx @@ -0,0 +1,141 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="BUT_loadlog.Text" xml:space="preserve"> + <value>Cargar un Log</value> + </data> + <data name="$this.Text" xml:space="preserve"> + <value>Mostrar Log</value> + </data> + <data name="Graphit.Text" xml:space="preserve"> + <value>Gráfico de estos datos</value> + </data> + <data name="Graphit.ToolTip" xml:space="preserve"> + <value>Gráficos de la celda actual puso de relieve</value> + </data> + <data name="BUT_loadlog.ToolTip" xml:space="preserve"> + <value>Cargar un archivo diferente de Log</value> + </data> + <data name="BUT_cleargraph.ToolTip" xml:space="preserve"> + <value>Borrar todos los datos del gráfico</value> + </data> + <data name="BUT_cleargraph.Text" xml:space="preserve"> + <value>Limpiar Gráfico</value> + </data> +</root> \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/MAVLink.cs b/Tools/ArdupilotMegaPlanner/MAVLink.cs index f0aab4b36fa58d628222d3d6fc82839b48439b87..e24df86b539448e91f6a18732091b0d0e7117333 100644 --- a/Tools/ArdupilotMegaPlanner/MAVLink.cs +++ b/Tools/ArdupilotMegaPlanner/MAVLink.cs @@ -9,46 +9,99 @@ using System.Reflection; using System.Reflection.Emit; using System.IO; using System.Drawing; - +using ArdupilotMega.Mavlink; +using System.ComponentModel; namespace ArdupilotMega { public partial class MAVLink { - public ICommsSerial BaseStream = new SerialPort(); + private const double CONNECT_TIMEOUT_SECONDS = 30; + + /// <summary> + /// Used for progress reporting on all internal functions + /// </summary> + public event ProgressEventHandler Progress; + /// <summary> + /// progress form to handle connect and param requests + /// </summary> + ProgressReporter frm; + /// <summary> /// used for outbound packet sending /// </summary> byte packetcount = 0; + /// <summary> + /// mavlink remote sysid + /// </summary> public byte sysid = 0; + /// <summary> + /// mavlink remove compid + /// </summary> public byte compid = 0; + /// <summary> + /// storage for whole paramater list + /// </summary> public Hashtable param = new Hashtable(); + /// <summary> + /// storage of a previous packet recevied of a specific type + /// </summary> public byte[][] packets = new byte[256][]; + /// <summary> + /// used to calc packets per second on any single message type - used for stream rate comparaison + /// </summary> public double[] packetspersecond = new double[256]; + /// <summary> + /// time last seen a packet of a type + /// </summary> DateTime[] packetspersecondbuild = new DateTime[256]; + /// <summary> + /// used as a serial port write lock + /// </summary> object objlock = new object(); + /// <summary> + /// used for a readlock on readpacket + /// </summary> object readlock = new object(); + /// <summary> + /// used for tlog file lock + /// </summary> object logwritelock = new object(); + /// <summary> + /// time seen of last mavlink packet + /// </summary> public DateTime lastvalidpacket = DateTime.Now; + /// <summary> + /// old log support + /// </summary> bool oldlogformat = false; + /// <summary> + /// mavlink version + /// </summary> byte mavlinkversion = 0; + /// <summary> + /// mavlink ap type + /// </summary> public byte aptype = 0; - byte[] readingpacket = new byte[256]; - + /// <summary> + /// used as a snapshot of what is loaded on the ap atm. - derived from the stream + /// </summary> public PointLatLngAlt[] wps = new PointLatLngAlt[200]; - + /// <summary> + /// turns on console packet display + /// </summary> public bool debugmavlink = false; - + /// <summary> + /// enabled read from file mode + /// </summary> public bool logreadmode = false; public DateTime lastlogread = DateTime.MinValue; public BinaryReader logplaybackfile = null; public BinaryWriter logfile = null; - public byte[] streams = new byte[256]; - int bps1 = 0; int bps2 = 0; public int bps = 0; @@ -78,8 +131,22 @@ namespace ArdupilotMega if (BaseStream.IsOpen) return; - System.Windows.Forms.Form frm = Common.LoadingBox("Mavlink Connecting..", "Mavlink Connecting.."); - frm.TopMost = true; + //System.Windows.Forms.Form frm = Common.LoadingBox("Mavlink Connecting..", "Mavlink Connecting.."); + //frm.TopMost = true; + + frm = new ProgressReporter(); + MainV2.fixtheme(frm); + this.Progress += new ProgressEventHandler(MAVLink_Progress); + //(progress, status) => { frm.updateProgressAndStatus(progress, status); }; + + frm.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + + frm.Show(); + + frm.Focus(); + + if (Progress != null) + Progress(-1, "Mavlink Connecting..."); // reset sysid = 0; @@ -102,7 +169,13 @@ namespace ArdupilotMega BaseStream.toggleDTR(); // allow 2560 connect timeout on usb - System.Threading.Thread.Sleep(1000); + for (int a = 0; a < 1000; a++ ) { + System.Threading.Thread.Sleep(1); + if (!MainV2.instance.InvokeRequired) + { + System.Windows.Forms.Application.DoEvents(); + } + } } @@ -110,42 +183,48 @@ namespace ArdupilotMega byte[] buffer1; DateTime start = DateTime.Now; + DateTime deadline = start.AddSeconds(CONNECT_TIMEOUT_SECONDS); + + var countDown = new System.Timers.Timer { Interval = 1000, AutoReset = false }; + countDown.Elapsed += (sender, e) => + { + int secondsRemaining = (deadline - e.SignalTime).Seconds; + if (Progress != null) + Progress(-1, string.Format("Trying to connect.\nTimeout in {0}", secondsRemaining)); + if (secondsRemaining > 0) countDown.Start(); + }; + countDown.Start(); int count = 0; while (true) { - System.Windows.Forms.Application.DoEvents(); - // incase we are in setup mode BaseStream.WriteLine("planner\rgcs\r"); - frm.Controls[0].Text = (start.AddSeconds(30) - DateTime.Now).Seconds.ToString("Timeout in 0"); + Console.WriteLine(DateTime.Now.Millisecond + " start "); + + /* + if (Progress != null) + { + int secondsRemaining = (start.AddSeconds(CONNECT_TIMEOUT_SECONDS) - DateTime.Now).Seconds; + Progress(-1, string.Format("Trying to connect.\nTimeout in {0}", secondsRemaining)); + } + */ if (lastbad[0] == '!' && lastbad[1] == 'G' || lastbad[0] == 'G' && lastbad[1] == '!') // waiting for gps lock { - frm.Controls[0].Text = "Waiting for GPS detection.."; + if (Progress != null) + Progress(-1, "Waiting for GPS detection.."); start = start.AddSeconds(5); // each round is 1.1 seconds } - System.Windows.Forms.Application.DoEvents(); - - if (!(start.AddSeconds(30) > DateTime.Now)) + if (DateTime.Now > deadline) { - /* - System.Windows.Forms.DialogResult dr = System.Windows.Forms.MessageBox.Show("Data recevied but no mavlink packets where read from this port\nWhat do you want to do", - "Read Fail", System.Windows.Forms.MessageBoxButtons.RetryCancel); - if (dr == System.Windows.Forms.DialogResult.Retry) - { - port.toggleDTRnow(); // force reset on usb - start = DateTime.Now; - } - else*/ - { - frm.Close(); - this.Close(); - throw new Exception("No Mavlink Heartbeat Packets where read from this port - Verify Baud Rate and setup\nIt might also be waiting for GPS Lock\nAPM Planner waits for 2 valid heartbeat packets before connecting"); - } + if (Progress != null) + Progress(-1, "No Heatbeat Packets"); + this.Close(); + throw new Exception("No Mavlink Heartbeat Packets where read from this port - Verify Baud Rate and setup\nIt might also be waiting for GPS Lock\nAPM Planner waits for 2 valid heartbeat packets before connecting"); } System.Threading.Thread.Sleep(1); @@ -153,23 +232,15 @@ namespace ArdupilotMega // incase we are in setup mode BaseStream.WriteLine("planner\rgcs\r"); - System.Windows.Forms.Application.DoEvents(); - buffer = getHeartBeat(); - System.Windows.Forms.Application.DoEvents(); - // incase we are in setup mode BaseStream.WriteLine("planner\rgcs\r"); System.Threading.Thread.Sleep(1); - System.Windows.Forms.Application.DoEvents(); - buffer1 = getHeartBeat(); - System.Windows.Forms.Application.DoEvents(); - try { Console.WriteLine("MAv Data: len " + buffer.Length + " btr " + BaseStream.BytesToRead); @@ -180,13 +251,7 @@ namespace ArdupilotMega if (buffer.Length > 5 && buffer1.Length > 5 && buffer[3] == buffer1[3] && buffer[4] == buffer1[4]) { - __mavlink_heartbeat_t hb = new __mavlink_heartbeat_t(); - - object temp = hb; - - MAVLink.ByteArrayToStructure(buffer, ref temp, 6); - - hb = (MAVLink.__mavlink_heartbeat_t)(temp); + __mavlink_heartbeat_t hb = buffer.ByteArrayToStructure<__mavlink_heartbeat_t>(6); mavlinkversion = hb.mavlink_version; aptype = hb.type; @@ -194,14 +259,18 @@ namespace ArdupilotMega sysid = buffer[3]; compid = buffer[4]; recvpacketcount = buffer[2]; - Console.WriteLine("ID sys " + sysid + " comp " + compid + " ver" + mavlinkversion); + Console.WriteLine("ID sys {0} comp {1} ver{2}", sysid, compid, mavlinkversion); break; } + } - frm.Controls[0].Text = "Getting Params.. (sysid " + sysid + " compid " + compid + ") "; - frm.Refresh(); - if (getparams == true) + countDown.Stop(); + + if (Progress != null) + Progress(-1, "Getting Params.. (sysid " + sysid + " compid " + compid + ") "); + + if (getparams) getParamList(); } catch (Exception e) @@ -212,132 +281,27 @@ namespace ArdupilotMega } catch { } MainV2.givecomport = false; - frm.Close(); + if (Progress != null) + Progress(-1, "Connect Failed\n" + e.Message); throw e; } - frm.Close(); - MainV2.givecomport = false; - Console.WriteLine("Done open " + sysid + " " + compid); - packetslost = 0; } - byte[] StructureToByteArrayEndian(params object[] list) + void MAVLink_Progress(int progress, string status) { - // The copy is made becuase SetValue won't work on a struct. - // Boxing was used because SetValue works on classes/objects. - // Unfortunately, it results in 2 copy operations. - object thisBoxed = list[0]; // Why make a copy? - Type test = thisBoxed.GetType(); - - int offset = 0; - byte[] data = new byte[Marshal.SizeOf(thisBoxed)]; - - // System.Net.IPAddress.NetworkToHostOrder is used to perform byte swapping. - // To convert unsigned to signed, 'unchecked()' was used. - // See http://stackoverflow.com/questions/1131843/how-do-i-convert-uint-to-int-in-c - - object fieldValue; - TypeCode typeCode; - - byte[] temp; - - // Enumerate each structure field using reflection. - foreach (var field in test.GetFields()) + if (frm != null) { - // field.Name has the field's name. - - fieldValue = field.GetValue(thisBoxed); // Get value - - // Get the TypeCode enumeration. Multiple types get mapped to a common typecode. - typeCode = Type.GetTypeCode(fieldValue.GetType()); - - switch (typeCode) - { - case TypeCode.Single: // float - { - temp = BitConverter.GetBytes((Single)fieldValue); - Array.Reverse(temp); - Array.Copy(temp, 0, data, offset, sizeof(Single)); - break; - } - case TypeCode.Int32: - { - temp = BitConverter.GetBytes((Int32)fieldValue); - Array.Reverse(temp); - Array.Copy(temp, 0, data, offset, sizeof(Int32)); - break; - } - case TypeCode.UInt32: - { - temp = BitConverter.GetBytes((UInt32)fieldValue); - Array.Reverse(temp); - Array.Copy(temp, 0, data, offset, sizeof(UInt32)); - break; - } - case TypeCode.Int16: - { - temp = BitConverter.GetBytes((Int16)fieldValue); - Array.Reverse(temp); - Array.Copy(temp, 0, data, offset, sizeof(Int16)); - break; - } - case TypeCode.UInt16: - { - temp = BitConverter.GetBytes((UInt16)fieldValue); - Array.Reverse(temp); - Array.Copy(temp, 0, data, offset, sizeof(UInt16)); - break; - } - case TypeCode.Int64: - { - temp = BitConverter.GetBytes((Int64)fieldValue); - Array.Reverse(temp); - Array.Copy(temp, 0, data, offset, sizeof(Int64)); - break; - } - case TypeCode.UInt64: - { - temp = BitConverter.GetBytes((UInt64)fieldValue); - Array.Reverse(temp); - Array.Copy(temp, 0, data, offset, sizeof(UInt64)); - break; - } - case TypeCode.Double: - { - temp = BitConverter.GetBytes((Double)fieldValue); - Array.Reverse(temp); - Array.Copy(temp, 0, data, offset, sizeof(Double)); - break; - } - case TypeCode.Byte: - { - data[offset] = (Byte)fieldValue; - break; - } - default: - { - //System.Diagnostics.Debug.Fail("No conversion provided for this type : " + typeCode.ToString()); - break; - } - }; // switch - if (typeCode == TypeCode.Object) - { - int length = ((byte[])fieldValue).Length; - Array.Copy(((byte[])fieldValue), 0, data, offset, length); - offset += length; - } - else + try { - offset += Marshal.SizeOf(fieldValue); + frm.updateProgressAndStatus(progress, status); } - } // foreach - - return data; - } // Swap + catch (Exception ex) { throw ex; } + } + } byte[] getHeartBeat() { @@ -388,11 +352,11 @@ namespace ArdupilotMega if (mavlinkversion == 3) { - data = StructureToByteArray(indata); + data = MavlinkUtil.StructureToByteArray(indata); } else { - data = StructureToByteArrayEndian(indata); + data = MavlinkUtil.StructureToByteArrayBigEndian(indata); } //Console.WriteLine(DateTime.Now + " PC Doing req "+ messageType + " " + this.BytesToRead); @@ -423,11 +387,11 @@ namespace ArdupilotMega i++; } - ushort checksum = crc_calculate(packet, packet[1] + 6); + ushort checksum = MavlinkCRC.crc_calculate(packet, packet[1] + 6); if (mavlinkversion == 3) { - checksum = crc_accumulate(MAVLINK_MESSAGE_CRCS[messageType], checksum); + checksum = MavlinkCRC.crc_accumulate(MAVLINK_MESSAGE_CRCS[messageType], checksum); } byte ck_a = (byte)(checksum & 0xFF); ///< High byte @@ -496,7 +460,7 @@ namespace ArdupilotMega { int value = (int)(float)param[paramname]; - return setParam(paramname,value | (int)flag); + return setParam(paramname, value | (int)flag); } /// <summary> @@ -557,13 +521,7 @@ namespace ArdupilotMega { if (buffer[5] == MAVLINK_MSG_ID_PARAM_VALUE) { - __mavlink_param_value_t par = new __mavlink_param_value_t(); - - object tempobj = par; - - ByteArrayToStructure(buffer, ref tempobj, 6); - - par = (__mavlink_param_value_t)tempobj; + __mavlink_param_value_t par = buffer.ByteArrayToStructure<__mavlink_param_value_t>(6); string st = System.Text.ASCIIEncoding.ASCII.GetString(par.param_id); @@ -631,7 +589,7 @@ namespace ArdupilotMega { if (retrys > 0) { - Console.WriteLine("getParamList Retry " + retrys + " sys " + sysid + " comp " + compid); + Console.WriteLine("getParamList Retry {0} sys {1} comp {2}", retrys, sysid, compid); generatePacket(MAVLINK_MSG_ID_PARAM_REQUEST_LIST, req); start = DateTime.Now; retrys--; @@ -659,15 +617,19 @@ namespace ArdupilotMega restart = DateTime.Now; start = DateTime.Now; - __mavlink_param_value_t par = new __mavlink_param_value_t(); + __mavlink_param_value_t par = buffer.ByteArrayToStructure<__mavlink_param_value_t>(6); - object temp = par; + param_total = (par.param_count); - ByteArrayToStructure(buffer, ref temp, 6); - par = (__mavlink_param_value_t)temp; + string paramID = System.Text.ASCIIEncoding.ASCII.GetString(par.param_id); - param_total = (par.param_count); + int pos = paramID.IndexOf('\0'); + if (pos != -1) + { + paramID = paramID.Substring(0, pos); + } + Console.WriteLine(DateTime.Now.Millisecond + " got param " + (par.param_index) + " of " + (param_total - 1) + " name: " + paramID); // for out of order udp packets if (BaseStream.GetType() != typeof(UdpSerial)) @@ -675,6 +637,8 @@ namespace ArdupilotMega if (nextid == (par.param_index)) { nextid++; + if (Progress != null) + Progress((par.param_index * 100) / param_total, "Got param " + paramID); } else { @@ -687,27 +651,15 @@ namespace ArdupilotMega retrys--; continue; } + Console.WriteLine("Out of order packet. Re-requesting list"); missed.Add(nextid); // for later devel MainV2.givecomport = false; throw new Exception("Missed ID expecting " + nextid + " got " + (par.param_index) + "\nPlease try loading again"); } - } - - string st = System.Text.ASCIIEncoding.ASCII.GetString(par.param_id); - - int pos = st.IndexOf('\0'); - - if (pos != -1) - { - st = st.Substring(0, pos); } - Console.WriteLine(DateTime.Now.Millisecond + " got param " + (par.param_index) + " of " + (param_total - 1) + " name: " + st); - - modifyParamForDisplay(true, st, ref par.param_value); - - param[st] = (par.param_value); - + modifyParamForDisplay(true, paramID, ref par.param_value); + param[paramID] = (par.param_value); param_count++; } else @@ -757,12 +709,6 @@ namespace ArdupilotMega req.start_stop = 0; // stop req.req_stream_id = 0; // all - // reset all - if (forget) - { - streams = new byte[streams.Length]; - } - // no error on bad try { @@ -897,13 +843,10 @@ namespace ArdupilotMega { if (buffer[5] == MAVLINK_MSG_ID_COMMAND_ACK) { - __mavlink_command_ack_t ack = new __mavlink_command_ack_t(); - object temp = (object)ack; - ByteArrayToStructure(buffer, ref temp, 6); + var ack = buffer.ByteArrayToStructure<__mavlink_command_ack_t>(6); - ack = (__mavlink_command_ack_t)(temp); if (ack.result == (byte)MAV_RESULT.MAV_RESULT_ACCEPTED) { @@ -1031,8 +974,6 @@ namespace ArdupilotMega public void requestDatastream(byte id, byte hzrate) { - streams[id] = hzrate; - double pps = 0; switch (id) @@ -1204,13 +1145,10 @@ namespace ArdupilotMega { if (buffer[5] == MAVLINK_MSG_ID_MISSION_COUNT) { - __mavlink_mission_count_t count = new __mavlink_mission_count_t(); - object temp = (object)count; - ByteArrayToStructure(buffer, ref temp, 6); - count = (__mavlink_mission_count_t)(temp); + var count = buffer.ByteArrayToStructure<__mavlink_mission_count_t>(6); Console.WriteLine("wpcount: " + count.count); @@ -1320,15 +1258,12 @@ namespace ArdupilotMega if (buffer[5] == MAVLINK_MSG_ID_MISSION_ITEM) { //Console.WriteLine("getwp ans " + DateTime.Now.Millisecond); - __mavlink_mission_item_t wp = new __mavlink_mission_item_t(); - object temp = (object)wp; //Array.Copy(buffer, 6, buffer, 0, buffer.Length - 6); - ByteArrayToStructure(buffer, ref temp, 6); + var wp = buffer.ByteArrayToStructure<__mavlink_mission_item_t>(6); - wp = (__mavlink_mission_item_t)(temp); #else @@ -1370,15 +1305,7 @@ namespace ArdupilotMega if (buffer[5] == MAVLINK_MSG_ID_WAYPOINT) { //Console.WriteLine("getwp ans " + DateTime.Now.Millisecond); - __mavlink_waypoint_t wp = new __mavlink_waypoint_t(); - - object temp = (object)wp; - - //Array.Copy(buffer, 6, buffer, 0, buffer.Length - 6); - - ByteArrayToStructure(buffer, ref temp, 6); - - wp = (__mavlink_waypoint_t)(temp); + __mavlink_waypoint_t wp = buffer.ByteArrayToStructure<__mavlink_waypoint_t>(6); #endif @@ -1499,7 +1426,7 @@ namespace ArdupilotMega object data = Activator.CreateInstance(mavstructs[messid]); - ByteArrayToStructure(datin, ref data, 6); + MavlinkUtil.ByteArrayToStructure(datin, ref data, 6); Type test = data.GetType(); @@ -1580,13 +1507,10 @@ namespace ArdupilotMega { if (buffer[5] == MAVLINK_MSG_ID_MISSION_REQUEST) { - __mavlink_mission_request_t request = new __mavlink_mission_request_t(); - object temp = (object)request; - ByteArrayToStructure(buffer, ref temp, 6); - request = (__mavlink_mission_request_t)(temp); + var request = buffer.ByteArrayToStructure<__mavlink_mission_request_t>(6); if (request.seq == 0) { @@ -1638,13 +1562,7 @@ namespace ArdupilotMega { if (buffer[5] == MAVLINK_MSG_ID_WAYPOINT_REQUEST) { - __mavlink_waypoint_request_t request = new __mavlink_waypoint_request_t(); - - object temp = (object)request; - - ByteArrayToStructure(buffer, ref temp, 6); - - request = (__mavlink_waypoint_request_t)(temp); + __mavlink_waypoint_request_t request = buffer.ByteArrayToStructure<__mavlink_waypoint_request_t>(6); if (request.seq == 0) { @@ -1790,26 +1708,20 @@ namespace ArdupilotMega #if MAVLINK10 if (buffer[5] == MAVLINK_MSG_ID_MISSION_ACK) { - __mavlink_mission_ack_t ans = new __mavlink_mission_ack_t(); - object temp = (object)ans; - ByteArrayToStructure(buffer, ref temp, 6); + var ans = buffer.ByteArrayToStructure<__mavlink_mission_ack_t>(6); - ans = (__mavlink_mission_ack_t)(temp); Console.WriteLine("set wp " + index + " ACK 47 : " + buffer[5] + " ans " + Enum.Parse(typeof(MAV_MISSION_RESULT), ans.type.ToString())); break; } else if (buffer[5] == MAVLINK_MSG_ID_MISSION_REQUEST) { - __mavlink_mission_request_t ans = new __mavlink_mission_request_t(); + var ans = buffer.ByteArrayToStructure<__mavlink_mission_request_t>(6); - object temp = (object)ans; - ByteArrayToStructure(buffer, ref temp, 6); - ans = (__mavlink_mission_request_t)(temp); if (ans.seq == (index + 1)) { @@ -1835,15 +1747,7 @@ namespace ArdupilotMega } else if (buffer[5] == MAVLINK_MSG_ID_WAYPOINT_REQUEST) { - __mavlink_waypoint_request_t ans = new __mavlink_waypoint_request_t(); - - object temp = (object)ans; - - //Array.Copy(buffer, 6, buffer, 0, buffer.Length - 6); - - ByteArrayToStructure(buffer, ref temp, 6); - - ans = (__mavlink_waypoint_request_t)(temp); + __mavlink_waypoint_request_t ans = buffer.ByteArrayToStructure<__mavlink_waypoint_request_t>(6); if (ans.seq == (index + 1)) { @@ -1961,7 +1865,7 @@ namespace ArdupilotMega int readcount = 0; lastbad = new byte[2]; - BaseStream.ReadTimeout = 1100; // 1100 ms between bytes + BaseStream.ReadTimeout = 100; DateTime start = DateTime.Now; @@ -2008,6 +1912,23 @@ namespace ArdupilotMega else { MainV2.cs.datetime = DateTime.Now; + + int to = 0; + + while (BaseStream.BytesToRead <= 0) + { + if (to > BaseStream.ReadTimeout) + { + Console.WriteLine("MAVLINK: wait time out btr {0} len {1}", BaseStream.BytesToRead, length); + throw new Exception("Timeout"); + } + System.Threading.Thread.Sleep(1); + if (!MainV2.instance.InvokeRequired) + { + System.Windows.Forms.Application.DoEvents(); // when connecting this is in the main thread + } + to++; + } if (BaseStream.IsOpen) temp[count] = (byte)BaseStream.ReadByte(); } @@ -2061,7 +1982,10 @@ namespace ArdupilotMega break; } System.Threading.Thread.Sleep(1); - System.Windows.Forms.Application.DoEvents(); // when connecting this is in the main thread + if (!MainV2.instance.InvokeRequired) + { + System.Windows.Forms.Application.DoEvents(); // when connecting this is in the main thread + } to++; //Console.WriteLine("data " + 0 + " " + length + " aval " + BaseStream.BytesToRead); @@ -2114,11 +2038,11 @@ namespace ArdupilotMega return temp;// new byte[0]; } - ushort crc = crc_calculate(temp, temp.Length - 2); + ushort crc = MavlinkCRC.crc_calculate(temp, temp.Length - 2); if (temp.Length > 5 && temp[0] == 254) { - crc = crc_accumulate(MAVLINK_MESSAGE_CRCS[temp[5]], crc); + crc = MavlinkCRC.crc_accumulate(MAVLINK_MESSAGE_CRCS[temp[5]], crc); } if (temp.Length > 5 && temp[1] != MAVLINK_MESSAGE_LENGTHS[temp[5]]) @@ -2235,46 +2159,30 @@ namespace ArdupilotMega /// <summary> /// Used to extract mission from log file /// </summary> - /// <param name="temp">packet</param> - void getWPsfromstream(ref byte[] temp) + /// <param name="buffer">packet</param> + void getWPsfromstream(ref byte[] buffer) { #if MAVLINK10 - if (temp[5] == MAVLINK_MSG_ID_MISSION_COUNT) + if (buffer[5] == MAVLINK_MSG_ID_MISSION_COUNT) { // clear old wps = new PointLatLngAlt[wps.Length]; } - if (temp[5] == MAVLink.MAVLINK_MSG_ID_MISSION_ITEM) + if (buffer[5] == MAVLink.MAVLINK_MSG_ID_MISSION_ITEM) { - __mavlink_mission_item_t wp = new __mavlink_mission_item_t(); - - object structtemp = (object)wp; - - //Array.Copy(buffer, 6, buffer, 0, buffer.Length - 6); - - ByteArrayToStructure(temp, ref structtemp, 6); - - wp = (__mavlink_mission_item_t)(structtemp); + __mavlink_mission_item_t wp = buffer.ByteArrayToStructure<__mavlink_mission_item_t>(6); #else - if (temp[5] == MAVLINK_MSG_ID_WAYPOINT_COUNT) + if (buffer[5] == MAVLINK_MSG_ID_WAYPOINT_COUNT) { // clear old wps = new PointLatLngAlt[wps.Length]; } - if (temp[5] == MAVLink.MAVLINK_MSG_ID_WAYPOINT) + if (buffer[5] == MAVLink.MAVLINK_MSG_ID_WAYPOINT) { - __mavlink_waypoint_t wp = new __mavlink_waypoint_t(); - - object structtemp = (object)wp; - - //Array.Copy(buffer, 6, buffer, 0, buffer.Length - 6); - - ByteArrayToStructure(temp, ref structtemp, 6); - - wp = (__mavlink_waypoint_t)(structtemp); + __mavlink_waypoint_t wp = buffer.ByteArrayToStructure<__mavlink_waypoint_t>(6); #endif wps[wp.seq] = new PointLatLngAlt(wp.x, wp.y, wp.z, wp.seq.ToString()); @@ -2323,13 +2231,7 @@ namespace ArdupilotMega { MainV2.givecomport = false; - __mavlink_fence_point_t fp = new __mavlink_fence_point_t(); - - object structtemp = (object)fp; - - ByteArrayToStructure(buffer, ref structtemp, 6); - - fp = (__mavlink_fence_point_t)(structtemp); + __mavlink_fence_point_t fp = buffer.ByteArrayToStructure<__mavlink_fence_point_t>(6); plla.Lat = fp.lat; plla.Lng = fp.lng; @@ -2462,206 +2364,7 @@ namespace ArdupilotMega return temp; } - const int X25_INIT_CRC = 0xffff; - const int X25_VALIDATE_CRC = 0xf0b8; - - ushort crc_accumulate(byte b, ushort crc) - { - unchecked - { - byte ch = (byte)(b ^ (byte)(crc & 0x00ff)); - ch = (byte)(ch ^ (ch << 4)); - return (ushort)((crc >> 8) ^ (ch << 8) ^ (ch << 3) ^ (ch >> 4)); - } - } - - ushort crc_calculate(byte[] pBuffer, int length) - { - if (length < 1) - { - return 0xffff; - } - // For a "message" of length bytes contained in the unsigned char array - // pointed to by pBuffer, calculate the CRC - // crcCalculate(unsigned char* pBuffer, int length, unsigned short* checkConst) < not needed - - ushort crcTmp; - int i; - - crcTmp = X25_INIT_CRC; - - for (i = 1; i < length; i++) // skips header U - { - crcTmp = crc_accumulate(pBuffer[i], crcTmp); - //Console.WriteLine(crcTmp + " " + pBuffer[i] + " " + length); - } - - return (crcTmp); - } - - - byte[] StructureToByteArray(object obj) - { - - int len = Marshal.SizeOf(obj); - - byte[] arr = new byte[len]; - - IntPtr ptr = Marshal.AllocHGlobal(len); - - Marshal.StructureToPtr(obj, ptr, true); - - Marshal.Copy(ptr, arr, 0, len); - - Marshal.FreeHGlobal(ptr); - - return arr; - - } - - public static void ByteArrayToStructure(byte[] bytearray, ref object obj, int startoffset) - { - if (bytearray[0] == 'U') - { - ByteArrayToStructureEndian(bytearray, ref obj, startoffset); - } - else - { - int len = Marshal.SizeOf(obj); - - IntPtr i = Marshal.AllocHGlobal(len); - - // create structure from ptr - obj = Marshal.PtrToStructure(i, obj.GetType()); - - try - { - // copy byte array to ptr - Marshal.Copy(bytearray, startoffset, i, len); - } - catch (Exception ex) { Console.WriteLine("ByteArrayToStructure FAIL: error " + ex.ToString()); } - - obj = Marshal.PtrToStructure(i, obj.GetType()); - - Marshal.FreeHGlobal(i); - } - } - - public static void ByteArrayToStructureEndian(byte[] bytearray, ref object obj, int startoffset) - { - int len = Marshal.SizeOf(obj); - - IntPtr i = Marshal.AllocHGlobal(len); - - byte[] temparray = (byte[])bytearray.Clone(); - - // create structure from ptr - obj = Marshal.PtrToStructure(i, obj.GetType()); - - // do endian swap - - object thisBoxed = obj; - Type test = thisBoxed.GetType(); - - int reversestartoffset = startoffset; - - // Enumerate each structure field using reflection. - foreach (var field in test.GetFields()) - { - // field.Name has the field's name. - - object fieldValue = field.GetValue(thisBoxed); // Get value - - // Get the TypeCode enumeration. Multiple types get mapped to a common typecode. - TypeCode typeCode = Type.GetTypeCode(fieldValue.GetType()); - - if (typeCode != TypeCode.Object) - { - Array.Reverse(temparray, reversestartoffset, Marshal.SizeOf(fieldValue)); - reversestartoffset += Marshal.SizeOf(fieldValue); - } - else - { - reversestartoffset += ((byte[])fieldValue).Length; - } - - } - - try - { - // copy byte array to ptr - Marshal.Copy(temparray, startoffset, i, len); - } - catch (Exception ex) { Console.WriteLine("ByteArrayToStructure FAIL: error " + ex.ToString()); } - - obj = Marshal.PtrToStructure(i, obj.GetType()); - - Marshal.FreeHGlobal(i); - - } - - public short swapend11(short value) - { - int len = Marshal.SizeOf(value); - - byte[] temp = BitConverter.GetBytes(value); - - Array.Reverse(temp); - - return BitConverter.ToInt16(temp, 0); - } - - public ushort swapend11(ushort value) - { - int len = Marshal.SizeOf(value); - - byte[] temp = BitConverter.GetBytes(value); - - Array.Reverse(temp); - - return BitConverter.ToUInt16(temp, 0); - } - - public ulong swapend11(ulong value) - { - int len = Marshal.SizeOf(value); - - byte[] temp = BitConverter.GetBytes(value); - - Array.Reverse(temp); - - return BitConverter.ToUInt64(temp, 0); - } - - public float swapend11(float value) - { - byte[] temp = BitConverter.GetBytes(value); - if (temp[0] == 0xff) - temp[0] = 0xfe; - Array.Reverse(temp); - return BitConverter.ToSingle(temp, 0); - } - - public int swapend11(int value) - { - int len = Marshal.SizeOf(value); - - byte[] temp = BitConverter.GetBytes(value); - Array.Reverse(temp); - return BitConverter.ToInt32(temp, 0); - } - - public double swapend11(double value) - { - int len = Marshal.SizeOf(value); - - byte[] temp = BitConverter.GetBytes(value); - - Array.Reverse(temp); - - return BitConverter.ToDouble(temp, 0); - } } } \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/MAVLinkTypesenum.cs b/Tools/ArdupilotMegaPlanner/MAVLinkTypesenum.cs deleted file mode 100644 index 6f146c83c8da8be86acfb537717160fa357163c1..0000000000000000000000000000000000000000 --- a/Tools/ArdupilotMegaPlanner/MAVLinkTypesenum.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Runtime.InteropServices; - -namespace ArdupilotMega -{ - partial class MAVLink - { - - } -} - diff --git a/Tools/ArdupilotMegaPlanner/MainV2.cs b/Tools/ArdupilotMegaPlanner/MainV2.cs index ffbb76efdffe004f8324f04b9bf87b85a1cdf04a..a0a75f0e8fee5797761b2842ddfaf058b92bbe14 100644 --- a/Tools/ArdupilotMegaPlanner/MainV2.cs +++ b/Tools/ArdupilotMegaPlanner/MainV2.cs @@ -760,19 +760,19 @@ namespace ArdupilotMega byte[] buffer = port.download(20); port.Close(); - if (buffer[0] != 'A' || buffer[1] != 'P') // this is the apvar header + if ((buffer[0] == 'A' || buffer[0] == 'P') && (buffer[1] == 'A' || buffer[1] == 'P')) // this is the apvar header { - MessageBox.Show("You dont appear to have uploaded a firmware yet,\n\nPlease goto the firmware page and upload one."); - return; + Console.WriteLine("Valid eeprom contents"); } else { - Console.WriteLine("Valid eeprom contents"); + MessageBox.Show("You dont appear to have uploaded a firmware yet,\n\nPlease goto the firmware page and upload one."); + return; } } } catch { } - MessageBox.Show("Can not establish a connection\n\n" + ex.ToString()); + //MessageBox.Show("Can not establish a connection\n\n" + ex.ToString()); return; } } @@ -1632,9 +1632,9 @@ namespace ArdupilotMega MainV2.instance.Invoke((MethodInvoker)delegate { loadinglabel.Text = text; - }); - Application.DoEvents(); + Application.DoEvents(); + }); } private static void checkForUpdate() @@ -1881,7 +1881,6 @@ namespace ArdupilotMega while (dataStream.CanRead) { - Application.DoEvents(); try { if (dt.Second != DateTime.Now.Second) diff --git a/Tools/ArdupilotMegaPlanner/Mavlink/MavlinkCRC.cs b/Tools/ArdupilotMegaPlanner/Mavlink/MavlinkCRC.cs new file mode 100644 index 0000000000000000000000000000000000000000..93f50fb6916f5ab7c7807b7f1719a8f7d34d42bd --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/Mavlink/MavlinkCRC.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ArdupilotMega.Mavlink +{ + class MavlinkCRC + { + const int X25_INIT_CRC = 0xffff; + const int X25_VALIDATE_CRC = 0xf0b8; + + public static ushort crc_accumulate(byte b, ushort crc) + { + unchecked + { + byte ch = (byte)(b ^ (byte)(crc & 0x00ff)); + ch = (byte)(ch ^ (ch << 4)); + return (ushort)((crc >> 8) ^ (ch << 8) ^ (ch << 3) ^ (ch >> 4)); + } + } + + public static ushort crc_calculate(byte[] pBuffer, int length) + { + if (length < 1) + { + return 0xffff; + } + // For a "message" of length bytes contained in the unsigned char array + // pointed to by pBuffer, calculate the CRC + // crcCalculate(unsigned char* pBuffer, int length, unsigned short* checkConst) < not needed + + ushort crcTmp; + int i; + + crcTmp = X25_INIT_CRC; + + for (i = 1; i < length; i++) // skips header U + { + crcTmp = crc_accumulate(pBuffer[i], crcTmp); + //Console.WriteLine(crcTmp + " " + pBuffer[i] + " " + length); + } + + return (crcTmp); + } + + } +} diff --git a/Tools/ArdupilotMegaPlanner/Mavlink/MavlinkUtil.cs b/Tools/ArdupilotMegaPlanner/Mavlink/MavlinkUtil.cs new file mode 100644 index 0000000000000000000000000000000000000000..0be0d7c6357efe6fbabba30193a92723a39a4f65 --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/Mavlink/MavlinkUtil.cs @@ -0,0 +1,246 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; + +namespace ArdupilotMega.Mavlink +{ + /// <summary> + /// Static methods and helpers for creation and manipulation of Mavlink packets + /// </summary> + public static class MavlinkUtil + { + /// <summary> + /// Create a new mavlink packet object from a byte array as recieved over mavlink + /// Endianess will be detetected using packet inspection + /// </summary> + /// <typeparam name="TMavlinkPacket">The type of mavlink packet to create</typeparam> + /// <param name="bytearray">The bytes of the mavlink packet</param> + /// <param name="startoffset">The position in the byte array where the packet starts</param> + /// <returns>The newly created mavlink packet</returns> + public static TMavlinkPacket ByteArrayToStructure<TMavlinkPacket>(this byte[] bytearray, int startoffset) where TMavlinkPacket : struct + { + object newPacket = new TMavlinkPacket(); + ByteArrayToStructure(bytearray, ref newPacket, startoffset); + return (TMavlinkPacket)newPacket; + } + + public static TMavlinkPacket ByteArrayToStructureBigEndian<TMavlinkPacket>(this byte[] bytearray, int startoffset) where TMavlinkPacket : struct + { + object newPacket = new TMavlinkPacket(); + ByteArrayToStructureEndian(bytearray, ref newPacket, startoffset); + return (TMavlinkPacket)newPacket; + } + + public static void ByteArrayToStructure(byte[] bytearray, ref object obj, int startoffset) + { + if (bytearray[0] == 'U') + { + ByteArrayToStructureEndian(bytearray, ref obj, startoffset); + } + else + { + int len = Marshal.SizeOf(obj); + + IntPtr i = Marshal.AllocHGlobal(len); + + // create structure from ptr + obj = Marshal.PtrToStructure(i, obj.GetType()); + + try + { + // copy byte array to ptr + Marshal.Copy(bytearray, startoffset, i, len); + } + catch (Exception ex) + { + Console.WriteLine("ByteArrayToStructure FAIL: error " + ex); + } + + obj = Marshal.PtrToStructure(i, obj.GetType()); + + Marshal.FreeHGlobal(i); + } + } + + public static void ByteArrayToStructureEndian(byte[] bytearray, ref object obj, int startoffset) + { + int len = Marshal.SizeOf(obj); + IntPtr i = Marshal.AllocHGlobal(len); + byte[] temparray = (byte[])bytearray.Clone(); + + // create structure from ptr + obj = Marshal.PtrToStructure(i, obj.GetType()); + + // do endian swap + object thisBoxed = obj; + Type test = thisBoxed.GetType(); + + int reversestartoffset = startoffset; + + // Enumerate each structure field using reflection. + foreach (var field in test.GetFields()) + { + // field.Name has the field's name. + object fieldValue = field.GetValue(thisBoxed); // Get value + + // Get the TypeCode enumeration. Multiple types get mapped to a common typecode. + TypeCode typeCode = Type.GetTypeCode(fieldValue.GetType()); + + if (typeCode != TypeCode.Object) + { + Array.Reverse(temparray, reversestartoffset, Marshal.SizeOf(fieldValue)); + reversestartoffset += Marshal.SizeOf(fieldValue); + } + else + { + reversestartoffset += ((byte[])fieldValue).Length; + } + + } + + try + { + // copy byte array to ptr + Marshal.Copy(temparray, startoffset, i, len); + } + catch (Exception ex) { Console.WriteLine("ByteArrayToStructure FAIL: error " + ex.ToString()); } + + obj = Marshal.PtrToStructure(i, obj.GetType()); + + Marshal.FreeHGlobal(i); + + } + + /// <summary> + /// Convert a struct to an array of bytes, struct fields being reperesented in + /// little endian (LSB first) + /// </summary> + /// <remarks>Note - assumes little endian host order</remarks> + public static byte[] StructureToByteArray(object obj) + { + int len = Marshal.SizeOf(obj); + byte[] arr = new byte[len]; + IntPtr ptr = Marshal.AllocHGlobal(len); + Marshal.StructureToPtr(obj, ptr, true); + Marshal.Copy(ptr, arr, 0, len); + Marshal.FreeHGlobal(ptr); + return arr; + } + + /// <summary> + /// Convert a struct to an array of bytes, struct fields being reperesented in + /// big endian (MSB first) + /// </summary> + public static byte[] StructureToByteArrayBigEndian(params object[] list) + { + // The copy is made becuase SetValue won't work on a struct. + // Boxing was used because SetValue works on classes/objects. + // Unfortunately, it results in 2 copy operations. + object thisBoxed = list[0]; // Why make a copy? + Type test = thisBoxed.GetType(); + + int offset = 0; + byte[] data = new byte[Marshal.SizeOf(thisBoxed)]; + + object fieldValue; + TypeCode typeCode; + + byte[] temp; + + // Enumerate each structure field using reflection. + foreach (var field in test.GetFields()) + { + // field.Name has the field's name. + + fieldValue = field.GetValue(thisBoxed); // Get value + + // Get the TypeCode enumeration. Multiple types get mapped to a common typecode. + typeCode = Type.GetTypeCode(fieldValue.GetType()); + + switch (typeCode) + { + case TypeCode.Single: // float + { + temp = BitConverter.GetBytes((Single)fieldValue); + Array.Reverse(temp); + Array.Copy(temp, 0, data, offset, sizeof(Single)); + break; + } + case TypeCode.Int32: + { + temp = BitConverter.GetBytes((Int32)fieldValue); + Array.Reverse(temp); + Array.Copy(temp, 0, data, offset, sizeof(Int32)); + break; + } + case TypeCode.UInt32: + { + temp = BitConverter.GetBytes((UInt32)fieldValue); + Array.Reverse(temp); + Array.Copy(temp, 0, data, offset, sizeof(UInt32)); + break; + } + case TypeCode.Int16: + { + temp = BitConverter.GetBytes((Int16)fieldValue); + Array.Reverse(temp); + Array.Copy(temp, 0, data, offset, sizeof(Int16)); + break; + } + case TypeCode.UInt16: + { + temp = BitConverter.GetBytes((UInt16)fieldValue); + Array.Reverse(temp); + Array.Copy(temp, 0, data, offset, sizeof(UInt16)); + break; + } + case TypeCode.Int64: + { + temp = BitConverter.GetBytes((Int64)fieldValue); + Array.Reverse(temp); + Array.Copy(temp, 0, data, offset, sizeof(Int64)); + break; + } + case TypeCode.UInt64: + { + temp = BitConverter.GetBytes((UInt64)fieldValue); + Array.Reverse(temp); + Array.Copy(temp, 0, data, offset, sizeof(UInt64)); + break; + } + case TypeCode.Double: + { + temp = BitConverter.GetBytes((Double)fieldValue); + Array.Reverse(temp); + Array.Copy(temp, 0, data, offset, sizeof(Double)); + break; + } + case TypeCode.Byte: + { + data[offset] = (Byte)fieldValue; + break; + } + default: + { + //System.Diagnostics.Debug.Fail("No conversion provided for this type : " + typeCode.ToString()); + break; + } + }; // switch + if (typeCode == TypeCode.Object) + { + int length = ((byte[])fieldValue).Length; + Array.Copy(((byte[])fieldValue), 0, data, offset, length); + offset += length; + } + else + { + offset += Marshal.SizeOf(fieldValue); + } + } // foreach + + return data; + } // Swap + } +} diff --git a/Tools/ArdupilotMegaPlanner/MavlinkLog.es-ES.resx b/Tools/ArdupilotMegaPlanner/MavlinkLog.es-ES.resx new file mode 100644 index 0000000000000000000000000000000000000000..3801d5fc68f925f38b919401758d0ba3afc23d7c --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/MavlinkLog.es-ES.resx @@ -0,0 +1,129 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="$this.Text" xml:space="preserve"> + <value>Log</value> + </data> + <data name="BUT_redokml.Text" xml:space="preserve"> + <value>Crear KML</value> + </data> + <data name="BUT_humanreadable.Text" xml:space="preserve"> + <value>Convertir a Texto</value> + </data> +</root> \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/Properties/AssemblyInfo.cs b/Tools/ArdupilotMegaPlanner/Properties/AssemblyInfo.cs index 3a28cbf8cf34fdb42cc6188cc3e319a64371f5b7..65f82186b920b7bcd2b44052fdf117cfefd8a755 100644 --- a/Tools/ArdupilotMegaPlanner/Properties/AssemblyInfo.cs +++ b/Tools/ArdupilotMegaPlanner/Properties/AssemblyInfo.cs @@ -34,5 +34,5 @@ using System.Resources; // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.1.37")] +[assembly: AssemblyFileVersion("1.1.38")] [assembly: NeutralResourcesLanguageAttribute("")] diff --git a/Tools/ArdupilotMegaPlanner/HUD.resx b/Tools/ArdupilotMegaPlanner/RAW_Sensor.es-ES.resx similarity index 71% rename from Tools/ArdupilotMegaPlanner/HUD.resx rename to Tools/ArdupilotMegaPlanner/RAW_Sensor.es-ES.resx index bef221098e410d9742d6e1f401a668c8f059132f..31f1917097ae7b60ba3dd9b5002cf260dd833342 100644 --- a/Tools/ArdupilotMegaPlanner/HUD.resx +++ b/Tools/ArdupilotMegaPlanner/RAW_Sensor.es-ES.resx @@ -1,174 +1,165 @@ -<?xml version="1.0" encoding="utf-8"?> -<root> - <!-- - Microsoft ResX Schema - - Version 2.0 - - The primary goals of this format is to allow a simple XML format - that is mostly human readable. The generation and parsing of the - various data types are done through the TypeConverter classes - associated with the data types. - - Example: - - ... ado.net/XML headers & schema ... - <resheader name="resmimetype">text/microsoft-resx</resheader> - <resheader name="version">2.0</resheader> - <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> - <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> - <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> - <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> - <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> - <value>[base64 mime encoded serialized .NET Framework object]</value> - </data> - <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> - <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> - <comment>This is a comment</comment> - </data> - - There are any number of "resheader" rows that contain simple - name/value pairs. - - Each data row contains a name, and value. The row also contains a - type or mimetype. Type corresponds to a .NET class that support - text/value conversion through the TypeConverter architecture. - Classes that don't support this are serialized and stored with the - mimetype set. - - The mimetype is used for serialized objects, and tells the - ResXResourceReader how to depersist the object. This is currently not - extensible. For a given mimetype the value must be set accordingly: - - Note - application/x-microsoft.net.object.binary.base64 is the format - that the ResXResourceWriter will generate, however the reader can - read any of the formats listed below. - - mimetype: application/x-microsoft.net.object.binary.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.soap.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Soap.SoapFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.bytearray.base64 - value : The object must be serialized into a byte array - : using a System.ComponentModel.TypeConverter - : and then encoded with base64 encoding. - --> - <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> - <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> - <xsd:element name="root" msdata:IsDataSet="true"> - <xsd:complexType> - <xsd:choice maxOccurs="unbounded"> - <xsd:element name="metadata"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" /> - </xsd:sequence> - <xsd:attribute name="name" use="required" type="xsd:string" /> - <xsd:attribute name="type" type="xsd:string" /> - <xsd:attribute name="mimetype" type="xsd:string" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="assembly"> - <xsd:complexType> - <xsd:attribute name="alias" type="xsd:string" /> - <xsd:attribute name="name" type="xsd:string" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="data"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> - <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> - <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="resheader"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" /> - </xsd:complexType> - </xsd:element> - </xsd:choice> - </xsd:complexType> - </xsd:element> - </xsd:schema> - <resheader name="resmimetype"> - <value>text/microsoft-resx</value> - </resheader> - <resheader name="version"> - <value>2.0</value> - </resheader> - <resheader name="reader"> - <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <resheader name="writer"> - <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> - <data name="glControl1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> - <value>Fill</value> - </data> - <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> - <data name="glControl1.Location" type="System.Drawing.Point, System.Drawing"> - <value>0, 0</value> - </data> - <data name="glControl1.Size" type="System.Drawing.Size, System.Drawing"> - <value>300, 225</value> - </data> - <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> - <data name="glControl1.TabIndex" type="System.Int32, mscorlib"> - <value>0</value> - </data> - <data name=">>glControl1.Name" xml:space="preserve"> - <value>glControl1</value> - </data> - <data name=">>glControl1.Type" xml:space="preserve"> - <value>OpenTK.GLControl, OpenTK.GLControl, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4</value> - </data> - <data name=">>glControl1.Parent" xml:space="preserve"> - <value>$this</value> - </data> - <data name=">>glControl1.ZOrder" xml:space="preserve"> - <value>0</value> - </data> - <data name="$this.Localizable" type="System.Boolean, mscorlib"> - <value>True</value> - </data> - <data name="$this.Size" type="System.Drawing.Size, System.Drawing"> - <value>300, 225</value> - </data> - <data name=">>$this.Name" xml:space="preserve"> - <value>HUD</value> - </data> - <data name=">>$this.Type" xml:space="preserve"> - <value>System.Windows.Forms.MyUserControl, ArdupilotMegaPlanner, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ff91852278f5092c</value> - </data> - <data name="Bat" xml:space="preserve"> - <value>Bat</value> - </data> - <data name="GPS: 2D Fix.Text" xml:space="preserve"> - <value>GPS: 3D Fix</value> - </data> - <data name="GPS: 3D Fix.Text" xml:space="preserve"> - <value>GPS: 3D Fix</value> - </data> - <data name="GPS: No Fix.Text" xml:space="preserve"> - <value>GPS: No Fix</value> - </data> - <data name="GPS: No GPS.Text" xml:space="preserve"> - <value>GPS: No GPS</value> - </data> +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="tabRawSensor.Text" xml:space="preserve"> + <value>Sensor Raw</value> + </data> + <data name="$this.Text" xml:space="preserve"> + <value>Sensor RAW</value> + </data> + <data name="CMB_rawupdaterate.Text" xml:space="preserve"> + <value>Actualiza Velocidad</value> + </data> + <data name="label2.Text" xml:space="preserve"> + <value>Salida Servo/Motor</value> + </data> + <data name="label3.Text" xml:space="preserve"> + <value>Nota: Hay un retardo de cuando se ve a través de Xbee @ 50Hz</value> + </data> + <data name="label1.Text" xml:space="preserve"> + <value>Entrada Radio</value> + </data> + <data name="chkax.Text" xml:space="preserve"> + <value>Accel X</value> + </data> + <data name="chkaz.Text" xml:space="preserve"> + <value>Accel Z</value> + </data> + <data name="chkay.Text" xml:space="preserve"> + <value>Accel Y</value> + </data> + <data name="tabRadio.Text" xml:space="preserve"> + <value>Radio</value> + </data> + <data name="tabOrientation.Text" xml:space="preserve"> + <value>Datos de Vuelo</value> + </data> + <data name="BUT_savecsv.Text" xml:space="preserve"> + <value>Guardar CSV</value> + </data> + <data name="chkgz.Text" xml:space="preserve"> + <value>Gyro Z</value> + </data> + <data name="chkgx.Text" xml:space="preserve"> + <value>Gyro X</value> + </data> + <data name="chkgy.Text" xml:space="preserve"> + <value>Gyro Y</value> + </data> </root> \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/Resources/Welcome_to_Michael_Oborne.rtf b/Tools/ArdupilotMegaPlanner/Resources/Welcome_to_Michael_Oborne.rtf index c537652c1f3437a9ffe70fd1cfb3a4ab63e6904d..e465a9a5f9e4513cda27a1170b3007d0d1c10f4a 100644 Binary files a/Tools/ArdupilotMegaPlanner/Resources/Welcome_to_Michael_Oborne.rtf and b/Tools/ArdupilotMegaPlanner/Resources/Welcome_to_Michael_Oborne.rtf differ diff --git a/Tools/ArdupilotMegaPlanner/SerialInput.es-ES.resx b/Tools/ArdupilotMegaPlanner/SerialInput.es-ES.resx new file mode 100644 index 0000000000000000000000000000000000000000..4d14dfe4ecc68454bdd31aea9abc50df98478d70 --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/SerialInput.es-ES.resx @@ -0,0 +1,123 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="textBox1.Text" xml:space="preserve"> + <value>Lo que esto hace. 1. se las actuales coordenadas GPS de un GPS NMEA. 2. envÃa un WP modo guiado a la AP cada 2 segundos. Como Usar 1. conectar con la AP. 2. el despegue, el modo de prueba guiada está trabajando. 3. abrir este y escoja su puerto com, y la velocidad de su NMEA GPS. 4. ahora debe estar siguiéndote.</value> + </data> +</root> \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/Setup/Setup.es-ES.resx b/Tools/ArdupilotMegaPlanner/Setup/Setup.es-ES.resx new file mode 100644 index 0000000000000000000000000000000000000000..70ad73f1af84a8cec236442b9c51462353fceab5 --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/Setup/Setup.es-ES.resx @@ -0,0 +1,315 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="SV3_POS_.Text" xml:space="preserve"> + <value>180</value> + </data> + <data name="BUT_HS4save.Text" xml:space="preserve"> + <value>Manual</value> + </data> + <data name="label12.Text" xml:space="preserve"> + <value>PWM 0 - 1230</value> + </data> + <data name="label10.Text" xml:space="preserve"> + <value>PWM 1621 - 1749</value> + </data> + <data name="label13.Text" xml:space="preserve"> + <value>Modo actual:</value> + </data> + <data name="CHK_enableoptflow.Text" xml:space="preserve"> + <value>Habilitar el flujo óptico</value> + </data> + <data name="label16.Text" xml:space="preserve"> + <value>NOTA: Las imágenes son sólo para su presentación</value> + </data> + <data name="CB_simple5.Text" xml:space="preserve"> + <value>Modo Simple</value> + </data> + <data name="label11.Text" xml:space="preserve"> + <value>PWM 1750 +</value> + </data> + <data name="CHK_elevonch1rev.Text" xml:space="preserve"> + <value>Elevons CH1 Rev</value> + </data> + <data name="label14.Text" xml:space="preserve"> + <value>PWM Actual:</value> + </data> + <data name="$this.Text" xml:space="preserve"> + <value>APMSetup</value> + </data> + <data name="label17.Text" xml:space="preserve"> + <value>Swash-Servo posición</value> + </data> + <data name="CHK_enablecompass.Text" xml:space="preserve"> + <value>Activar Compas</value> + </data> + <data name="CB_simple4.Text" xml:space="preserve"> + <value>Modo Simple</value> + </data> + <data name="tabArducopter.Text" xml:space="preserve"> + <value>ArduCopter2</value> + </data> + <data name="CB_simple1.Text" xml:space="preserve"> + <value>Modo Simple</value> + </data> + <data name="label15.Text" xml:space="preserve"> + <value>Ajuste Chásis (+ or x)</value> + </data> + <data name="SV2_POS_.Text" xml:space="preserve"> + <value>60</value> + </data> + <data name="label18.Text" xml:space="preserve"> + <value>1</value> + </data> + <data name="CB_simple6.Text" xml:space="preserve"> + <value>Modo Simple</value> + </data> + <data name="CB_simple3.Text" xml:space="preserve"> + <value>Modo Simple</value> + </data> + <data name="label19.Text" xml:space="preserve"> + <value>2</value> + </data> + <data name="tabModes.Text" xml:space="preserve"> + <value>Modos</value> + </data> + <data name="CB_simple2.Text" xml:space="preserve"> + <value>Modo Simple</value> + </data> + <data name="label20.Text" xml:space="preserve"> + <value>3</value> + </data> + <data name="tabReset.Text" xml:space="preserve"> + <value>Reset</value> + </data> + <data name="SV1_POS_.Text" xml:space="preserve"> + <value>-60</value> + </data> + <data name="label21.Text" xml:space="preserve"> + <value>Superior</value> + </data> + <data name="label22.Text" xml:space="preserve"> + <value>Swash de Viaje</value> + </data> + <data name="lbl_currentmode.Text" xml:space="preserve"> + <value>Manual</value> + </data> + <data name="label23.Text" xml:space="preserve"> + <value>Timón de Viaje</value> + </data> + <data name="textBox3.Text" xml:space="preserve"> + <value>Calibración del sensor de voltaje:Para calibrar el sensor, use un multÃmetro para medir la tensión que sale de la CES de la baterÃa-la eliminación del circuito (se trata de cables negro y rojo en el cable de tres hilos que suministra energÃa a la placa APM).Luego reste 0,3 V de ese valor y entrar en él en el campo # 1 a la izquierda.</value> + </data> + <data name="BUT_Calibrateradio.Text" xml:space="preserve"> + <value>Calibrar Radio</value> + </data> + <data name="label24.Text" xml:space="preserve"> + <value>Max</value> + </data> + <data name="label2.Text" xml:space="preserve"> + <value>Modo de Vuelo 2</value> + </data> + <data name="label25.Text" xml:space="preserve"> + <value>Alabeo Max</value> + </data> + <data name="label3.Text" xml:space="preserve"> + <value>Modo de Vuelo 3</value> + </data> + <data name="label26.Text" xml:space="preserve"> + <value>Cabeceo Max</value> + </data> + <data name="label27.Text" xml:space="preserve"> + <value>por ejemplo, en grados 2 ° 3 'W es -2,3</value> + </data> + <data name="label1.Text" xml:space="preserve"> + <value>Modo de Vuelo 1</value> + </data> + <data name="label28.Text" xml:space="preserve"> + <value>Nivel tu quad para establecer las compensaciones por defecto acel</value> + </data> + <data name="label6.Text" xml:space="preserve"> + <value>Modo de Vuelo 6</value> + </data> + <data name="label29.Text" xml:space="preserve"> + <value>Capacidad</value> + </data> + <data name="label100.Text" xml:space="preserve"> + <value>Declinación</value> + </data> + <data name="CHK_enablesonar.Text" xml:space="preserve"> + <value>Activar Sonar</value> + </data> + <data name="label7.Text" xml:space="preserve"> + <value>PWM 1231 - 1360</value> + </data> + <data name="tabRadioIn.Text" xml:space="preserve"> + <value>Entrada Radio</value> + </data> + <data name="groupBox4.Text" xml:space="preserve"> + <value>Calibración</value> + </data> + <data name="HS4_MIN.Text" xml:space="preserve"> + <value>1500</value> + </data> + <data name="label4.Text" xml:space="preserve"> + <value>Modo de Vuelo 4</value> + </data> + <data name="label5.Text" xml:space="preserve"> + <value>Modo de Vuelo 5</value> + </data> + <data name="groupBox3.Text" xml:space="preserve"> + <value>Gyro</value> + </data> + <data name="label8.Text" xml:space="preserve"> + <value>PWM 1361 - 1490</value> + </data> + <data name="tabHardware.Text" xml:space="preserve"> + <value>Hardware</value> + </data> + <data name="label9.Text" xml:space="preserve"> + <value>PWM 1491 - 1620</value> + </data> + <data name="linkLabelmagdec.Text" xml:space="preserve"> + <value>Sitio Web Declinación</value> + </data> + <data name="HS4_MAX.Text" xml:space="preserve"> + <value>1500</value> + </data> + <data name="tabBattery.Text" xml:space="preserve"> + <value>BaterÃa</value> + </data> + <data name="BUT_0collective.Text" xml:space="preserve"> + <value>Cero</value> + </data> + <data name="CHK_enableairspeed.Text" xml:space="preserve"> + <value>Activar Airspeed</value> + </data> + <data name="PIT_MAX_.Text" xml:space="preserve"> + <value>4500</value> + </data> + <data name="BUT_reset.Text" xml:space="preserve"> + <value>Restablecer los Ajustes de hardware APM</value> + </data> + <data name="GYR_GAIN_.Text" xml:space="preserve"> + <value>1000</value> + </data> + <data name="label30.Text" xml:space="preserve"> + <value>Monitor</value> + </data> +</root> \ No newline at end of file diff --git a/Tools/ArdupilotMegaPlanner/bin/Release/ArdupilotMegaPlanner.pdb b/Tools/ArdupilotMegaPlanner/bin/Release/ArdupilotMegaPlanner.pdb index 11b35bd52b6ec275bd0b58728c7f1b031cea281b..9be6fd68a9f3c0907e13233c392a1ec295aec7e4 100644 Binary files a/Tools/ArdupilotMegaPlanner/bin/Release/ArdupilotMegaPlanner.pdb and b/Tools/ArdupilotMegaPlanner/bin/Release/ArdupilotMegaPlanner.pdb differ diff --git a/Tools/ArdupilotMegaPlanner/bin/Release/Resources/Welcome_to_Michael_Oborne.rtf b/Tools/ArdupilotMegaPlanner/bin/Release/Resources/Welcome_to_Michael_Oborne.rtf index c537652c1f3437a9ffe70fd1cfb3a4ab63e6904d..e465a9a5f9e4513cda27a1170b3007d0d1c10f4a 100644 Binary files a/Tools/ArdupilotMegaPlanner/bin/Release/Resources/Welcome_to_Michael_Oborne.rtf and b/Tools/ArdupilotMegaPlanner/bin/Release/Resources/Welcome_to_Michael_Oborne.rtf differ diff --git a/Tools/ArdupilotMegaPlanner/bin/Release/aircraft/arducopter/Models/Untitled.ac b/Tools/ArdupilotMegaPlanner/bin/Release/aircraft/arducopter/Models/Untitled.ac new file mode 100644 index 0000000000000000000000000000000000000000..5b9e7ed5b7de46831b0389e87c3d7ca4083ce932 --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/bin/Release/aircraft/arducopter/Models/Untitled.ac @@ -0,0 +1,1094 @@ +AC3Db +MATERIAL "default" rgb 0.72 0.72 0.72 amb 0.8 0.8 0.8 emis 0.08 0.08 0.08 spec 0.2 0.2 0.2 shi 128 trans 0 +MATERIAL "material.006"1"1" rgb 0.0000 0.0000 0.0000 amb 0.0000 0.0000 0.0000 emis 0.0000 0.0000 0.0000 spec 0.2 0.2 0.2 shi 128 trans 0.0000 +OBJECT world +kids 1 +OBJECT poly +name "blah" +numvert 88 +0.008832 0.001373 -0.000873 +0.008506 0.000990 -0.000881 +0.009033 0.001338 -0.000893 +0.008326 0.001009 -0.000823 +0.007376 -0.000207 -0.000850 +0.007229 -0.000460 -0.000812 +0.007268 -0.000476 -0.000806 +0.007489 -0.000258 -0.000838 +0.007554 0.000049 -0.000887 +0.009654 0.002468 -0.000833 +0.009255 0.001925 -0.000848 +0.009734 0.002440 -0.000831 +0.009103 0.001954 -0.000835 +0.009555 0.002483 -0.000837 +0.008591 0.001436 -0.000825 +0.008638 0.001416 -0.000829 +0.009076 0.001982 -0.000840 +0.009396 0.001900 -0.000860 +0.005825 -0.001719 -0.000888 +0.005965 -0.001746 -0.000876 +0.005486 -0.002262 -0.000867 +0.006389 -0.001191 -0.000892 +0.006188 -0.001154 -0.000911 +0.009024 0.001954 -0.000833 +0.009502 0.002462 -0.000841 +0.008560 0.001453 -0.000824 +0.008093 0.000346 -0.000945 +0.007752 0.000090 -0.000908 +0.007754 0.000168 -0.000919 +0.008097 0.000505 -0.000954 +0.008326 0.000640 -0.000974 +0.007883 0.000406 -0.000928 +0.006630 -0.001281 -0.000850 +0.006117 -0.001776 -0.000863 +0.006144 -0.001803 -0.000868 +0.006660 -0.001276 -0.000843 +0.006197 -0.001776 -0.000860 +0.007844 0.000385 -0.000848 +0.007963 0.000343 -0.000869 +0.007663 0.000128 -0.000889 +0.007952 0.000649 -0.000800 +0.007991 0.000634 -0.000806 +0.007731 0.000435 -0.000835 +0.007128 -0.000157 -0.000946 +0.006895 -0.000448 -0.000980 +0.007044 -0.000422 -0.000905 +0.008263 0.001060 -0.000809 +0.008280 0.001025 -0.000814 +0.008638 0.001456 -0.000843 +0.008486 0.001037 -0.000911 +0.008683 0.000994 -0.000933 +0.005665 -0.002304 -0.000873 +0.005718 -0.002283 -0.000876 +0.006714 -0.000807 -0.000893 +0.006894 -0.000833 -0.000835 +0.006735 -0.000851 -0.000924 +0.006934 -0.000873 -0.000832 +0.006582 -0.001277 -0.000862 +0.007030 -0.000596 -0.000896 +0.007305 -0.000350 -0.000868 +0.006583 -0.001239 -0.000848 +0.007180 -0.000444 -0.000827 +0.006957 -0.000886 -0.000822 +0.005693 -0.002293 -0.000875 +0.006097 -0.001829 -0.000868 +0.007124 -0.000315 -0.000958 +0.007515 -0.000219 -0.000874 +0.007519 -0.000149 -0.000909 +0.007338 -0.000219 -0.000930 +0.006538 -0.000807 -0.000946 +0.009124 0.002008 -0.000839 +0.009527 0.002472 -0.000839 +0.007257 -0.000163 -0.000871 +0.007466 0.000089 -0.000906 +0.008176 0.000606 -0.000900 +0.008040 0.000619 -0.000821 +0.008191 0.000779 -0.000888 +0.007915 0.000530 -0.000864 +0.007328 -0.000058 -0.000926 +0.007560 0.000012 -0.000898 +0.007520 -0.000273 -0.000840 +0.007581 0.000176 -0.000871 +0.007657 0.000166 -0.000898 +0.007636 0.000000 -0.000871 +0.005566 -0.002290 -0.000869 +0.007705 0.000400 -0.000873 +0.007656 0.000213 -0.000903 +0.007701 0.000450 -0.000838 +numsurf 166 +SURF 0x30 +mat 1 +refs 3 +0 0 0 +1 0 0 +2 0 0 +SURF 0x30 +mat 1 +refs 3 +0 0 0 +3 0 0 +1 0 0 +SURF 0x30 +mat 1 +refs 3 +4 0 0 +5 0 0 +6 0 0 +SURF 0x30 +mat 1 +refs 3 +4 0 0 +6 0 0 +7 0 0 +SURF 0x30 +mat 1 +refs 3 +8 0 0 +4 0 0 +7 0 0 +SURF 0x30 +mat 1 +refs 3 +9 0 0 +10 0 0 +11 0 0 +SURF 0x30 +mat 1 +refs 3 +9 0 0 +12 0 0 +10 0 0 +SURF 0x30 +mat 1 +refs 3 +13 0 0 +12 0 0 +9 0 0 +SURF 0x30 +mat 1 +refs 3 +12 0 0 +14 0 0 +15 0 0 +SURF 0x30 +mat 1 +refs 3 +16 0 0 +14 0 0 +12 0 0 +SURF 0x30 +mat 1 +refs 3 +10 0 0 +0 0 0 +17 0 0 +SURF 0x30 +mat 1 +refs 3 +10 0 0 +15 0 0 +0 0 0 +SURF 0x30 +mat 1 +refs 3 +18 0 0 +19 0 0 +20 0 0 +SURF 0x30 +mat 1 +refs 3 +21 0 0 +19 0 0 +18 0 0 +SURF 0x30 +mat 1 +refs 3 +22 0 0 +21 0 0 +18 0 0 +SURF 0x30 +mat 1 +refs 3 +16 0 0 +14 0 0 +23 0 0 +SURF 0x30 +mat 1 +refs 3 +24 0 0 +16 0 0 +23 0 0 +SURF 0x30 +mat 1 +refs 3 +23 0 0 +14 0 0 +25 0 0 +SURF 0x30 +mat 1 +refs 3 +26 0 0 +27 0 0 +28 0 0 +SURF 0x30 +mat 1 +refs 3 +29 0 0 +26 0 0 +28 0 0 +SURF 0x30 +mat 1 +refs 3 +30 0 0 +26 0 0 +29 0 0 +SURF 0x30 +mat 1 +refs 3 +29 0 0 +28 0 0 +31 0 0 +SURF 0x30 +mat 1 +refs 3 +32 0 0 +33 0 0 +34 0 0 +SURF 0x30 +mat 1 +refs 3 +35 0 0 +32 0 0 +34 0 0 +SURF 0x30 +mat 1 +refs 3 +35 0 0 +34 0 0 +36 0 0 +SURF 0x30 +mat 1 +refs 3 +37 0 0 +27 0 0 +38 0 0 +SURF 0x30 +mat 1 +refs 3 +37 0 0 +39 0 0 +27 0 0 +SURF 0x30 +mat 1 +refs 3 +40 0 0 +37 0 0 +41 0 0 +SURF 0x30 +mat 1 +refs 3 +40 0 0 +42 0 0 +37 0 0 +SURF 0x30 +mat 1 +refs 3 +42 0 0 +39 0 0 +37 0 0 +SURF 0x30 +mat 1 +refs 3 +43 0 0 +44 0 0 +45 0 0 +SURF 0x30 +mat 1 +refs 3 +46 0 0 +47 0 0 +40 0 0 +SURF 0x30 +mat 1 +refs 3 +14 0 0 +47 0 0 +46 0 0 +SURF 0x30 +mat 1 +refs 3 +48 0 0 +47 0 0 +14 0 0 +SURF 0x30 +mat 1 +refs 3 +49 0 0 +50 0 0 +30 0 0 +SURF 0x30 +mat 1 +refs 3 +0 0 0 +50 0 0 +49 0 0 +SURF 0x30 +mat 1 +refs 3 +0 0 0 +2 0 0 +50 0 0 +SURF 0x30 +mat 1 +refs 3 +33 0 0 +51 0 0 +34 0 0 +SURF 0x30 +mat 1 +refs 3 +36 0 0 +34 0 0 +51 0 0 +SURF 0x30 +mat 1 +refs 3 +36 0 0 +51 0 0 +52 0 0 +SURF 0x30 +mat 1 +refs 3 +53 0 0 +22 0 0 +21 0 0 +SURF 0x30 +mat 1 +refs 3 +53 0 0 +21 0 0 +54 0 0 +SURF 0x30 +mat 1 +refs 3 +55 0 0 +56 0 0 +57 0 0 +SURF 0x30 +mat 1 +refs 3 +58 0 0 +56 0 0 +55 0 0 +SURF 0x30 +mat 1 +refs 3 +6 0 0 +56 0 0 +58 0 0 +SURF 0x30 +mat 1 +refs 3 +59 0 0 +6 0 0 +58 0 0 +SURF 0x30 +mat 1 +refs 3 +44 0 0 +58 0 0 +55 0 0 +SURF 0x30 +mat 1 +refs 3 +54 0 0 +21 0 0 +60 0 0 +SURF 0x30 +mat 1 +refs 3 +61 0 0 +54 0 0 +5 0 0 +SURF 0x30 +mat 1 +refs 3 +5 0 0 +54 0 0 +56 0 0 +SURF 0x30 +mat 1 +refs 3 +5 0 0 +56 0 0 +6 0 0 +SURF 0x30 +mat 1 +refs 3 +6 0 0 +56 0 0 +62 0 0 +SURF 0x30 +mat 1 +refs 3 +54 0 0 +60 0 0 +56 0 0 +SURF 0x30 +mat 1 +refs 3 +25 0 0 +46 0 0 +14 0 0 +SURF 0x30 +mat 1 +refs 3 +17 0 0 +0 0 0 +2 0 0 +SURF 0x30 +mat 1 +refs 3 +34 0 0 +63 0 0 +64 0 0 +SURF 0x30 +mat 1 +refs 3 +65 0 0 +58 0 0 +44 0 0 +SURF 0x30 +mat 1 +refs 3 +66 0 0 +6 0 0 +59 0 0 +SURF 0x30 +mat 1 +refs 3 +67 0 0 +66 0 0 +59 0 0 +SURF 0x30 +mat 1 +refs 3 +67 0 0 +59 0 0 +68 0 0 +SURF 0x30 +mat 1 +refs 3 +45 0 0 +44 0 0 +69 0 0 +SURF 0x30 +mat 1 +refs 3 +45 0 0 +69 0 0 +53 0 0 +SURF 0x30 +mat 1 +refs 3 +45 0 0 +53 0 0 +61 0 0 +SURF 0x30 +mat 1 +refs 3 +61 0 0 +53 0 0 +54 0 0 +SURF 0x30 +mat 1 +refs 3 +69 0 0 +22 0 0 +53 0 0 +SURF 0x30 +mat 1 +refs 3 +44 0 0 +55 0 0 +69 0 0 +SURF 0x30 +mat 1 +refs 3 +69 0 0 +55 0 0 +21 0 0 +SURF 0x30 +mat 1 +refs 3 +13 0 0 +23 0 0 +16 0 0 +SURF 0x30 +mat 1 +refs 3 +13 0 0 +24 0 0 +23 0 0 +SURF 0x30 +mat 1 +refs 3 +13 0 0 +9 0 0 +70 0 0 +SURF 0x30 +mat 1 +refs 3 +70 0 0 +48 0 0 +16 0 0 +SURF 0x30 +mat 1 +refs 3 +71 0 0 +70 0 0 +16 0 0 +SURF 0x30 +mat 1 +refs 3 +48 0 0 +49 0 0 +47 0 0 +SURF 0x30 +mat 1 +refs 3 +65 0 0 +59 0 0 +58 0 0 +SURF 0x30 +mat 1 +refs 3 +68 0 0 +59 0 0 +65 0 0 +SURF 0x30 +mat 1 +refs 3 +72 0 0 +61 0 0 +5 0 0 +SURF 0x30 +mat 1 +refs 3 +72 0 0 +5 0 0 +4 0 0 +SURF 0x30 +mat 1 +refs 3 +73 0 0 +72 0 0 +4 0 0 +SURF 0x30 +mat 1 +refs 3 +73 0 0 +4 0 0 +8 0 0 +SURF 0x30 +mat 1 +refs 3 +73 0 0 +43 0 0 +72 0 0 +SURF 0x30 +mat 1 +refs 3 +43 0 0 +45 0 0 +72 0 0 +SURF 0x30 +mat 1 +refs 3 +72 0 0 +45 0 0 +61 0 0 +SURF 0x30 +mat 1 +refs 3 +74 0 0 +38 0 0 +26 0 0 +SURF 0x30 +mat 1 +refs 3 +75 0 0 +38 0 0 +74 0 0 +SURF 0x30 +mat 1 +refs 3 +30 0 0 +74 0 0 +26 0 0 +SURF 0x30 +mat 1 +refs 3 +49 0 0 +76 0 0 +47 0 0 +SURF 0x30 +mat 1 +refs 3 +47 0 0 +76 0 0 +40 0 0 +SURF 0x30 +mat 1 +refs 3 +76 0 0 +77 0 0 +40 0 0 +SURF 0x30 +mat 1 +refs 3 +49 0 0 +30 0 0 +76 0 0 +SURF 0x30 +mat 1 +refs 3 +76 0 0 +30 0 0 +29 0 0 +SURF 0x30 +mat 1 +refs 3 +76 0 0 +29 0 0 +77 0 0 +SURF 0x30 +mat 1 +refs 3 +73 0 0 +78 0 0 +43 0 0 +SURF 0x30 +mat 1 +refs 3 +78 0 0 +65 0 0 +43 0 0 +SURF 0x30 +mat 1 +refs 3 +43 0 0 +65 0 0 +44 0 0 +SURF 0x30 +mat 1 +refs 3 +78 0 0 +68 0 0 +65 0 0 +SURF 0x30 +mat 1 +refs 3 +11 0 0 +17 0 0 +10 0 0 +SURF 0x30 +mat 1 +refs 3 +10 0 0 +17 0 0 +0 0 0 +SURF 0x30 +mat 1 +refs 3 +17 0 0 +2 0 0 +0 0 0 +SURF 0x30 +mat 1 +refs 3 +79 0 0 +67 0 0 +68 0 0 +SURF 0x30 +mat 1 +refs 3 +79 0 0 +68 0 0 +78 0 0 +SURF 0x30 +mat 1 +refs 3 +73 0 0 +8 0 0 +78 0 0 +SURF 0x30 +mat 1 +refs 3 +66 0 0 +80 0 0 +6 0 0 +SURF 0x30 +mat 1 +refs 3 +56 0 0 +60 0 0 +32 0 0 +SURF 0x30 +mat 1 +refs 3 +56 0 0 +32 0 0 +62 0 0 +SURF 0x30 +mat 1 +refs 3 +62 0 0 +32 0 0 +35 0 0 +SURF 0x30 +mat 1 +refs 3 +56 0 0 +62 0 0 +32 0 0 +SURF 0x30 +mat 1 +refs 3 +56 0 0 +32 0 0 +57 0 0 +SURF 0x30 +mat 1 +refs 3 +42 0 0 +81 0 0 +39 0 0 +SURF 0x30 +mat 1 +refs 3 +31 0 0 +28 0 0 +82 0 0 +SURF 0x30 +mat 1 +refs 3 +9 0 0 +10 0 0 +70 0 0 +SURF 0x30 +mat 1 +refs 3 +70 0 0 +10 0 0 +48 0 0 +SURF 0x30 +mat 1 +refs 3 +10 0 0 +0 0 0 +48 0 0 +SURF 0x30 +mat 1 +refs 3 +9 0 0 +11 0 0 +10 0 0 +SURF 0x30 +mat 1 +refs 3 +8 0 0 +7 0 0 +83 0 0 +SURF 0x30 +mat 1 +refs 3 +79 0 0 +83 0 0 +67 0 0 +SURF 0x30 +mat 1 +refs 3 +15 0 0 +3 0 0 +0 0 0 +SURF 0x30 +mat 1 +refs 3 +3 0 0 +41 0 0 +75 0 0 +SURF 0x30 +mat 1 +refs 3 +47 0 0 +41 0 0 +3 0 0 +SURF 0x30 +mat 1 +refs 3 +47 0 0 +40 0 0 +41 0 0 +SURF 0x30 +mat 1 +refs 3 +46 0 0 +40 0 0 +47 0 0 +SURF 0x30 +mat 1 +refs 3 +15 0 0 +47 0 0 +3 0 0 +SURF 0x30 +mat 1 +refs 3 +14 0 0 +47 0 0 +15 0 0 +SURF 0x30 +mat 1 +refs 3 +14 0 0 +46 0 0 +47 0 0 +SURF 0x30 +mat 1 +refs 3 +16 0 0 +25 0 0 +14 0 0 +SURF 0x30 +mat 1 +refs 3 +16 0 0 +23 0 0 +25 0 0 +SURF 0x30 +mat 1 +refs 3 +13 0 0 +16 0 0 +12 0 0 +SURF 0x30 +mat 1 +refs 3 +26 0 0 +38 0 0 +27 0 0 +SURF 0x30 +mat 1 +refs 3 +64 0 0 +51 0 0 +84 0 0 +SURF 0x30 +mat 1 +refs 3 +19 0 0 +64 0 0 +84 0 0 +SURF 0x30 +mat 1 +refs 3 +57 0 0 +64 0 0 +19 0 0 +SURF 0x30 +mat 1 +refs 3 +21 0 0 +57 0 0 +19 0 0 +SURF 0x30 +mat 1 +refs 3 +19 0 0 +84 0 0 +20 0 0 +SURF 0x30 +mat 1 +refs 3 +77 0 0 +29 0 0 +31 0 0 +SURF 0x30 +mat 1 +refs 3 +41 0 0 +38 0 0 +75 0 0 +SURF 0x30 +mat 1 +refs 3 +41 0 0 +37 0 0 +38 0 0 +SURF 0x30 +mat 1 +refs 3 +32 0 0 +36 0 0 +34 0 0 +SURF 0x30 +mat 1 +refs 3 +36 0 0 +52 0 0 +34 0 0 +SURF 0x30 +mat 1 +refs 3 +22 0 0 +18 0 0 +21 0 0 +SURF 0x30 +mat 1 +refs 3 +21 0 0 +18 0 0 +19 0 0 +SURF 0x30 +mat 1 +refs 3 +21 0 0 +19 0 0 +60 0 0 +SURF 0x30 +mat 1 +refs 3 +60 0 0 +19 0 0 +33 0 0 +SURF 0x30 +mat 1 +refs 3 +18 0 0 +20 0 0 +19 0 0 +SURF 0x30 +mat 1 +refs 3 +69 0 0 +21 0 0 +22 0 0 +SURF 0x30 +mat 1 +refs 3 +55 0 0 +57 0 0 +21 0 0 +SURF 0x30 +mat 1 +refs 3 +57 0 0 +32 0 0 +34 0 0 +SURF 0x30 +mat 1 +refs 3 +48 0 0 +0 0 0 +49 0 0 +SURF 0x30 +mat 1 +refs 3 +16 0 0 +48 0 0 +14 0 0 +SURF 0x30 +mat 1 +refs 3 +6 0 0 +62 0 0 +56 0 0 +SURF 0x30 +mat 1 +refs 3 +19 0 0 +20 0 0 +84 0 0 +SURF 0x30 +mat 1 +refs 3 +19 0 0 +84 0 0 +33 0 0 +SURF 0x30 +mat 1 +refs 3 +33 0 0 +84 0 0 +51 0 0 +SURF 0x30 +mat 1 +refs 3 +60 0 0 +33 0 0 +32 0 0 +SURF 0x30 +mat 1 +refs 3 +12 0 0 +15 0 0 +10 0 0 +SURF 0x30 +mat 1 +refs 3 +11 0 0 +10 0 0 +17 0 0 +SURF 0x30 +mat 1 +refs 3 +85 0 0 +86 0 0 +81 0 0 +SURF 0x30 +mat 1 +refs 3 +40 0 0 +85 0 0 +87 0 0 +SURF 0x30 +mat 1 +refs 3 +40 0 0 +77 0 0 +85 0 0 +SURF 0x30 +mat 1 +refs 3 +77 0 0 +86 0 0 +85 0 0 +SURF 0x30 +mat 1 +refs 3 +77 0 0 +31 0 0 +86 0 0 +SURF 0x30 +mat 1 +refs 3 +50 0 0 +74 0 0 +30 0 0 +SURF 0x30 +mat 1 +refs 3 +50 0 0 +1 0 0 +74 0 0 +SURF 0x30 +mat 1 +refs 3 +35 0 0 +36 0 0 +32 0 0 +SURF 0x30 +mat 1 +refs 3 +57 0 0 +34 0 0 +64 0 0 +SURF 0x30 +mat 1 +refs 3 +1 0 0 +75 0 0 +74 0 0 +SURF 0x30 +mat 1 +refs 3 +3 0 0 +75 0 0 +1 0 0 +SURF 0x30 +mat 1 +refs 3 +2 0 0 +1 0 0 +50 0 0 +kids 0 diff --git a/Tools/ArdupilotMegaPlanner/bin/Release/aircraft/arducopter/Models/plus_quad2.xml b/Tools/ArdupilotMegaPlanner/bin/Release/aircraft/arducopter/Models/plus_quad2.xml new file mode 100644 index 0000000000000000000000000000000000000000..d4bc4629ef20d846a660fea86a4b3e36dc0f3e36 --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/bin/Release/aircraft/arducopter/Models/plus_quad2.xml @@ -0,0 +1,88 @@ +<?xml version="1.0"?> +<PropertyList> + <!--Airframe--> + <path>plus_quad2.ac</path> + <offsets> + <z-m>0.0</z-m> + <y-m>0</y-m> + <x-m>0.0</x-m> + <pitch-deg>0</pitch-deg> + <heading-deg>180</heading-deg> + </offsets> + <!--Propeller Right--> + <animation> + <type>noshadow</type> + <object-name>prop0</object-name> + </animation> + <animation> + <type>spin</type> + <object-name>prop0</object-name> + <property>/controls/engines/engine[0]/throttle</property> + <factor>12000</factor> + <axis> + <x1-m>0.000</x1-m> + <y1-m>-0.288</y1-m> + <z1-m>0.046</z1-m> + <x2-m>0.000</x2-m> + <y2-m>-0.288</y2-m> + <z2-m>0.012</z2-m> + </axis> + </animation> + <!--Propeller Left--> + <animation> + <type>noshadow</type> + <object-name>prop1</object-name> + </animation> + <animation> + <type>spin</type> + <object-name>prop1</object-name> + <property>/controls/engines/engine[1]/throttle</property> + <factor>12000</factor> + <axis> + <x1-m>0.000</x1-m> + <y1-m>0.288</y1-m> + <z1-m>0.046</z1-m> + <x2-m>0.000</x2-m> + <y2-m>0.288</y2-m> + <z2-m>0.012</z2-m> + </axis> + </animation> + <!--Propeller Front--> + <animation> + <type>noshadow</type> + <object-name>prop2</object-name> + </animation> + <animation> + <type>spin</type> + <object-name>prop2</object-name> + <property>/controls/engines/engine[2]/throttle</property> + <factor>12000</factor> + <axis> + <x1-m>0.288</x1-m> + <y1-m>0.000</y1-m> + <z1-m>0.046</z1-m> + <x2-m>0.288</x2-m> + <y2-m>0.000</y2-m> + <z2-m>0.012</z2-m> + </axis> + </animation> + <!--Propeller Back--> + <animation> + <type>noshadow</type> + <object-name>prop3</object-name> + </animation> + <animation> + <type>spin</type> + <object-name>prop3</object-name> + <property>/controls/engines/engine[3]/throttle</property> + <factor>12000</factor> + <axis> + <x1-m>-0.288</x1-m> + <y1-m>0.000</y1-m> + <z1-m>0.046</z1-m> + <x2-m>-0.288</x2-m> + <y2-m>0.000</y2-m> + <z2-m>0.012</z2-m> + </axis> + </animation> +</PropertyList> diff --git a/Tools/ArdupilotMegaPlanner/bin/Release/aircraft/arducopter/Models/quad.3ds b/Tools/ArdupilotMegaPlanner/bin/Release/aircraft/arducopter/Models/quad.3ds new file mode 100644 index 0000000000000000000000000000000000000000..2f1e6be165c7589770283c6cda60f1649075dcdb Binary files /dev/null and b/Tools/ArdupilotMegaPlanner/bin/Release/aircraft/arducopter/Models/quad.3ds differ diff --git a/Tools/ArdupilotMegaPlanner/bin/Release/aircraft/arducopter/Models/shareware_output.3ds b/Tools/ArdupilotMegaPlanner/bin/Release/aircraft/arducopter/Models/shareware_output.3ds new file mode 100644 index 0000000000000000000000000000000000000000..f736f7b19db62395829778d6fd9a8e8d26a26984 Binary files /dev/null and b/Tools/ArdupilotMegaPlanner/bin/Release/aircraft/arducopter/Models/shareware_output.3ds differ diff --git a/Tools/ArdupilotMegaPlanner/bin/Release/aircraft/arducopter/quad.nas b/Tools/ArdupilotMegaPlanner/bin/Release/aircraft/arducopter/quad.nas new file mode 100644 index 0000000000000000000000000000000000000000..016629be1ad1787ddc52d455fb5b93b401f61b81 --- /dev/null +++ b/Tools/ArdupilotMegaPlanner/bin/Release/aircraft/arducopter/quad.nas @@ -0,0 +1,40 @@ +round10 = func(v) { + if (v == nil) return 0; + return 0.1*int(v*10); +} + +round100 = func(v) { + if (v == nil) return 0; + return 0.01*int(v*100); +} + +var update_quad = func( ) { + asl_ft = getprop("/position/altitude-ft"); + ground = getprop("/position/ground-elev-ft"); + agl_m = (asl_ft - ground) * 0.3048; + + setprop("/apm/altitude", round10(agl_m)); + + setprop("/apm/pitch", round10(getprop("/orientation/pitch-deg"))); + setprop("/apm/roll", round10(getprop("/orientation/roll-deg"))); + setprop("/apm/heading", round10(getprop("/orientation/heading-deg"))); + + # airspeed-kt is actually in feet per second (FDM NET bug) + setprop("/apm/airspeed", round10(0.3048*getprop("/velocities/airspeed-kt"))); + + setprop("/apm/motor_right", round10(getprop("/engines/engine[0]/rpm")/10.0)); + setprop("/apm/motor_left", round10(getprop("/engines/engine[1]/rpm")/10.0)); + setprop("/apm/motor_front", round10(getprop("/engines/engine[2]/rpm")/10.0)); + setprop("/apm/motor_back", round10(getprop("/engines/engine[3]/rpm")/10.0)); +} + +var main_loop = func { + update_quad(); + settimer(main_loop, 0); +} + + +setlistener("/sim/signals/fdm-initialized", + func { + main_loop(); + }); diff --git a/Tools/ArdupilotMegaPlanner/defines.h b/Tools/ArdupilotMegaPlanner/defines.h deleted file mode 100644 index 74760c243c6cce72f5113ddd3e2ca163a6e04437..0000000000000000000000000000000000000000 --- a/Tools/ArdupilotMegaPlanner/defines.h +++ /dev/null @@ -1,346 +0,0 @@ -// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*- - -// Internal defines, don't edit and expect things to work -// ------------------------------------------------------- - -#define DEBUG 0 -#define LOITER_RANGE 30 // for calculating power outside of loiter radius - -// GPS baud rates -// -------------- -#define NO_GPS 38400 -#define NMEA_GPS 38400 -#define EM406_GPS 57600 -#define UBLOX_GPS 38400 -#define ARDU_IMU 38400 -#define MTK_GPS 38400 -#define SIM_GPS 38400 - -// GPS type codes - use the names, not the numbers -#define GPS_PROTOCOL_NONE -1 -#define GPS_PROTOCOL_NMEA 0 -#define GPS_PROTOCOL_SIRF 1 -#define GPS_PROTOCOL_UBLOX 2 -#define GPS_PROTOCOL_IMU 3 -#define GPS_PROTOCOL_MTK 4 - -// Radio channels -// Note channels are from 0! -// -// XXX these should be CH_n defines from RC.h at some point. -#define CH_ROLL 0 -#define CH_PITCH 1 -#define CH_THROTTLE 2 -#define CH_RUDDER 3 -#define CH_1 0 -#define CH_2 1 -#define CH_3 2 -#define CH_4 3 -#define CH_5 4 -#define CH_6 5 -#define CH_7 6 -#define CH_8 7 - -#define WP_START_BYTE 0x130 // where in memory home WP is stored + all other WP -#define WP_SIZE 14 - -// GCS enumeration -#define GCS_PROTOCOL_STANDARD 0 // standard APM protocol -#define GCS_PROTOCOL_SPECIAL 1 // special test protocol (?) -#define GCS_PROTOCOL_LEGACY 2 // legacy ArduPilot protocol -#define GCS_PROTOCOL_XPLANE 3 // X-Plane HIL simulation -#define GCS_PROTOCOL_IMU 4 // ArdiPilot IMU output -#define GCS_PROTOCOL_JASON 5 // Jason's special secret GCS protocol -#define GCS_PROTOCOL_DEBUGTERMINAL 6 // Text-based interactive GCS -#define GCS_PROTOCOL_NONE -1 // No GCS output - -// PID enumeration -// --------------- -#define CASE_SERVO_ROLL 0 -#define CASE_SERVO_PITCH 1 -#define CASE_SERVO_RUDDER 2 -#define CASE_NAV_ROLL 3 -#define CASE_NAV_PITCH_ASP 4 -#define CASE_NAV_PITCH_ALT 5 -#define CASE_TE_THROTTLE 6 -#define CASE_ALT_THROTTLE 7 - -// Feedforward cases -// ---------------- -#define CASE_PITCH_COMP 0 -#define CASE_RUDDER_MIX 1 -#define CASE_P_TO_T 2 -#define CASE_T_TO_P 3 - -// Auto Pilot modes -// ---------------- -#define MANUAL 0 -#define CIRCLE 1 // When flying sans GPS, and we loose the radio, just circle -#define STABILIZE 2 - -#define FLY_BY_WIRE_A 5 // Fly By Wire A has left stick horizontal => desired roll angle, left stick vertical => desired pitch angle, right stick vertical = manual throttle -#define FLY_BY_WIRE_B 6 // Fly By Wire B has left stick horizontal => desired roll angle, left stick vertical => desired pitch angle, right stick vertical => desired airspeed - // Fly By Wire B = Fly By Wire A if you have AIRSPEED_SENSOR 0 -#define AUTO 10 -#define RTL 11 -#define LOITER 12 -#define TAKEOFF 13 -#define LAND 14 - - -// Command IDs - Must -#define CMD_BLANK 0x00 // there is no command stored in the mem location requested -#define CMD_WAYPOINT 0x10 -#define CMD_LOITER 0x11 -#define CMD_LOITER_N_TURNS 0x12 -#define CMD_LOITER_TIME 0x13 -#define CMD_RTL 0x14 -#define CMD_LAND 0x15 -#define CMD_TAKEOFF 0x16 - -// Command IDs - May -#define CMD_DELAY 0x20 -#define CMD_CLIMB 0x21 // NOT IMPLEMENTED -#define CMD_LAND_OPTIONS 0x22 // pitch in deg, airspeed m/s, throttle %, track WP 1 or 0 - -// Command IDs - Now -//#define CMD_AP_MODE 0x30 -#define CMD_RESET_INDEX 0x31 -#define CMD_GOTO_INDEX 0x32 // NOT IMPLEMENTED -#define CMD_GETVAR_INDEX 0x33 -#define CMD_SENDVAR_INDEX 0x34 -#define CMD_TELEMETRY 0x35 - -#define CMD_THROTTLE_CRUISE 0x40 -#define CMD_AIRSPEED_CRUISE 0x41 -#define CMD_RESET_HOME 0x44 - -#define CMD_KP_GAIN 0x60 -#define CMD_KI_GAIN 0x61 -#define CMD_KD_GAIN 0x62 -#define CMD_KI_MAX 0x63 -#define CMD_KFF_GAIN 0x64 - -#define CMD_RADIO_TRIM 0x70 -#define CMD_RADIO_MAX 0x71 -#define CMD_RADIO_MIN 0x72 -#define CMD_RADIO_MIN 0x72 -#define CMD_ELEVON_TRIM 0x73 - -#define CMD_INDEX 0x75 // sets the current Must index -#define CMD_REPEAT 0x80 -#define CMD_RELAY 0x81 -#define CMD_SERVO 0x82 // move servo N to PWM value - -//repeating events -#define NO_REPEAT 0 -#define CH_4_TOGGLE 1 -#define CH_5_TOGGLE 2 -#define CH_6_TOGGLE 3 -#define CH_7_TOGGLE 4 -#define RELAY_TOGGLE 5 -#define STOP_REPEAT 10 - -// GCS Message ID's -#define MSG_ACKNOWLEDGE 0x00 -#define MSG_HEARTBEAT 0x01 -#define MSG_ATTITUDE 0x02 -#define MSG_LOCATION 0x03 -#define MSG_PRESSURE 0x04 -#define MSG_STATUS_TEXT 0x05 -#define MSG_PERF_REPORT 0x06 -#define MSG_COMMAND 0x22 -#define MSG_VALUE 0x32 -#define MSG_PID 0x42 -#define MSG_TRIMS 0x50 -#define MSG_MINS 0x51 -#define MSG_MAXS 0x52 -#define MSG_IMU_OUT 0x53 - -#define SEVERITY_LOW 1 -#define SEVERITY_MEDIUM 2 -#define SEVERITY_HIGH 3 -#define SEVERITY_CRITICAL 4 - -// Logging parameters -#define LOG_ATTITUDE_MSG 0x01 -#define LOG_GPS_MSG 0x02 -#define LOG_MODE_MSG 0X03 -#define LOG_CONTROL_TUNING_MSG 0X04 -#define LOG_NAV_TUNING_MSG 0X05 -#define LOG_PERFORMANCE_MSG 0X06 -#define LOG_RAW_MSG 0x07 -#define LOG_CMD_MSG 0x08 -#define LOG_STARTUP_MSG 0x09 -#define TYPE_AIRSTART_MSG 0x00 -#define TYPE_GROUNDSTART_MSG 0x01 - -#define MASK_LOG_ATTITUDE_FAST 0 -#define MASK_LOG_ATTITUDE_MED 2 -#define MASK_LOG_GPS 4 -#define MASK_LOG_PM 8 -#define MASK_LOG_CTUN 16 -#define MASK_LOG_NTUN 32 -#define MASK_LOG_MODE 64 -#define MASK_LOG_RAW 128 -#define MASK_LOG_CMD 256 - -// Yaw modes -#define YAW_MODE_COORDINATE_TURNS 0 -#define YAW_MODE_HOLD_HEADING 1 -#define YAW_MODE_SLIP 2 - -// Waypoint Modes -// ---------------- -#define ABS_WP 0 -#define REL_WP 1 - -// Command Queues -// --------------- -#define COMMAND_MUST 0 -#define COMMAND_MAY 1 -#define COMMAND_NOW 2 - -// Events -// ------ -#define EVENT_WILL_REACH_WAYPOINT 1 -#define EVENT_SET_NEW_WAYPOINT_INDEX 2 -#define EVENT_LOADED_WAYPOINT 3 -#define EVENT_LOOP 4 - -//GPS_fix -#define VALID_GPS 0x00 -#define BAD_GPS 0x01 -#define FAILED_GPS 0x03 - - - -#define BATTERY_VOLTAGE(x) (x*(INPUT_VOLTAGE/1024.0))*VOLT_DIV_RATIO - -#define AIRSPEED_CH 7 // The external ADC channel for the airspeed sensor -#define BATTERY_PIN1 0 // These are the pins for the voltage dividers -#define BATTERY_PIN2 1 -#define BATTERY_PIN3 2 -#define BATTERY_PIN4 3 -#define RELAY_PIN 47 - -// Hardware Parameters -#define SLIDE_SWITCH_PIN 40 -#define PUSHBUTTON_PIN 41 - -#define A_LED_PIN 37 //36 = B, 37 = A, 35 = C -#define B_LED_PIN 36 -#define C_LED_PIN 35 - -#define HOLD_ALT_ABOVE_HOME 8 // bitmask value - -// IMU Parameters - -#define ADC_CONSTRAINT 900 -#define TRUE 1 -#define FALSE 0 -#define ADC_WARM_CYCLES 200 -#define SPEEDFILT 400 // centimeters/second - -#define GYRO_TEMP_CH 3 // The ADC channel reading the gyro temperature - -// ADC : Voltage reference 3.3v / 12bits(4096 steps) => 0.8mV/ADC step -// ADXL335 Sensitivity(from datasheet) => 330mV/g, 0.8mV/ADC step => 330/0.8 = 412 -// Tested value : 418 -#define GRAVITY 418 //this equivalent to 1G in the raw data coming from the accelerometer -#define Accel_Scale(x) x*(GRAVITY/9.81)//Scaling the raw data of the accel to actual acceleration in meters for seconds square - -#define ToRad(x) (x*0.01745329252) // *pi/180 -#define ToDeg(x) (x*57.2957795131) // *180/pi - -// IDG500 Sensitivity (from datasheet) => 2.0mV/º/s, 0.8mV/ADC step => 0.8/3.33 = 0.4 -// Tested values : 0.4026, ?, 0.4192 -#define Gyro_Gain_X 0.4 //X axis Gyro gain -#define Gyro_Gain_Y 0.41 //Y axis Gyro gain -#define Gyro_Gain_Z 0.41 //Z axis Gyro gain -#define Gyro_Scaled_X(x) x*ToRad(Gyro_Gain_X) //Return the scaled ADC raw data of the gyro in radians for second -#define Gyro_Scaled_Y(x) x*ToRad(Gyro_Gain_Y) //Return the scaled ADC raw data of the gyro in radians for second -#define Gyro_Scaled_Z(x) x*ToRad(Gyro_Gain_Z) //Return the scaled ADC raw data of the gyro in radians for second - -#define Kp_ROLLPITCH 0.0014 // Pitch&Roll Drift Correction Proportional Gain -#define Ki_ROLLPITCH 0.0000003 // Pitch&Roll Drift Correction Integrator Gain -#define Kp_YAW 0.8 // Yaw Drift Correction Porportional Gain -#define Ki_YAW 0.00004 // Yaw Drift CorrectionIntegrator Gain - -/*For debugging purposes*/ -#define OUTPUTMODE 1 //If value = 1 will print the corrected data, 0 will print uncorrected data of the gyros (with drift), 2 Accel only data - - -#define EEPROM_MAX_ADDR 4096 - -// Radio setup -#define EE_TRIM 0x00 -#define EE_MIN 0x10 -#define EE_MAX 0x20 -#define EE_ELEVON1_TRIM 0x30 -#define EE_ELEVON2_TRIM 0x32 - -// user gains -#define EE_XTRACK_GAIN 0x34 -#define EE_XTRACK_ANGLE 0x36 -#define EE_ALT_MIX 0x3B -#define EE_HEAD_MAX 0x38 -#define EE_PITCH_MAX 0x39 -#define EE_PITCH_MIN 0x3A -#define EE_KP 0x40 -#define EE_KI 0x60 -#define EE_KD 0x80 -#define EE_IMAX 0xA0 -#define EE_KFF 0xC0 -#define EE_AN_OFFSET 0xE0 -#define EE_PITCH_TARGET 0x127 - -//mission specific -#define EE_CONFIG 0X0F8 -#define EE_WP_MODE 0x0F9 -#define EE_YAW_MODE 0x0FA // not used -#define EE_WP_TOTAL 0x0FB -#define EE_WP_INDEX 0x0FC -#define EE_WP_RADIUS 0x0FD -#define EE_LOITER_RADIUS 0x0FE -#define EE_ALT_HOLD_HOME 0x0FF - -// user configs -#define EE_AIRSPEED_CRUISE 0x103 -#define EE_AIRSPEED_RATIO 0x104 -#define EE_AIRSPEED_FBW_MIN 0x108 -#define EE_AIRSPEED_FBW_MAX 0x109 -#define EE_THROTTLE_MIN 0x10A -#define EE_THROTTLE_CRUISE 0x10B -#define EE_THROTTLE_MAX 0x10C -#define EE_THROTTLE_FAILSAFE 0x10D -#define EE_THROTTLE_FS_VALUE 0x10E -#define EE_THROTTLE_FAILSAFE_ACTION 0x110 -#define EE_FLIGHT_MODE_CHANNEL 0x112 -#define EE_AUTO_TRIM 0x113 -#define EE_LOG_BITMASK 0x114 -#define EE_REVERSE_SWITCH 0x120 -#define EE_FLIGHT_MODES 0x121 - -// sensors -#define EE_ABS_PRESS_GND 0x116 -#define EE_GND_TEMP 0x11A -#define EE_GND_ALT 0x11C -#define EE_AP_OFFSET 0x11E - -// log -#define EE_LAST_LOG_PAGE 0xE00 -#define EE_LAST_LOG_NUM 0xE02 -#define EE_LOG_1_START 0xE04 - -// bits in log_bitmask -#define LOGBIT_ATTITUDE_FAST (1<<0) -#define LOGBIT_ATTITUDE_MED (1<<1) -#define LOGBIT_GPS (1<<2) -#define LOGBIT_PM (1<<3) -#define LOGBIT_CTUN (1<<4) -#define LOGBIT_NTUN (1<<5) -#define LOGBIT_MODE (1<<6) -#define LOGBIT_RAW (1<<7) -#define LOGBIT_CMD (1<<8) -