APM Planner 1.1.81

mavlink 1.0 fixs
simulation hil fix for lorenz
modify default att rate to 10 hz
This commit is contained in:
Michael Oborne 2012-05-07 22:25:56 +08:00
parent 46614e9acd
commit a04b6d6993
31 changed files with 2731 additions and 100 deletions

View File

@ -0,0 +1,216 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{B8943726-04B0-4477-BFDA-E156A0CD98A4}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>_3DRRadio</RootNamespace>
<AssemblyName>3DRRadio</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>3dr.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net">
<HintPath>..\Lib\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Arduino\ArduinoComms.cs">
<Link>Linked\ArduinoComms.cs</Link>
</Compile>
<Compile Include="..\Arduino\ArduinoSTK.cs">
<Link>Linked\ArduinoSTK.cs</Link>
<SubType>Component</SubType>
</Compile>
<Compile Include="..\Attributes\DisplayTextAttribute.cs">
<Link>Linked\DisplayTextAttribute.cs</Link>
</Compile>
<Compile Include="..\Attributes\PrivateAttribute.cs">
<Link>Linked\PrivateAttribute.cs</Link>
</Compile>
<Compile Include="..\Comms\CommsSerialInterface.cs">
<Link>Linked\CommsSerialInterface.cs</Link>
</Compile>
<Compile Include="..\Comms\CommsSerialPort.cs">
<Link>Linked\CommsSerialPort.cs</Link>
<SubType>Component</SubType>
</Compile>
<Compile Include="..\Controls\BackstageView\BackstageView.cs">
<Link>Linked\BackstageView.cs</Link>
<SubType>UserControl</SubType>
</Compile>
<Compile Include="..\Controls\BackstageView\BackstageView.designer.cs">
<Link>Linked\BackstageView.designer.cs</Link>
<DependentUpon>BackstageView.cs</DependentUpon>
</Compile>
<Compile Include="..\Controls\BackstageView\BackstageViewButton.cs">
<Link>Linked\BackstageViewButton.cs</Link>
<SubType>Component</SubType>
</Compile>
<Compile Include="..\Controls\BackstageView\BackStageViewContentPanel.cs">
<Link>Linked\BackStageViewContentPanel.cs</Link>
<SubType>UserControl</SubType>
</Compile>
<Compile Include="..\Controls\BackstageView\BackStageViewMenuPanel.cs">
<Link>Linked\BackStageViewMenuPanel.cs</Link>
<SubType>Component</SubType>
</Compile>
<Compile Include="..\Controls\CustomMessageBox.cs">
<Link>Linked\CustomMessageBox.cs</Link>
</Compile>
<Compile Include="..\Controls\MyButton.cs">
<Link>Linked\MyButton.cs</Link>
<SubType>Component</SubType>
</Compile>
<Compile Include="..\Radio\3DRradio.cs">
<Link>Linked\3DRradio.cs</Link>
<SubType>UserControl</SubType>
</Compile>
<Compile Include="..\Radio\3DRradio.designer.cs">
<Link>Linked\3DRradio.designer.cs</Link>
<DependentUpon>3DRradio.cs</DependentUpon>
</Compile>
<Compile Include="..\Radio\IHex.cs">
<Link>Linked\IHex.cs</Link>
</Compile>
<Compile Include="..\Radio\Uploader.cs">
<Link>Linked\Uploader.cs</Link>
</Compile>
<Compile Include="Common.cs" />
<Compile Include="Config.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Config.Designer.cs">
<DependentUpon>Config.cs</DependentUpon>
</Compile>
<Compile Include="MainV2.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ThemeManager.cs" />
<EmbeddedResource Include="..\Controls\BackstageView\BackstageView.resx">
<Link>Linked\BackstageView.resx</Link>
<DependentUpon>BackstageView.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="..\Radio\3DRradio.resx">
<Link>Linked\3DRradio.resx</Link>
<DependentUpon>3DRradio.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="..\Radio\3DRradio.zh-Hans.resx">
<Link>Linked\3DRradio.zh-Hans.resx</Link>
<DependentUpon>3DRradio.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Config.resx">
<DependentUpon>Config.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="Resources\3dr.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\3dr2.png" />
</ItemGroup>
<ItemGroup>
<Content Include="3dr.ico" />
<None Include="Resources\3dr3.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography.X509Certificates;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Xml; // config file
using System.Runtime.InteropServices; // dll imports
using System.Drawing.Drawing2D;
using log4net;
using System.Reflection;
using System.Windows.Forms;
namespace ArdupilotMega
{
public class Common
{
private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public static bool getFilefromNet(string url, string saveto)
{
try
{
// this is for mono to a ssl server
//ServicePointManager.CertificatePolicy = new NoCheckCertificatePolicy();
ServicePointManager.ServerCertificateValidationCallback =
new System.Net.Security.RemoteCertificateValidationCallback((sender, certificate, chain, policyErrors) => { return true; });
// Create a request using a URL that can receive a post.
WebRequest request = WebRequest.Create(url);
request.Timeout = 10000;
// Set the Method property of the request to POST.
request.Method = "GET";
// Get the response.
WebResponse response = request.GetResponse();
// Display the status.
log.Info(((HttpWebResponse)response).StatusDescription);
if (((HttpWebResponse)response).StatusCode != HttpStatusCode.OK)
return false;
// Get the stream containing content returned by the server.
Stream dataStream = response.GetResponseStream();
long bytes = response.ContentLength;
long contlen = bytes;
byte[] buf1 = new byte[1024];
FileStream fs = new FileStream(saveto + ".new", FileMode.Create);
DateTime dt = DateTime.Now;
while (dataStream.CanRead && bytes > 0)
{
Application.DoEvents();
log.Debug(saveto + " " + bytes);
int len = dataStream.Read(buf1, 0, buf1.Length);
bytes -= len;
fs.Write(buf1, 0, len);
}
fs.Close();
dataStream.Close();
response.Close();
File.Delete(saveto);
File.Move(saveto + ".new", saveto);
return true;
}
catch (Exception ex) { log.Info("getFilefromNet(): " + ex.ToString()); return false; }
}
}
}

