APM Planner 1.1.87

add popouts in config/setup
add more text to hud heading nw,ne,sw,se
add 5 m filter to antenna tracker
add refresh param buttons
remove the word old, as people still want it.
modify telem playback interface with slider bars
add posible fix to bad grid spacing
move mavlink code.
This commit is contained in:
Michael Oborne committed 2012-05-20 14:47:20 +08:00
1 parent 8d075015e1
commit 6d24f5efb2
44 files changed
+7908 -459

No files matched your search

@@ -1,4 +1,6 @@
0.5 - add terminal
0.7 - fix typos - log rssi screen to log as well
0.6 - add terminal logging to file, fix remote radio config
0.5 - add terminal
0.4 - adjust erase timeout - to prevent lost bootloader sync error.
0.3 - add RFD900 support
0.2 - change packet size to 32 bytes
+8 -9
View File
@@ -41,10 +41,10 @@
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.terminalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.rssiToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.projectPageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.rssiToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
@@ -108,8 +108,8 @@
//
// groupBox2
//
this.groupBox2.Controls.Add(this.panel1);
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Controls.Add(this.panel1);
this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false;
//
@@ -142,6 +142,12 @@
resources.ApplyResources(this.terminalToolStripMenuItem, "terminalToolStripMenuItem");
this.terminalToolStripMenuItem.Click += new System.EventHandler(this.terminalToolStripMenuItem_Click);
//
// rssiToolStripMenuItem
//
this.rssiToolStripMenuItem.Name = "rssiToolStripMenuItem";
resources.ApplyResources(this.rssiToolStripMenuItem, "rssiToolStripMenuItem");
this.rssiToolStripMenuItem.Click += new System.EventHandler(this.rssiToolStripMenuItem_Click);
//
// aboutToolStripMenuItem
//
this.aboutToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -162,12 +168,6 @@
resources.ApplyResources(this.projectPageToolStripMenuItem, "projectPageToolStripMenuItem");
this.projectPageToolStripMenuItem.Click += new System.EventHandler(this.projectPageToolStripMenuItem_Click);
//
// rssiToolStripMenuItem
//
this.rssiToolStripMenuItem.Name = "rssiToolStripMenuItem";
resources.ApplyResources(this.rssiToolStripMenuItem, "rssiToolStripMenuItem");
this.rssiToolStripMenuItem.Click += new System.EventHandler(this.rssiToolStripMenuItem_Click);
//
// Config
//
resources.ApplyResources(this, "$this");
@@ -178,7 +178,6 @@
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.menuStrip1);
this.MainMenuStrip = this.menuStrip1;
this.MaximizeBox = false;
this.Name = "Config";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
@@ -326,6 +326,9 @@
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="groupBox2.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Bottom, Left, Right</value>
</data>
<data name="groupBox2.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 108</value>
</data>
@@ -393,10 +396,10 @@
<value>Terminal</value>
</data>
<data name="rssiToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>39, 20</value>
<value>41, 20</value>
</data>
<data name="rssiToolStripMenuItem.Text" xml:space="preserve">
<value>Rssi</value>
<value>RSSI</value>
</data>
<data name="helpToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>140, 22</value>
@@ -1585,7 +1588,7 @@
</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>3DRRadio Config 0.5</value>
<value>3DRRadio Config 0.7</value>
</data>
<data name="&gt;&gt;settingsToolStripMenuItem.Name" xml:space="preserve">
<value>settingsToolStripMenuItem</value>
@@ -1599,6 +1602,12 @@
<data name="&gt;&gt;terminalToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;rssiToolStripMenuItem.Name" xml:space="preserve">
<value>rssiToolStripMenuItem</value>
</data>
<data name="&gt;&gt;rssiToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;aboutToolStripMenuItem.Name" xml:space="preserve">
<value>aboutToolStripMenuItem</value>
</data>
@@ -1617,12 +1626,6 @@
<data name="&gt;&gt;projectPageToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;rssiToolStripMenuItem.Name" xml:space="preserve">
<value>rssiToolStripMenuItem</value>
</data>
<data name="&gt;&gt;rssiToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>Config</value>
</data>
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.5.*")]
[assembly: AssemblyFileVersion("0.5.0.0")]
[assembly: AssemblyVersion("0.0.*")]
[assembly: AssemblyFileVersion("0.0.0.0")]
+16 -4
View File
@@ -9,6 +9,7 @@ using System.Windows.Forms;
using ZedGraph;
using ArdupilotMega;
using System.Text.RegularExpressions;
using System.IO;
namespace _3DRRadio
{
@@ -26,10 +27,15 @@ namespace _3DRRadio
{
InitializeComponent();
zedGraphControl1.GraphPane.AddCurve("Rssi Local",plotdatarssil,Color.Red,SymbolType.None);
zedGraphControl1.GraphPane.AddCurve("Rssi Remote", plotdatarssir, Color.Green, SymbolType.None);
zedGraphControl1.GraphPane.AddCurve("Noice Local", plotdatanoicel, Color.Blue, SymbolType.None);
zedGraphControl1.GraphPane.AddCurve("Noice Remote", plotdatanoicer, Color.Orange, SymbolType.None);
zedGraphControl1.GraphPane.AddCurve("RSSI Local",plotdatarssil,Color.Red,SymbolType.None);
zedGraphControl1.GraphPane.AddCurve("RSSI Remote", plotdatarssir, Color.Green, SymbolType.None);
zedGraphControl1.GraphPane.AddCurve("Noise Local", plotdatanoicel, Color.Blue, SymbolType.None);
zedGraphControl1.GraphPane.AddCurve("Noise Remote", plotdatanoicer, Color.Orange, SymbolType.None);
zedGraphControl1.GraphPane.Title.Text = "RSSI";
if (Terminal.sw == null)
Terminal.sw = new StreamWriter("Terminal-" + DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss") + ".txt");
}
private void BUT_connect_Click(object sender, EventArgs e)
@@ -112,6 +118,12 @@ L/R RSSI: 12/0 L/R noise: 16/0 pkts: 0 txe=0 rxe=0 stx=0 srx=0 ecc=0/0 temp=61
// Force a redraw
zedGraphControl1.Invalidate();
if (Terminal.sw != null)
{
Terminal.sw.Write(line);
Terminal.sw.Flush();
}
}
}
@@ -9,6 +9,7 @@ using System.Windows.Forms;
using System.IO.Ports;
using ArdupilotMega;
using ArdupilotMega.Comms;
using System.IO;
namespace _3DRRadio
{
@@ -18,10 +19,14 @@ namespace _3DRRadio
Object thisLock = new Object();
public static bool threadrun = false;
StringBuilder cmd = new StringBuilder();
internal static StreamWriter sw;
public Terminal()
{
InitializeComponent();
if (sw == null)
sw = new StreamWriter("Terminal-" + DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss") + ".txt");
}
void comPort_DataReceived(object sender, SerialDataReceivedEventArgs e)
@@ -35,6 +40,12 @@ namespace _3DRRadio
string data = comPort.ReadExisting();
//Console.Write(data);
if (sw != null)
{
sw.Write(data);
sw.Flush();
}
addText(data);
}
}
@@ -113,6 +124,13 @@ namespace _3DRRadio
comPort.DtrEnable = false;
try
{
//if (sw != null)
// sw.Close();
}
catch { }
if (threadrun == false)
{
comPort.Close();
@@ -174,11 +192,19 @@ namespace _3DRRadio
string temp = cmd.ToString();
if (cmd.ToString() == "+++")
{
comPort.Write(Encoding.ASCII.GetBytes(cmd.ToString()), 0, cmd.Length);
}
else
{
comPort.Write(Encoding.ASCII.GetBytes(cmd.ToString() + "\r"), 0, cmd.Length + 1);
}
if (sw != null)
{
sw.WriteLine(cmd.ToString());
sw.Flush();
}
}
catch { CustomMessageBox.Show("Error writing to com port"); }
}
@@ -231,6 +231,12 @@
<Compile Include="Attributes\DisplayTextAttribute.cs" />
<Compile Include="Attributes\PrivateAttribute.cs" />
<Compile Include="CodeGen.cs" />
<Compile Include="Comms\CommsSerialInterface.cs" />
<Compile Include="Comms\CommsSerialPort.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Comms\CommsTCPSerial.cs" />
<Compile Include="Comms\CommsUdpSerial.cs" />
<Compile Include="Controls\HSI.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -265,6 +271,7 @@
<Compile Include="GCSViews\ConfigurationView\ConfigArdurover.Designer.cs">
<DependentUpon>ConfigArdurover.cs</DependentUpon>
</Compile>
<Compile Include="Mavlink\IMAVLink.cs" />
<Compile Include="Utilities\CollectionExtensions.cs" />
<Compile Include="Utilities\ParameterMetaDataConstants.cs" />
<Compile Include="Controls\BackstageView\BackstageView.cs">
@@ -406,12 +413,6 @@
<DependentUpon>Camera.cs</DependentUpon>
</Compile>
<Compile Include="Utilities\Capture.cs" />
<Compile Include="Comms\CommsSerialInterface.cs" />
<Compile Include="Comms\CommsSerialPort.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Comms\CommsTCPSerial.cs" />
<Compile Include="Comms\CommsUdpSerial.cs" />
<Compile Include="Controls\ImageLabel.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -468,7 +469,7 @@
<Compile Include="JoystickSetup.Designer.cs">
<DependentUpon>JoystickSetup.cs</DependentUpon>
</Compile>
<Compile Include="MAVLinkTypes.cs" />
<Compile Include="Mavlink\MAVLinkTypes.cs" />
<Compile Include="Controls\MyButton.cs">
<SubType>Component</SubType>
</Compile>
@@ -537,14 +538,14 @@
<SubType>Component</SubType>
</Compile>
<Compile Include="CurrentState.cs" />
<Compile Include="MAVLinkTypes0.9.cs" />
<Compile Include="Mavlink\MAVLinkTypes0.9.cs" />
<Compile Include="ElevationProfile.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ElevationProfile.Designer.cs">
<DependentUpon>ElevationProfile.cs</DependentUpon>
</Compile>
<Compile Include="MAVLink.cs" />
<Compile Include="Mavlink\MAVLink.cs" />
<Compile Include="Arduino\ArduinoSTK.cs">
<SubType>Component</SubType>
</Compile>
@@ -11,6 +11,6 @@
<UpdateUrlHistory />
</PropertyGroup>
<PropertyGroup>
<ReferencePath>C:\Users\hog\Desktop\DIYDrones\myquad\greatmaps_e1bb830a18a3\Demo.WindowsForms\bin\Debug\;C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\Lib\;C:\Users\hog\Desktop\DIYDrones\myquad\sharpkml\SharpKml\bin\Release\;C:\Users\hog\Desktop\DIYDrones\myquad\MetaDataExtractorCSharp240d\bin\Release\</ReferencePath>
<ReferencePath>C:\Users\hog\Desktop\DIYDrones\myquad\greatmaps_e1bb830a18a3\Demo.WindowsForms\bin\Debug\;C:\Users\hog\Desktop\DIYDrones\myquad\sharpkml\SharpKml\bin\Release\;C:\Users\hog\Desktop\DIYDrones\myquad\MetaDataExtractorCSharp240d\bin\Release\;C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\Lib\</ReferencePath>
</PropertyGroup>
</Project>
File diff suppressed because it is too large. Load diff
@@ -191,6 +191,50 @@ namespace ArdupilotMega.Controls.BackstageView
pnlMenu.Controls.Add(lnkButton);
lnkButton.Click += this.ButtonClick;
lnkButton.DoubleClick += lnkButton_DoubleClick;
}
void lnkButton_DoubleClick(object sender, EventArgs e)
{
var backstageViewButton = ((BackstageViewButton)sender);
var associatedPage = backstageViewButton.Tag as BackstageViewPage;
Form popoutForm = new Form();
popoutForm.FormClosing += popoutForm_FormClosing;
int maxright = 0, maxdown = 0;
foreach (Control ctl in associatedPage.Page.Controls)
{
maxright = Math.Max(ctl.Right, maxright);
maxdown = Math.Max(ctl.Bottom, maxdown);
}
// set the height to 0, so we can derive the header height in the next step
popoutForm.Height = 0;
popoutForm.Size = new System.Drawing.Size(maxright + 20, maxdown + 20 + popoutForm.Height);
popoutForm.Controls.Add(associatedPage.Page);
popoutForm.Tag = associatedPage;
popoutForm.Text = associatedPage.LinkText;
popoutForm.BackColor = this.BackColor;
popoutForm.ForeColor = this.ForeColor;
popoutForm.Show(this);
}
void popoutForm_FormClosing(object sender, FormClosingEventArgs e)
{
// get the page back
var temp = ((Form)sender).Tag as BackstageViewPage;
// add back to where it belongs
this.pnlPages.Controls.Add(temp.Page);
// clear the controls, so we dont dispose the good control
((Form)sender).Controls.Clear();
}
@@ -239,7 +283,7 @@ namespace ArdupilotMega.Controls.BackstageView
LinkText = linkText;
}
public BackStageViewContentPanel Page { get; private set; }
public BackStageViewContentPanel Page { get; set; }
public string LinkText { get; set; }
}
}
@@ -135,6 +135,7 @@ namespace ArdupilotMega.Controls.BackstageView
this.Invalidate();
}
/*
// This IS necessary for transparency - windows only..... remove it
protected override CreateParams CreateParams
@@ -11,10 +11,11 @@ namespace ArdupilotMega.Controls
{
public partial class ConnectionStats : UserControl
{
private readonly MAVLink _mavlink;
private readonly IMAVLink _mavlink;
private CompositeDisposable _subscriptionsDisposable;
public ConnectionStats(MAVLink comPort) : this()
public ConnectionStats(IMAVLink comPort)
: this()
{
_mavlink = comPort;
@@ -967,18 +967,34 @@ namespace ArdupilotMega.Controls
{
drawstring(graphicsObject, "N".PadLeft(2), font, fontsize + 4, whiteBrush, headbg.Left - 5 + space * (a - start) - fontoffset, headbg.Bottom - 24 - (int)(fontoffset * 1.7));
}
else if (disp == 45)
{
drawstring(graphicsObject, "NE".PadLeft(2), font, fontsize + 4, whiteBrush, headbg.Left - 5 + space * (a - start) - fontoffset, headbg.Bottom - 24 - (int)(fontoffset * 1.7));
}
else if (disp == 90)
{
drawstring(graphicsObject, "E".PadLeft(2), font, fontsize + 4, whiteBrush, headbg.Left - 5 + space * (a - start) - fontoffset, headbg.Bottom - 24 - (int)(fontoffset * 1.7));
}
else if (disp == 135)
{
drawstring(graphicsObject, "SE".PadLeft(2), font, fontsize + 4, whiteBrush, headbg.Left - 5 + space * (a - start) - fontoffset, headbg.Bottom - 24 - (int)(fontoffset * 1.7));
}
else if (disp == 180)
{
drawstring(graphicsObject, "S".PadLeft(2), font, fontsize + 4, whiteBrush, headbg.Left - 5 + space * (a - start) - fontoffset, headbg.Bottom - 24 - (int)(fontoffset * 1.7));
}
else if (disp == 225)
{
drawstring(graphicsObject, "SW".PadLeft(2), font, fontsize + 4, whiteBrush, headbg.Left - 5 + space * (a - start) - fontoffset, headbg.Bottom - 24 - (int)(fontoffset * 1.7));
}
else if (disp == 270)
{
drawstring(graphicsObject, "W".PadLeft(2), font, fontsize + 4, whiteBrush, headbg.Left - 5 + space * (a - start) - fontoffset, headbg.Bottom - 24 - (int)(fontoffset * 1.7));
}
else if (disp == 315)
{
drawstring(graphicsObject, "NW".PadLeft(2), font, fontsize + 4, whiteBrush, headbg.Left - 5 + space * (a - start) - fontoffset, headbg.Bottom - 24 - (int)(fontoffset * 1.7));
}
else
{
drawstring(graphicsObject, (disp % 360).ToString().PadLeft(3), font, fontsize, whiteBrush, headbg.Left - 5 + space * (a - start) - fontoffset, headbg.Bottom - 24 - (int)(fontoffset * 1.7));
+7 -1
View File
@@ -220,6 +220,9 @@ namespace ArdupilotMega
{
float dist = DistToMAV;
if (dist < 5)
return 0;
float altdiff = (float)(alt - HomeLocation.Alt);
float angle = (float)Math.Atan(altdiff / dist) * rad2deg;
@@ -245,6 +248,9 @@ namespace ArdupilotMega
//bearing = bearing - 180;//absolut return direction
//if (bearing < 0) bearing += 360;//normalization
if (DistToMAV < 5)
return 0;
return (float)bearing;
}
}
@@ -339,7 +345,7 @@ namespace ArdupilotMega
UpdateCurrentSettings(bs, false, MainV2.comPort);
}
*/
public void UpdateCurrentSettings(System.Windows.Forms.BindingSource bs, bool updatenow, MAVLink mavinterface)
public void UpdateCurrentSettings(System.Windows.Forms.BindingSource bs, bool updatenow, IMAVLink mavinterface)
{
if (DateTime.Now > lastupdate.AddMilliseconds(19) || updatenow) // 50 hz
{
@@ -127,6 +127,7 @@
this.label91 = new System.Windows.Forms.Label();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.BUT_writePIDS = new ArdupilotMega.Controls.MyButton();
this.BUT_rerequestparams = new ArdupilotMega.Controls.MyButton();
((System.ComponentModel.ISupportInitialize)(this.TUNE_LOW)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.TUNE_HIGH)).BeginInit();
this.groupBox5.SuspendLayout();
@@ -793,10 +794,18 @@
this.BUT_writePIDS.UseVisualStyleBackColor = true;
this.BUT_writePIDS.Click += new System.EventHandler(this.BUT_writePIDS_Click);
//
// BUT_rerequestparams
//
resources.ApplyResources(this.BUT_rerequestparams, "BUT_rerequestparams");
this.BUT_rerequestparams.Name = "BUT_rerequestparams";
this.BUT_rerequestparams.UseVisualStyleBackColor = true;
this.BUT_rerequestparams.Click += new System.EventHandler(this.BUT_rerequestparams_Click);
//
// ConfigArducopter
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.BUT_rerequestparams);
this.Controls.Add(this.BUT_writePIDS);
this.Controls.Add(this.myLabel3);
this.Controls.Add(this.TUNE_LOW);
@@ -974,5 +983,6 @@
private System.Windows.Forms.Label label91;
private System.Windows.Forms.ToolTip toolTip1;
private Controls.MyButton BUT_writePIDS;
private Controls.MyButton BUT_rerequestparams;
}
}
@@ -374,6 +374,33 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
}
}
}
/// <summary>
/// Handles the Click event of the BUT_rerequestparams control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
protected void BUT_rerequestparams_Click(object sender, EventArgs e)
{
if (!MainV2.comPort.BaseStream.IsOpen)
return;
((Control)sender).Enabled = false;
try
{
MainV2.comPort.getParamList();
}
catch (Exception ex)
{
CustomMessageBox.Show("Error: getting param list " + ex.ToString());
}
((Control)sender).Enabled = true;
this.DoLoad(new EventArgs());
}
}
File diff suppressed because it is too large. Load diff
@@ -132,6 +132,7 @@
this.label52 = new System.Windows.Forms.Label();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.BUT_writePIDS = new ArdupilotMega.Controls.MyButton();
this.BUT_rerequestparams = new ArdupilotMega.Controls.MyButton();
this.groupBox3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.THR_FS_VALUE)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.THR_MAX)).BeginInit();
@@ -797,10 +798,18 @@
this.BUT_writePIDS.UseVisualStyleBackColor = true;
this.BUT_writePIDS.Click += new System.EventHandler(this.BUT_writePIDS_Click);
//
// BUT_rerequestparams
//
resources.ApplyResources(this.BUT_rerequestparams, "BUT_rerequestparams");
this.BUT_rerequestparams.Name = "BUT_rerequestparams";
this.BUT_rerequestparams.UseVisualStyleBackColor = true;
this.BUT_rerequestparams.Click += new System.EventHandler(this.BUT_rerequestparams_Click);
//
// ConfigArduplane
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.BUT_rerequestparams);
this.Controls.Add(this.BUT_writePIDS);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox1);
@@ -980,5 +989,6 @@
private System.Windows.Forms.Label label52;
private System.Windows.Forms.ToolTip toolTip1;
private Controls.MyButton BUT_writePIDS;
private Controls.MyButton BUT_rerequestparams;
}
}
@@ -294,5 +294,32 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
}
}
/// <summary>
/// Handles the Click event of the BUT_rerequestparams control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
protected void BUT_rerequestparams_Click(object sender, EventArgs e)
{
if (!MainV2.comPort.BaseStream.IsOpen)
return;
((Control)sender).Enabled = false;
try
{
MainV2.comPort.getParamList();
}
catch (Exception ex)
{
CustomMessageBox.Show("Error: getting param list " + ex.ToString());
}
((Control)sender).Enabled = true;
this.DoLoad(new EventArgs());
}
}
}
@@ -237,7 +237,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox3.ZOrder" xml:space="preserve">
<value>1</value>
<value>2</value>
</data>
<data name="THR_FS_VALUE.Location" type="System.Drawing.Point, System.Drawing">
<value>111, 82</value>
@@ -550,7 +550,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>2</value>
<value>3</value>
</data>
<data name="ARSPD_RATIO.Location" type="System.Drawing.Point, System.Drawing">
<value>111, 82</value>
@@ -838,7 +838,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox2.ZOrder" xml:space="preserve">
<value>3</value>
<value>4</value>
</data>
<data name="LIM_PITCH_MIN.Location" type="System.Drawing.Point, System.Drawing">
<value>111, 59</value>
@@ -1054,7 +1054,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox15.ZOrder" xml:space="preserve">
<value>4</value>
<value>5</value>
</data>
<data name="XTRK_ANGLE_CD.Location" type="System.Drawing.Point, System.Drawing">
<value>111, 36</value>
@@ -1246,7 +1246,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox16.ZOrder" xml:space="preserve">
<value>5</value>
<value>6</value>
</data>
<data name="KFF_PTCH2THR.Location" type="System.Drawing.Point, System.Drawing">
<value>111, 13</value>
@@ -1510,7 +1510,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox14.ZOrder" xml:space="preserve">
<value>6</value>
<value>7</value>
</data>
<data name="ENRGY2THR_IMAX.Location" type="System.Drawing.Point, System.Drawing">
<value>111, 82</value>
@@ -1822,7 +1822,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox13.ZOrder" xml:space="preserve">
<value>7</value>
<value>8</value>
</data>
<data name="ALT2PTCH_IMAX.Location" type="System.Drawing.Point, System.Drawing">
<value>111, 82</value>
@@ -2134,7 +2134,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox12.ZOrder" xml:space="preserve">
<value>8</value>
<value>9</value>
</data>
<data name="ARSP2PTCH_IMAX.Location" type="System.Drawing.Point, System.Drawing">
<value>111, 82</value>
@@ -2446,7 +2446,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox11.ZOrder" xml:space="preserve">
<value>9</value>
<value>10</value>
</data>
<data name="HDNG2RLL_IMAX.Location" type="System.Drawing.Point, System.Drawing">
<value>111, 82</value>
@@ -2758,7 +2758,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox10.ZOrder" xml:space="preserve">
<value>10</value>
<value>11</value>
</data>
<data name="YW2SRV_IMAX.Location" type="System.Drawing.Point, System.Drawing">
<value>111, 82</value>
@@ -3070,7 +3070,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox9.ZOrder" xml:space="preserve">
<value>11</value>
<value>12</value>
</data>
<data name="PTCH2SRV_IMAX.Location" type="System.Drawing.Point, System.Drawing">
<value>111, 82</value>
@@ -3382,7 +3382,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox8.ZOrder" xml:space="preserve">
<value>12</value>
<value>13</value>
</data>
<data name="RLL2SRV_IMAX.Location" type="System.Drawing.Point, System.Drawing">
<value>111, 82</value>
@@ -3586,7 +3586,7 @@
<value>NoControl</value>
</data>
<data name="BUT_writePIDS.Location" type="System.Drawing.Point, System.Drawing">
<value>261, 437</value>
<value>204, 437</value>
</data>
<data name="BUT_writePIDS.Size" type="System.Drawing.Size, System.Drawing">
<value>103, 19</value>
@@ -3601,12 +3601,42 @@
<value>BUT_writePIDS</value>
</data>
<data name="&gt;&gt;BUT_writePIDS.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.24834, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4523.24267, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_writePIDS.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;BUT_writePIDS.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="BUT_rerequestparams.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="BUT_rerequestparams.Location" type="System.Drawing.Point, System.Drawing">
<value>313, 437</value>
</data>
<data name="BUT_rerequestparams.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 15, 0, 0</value>
</data>
<data name="BUT_rerequestparams.Size" type="System.Drawing.Size, System.Drawing">
<value>103, 19</value>
</data>
<data name="BUT_rerequestparams.TabIndex" type="System.Int32, mscorlib">
<value>75</value>
</data>
<data name="BUT_rerequestparams.Text" xml:space="preserve">
<value>Refresh Params</value>
</data>
<data name="&gt;&gt;BUT_rerequestparams.Name" xml:space="preserve">
<value>BUT_rerequestparams</value>
</data>
<data name="&gt;&gt;BUT_rerequestparams.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4523.24267, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_rerequestparams.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;BUT_rerequestparams.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@@ -3628,6 +3658,6 @@
<value>ConfigArduplane</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.BackstageView.BackStageViewContentPanel, ArdupilotMegaPlanner, Version=1.1.4498.24834, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.BackstageView.BackStageViewContentPanel, ArdupilotMegaPlanner, Version=1.1.4523.24267, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>
@@ -80,6 +80,7 @@
this.label64 = new System.Windows.Forms.Label();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.BUT_writePIDS = new ArdupilotMega.Controls.MyButton();
this.BUT_rerequestparams = new ArdupilotMega.Controls.MyButton();
this.groupBox3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.THR_FS_VALUE)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.THR_MAX)).BeginInit();
@@ -404,10 +405,18 @@
this.BUT_writePIDS.UseVisualStyleBackColor = true;
this.BUT_writePIDS.Click += new System.EventHandler(this.BUT_writePIDS_Click);
//
// BUT_rerequestparams
//
resources.ApplyResources(this.BUT_rerequestparams, "BUT_rerequestparams");
this.BUT_rerequestparams.Name = "BUT_rerequestparams";
this.BUT_rerequestparams.UseVisualStyleBackColor = true;
this.BUT_rerequestparams.Click += new System.EventHandler(this.BUT_rerequestparams_Click);
//
// ConfigArdurover
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.BUT_rerequestparams);
this.Controls.Add(this.BUT_writePIDS);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox1);
@@ -500,5 +509,6 @@
private System.Windows.Forms.Label label64;
private System.Windows.Forms.ToolTip toolTip1;
private Controls.MyButton BUT_writePIDS;
private Controls.MyButton BUT_rerequestparams;
}
}
@@ -294,5 +294,32 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
}
}
/// <summary>
/// Handles the Click event of the BUT_rerequestparams control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
protected void BUT_rerequestparams_Click(object sender, EventArgs e)
{
if (!MainV2.comPort.BaseStream.IsOpen)
return;
((Control)sender).Enabled = false;
try
{
MainV2.comPort.getParamList();
}
catch (Exception ex)
{
CustomMessageBox.Show("Error: getting param list " + ex.ToString());
}
((Control)sender).Enabled = true;
this.DoLoad(new EventArgs());
}
}
}
@@ -237,7 +237,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox3.ZOrder" xml:space="preserve">
<value>1</value>
<value>2</value>
</data>
<data name="THR_FS_VALUE.Location" type="System.Drawing.Point, System.Drawing">
<value>111, 82</value>
@@ -550,7 +550,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>2</value>
<value>3</value>
</data>
<data name="ARSPD_RATIO.Location" type="System.Drawing.Point, System.Drawing">
<value>111, 82</value>
@@ -838,7 +838,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox2.ZOrder" xml:space="preserve">
<value>3</value>
<value>4</value>
</data>
<data name="LIM_PITCH_MIN.Location" type="System.Drawing.Point, System.Drawing">
<value>111, 59</value>
@@ -1054,7 +1054,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox15.ZOrder" xml:space="preserve">
<value>4</value>
<value>5</value>
</data>
<data name="XTRK_ANGLE_CD.Location" type="System.Drawing.Point, System.Drawing">
<value>111, 36</value>
@@ -1270,7 +1270,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox14.ZOrder" xml:space="preserve">
<value>5</value>
<value>6</value>
</data>
<data name="ENRGY2THR_IMAX.Location" type="System.Drawing.Point, System.Drawing">
<value>111, 82</value>
@@ -1582,7 +1582,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox11.ZOrder" xml:space="preserve">
<value>6</value>
<value>7</value>
</data>
<data name="HDNG2RLL_IMAX.Location" type="System.Drawing.Point, System.Drawing">
<value>111, 82</value>
@@ -1783,7 +1783,7 @@
<value>NoControl</value>
</data>
<data name="BUT_writePIDS.Location" type="System.Drawing.Point, System.Drawing">
<value>261, 437</value>
<value>205, 437</value>
</data>
<data name="BUT_writePIDS.Size" type="System.Drawing.Size, System.Drawing">
<value>103, 19</value>
@@ -1798,12 +1798,42 @@
<value>BUT_writePIDS</value>
</data>
<data name="&gt;&gt;BUT_writePIDS.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4517.34195, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4523.24267, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_writePIDS.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;BUT_writePIDS.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="BUT_rerequestparams.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="BUT_rerequestparams.Location" type="System.Drawing.Point, System.Drawing">
<value>314, 437</value>
</data>
<data name="BUT_rerequestparams.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 15, 0, 0</value>
</data>
<data name="BUT_rerequestparams.Size" type="System.Drawing.Size, System.Drawing">
<value>103, 19</value>
</data>
<data name="BUT_rerequestparams.TabIndex" type="System.Int32, mscorlib">
<value>75</value>
</data>
<data name="BUT_rerequestparams.Text" xml:space="preserve">
<value>Refresh Params</value>
</data>
<data name="&gt;&gt;BUT_rerequestparams.Name" xml:space="preserve">
<value>BUT_rerequestparams</value>
</data>
<data name="&gt;&gt;BUT_rerequestparams.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4523.24267, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_rerequestparams.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;BUT_rerequestparams.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@@ -1825,6 +1855,6 @@
<value>ConfigArdurover</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.BackstageView.BackStageViewContentPanel, ArdupilotMegaPlanner, Version=1.1.4517.34195, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.BackstageView.BackStageViewContentPanel, ArdupilotMegaPlanner, Version=1.1.4523.24267, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>
@@ -36,7 +36,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
configpanel.LoadXML("ArduCopterConfig.xml");
this.backstageView.AddPage(new BackstageView.BackstageViewPage(configpanel, "ArduCopter Pids"));
this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigArducopter(), "OLD ArduCopter Config"));
this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigArducopter(), "ArduCopter Config"));
}
/****************************** ArduCopter **************************/
else if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2)
@@ -47,7 +47,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
configpanel.LoadXML("ArduCopterConfig.xml");
this.backstageView.AddPage(new BackstageView.BackstageViewPage(configpanel, "ArduCopter Pids"));
this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigArducopter(), "OLD ArduCopter Config"));
this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigArducopter(), "ArduCopter Config"));
}
/****************************** ArduPlane **************************/
else if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane)
@@ -79,7 +79,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
if (!MainV2.comPort.BaseStream.IsOpen)
{
CustomMessageBox.Show("Please connect (click Connect Button) before using setup!!");
Common.MessageShowAgain("Config Connect", "Please connect (click Connect Button) before using setup!!");
}
}
+16 -23
View File
@@ -44,8 +44,9 @@
this.Gspeed = new AGaugeApp.AGauge();
this.tabStatus = new System.Windows.Forms.TabPage();
this.tabTLogs = new System.Windows.Forms.TabPage();
this.lbl_playbackspeed = new ArdupilotMega.Controls.MyLabel();
this.lbl_logpercent = new ArdupilotMega.Controls.MyLabel();
this.NUM_playbackspeed = new System.Windows.Forms.NumericUpDown();
this.NUM_playbackspeed = new ArdupilotMega.Controls.MyTrackBar();
this.BUT_log2kml = new ArdupilotMega.Controls.MyButton();
this.tracklog = new System.Windows.Forms.TrackBar();
this.BUT_playlog = new ArdupilotMega.Controls.MyButton();
@@ -852,6 +853,7 @@
//
// tabTLogs
//
this.tabTLogs.Controls.Add(this.lbl_playbackspeed);
this.tabTLogs.Controls.Add(this.lbl_logpercent);
this.tabTLogs.Controls.Add(this.NUM_playbackspeed);
this.tabTLogs.Controls.Add(this.BUT_log2kml);
@@ -862,6 +864,12 @@
this.tabTLogs.Name = "tabTLogs";
this.tabTLogs.UseVisualStyleBackColor = true;
//
// lbl_playbackspeed
//
resources.ApplyResources(this.lbl_playbackspeed, "lbl_playbackspeed");
this.lbl_playbackspeed.Name = "lbl_playbackspeed";
this.lbl_playbackspeed.resize = false;
//
// lbl_logpercent
//
resources.ApplyResources(this.lbl_logpercent, "lbl_logpercent");
@@ -870,30 +878,14 @@
//
// NUM_playbackspeed
//
this.NUM_playbackspeed.DecimalPlaces = 1;
this.NUM_playbackspeed.Increment = new decimal(new int[] {
1,
0,
0,
65536});
resources.ApplyResources(this.NUM_playbackspeed, "NUM_playbackspeed");
this.NUM_playbackspeed.Maximum = new decimal(new int[] {
10,
0,
0,
0});
this.NUM_playbackspeed.Minimum = new decimal(new int[] {
1,
0,
0,
65536});
this.NUM_playbackspeed.LargeChange = 1;
this.NUM_playbackspeed.Maximum = 10D;
this.NUM_playbackspeed.Minimum = 0.01D;
this.NUM_playbackspeed.Name = "NUM_playbackspeed";
this.toolTip1.SetToolTip(this.NUM_playbackspeed, resources.GetString("NUM_playbackspeed.ToolTip"));
this.NUM_playbackspeed.Value = new decimal(new int[] {
1,
0,
0,
0});
this.NUM_playbackspeed.Value = 1D;
this.NUM_playbackspeed.Scroll += new System.EventHandler(this.NUM_playbackspeed_Scroll);
//
// BUT_log2kml
//
@@ -1225,7 +1217,7 @@
private ArdupilotMega.Controls.MyLabel lbl_winddir;
private ArdupilotMega.Controls.MyButton BUT_joystick;
private System.Windows.Forms.ToolTip toolTip1;
private System.Windows.Forms.NumericUpDown NUM_playbackspeed;
private ArdupilotMega.Controls.MyTrackBar NUM_playbackspeed;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip2;
private System.Windows.Forms.ToolStripMenuItem recordHudToAVIToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem stopRecordToolStripMenuItem;
@@ -1236,5 +1228,6 @@
private ArdupilotMega.Controls.MyLabel lbl_hdop;
private ArdupilotMega.Controls.MyLabel lbl_sats;
private Controls.HSI Gheading;
private Controls.MyLabel lbl_playbackspeed;
}
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -1221,7 +1221,7 @@ namespace ArdupilotMega.GCSViews
try
{
MAVLink port = MainV2.comPort;
IMAVLink port = MainV2.comPort;
if (!port.BaseStream.IsOpen)
{
@@ -1330,7 +1330,7 @@ namespace ArdupilotMega.GCSViews
{
try
{
MAVLink port = MainV2.comPort;
IMAVLink port = MainV2.comPort;
if (!port.BaseStream.IsOpen)
{
@@ -2491,6 +2491,12 @@ namespace ArdupilotMega.GCSViews
CustomMessageBox.Show("Right click the map to draw a polygon", "Area", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
// ensure points/latlong are current
MainMap.Zoom = (int)MainMap.Zoom;
MainMap.Refresh();
GMapPolygon area = drawnpolygon;
area.Points.Add(area.Points[0]); // make a full loop
RectLatLng arearect = getPolyMinMax(area);
@@ -2541,7 +2547,7 @@ namespace ArdupilotMega.GCSViews
//Commands.Rows.Clear();
#endif
// get x y components
double x1 = Math.Cos((double.Parse(angle)) * deg2rad);
double x1 = Math.Cos((double.Parse(angle)) * deg2rad); // needs to mod for long scale
double y1 = Math.Sin((double.Parse(angle)) * deg2rad);
// get x y step amount in lat lng from m
@@ -22,7 +22,7 @@ namespace ArdupilotMega.GCSViews
public partial class Simulation : MyUserControl
{
private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
MAVLink comPort = MainV2.comPort;
IMAVLink comPort = MainV2.comPort;
UdpClient XplanesSEND;
UdpClient MavLink;
Socket SimulatorRECV;
@@ -721,7 +721,7 @@ namespace ArdupilotMega.GCSViews
/// <param name="data">Packet</param>
/// <param name="receviedbytes">Length</param>
/// <param name="comPort">Com Port</param>
private void RECVprocess(byte[] data, int receviedbytes, ArdupilotMega.MAVLink comPort)
private void RECVprocess(byte[] data, int receviedbytes, ArdupilotMega.IMAVLink comPort)
{
#if MAVLINK10
ArdupilotMega.MAVLink.mavlink_hil_state_t hilstate = new ArdupilotMega.MAVLink.mavlink_hil_state_t();
+38 -17
View File
@@ -44,7 +44,7 @@ namespace ArdupilotMega
/// <summary>
/// Main Comport interface
/// </summary>
public static MAVLink comPort = new MAVLink();
public static IMAVLink comPort = new MAVLink();
/// <summary>
/// Comport name
/// </summary>
@@ -1310,7 +1310,10 @@ namespace ArdupilotMega
try
{
CheckForUpdate();
if (System.Diagnostics.Debugger.IsAttached)
{
CheckForUpdate();
}
}
catch (Exception ex)
{
@@ -1518,6 +1521,23 @@ namespace ArdupilotMega
kml.AddFeature(pmplane);
SharpKml.Dom.CoordinateCollection coords = new SharpKml.Dom.CoordinateCollection();
foreach (var point in GCSViews.FlightPlanner.pointlist)
{
if (point != null)
coords.Add(new SharpKml.Base.Vector(point.Lat, point.Lng, point.Alt));
}
SharpKml.Dom.LineString ls = new SharpKml.Dom.LineString();
ls.AltitudeMode = SharpKml.Dom.AltitudeMode.RelativeToGround;
ls.Coordinates = coords;
SharpKml.Dom.Placemark pm = new SharpKml.Dom.Placemark() { Geometry = ls };
kml.AddFeature(pm);
SharpKml.Base.Serializer serializer = new SharpKml.Base.Serializer();
serializer.Serialize(kml);
@@ -1677,19 +1697,20 @@ namespace ArdupilotMega
{
process.StartInfo.FileName = exePath + Path.DirectorySeparatorChar + "Updater.exe";
process.StartInfo.Arguments = "";
try
}
try
{
foreach (string newupdater in Directory.GetFiles(exePath, "Updater.exe*.new"))
{
foreach (string newupdater in Directory.GetFiles(exePath, "Updater.exe*.new"))
{
File.Copy(newupdater, newupdater.Remove(newupdater.Length - 4), true);
File.Delete(newupdater);
}
}
catch (Exception ex)
{
log.Error("Exception during update", ex);
File.Copy(newupdater, newupdater.Remove(newupdater.Length - 4), true);
File.Delete(newupdater);
}
}
catch (Exception ex)
{
log.Error("Exception during update", ex);
}
if (frmProgressReporter != null)
frmProgressReporter.UpdateProgressAndStatus(-1, "Starting Updater");
log.Info("Starting new process: " + process.StartInfo.FileName + " with " + process.StartInfo.Arguments);
@@ -1750,7 +1771,7 @@ namespace ArdupilotMega
//dataStream = response.GetResponseStream();
// Open the stream using a StreamReader for easy access.
bool shouldGetFile = false;
bool updateFound = false;
if (File.Exists(path))
{
@@ -1785,19 +1806,19 @@ namespace ArdupilotMega
if (LocalVersion != WebVersion)
{
shouldGetFile = true;
updateFound = true;
}
}
else
{
shouldGetFile = true;
updateFound = true;
log.Info("File does not exist: Getting " + path);
// get it
}
response.Close();
if (shouldGetFile)
if (updateFound)
{
var dr = CustomMessageBox.Show("Update Found\n\nDo you wish to update now?", "Update Now", MessageBoxButtons.YesNo);
if (dr == DialogResult.Yes)
@@ -2173,7 +2194,7 @@ namespace ArdupilotMega
// write
MainV2.comPort.doCommand(MAVLink.MAV_CMD.PREFLIGHT_STORAGE, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
//read
///////MainV2.comPort.doCommand(MAVLink.MAV_CMD.PREFLIGHT_STORAGE, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
///////MainV2.comPort.doCommand(MAVLink09.MAV_CMD.PREFLIGHT_STORAGE, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
#else
MainV2.comPort.doAction(MAVLink.MAV_ACTION.MAV_ACTION_STORAGE_WRITE);
#endif
@@ -0,0 +1,119 @@
using System;
using System.Collections.Generic;
using System.Reactive.Subjects;
using System.Text;
using System.Runtime.InteropServices;
using System.Collections; // hashs
using System.Diagnostics; // stopwatch
using System.Reflection;
using System.Reflection.Emit;
using System.IO;
using System.Drawing;
using System.Threading;
using ArdupilotMega.Controls;
using System.ComponentModel;
using log4net;
using ArdupilotMega.Comms;
using ArdupilotMega.Utilities;
namespace ArdupilotMega
{
public interface IMAVLink
{
// there is too much message intergration in the main code, so i dont think i will pursue this any further
// if it an't broke dont fix it - mav09 and mav10 are compile time defined
// i will probly revert this change at some point, unless someone else has a good idea.
// Fields
byte[][] packets { get; set; }
double[] packetspersecond { get; set; }
Hashtable param { get; set; }
BinaryWriter rawlogfile { get; set; }
byte sysid { get; set; }
Subject<int> WhenPacketLost { get; set; }
Subject<int> WhenPacketReceived { get; set; }
PointLatLngAlt[] wps { get; set; }
ArdupilotMega.MAVLink.MAV_TYPE aptype { get; set; }
ICommsSerial BaseStream { get; set; }
int bps { get; set; }
DateTime bpstime { get; set; }
byte compid { get; set; }
bool debugmavlink { get; set; }
DateTime lastlogread { get; set; }
DateTime lastvalidpacket { get; set; }
BinaryWriter logfile { get; set; }
BinaryReader logplaybackfile { get; set; }
bool logreadmode { get; set; }
// Events
event EventHandler ParamListChanged;
// Methods
void Close();
object DebugPacket(byte[] datin);
object DebugPacket(byte[] datin, bool PrintToConsole);
object DebugPacket(byte[] datin, ref string text);
object DebugPacket(byte[] datin, ref string text, bool PrintToConsole, string delimeter = " ");
// mav 09
bool doAction(object actionid);
// mac 10
bool doCommand(ArdupilotMega.MAVLink.MAV_CMD actionid, float p1, float p2, float p3, float p4, float p5, float p6, float p7);
void setAPType();
PointLatLngAlt getFencePoint(int no, ref int total);
void getParamList();
Locationwp getWP(ushort index);
byte getWPCount();
// static void modifyParamForDisplay(bool fromapm, string paramname, ref float value);
void Open();
void Open(bool getparams);
byte[] readPacket();
void requestDatastream(byte id, byte hzrate);
void sendPacket(object indata);
bool setFencePoint(byte index, PointLatLngAlt plla, byte fencepointcount);
void setMode(string modein);
void setMountConfigure(ArdupilotMega.MAVLink.MAV_MOUNT_MODE mountmode, bool stabroll, bool stabpitch, bool stabyaw);
void setMountControl(double pa, double pb, double pc, bool islatlng);
bool setParam(string paramname, float value);
void setWP(Locationwp loc, ushort index, ArdupilotMega.MAVLink.MAV_FRAME frame, byte current);
void setWPACK();
bool setWPCurrent(ushort index);
void setWPTotal(ushort wp_total);
void stopall(bool forget);
bool Write(string line);
// Properties
IObservable<int> BytesReceived { get; }
IObservable<int> BytesSent { get; }
}
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -7,6 +7,7 @@ namespace ArdupilotMega
{
public partial class MAVLink
{
#if !MAVLINK10
enum MAV_CLASS
{
@@ -161,7 +162,6 @@ namespace ArdupilotMega
GLOBAL_RELATIVE_ALT = 3,
LOCAL_ENU = 4
};
#endif
}
}
@@ -22,14 +22,14 @@ namespace ArdupilotMega
/// <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
public static TMavlinkPacket ByteArrayToStructure<TMavlinkPacket>(this byte[] bytearray, int startoffset = 6) 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
public static TMavlinkPacket ByteArrayToStructureBigEndian<TMavlinkPacket>(this byte[] bytearray, int startoffset = 6) where TMavlinkPacket : struct
{
object newPacket = new TMavlinkPacket();
ByteArrayToStructureEndian(bytearray, ref newPacket, startoffset);
+3 -16
View File
@@ -439,20 +439,7 @@ namespace ArdupilotMega
Application.DoEvents();
switch (mine.aptype)
{
case MAVLink.MAV_TYPE.MAV_FIXED_WING:
MainV2.cs.firmware = MainV2.Firmwares.ArduPlane;
break;
case MAVLink.MAV_TYPE.MAV_QUADROTOR:
MainV2.cs.firmware = MainV2.Firmwares.ArduCopter2;
break;
case MAVLink.MAV_TYPE.MAV_GROUND:
MainV2.cs.firmware = MainV2.Firmwares.ArduRover;
break;
default:
break;
}
mine.setAPType();
writeGPX(logfile);
writeKML(logfile + ".kml");
@@ -830,10 +817,10 @@ namespace ArdupilotMega
string code = @"
public double stage(object inp) {
return getAltAboveHome((MAVLink.mavlink_gps_raw_t) inp);
return getAltAboveHome((MAVLink09.mavlink_gps_raw_t) inp);
}
public double getAltAboveHome(MAVLink.mavlink_gps_raw_t gps)
public double getAltAboveHome(MAVLink09.mavlink_gps_raw_t gps)
{
if (customforusenumber == -1 && gps.fix_type != 2)
customforusenumber = gps.alt;
+8 -1
View File
@@ -43,7 +43,14 @@ namespace ArdupilotMega
//Console.WriteLine(srtm.getAltitude(-35.115676879882812, 117.94178754638671,20));
//return;
PointLatLngAlt plla = new PointLatLngAlt(54.0359, 5.4253, 0, "");
PointLatLngAlt plla2 = new PointLatLngAlt(54.3838, 3.0412, 0, "");
Console.WriteLine(plla.GetDistance(plla2));
Console.WriteLine(plla.GetDistance2(plla2));
if (System.Diagnostics.Debugger.IsAttached)
{
@@ -34,5 +34,5 @@ using System.Resources;
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.*")]
[assembly: AssemblyFileVersion("1.1.86")]
[assembly: AssemblyFileVersion("1.1.87")]
[assembly: NeutralResourcesLanguageAttribute("")]
+10 -15
View File
@@ -25,8 +25,6 @@ namespace ArdupilotMega
int tickStart = 0;
MAVLink comPort = new MAVLink();
public RAW_Sensor()
{
InitializeComponent();
@@ -141,7 +139,7 @@ namespace ArdupilotMega
private void timer2serial_Tick(object sender, EventArgs e)
{
if (!comPort.BaseStream.IsOpen && !MainV2.comPort.logreadmode)
if (!MainV2.comPort.BaseStream.IsOpen && !MainV2.comPort.logreadmode)
return;
//Console.WriteLine(DateTime.Now.Millisecond + " timer2 serial");
@@ -208,7 +206,7 @@ namespace ArdupilotMega
private void ACM_Setup_FormClosed(object sender, FormClosedEventArgs e)
{
if (comPort != null && comPort.BaseStream.IsOpen)
if (MainV2.comPort != null && MainV2.comPort.BaseStream.IsOpen)
{
try
{
@@ -225,9 +223,7 @@ namespace ArdupilotMega
{
try
{
comPort = MainV2.comPort;
if (!comPort.BaseStream.IsOpen && !MainV2.comPort.logreadmode)
if (!MainV2.comPort.BaseStream.IsOpen && !MainV2.comPort.logreadmode)
{
CustomMessageBox.Show("Please connect first");
this.Close();
@@ -237,13 +233,12 @@ namespace ArdupilotMega
//comPort.Open();
//comPort.stopall(true); // ensure off
Console.WriteLine("Req streams {0} {1}", comPort.bps, DateTime.Now);
//comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.EXTENDED_STATUS, 0); // mode gps raw
//comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.POSITION, 3); // request location
//comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.EXTRA1, 3); // request attitude
//comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.EXTRA2, 3); // request vfr
comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.RAW_SENSORS, MainV2.cs.ratesensors); // request raw sensor
//comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.RC_CHANNELS, 3); // request rc info
//comPort.requestDatastream((byte)ArdupilotMega.MAVLink09.MAV_DATA_STREAM.EXTENDED_STATUS, 0); // mode gps raw
//comPort.requestDatastream((byte)ArdupilotMega.MAVLink09.MAV_DATA_STREAM.POSITION, 3); // request location
//comPort.requestDatastream((byte)ArdupilotMega.MAVLink09.MAV_DATA_STREAM.EXTRA1, 3); // request attitude
//comPort.requestDatastream((byte)ArdupilotMega.MAVLink09.MAV_DATA_STREAM.EXTRA2, 3); // request vfr
MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.RAW_SENSORS, MainV2.cs.ratesensors); // request raw sensor
//comPort.requestDatastream((byte)ArdupilotMega.MAVLink09.MAV_DATA_STREAM.RC_CHANNELS, 3); // request rc info
}
catch
{
@@ -256,7 +251,7 @@ namespace ArdupilotMega
private void CMB_rawupdaterate_SelectedIndexChanged(object sender, EventArgs e)
{
MainV2.cs.ratesensors = (byte)int.Parse(CMB_rawupdaterate.Text);
comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.RAW_SENSORS, (byte)int.Parse(CMB_rawupdaterate.Text)); // request raw sensor
MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.RAW_SENSORS, (byte)int.Parse(CMB_rawupdaterate.Text)); // request raw sensor
}
System.IO.StreamWriter sw = null;
+3 -3
View File
@@ -37,7 +37,7 @@ namespace ArdupilotMega
// setup netid
S3.DataSource = Enumerable.Range(0, 500).ToArray();
RS3.DataSource = S3.DataSource;
RS3.DataSource = Enumerable.Range(0, 500).ToArray();
}
bool getFirmware(uploader.Uploader.Code device)
@@ -515,7 +515,7 @@ namespace ArdupilotMega
}
// remote
foreach (Control ctl in this.Controls)
foreach (Control ctl in groupBox2.Controls)
{
if (ctl.Name.StartsWith("RS") && ctl.Name != "RSSI")
ctl.ResetText();
@@ -553,7 +553,7 @@ namespace ArdupilotMega
}
else if (controls[0].GetType() == typeof(ComboBox))
{
((ComboBox)controls[0]).SelectedText = values[2].Trim();
((ComboBox)controls[0]).Text = values[2].Trim();
}
}
else
@@ -1799,7 +1799,7 @@ which result in a valid packet CRC
<value>BUT_savesettings</value>
</data>
<data name="&gt;&gt;BUT_savesettings.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4519.35885, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, 3DRRadio, Version=0.6.4521.12642, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_savesettings.Parent" xml:space="preserve">
<value>$this</value>
@@ -1823,7 +1823,7 @@ which result in a valid packet CRC
<value>BUT_getcurrent</value>
</data>
<data name="&gt;&gt;BUT_getcurrent.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4519.35885, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, 3DRRadio, Version=0.6.4521.12642, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_getcurrent.Parent" xml:space="preserve">
<value>$this</value>
@@ -1868,7 +1868,7 @@ which result in a valid packet CRC
<value>BUT_upload</value>
</data>
<data name="&gt;&gt;BUT_upload.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4519.35885, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, 3DRRadio, Version=0.6.4521.12642, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_upload.Parent" xml:space="preserve">
<value>$this</value>
@@ -2559,7 +2559,7 @@ which result in a valid packet CRC
<value>NoControl</value>
</data>
<data name="BUT_Syncoptions.Location" type="System.Drawing.Point, System.Drawing">
<value>338, 355</value>
<value>346, 355</value>
</data>
<data name="BUT_Syncoptions.Size" type="System.Drawing.Size, System.Drawing">
<value>102, 29</value>
@@ -2574,7 +2574,7 @@ which result in a valid packet CRC
<value>BUT_Syncoptions</value>
</data>
<data name="&gt;&gt;BUT_Syncoptions.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4519.35885, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, 3DRRadio, Version=0.6.4521.12642, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_Syncoptions.Parent" xml:space="preserve">
<value>$this</value>
@@ -2700,6 +2700,6 @@ which result in a valid packet CRC
<value>_3DRradio</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.BackstageView.BackStageViewContentPanel, ArdupilotMegaPlanner, Version=1.1.4519.35885, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.BackstageView.BackStageViewContentPanel, 3DRRadio, Version=0.6.4521.12642, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>
@@ -0,0 +1,78 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AForge;
using AForge.Video;
using AForge.Video.DirectShow;
namespace ArdupilotMega.Utilities
{
public class Video
{
private static FilterInfoCollection videoDevices;
private static AsyncVideoSource asyncSource;
public static bool isRunning { get { if (asyncSource == null) return false; return asyncSource.IsRunning; } }
public static List<string> getDevices()
{
List<string> list = new List<string>();
// Get the collection of video devices
videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
foreach (FilterInfo dev in videoDevices)
{
list.Add(dev.Name);
}
return list;
}
public static void Start(VideoCaptureDevice videoSource)
{
videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
//VideoCaptureDevice videoSource = new VideoCaptureDevice(videoDevices[Device].MonikerString);
videoSource.DesiredFrameRate = 25;
asyncSource = new AsyncVideoSource(videoSource, true);
asyncSource.NewFrame += new NewFrameEventHandler(asyncSource_NewFrame);
asyncSource.Start();
}
static void asyncSource_NewFrame(object sender, NewFrameEventArgs eventArgs)
{
//GCSViews.FlightData.cam_camimage(eventArgs.Frame);
if (MainV2.instance.IsDisposed)
Dispose();
}
public static void Stop()
{
Dispose();
}
/// <summary> release everything. </summary>
public static void Dispose()
{
try
{
asyncSource.Stop();
asyncSource = null;
}
catch { }
asyncSource_NewFrame(null, new NewFrameEventArgs(null));
}
~Video()
{
Dispose();
}
}
}
+4 -2
View File
@@ -301,8 +301,10 @@ data = @"
foreach (string filepath in files)
{
if (filepath.ToLower().EndsWith("release\\config.xml") || filepath.ToLower().Contains("ardupilotplanner.log") || filepath.ToLower().Contains("dataflash.bin") || filepath.ToLower().Contains(".etag"))
if (filepath.ToLower().EndsWith("release\\config.xml") || filepath.ToLower().Contains("ardupilotplanner.log") ||
filepath.ToLower().Contains("dataflash.bin") || filepath.ToLower().Contains(".etag"))
continue;
no++;
@@ -320,7 +322,7 @@ data = @"
foreach (string dir in dirs)
{
if (dir.EndsWith("gmapcache") || dir.EndsWith("srtm"))
if (dir.ToLower().EndsWith("gmapcache") || dir.ToLower().EndsWith("srtm") || dir.ToLower().EndsWith("logs"))
continue;
dodirectory(dir);
}