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 2012-05-20 13:54:35 +08:00
parent f8ceec2b4b
commit 512c46a86a
44 changed files with 7908 additions and 459 deletions

View File

@ -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

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();

View File

@ -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>

View File

@ -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")]

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();
}
}
}

View File

@ -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"); }
}

View File

@ -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>

View File

@ -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>

View File

@ -203,7 +203,7 @@ namespace ArdupilotMega
float alpha = ((desired_lead_dist * (float)m2pixelwidth) / MainV2.cs.radius) * rad2deg;
if (MainV2.cs.radius < 0)
if (MainV2.cs.radius < -1)
{
// fixme
@ -215,7 +215,7 @@ namespace ArdupilotMega
}
else
else if (MainV2.cs.radius > 1)
{
// correct
@ -295,6 +295,9 @@ namespace ArdupilotMega
public string Tag = "";
public Color color = Color.White;
const float rad2deg = (float)(180 / Math.PI);
const float deg2rad = (float)(1.0 / rad2deg);
public PointLatLngAlt(double lat, double lng, double alt, string tag)
{
this.Lat = lat;
@ -378,7 +381,24 @@ namespace ArdupilotMega
double num6 = num3 - d;
double num7 = Math.Pow(Math.Sin(num6 / 2.0), 2.0) + ((Math.Cos(d) * Math.Cos(num3)) * Math.Pow(Math.Sin(num5 / 2.0), 2.0));
double num8 = 2.0 * Math.Atan2(Math.Sqrt(num7), Math.Sqrt(1.0 - num7));
return (6378.137 * num8) * 1000; // M
return (6371 * num8) * 1000.0; // M
}
public double GetDistance2(PointLatLngAlt p2)
{
//http://www.movable-type.co.uk/scripts/latlong.html
var R = 6371; // 6371 km
var dLat = (p2.Lat - Lat) * deg2rad;
var dLon = (p2.Lng - Lng) * deg2rad;
var lat1 = Lat * deg2rad;
var lat2 = p2.Lat * deg2rad;
var a = Math.Sin(dLat / 2) * Math.Sin(dLat / 2) +
Math.Sin(dLon / 2) * Math.Sin(dLon / 2) * Math.Cos(lat1) * Math.Cos(lat2);
var c = 2.0 * Math.Atan2(Math.Sqrt(a), Math.Sqrt(1 - a));
var d = R * c * 1000.0; // M
return d;
}
}
@ -587,188 +607,6 @@ namespace ArdupilotMega
//Console.ReadLine();
}
#if MAVLINK10
public static bool translateMode(string modein, ref MAVLink.mavlink_set_mode_t mode)
{
//MAVLink.mavlink_set_mode_t mode = new MAVLink.mavlink_set_mode_t();
mode.target_system = MainV2.comPort.sysid;
try
{
if (Common.getModes() == typeof(Common.apmmodes))
{
switch (EnumTranslator.GetValue<Common.apmmodes>(modein))
{
case (int)Common.apmmodes.MANUAL:
case (int)Common.apmmodes.CIRCLE:
case (int)Common.apmmodes.STABILIZE:
case (int)Common.apmmodes.AUTO:
case (int)Common.apmmodes.RTL:
case (int)Common.apmmodes.LOITER:
case (int)Common.apmmodes.FLY_BY_WIRE_A:
case (int)Common.apmmodes.FLY_BY_WIRE_B:
mode.base_mode = (byte)MAVLink.MAV_MODE_FLAG.CUSTOM_MODE_ENABLED;
mode.custom_mode = (uint)EnumTranslator.GetValue<Common.apmmodes>(modein);
break;
default:
MessageBox.Show("No Mode Changed " + modein);
return false;
}
}
else if (Common.getModes() == typeof(Common.ac2modes))
{
switch (EnumTranslator.GetValue<Common.ac2modes>(modein))
{
case (int)Common.ac2modes.STABILIZE:
case (int)Common.ac2modes.AUTO:
case (int)Common.ac2modes.RTL:
case (int)Common.ac2modes.LOITER:
case (int)Common.ac2modes.ACRO:
case (int)Common.ac2modes.ALT_HOLD:
case (int)Common.ac2modes.CIRCLE:
case (int)Common.ac2modes.POSITION:
mode.base_mode = (byte)MAVLink.MAV_MODE_FLAG.CUSTOM_MODE_ENABLED;
mode.custom_mode = (uint)EnumTranslator.GetValue<Common.ac2modes>(modein);
break;
default:
MessageBox.Show("No Mode Changed " + modein);
return false;
}
}
}
catch { System.Windows.Forms.MessageBox.Show("Failed to find Mode"); return false; }
return true;
}
#else
public static bool translateMode(string modein, ref MAVLink.mavlink_set_nav_mode_t navmode, ref MAVLink.mavlink_set_mode_t mode)
{
//MAVLink.mavlink_set_nav_mode_t navmode = new MAVLink.mavlink_set_nav_mode_t();
navmode.target = MainV2.comPort.sysid;
navmode.nav_mode = 255;
//MAVLink.mavlink_set_mode_t mode = new MAVLink.mavlink_set_mode_t();
mode.target = MainV2.comPort.sysid;
try
{
if (Common.getModes() == typeof(Common.apmmodes))
{
switch (EnumTranslator.GetValue<Common.apmmodes>(modein))
{
case (int)Common.apmmodes.MANUAL:
mode.mode = (byte)MAVLink.MAV_MODE.MAV_MODE_MANUAL;
break;
case (int)Common.apmmodes.GUIDED:
mode.mode = (byte)MAVLink.MAV_MODE.MAV_MODE_GUIDED;
break;
case (int)Common.apmmodes.STABILIZE:
mode.mode = (byte)MAVLink.MAV_MODE.MAV_MODE_TEST1;
break;
// AUTO MODES
case (int)Common.apmmodes.AUTO:
navmode.nav_mode = (byte)MAVLink.MAV_NAV.MAV_NAV_WAYPOINT;
mode.mode = (byte)MAVLink.MAV_MODE.MAV_MODE_AUTO;
break;
case (int)Common.apmmodes.RTL:
navmode.nav_mode = (byte)MAVLink.MAV_NAV.MAV_NAV_RETURNING;
mode.mode = (byte)MAVLink.MAV_MODE.MAV_MODE_AUTO;
break;
case (int)Common.apmmodes.LOITER:
navmode.nav_mode = (byte)MAVLink.MAV_NAV.MAV_NAV_LOITER;
mode.mode = (byte)MAVLink.MAV_MODE.MAV_MODE_AUTO;
break;
// FBW
case (int)Common.apmmodes.FLY_BY_WIRE_A:
navmode.nav_mode = (byte)1;
mode.mode = (byte)MAVLink.MAV_MODE.MAV_MODE_TEST2;
break;
case (int)Common.apmmodes.FLY_BY_WIRE_B:
navmode.nav_mode = (byte)2;
mode.mode = (byte)MAVLink.MAV_MODE.MAV_MODE_TEST2;
break;
default:
CustomMessageBox.Show("No Mode Changed " + modein);
return false;
}
}
else if (Common.getModes() == typeof(Common.aprovermodes))
{
switch (EnumTranslator.GetValue<Common.aprovermodes>(modein))
{
case (int)Common.aprovermodes.MANUAL:
mode.mode = (byte)MAVLink.MAV_MODE.MAV_MODE_MANUAL;
break;
case (int)Common.aprovermodes.GUIDED:
mode.mode = (byte)MAVLink.MAV_MODE.MAV_MODE_GUIDED;
break;
case (int)Common.aprovermodes.LEARNING:
mode.mode = (byte)MAVLink.MAV_MODE.MAV_MODE_TEST1;
break;
// AUTO MODES
case (int)Common.aprovermodes.AUTO:
navmode.nav_mode = (byte)MAVLink.MAV_NAV.MAV_NAV_WAYPOINT;
mode.mode = (byte)MAVLink.MAV_MODE.MAV_MODE_AUTO;
break;
case (int)Common.aprovermodes.RTL:
navmode.nav_mode = (byte)MAVLink.MAV_NAV.MAV_NAV_RETURNING;
mode.mode = (byte)MAVLink.MAV_MODE.MAV_MODE_AUTO;
break;
case (int)Common.aprovermodes.LOITER:
navmode.nav_mode = (byte)MAVLink.MAV_NAV.MAV_NAV_LOITER;
mode.mode = (byte)MAVLink.MAV_MODE.MAV_MODE_AUTO;
break;
// FBW
case (int)Common.aprovermodes.FLY_BY_WIRE_A:
navmode.nav_mode = (byte)1;
mode.mode = (byte)MAVLink.MAV_MODE.MAV_MODE_TEST2;
break;
case (int)Common.aprovermodes.FLY_BY_WIRE_B:
navmode.nav_mode = (byte)2;
mode.mode = (byte)MAVLink.MAV_MODE.MAV_MODE_TEST2;
break;
default:
CustomMessageBox.Show("No Mode Changed " + modein);
return false;
}
}
else if (Common.getModes() == typeof(Common.ac2modes))
{
switch (EnumTranslator.GetValue<Common.ac2modes>(modein))
{
case (int)Common.ac2modes.GUIDED:
mode.mode = (byte)MAVLink.MAV_MODE.MAV_MODE_GUIDED;
break;
case (int)Common.ac2modes.STABILIZE:
mode.mode = (byte)MAVLink.MAV_MODE.MAV_MODE_MANUAL;
break;
// AUTO MODES
case (int)Common.ac2modes.AUTO:
navmode.nav_mode = (byte)MAVLink.MAV_NAV.MAV_NAV_WAYPOINT;
mode.mode = (byte)MAVLink.MAV_MODE.MAV_MODE_AUTO;
break;
case (int)Common.ac2modes.RTL:
navmode.nav_mode = (byte)MAVLink.MAV_NAV.MAV_NAV_RETURNING;
mode.mode = (byte)MAVLink.MAV_MODE.MAV_MODE_AUTO;
break;
case (int)Common.ac2modes.LOITER:
navmode.nav_mode = (byte)MAVLink.MAV_NAV.MAV_NAV_LOITER;
mode.mode = (byte)MAVLink.MAV_MODE.MAV_MODE_AUTO;
break;
default:
CustomMessageBox.Show("No Mode Changed " + modein);
return false;
}
}
}
catch { System.Windows.Forms.CustomMessageBox.Show("Failed to find Mode"); return false; }
return true;
}
#endif