View File

@ -0,0 +1,146 @@
namespace _3DRRadio
{
partial class Config
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Config));
this.CMB_SerialPort = new System.Windows.Forms.ComboBox();
this.CMB_Baudrate = new System.Windows.Forms.ComboBox();
this.panel1 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// CMB_SerialPort
//
this.CMB_SerialPort.FormattingEnabled = true;
resources.ApplyResources(this.CMB_SerialPort, "CMB_SerialPort");
this.CMB_SerialPort.Name = "CMB_SerialPort";
this.CMB_SerialPort.SelectedIndexChanged += new System.EventHandler(this.CMB_SerialPort_SelectedIndexChanged);
this.CMB_SerialPort.Click += new System.EventHandler(this.CMB_SerialPort_Click);
//
// CMB_Baudrate
//
this.CMB_Baudrate.FormattingEnabled = true;
this.CMB_Baudrate.Items.AddRange(new object[] {
resources.GetString("CMB_Baudrate.Items"),
resources.GetString("CMB_Baudrate.Items1"),
resources.GetString("CMB_Baudrate.Items2"),
resources.GetString("CMB_Baudrate.Items3"),
resources.GetString("CMB_Baudrate.Items4"),
resources.GetString("CMB_Baudrate.Items5"),
resources.GetString("CMB_Baudrate.Items6"),
resources.GetString("CMB_Baudrate.Items7")});
resources.ApplyResources(this.CMB_Baudrate, "CMB_Baudrate");
this.CMB_Baudrate.Name = "CMB_Baudrate";
this.CMB_Baudrate.SelectedIndexChanged += new System.EventHandler(this.CMB_Baudrate_SelectedIndexChanged);
//
// panel1
//
resources.ApplyResources(this.panel1, "panel1");
this.panel1.MinimumSize = new System.Drawing.Size(781, 433);
this.panel1.Name = "panel1";
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.Name = "label2";
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.CMB_SerialPort);
this.groupBox1.Controls.Add(this.CMB_Baudrate);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.label2);
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.panel1);
resources.ApplyResources(this.groupBox2, "groupBox2");
this.groupBox2.Name = "groupBox2";
this.groupBox2.TabStop = false;
//
// pictureBox1
//
this.pictureBox1.BackgroundImage = global::_3DRRadio.Properties.Resources._3dr3;
resources.ApplyResources(this.pictureBox1, "pictureBox1");
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.TabStop = false;
//
// Config
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.label3);
this.Controls.Add(this.pictureBox1);
this.Name = "Config";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ComboBox CMB_SerialPort;
private System.Windows.Forms.ComboBox CMB_Baudrate;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
}
}

View File

@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace _3DRRadio
{
public partial class Config : Form
{
public Config()
{
InitializeComponent();
ArdupilotMega._3DRradio form = new ArdupilotMega._3DRradio();
panel1.Controls.Add(form);
ArdupilotMega.Utilities.ThemeManager.SetTheme(ArdupilotMega.Utilities.ThemeManager.Themes.None);
ArdupilotMega.Utilities.ThemeManager.ApplyThemeTo(this);
CMB_SerialPort.Items.AddRange(ArdupilotMega.Comms.SerialPort.GetPortNames());
if (CMB_SerialPort.Items.Count > 0)
CMB_SerialPort.SelectedIndex = 0;
// default
CMB_Baudrate.SelectedIndex = CMB_Baudrate.Items.IndexOf("57600");
}
private void CMB_SerialPort_SelectedIndexChanged(object sender, EventArgs e)
{
ArdupilotMega.MainV2.comPort.BaseStream.PortName = CMB_SerialPort.Text;
}
private void CMB_Baudrate_SelectedIndexChanged(object sender, EventArgs e)
{
ArdupilotMega.MainV2.comPort.BaseStream.BaudRate = int.Parse(CMB_Baudrate.Text);
}
private void CMB_SerialPort_Click(object sender, EventArgs e)
{
CMB_SerialPort.Items.Clear();
CMB_SerialPort.Items.AddRange(ArdupilotMega.Comms.SerialPort.GetPortNames());
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ArdupilotMega
{
class MainV2
{
public static portproxy comPort = new portproxy();
}
class portproxy
{
public ArdupilotMega.Comms.SerialPort BaseStream = new ArdupilotMega.Comms.SerialPort();
}
}

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using log4net.Config;
namespace _3DRRadio
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
XmlConfigurator.Configure();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Config());
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("3DRRadio")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("3DRRadio")]
[assembly: AssemblyCopyright("Copyright © 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("5f5b5ed0-0b27-4a90-8c24-248309f363f8")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// 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.1.*")]
[assembly: AssemblyFileVersion("0.1.0.0")]

View File

@ -0,0 +1,84 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.261
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace _3DRRadio.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("_3DRRadio.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
internal static System.Drawing.Bitmap _3dr {
get {
object obj = ResourceManager.GetObject("3dr", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap _3dr2 {
get {
object obj = ResourceManager.GetObject("3dr2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap _3dr3 {
get {
object obj = ResourceManager.GetObject("3dr3", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@ -0,0 +1,131 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="3dr2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\3dr2.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="3dr" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\3dr.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="3dr3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\3dr3.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.261
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace _3DRRadio.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -0,0 +1,235 @@
using System;
using System.Drawing;
using System.Windows.Forms;
using ArdupilotMega.Controls.BackstageView;
using log4net;
using ArdupilotMega.Controls;
namespace ArdupilotMega.Utilities
{
/// <summary>
/// Helper class for the stylng 'theming' of forms and controls, and provides MessageBox
/// replacements which are also styled
/// </summary>
public class ThemeManager
{
private static readonly ILog log =
LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private static Themes _currentTheme = Themes.BurntKermit;
public enum Themes
{
/// <summary>
/// no theme - standard Winforms appearance
/// </summary>
None,
/// <summary>
/// Standard Planner Charcoal & Green colours
/// </summary>
BurntKermit,
}
/// <summary>
/// Change the current theme. Existing controls are not affected
/// </summary>
/// <param name="theme"></param>
public static void SetTheme(Themes theme)
{
log.Debug("Theme set to " + Enum.GetName(typeof(Themes), theme));
_currentTheme = theme;
}
/// <summary>
/// Will recursively apply the current theme to 'control'
/// </summary>
/// <param name="control"></param>
public static void ApplyThemeTo(Control control)
{
switch (_currentTheme)
{
case Themes.BurntKermit: ApplyBurntKermitTheme(control, 0);
break;
case Themes.None: ApplyNone(control, 0);
break;
// More themes go here
default:
break;
}
}
private static void ApplyNone(Control temp, int level)
{
foreach (Control ctl in temp.Controls)
{
if (ctl.GetType() == typeof(MyButton))
{
ArdupilotMega.Controls.MyButton but = (MyButton)ctl;
but.BGGradTop = Color.FromArgb(242,242,242);
but.BGGradBot = Color.FromArgb(207,207,207);
but.ForeColor = Color.Black;
but.TextColor = Color.Black;
but.Outline = Color.FromArgb(112,112,112);
}
if (ctl.Controls.Count > 0)
ApplyNone(ctl, 1);
}
}
private static void ApplyBurntKermitTheme(Control temp, int level)
{
Color BGColor = Color.FromArgb(0x26, 0x27, 0x28); // background
Color ControlBGColor = Color.FromArgb(0x43, 0x44, 0x45); // editable bg color
Color TextColor = Color.White;
if (level == 0)
{
temp.BackColor = BGColor;
temp.ForeColor = TextColor;// Color.FromArgb(0xe6, 0xe8, 0xea);
}
//temp.Font = new Font("Lucida Console", 8.25f);
foreach (Control ctl in temp.Controls)
{
if (ctl.GetType() == typeof(Button))
{
ctl.ForeColor = Color.Black;
}
else if (ctl.GetType() == typeof(MyButton))
{
Color PrimeColor = Color.FromArgb(0x94, 0xc1, 0x1f);
ArdupilotMega.Controls.MyButton but = (MyButton)ctl;
//but.BGGradTop = Color.FromArgb(PrimeColor.R, PrimeColor.G, PrimeColor.B);
//but.BGGradBot = Color.FromArgb(255 - (int)(PrimeColor.R * 0.27), 255 - (int)(PrimeColor.G * 0.14), 255 - (int)(PrimeColor.B * 0.79));
//but.ForeColor = Color.FromArgb(0x40, 0x57, 0x04); //Color.FromArgb(255 - (int)(PrimeColor.R * 0.7), 255 - (int)(PrimeColor.G * 0.8), 255 - (int)(PrimeColor.B * 0.1));
//but.Outline = ControlBGColor;
}
else if (ctl.GetType() == typeof(TextBox))
{
ctl.BackColor = ControlBGColor;
ctl.ForeColor = TextColor;// Color.FromArgb(0xe6, 0xe8, 0xea);
TextBox txt = (TextBox)ctl;
txt.BorderStyle = BorderStyle.None;
}
else if (ctl.GetType() == typeof(DomainUpDown))
{
ctl.BackColor = ControlBGColor;
ctl.ForeColor = TextColor;// Color.FromArgb(0xe6, 0xe8, 0xea);
DomainUpDown txt = (DomainUpDown)ctl;
txt.BorderStyle = BorderStyle.None;
}
else if (ctl.GetType() == typeof(GroupBox))
{
ctl.BackColor = BGColor;
ctl.ForeColor = TextColor;// Color.FromArgb(0xe6, 0xe8, 0xea);
}
else if (ctl.GetType() == typeof(Form))
{
ctl.BackColor = BGColor;
ctl.ForeColor = TextColor;// Color.FromArgb(0xe6, 0xe8, 0xea);
}
else if (ctl.GetType() == typeof(RichTextBox))
{
ctl.BackColor = ControlBGColor;
ctl.ForeColor = TextColor;
RichTextBox txtr = (RichTextBox)ctl;
txtr.BorderStyle = BorderStyle.None;
}
else if (ctl.GetType() == typeof(CheckedListBox))
{
ctl.BackColor = ControlBGColor;
ctl.ForeColor = TextColor;
CheckedListBox txtr = (CheckedListBox)ctl;
txtr.BorderStyle = BorderStyle.None;
}
else if (ctl.GetType() == typeof(TabPage))
{
ctl.BackColor = BGColor; //ControlBGColor
ctl.ForeColor = TextColor;
TabPage txtr = (TabPage)ctl;
txtr.BorderStyle = BorderStyle.None;
}
else if (ctl.GetType() == typeof(TabControl))
{
ctl.BackColor = BGColor; //ControlBGColor
ctl.ForeColor = TextColor;
TabControl txtr = (TabControl)ctl;
}
else if (ctl.GetType() == typeof(DataGridView))
{
ctl.ForeColor = TextColor;
DataGridView dgv = (DataGridView)ctl;
dgv.EnableHeadersVisualStyles = false;
dgv.BorderStyle = BorderStyle.None;
dgv.BackgroundColor = BGColor;
DataGridViewCellStyle rs = new DataGridViewCellStyle();
rs.BackColor = ControlBGColor;
rs.ForeColor = TextColor;
dgv.RowsDefaultCellStyle = rs;
DataGridViewCellStyle hs = new DataGridViewCellStyle(dgv.ColumnHeadersDefaultCellStyle);
hs.BackColor = BGColor;
hs.ForeColor = TextColor;
dgv.ColumnHeadersDefaultCellStyle = hs;
dgv.RowHeadersDefaultCellStyle = hs;
}
else if (ctl.GetType() == typeof(ComboBox))
{
ctl.BackColor = ControlBGColor;
ctl.ForeColor = TextColor;
ComboBox CMB = (ComboBox)ctl;
CMB.FlatStyle = FlatStyle.Flat;
}
else if (ctl.GetType() == typeof(NumericUpDown))
{
ctl.BackColor = ControlBGColor;
ctl.ForeColor = TextColor;
}
else if (ctl.GetType() == typeof(TrackBar))
{
ctl.BackColor = BGColor;
ctl.ForeColor = TextColor;
}
else if (ctl.GetType() == typeof(LinkLabel))
{
ctl.BackColor = BGColor;
ctl.ForeColor = TextColor;
LinkLabel LNK = (LinkLabel)ctl;
LNK.ActiveLinkColor = TextColor;
LNK.LinkColor = TextColor;
LNK.VisitedLinkColor = TextColor;
}
else if (ctl.GetType() == typeof(BackstageView))
{
var bsv = ctl as BackstageView;
bsv.BackColor = BGColor;
bsv.ButtonsAreaBgColor = ControlBGColor;
bsv.HighlightColor2 = Color.FromArgb(0x94, 0xc1, 0x1f);
bsv.HighlightColor1 = Color.FromArgb(0x40, 0x57, 0x04);
bsv.SelectedTextColor = Color.White;
bsv.UnSelectedTextColor = Color.Gray;
bsv.ButtonsAreaPencilColor = Color.DarkGray;
}
if (ctl.Controls.Count > 0)
ApplyBurntKermitTheme(ctl, 1);
}
}
}
}

View File

@ -0,0 +1,29 @@
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<startup useLegacyV2RuntimeActivationPolicy="true"><supportedRuntime version="v2.0.50727"/></startup>
<log4net>
<appender name="Console" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%level %logger - %message%newline" />
</layout>
<threshold value="INFO"/>
</appender>
<appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
<file value="3DRRadio.log" />
<appendToFile value="true" />
<maximumFileSize value="500KB" />
<maxSizeRollBackups value="2" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %5level %logger - %message (%file:%line) [%thread]%newline" />
</layout>
</appender>
<root>
<level value="DEBUG" />
<appender-ref ref="RollingFile" />
<appender-ref ref="Console" />
</root>
</log4net>
</configuration>

View File

@ -45,7 +45,7 @@
<DefineConstants>TRACE;DEBUG;MAVLINK10cra</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<DocumentationFile>
</DocumentationFile>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
@ -61,7 +61,7 @@
<DefineConstants>TRACE;DEBUG;MAVLINK10cra</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<DocumentationFile>
</DocumentationFile>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>

View File

@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Updater", "Updater\Updater.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wix", "wix\wix.csproj", "{76374F95-C343-4ACC-B86F-7ECFDD668F46}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "3DRRadio", "3DRRadio\3DRRadio.csproj", "{B8943726-04B0-4477-BFDA-E156A0CD98A4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -55,6 +57,18 @@ Global
{76374F95-C343-4ACC-B86F-7ECFDD668F46}.Release|Win32.ActiveCfg = Release|x86
{76374F95-C343-4ACC-B86F-7ECFDD668F46}.Release|x86.ActiveCfg = Release|x86
{76374F95-C343-4ACC-B86F-7ECFDD668F46}.Release|x86.Build.0 = Release|x86
{B8943726-04B0-4477-BFDA-E156A0CD98A4}.Debug|Any CPU.ActiveCfg = Debug|x86
{B8943726-04B0-4477-BFDA-E156A0CD98A4}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{B8943726-04B0-4477-BFDA-E156A0CD98A4}.Debug|Mixed Platforms.Build.0 = Debug|x86
{B8943726-04B0-4477-BFDA-E156A0CD98A4}.Debug|Win32.ActiveCfg = Debug|x86
{B8943726-04B0-4477-BFDA-E156A0CD98A4}.Debug|x86.ActiveCfg = Debug|x86
{B8943726-04B0-4477-BFDA-E156A0CD98A4}.Debug|x86.Build.0 = Debug|x86
{B8943726-04B0-4477-BFDA-E156A0CD98A4}.Release|Any CPU.ActiveCfg = Release|x86
{B8943726-04B0-4477-BFDA-E156A0CD98A4}.Release|Mixed Platforms.ActiveCfg = Release|x86
{B8943726-04B0-4477-BFDA-E156A0CD98A4}.Release|Mixed Platforms.Build.0 = Release|x86
{B8943726-04B0-4477-BFDA-E156A0CD98A4}.Release|Win32.ActiveCfg = Release|x86
{B8943726-04B0-4477-BFDA-E156A0CD98A4}.Release|x86.ActiveCfg = Release|x86
{B8943726-04B0-4477-BFDA-E156A0CD98A4}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -524,7 +524,7 @@ namespace ArdupilotMega
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)(int)Enum.Parse(Common.getModes(), modein);
mode.custom_mode = (uint)EnumTranslator.GetValue<Common.apmmodes>(modein);
break;
default:
MessageBox.Show("No Mode Changed " + modein);
@ -544,7 +544,7 @@ namespace ArdupilotMega
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)(int)Enum.Parse(Common.getModes(), modein);
mode.custom_mode = (uint)EnumTranslator.GetValue<Common.ac2modes>(modein);
break;
default:
MessageBox.Show("No Mode Changed " + modein);

View File

@ -7,7 +7,7 @@ using System.Linq;
namespace ArdupilotMega.Comms
{
class SerialPort : System.IO.Ports.SerialPort,ICommsSerial
public class SerialPort : System.IO.Ports.SerialPort,ICommsSerial
{
public new void Open()
{

View File

@ -15,9 +15,15 @@ namespace ArdupilotMega.Controls.BackstageView
FormClosing(this, new FormClosingEventArgs(CloseReason.UserClosing, false));
}
public new void OnLoad(EventArgs e)
public void DoLoad(EventArgs e)
{
base.OnLoad(e);
}
public new void OnLoad(EventArgs e)
{
// this is now done on page load via parent control
// base.OnLoad(e);
}
}
}

View File

@ -165,10 +165,12 @@ namespace ArdupilotMega.Controls.BackstageView
this.pnlPages.Controls.Add(page.Page);
if (_activePage == null)
{
_activePage = page;
ActivatePage(page);
}
}
private void CreateLinkButton(BackstageViewPage page)
{
@ -202,6 +204,12 @@ namespace ArdupilotMega.Controls.BackstageView
public void ActivatePage(BackstageViewPage associatedPage)
{
// deactivate the old page
_activePage.Page.Close();
Pages.ForEach(x =>
{
x.Page.Visible = false;
});
_activePage.Page.Visible = false;
var oldButton = this.pnlMenu.Controls.OfType<BackstageViewButton>().Single(b => b.Tag == _activePage);
oldButton.IsSelected = false;
@ -212,7 +220,7 @@ namespace ArdupilotMega.Controls.BackstageView
_activePage = associatedPage;
_activePage.Page.OnLoad(new EventArgs());
_activePage.Page.DoLoad(new EventArgs());
}
public void Close()

View File

@ -35,6 +35,8 @@ namespace ArdupilotMega.Controls
// process hashdefines and update display
foreach (string value in MainV2.comPort.param.Keys)
{
if (value == null) // older ap vesion have a null param
continue;
Control[] text = this.Controls.Find(value, true);
foreach (Control ctl in text)
{

View File

@ -312,7 +312,7 @@ namespace ArdupilotMega
{
mode = "";
messages = new List<string>();
rateattitude = 3;
rateattitude = 10;
rateposition = 3;
ratestatus = 3;
ratesensors = 3;
@ -373,7 +373,7 @@ namespace ArdupilotMega
byte[] bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_RC_CHANNELS_SCALED];
if (bytearray != null) // hil
if (bytearray != null) // hil mavlink 0.9
{
var hil = bytearray.ByteArrayToStructure<MAVLink.mavlink_rc_channels_scaled_t>(6);
@ -389,6 +389,20 @@ namespace ArdupilotMega
//MAVLink.packets[MAVLink.MAVLINK_MSG_ID_RC_CHANNELS_SCALED] = null;
}
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_HIL_CONTROLS];
if (bytearray != null) // hil mavlink 0.9 and 1.0
{
var hil = bytearray.ByteArrayToStructure<MAVLink.mavlink_hil_controls_t>(6);
hilch1 = (int)(hil.roll_ailerons * 10000);
hilch2 = (int)(hil.pitch_elevator * 10000);
hilch3 = (int)(hil.throttle * 10000);
hilch4 = (int)(hil.yaw_rudder * 10000);
//MAVLink.packets[MAVLink.MAVLINK_MSG_ID_RC_CHANNELS_SCALED] = null;
}
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT];
if (bytearray != null)

View File

@ -68,7 +68,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
{
#if MAVLINK10
int fixme; // needs to be accel only
MainV2.comPort.doCommand(MAVLink.MAV_CMD.PREFLIGHT_CALIBRATION,1,1,1,1,1,1,1);
MainV2.comPort.doCommand(MAVLink.MAV_CMD.PREFLIGHT_CALIBRATION,1,1,1,0,0,0,0);
#else
MainV2.comPort.doAction(MAVLink.MAV_ACTION.MAV_ACTION_CALIBRATE_ACC);
#endif

View File

@ -149,64 +149,6 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
#region Methods
/// <summary>
/// Loads the param file.
/// </summary>
/// <param name="Filename">The filename.</param>
/// <returns></returns>
private Hashtable loadParamFile(string Filename)
{
Hashtable param = new Hashtable();
StreamReader sr = new StreamReader(Filename);
while (!sr.EndOfStream)
{
string line = sr.ReadLine();
if (line.Contains("NOTE:"))
CustomMessageBox.Show(line, "Saved Note");
if (line.StartsWith("#"))
continue;
string[] items = line.Split(new char[] { ' ', ',', '\t' }, StringSplitOptions.RemoveEmptyEntries);
if (items.Length != 2)
continue;
string name = items[0];
float value = float.Parse(items[1], new System.Globalization.CultureInfo("en-US"));
MAVLink.modifyParamForDisplay(true, name, ref value);
if (name == "SYSID_SW_MREV")
continue;
if (name == "WP_TOTAL")
continue;
if (name == "CMD_TOTAL")
continue;
if (name == "FENCE_TOTAL")
continue;
if (name == "SYS_NUM_RESETS")
continue;
if (name == "ARSPD_OFFSET")
continue;
if (name == "GND_ABS_PRESS")
continue;
if (name == "GND_TEMP")
continue;
if (name == "CMD_INDEX")
continue;
if (name == "LOG_LASTFILE")
continue;
param[name] = value;
}
sr.Close();
return param;
}
/// <summary>
/// Sorts the param list.
/// </summary>
@ -241,6 +183,11 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
{
tableLayoutPanel1.Controls.Clear();
if (_params == null || _params.Count == 0) SortParamList();
// get the params if nothing exists already
if (_params != null && _params.Count == 0)
Utilities.ParameterMetaDataParser.GetParameterInformation();
_params.ForEach(x =>
{
if(!String.IsNullOrEmpty(x.Key))

View File

@ -1180,7 +1180,7 @@ namespace ArdupilotMega.GCSViews
{
((Button)sender).Enabled = false;
#if MAVLINK10
MainV2.comPort.setMode("AUTO");
MainV2.comPort.setMode("Auto");
#else
comPort.doAction(MAVLink.MAV_ACTION.MAV_ACTION_SET_AUTO);
#endif
@ -1210,7 +1210,7 @@ namespace ArdupilotMega.GCSViews
{
((Button)sender).Enabled = false;
#if MAVLINK10
MainV2.comPort.setMode("MANUAL");
MainV2.comPort.setMode("Manual");
#else
comPort.doAction(MAVLink.MAV_ACTION.MAV_ACTION_SET_MANUAL);
#endif

View File

@ -1210,11 +1210,22 @@ namespace ArdupilotMega.GCSViews
TimeSpan gpsspan = DateTime.Now - lastgpsupdate;
// add gps delay
if (gpsspan.TotalMilliseconds >= GPS_rate)
{
lastgpsupdate = DateTime.Now;
oldgps = gps;
//comPort.sendPacket(gps);
// save current fix = 3
gpsbuffer[gpsbufferindex % gpsbuffer.Length] = gps;
// Console.WriteLine((gpsbufferindex % gpsbuffer.Length) + " " + ((gpsbufferindex + (gpsbuffer.Length - 1)) % gpsbuffer.Length));
// return buffer index + 5 = (3 + 5) = 8 % 6 = 2
oldgps = gpsbuffer[(gpsbufferindex + (gpsbuffer.Length - 1)) % gpsbuffer.Length];
//comPort.sendPacket(oldgps);
gpsbufferindex++;
}
@ -1226,8 +1237,8 @@ namespace ArdupilotMega.GCSViews
hilstate.roll = att.roll;
hilstate.rollspeed = att.rollspeed;
hilstate.time_usec = gps.time_usec;
hilstate.vx = (short)(gps.vel * Math.Sin(oldgps.cog / 100.0 * deg2rad));
hilstate.vy = (short)(gps.vel * Math.Cos(oldgps.cog / 100.0 * deg2rad));
hilstate.vx = (short)(gps.vel * Math.Sin(gps.cog / 100.0 * deg2rad));
hilstate.vy = (short)(gps.vel * Math.Cos(gps.cog / 100.0 * deg2rad));
hilstate.vz = 0;
hilstate.xacc = imu.xacc;
hilstate.yacc = imu.yacc;
@ -1237,6 +1248,8 @@ namespace ArdupilotMega.GCSViews
comPort.sendPacket(hilstate);
// comPort.sendPacket(oldgps);
comPort.sendPacket(asp);
#else
@ -1266,6 +1279,7 @@ namespace ArdupilotMega.GCSViews
TimeSpan gpsspan = DateTime.Now - lastgpsupdate;
// add gps delay
if (gpsspan.TotalMilliseconds >= GPS_rate)
{
lastgpsupdate = DateTime.Now;

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.80")]
[assembly: AssemblyFileVersion("1.1.81")]
[assembly: NeutralResourcesLanguageAttribute("")]

View File

@ -11,6 +11,8 @@ using System.IO;
using ArdupilotMega.Controls.BackstageView;
using ArdupilotMega.Arduino;
using ArdupilotMega.Comms;
using log4net;
using System.Reflection;
namespace ArdupilotMega
{
@ -22,6 +24,8 @@ namespace ArdupilotMega
string firmwarefile = Path.GetDirectoryName(Application.ExecutablePath) + Path.DirectorySeparatorChar + "radio.hm_trp.hex";
private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public _3DRradio()
{
InitializeComponent();
@ -118,7 +122,7 @@ namespace ArdupilotMega
{
comPort.Write("AT&UPDATE\r\n");
string left = comPort.ReadExisting();
Console.WriteLine(left);
log.Info(left);
Sleep(700);
comPort.BaudRate = 115200;
}
@ -165,6 +169,7 @@ namespace ArdupilotMega
{
Console.Write(message);
lbl_status.Text = message;
log.Info(message);
Application.DoEvents();
}
}
@ -179,6 +184,7 @@ namespace ArdupilotMega
{
lbl_status.Text = message;
Console.WriteLine(message);
log.Info(message);
Application.DoEvents();
}
}
@ -477,7 +483,7 @@ namespace ArdupilotMega
}
else
{
Console.WriteLine("Odd config line :" + item);
log.Info("Odd config line :" + item);
}
}
}
@ -534,7 +540,7 @@ namespace ArdupilotMega
// ignore all existing data
comPort.DiscardInBuffer();
lbl_status.Text = "Doing Command " + cmd;
Console.WriteLine("Doing Command " + cmd);
log.Info("Doing Command " + cmd);
// write command
comPort.Write(cmd + "\r\n");
// read echoed line or existing data
@ -544,7 +550,7 @@ namespace ArdupilotMega
temp = Serial_ReadLine(comPort);
}
catch { temp = comPort.ReadExisting(); }
Console.WriteLine("cmd " + cmd + " echo " + temp);
log.Info("cmd " + cmd + " echo " + temp);
// delay for command
Sleep(500);
// get responce
@ -564,7 +570,7 @@ namespace ArdupilotMega
}
}
Console.WriteLine("responce " + level + " " + ans.Replace('\0', ' '));
log.Info("responce " + level + " " + ans.Replace('\0', ' '));
// try again
if (ans == "" && level == 0)
@ -586,9 +592,9 @@ namespace ArdupilotMega
// wait
Sleep(1100);
// check for config responce "OK"
Console.WriteLine("Connect btr " + comPort.BytesToRead + " baud " + comPort.BaudRate);
log.Info("Connect btr " + comPort.BytesToRead + " baud " + comPort.BaudRate);
string conn = comPort.ReadExisting();
Console.WriteLine("Connect first responce " + conn.Replace('\0', ' ') + " " + conn.Length);
log.Info("Connect first responce " + conn.Replace('\0', ' ') + " " + conn.Length);
if (conn.Contains("OK"))
{
//return true;
@ -601,7 +607,7 @@ namespace ArdupilotMega
string version = doCommand(comPort, "ATI");
Console.Write("Connect Version: " + version.Trim() + "\n");
log.Info("Connect Version: " + version.Trim() + "\n");
if (version.Contains("SiK") && version.Contains("on")) // should use a regex....
{

View File

@ -17,8 +17,13 @@ namespace ArdupilotMega.Utilities
public ParameterMetaDataRepository()
{
string paramMetaDataXMLFileName = String.Format("{0}\\{1}", Application.StartupPath, ConfigurationManager.AppSettings["ParameterMetaDataXMLFileName"]);
try
{
if (File.Exists(paramMetaDataXMLFileName))
_parameterMetaDataXML = XDocument.Load(paramMetaDataXMLFileName);
}
catch { } // Exception System.Xml.XmlException: Root element is missing.
}
/// <summary>
@ -33,20 +38,24 @@ namespace ArdupilotMega.Utilities
{
// Use this to find the endpoint node we are looking for
// Either it will be pulled from a file in the ArduPlane hierarchy or the ArduCopter hierarchy
try
{
var element = _parameterMetaDataXML.Element("Params").Element(MainV2.cs.firmware.ToString());
if(element != null && element.HasElements)
if (element != null && element.HasElements)
{
var node = element.Element(nodeKey);
if(node != null && node.HasElements)
if (node != null && node.HasElements)
{
var metaValue = node.Element(metaKey);
if(metaValue != null)
if (metaValue != null)
{
return metaValue.Value;
}
}
}
}
catch { } // Exception System.ArgumentException: '' is an invalid expanded name.
}
return string.Empty;
}
}