View File

@ -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; }
}
}

View File

@ -135,6 +135,7 @@ namespace ArdupilotMega.Controls.BackstageView
this.Invalidate();
}
/*
// This IS necessary for transparency - windows only..... remove it
protected override CreateParams CreateParams

View File

@ -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;

View File

@ -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));

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
{

View File

@ -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;
}
}

View File

@ -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());
}
}

View File

@ -135,13 +135,13 @@
<value>myLabel3</value>
</data>
<data name="&gt;&gt;myLabel3.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4498.24834, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4523.24267, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;myLabel3.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;myLabel3.ZOrder" xml:space="preserve">
<value>1</value>
<value>2</value>
</data>
<data name="TUNE_LOW.Location" type="System.Drawing.Point, System.Drawing">
<value>575, 305</value>
@ -162,7 +162,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;TUNE_LOW.ZOrder" xml:space="preserve">
<value>2</value>
<value>3</value>
</data>
<data name="TUNE_HIGH.Location" type="System.Drawing.Point, System.Drawing">
<value>665, 305</value>
@ -183,7 +183,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;TUNE_HIGH.ZOrder" xml:space="preserve">
<value>3</value>
<value>4</value>
</data>
<data name="myLabel2.Location" type="System.Drawing.Point, System.Drawing">
<value>540, 277</value>
@ -201,13 +201,13 @@
<value>myLabel2</value>
</data>
<data name="&gt;&gt;myLabel2.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4498.24834, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4523.24267, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;myLabel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;myLabel2.ZOrder" xml:space="preserve">
<value>4</value>
<value>5</value>
</data>
<data name="TUNE.Items" xml:space="preserve">
<value>CH6_NONE</value>
@ -294,7 +294,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;TUNE.ZOrder" xml:space="preserve">
<value>5</value>
<value>6</value>
</data>
<data name="myLabel1.Location" type="System.Drawing.Point, System.Drawing">
<value>540, 329</value>
@ -312,13 +312,13 @@
<value>myLabel1</value>
</data>
<data name="&gt;&gt;myLabel1.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4498.24834, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4523.24267, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;myLabel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;myLabel1.ZOrder" xml:space="preserve">
<value>6</value>
<value>7</value>
</data>
<data name="CH7_OPT.Items" xml:space="preserve">
<value>Do Nothing</value>
@ -363,7 +363,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;CH7_OPT.ZOrder" xml:space="preserve">
<value>7</value>
<value>8</value>
</data>
<data name="THR_RATE_D.Location" type="System.Drawing.Point, System.Drawing">
<value>80, 60</value>
@ -580,7 +580,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox5.ZOrder" xml:space="preserve">
<value>8</value>
<value>9</value>
</data>
<data name="CHK_lockrollpitch.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -610,7 +610,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;CHK_lockrollpitch.ZOrder" xml:space="preserve">
<value>9</value>
<value>10</value>
</data>
<data name="NAV_LAT_D.Location" type="System.Drawing.Point, System.Drawing">
<value>80, 60</value>
@ -874,7 +874,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox4.ZOrder" xml:space="preserve">
<value>10</value>
<value>11</value>
</data>
<data name="XTRK_GAIN_SC1.Location" type="System.Drawing.Point, System.Drawing">
<value>80, 13</value>
@ -946,7 +946,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox6.ZOrder" xml:space="preserve">
<value>11</value>
<value>12</value>
</data>
<data name="THR_ALT_IMAX.Location" type="System.Drawing.Point, System.Drawing">
<value>80, 63</value>
@ -1114,7 +1114,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox7.ZOrder" xml:space="preserve">
<value>12</value>
<value>13</value>
</data>
<data name="HLD_LAT_IMAX.Location" type="System.Drawing.Point, System.Drawing">
<value>80, 61</value>
@ -1282,7 +1282,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox19.ZOrder" xml:space="preserve">
<value>13</value>
<value>14</value>
</data>
<data name="STB_YAW_IMAX.Location" type="System.Drawing.Point, System.Drawing">
<value>80, 63</value>
@ -1450,7 +1450,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox20.ZOrder" xml:space="preserve">
<value>14</value>
<value>15</value>
</data>
<data name="STAB_D.Location" type="System.Drawing.Point, System.Drawing">
<value>80, 88</value>
@ -1666,7 +1666,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox21.ZOrder" xml:space="preserve">
<value>15</value>
<value>16</value>
</data>
<data name="STB_RLL_IMAX.Location" type="System.Drawing.Point, System.Drawing">
<value>80, 63</value>
@ -1834,7 +1834,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox22.ZOrder" xml:space="preserve">
<value>16</value>
<value>17</value>
</data>
<data name="RATE_YAW_D.Location" type="System.Drawing.Point, System.Drawing">
<value>80, 60</value>
@ -2050,7 +2050,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox23.ZOrder" xml:space="preserve">
<value>17</value>
<value>18</value>
</data>
<data name="RATE_PIT_D.Location" type="System.Drawing.Point, System.Drawing">
<value>80, 60</value>
@ -2266,7 +2266,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox24.ZOrder" xml:space="preserve">
<value>18</value>
<value>19</value>
</data>
<data name="RATE_RLL_D.Location" type="System.Drawing.Point, System.Drawing">
<value>80, 60</value>
@ -2482,19 +2482,16 @@
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox25.ZOrder" xml:space="preserve">
<value>19</value>
<value>20</value>
</data>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="BUT_writePIDS.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="BUT_writePIDS.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="BUT_writePIDS.Location" type="System.Drawing.Point, System.Drawing">
<value>305, 383</value>
<value>255, 383</value>
</data>
<data name="BUT_writePIDS.Size" type="System.Drawing.Size, System.Drawing">
<value>103, 19</value>
@ -2509,12 +2506,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>364, 383</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>74</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">
@ -2527,7 +2554,7 @@
<value>True</value>
</data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>728, 529</value>
<value>728, 411</value>
</data>
<data name="&gt;&gt;toolTip1.Name" xml:space="preserve">
<value>toolTip1</value>
@ -2539,6 +2566,6 @@
<value>ConfigArducopter</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>

View File

@ -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;
}
}

View File

@ -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());
}
}
}

View File

@ -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>

View File

@ -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;
}
}

View File

@ -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());
}
}
}

View File

@ -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>

View File

@ -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!!");
}
}

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;
}
}

View File

@ -24,7 +24,7 @@ namespace ArdupilotMega.GCSViews
{
partial class FlightData : MyUserControl
{
ArdupilotMega.MAVLink comPort = MainV2.comPort;
ArdupilotMega.IMAVLink comPort = MainV2.comPort;
public static int threadrun = 0;
StreamWriter swlog;
int tickStart = 0;
@ -77,7 +77,7 @@ namespace ArdupilotMega.GCSViews
public static GMapControl mymap = null;
bool playingLog = false;
double LogPlayBackSpeed = 1.0;
public static PointLatLngAlt GuidedModeWP = new PointLatLngAlt();
@ -126,7 +126,7 @@ namespace ArdupilotMega.GCSViews
List<string> list = new List<string>();
//foreach (object obj in Enum.GetValues(typeof(MAVLink.MAV_ACTION)))
//foreach (object obj in Enum.GetValues(typeof(MAVLink09.MAV_ACTION)))
#if MAVLINK10
{
list.Add("LOITER_UNLIM");
@ -280,7 +280,7 @@ namespace ArdupilotMega.GCSViews
{
//System.Threading.Thread.Sleep(1000);
//comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.RAW_CONTROLLER, 0); // request servoout
//comPort.requestDatastream((byte)ArdupilotMega.MAVLink09.MAV_DATA_STREAM.RAW_CONTROLLER, 0); // request servoout
comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.EXTENDED_STATUS, MainV2.cs.ratestatus); // mode
comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.POSITION, MainV2.cs.rateposition); // request gps
comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.EXTRA1, MainV2.cs.rateattitude); // request attitude
@ -319,20 +319,7 @@ namespace ArdupilotMega.GCSViews
updatePlayPauseButton(true);
switch (comPort.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;
}
MainV2.comPort.setAPType();
if (comPort.BaseStream.IsOpen)
{
@ -356,9 +343,11 @@ namespace ArdupilotMega.GCSViews
act = 0;
int ts = 0;
if (LogPlayBackSpeed == 0)
LogPlayBackSpeed = 0.01;
try
{
ts = (int)(act / (double)NUM_playbackspeed.Value);
ts = (int) Math.Min((act / LogPlayBackSpeed),1000);
}
catch { }
if (ts > 0)
@ -509,7 +498,6 @@ namespace ArdupilotMega.GCSViews
{
PointLatLng currentloc = new PointLatLng(MainV2.cs.lat, MainV2.cs.lng);
if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane)
{
routes.Markers.Add(new GMapMarkerPlane(currentloc, MainV2.cs.yaw, MainV2.cs.groundcourse, MainV2.cs.nav_bearing, MainV2.cs.target_bearing, gMapControl1));
@ -864,11 +852,11 @@ namespace ArdupilotMega.GCSViews
{
((Button)sender).Enabled = false;
//comPort.doAction(MAVLink.MAV_ACTION.MAV_ACTION_RETURN); // set nav from
//comPort.doAction(MAVLink09.MAV_ACTION.MAV_ACTION_RETURN); // set nav from
//System.Threading.Thread.Sleep(100);
comPort.setWPCurrent(1); // set nav to
//System.Threading.Thread.Sleep(100);
//comPort.doAction(MAVLink.MAV_ACTION.MAV_ACTION_SET_AUTO); // set auto
//comPort.doAction(MAVLink09.MAV_ACTION.MAV_ACTION_SET_AUTO); // set auto
}
catch { CustomMessageBox.Show("The command failed to execute"); }
((Button)sender).Enabled = true;
@ -1139,7 +1127,33 @@ namespace ArdupilotMega.GCSViews
private void tabPage1_Resize(object sender, EventArgs e)
{
int mywidth;
int mywidth, myheight;
float scale = tabGauges.Width / (float)tabGauges.Height;
if (scale > 0.5 && scale < 1.9)
{// square
Gvspeed.Visible = true;
if (tabGauges.Height < tabGauges.Width)
myheight = tabGauges.Height / 2;
else
myheight = tabGauges.Width / 2;
Gvspeed.Height = myheight;
Gspeed.Height = myheight;
Galt.Height = myheight;
Gheading.Height = myheight;
Gvspeed.Location = new Point(0, 0);
Gspeed.Location = new Point(Gvspeed.Right, 0);
Galt.Location = new Point(0, Gspeed.Bottom);
Gheading.Location = new Point(Galt.Right, Gspeed.Bottom);
return;
}
if (tabGauges.Width < 500)
{
@ -1448,7 +1462,7 @@ namespace ArdupilotMega.GCSViews
aviwriter = null;
}
void setupPropertyInfo(ref System.Reflection.PropertyInfo input, string name, object source)
bool setupPropertyInfo(ref System.Reflection.PropertyInfo input, string name, object source)
{
Type test = source.GetType();
@ -1457,11 +1471,11 @@ namespace ArdupilotMega.GCSViews
if (field.Name == name)
{
input = field;
return;
return true;
}
}
return false;
}
private void zg1_DoubleClick(object sender, EventArgs e)
@ -1575,53 +1589,53 @@ namespace ArdupilotMega.GCSViews
{
if (list1item == null)
{
setupPropertyInfo(ref list1item, ((CheckBox)sender).Name, MainV2.cs);
list1curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list1, Color.Red, SymbolType.None);
if (setupPropertyInfo(ref list1item, ((CheckBox)sender).Name, MainV2.cs))
list1curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list1, Color.Red, SymbolType.None);
}
else if (list2item == null)
{
setupPropertyInfo(ref list2item, ((CheckBox)sender).Name, MainV2.cs);
list2curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list2, Color.Blue, SymbolType.None);
if (setupPropertyInfo(ref list2item, ((CheckBox)sender).Name, MainV2.cs))
list2curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list2, Color.Blue, SymbolType.None);
}
else if (list3item == null)
{
setupPropertyInfo(ref list3item, ((CheckBox)sender).Name, MainV2.cs);
list3curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list3, Color.Green, SymbolType.None);
if (setupPropertyInfo(ref list3item, ((CheckBox)sender).Name, MainV2.cs))
list3curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list3, Color.Green, SymbolType.None);
}
else if (list4item == null)
{
setupPropertyInfo(ref list4item, ((CheckBox)sender).Name, MainV2.cs);
list4curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list4, Color.Orange, SymbolType.None);
if (setupPropertyInfo(ref list4item, ((CheckBox)sender).Name, MainV2.cs))
list4curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list4, Color.Orange, SymbolType.None);
}
else if (list5item == null)
{
setupPropertyInfo(ref list5item, ((CheckBox)sender).Name, MainV2.cs);
list5curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list5, Color.Yellow, SymbolType.None);
if (setupPropertyInfo(ref list5item, ((CheckBox)sender).Name, MainV2.cs))
list5curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list5, Color.Yellow, SymbolType.None);
}
else if (list6item == null)
{
setupPropertyInfo(ref list6item, ((CheckBox)sender).Name, MainV2.cs);
list6curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list6, Color.Magenta, SymbolType.None);
if (setupPropertyInfo(ref list6item, ((CheckBox)sender).Name, MainV2.cs))
list6curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list6, Color.Magenta, SymbolType.None);
}
else if (list7item == null)
{
setupPropertyInfo(ref list7item, ((CheckBox)sender).Name, MainV2.cs);
list7curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list7, Color.Purple, SymbolType.None);
if (setupPropertyInfo(ref list7item, ((CheckBox)sender).Name, MainV2.cs))
list7curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list7, Color.Purple, SymbolType.None);
}
else if (list8item == null)
{
setupPropertyInfo(ref list8item, ((CheckBox)sender).Name, MainV2.cs);
list8curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list8, Color.LimeGreen, SymbolType.None);
if (setupPropertyInfo(ref list8item, ((CheckBox)sender).Name, MainV2.cs))
list8curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list8, Color.LimeGreen, SymbolType.None);
}
else if (list9item == null)
{
setupPropertyInfo(ref list9item, ((CheckBox)sender).Name, MainV2.cs);
list9curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list9, Color.Cyan, SymbolType.None);
if (setupPropertyInfo(ref list9item, ((CheckBox)sender).Name, MainV2.cs))
list9curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list9, Color.Cyan, SymbolType.None);
}
else if (list10item == null)
{
setupPropertyInfo(ref list10item, ((CheckBox)sender).Name, MainV2.cs);
list10curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list10, Color.Violet, SymbolType.None);
if (setupPropertyInfo(ref list10item, ((CheckBox)sender).Name, MainV2.cs))
list10curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list10, Color.Violet, SymbolType.None);
}
else
{
@ -1843,5 +1857,11 @@ print 'Roll complete'
{
MainV2.config["CHK_autopan"] = CHK_autopan.Checked.ToString();
}
private void NUM_playbackspeed_Scroll(object sender, EventArgs e)
{
LogPlayBackSpeed = NUM_playbackspeed.Value;
lbl_playbackspeed.Text = "x " + LogPlayBackSpeed;
}
}
}

View File

@ -208,7 +208,7 @@
<value>hud1</value>
</data>
<data name="&gt;&gt;hud1.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.HUD, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.HUD, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;hud1.Parent" xml:space="preserve">
<value>SubMainLeft.Panel1</value>
@ -247,7 +247,7 @@
<value>BUT_script</value>
</data>
<data name="&gt;&gt;BUT_script.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_script.Parent" xml:space="preserve">
<value>tabActions</value>
@ -280,7 +280,7 @@
<value>BUT_joystick</value>
</data>
<data name="&gt;&gt;BUT_joystick.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_joystick.Parent" xml:space="preserve">
<value>tabActions</value>
@ -310,7 +310,7 @@
<value>BUT_quickmanual</value>
</data>
<data name="&gt;&gt;BUT_quickmanual.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_quickmanual.Parent" xml:space="preserve">
<value>tabActions</value>
@ -340,7 +340,7 @@
<value>BUT_quickrtl</value>
</data>
<data name="&gt;&gt;BUT_quickrtl.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_quickrtl.Parent" xml:space="preserve">
<value>tabActions</value>
@ -370,7 +370,7 @@
<value>BUT_quickauto</value>
</data>
<data name="&gt;&gt;BUT_quickauto.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_quickauto.Parent" xml:space="preserve">
<value>tabActions</value>
@ -424,7 +424,7 @@
<value>BUT_setwp</value>
</data>
<data name="&gt;&gt;BUT_setwp.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_setwp.Parent" xml:space="preserve">
<value>tabActions</value>
@ -475,7 +475,7 @@
<value>BUT_setmode</value>
</data>
<data name="&gt;&gt;BUT_setmode.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_setmode.Parent" xml:space="preserve">
<value>tabActions</value>
@ -505,7 +505,7 @@
<value>BUT_clear_track</value>
</data>
<data name="&gt;&gt;BUT_clear_track.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_clear_track.Parent" xml:space="preserve">
<value>tabActions</value>
@ -556,7 +556,7 @@
<value>BUT_Homealt</value>
</data>
<data name="&gt;&gt;BUT_Homealt.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_Homealt.Parent" xml:space="preserve">
<value>tabActions</value>
@ -586,7 +586,7 @@
<value>BUT_RAWSensor</value>
</data>
<data name="&gt;&gt;BUT_RAWSensor.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_RAWSensor.Parent" xml:space="preserve">
<value>tabActions</value>
@ -616,7 +616,7 @@
<value>BUTrestartmission</value>
</data>
<data name="&gt;&gt;BUTrestartmission.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUTrestartmission.Parent" xml:space="preserve">
<value>tabActions</value>
@ -646,7 +646,7 @@
<value>BUTactiondo</value>
</data>
<data name="&gt;&gt;BUTactiondo.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUTactiondo.Parent" xml:space="preserve">
<value>tabActions</value>
@ -700,7 +700,7 @@
<value>Gvspeed</value>
</data>
<data name="&gt;&gt;Gvspeed.Type" xml:space="preserve">
<value>AGaugeApp.AGauge, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>AGaugeApp.AGauge, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;Gvspeed.Parent" xml:space="preserve">
<value>tabGauges</value>
@ -730,7 +730,7 @@
<value>Gheading</value>
</data>
<data name="&gt;&gt;Gheading.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.HSI, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.HSI, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;Gheading.Parent" xml:space="preserve">
<value>tabGauges</value>
@ -760,7 +760,7 @@
<value>Galt</value>
</data>
<data name="&gt;&gt;Galt.Type" xml:space="preserve">
<value>AGaugeApp.AGauge, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>AGaugeApp.AGauge, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;Galt.Parent" xml:space="preserve">
<value>tabGauges</value>
@ -793,7 +793,7 @@
<value>Gspeed</value>
</data>
<data name="&gt;&gt;Gspeed.Type" xml:space="preserve">
<value>AGaugeApp.AGauge, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>AGaugeApp.AGauge, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;Gspeed.Parent" xml:space="preserve">
<value>tabGauges</value>
@ -858,6 +858,33 @@
<data name="&gt;&gt;tabStatus.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="lbl_playbackspeed.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="lbl_playbackspeed.Location" type="System.Drawing.Point, System.Drawing">
<value>353, 54</value>
</data>
<data name="lbl_playbackspeed.Size" type="System.Drawing.Size, System.Drawing">
<value>51, 20</value>
</data>
<data name="lbl_playbackspeed.TabIndex" type="System.Int32, mscorlib">
<value>79</value>
</data>
<data name="lbl_playbackspeed.Text" xml:space="preserve">
<value>x 1.0</value>
</data>
<data name="&gt;&gt;lbl_playbackspeed.Name" xml:space="preserve">
<value>lbl_playbackspeed</value>
</data>
<data name="&gt;&gt;lbl_playbackspeed.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_playbackspeed.Parent" xml:space="preserve">
<value>tabTLogs</value>
</data>
<data name="&gt;&gt;lbl_playbackspeed.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="lbl_logpercent.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
@ -877,19 +904,22 @@
<value>lbl_logpercent</value>
</data>
<data name="&gt;&gt;lbl_logpercent.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_logpercent.Parent" xml:space="preserve">
<value>tabTLogs</value>
</data>
<data name="&gt;&gt;lbl_logpercent.ZOrder" xml:space="preserve">
<value>0</value>
<value>1</value>
</data>
<data name="NUM_playbackspeed.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Bottom, Left, Right</value>
</data>
<data name="NUM_playbackspeed.Location" type="System.Drawing.Point, System.Drawing">
<value>178, 35</value>
<value>178, 40</value>
</data>
<data name="NUM_playbackspeed.Size" type="System.Drawing.Size, System.Drawing">
<value>54, 20</value>
<value>169, 45</value>
</data>
<data name="NUM_playbackspeed.TabIndex" type="System.Int32, mscorlib">
<value>77</value>
@ -901,13 +931,13 @@
<value>NUM_playbackspeed</value>
</data>
<data name="&gt;&gt;NUM_playbackspeed.Type" xml:space="preserve">
<value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>ArdupilotMega.Controls.MyTrackBar, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;NUM_playbackspeed.Parent" xml:space="preserve">
<value>tabTLogs</value>
</data>
<data name="&gt;&gt;NUM_playbackspeed.ZOrder" xml:space="preserve">
<value>1</value>
<value>2</value>
</data>
<data name="BUT_log2kml.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -928,13 +958,13 @@
<value>BUT_log2kml</value>
</data>
<data name="&gt;&gt;BUT_log2kml.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_log2kml.Parent" xml:space="preserve">
<value>tabTLogs</value>
</data>
<data name="&gt;&gt;BUT_log2kml.ZOrder" xml:space="preserve">
<value>2</value>
<value>3</value>
</data>
<data name="tracklog.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Left, Right</value>
@ -961,7 +991,7 @@
<value>tabTLogs</value>
</data>
<data name="&gt;&gt;tracklog.ZOrder" xml:space="preserve">
<value>3</value>
<value>4</value>
</data>
<data name="BUT_playlog.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -982,13 +1012,13 @@
<value>BUT_playlog</value>
</data>
<data name="&gt;&gt;BUT_playlog.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_playlog.Parent" xml:space="preserve">
<value>tabTLogs</value>
</data>
<data name="&gt;&gt;BUT_playlog.ZOrder" xml:space="preserve">
<value>4</value>
<value>5</value>
</data>
<data name="BUT_loadtelem.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -1009,13 +1039,13 @@
<value>BUT_loadtelem</value>
</data>
<data name="&gt;&gt;BUT_loadtelem.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_loadtelem.Parent" xml:space="preserve">
<value>tabTLogs</value>
</data>
<data name="&gt;&gt;BUT_loadtelem.ZOrder" xml:space="preserve">
<value>5</value>
<value>6</value>
</data>
<data name="tabTLogs.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 22</value>
@ -1198,7 +1228,7 @@
<value>lbl_hdop</value>
</data>
<data name="&gt;&gt;lbl_hdop.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_hdop.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
@ -1231,7 +1261,7 @@
<value>lbl_sats</value>
</data>
<data name="&gt;&gt;lbl_sats.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_sats.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
@ -1261,7 +1291,7 @@
<value>lbl_winddir</value>
</data>
<data name="&gt;&gt;lbl_winddir.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_winddir.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
@ -1291,7 +1321,7 @@
<value>lbl_windvel</value>
</data>
<data name="&gt;&gt;lbl_windvel.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_windvel.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
@ -1463,7 +1493,7 @@
<value>gMapControl1</value>
</data>
<data name="&gt;&gt;gMapControl1.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.myGMAP, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.myGMAP, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;gMapControl1.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
@ -1526,7 +1556,7 @@
<value>TXT_lat</value>
</data>
<data name="&gt;&gt;TXT_lat.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;TXT_lat.Parent" xml:space="preserve">
<value>panel1</value>
@ -1583,7 +1613,7 @@
<value>label1</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>panel1</value>
@ -1613,7 +1643,7 @@
<value>TXT_long</value>
</data>
<data name="&gt;&gt;TXT_long.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;TXT_long.Parent" xml:space="preserve">
<value>panel1</value>
@ -1643,7 +1673,7 @@
<value>TXT_alt</value>
</data>
<data name="&gt;&gt;TXT_alt.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;TXT_alt.Parent" xml:space="preserve">
<value>panel1</value>
@ -1844,7 +1874,7 @@
<value>label6</value>
</data>
<data name="&gt;&gt;label6.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;label6.Parent" xml:space="preserve">
<value>$this</value>
@ -1922,6 +1952,6 @@
<value>FlightData</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.MyUserControl, ArdupilotMegaPlanner, Version=1.1.4519.33801, Culture=neutral, PublicKeyToken=null</value>
<value>System.Windows.Forms.MyUserControl, ArdupilotMegaPlanner, Version=1.1.4523.23191, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>

View File

@ -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

View File

@ -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();

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

View File

@ -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

View File

@ -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
}
}

View File

@ -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);

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;

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)
{

View File

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

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;

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

View File

@ -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>

View File

@ -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();
}
}
}

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);
}