Mission Planner 1.2.13

remove some mavlink 0.9 code
add arm/disarm button. Not yet implemented AC and AP Side.
modify heli setup screen
modify failsafe screen
fix old firmware under mono
workaround mono crash.
modify planner wp storage
tweak log dl screen
add change alt button
modify tlog wp extractor, multiple extractions
speed up srtm reading
fix lang edit.
This commit is contained in:
Michael Oborne 2012-10-01 07:53:54 +08:00
parent 939ee1f4a9
commit 09d8a8a2d1
40 changed files with 5358 additions and 3743 deletions

View File

@ -376,6 +376,12 @@
<Compile Include="Controls\ToolStripConnectionControl.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\ModifyandSet.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\ModifyandSet.Designer.cs">
<DependentUpon>ModifyandSet.cs</DependentUpon>
</Compile>
<Compile Include="Controls\ValuesControl.cs">
<SubType>UserControl</SubType>
</Compile>
@ -635,7 +641,6 @@
<DependentUpon>Simulation.cs</DependentUpon>
</Compile>
<Compile Include="CurrentState.cs" />
<Compile Include="Mavlink\MAVLinkTypes0.9.cs" />
<Compile Include="ElevationProfile.cs">
<SubType>Form</SubType>
</Compile>
@ -728,6 +733,9 @@
<EmbeddedResource Include="Controls\RangeControl.resx">
<DependentUpon>RangeControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\ModifyandSet.resx">
<DependentUpon>ModifyandSet.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\ValuesControl.resx">
<DependentUpon>ValuesControl.cs</DependentUpon>
</EmbeddedResource>

View File

@ -1,9 +1,51 @@
* Mission Planner 1.2.8
* Mission Planner 1.2.12
add arduino chip detect
fix apm2,2.5 dialog test
add write timeout. this will stop planner hangs on bad serial devices.
change quickview decimal places to 0.00
fix map clicking issue.
fix wind direction wrapping
add airspeed use
modify firmware screen from Marooned
major flightdata tab change.
add save/load polygon from file
add some error handling dialogs
* Mission Planner 1.2.11
Fix ac crosstrack display
tweak ap_mount
speed up Terminal
* Mission Planner 1.2.10
add useritems to HUD
change hdop scale
fix posible follow me bug (, vs .)
fix posible friendly params bug (, vs .)
tweak flightdata log playback timming
fix gridv2 bug. if no waypoint had been done, the grid wold fail
tweak some mission upload potential issues
add ability to get param list from a log (from startup)
add ability to get the first wp list in a log, if wps where received in that log.
tweak video capture library timing
* Mission Planner 1.2.9
add est distance traveled
add est flight time
AP_Mount now updated
add expermental firmware options.
fix hud avi record framerate
add 2 direction wp circle
tweak gridv2
* Mission Planner 1.2.8
fix mjpeg stream from VLC.
add grid mode V2
fix hdop scaling
* Mission Planner 1.2.7
add wind from ap
add wp every x m in grid mode
@ -11,6 +53,7 @@ fix hil problem
fix control-s
update mavlink format
* Mission Planner 1.2.6
add tracker location option.
fix current sensor screen
@ -18,6 +61,7 @@ add more right click flight planner options.
make some connecting error messages more detailed.
add partial microdrones protocol output
* Mission Planner 1.2.5
add experimental antenna tracker find
add new apparam eeprom reader
@ -29,6 +73,7 @@ move some functions to the right click menu
add xplanes data in/out setup to be automatic.
add better mission upload handeling.
* Mission Planner 1.2.4
remove geofence tab
add guided alt remeber

View File

@ -159,7 +159,9 @@ namespace ArdupilotMega.Controls
public float groundalt { get; set; }
[System.ComponentModel.Browsable(true), System.ComponentModel.Category("Values")]
public int status { get; set; }
public bool status { get; set; }
bool statuslast = false;
DateTime armedtimer = DateTime.MinValue;
public struct Custom
{
@ -172,8 +174,7 @@ namespace ArdupilotMega.Controls
public Hashtable CustomItems = new Hashtable();
int statuslast = 0;
DateTime armedtimer = DateTime.MinValue;
public bool bgon = true;
public bool hudon = true;
@ -852,7 +853,7 @@ namespace ArdupilotMega.Controls
armedtimer = DateTime.Now;
}
if (status == 3) // not armed
if (status == false) // not armed
{
//if ((armedtimer.AddSeconds(8) > DateTime.Now))
{
@ -860,7 +861,7 @@ namespace ArdupilotMega.Controls
statuslast = status;
}
}
else if (status == 4) // armed
else if (status == true) // armed
{
if ((armedtimer.AddSeconds(8) > DateTime.Now))
{

View File

@ -0,0 +1,95 @@
namespace ArdupilotMega.Controls
{
partial class ModifyandSet
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
this.myButton1 = new ArdupilotMega.Controls.MyButton();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
this.flowLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// numericUpDown1
//
this.numericUpDown1.Location = new System.Drawing.Point(3, 3);
this.numericUpDown1.Maximum = new decimal(new int[] {
1000,
0,
0,
0});
this.numericUpDown1.Name = "numericUpDown1";
this.numericUpDown1.Size = new System.Drawing.Size(47, 20);
this.numericUpDown1.TabIndex = 0;
this.numericUpDown1.Value = new decimal(new int[] {
1000,
0,
0,
0});
this.numericUpDown1.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged);
//
// myButton1
//
this.myButton1.Location = new System.Drawing.Point(56, 3);
this.myButton1.Name = "myButton1";
this.myButton1.Size = new System.Drawing.Size(52, 23);
this.myButton1.TabIndex = 1;
this.myButton1.Text = "Set to This";
this.myButton1.UseVisualStyleBackColor = true;
this.myButton1.Click += new System.EventHandler(this.myButton1_Click);
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.Controls.Add(this.numericUpDown1);
this.flowLayoutPanel1.Controls.Add(this.myButton1);
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(114, 29);
this.flowLayoutPanel1.TabIndex = 2;
//
// ModifyandSet
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.flowLayoutPanel1);
this.Name = "ModifyandSet";
this.Size = new System.Drawing.Size(114, 29);
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
this.flowLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.NumericUpDown numericUpDown1;
private MyButton myButton1;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
}
}

View File

@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ArdupilotMega.Controls
{
public partial class ModifyandSet : UserControl
{
[System.ComponentModel.Browsable(true)]
public NumericUpDown NumericUpDown { get; set; }
[System.ComponentModel.Browsable(true)]
public MyButton Button { get; set; }
[System.ComponentModel.Browsable(true)]
public String ButtonText { get { return Button.Text; } set { Button.Text = value; } }
[System.ComponentModel.Browsable(true)]
public Decimal Value { get { return NumericUpDown.Value; } set { NumericUpDown.Value = value; } }
public new event EventHandler Click;
public event EventHandler ValueChanged;
public ModifyandSet()
{
InitializeComponent();
NumericUpDown = numericUpDown1;
Button = myButton1;
}
private void myButton1_Click(object sender, EventArgs e)
{
if (Click != null)
Click(sender, e);
}
private void numericUpDown1_ValueChanged(object sender, EventArgs e)
{
if (ValueChanged != null)
ValueChanged(sender, e);
}
}
}

View File

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

View File

@ -12,7 +12,7 @@ using System.Drawing.Drawing2D;
namespace ArdupilotMega.Controls
{
class MyButton : Button
public class MyButton : Button
{
bool mouseover = false;
bool mousedown = false;

View File

@ -217,8 +217,6 @@ namespace ArdupilotMega
PointLatLngAlt _trackerloc = new PointLatLngAlt();
internal PointLatLngAlt TrackerLocation { get { if (_trackerloc.Lng != 0) return _trackerloc; return HomeLocation; } set { _trackerloc = value; } }
internal PointLatLngAlt GuidedModeWP = new PointLatLngAlt();
public float DistToMAV
{
get
@ -279,7 +277,7 @@ namespace ArdupilotMega
public MainV2.Firmwares firmware = MainV2.Firmwares.ArduPlane;
public float freemem { get; set; }
public float brklevel { get; set; }
public int armed { get; set; }
public bool armed { get; set; }
// 3dr radio
public float rssi { get; set; }
@ -494,7 +492,7 @@ namespace ArdupilotMega
{
var hb = bytearray.ByteArrayToStructure<MAVLink.mavlink_heartbeat_t>(6);
armed = (hb.base_mode & (byte)MAVLink.MAV_MODE_FLAG.SAFETY_ARMED) == (byte)MAVLink.MAV_MODE_FLAG.SAFETY_ARMED ? 4 : 3;
armed = (hb.base_mode & (byte)MAVLink.MAV_MODE_FLAG.SAFETY_ARMED) == (byte)MAVLink.MAV_MODE_FLAG.SAFETY_ARMED;
string oldmode = mode;
@ -764,7 +762,6 @@ namespace ArdupilotMega
//MAVLink.packets[MAVLink.MAVLINK_MSG_ID_ATTITUDE] = null;
}
#if MAVLINK10
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_GPS_RAW_INT];
if (bytearray != null)
{
@ -789,28 +786,6 @@ namespace ArdupilotMega
//MAVLink.packets[MAVLink.MAVLINK_MSG_ID_GPS_RAW] = null;
}
#else
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_GPS_RAW];
if (bytearray != null)
{
var gps = bytearray.ByteArrayToStructure<MAVLink.mavlink_gps_raw_t>(6);
lat = gps.lat;
lng = gps.lon;
// alt = gps.alt; // using vfr as includes baro calc
gpsstatus = gps.fix_type;
// Console.WriteLine("gpsfix {0}",gpsstatus);
gpshdop = gps.eph;
groundspeed = gps.v;
groundcourse = gps.hdg;
//MAVLink.packets[MAVLink.MAVLINK_MSG_ID_GPS_RAW] = null;
}
#endif
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_GPS_STATUS];
if (bytearray != null)
@ -845,7 +820,7 @@ namespace ArdupilotMega
lat = loc.lat / 10000000.0f;
lng = loc.lon / 10000000.0f;
}
#if MAVLINK10
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_MISSION_CURRENT];
if (bytearray != null)
{
@ -862,36 +837,6 @@ namespace ArdupilotMega
//MAVLink.packets[ArdupilotMega.MAVLink.MAVLINK_MSG_ID_WAYPOINT_CURRENT] = null;
}
#else
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_GLOBAL_POSITION];
if (bytearray != null)
{
var loc = bytearray.ByteArrayToStructure<MAVLink.mavlink_global_position_t>(6);
alt = loc.alt;
lat = loc.lat;
lng = loc.lon;
}
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_WAYPOINT_CURRENT];
if (bytearray != null)
{
var wpcur = bytearray.ByteArrayToStructure<MAVLink.mavlink_waypoint_current_t>(6);
int oldwp = (int)wpno;
wpno = wpcur.seq;
if (oldwp != wpno && MainV2.speechEnable && MainV2.speechEngine != null && MainV2.getConfig("speechwaypointenabled") == "True")
{
MainV2.speechEngine.SpeakAsync(Common.speechConversion(MainV2.getConfig("speechwaypoint")));
}
//MAVLink.packets[ArdupilotMega.MAVLink.MAVLINK_MSG_ID_WAYPOINT_CURRENT] = null;
}
#endif
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT];

View File

@ -162,8 +162,6 @@ namespace ArdupilotMega
MainV2.comPort.setGuidedModeWP(gotohere);
MainV2.cs.GuidedModeWP = new PointLatLngAlt(gotohere);
MainV2.giveComport = false;
}
catch { MainV2.giveComport = false; }

View File

@ -137,7 +137,8 @@
resources.GetString("CMB_batmonsensortype.Items"),
resources.GetString("CMB_batmonsensortype.Items1"),
resources.GetString("CMB_batmonsensortype.Items2"),
resources.GetString("CMB_batmonsensortype.Items3")});
resources.GetString("CMB_batmonsensortype.Items3"),
resources.GetString("CMB_batmonsensortype.Items4")});
resources.ApplyResources(this.CMB_batmonsensortype, "CMB_batmonsensortype");
this.CMB_batmonsensortype.Name = "CMB_batmonsensortype";
this.CMB_batmonsensortype.SelectedIndexChanged += new System.EventHandler(this.CMB_batmonsensortype_SelectedIndexChanged);

View File

@ -468,6 +468,9 @@
<data name="CMB_batmonsensortype.Items3" xml:space="preserve">
<value>3: AttoPilot 180A</value>
</data>
<data name="CMB_batmonsensortype.Items4" xml:space="preserve">
<value>4: 3DR IV Sensor</value>
</data>
<data name="CMB_batmonsensortype.Location" type="System.Drawing.Point, System.Drawing">
<value>160, 68</value>
</data>

View File

@ -50,10 +50,19 @@
this.horizontalProgressBar2 = new ArdupilotMega.HorizontalProgressBar();
this.horizontalProgressBar1 = new ArdupilotMega.HorizontalProgressBar();
this.lbl_currentmode = new System.Windows.Forms.Label();
this.mavlinkCheckBox1 = new ArdupilotMega.Controls.MavlinkCheckBox();
this.mavlinkNumericUpDown1 = new ArdupilotMega.Controls.MavlinkNumericUpDown();
this.mavlinkCheckBoxthr_fs = new ArdupilotMega.Controls.MavlinkCheckBox();
this.mavlinkNumericUpDownthr_fs_value = new ArdupilotMega.Controls.MavlinkNumericUpDown();
this.LNK_wiki = new System.Windows.Forms.LinkLabel();
this.mavlinkCheckBoxgcs_fs = new ArdupilotMega.Controls.MavlinkCheckBox();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.mavlinkCheckBoxshort_fs = new ArdupilotMega.Controls.MavlinkCheckBox();
this.mavlinkCheckBoxlong_fs = new ArdupilotMega.Controls.MavlinkCheckBox();
this.mavlinkCheckBoxthr_fs_action = new ArdupilotMega.Controls.MavlinkCheckBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label3 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.currentStateBindingSource)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDown1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDownthr_fs_value)).BeginInit();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// currentStateBindingSource
@ -300,31 +309,110 @@
resources.ApplyResources(this.lbl_currentmode, "lbl_currentmode");
this.lbl_currentmode.Name = "lbl_currentmode";
//
// mavlinkCheckBox1
// mavlinkCheckBoxthr_fs
//
resources.ApplyResources(this.mavlinkCheckBox1, "mavlinkCheckBox1");
this.mavlinkCheckBox1.Name = "mavlinkCheckBox1";
this.mavlinkCheckBox1.OffValue = 0F;
this.mavlinkCheckBox1.OnValue = 1F;
this.mavlinkCheckBox1.param = null;
this.mavlinkCheckBox1.ParamName = null;
this.mavlinkCheckBox1.UseVisualStyleBackColor = true;
resources.ApplyResources(this.mavlinkCheckBoxthr_fs, "mavlinkCheckBoxthr_fs");
this.mavlinkCheckBoxthr_fs.Name = "mavlinkCheckBoxthr_fs";
this.mavlinkCheckBoxthr_fs.OffValue = 0F;
this.mavlinkCheckBoxthr_fs.OnValue = 1F;
this.mavlinkCheckBoxthr_fs.param = null;
this.mavlinkCheckBoxthr_fs.ParamName = null;
this.toolTip1.SetToolTip(this.mavlinkCheckBoxthr_fs, resources.GetString("mavlinkCheckBoxthr_fs.ToolTip"));
this.mavlinkCheckBoxthr_fs.UseVisualStyleBackColor = true;
//
// mavlinkNumericUpDown1
// mavlinkNumericUpDownthr_fs_value
//
resources.ApplyResources(this.mavlinkNumericUpDown1, "mavlinkNumericUpDown1");
this.mavlinkNumericUpDown1.Max = 1F;
this.mavlinkNumericUpDown1.Min = 0F;
this.mavlinkNumericUpDown1.Name = "mavlinkNumericUpDown1";
this.mavlinkNumericUpDown1.param = null;
this.mavlinkNumericUpDown1.ParamName = null;
resources.ApplyResources(this.mavlinkNumericUpDownthr_fs_value, "mavlinkNumericUpDownthr_fs_value");
this.mavlinkNumericUpDownthr_fs_value.Max = 1F;
this.mavlinkNumericUpDownthr_fs_value.Min = 0F;
this.mavlinkNumericUpDownthr_fs_value.Name = "mavlinkNumericUpDownthr_fs_value";
this.mavlinkNumericUpDownthr_fs_value.param = null;
this.mavlinkNumericUpDownthr_fs_value.ParamName = null;
this.toolTip1.SetToolTip(this.mavlinkNumericUpDownthr_fs_value, resources.GetString("mavlinkNumericUpDownthr_fs_value.ToolTip"));
//
// LNK_wiki
//
resources.ApplyResources(this.LNK_wiki, "LNK_wiki");
this.LNK_wiki.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
this.LNK_wiki.LinkColor = System.Drawing.Color.CornflowerBlue;
this.LNK_wiki.Name = "LNK_wiki";
this.LNK_wiki.TabStop = true;
this.LNK_wiki.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LNK_wiki_LinkClicked);
//
// mavlinkCheckBoxgcs_fs
//
resources.ApplyResources(this.mavlinkCheckBoxgcs_fs, "mavlinkCheckBoxgcs_fs");
this.mavlinkCheckBoxgcs_fs.Name = "mavlinkCheckBoxgcs_fs";
this.mavlinkCheckBoxgcs_fs.OffValue = 0F;
this.mavlinkCheckBoxgcs_fs.OnValue = 1F;
this.mavlinkCheckBoxgcs_fs.param = null;
this.mavlinkCheckBoxgcs_fs.ParamName = null;
this.toolTip1.SetToolTip(this.mavlinkCheckBoxgcs_fs, resources.GetString("mavlinkCheckBoxgcs_fs.ToolTip"));
this.mavlinkCheckBoxgcs_fs.UseVisualStyleBackColor = true;
//
// toolTip1
//
this.toolTip1.AutoPopDelay = 20000;
this.toolTip1.InitialDelay = 500;
this.toolTip1.ReshowDelay = 100;
//
// mavlinkCheckBoxshort_fs
//
resources.ApplyResources(this.mavlinkCheckBoxshort_fs, "mavlinkCheckBoxshort_fs");
this.mavlinkCheckBoxshort_fs.Name = "mavlinkCheckBoxshort_fs";
this.mavlinkCheckBoxshort_fs.OffValue = 0F;
this.mavlinkCheckBoxshort_fs.OnValue = 1F;
this.mavlinkCheckBoxshort_fs.param = null;
this.mavlinkCheckBoxshort_fs.ParamName = null;
this.toolTip1.SetToolTip(this.mavlinkCheckBoxshort_fs, resources.GetString("mavlinkCheckBoxshort_fs.ToolTip"));
this.mavlinkCheckBoxshort_fs.UseVisualStyleBackColor = true;
//
// mavlinkCheckBoxlong_fs
//
resources.ApplyResources(this.mavlinkCheckBoxlong_fs, "mavlinkCheckBoxlong_fs");
this.mavlinkCheckBoxlong_fs.Name = "mavlinkCheckBoxlong_fs";
this.mavlinkCheckBoxlong_fs.OffValue = 0F;
this.mavlinkCheckBoxlong_fs.OnValue = 1F;
this.mavlinkCheckBoxlong_fs.param = null;
this.mavlinkCheckBoxlong_fs.ParamName = null;
this.toolTip1.SetToolTip(this.mavlinkCheckBoxlong_fs, resources.GetString("mavlinkCheckBoxlong_fs.ToolTip"));
this.mavlinkCheckBoxlong_fs.UseVisualStyleBackColor = true;
//
// mavlinkCheckBoxthr_fs_action
//
resources.ApplyResources(this.mavlinkCheckBoxthr_fs_action, "mavlinkCheckBoxthr_fs_action");
this.mavlinkCheckBoxthr_fs_action.Name = "mavlinkCheckBoxthr_fs_action";
this.mavlinkCheckBoxthr_fs_action.OffValue = 0F;
this.mavlinkCheckBoxthr_fs_action.OnValue = 1F;
this.mavlinkCheckBoxthr_fs_action.param = null;
this.mavlinkCheckBoxthr_fs_action.ParamName = null;
this.toolTip1.SetToolTip(this.mavlinkCheckBoxthr_fs_action, resources.GetString("mavlinkCheckBoxthr_fs_action.ToolTip"));
this.mavlinkCheckBoxthr_fs_action.UseVisualStyleBackColor = true;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.mavlinkCheckBoxthr_fs);
this.groupBox1.Controls.Add(this.mavlinkCheckBoxthr_fs_action);
this.groupBox1.Controls.Add(this.mavlinkNumericUpDownthr_fs_value);
this.groupBox1.Controls.Add(this.mavlinkCheckBoxlong_fs);
this.groupBox1.Controls.Add(this.mavlinkCheckBoxgcs_fs);
this.groupBox1.Controls.Add(this.mavlinkCheckBoxshort_fs);
resources.ApplyResources(this.groupBox1, "groupBox1");
this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false;
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// ConfigFailSafe
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.mavlinkNumericUpDown1);
this.Controls.Add(this.mavlinkCheckBox1);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.LNK_wiki);
this.Controls.Add(this.lbl_currentmode);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
@ -346,7 +434,9 @@
this.Controls.Add(this.horizontalProgressBar1);
this.Name = "ConfigFailSafe";
((System.ComponentModel.ISupportInitialize)(this.currentStateBindingSource)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDown1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDownthr_fs_value)).EndInit();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@ -374,7 +464,15 @@
private HorizontalProgressBar horizontalProgressBar2;
private HorizontalProgressBar horizontalProgressBar1;
private System.Windows.Forms.Label lbl_currentmode;
private Controls.MavlinkCheckBox mavlinkCheckBox1;
private Controls.MavlinkNumericUpDown mavlinkNumericUpDown1;
private Controls.MavlinkCheckBox mavlinkCheckBoxthr_fs;
private Controls.MavlinkNumericUpDown mavlinkNumericUpDownthr_fs_value;
private System.Windows.Forms.LinkLabel LNK_wiki;
private Controls.MavlinkCheckBox mavlinkCheckBoxgcs_fs;
private System.Windows.Forms.ToolTip toolTip1;
private Controls.MavlinkCheckBox mavlinkCheckBoxshort_fs;
private Controls.MavlinkCheckBox mavlinkCheckBoxlong_fs;
private Controls.MavlinkCheckBox mavlinkCheckBoxthr_fs_action;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label3;
}
}

View File

@ -8,20 +8,19 @@ using System.Text;
using System.Windows.Forms;
using ArdupilotMega.Controls.BackstageView;
using ArdupilotMega.Controls;
using System.Diagnostics;
namespace ArdupilotMega.GCSViews.ConfigurationView
{
public partial class ConfigFailSafe : UserControl, IActivate, IDeactivate
{
Timer timer = new Timer();
//
public ConfigFailSafe()
{
InitializeComponent();
mavlinkCheckBox1.setup(1, 0, "THR_FAILSAFE", MainV2.comPort.param);
mavlinkNumericUpDown1.setup(800, 1200, 1, 1, "THR_FS_VALUE", MainV2.comPort.param);
// setup rc update
timer.Tick += new EventHandler(timer_Tick);
}
@ -43,11 +42,23 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
public void Activate()
{
mavlinkCheckBoxthr_fs.setup(1, 0, "THR_FAILSAFE", MainV2.comPort.param, mavlinkNumericUpDownthr_fs_value);
mavlinkNumericUpDownthr_fs_value.setup(800, 1200, 1, 1, "THR_FS_VALUE", MainV2.comPort.param);
mavlinkCheckBoxthr_fs_action.setup(1, 0, "THR_FS_ACTION",MainV2.comPort.param);
mavlinkCheckBoxgcs_fs.setup(1, 0, "FS_GCS_ENABL", MainV2.comPort.param);
mavlinkCheckBoxshort_fs.setup(1, 0, "FS_SHORT_ACTN", MainV2.comPort.param);
mavlinkCheckBoxlong_fs.setup(1, 0, "FS_LONG_ACTN", MainV2.comPort.param);
timer.Enabled = true;
timer.Interval = 100;
timer.Start();
CustomMessageBox.Show("Ensure your props are not on the Plane/Quad","FailSafe",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
}
private void LNK_wiki_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process.Start(new ProcessStartInfo("http://code.google.com/p/ardupilot-mega/wiki/APM2xFailsafe"));
}
}
}

View File

@ -199,7 +199,7 @@
<value>horizontalProgressBar9</value>
</data>
<data name="&gt;&gt;horizontalProgressBar9.Type" xml:space="preserve">
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4640.13049, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4646.37607, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;horizontalProgressBar9.Parent" xml:space="preserve">
<value>$this</value>
@ -223,7 +223,7 @@
<value>horizontalProgressBar10</value>
</data>
<data name="&gt;&gt;horizontalProgressBar10.Type" xml:space="preserve">
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4640.13049, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4646.37607, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;horizontalProgressBar10.Parent" xml:space="preserve">
<value>$this</value>
@ -247,7 +247,7 @@
<value>horizontalProgressBar11</value>
</data>
<data name="&gt;&gt;horizontalProgressBar11.Type" xml:space="preserve">
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4640.13049, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4646.37607, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;horizontalProgressBar11.Parent" xml:space="preserve">
<value>$this</value>
@ -271,7 +271,7 @@
<value>horizontalProgressBar12</value>
</data>
<data name="&gt;&gt;horizontalProgressBar12.Type" xml:space="preserve">
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4640.13049, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4646.37607, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;horizontalProgressBar12.Parent" xml:space="preserve">
<value>$this</value>
@ -295,7 +295,7 @@
<value>horizontalProgressBar13</value>
</data>
<data name="&gt;&gt;horizontalProgressBar13.Type" xml:space="preserve">
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4640.13049, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4646.37607, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;horizontalProgressBar13.Parent" xml:space="preserve">
<value>$this</value>
@ -319,7 +319,7 @@
<value>horizontalProgressBar14</value>
</data>
<data name="&gt;&gt;horizontalProgressBar14.Type" xml:space="preserve">
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4640.13049, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4646.37607, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;horizontalProgressBar14.Parent" xml:space="preserve">
<value>$this</value>
@ -343,7 +343,7 @@
<value>horizontalProgressBar15</value>
</data>
<data name="&gt;&gt;horizontalProgressBar15.Type" xml:space="preserve">
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4640.13049, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4646.37607, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;horizontalProgressBar15.Parent" xml:space="preserve">
<value>$this</value>
@ -367,7 +367,7 @@
<value>horizontalProgressBar16</value>
</data>
<data name="&gt;&gt;horizontalProgressBar16.Type" xml:space="preserve">
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4640.13049, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4646.37607, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;horizontalProgressBar16.Parent" xml:space="preserve">
<value>$this</value>
@ -391,7 +391,7 @@
<value>horizontalProgressBar8</value>
</data>
<data name="&gt;&gt;horizontalProgressBar8.Type" xml:space="preserve">
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4640.13049, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4646.37607, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;horizontalProgressBar8.Parent" xml:space="preserve">
<value>$this</value>
@ -415,7 +415,7 @@
<value>horizontalProgressBar7</value>
</data>
<data name="&gt;&gt;horizontalProgressBar7.Type" xml:space="preserve">
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4640.13049, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4646.37607, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;horizontalProgressBar7.Parent" xml:space="preserve">
<value>$this</value>
@ -439,7 +439,7 @@
<value>horizontalProgressBar6</value>
</data>
<data name="&gt;&gt;horizontalProgressBar6.Type" xml:space="preserve">
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4640.13049, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4646.37607, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;horizontalProgressBar6.Parent" xml:space="preserve">
<value>$this</value>
@ -463,7 +463,7 @@
<value>horizontalProgressBar5</value>
</data>
<data name="&gt;&gt;horizontalProgressBar5.Type" xml:space="preserve">
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4640.13049, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4646.37607, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;horizontalProgressBar5.Parent" xml:space="preserve">
<value>$this</value>
@ -487,7 +487,7 @@
<value>horizontalProgressBar4</value>
</data>
<data name="&gt;&gt;horizontalProgressBar4.Type" xml:space="preserve">
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4640.13049, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4646.37607, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;horizontalProgressBar4.Parent" xml:space="preserve">
<value>$this</value>
@ -511,7 +511,7 @@
<value>horizontalProgressBar3</value>
</data>
<data name="&gt;&gt;horizontalProgressBar3.Type" xml:space="preserve">
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4640.13049, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4646.37607, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;horizontalProgressBar3.Parent" xml:space="preserve">
<value>$this</value>
@ -535,7 +535,7 @@
<value>horizontalProgressBar2</value>
</data>
<data name="&gt;&gt;horizontalProgressBar2.Type" xml:space="preserve">
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4640.13049, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4646.37607, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;horizontalProgressBar2.Parent" xml:space="preserve">
<value>$this</value>
@ -559,7 +559,7 @@
<value>horizontalProgressBar1</value>
</data>
<data name="&gt;&gt;horizontalProgressBar1.Type" xml:space="preserve">
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4640.13049, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.HorizontalProgressBar, ArdupilotMegaPlanner10, Version=1.1.4646.37607, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;horizontalProgressBar1.Parent" xml:space="preserve">
<value>$this</value>
@ -577,7 +577,7 @@
<value>473, 21</value>
</data>
<data name="lbl_currentmode.Size" type="System.Drawing.Size, System.Drawing">
<value>275, 50</value>
<value>215, 50</value>
</data>
<data name="lbl_currentmode.TabIndex" type="System.Int32, mscorlib">
<value>140</value>
@ -600,58 +600,293 @@
<data name="&gt;&gt;lbl_currentmode.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="mavlinkCheckBox1.AutoSize" type="System.Boolean, mscorlib">
<data name="mavlinkCheckBoxthr_fs.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="mavlinkCheckBox1.Enabled" type="System.Boolean, mscorlib">
<data name="mavlinkCheckBoxthr_fs.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="mavlinkCheckBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>556, 94</value>
<data name="mavlinkCheckBoxthr_fs.Location" type="System.Drawing.Point, System.Drawing">
<value>6, 19</value>
</data>
<data name="mavlinkCheckBox1.Size" type="System.Drawing.Size, System.Drawing">
<data name="mavlinkCheckBoxthr_fs.Size" type="System.Drawing.Size, System.Drawing">
<value>103, 17</value>
</data>
<data name="mavlinkCheckBox1.TabIndex" type="System.Int32, mscorlib">
<data name="mavlinkCheckBoxthr_fs.TabIndex" type="System.Int32, mscorlib">
<value>141</value>
</data>
<data name="mavlinkCheckBox1.Text" xml:space="preserve">
<data name="mavlinkCheckBoxthr_fs.Text" xml:space="preserve">
<value>Throttle FailSafe</value>
</data>
<data name="&gt;&gt;mavlinkCheckBox1.Name" xml:space="preserve">
<value>mavlinkCheckBox1</value>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>214, 17</value>
</metadata>
<data name="mavlinkCheckBoxthr_fs.ToolTip" xml:space="preserve">
<value>Enable Failsafe on low throttle pwm</value>
</data>
<data name="&gt;&gt;mavlinkCheckBox1.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MavlinkCheckBox, ArdupilotMegaPlanner10, Version=1.1.4640.13049, Culture=neutral, PublicKeyToken=null</value>
<data name="&gt;&gt;mavlinkCheckBoxthr_fs.Name" xml:space="preserve">
<value>mavlinkCheckBoxthr_fs</value>
</data>
<data name="&gt;&gt;mavlinkCheckBox1.Parent" xml:space="preserve">
<value>$this</value>
<data name="&gt;&gt;mavlinkCheckBoxthr_fs.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MavlinkCheckBox, ArdupilotMegaPlanner10, Version=1.1.4646.37607, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;mavlinkCheckBox1.ZOrder" xml:space="preserve">
<data name="&gt;&gt;mavlinkCheckBoxthr_fs.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;mavlinkCheckBoxthr_fs.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="mavlinkNumericUpDown1.Enabled" type="System.Boolean, mscorlib">
<data name="mavlinkNumericUpDownthr_fs_value.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="mavlinkNumericUpDown1.Location" type="System.Drawing.Point, System.Drawing">
<value>556, 118</value>
<data name="mavlinkNumericUpDownthr_fs_value.Location" type="System.Drawing.Point, System.Drawing">
<value>42, 42</value>
</data>
<data name="mavlinkNumericUpDown1.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 20</value>
<data name="mavlinkNumericUpDownthr_fs_value.Size" type="System.Drawing.Size, System.Drawing">
<value>103, 20</value>
</data>
<data name="mavlinkNumericUpDown1.TabIndex" type="System.Int32, mscorlib">
<data name="mavlinkNumericUpDownthr_fs_value.TabIndex" type="System.Int32, mscorlib">
<value>142</value>
</data>
<data name="&gt;&gt;mavlinkNumericUpDown1.Name" xml:space="preserve">
<value>mavlinkNumericUpDown1</value>
<data name="mavlinkNumericUpDownthr_fs_value.ToolTip" xml:space="preserve">
<value>Trigger Throttle Pwm</value>
</data>
<data name="&gt;&gt;mavlinkNumericUpDown1.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MavlinkNumericUpDown, ArdupilotMegaPlanner10, Version=1.1.4640.13049, Culture=neutral, PublicKeyToken=null</value>
<data name="&gt;&gt;mavlinkNumericUpDownthr_fs_value.Name" xml:space="preserve">
<value>mavlinkNumericUpDownthr_fs_value</value>
</data>
<data name="&gt;&gt;mavlinkNumericUpDown1.Parent" xml:space="preserve">
<data name="&gt;&gt;mavlinkNumericUpDownthr_fs_value.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MavlinkNumericUpDown, ArdupilotMegaPlanner10, Version=1.1.4646.37607, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;mavlinkNumericUpDownthr_fs_value.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;mavlinkNumericUpDownthr_fs_value.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="LNK_wiki.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="LNK_wiki.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="LNK_wiki.Location" type="System.Drawing.Point, System.Drawing">
<value>657, 5</value>
</data>
<data name="LNK_wiki.Size" type="System.Drawing.Size, System.Drawing">
<value>28, 13</value>
</data>
<data name="LNK_wiki.TabIndex" type="System.Int32, mscorlib">
<value>143</value>
</data>
<data name="LNK_wiki.Text" xml:space="preserve">
<value>Wiki</value>
</data>
<data name="&gt;&gt;LNK_wiki.Name" xml:space="preserve">
<value>LNK_wiki</value>
</data>
<data name="&gt;&gt;LNK_wiki.Type" xml:space="preserve">
<value>System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;LNK_wiki.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;mavlinkNumericUpDown1.ZOrder" xml:space="preserve">
<data name="&gt;&gt;LNK_wiki.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="mavlinkCheckBoxgcs_fs.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="mavlinkCheckBoxgcs_fs.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="mavlinkCheckBoxgcs_fs.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="mavlinkCheckBoxgcs_fs.Location" type="System.Drawing.Point, System.Drawing">
<value>6, 92</value>
</data>
<data name="mavlinkCheckBoxgcs_fs.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 17</value>
</data>
<data name="mavlinkCheckBoxgcs_fs.TabIndex" type="System.Int32, mscorlib">
<value>144</value>
</data>
<data name="mavlinkCheckBoxgcs_fs.Text" xml:space="preserve">
<value>GCS FailSafe</value>
</data>
<data name="mavlinkCheckBoxgcs_fs.ToolTip" xml:space="preserve">
<value>Enable Failsafe on GCS loss of communication</value>
</data>
<data name="&gt;&gt;mavlinkCheckBoxgcs_fs.Name" xml:space="preserve">
<value>mavlinkCheckBoxgcs_fs</value>
</data>
<data name="&gt;&gt;mavlinkCheckBoxgcs_fs.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MavlinkCheckBox, ArdupilotMegaPlanner10, Version=1.1.4646.37607, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;mavlinkCheckBoxgcs_fs.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;mavlinkCheckBoxgcs_fs.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="mavlinkCheckBoxshort_fs.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="mavlinkCheckBoxshort_fs.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="mavlinkCheckBoxshort_fs.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="mavlinkCheckBoxshort_fs.Location" type="System.Drawing.Point, System.Drawing">
<value>6, 115</value>
</data>
<data name="mavlinkCheckBoxshort_fs.Size" type="System.Drawing.Size, System.Drawing">
<value>127, 17</value>
</data>
<data name="mavlinkCheckBoxshort_fs.TabIndex" type="System.Int32, mscorlib">
<value>145</value>
</data>
<data name="mavlinkCheckBoxshort_fs.Text" xml:space="preserve">
<value>FailSafe Short (1 sec)</value>
</data>
<data name="mavlinkCheckBoxshort_fs.ToolTip" xml:space="preserve">
<value>Off, no Action, On, RTL</value>
</data>
<data name="&gt;&gt;mavlinkCheckBoxshort_fs.Name" xml:space="preserve">
<value>mavlinkCheckBoxshort_fs</value>
</data>
<data name="&gt;&gt;mavlinkCheckBoxshort_fs.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MavlinkCheckBox, ArdupilotMegaPlanner10, Version=1.1.4646.37607, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;mavlinkCheckBoxshort_fs.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;mavlinkCheckBoxshort_fs.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="mavlinkCheckBoxlong_fs.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="mavlinkCheckBoxlong_fs.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="mavlinkCheckBoxlong_fs.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="mavlinkCheckBoxlong_fs.Location" type="System.Drawing.Point, System.Drawing">
<value>6, 138</value>
</data>
<data name="mavlinkCheckBoxlong_fs.Size" type="System.Drawing.Size, System.Drawing">
<value>132, 17</value>
</data>
<data name="mavlinkCheckBoxlong_fs.TabIndex" type="System.Int32, mscorlib">
<value>146</value>
</data>
<data name="mavlinkCheckBoxlong_fs.Text" xml:space="preserve">
<value>FailSafe Long (20 sec)</value>
</data>
<data name="mavlinkCheckBoxlong_fs.ToolTip" xml:space="preserve">
<value>Off, no Action, On, RTL</value>
</data>
<data name="&gt;&gt;mavlinkCheckBoxlong_fs.Name" xml:space="preserve">
<value>mavlinkCheckBoxlong_fs</value>
</data>
<data name="&gt;&gt;mavlinkCheckBoxlong_fs.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MavlinkCheckBox, ArdupilotMegaPlanner10, Version=1.1.4646.37607, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;mavlinkCheckBoxlong_fs.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;mavlinkCheckBoxlong_fs.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="mavlinkCheckBoxthr_fs_action.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="mavlinkCheckBoxthr_fs_action.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="mavlinkCheckBoxthr_fs_action.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="mavlinkCheckBoxthr_fs_action.Location" type="System.Drawing.Point, System.Drawing">
<value>6, 69</value>
</data>
<data name="mavlinkCheckBoxthr_fs_action.Size" type="System.Drawing.Size, System.Drawing">
<value>134, 17</value>
</data>
<data name="mavlinkCheckBoxthr_fs_action.TabIndex" type="System.Int32, mscorlib">
<value>147</value>
</data>
<data name="mavlinkCheckBoxthr_fs_action.Text" xml:space="preserve">
<value>Throttle Failsafe Action</value>
</data>
<data name="mavlinkCheckBoxthr_fs_action.ToolTip" xml:space="preserve">
<value>Arducopter Auto: Off, no Action, On, RTL
Arducopter Other: if have gps, RTL, Otherwise Land</value>
</data>
<data name="&gt;&gt;mavlinkCheckBoxthr_fs_action.Name" xml:space="preserve">
<value>mavlinkCheckBoxthr_fs_action</value>
</data>
<data name="&gt;&gt;mavlinkCheckBoxthr_fs_action.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MavlinkCheckBox, ArdupilotMegaPlanner10, Version=1.1.4646.37607, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;mavlinkCheckBoxthr_fs_action.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;mavlinkCheckBoxthr_fs_action.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>6, 48</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>30, 13</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>148</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Pwm</value>
</data>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</value>
</data>
<data name="&gt;&gt;label3.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>495, 76</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>170, 167</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>148</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>FailSafe Options</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;groupBox1.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">
@ -661,7 +896,7 @@
<value>6, 13</value>
</data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>751, 478</value>
<value>688, 448</value>
</data>
<data name="&gt;&gt;currentStateBindingSource.Name" xml:space="preserve">
<value>currentStateBindingSource</value>
@ -669,6 +904,12 @@
<data name="&gt;&gt;currentStateBindingSource.Type" xml:space="preserve">
<value>System.Windows.Forms.BindingSource, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolTip1.Name" xml:space="preserve">
<value>toolTip1</value>
</data>
<data name="&gt;&gt;toolTip1.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolTip, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>ConfigFailSafe</value>
</data>

View File

@ -83,7 +83,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
CHK_revch3.Checked = MainV2.comPort.param["RC3_REV"].ToString() == "-1";
CHK_revch4.Checked = MainV2.comPort.param["RC4_REV"].ToString() == "-1";
}
catch (Exception ex) { /*CustomMessageBox.Show("Missing RC rev Param " + ex.ToString());*/ }
catch {}//(Exception ex) { CustomMessageBox.Show("Missing RC rev Param " + ex.ToString()); }
startup = false;
}

View File

@ -140,6 +140,12 @@
resources.ApplyResources(this.RawValue, "RawValue");
this.RawValue.Name = "RawValue";
//
// toolTip1
//
this.toolTip1.AutoPopDelay = 20000;
this.toolTip1.InitialDelay = 500;
this.toolTip1.ReshowDelay = 100;
//
// ConfigRawParams
//
resources.ApplyResources(this, "$this");

View File

@ -142,7 +142,7 @@
<value>BUT_compare</value>
</data>
<data name="&gt;&gt;BUT_compare.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4491.33622, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4646.35335, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_compare.Parent" xml:space="preserve">
<value>$this</value>
@ -172,7 +172,7 @@
<value>BUT_rerequestparams</value>
</data>
<data name="&gt;&gt;BUT_rerequestparams.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4491.33622, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4646.35335, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_rerequestparams.Parent" xml:space="preserve">
<value>$this</value>
@ -202,7 +202,7 @@
<value>BUT_writePIDS</value>
</data>
<data name="&gt;&gt;BUT_writePIDS.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4491.33622, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4646.35335, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_writePIDS.Parent" xml:space="preserve">
<value>$this</value>
@ -235,7 +235,7 @@
<value>BUT_save</value>
</data>
<data name="&gt;&gt;BUT_save.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4491.33622, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4646.35335, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_save.Parent" xml:space="preserve">
<value>$this</value>
@ -268,7 +268,7 @@
<value>BUT_load</value>
</data>
<data name="&gt;&gt;BUT_load.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4491.33622, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4646.35335, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_load.Parent" xml:space="preserve">
<value>$this</value>
@ -397,6 +397,6 @@
<value>ConfigRawParams</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.BackstageView.BackStageViewContentPanel, ArdupilotMegaPlanner, Version=1.1.4491.33622, Culture=neutral, PublicKeyToken=null</value>
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

View File

@ -33,14 +33,12 @@
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.H_SWASH_TYPE = new System.Windows.Forms.RadioButton();
this.CCPM = new System.Windows.Forms.RadioButton();
this.BUT_swash_manual = new ArdupilotMega.Controls.MyButton();
this.label41 = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.label46 = new System.Windows.Forms.Label();
this.label45 = new System.Windows.Forms.Label();
this.H_GYR_ENABLE = new System.Windows.Forms.CheckBox();
this.H_GYR_GAIN = new System.Windows.Forms.TextBox();
this.BUT_HS4save = new ArdupilotMega.Controls.MyButton();
this.label21 = new System.Windows.Forms.Label();
this.H_COL_MIN = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
@ -60,9 +58,7 @@
this.label37 = new System.Windows.Forms.Label();
this.label36 = new System.Windows.Forms.Label();
this.label26 = new System.Windows.Forms.Label();
this.H_PIT_MAX = new System.Windows.Forms.TextBox();
this.label25 = new System.Windows.Forms.Label();
this.H_ROL_MAX = new System.Windows.Forms.TextBox();
this.label23 = new System.Windows.Forms.Label();
this.label22 = new System.Windows.Forms.Label();
this.label20 = new System.Windows.Forms.Label();
@ -75,15 +71,27 @@
this.HS2_REV = new System.Windows.Forms.CheckBox();
this.HS1_REV = new System.Windows.Forms.CheckBox();
this.label17 = new System.Windows.Forms.Label();
this.HS4 = new ArdupilotMega.HorizontalProgressBar2();
this.currentStateBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.HS3 = new ArdupilotMega.VerticalProgressBar2();
this.Gservoloc = new AGaugeApp.AGauge();
this.label44 = new System.Windows.Forms.Label();
this.label43 = new System.Windows.Forms.Label();
this.label42 = new System.Windows.Forms.Label();
this.HS4_TRIM = new System.Windows.Forms.NumericUpDown();
this.HS4_REV = new System.Windows.Forms.CheckBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.mavlinkNumericUpDown3max = new ArdupilotMega.Controls.MavlinkNumericUpDown();
this.mavlinkNumericUpDown3min = new ArdupilotMega.Controls.MavlinkNumericUpDown();
this.mavlinkNumericUpDown2max = new ArdupilotMega.Controls.MavlinkNumericUpDown();
this.mavlinkNumericUpDown2min = new ArdupilotMega.Controls.MavlinkNumericUpDown();
this.mavlinkNumericUpDown1max = new ArdupilotMega.Controls.MavlinkNumericUpDown();
this.mavlinkNumericUpDown1min = new ArdupilotMega.Controls.MavlinkNumericUpDown();
this.BUT_swash_manual = new ArdupilotMega.Controls.MyButton();
this.BUT_HS4save = new ArdupilotMega.Controls.MyButton();
this.HS4 = new ArdupilotMega.HorizontalProgressBar2();
this.currentStateBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.HS3 = new ArdupilotMega.VerticalProgressBar2();
this.Gservoloc = new AGaugeApp.AGauge();
this.mavlinkNumericUpDownrollmax = new ArdupilotMega.Controls.MavlinkNumericUpDown();
this.mavlinkNumericUpDownpitchmax = new ArdupilotMega.Controls.MavlinkNumericUpDown();
this.groupBox5.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox1.SuspendLayout();
@ -91,8 +99,16 @@
((System.ComponentModel.ISupportInitialize)(this.HS3_TRIM)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.HS2_TRIM)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.HS1_TRIM)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.currentStateBindingSource)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.HS4_TRIM)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDown3max)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDown3min)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDown2max)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDown2min)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDown1max)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDown1min)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.currentStateBindingSource)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDownrollmax)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDownpitchmax)).BeginInit();
this.SuspendLayout();
//
// groupBox5
@ -118,13 +134,6 @@
this.CCPM.TabStop = true;
this.CCPM.UseVisualStyleBackColor = true;
//
// BUT_swash_manual
//
resources.ApplyResources(this.BUT_swash_manual, "BUT_swash_manual");
this.BUT_swash_manual.Name = "BUT_swash_manual";
this.BUT_swash_manual.UseVisualStyleBackColor = true;
this.BUT_swash_manual.Click += new System.EventHandler(this.BUT_swash_manual_Click);
//
// label41
//
resources.ApplyResources(this.label41, "label41");
@ -163,13 +172,6 @@
this.H_GYR_GAIN.Name = "H_GYR_GAIN";
this.H_GYR_GAIN.Validating += new System.ComponentModel.CancelEventHandler(this.GYR_GAIN__Validating);
//
// BUT_HS4save
//
resources.ApplyResources(this.BUT_HS4save, "BUT_HS4save");
this.BUT_HS4save.Name = "BUT_HS4save";
this.BUT_HS4save.UseVisualStyleBackColor = true;
this.BUT_HS4save.Click += new System.EventHandler(this.BUT_HS4save_Click);
//
// label21
//
resources.ApplyResources(this.label21, "label21");
@ -335,23 +337,11 @@
resources.ApplyResources(this.label26, "label26");
this.label26.Name = "label26";
//
// H_PIT_MAX
//
resources.ApplyResources(this.H_PIT_MAX, "H_PIT_MAX");
this.H_PIT_MAX.Name = "H_PIT_MAX";
this.H_PIT_MAX.Validating += new System.ComponentModel.CancelEventHandler(this.PIT_MAX__Validating);
//
// label25
//
resources.ApplyResources(this.label25, "label25");
this.label25.Name = "label25";
//
// H_ROL_MAX
//
resources.ApplyResources(this.H_ROL_MAX, "H_ROL_MAX");
this.H_ROL_MAX.Name = "H_ROL_MAX";
this.H_ROL_MAX.Validating += new System.ComponentModel.CancelEventHandler(this.ROL_MAX__Validating);
//
// label23
//
resources.ApplyResources(this.label23, "label23");
@ -421,6 +411,127 @@
resources.ApplyResources(this.label17, "label17");
this.label17.Name = "label17";
//
// label44
//
resources.ApplyResources(this.label44, "label44");
this.label44.Name = "label44";
//
// label43
//
resources.ApplyResources(this.label43, "label43");
this.label43.Name = "label43";
//
// label42
//
resources.ApplyResources(this.label42, "label42");
this.label42.Name = "label42";
//
// HS4_TRIM
//
resources.ApplyResources(this.HS4_TRIM, "HS4_TRIM");
this.HS4_TRIM.Maximum = new decimal(new int[] {
2000,
0,
0,
0});
this.HS4_TRIM.Minimum = new decimal(new int[] {
1000,
0,
0,
0});
this.HS4_TRIM.Name = "HS4_TRIM";
this.HS4_TRIM.Value = new decimal(new int[] {
1500,
0,
0,
0});
this.HS4_TRIM.ValueChanged += new System.EventHandler(this.HS4_TRIM_ValueChanged);
//
// HS4_REV
//
resources.ApplyResources(this.HS4_REV, "HS4_REV");
this.HS4_REV.Name = "HS4_REV";
this.HS4_REV.UseVisualStyleBackColor = true;
this.HS4_REV.CheckedChanged += new System.EventHandler(this.HS4_REV_CheckedChanged);
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.Name = "label2";
//
// mavlinkNumericUpDown3max
//
resources.ApplyResources(this.mavlinkNumericUpDown3max, "mavlinkNumericUpDown3max");
this.mavlinkNumericUpDown3max.Max = 1F;
this.mavlinkNumericUpDown3max.Min = 0F;
this.mavlinkNumericUpDown3max.Name = "mavlinkNumericUpDown3max";
this.mavlinkNumericUpDown3max.param = null;
this.mavlinkNumericUpDown3max.ParamName = null;
//
// mavlinkNumericUpDown3min
//
resources.ApplyResources(this.mavlinkNumericUpDown3min, "mavlinkNumericUpDown3min");
this.mavlinkNumericUpDown3min.Max = 1F;
this.mavlinkNumericUpDown3min.Min = 0F;
this.mavlinkNumericUpDown3min.Name = "mavlinkNumericUpDown3min";
this.mavlinkNumericUpDown3min.param = null;
this.mavlinkNumericUpDown3min.ParamName = null;
//
// mavlinkNumericUpDown2max
//
resources.ApplyResources(this.mavlinkNumericUpDown2max, "mavlinkNumericUpDown2max");
this.mavlinkNumericUpDown2max.Max = 1F;
this.mavlinkNumericUpDown2max.Min = 0F;
this.mavlinkNumericUpDown2max.Name = "mavlinkNumericUpDown2max";
this.mavlinkNumericUpDown2max.param = null;
this.mavlinkNumericUpDown2max.ParamName = null;
//
// mavlinkNumericUpDown2min
//
resources.ApplyResources(this.mavlinkNumericUpDown2min, "mavlinkNumericUpDown2min");
this.mavlinkNumericUpDown2min.Max = 1F;
this.mavlinkNumericUpDown2min.Min = 0F;
this.mavlinkNumericUpDown2min.Name = "mavlinkNumericUpDown2min";
this.mavlinkNumericUpDown2min.param = null;
this.mavlinkNumericUpDown2min.ParamName = null;
//
// mavlinkNumericUpDown1max
//
resources.ApplyResources(this.mavlinkNumericUpDown1max, "mavlinkNumericUpDown1max");
this.mavlinkNumericUpDown1max.Max = 1F;
this.mavlinkNumericUpDown1max.Min = 0F;
this.mavlinkNumericUpDown1max.Name = "mavlinkNumericUpDown1max";
this.mavlinkNumericUpDown1max.param = null;
this.mavlinkNumericUpDown1max.ParamName = null;
//
// mavlinkNumericUpDown1min
//
resources.ApplyResources(this.mavlinkNumericUpDown1min, "mavlinkNumericUpDown1min");
this.mavlinkNumericUpDown1min.Max = 1F;
this.mavlinkNumericUpDown1min.Min = 0F;
this.mavlinkNumericUpDown1min.Name = "mavlinkNumericUpDown1min";
this.mavlinkNumericUpDown1min.param = null;
this.mavlinkNumericUpDown1min.ParamName = null;
//
// BUT_swash_manual
//
resources.ApplyResources(this.BUT_swash_manual, "BUT_swash_manual");
this.BUT_swash_manual.Name = "BUT_swash_manual";
this.BUT_swash_manual.UseVisualStyleBackColor = true;
this.BUT_swash_manual.Click += new System.EventHandler(this.BUT_swash_manual_Click);
//
// BUT_HS4save
//
resources.ApplyResources(this.BUT_HS4save, "BUT_HS4save");
this.BUT_HS4save.Name = "BUT_HS4save";
this.BUT_HS4save.UseVisualStyleBackColor = true;
this.BUT_HS4save.Click += new System.EventHandler(this.BUT_HS4save_Click);
//
// HS4
//
this.HS4.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(67)))), ((int)(((byte)(68)))), ((int)(((byte)(69)))));
@ -600,53 +711,38 @@
this.Gservoloc.Value2 = 180F;
this.Gservoloc.Value3 = 0F;
//
// label44
// mavlinkNumericUpDownrollmax
//
resources.ApplyResources(this.label44, "label44");
this.label44.Name = "label44";
resources.ApplyResources(this.mavlinkNumericUpDownrollmax, "mavlinkNumericUpDownrollmax");
this.mavlinkNumericUpDownrollmax.Max = 1F;
this.mavlinkNumericUpDownrollmax.Min = 0F;
this.mavlinkNumericUpDownrollmax.Name = "mavlinkNumericUpDownrollmax";
this.mavlinkNumericUpDownrollmax.param = null;
this.mavlinkNumericUpDownrollmax.ParamName = null;
//
// label43
// mavlinkNumericUpDownpitchmax
//
resources.ApplyResources(this.label43, "label43");
this.label43.Name = "label43";
//
// label42
//
resources.ApplyResources(this.label42, "label42");
this.label42.Name = "label42";
//
// HS4_TRIM
//
resources.ApplyResources(this.HS4_TRIM, "HS4_TRIM");
this.HS4_TRIM.Maximum = new decimal(new int[] {
2000,
0,
0,
0});
this.HS4_TRIM.Minimum = new decimal(new int[] {
1000,
0,
0,
0});
this.HS4_TRIM.Name = "HS4_TRIM";
this.HS4_TRIM.Value = new decimal(new int[] {
1500,
0,
0,
0});
this.HS4_TRIM.ValueChanged += new System.EventHandler(this.HS4_TRIM_ValueChanged);
//
// HS4_REV
//
resources.ApplyResources(this.HS4_REV, "HS4_REV");
this.HS4_REV.Name = "HS4_REV";
this.HS4_REV.UseVisualStyleBackColor = true;
this.HS4_REV.CheckedChanged += new System.EventHandler(this.HS4_REV_CheckedChanged);
resources.ApplyResources(this.mavlinkNumericUpDownpitchmax, "mavlinkNumericUpDownpitchmax");
this.mavlinkNumericUpDownpitchmax.Max = 1F;
this.mavlinkNumericUpDownpitchmax.Min = 0F;
this.mavlinkNumericUpDownpitchmax.Name = "mavlinkNumericUpDownpitchmax";
this.mavlinkNumericUpDownpitchmax.param = null;
this.mavlinkNumericUpDownpitchmax.ParamName = null;
//
// ConfigTradHeli
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.mavlinkNumericUpDownpitchmax);
this.Controls.Add(this.mavlinkNumericUpDownrollmax);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.mavlinkNumericUpDown3max);
this.Controls.Add(this.mavlinkNumericUpDown3min);
this.Controls.Add(this.mavlinkNumericUpDown2max);
this.Controls.Add(this.mavlinkNumericUpDown2min);
this.Controls.Add(this.mavlinkNumericUpDown1max);
this.Controls.Add(this.mavlinkNumericUpDown1min);
this.Controls.Add(this.label44);
this.Controls.Add(this.label43);
this.Controls.Add(this.label42);
@ -666,9 +762,7 @@
this.Controls.Add(this.label37);
this.Controls.Add(this.label36);
this.Controls.Add(this.label26);
this.Controls.Add(this.H_PIT_MAX);
this.Controls.Add(this.label25);
this.Controls.Add(this.H_ROL_MAX);
this.Controls.Add(this.label23);
this.Controls.Add(this.label22);
this.Controls.Add(this.label20);
@ -696,8 +790,16 @@
((System.ComponentModel.ISupportInitialize)(this.HS3_TRIM)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.HS2_TRIM)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.HS1_TRIM)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.currentStateBindingSource)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.HS4_TRIM)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDown3max)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDown3min)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDown2max)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDown2min)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDown1max)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDown1min)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.currentStateBindingSource)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDownrollmax)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDownpitchmax)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@ -735,9 +837,7 @@
private System.Windows.Forms.Label label37;
private System.Windows.Forms.Label label36;
private System.Windows.Forms.Label label26;
private System.Windows.Forms.TextBox H_PIT_MAX;
private System.Windows.Forms.Label label25;
private System.Windows.Forms.TextBox H_ROL_MAX;
private System.Windows.Forms.Label label23;
private System.Windows.Forms.Label label22;
private System.Windows.Forms.Label label20;
@ -759,5 +859,15 @@
private System.Windows.Forms.Label label42;
private System.Windows.Forms.NumericUpDown HS4_TRIM;
private System.Windows.Forms.CheckBox HS4_REV;
private Controls.MavlinkNumericUpDown mavlinkNumericUpDown1min;
private Controls.MavlinkNumericUpDown mavlinkNumericUpDown1max;
private Controls.MavlinkNumericUpDown mavlinkNumericUpDown2max;
private Controls.MavlinkNumericUpDown mavlinkNumericUpDown2min;
private Controls.MavlinkNumericUpDown mavlinkNumericUpDown3max;
private Controls.MavlinkNumericUpDown mavlinkNumericUpDown3min;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private Controls.MavlinkNumericUpDown mavlinkNumericUpDownrollmax;
private Controls.MavlinkNumericUpDown mavlinkNumericUpDownpitchmax;
}
}

View File

@ -383,6 +383,16 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
timer.Interval = 100;
timer.Start();
mavlinkNumericUpDown1min.setup(800,1400,1,1,"HS1_MIN",MainV2.comPort.param);
mavlinkNumericUpDown1max.setup(1600,2200,1,1,"HS1_MAX",MainV2.comPort.param);
mavlinkNumericUpDown2min.setup(800, 1400, 1, 1, "HS2_MIN", MainV2.comPort.param);
mavlinkNumericUpDown2max.setup(1600, 2200, 1, 1, "HS2_MAX", MainV2.comPort.param);
mavlinkNumericUpDown3min.setup(800, 1400, 1, 1, "HS3_MIN", MainV2.comPort.param);
mavlinkNumericUpDown3max.setup(1600, 2200, 1, 1, "HS3_MAX", MainV2.comPort.param);
mavlinkNumericUpDownpitchmax.setup(10, 65, 100, 1, "H_PIT_MAX", MainV2.comPort.param);
mavlinkNumericUpDownrollmax.setup(10, 65, 100, 1, "H_ROL_MAX", MainV2.comPort.param);
startup = true;
try
{

View File

@ -10,6 +10,8 @@ using log4net;
using ArdupilotMega.Arduino;
using ArdupilotMega.Utilities;
using System.Text.RegularExpressions;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
namespace ArdupilotMega.GCSViews
{
@ -84,9 +86,13 @@ namespace ArdupilotMega.GCSViews
software temp = new software();
// this is for mono to a ssl server
//ServicePointManager.CertificatePolicy = new NoCheckCertificatePolicy();
ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback((sender1, certificate, chain, policyErrors) => { return true; });
try
{
log.Info("url: "+firmwareurl);
using (XmlTextReader xmlreader = new XmlTextReader(firmwareurl))
{
while (xmlreader.Read())
@ -147,6 +153,7 @@ namespace ArdupilotMega.GCSViews
}
catch (Exception ex)
{
log.Error(ex);
CustomMessageBox.Show("Failed to get Firmware List : " + ex.Message);
}
log.Info("FW load done");

View File

@ -8,8 +8,8 @@
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FlightData));
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
this.contextMenuStripMap = new System.Windows.Forms.ContextMenuStrip(this.components);
this.goHereToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.flyToHereAltToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -35,6 +35,8 @@
this.quickView2 = new ArdupilotMega.Controls.QuickView();
this.quickView1 = new ArdupilotMega.Controls.QuickView();
this.tabActions = new System.Windows.Forms.TabPage();
this.modifyandSetAlt = new ArdupilotMega.Controls.ModifyandSet();
this.BUT_ARM = new ArdupilotMega.Controls.MyButton();
this.BUT_script = new ArdupilotMega.Controls.MyButton();
this.BUT_joystick = new ArdupilotMega.Controls.MyButton();
this.BUT_quickmanual = new ArdupilotMega.Controls.MyButton();
@ -229,7 +231,7 @@
this.hud1.opengl = true;
this.hud1.pitch = 0F;
this.hud1.roll = 0F;
this.hud1.status = 0;
this.hud1.status = false;
this.hud1.streamjpg = null;
this.hud1.targetalt = 0F;
this.hud1.targetheading = 0F;
@ -384,10 +386,13 @@
this.quickView1.Name = "quickView1";
this.quickView1.number = 0D;
this.quickView1.numberColor = System.Drawing.Color.FromArgb(((int)(((byte)(209)))), ((int)(((byte)(151)))), ((int)(((byte)(248)))));
this.toolTip1.SetToolTip(this.quickView1, resources.GetString("quickView1.ToolTip"));
this.quickView1.DoubleClick += new System.EventHandler(this.quickView_DoubleClick);
//
// tabActions
//
this.tabActions.Controls.Add(this.modifyandSetAlt);
this.tabActions.Controls.Add(this.BUT_ARM);
this.tabActions.Controls.Add(this.BUT_script);
this.tabActions.Controls.Add(this.BUT_joystick);
this.tabActions.Controls.Add(this.BUT_quickmanual);
@ -407,6 +412,26 @@
this.tabActions.Name = "tabActions";
this.tabActions.UseVisualStyleBackColor = true;
//
// modifyandSetAlt
//
this.modifyandSetAlt.ButtonText = "Change Alt";
resources.ApplyResources(this.modifyandSetAlt, "modifyandSetAlt");
this.modifyandSetAlt.Name = "modifyandSetAlt";
this.modifyandSetAlt.Value = new decimal(new int[] {
100,
0,
0,
0});
this.modifyandSetAlt.Click += new System.EventHandler(this.modifyandSetAlt_Click);
//
// BUT_ARM
//
resources.ApplyResources(this.BUT_ARM, "BUT_ARM");
this.BUT_ARM.Name = "BUT_ARM";
this.toolTip1.SetToolTip(this.BUT_ARM, resources.GetString("BUT_ARM.ToolTip"));
this.BUT_ARM.UseVisualStyleBackColor = true;
this.BUT_ARM.Click += new System.EventHandler(this.BUT_ARM_Click);
//
// BUT_script
//
resources.ApplyResources(this.BUT_script, "BUT_script");
@ -1243,8 +1268,8 @@
//
// dataGridViewImageColumn1
//
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.dataGridViewImageColumn1.DefaultCellStyle = dataGridViewCellStyle1;
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.dataGridViewImageColumn1.DefaultCellStyle = dataGridViewCellStyle3;
resources.ApplyResources(this.dataGridViewImageColumn1, "dataGridViewImageColumn1");
this.dataGridViewImageColumn1.Image = global::ArdupilotMega.Properties.Resources.up;
this.dataGridViewImageColumn1.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Stretch;
@ -1252,8 +1277,8 @@
//
// dataGridViewImageColumn2
//
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.dataGridViewImageColumn2.DefaultCellStyle = dataGridViewCellStyle2;
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.dataGridViewImageColumn2.DefaultCellStyle = dataGridViewCellStyle4;
resources.ApplyResources(this.dataGridViewImageColumn2, "dataGridViewImageColumn2");
this.dataGridViewImageColumn2.Image = global::ArdupilotMega.Properties.Resources.down;
this.dataGridViewImageColumn2.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Stretch;
@ -1412,5 +1437,8 @@
private Crom.Controls.Docking.DockContainer dockContainer1;
private System.Windows.Forms.ContextMenuStrip contextMenuStripDockContainer;
private System.Windows.Forms.ToolStripMenuItem resetToolStripMenuItem;
private Controls.MyButton BUT_ARM;
private Controls.ModifyandSet modifyandSetAlt;
}
}

View File

@ -68,13 +68,12 @@ namespace ArdupilotMega.GCSViews
internal static GMapOverlay kmlpolygons;
internal static GMapOverlay geofence;
Dictionary<Guid, Form> formguids = new Dictionary<Guid,Form>();
Dictionary<Guid, Form> formguids = new Dictionary<Guid, Form>();
bool huddropout = false;
bool huddropoutresize = false;
private DockStateSerializer _serializer = null;
DockableFormInfo dockhud;
List<PointLatLng> trackPoints = new List<PointLatLng>();
@ -99,8 +98,11 @@ namespace ArdupilotMega.GCSViews
threadrun = 0;
MainV2.comPort.logreadmode = false;
MainV2.config["FlightSplitter"] = hud1.Width;
_serializer.Save();
SaveWindowLayout();
if (!MainV2.MONO)
{
_serializer.Save();
SaveWindowLayout();
}
System.Threading.Thread.Sleep(100);
base.Dispose(disposing);
}
@ -230,25 +232,31 @@ namespace ArdupilotMega.GCSViews
}
catch { }
SetupDocking();
if (File.Exists(_serializer.SavePath) == true)
if (MainV2.MONO)
{
try
{
_serializer.Load(true, GetFormFromGuid);
}
catch { }
MainH.Dock = DockStyle.Fill;
MainH.Visible = true;
}
else
{
SetupDocking();
cleanupDocks();
if (File.Exists(_serializer.SavePath) == true)
{
try
{
_serializer.Load(true, GetFormFromGuid);
}
catch { }
}
}
}
void SetupDocking()
{
this.SuspendLayout();
dockhud = CreateFormAndGuid(dockContainer1, hud1, "fd_hud_guid");
DockableFormInfo dockhud = CreateFormAndGuid(dockContainer1, hud1, "fd_hud_guid");
DockableFormInfo dockmap = CreateFormAndGuid(dockContainer1, tableMap, "fd_map_guid");
DockableFormInfo dockquick = CreateFormAndGuid(dockContainer1, tabQuick, "fd_quick_guid");
DockableFormInfo dockactions = CreateFormAndGuid(dockContainer1, tabActions, "fd_actions_guid");
@ -256,7 +264,6 @@ namespace ArdupilotMega.GCSViews
DockableFormInfo dockstatus = CreateFormAndGuid(dockContainer1, tabStatus, "fd_status_guid");
DockableFormInfo docktlogs = CreateFormAndGuid(dockContainer1, tabTLogs, "fd_tlogs_guid");
dockContainer1.DockForm(dockmap, DockStyle.Fill, zDockMode.Outer);
dockContainer1.DockForm(dockquick, DockStyle.Right, zDockMode.Outer);
dockContainer1.DockForm(dockhud, DockStyle.Left, zDockMode.Outer);
@ -275,6 +282,8 @@ namespace ArdupilotMega.GCSViews
dockContainer1.SetHeight(dockhud, hud1.Height);
dockContainer1.SetWidth(dockguages, 110);
this.ResumeLayout();
}
@ -289,7 +298,6 @@ namespace ArdupilotMega.GCSViews
info.ShowContextMenuButton = false;
}
dockContainer1.Invalidate();
}
void SaveWindowLayout()
@ -319,7 +327,7 @@ namespace ArdupilotMega.GCSViews
object fieldValue;
try
{
fieldValue = field.GetValue(thisBoxed,null); // Get value
fieldValue = field.GetValue(thisBoxed, null); // Get value
}
catch { continue; }
@ -329,10 +337,30 @@ namespace ArdupilotMega.GCSViews
xmlwriter.WriteElementString(field.Name, fieldValue.ToString());
}
// DockableContainer dockcont = info as DockableContainer;
thisBoxed = info.DockableForm;
test = thisBoxed.GetType();
foreach (var field in test.GetProperties())
{
// field.Name has the field's name.
object fieldValue;
try
{
fieldValue = field.GetValue(thisBoxed, null); // Get value
// Get the TypeCode enumeration. Multiple types get mapped to a common typecode.
TypeCode typeCode = Type.GetTypeCode(fieldValue.GetType());
xmlwriter.WriteElementString(field.Name, fieldValue.ToString());
}
catch { continue; }
}
// DockableContainer dockcont = info as DockableContainer;
// dockContainer1.
// dockContainer1.
xmlwriter.WriteEndElement();
}
@ -342,11 +370,12 @@ namespace ArdupilotMega.GCSViews
xmlwriter.Close();
}
DockableFormInfo CreateFormAndGuid(DockContainer dock, Control ctl, string configguidref)
DockableFormInfo CreateFormAndGuid(DockContainer dock, Control ctl, string configguidref)
{
Guid gu = GetOrCreateGuid(configguidref);
Form frm;
if (formguids.ContainsKey(gu))
if (formguids.ContainsKey(gu) && !formguids[gu].IsDisposed)
{
frm = formguids[gu];
}
@ -355,9 +384,18 @@ namespace ArdupilotMega.GCSViews
frm = CreateFormFromControl(ctl);
frm.AutoScroll = true;
formguids[gu] = frm;
}
}
return dock.Add(frm, Crom.Controls.Docking.zAllowedDock.All, gu);
frm.FormBorderStyle = FormBorderStyle.SizableToolWindow;
frm.TopLevel = false;
DockableFormInfo answer = dock.Add(frm, Crom.Controls.Docking.zAllowedDock.All, gu);
answer.ShowCloseButton = false;
answer.ShowContextMenuButton = false;
return answer;
}
Guid GetOrCreateGuid(string configname)
@ -367,7 +405,7 @@ namespace ArdupilotMega.GCSViews
MainV2.config[configname] = Guid.NewGuid().ToString();
}
return new Guid(MainV2.config[configname].ToString());
return new Guid(MainV2.config[configname].ToString());
}
Form GetFormFromGuid(Guid id)
@ -418,7 +456,7 @@ namespace ArdupilotMega.GCSViews
{
newform.Text = "Hud";
}
if (ctl is myGMAP)
if (ctl is myGMAP)
{
newform.Text = "Map";
}
@ -433,7 +471,7 @@ namespace ArdupilotMega.GCSViews
// localise it
Control tabStatus = sender as Control;
// tabStatus.SuspendLayout();
// tabStatus.SuspendLayout();
//foreach (Control temp in tabStatus.Controls)
{
@ -517,7 +555,7 @@ namespace ArdupilotMega.GCSViews
tabStatus.Width = x;
// tabStatus.ResumeLayout();
// tabStatus.ResumeLayout();
}
public void Activate()
@ -550,7 +588,7 @@ namespace ArdupilotMega.GCSViews
hud1.Enabled = false;
hud1.Visible = false;
}
// hud1.Location = new Point(-1000,-1000);
// hud1.Location = new Point(-1000,-1000);
ZedGraphTimer.Stop();
}
@ -718,7 +756,7 @@ namespace ArdupilotMega.GCSViews
LogPlayBackSpeed = 0.01;
try
{
ts = Math.Min((act / LogPlayBackSpeed),1000);
ts = Math.Min((act / LogPlayBackSpeed), 1000);
}
catch { }
@ -759,7 +797,7 @@ namespace ArdupilotMega.GCSViews
tunning = DateTime.Now;
}
if (MainV2.comPort.logplaybackfile != null && MainV2.comPort.logplaybackfile.BaseStream.Position == MainV2.comPort.logplaybackfile.BaseStream.Length)
{
@ -779,18 +817,18 @@ namespace ArdupilotMega.GCSViews
}
}
try
{
// Console.WriteLine(DateTime.Now.Millisecond);
// Console.WriteLine(DateTime.Now.Millisecond);
updateBindingSource();
// Console.WriteLine(DateTime.Now.Millisecond + " done ");
// Console.WriteLine(DateTime.Now.Millisecond + " done ");
if (ArdupilotMega.Controls.OpenGLtest.instance != null)
{
ArdupilotMega.Controls.OpenGLtest.instance.rpy = new OpenTK.Vector3(MainV2.cs.roll,MainV2.cs.pitch,MainV2.cs.yaw);
ArdupilotMega.Controls.OpenGLtest.instance.LocationCenter = new PointLatLngAlt(MainV2.cs.lat,MainV2.cs.lng,MainV2.cs.alt,"here");
ArdupilotMega.Controls.OpenGLtest.instance.rpy = new OpenTK.Vector3(MainV2.cs.roll, MainV2.cs.pitch, MainV2.cs.yaw);
ArdupilotMega.Controls.OpenGLtest.instance.LocationCenter = new PointLatLngAlt(MainV2.cs.lat, MainV2.cs.lng, MainV2.cs.alt, "here");
}
if (tunning.AddMilliseconds(50) < DateTime.Now && CB_tuning.Checked == true)
@ -847,12 +885,12 @@ namespace ArdupilotMega.GCSViews
if (route.Points.Count > int.Parse(MainV2.config["NUM_tracklength"].ToString()))
{
// trackPoints.RemoveRange(0, trackPoints.Count - int.Parse(MainV2.config["NUM_tracklength"].ToString()));
// trackPoints.RemoveRange(0, trackPoints.Count - int.Parse(MainV2.config["NUM_tracklength"].ToString()));
route.Points.RemoveRange(0, route.Points.Count - int.Parse(MainV2.config["NUM_tracklength"].ToString()));
}
if (MainV2.cs.lat != 0)
{
// trackPoints.Add(currentloc);
// trackPoints.Add(currentloc);
route.Points.Add(currentloc);
}
@ -880,26 +918,28 @@ namespace ArdupilotMega.GCSViews
//Console.WriteLine("Doing FD WP's");
updateMissionRouteMarkers();
if (MainV2.comPort.logreadmode && MainV2.comPort.logplaybackfile != null)
foreach (MAVLink.mavlink_mission_item_t plla in MainV2.comPort.wps.Values)
{
FlightPlanner.pointlist.Clear();
FlightPlanner.pointlist.AddRange(MainV2.comPort.wps);
}
foreach (PointLatLngAlt plla in FlightPlanner.pointlist)
{
if (plla == null)
break;
if (plla.Lng == 0 || plla.Lat == 0)
if (plla.x == 0 || plla.y == 0)
continue;
if (plla.Tag.StartsWith("ROI"))
if (plla.command == (byte)MAVLink.MAV_CMD.ROI)
{
addpolygonmarkerred(plla.Tag, plla.Lng, plla.Lat, (int)plla.Alt, plla.color, routes);
addpolygonmarkerred(plla.seq.ToString(), plla.y, plla.x, (int)plla.z, Color.Red, routes);
continue;
}
addpolygonmarker(plla.Tag, plla.Lng, plla.Lat, (int)plla.Alt,plla.color,polygons);
string tag = plla.seq.ToString();
if (plla.seq == 0 && plla.current != 2)
{
tag = "Home";
}
if (plla.current == 2)
{
continue;
}
addpolygonmarker(tag, plla.y, plla.x, (int)plla.z, Color.White, polygons);
}
RegeneratePolygon();
@ -915,12 +955,12 @@ namespace ArdupilotMega.GCSViews
if (routes.Markers.Count != 1)
{
routes.Markers.Clear();
routes.Markers.Add( new GMapMarkerCross(currentloc));
routes.Markers.Add(new GMapMarkerCross(currentloc));
}
if (MainV2.cs.mode.ToLower() == "guided" && MainV2.cs.GuidedModeWP != null && MainV2.cs.GuidedModeWP.Lat != 0)
if (MainV2.cs.mode.ToLower() == "guided" && MainV2.comPort.GuidedMode.x != 0)
{
addpolygonmarker("Guided Mode", MainV2.cs.GuidedModeWP.Lng, MainV2.cs.GuidedModeWP.Lat, (int)MainV2.cs.GuidedModeWP.Alt, Color.Blue, routes);
addpolygonmarker("Guided Mode", MainV2.comPort.GuidedMode.y, MainV2.comPort.GuidedMode.x, (int)MainV2.comPort.GuidedMode.z, Color.Blue, routes);
}
if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane)
@ -999,7 +1039,7 @@ namespace ArdupilotMega.GCSViews
{
if (playing)
{
if (BUT_playlog.Text == "Pause")
if (BUT_playlog.Text == "Pause")
return;
this.BeginInvoke((System.Windows.Forms.MethodInvoker)delegate()
@ -1091,18 +1131,18 @@ namespace ArdupilotMega.GCSViews
GMapMarkerRect mBorders = new GMapMarkerRect(point);
{
mBorders.InnerMarker = m;
try
{
mBorders.wprad = (int)(float.Parse(ArdupilotMega.MainV2.config["TXT_WPRad"].ToString()) / MainV2.cs.multiplierdist);
}
catch { }
mBorders.MainMap = gMapControl1;
if (color.HasValue)
{
mBorders.Color = color.Value;
}
mBorders.InnerMarker = m;
try
{
mBorders.wprad = (int)(float.Parse(ArdupilotMega.MainV2.config["TXT_WPRad"].ToString()) / MainV2.cs.multiplierdist);
}
catch { }
mBorders.MainMap = gMapControl1;
if (color.HasValue)
{
mBorders.Color = color.Value;
}
}
overlay.Markers.Add(m);
@ -1284,7 +1324,7 @@ namespace ArdupilotMega.GCSViews
private void BUT_clear_track_Click(object sender, EventArgs e)
{
if (route !=null)
if (route != null)
route.Points.Clear();
}
@ -1308,7 +1348,7 @@ namespace ArdupilotMega.GCSViews
{
((Button)sender).Enabled = false;
#if MAVLINK10
comPort.doCommand((MAVLink.MAV_CMD)Enum.Parse(typeof(MAVLink.MAV_CMD), CMB_action.Text),1,0,1,0,0,0,0);
comPort.doCommand((MAVLink.MAV_CMD)Enum.Parse(typeof(MAVLink.MAV_CMD), CMB_action.Text), 1, 0, 1, 0, 0, 0, 0);
#else
comPort.doAction((MAVLink.MAV_ACTION)Enum.Parse(typeof(MAVLink.MAV_ACTION), "MAV_ACTION_" + CMB_action.Text));
#endif
@ -1387,11 +1427,11 @@ namespace ArdupilotMega.GCSViews
return;
}
if (MainV2.cs.GuidedModeWP.Alt == 0)
if (MainV2.comPort.GuidedMode.z == 0)
{
flyToHereAltToolStripMenuItem_Click(null, null);
if (MainV2.cs.GuidedModeWP.Alt == 0)
if (MainV2.comPort.GuidedMode.z == 0)
return;
}
@ -1404,15 +1444,13 @@ namespace ArdupilotMega.GCSViews
Locationwp gotohere = new Locationwp();
gotohere.id = (byte)MAVLink.MAV_CMD.WAYPOINT;
gotohere.alt = (float)(MainV2.cs.GuidedModeWP.Alt); // back to m
gotohere.alt = (float)(MainV2.comPort.GuidedMode.z); // back to m
gotohere.lat = (float)(gotolocation.Lat);
gotohere.lng = (float)(gotolocation.Lng);
try
{
MainV2.comPort.setGuidedModeWP(gotohere);
MainV2.cs.GuidedModeWP = new PointLatLngAlt(gotohere.lat, gotohere.lng, gotohere.alt, "Guided Mode");
}
catch (Exception ex) { MainV2.giveComport = false; CustomMessageBox.Show("Error sending command : " + ex.Message); }
@ -1450,8 +1488,8 @@ namespace ArdupilotMega.GCSViews
catch { }
}
}
private void FlightData_ParentChanged(object sender, EventArgs e)
private void FlightData_ParentChanged(object sender, EventArgs e)
{
if (MainV2.cam != null)
{
@ -1528,7 +1566,7 @@ namespace ArdupilotMega.GCSViews
}
else
{
// BUT_clear_track_Click(sender, e);
// BUT_clear_track_Click(sender, e);
MainV2.comPort.logreadmode = true;
list1.Clear();
list2.Clear();
@ -1665,11 +1703,7 @@ namespace ArdupilotMega.GCSViews
try
{
((Button)sender).Enabled = false;
#if MAVLINK10
MainV2.comPort.setMode("Auto");
#else
comPort.doAction(MAVLink.MAV_ACTION.MAV_ACTION_SET_AUTO);
#endif
MainV2.comPort.setMode("Auto");
}
catch { CustomMessageBox.Show("The Command failed to execute"); }
((Button)sender).Enabled = true;
@ -1680,11 +1714,7 @@ namespace ArdupilotMega.GCSViews
try
{
((Button)sender).Enabled = false;
#if MAVLINK10
MainV2.comPort.setMode("RTL");
#else
comPort.doAction(MAVLink.MAV_ACTION.MAV_ACTION_RETURN);
#endif
MainV2.comPort.setMode("RTL");
}
catch { CustomMessageBox.Show("The Command failed to execute"); }
((Button)sender).Enabled = true;
@ -1695,14 +1725,11 @@ namespace ArdupilotMega.GCSViews
try
{
((Button)sender).Enabled = false;
#if MAVLINK10
if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane)
MainV2.comPort.setMode("Manual");
MainV2.comPort.setMode("Manual");
if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2)
MainV2.comPort.setMode("Stabilize");
#else
comPort.doAction(MAVLink.MAV_ACTION.MAV_ACTION_SET_MANUAL);
#endif
}
catch { CustomMessageBox.Show("The Command failed to execute"); }
((Button)sender).Enabled = true;
@ -1745,7 +1772,7 @@ namespace ArdupilotMega.GCSViews
void dropout_FormClosed(object sender, FormClosedEventArgs e)
{
dockhud.DockableForm.Controls.Add(hud1);
GetFormFromGuid(GetOrCreateGuid("fd_hud_guid")).Controls.Add(hud1);
huddropout = false;
}
@ -2024,7 +2051,7 @@ namespace ArdupilotMega.GCSViews
{
HUD.Custom cust = new HUD.Custom();
string prefix = ((CheckBox)sender).Name +": ";
string prefix = ((CheckBox)sender).Name + ": ";
if (MainV2.config["hud1_useritem_" + ((CheckBox)sender).Name] != null)
prefix = (string)MainV2.config["hud1_useritem_" + ((CheckBox)sender).Name];
@ -2328,11 +2355,11 @@ print 'Roll complete'
";
// CustomMessageBox.Show("This is Very ALPHA");
// CustomMessageBox.Show("This is Very ALPHA");
Form scriptedit = new Form();
scriptedit.Size = new System.Drawing.Size(500,500);
scriptedit.Size = new System.Drawing.Size(500, 500);
TextBox tb = new TextBox();
@ -2341,8 +2368,8 @@ print 'Roll complete'
tb.ScrollBars = ScrollBars.Both;
tb.Multiline = true;
tb.Location = new Point(0,0);
tb.Size = new System.Drawing.Size(scriptedit.Size.Width-30,scriptedit.Size.Height-30);
tb.Location = new Point(0, 0);
tb.Size = new System.Drawing.Size(scriptedit.Size.Width - 30, scriptedit.Size.Height - 30);
scriptedit.Controls.Add(tb);
@ -2485,7 +2512,7 @@ print 'Roll complete'
// set databinding for value
((QuickView)((CheckBox)sender).Tag).DataBindings.Clear();
((QuickView)((CheckBox)sender).Tag).DataBindings.Add(new System.Windows.Forms.Binding("number",this.bindingSource1, ((CheckBox)sender).Name, true));
((QuickView)((CheckBox)sender).Tag).DataBindings.Add(new System.Windows.Forms.Binding("number", this.bindingSource1, ((CheckBox)sender).Name, true));
// close selection form
((Form)((CheckBox)sender).Parent).Close();
@ -2520,11 +2547,11 @@ print 'Roll complete'
return;
}
MainV2.cs.GuidedModeWP.Alt = intalt;
MainV2.comPort.GuidedMode.z = intalt;
if (MainV2.cs.mode == "Guided")
{
MainV2.comPort.setGuidedModeWP(new Locationwp() { alt = (float)MainV2.cs.GuidedModeWP.Alt, lat = (float)MainV2.cs.GuidedModeWP.Lat, lng = (float)MainV2.cs.GuidedModeWP.Lng });
MainV2.comPort.setGuidedModeWP(new Locationwp() { alt = (float)MainV2.comPort.GuidedMode.z, lat = (float)MainV2.comPort.GuidedMode.x, lng = (float)MainV2.comPort.GuidedMode.y });
}
}
@ -2545,7 +2572,7 @@ print 'Roll complete'
splitContainer1.Panel2.Controls.Add(but);
splitContainer1.Panel2.Controls.Add(sc.Control);
ThemeManager.ApplyThemeTo(sc.Control);
sc.Control.Dock = DockStyle.Fill;
sc.Control.Visible = true;
@ -2598,11 +2625,11 @@ print 'Roll complete'
private void hud1_Resize(object sender, EventArgs e)
{
Console.WriteLine("HUD resize "+ hud1.Width + " " + hud1.Height);
//Console.WriteLine("HUD resize "+ hud1.Width + " " + hud1.Height);
try
{
// dockContainer1.SetHeight(dockhud, hud1.Height);
// dockContainer1.SetHeight(dockhud, hud1.Height);
}
catch { }
}
@ -2611,8 +2638,25 @@ print 'Roll complete'
{
dockContainer1.Clear();
SetupDocking();
cleanupDocks();
this.Refresh();
}
private void BUT_ARM_Click(object sender, EventArgs e)
{
if (!MainV2.comPort.BaseStream.IsOpen)
return;
// arm the MAV
MainV2.comPort.doARM(MainV2.cs.armed);
}
private void modifyandSetAlt_Click(object sender, EventArgs e)
{
int newalt = (int)modifyandSetAlt.Value;
MainV2.comPort.setNewWPAlt(new Locationwp() { alt = newalt });
//MainV2.comPort.setNextWPTargetAlt((ushort)MainV2.cs.wpno, newalt);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -38,7 +38,7 @@ namespace ArdupilotMega.GCSViews
bool polygongridmode = false;
Hashtable param = new Hashtable();
public static List<PointLatLngAlt> pointlist = new List<PointLatLngAlt>(); // used to calc distance
List<PointLatLngAlt> pointlist = new List<PointLatLngAlt>(); // used to calc distance
static public Object thisLock = new Object();
private ComponentResourceManager rm = new ComponentResourceManager(typeof(FlightPlanner));
@ -925,7 +925,7 @@ namespace ArdupilotMega.GCSViews
// this is to share the current mission with the data tab
pointlist = new List<PointLatLngAlt>();
System.Diagnostics.Debug.WriteLine(DateTime.Now);
try
{
@ -1921,7 +1921,7 @@ namespace ArdupilotMega.GCSViews
MainMap.Invalidate(false);
int answer;
if (int.TryParse(item.Tag.ToString(), out answer))
if (item.Tag != null && int.TryParse(item.Tag.ToString(), out answer))
{
try
{
@ -2782,9 +2782,9 @@ namespace ArdupilotMega.GCSViews
routes.Markers.Add(new GMapMarkerQuad(currentloc, MainV2.cs.yaw, MainV2.cs.groundcourse, MainV2.cs.nav_bearing));
}
if (MainV2.cs.mode.ToLower() == "guided" && MainV2.cs.GuidedModeWP != null && MainV2.cs.GuidedModeWP.Lat != 0)
if (MainV2.cs.mode.ToLower() == "guided" && MainV2.comPort.GuidedMode.x != 0)
{
addpolygonmarker("Guided Mode", MainV2.cs.GuidedModeWP.Lng, MainV2.cs.GuidedModeWP.Lat, (int)MainV2.cs.GuidedModeWP.Alt, Color.Red, routes);
addpolygonmarker("Guided Mode", MainV2.comPort.GuidedMode.y, MainV2.comPort.GuidedMode.x, (int)MainV2.comPort.GuidedMode.z, Color.Blue, routes);
}

View File

@ -565,10 +565,8 @@ namespace ArdupilotMega.GCSViews
DateTime lastdata = DateTime.MinValue;
#if MAVLINK10
// set enable hil status flag - sends base_mode = 0
MainV2.comPort.setMode(new MAVLink.mavlink_set_mode_t() { target_system = MainV2.comPort.sysid }, MAVLink.MAV_MODE_FLAG.HIL_ENABLED);
#endif
while (threadrun == 1)
{

View File

@ -62,6 +62,23 @@ namespace ArdupilotMega
InitializeComponent();
}
private void waitandsleep(int time)
{
DateTime start = DateTime.Now;
while ((DateTime.Now - start).TotalMilliseconds < time)
{
try
{
if (comPort.BytesToRead > 0)
{
return;
}
}
catch { threadrun = false; return; }
}
}
private void readandsleep(int time)
{
DateTime start = DateTime.Now;
@ -85,12 +102,15 @@ namespace ArdupilotMega
comPort = MainV2.comPort.BaseStream;
//comPort.ReceivedBytesThreshold = 50;
//comPort.ReadBufferSize = 1024 * 1024;
try
{
comPort.toggleDTR();
//comPort.Open();
comPort.DiscardInBuffer();
// 10 sec
waitandsleep(10000);
}
catch (Exception ex)
{
@ -104,7 +124,7 @@ namespace ArdupilotMega
threadrun = true;
readandsleep(2500);
readandsleep(100);
try
{

View File

@ -1106,7 +1106,6 @@ namespace ArdupilotMega
MainV2.cs.linkqualitygcs = (ushort)(MainV2.cs.linkqualitygcs * 0.8f);
linkqualitytime = DateTime.Now;
int checkthis;
GCSViews.FlightData.myhud.Invalidate();
}
}
@ -1118,7 +1117,7 @@ namespace ArdupilotMega
{
type = (byte)MAVLink.MAV_TYPE.GCS,
autopilot = (byte)MAVLink.MAV_AUTOPILOT.ARDUPILOTMEGA,
mavlink_version = 3
mavlink_version = 3,
};
comPort.sendPacket(htb);
@ -1474,11 +1473,9 @@ namespace ArdupilotMega
SharpKml.Dom.CoordinateCollection coords = new SharpKml.Dom.CoordinateCollection();
foreach (var point in GCSViews.FlightPlanner.pointlist)
foreach (var point in MainV2.comPort.wps.Values)
{
if (point != null)
coords.Add(new SharpKml.Base.Vector(point.Lat, point.Lng, point.Alt));
coords.Add(new SharpKml.Base.Vector(point.x, point.y, point.z));
}
SharpKml.Dom.LineString ls = new SharpKml.Dom.LineString();
@ -1716,8 +1713,8 @@ namespace ArdupilotMega
{
var fi = new FileInfo(path);
string LocalVersion = "";
string WebVersion = "";
Version LocalVersion = new Version();
Version WebVersion = new Version();
if (File.Exists(path))
{
@ -1725,7 +1722,7 @@ namespace ArdupilotMega
{
using (StreamReader sr = new StreamReader(fs))
{
LocalVersion = sr.ReadLine();
LocalVersion = new Version(sr.ReadLine());
sr.Close();
}
fs.Close();
@ -1734,7 +1731,7 @@ namespace ArdupilotMega
using (StreamReader sr = new StreamReader(response.GetResponseStream()))
{
WebVersion = sr.ReadLine();
WebVersion = new Version(sr.ReadLine());
sr.Close();
}
@ -1743,7 +1740,7 @@ namespace ArdupilotMega
log.Info("New file Check: local " + LocalVersion + " vs Remote " + WebVersion);
if (LocalVersion != WebVersion)
if (LocalVersion < WebVersion)
{
updateFound = true;
}

View File

@ -47,15 +47,15 @@ namespace ArdupilotMega
/// <summary>
/// storage for whole paramater list
/// </summary>
public Hashtable param { get; set; }
public Hashtable param { get; set; }
/// <summary>
/// storage of a previous packet recevied of a specific type
/// </summary>
public byte[][] packets { get; set; }
public byte[][] packets { get; set; }
/// <summary>
/// used to calc packets per second on any single message type - used for stream rate comparaison
/// </summary>
public double[] packetspersecond { get; set; }
public double[] packetspersecond { get; set; }
/// <summary>
/// time last seen a packet of a type
/// </summary>
@ -95,7 +95,7 @@ namespace ArdupilotMega
/// <summary>
/// time seen of last mavlink packet
/// </summary>
public DateTime lastvalidpacket { get; set; }
public DateTime lastvalidpacket { get; set; }
/// <summary>
/// old log support
/// </summary>
@ -112,7 +112,11 @@ namespace ArdupilotMega
/// <summary>
/// used as a snapshot of what is loaded on the ap atm. - derived from the stream
/// </summary>
public PointLatLngAlt[] wps { get; set; }
public Dictionary<int, mavlink_mission_item_t> wps = new Dictionary<int, mavlink_mission_item_t>();
/// <summary>
/// Store the guided mode wp location
/// </summary>
public mavlink_mission_item_t GuidedMode = new mavlink_mission_item_t();
/// <summary>
/// turns on console packet display
/// </summary>
@ -157,7 +161,6 @@ namespace ArdupilotMega
this.oldlogformat = false;
this.mavlinkversion = 0;
this.aptype = 0;
this.wps = new PointLatLngAlt[200];
this.debugmavlink = false;
this.logreadmode = false;
this.lastlogread = DateTime.MinValue;
@ -547,7 +550,7 @@ namespace ArdupilotMega
}
catch { } // been getting errors from this. people must have it open twice.
}*/
}
}
}
public bool Write(string line)
@ -581,7 +584,7 @@ namespace ArdupilotMega
MainV2.giveComport = true;
var req = new mavlink_param_set_t {target_system = sysid, target_component = compid};
var req = new mavlink_param_set_t { target_system = sysid, target_component = compid };
byte[] temp = Encoding.ASCII.GetBytes(paramname);
@ -744,13 +747,13 @@ namespace ArdupilotMega
MainV2.giveComport = false;
if (packets > 0 && param_total == 1)
{
throw new Exception("Timeout on read - getParamList\n"+packets+" Packets where received, but no paramater packets where received\n");
throw new Exception("Timeout on read - getParamList\n" + packets + " Packets where received, but no paramater packets where received\n");
}
if (packets == 0)
{
throw new Exception("Timeout on read - getParamList\nNo Packets where received\n");
}
throw new Exception("Timeout on read - getParamList\nReceived: " + got.Count + " of " + param_total + " after 6 retrys\n\nPlease Check\n1. Link Speed\n2. Link Quality\n3. Hardware hasn't hung");
}
@ -761,7 +764,7 @@ namespace ArdupilotMega
if (buffer.Length > 5)
{
packets++;
// stopwatch.Start();
// stopwatch.Start();
if (buffer[5] == MAVLINK_MSG_ID_PARAM_VALUE)
{
restart = DateTime.Now;
@ -809,7 +812,7 @@ namespace ArdupilotMega
this.frmProgressReporter.UpdateProgressAndStatus((got.Count * 100) / param_total, "Got param " + paramID);
// we have them all - lets escape eq total = 176 index = 0-175
if (par.param_index == (param_total -1))
if (par.param_index == (param_total - 1))
break;
}
else
@ -817,8 +820,8 @@ namespace ArdupilotMega
//Console.WriteLine(DateTime.Now + " PC paramlist " + buffer[5] + " want " + MAVLINK_MSG_ID_PARAM_VALUE + " btr " + BaseStream.BytesToRead);
}
//stopwatch.Stop();
// Console.WriteLine("Time elapsed: {0}", stopwatch.Elapsed);
// Console.WriteLine(DateTime.Now.Millisecond + " gp4 " + BaseStream.BytesToRead);
// Console.WriteLine("Time elapsed: {0}", stopwatch.Elapsed);
// Console.WriteLine(DateTime.Now.Millisecond + " gp4 " + BaseStream.BytesToRead);
}
} while (got.Count < param_total);
@ -836,6 +839,70 @@ namespace ArdupilotMega
return param;
}
public float GetParam(string name)
{
return GetParam(name);
}
public float GetParam(int index)
{
return GetParam("", index);
}
/// <summary>
/// Get param by either index or name
/// </summary>
/// <param name="index"></param>
/// <param name="name"></param>
/// <returns></returns>
internal float GetParam(string name = "", int index = -1)
{
if (name == "" && index == -1)
return 0;
MainV2.giveComport = true;
byte[] buffer;
mavlink_param_request_list_t req = new mavlink_param_request_list_t();
req.target_system = sysid;
req.target_component = compid;
generatePacket(MAVLINK_MSG_ID_PARAM_REQUEST_READ, req);
DateTime start = DateTime.Now;
int retrys = 3;
while (true)
{
if (!(start.AddMilliseconds(200) > DateTime.Now))
{
if (retrys > 0)
{
log.Info("GetParam Retry " + retrys);
generatePacket(MAVLINK_MSG_ID_PARAM_REQUEST_READ, req);
start = DateTime.Now;
retrys--;
continue;
}
MainV2.giveComport = false;
throw new Exception("Timeout on read - GetParam");
}
buffer = readPacket();
if (buffer.Length > 5)
{
if (buffer[5] == MAVLINK_MSG_ID_PARAM_VALUE)
{
MainV2.giveComport = false;
mavlink_param_value_t par = buffer.ByteArrayToStructure<mavlink_param_value_t>(6);
return par.param_value;
}
}
}
}
public static void modifyParamForDisplay(bool fromapm, string paramname, ref float value)
{
if (paramname.ToUpper().EndsWith("_IMAX") || paramname.ToUpper().EndsWith("ALT_HOLD_RTL") || paramname.ToUpper().EndsWith("APPROACH_ALT") || paramname.ToUpper().EndsWith("TRIM_ARSPD_CM")
@ -896,21 +963,12 @@ namespace ArdupilotMega
public void setWPACK()
{
#if MAVLINK10
MAVLink.mavlink_mission_ack_t req = new MAVLink.mavlink_mission_ack_t();
req.target_system = sysid;
req.target_component = compid;
req.type = 0;
generatePacket(MAVLINK_MSG_ID_MISSION_ACK, req);
#else
MAVLink.mavlink_waypoint_ack_t req = new MAVLink.mavlink_waypoint_ack_t();
req.target_system = sysid;
req.target_component = compid;
req.type = 0;
generatePacket(MAVLINK_MSG_ID_WAYPOINT_ACK, req);
#endif
}
public bool setWPCurrent(ushort index)
@ -965,6 +1023,11 @@ namespace ArdupilotMega
throw new NotImplementedException();
}
public bool doARM(bool armit)
{
return doCommand(MAV_CMD.COMPONENT_ARM_DISARM, armit ? 1 : 0, 0, 0, 0, 0, 0, 0);
}
public bool doCommand(MAV_CMD actionid, float p1, float p2, float p3, float p4, float p5, float p6, float p7)
{
@ -976,6 +1039,11 @@ namespace ArdupilotMega
req.target_system = sysid;
req.target_component = compid;
if (actionid == MAV_CMD.COMPONENT_ARM_DISARM)
{
req.target_component = (byte)MAV_COMPONENT.MAV_COMP_ID_SYSTEM_CONTROL;
}
req.command = (ushort)actionid;
req.param1 = p1;
@ -1691,7 +1759,7 @@ namespace ArdupilotMega
/// <param name="wp_total"></param>
public void setWPTotal(ushort wp_total)
{
#if MAVLINK10
#if MAVLINK10
MainV2.giveComport = true;
mavlink_mission_count_t req = new mavlink_mission_count_t();
@ -1736,6 +1804,9 @@ namespace ArdupilotMega
param["WP_TOTAL"] = (float)wp_total - 1;
if (param["CMD_TOTAL"] != null)
param["CMD_TOTAL"] = (float)wp_total - 1;
wps.Clear();
MainV2.giveComport = false;
return;
}
@ -1809,14 +1880,10 @@ namespace ArdupilotMega
/// <param name="index">wp no</param>
/// <param name="frame">global or relative</param>
/// <param name="current">0 = no , 2 = guided mode</param>
public MAV_MISSION_RESULT setWP(Locationwp loc, ushort index, MAV_FRAME frame, byte current)
public MAV_MISSION_RESULT setWP(Locationwp loc, ushort index, MAV_FRAME frame, byte current = 0)
{
MainV2.giveComport = true;
#if MAVLINK10
mavlink_mission_item_t req = new mavlink_mission_item_t();
#else
mavlink_waypoint_t req = new mavlink_waypoint_t();
#endif
req.target_system = sysid;
req.target_component = compid; // MAVLINK_MSG_ID_MISSION_ITEM
@ -1835,68 +1902,14 @@ namespace ArdupilotMega
req.param2 = loc.p2;
req.param3 = loc.p3;
req.param4 = loc.p4;
/*
if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane)
{
switch (loc.id)
{ // Switch to map APM command fields inot MAVLink command fields
case (byte)MAV_CMD.LOITER_TURNS:
case (byte)MAV_CMD.TAKEOFF:
req.param1 = loc.p1;
break;
case (byte)MAV_CMD.DO_SET_HOME:
req.param1 = loc.p1;
break;
case (byte)MAV_CMD.CONDITION_CHANGE_ALT:
req.param1 = loc.lat;
req.x = 0;
req.y = 0;
break;
case (byte)MAV_CMD.LOITER_TIME:
req.param1 = loc.p1 * 10; // APM loiter time is in ten second increments
break;
case (byte)MAV_CMD.CONDITION_DELAY:
case (byte)MAV_CMD.CONDITION_DISTANCE:
req.param1 = loc.lat;
break;
case (byte)MAV_CMD.DO_JUMP:
req.param2 = loc.lat;
req.param1 = loc.p1;
break;
case (byte)MAV_CMD.DO_REPEAT_SERVO:
req.param4 = loc.lng;
goto case (byte)MAV_CMD.DO_CHANGE_SPEED;
case (byte)MAV_CMD.DO_REPEAT_RELAY:
case (byte)MAV_CMD.DO_CHANGE_SPEED:
req.param3 = loc.lat;
req.param2 = loc.alt;
req.param1 = loc.p1;
break;
case (byte)MAV_CMD.DO_SET_PARAMETER:
case (byte)MAV_CMD.DO_SET_RELAY:
case (byte)MAV_CMD.DO_SET_SERVO:
req.param2 = loc.alt;
req.param1 = loc.p1;
break;
}
}
*/
req.seq = index;
log.InfoFormat("setWP {6} frame {0} cmd {1} p1 {2} x {3} y {4} z {5}", req.frame, req.command, req.param1, req.x, req.y, req.z, index);
// request
#if MAVLINK10
generatePacket(MAVLINK_MSG_ID_MISSION_ITEM, req);
#else
generatePacket(MAVLINK_MSG_ID_WAYPOINT, req);
#endif
DateTime start = DateTime.Now;
int retrys = 10;
@ -1908,11 +1921,8 @@ namespace ArdupilotMega
if (retrys > 0)
{
log.Info("setWP Retry " + retrys);
#if MAVLINK10
generatePacket(MAVLINK_MSG_ID_MISSION_ITEM, req);
#else
generatePacket(MAVLINK_MSG_ID_WAYPOINT, req);
#endif
generatePacket(MAVLINK_MSG_ID_MISSION_ITEM, req);
start = DateTime.Now;
retrys--;
continue;
@ -1923,11 +1933,24 @@ namespace ArdupilotMega
byte[] buffer = readPacket();
if (buffer.Length > 5)
{
#if MAVLINK10
if (buffer[5] == MAVLINK_MSG_ID_MISSION_ACK)
{
var ans = buffer.ByteArrayToStructure<mavlink_mission_ack_t>(6);
log.Info("set wp " + index + " ACK 47 : " + buffer[5] + " ans " + Enum.Parse(typeof(MAV_MISSION_RESULT), ans.type.ToString()));
if (req.current == 2)
{
GuidedMode = req;
}
else if (req.current == 3)
{
}
else
{
wps[req.seq] = req;
}
return (MAV_MISSION_RESULT)ans.type;
}
else if (buffer[5] == MAVLINK_MSG_ID_MISSION_REQUEST)
@ -1938,6 +1961,19 @@ namespace ArdupilotMega
log.Info("set wp doing " + index + " req " + ans.seq + " REQ 40 : " + buffer[5]);
MainV2.giveComport = false;
if (req.current == 2)
{
GuidedMode = req;
}
else if (req.current == 3)
{
}
else
{
wps[req.seq] = req;
}
return MAV_MISSION_RESULT.MAV_MISSION_ACCEPTED;
}
else
@ -1950,37 +1986,40 @@ namespace ArdupilotMega
{
//Console.WriteLine(DateTime.Now + " PC setwp " + buffer[5]);
}
#else
if (buffer[5] == MAVLINK_MSG_ID_WAYPOINT_ACK)
{ //mavlink_waypoint_request_t
log.Info("set wp " + index + " ACK 47 : " + buffer[5]);
break;
}
else if (buffer[5] == MAVLINK_MSG_ID_WAYPOINT_REQUEST)
{
mavlink_waypoint_request_t ans = buffer.ByteArrayToStructure<mavlink_waypoint_request_t>(6);
if (ans.seq == (index + 1))
{
log.Info("set wp doing " + index + " req " + ans.seq + " REQ 40 : " + buffer[5]);
MainV2.giveComport = false;
break;
}
else
{
log.InfoFormat("set wp fail doing " + index + " req " + ans.seq + " ACK 47 or REQ 40 : " + buffer[5] + " seq {0} ts {1} tc {2}", req.seq, req.target_system, req.target_component);
//break;
}
}
else
{
//Console.WriteLine(DateTime.Now + " PC setwp " + buffer[5]);
}
#endif
}
}
// return MAV_MISSION_RESULT.MAV_MISSION_INVALID;
// return MAV_MISSION_RESULT.MAV_MISSION_INVALID;
}
public void setNextWPTargetAlt(ushort wpno, float alt)
{
// get the existing wp
Locationwp current = getWP(wpno);
mavlink_mission_write_partial_list_t req = new mavlink_mission_write_partial_list_t();
req.target_system = sysid;
req.target_component = compid;
req.start_index = (short)wpno;
req.end_index = (short)wpno;
// change the alt
current.alt = alt;
// send a request to update single point
generatePacket(MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, req);
Thread.Sleep(10);
generatePacket(MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, req);
MAV_FRAME frame = (current.options & 0x1) == 0 ? MAV_FRAME.GLOBAL : MAV_FRAME.GLOBAL_RELATIVE_ALT;
//send the point with new alt
setWP(current, wpno, MAV_FRAME.GLOBAL_RELATIVE_ALT, 0);
// set the point as current to reload the modified command
setWPCurrent(wpno);
}
public void setGuidedModeWP(Locationwp gotohere)
@ -1992,7 +2031,7 @@ namespace ArdupilotMega
try
{
gotohere.id =(byte)MAV_CMD.WAYPOINT;
gotohere.id = (byte)MAV_CMD.WAYPOINT;
MAV_MISSION_RESULT ans = MainV2.comPort.setWP(gotohere, 0, MAVLink.MAV_FRAME.GLOBAL_RELATIVE_ALT, (byte)2);
@ -2004,6 +2043,24 @@ namespace ArdupilotMega
MainV2.giveComport = false;
}
public void setNewWPAlt(Locationwp gotohere)
{
MainV2.giveComport = true;
try
{
gotohere.id = (byte)MAV_CMD.WAYPOINT;
MAV_MISSION_RESULT ans = MainV2.comPort.setWP(gotohere, 0, MAVLink.MAV_FRAME.GLOBAL_RELATIVE_ALT, (byte)3);
if (ans != MAV_MISSION_RESULT.MAV_MISSION_ACCEPTED)
throw new Exception("Alt Change Failed");
}
catch (Exception ex) { log.Error(ex); }
MainV2.giveComport = false;
}
public void setMountConfigure(MAV_MOUNT_MODE mountmode, bool stabroll, bool stabpitch, bool stabyaw)
{
mavlink_mount_configure_t req = new mavlink_mount_configure_t();
@ -2046,7 +2103,6 @@ namespace ArdupilotMega
public void setMode(string modein)
{
#if MAVLINK10
try
{
MAVLink.mavlink_set_mode_t mode = new MAVLink.mavlink_set_mode_t();
@ -2057,38 +2113,15 @@ namespace ArdupilotMega
}
}
catch { System.Windows.Forms.MessageBox.Show("Failed to change Modes"); }
#else
try
{
MAVLink.mavlink_set_nav_mode_t navmode = new MAVLink.mavlink_set_nav_mode_t();
MAVLink.mavlink_set_mode_t mode = new MAVLink.mavlink_set_mode_t();
if (translateMode(modein, ref navmode, ref mode))
{
generatePacket((byte)MAVLink.MAVLINK_MSG_ID_SET_NAV_MODE, navmode);
System.Threading.Thread.Sleep(10);
generatePacket((byte)MAVLink.MAVLINK_MSG_ID_SET_MODE, mode);
System.Threading.Thread.Sleep(10);
generatePacket((byte)MAVLink.MAVLINK_MSG_ID_SET_NAV_MODE, navmode);
System.Threading.Thread.Sleep(10);
generatePacket((byte)MAVLink.MAVLINK_MSG_ID_SET_MODE, mode);
}
}
catch { System.Windows.Forms.CustomMessageBox.Show("Failed to change Modes"); }
#endif
}
public void setMode(mavlink_set_mode_t mode, MAV_MODE_FLAG base_mode = 0)
{
#if MAVLINK10
mode.base_mode |= (byte)base_mode;
generatePacket((byte)MAVLink.MAVLINK_MSG_ID_SET_MODE, mode);
System.Threading.Thread.Sleep(10);
generatePacket((byte)MAVLink.MAVLINK_MSG_ID_SET_MODE, mode);
#endif
}
/// <summary>
@ -2175,7 +2208,7 @@ namespace ArdupilotMega
DateTime to = DateTime.Now.AddMilliseconds(BaseStream.ReadTimeout);
// Console.WriteLine(DateTime.Now.Millisecond + " SR1a " + BaseStream.BytesToRead);
// Console.WriteLine(DateTime.Now.Millisecond + " SR1a " + BaseStream.BytesToRead);
while (BaseStream.BytesToRead <= 0)
{
@ -2240,7 +2273,7 @@ namespace ArdupilotMega
int read = BaseStream.Read(buffer, 1, 5);
count = read;
if (rawlogfile != null && rawlogfile.BaseStream.CanWrite)
rawlogfile.Write(buffer,1,read);
rawlogfile.Write(buffer, 1, read);
}
// packet length
@ -2354,20 +2387,12 @@ namespace ArdupilotMega
else
{
log.InfoFormat("Mavlink Bad Packet (Len Fail) len {0} pkno {1}", buffer.Length, buffer[5]);
#if MAVLINK10
if (buffer.Length == 11 && buffer[0] == 'U' && buffer[5] == 0){
string message ="Mavlink 0.9 Heartbeat, Please upgrade your AP, This planner is for Mavlink 1.0\n\n";
System.Windows.Forms.CustomMessageBox.Show(message);
throw new Exception(message);
}
#else
if (buffer.Length == 17 && buffer[0] == 254 && buffer[5] == 0)
if (buffer.Length == 11 && buffer[0] == 'U' && buffer[5] == 0)
{
string message = "Mavlink 1.0 Heartbeat, Please Upgrade your Mission Planner, This planner is for Mavlink 0.9\n\n";
string message = "Mavlink 0.9 Heartbeat, Please upgrade your AP, This planner is for Mavlink 1.0\n\n";
System.Windows.Forms.CustomMessageBox.Show(message);
throw new Exception(message);
}
#endif
return new byte[0];
}
}
@ -2393,7 +2418,7 @@ namespace ArdupilotMega
}
else
{
byte packetSeqNo = buffer[2];
int expectedPacketSeqNo = ((recvpacketcount + 1) % 0x100);
@ -2428,7 +2453,7 @@ namespace ArdupilotMega
recvpacketcount = packetSeqNo;
}
WhenPacketReceived.OnNext(1);
// Console.WriteLine(DateTime.Now.Millisecond);
// Console.WriteLine(DateTime.Now.Millisecond);
}
//MAVLINK_MSG_ID_GPS_STATUS
@ -2481,10 +2506,11 @@ namespace ArdupilotMega
logfile.Write(datearray, 0, datearray.Length);
logfile.Write(buffer, 0, buffer.Length);
if (buffer[5] == 0) {// flush on heartbeat - 1 seconds
if (buffer[5] == 0)
{// flush on heartbeat - 1 seconds
logfile.BaseStream.Flush();
rawlogfile.BaseStream.Flush();
}
rawlogfile.BaseStream.Flush();
}
}
}
@ -2498,7 +2524,7 @@ namespace ArdupilotMega
// Console.Write((DateTime.Now - start).TotalMilliseconds.ToString("00.000") + "\t" + temp.Length + " \r");
// Console.WriteLine(DateTime.Now.Millisecond + " SR4 " + BaseStream.BytesToRead);
// Console.WriteLine(DateTime.Now.Millisecond + " SR4 " + BaseStream.BytesToRead);
return buffer;
}
@ -2509,32 +2535,28 @@ namespace ArdupilotMega
/// <param name="buffer">packet</param>
void getWPsfromstream(ref byte[] buffer)
{
#if MAVLINK10
if (buffer[5] == MAVLINK_MSG_ID_MISSION_COUNT)
{
// clear old
wps = new PointLatLngAlt[wps.Length];
wps.Clear();
//new PointLatLngAlt[wps.Length];
}
if (buffer[5] == MAVLink.MAVLINK_MSG_ID_MISSION_ITEM)
{
mavlink_mission_item_t wp = buffer.ByteArrayToStructure<mavlink_mission_item_t>(6);
#else
if (buffer[5] == MAVLINK_MSG_ID_WAYPOINT_COUNT)
{
// clear old
wps = new PointLatLngAlt[wps.Length];
}
if (wp.current == 2)
{
// guide mode wp
GuidedMode = wp;
}
else
{
wps[wp.seq] = wp;
}
if (buffer[5] == MAVLink.MAVLINK_MSG_ID_WAYPOINT)
{
mavlink_waypoint_t wp = buffer.ByteArrayToStructure<mavlink_waypoint_t>(6);
#endif
wps[wp.seq] = new PointLatLngAlt(wp.x, wp.y, wp.z, wp.seq.ToString());
Console.WriteLine("WP # {7} cmd {8} p1 {0} p2 {1} p3 {2} p4 {3} x {4} y {5} z {6}",wp.param1,wp.param2,wp.param3,wp.param4,wp.x,wp.y,wp.z,wp.seq,wp.command);
Console.WriteLine("WP # {7} cmd {8} p1 {0} p2 {1} p3 {2} p4 {3} x {4} y {5} z {6}", wp.param1, wp.param2, wp.param3, wp.param4, wp.x, wp.y, wp.z, wp.seq, wp.command);
}
}
@ -2715,7 +2737,8 @@ namespace ArdupilotMega
}
// set ap type for log file playback
if (temp[5] == 0) {
if (temp[5] == 0)
{
mavlink_heartbeat_t hb = temp.ByteArrayToStructure<mavlink_heartbeat_t>(6);
mavlinkversion = hb.mavlink_version;
@ -2726,9 +2749,6 @@ namespace ArdupilotMega
return temp;
}
#if MAVLINK10
public static bool translateMode(string modein, ref MAVLink.mavlink_set_mode_t mode)
{
//MAVLink09.mavlink_set_mode_t mode = new MAVLink09.mavlink_set_mode_t();
@ -2752,7 +2772,7 @@ namespace ArdupilotMega
mode.custom_mode = (uint)EnumTranslator.GetValue<Common.apmmodes>(modein);
break;
default:
MessageBox.Show("No Mode Changed " + modein);
MessageBox.Show("No Mode Changed " + modein);
return false;
}
}
@ -2772,7 +2792,7 @@ namespace ArdupilotMega
mode.custom_mode = (uint)EnumTranslator.GetValue<Common.ac2modes>(modein);
break;
default:
MessageBox.Show("No Mode Changed " + modein);
MessageBox.Show("No Mode Changed " + modein);
return false;
}
}
@ -2781,136 +2801,7 @@ namespace ArdupilotMega
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
#if MAVLINK10
public void setAPType()
{
switch (aptype)
@ -2928,24 +2819,6 @@ namespace ArdupilotMega
break;
}
}
#else
public void setAPType()
{
switch (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;
}
}
#endif
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1333,6 +1333,8 @@ namespace ArdupilotMega
foreach (string logfile in openFileDialog1.FileNames)
{
int wplists = 0;
MAVLink mine = new MAVLink();
try
{
@ -1344,17 +1346,28 @@ namespace ArdupilotMega
mine.packets.Initialize(); // clear
StreamWriter sw = new StreamWriter(Path.GetDirectoryName(logfile) + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(logfile) + ".txt");
while (mine.logplaybackfile.BaseStream.Position < mine.logplaybackfile.BaseStream.Length)
{
// bar moves to 100 % in this step
progressBar1.Value = (int)((float)mine.logplaybackfile.BaseStream.Position / (float)mine.logplaybackfile.BaseStream.Length * 100.0f / 1.0f);
// bar moves to 100 % in this step
progressBar1.Value = (int)((float)mine.logplaybackfile.BaseStream.Position / (float)mine.logplaybackfile.BaseStream.Length * 100.0f / 1.0f);
progressBar1.Refresh();
//Application.DoEvents();
byte count = 0;
try
{
count = mine.getWPCount();
}
catch { }
progressBar1.Refresh();
//Application.DoEvents();
if (count == 0)
{
continue;
}
sw.WriteLine("QGC WPL 110");
StreamWriter sw = new StreamWriter(Path.GetDirectoryName(logfile) + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(logfile) + "-" + wplists + ".txt");
byte count = mine.getWPCount();
sw.WriteLine("QGC WPL 110");
for (ushort a = 0; a < count; a++)
{
Locationwp wp = mine.getWP(a);
@ -1375,8 +1388,10 @@ namespace ArdupilotMega
sw.Write("\t" + 1);
sw.WriteLine("");
}
sw.Close();
sw.Close();
wplists++;
}
progressBar1.Value = 100;

View File

@ -2,14 +2,14 @@
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension" xmlns:difx="http://schemas.microsoft.com/wix/DifxAppExtension">
<Product Id="*" Name="APM Planner" Language="1033" Version="1.2.11" Manufacturer="Michael Oborne" UpgradeCode="{625389D7-EB3C-4d77-A5F6-A285CF99437D}">
<Product Id="*" Name="APM Planner" Language="1033" Version="1.2.12" Manufacturer="Michael Oborne" UpgradeCode="{625389D7-EB3C-4d77-A5F6-A285CF99437D}">
<Package Description="APM Planner Installer" Comments="Apm Planner Installer" Manufacturer="Michael Oborne" InstallerVersion="200" Compressed="yes" />
<Upgrade Id="{625389D7-EB3C-4d77-A5F6-A285CF99437D}">
<UpgradeVersion OnlyDetect="yes" Minimum="1.2.11" Property="NEWERVERSIONDETECTED" IncludeMinimum="no" />
<UpgradeVersion OnlyDetect="no" Maximum="1.2.11" Property="OLDERVERSIONBEINGUPGRADED" IncludeMaximum="no" />
<UpgradeVersion OnlyDetect="yes" Minimum="1.2.12" Property="NEWERVERSIONDETECTED" IncludeMinimum="no" />
<UpgradeVersion OnlyDetect="no" Maximum="1.2.12" Property="OLDERVERSIONBEINGUPGRADED" IncludeMaximum="no" />
</Upgrade>
<InstallExecuteSequence>
@ -31,7 +31,7 @@
<Permission User="Everyone" GenericAll="yes" />
</CreateFolder>
</Component>
<Component Id="_comp1" Guid="14edd85b-dc50-435c-9790-c20549b31302">
<Component Id="_comp1" Guid="00bc1eab-4a5f-41c6-93e6-29f385b08237">
<File Id="_2" Source="..\bin\release\.gdbinit" />
<File Id="_3" Source="..\bin\release\.gitignore" />
<File Id="_4" Source="..\bin\release\aerosim3.91.txt" />
@ -61,197 +61,201 @@
<File Id="_28" Source="..\bin\release\BSE.Windows.Forms.pdb" />
<File Id="_29" Source="..\bin\release\BSE.Windows.Forms.xml" />
<File Id="_30" Source="..\bin\release\Core.dll" />
<File Id="_31" Source="..\bin\release\cygstdc++-6.dll" />
<File Id="_32" Source="..\bin\release\cygwin1.dll" />
<File Id="_33" Source="..\bin\release\dataflashlog.xml" />
<File Id="_34" Source="..\bin\release\DirectShowLib-2005.dll" />
<File Id="_35" Source="..\bin\release\eeprom.bin" />
<File Id="_36" Source="..\bin\release\GMap.NET.Core.dll" />
<File Id="_37" Source="..\bin\release\GMap.NET.Core.pdb" />
<File Id="_38" Source="..\bin\release\GMap.NET.WindowsForms.dll" />
<File Id="_39" Source="..\bin\release\GMap.NET.WindowsForms.pdb" />
<File Id="_40" Source="..\bin\release\hud.html" />
<File Id="_41" Source="..\bin\release\ICSharpCode.SharpZipLib.dll" />
<File Id="_42" Source="..\bin\release\Ionic.Zip.Reduced.dll" />
<File Id="_43" Source="..\bin\release\IronPython.dll" />
<File Id="_44" Source="..\bin\release\IronPython.Modules.dll" />
<File Id="_45" Source="..\bin\release\JSBSim.exe" />
<File Id="_46" Source="..\bin\release\KMLib.dll" />
<File Id="_47" Source="..\bin\release\log4net.dll" />
<File Id="_48" Source="..\bin\release\mavcmd.xml" />
<File Id="_49" Source="..\bin\release\MAVLink.xml" />
<File Id="_50" Source="..\bin\release\MetaDataExtractor.dll" />
<File Id="_51" Source="..\bin\release\Microsoft.DirectX.dll" />
<File Id="_52" Source="..\bin\release\Microsoft.Dynamic.dll" />
<File Id="_53" Source="..\bin\release\Microsoft.Scripting.Core.dll" />
<File Id="_54" Source="..\bin\release\Microsoft.Scripting.Debugging.dll" />
<File Id="_55" Source="..\bin\release\Microsoft.Scripting.dll" />
<File Id="_56" Source="..\bin\release\Microsoft.Scripting.ExtensionAttribute.dll" />
<File Id="_57" Source="..\bin\release\netDxf.dll" />
<File Id="_58" Source="..\bin\release\OpenTK.Compatibility.dll" />
<File Id="_59" Source="..\bin\release\OpenTK.dll" />
<File Id="_60" Source="..\bin\release\OpenTK.dll.config" />
<File Id="_61" Source="..\bin\release\OpenTK.GLControl.dll" />
<File Id="_62" Source="..\bin\release\ParameterMetaData.xml" />
<File Id="_63" Source="..\bin\release\quadhil.xml" />
<File Id="_64" Source="..\bin\release\runme" />
<File Id="_65" Source="..\bin\release\serialsent.raw" />
<File Id="_66" Source="..\bin\release\SharpKml.dll" />
<File Id="_67" Source="..\bin\release\SharpKml.pdb" />
<File Id="_68" Source="..\bin\release\SharpKml.xml" />
<File Id="_69" Source="..\bin\release\System.Data.SQLite.dll" />
<File Id="_70" Source="..\bin\release\System.Reactive.dll" />
<File Id="_71" Source="..\bin\release\System.Reactive.xml" />
<File Id="_72" Source="..\bin\release\System.Speech.dll" />
<File Id="_73" Source="..\bin\release\Transitions.dll" />
<File Id="_74" Source="..\bin\release\Updater.exe" />
<File Id="_75" Source="..\bin\release\Updater.exe.config" />
<File Id="_76" Source="..\bin\release\Updater.pdb" />
<File Id="_77" Source="..\bin\release\version.exe" />
<File Id="_78" Source="..\bin\release\version.txt" />
<File Id="_79" Source="..\bin\release\ZedGraph.dll" />
<File Id="_31" Source="..\bin\release\Crom.Controls.dll" />
<File Id="_32" Source="..\bin\release\Crom.Controls.pdb" />
<File Id="_33" Source="..\bin\release\cygstdc++-6.dll" />
<File Id="_34" Source="..\bin\release\cygwin1.dll" />
<File Id="_35" Source="..\bin\release\dataflashlog.xml" />
<File Id="_36" Source="..\bin\release\DirectShowLib-2005.dll" />
<File Id="_37" Source="..\bin\release\eeprom.bin" />
<File Id="_38" Source="..\bin\release\GMap.NET.Core.dll" />
<File Id="_39" Source="..\bin\release\GMap.NET.Core.pdb" />
<File Id="_40" Source="..\bin\release\GMap.NET.WindowsForms.dll" />
<File Id="_41" Source="..\bin\release\GMap.NET.WindowsForms.pdb" />
<File Id="_42" Source="..\bin\release\hud.html" />
<File Id="_43" Source="..\bin\release\ICSharpCode.SharpZipLib.dll" />
<File Id="_44" Source="..\bin\release\Ionic.Zip.Reduced.dll" />
<File Id="_45" Source="..\bin\release\IronPython.dll" />
<File Id="_46" Source="..\bin\release\IronPython.Modules.dll" />
<File Id="_47" Source="..\bin\release\JSBSim.exe" />
<File Id="_48" Source="..\bin\release\KMLib.dll" />
<File Id="_49" Source="..\bin\release\log4net.dll" />
<File Id="_50" Source="..\bin\release\mavcmd.xml" />
<File Id="_51" Source="..\bin\release\MAVLink.xml" />
<File Id="_52" Source="..\bin\release\MetaDataExtractor.dll" />
<File Id="_53" Source="..\bin\release\Microsoft.DirectX.DirectInput.dll" />
<File Id="_54" Source="..\bin\release\Microsoft.DirectX.dll" />
<File Id="_55" Source="..\bin\release\Microsoft.Dynamic.dll" />
<File Id="_56" Source="..\bin\release\Microsoft.Scripting.Core.dll" />
<File Id="_57" Source="..\bin\release\Microsoft.Scripting.Debugging.dll" />
<File Id="_58" Source="..\bin\release\Microsoft.Scripting.dll" />
<File Id="_59" Source="..\bin\release\Microsoft.Scripting.ExtensionAttribute.dll" />
<File Id="_60" Source="..\bin\release\netDxf.dll" />
<File Id="_61" Source="..\bin\release\OpenTK.Compatibility.dll" />
<File Id="_62" Source="..\bin\release\OpenTK.dll" />
<File Id="_63" Source="..\bin\release\OpenTK.dll.config" />
<File Id="_64" Source="..\bin\release\OpenTK.GLControl.dll" />
<File Id="_65" Source="..\bin\release\ParameterMetaData.xml" />
<File Id="_66" Source="..\bin\release\quadhil.xml" />
<File Id="_67" Source="..\bin\release\Release.zip" />
<File Id="_68" Source="..\bin\release\runme" />
<File Id="_69" Source="..\bin\release\serialsent.raw" />
<File Id="_70" Source="..\bin\release\SharpKml.dll" />
<File Id="_71" Source="..\bin\release\SharpKml.pdb" />
<File Id="_72" Source="..\bin\release\SharpKml.xml" />
<File Id="_73" Source="..\bin\release\System.Data.SQLite.dll" />
<File Id="_74" Source="..\bin\release\System.Reactive.dll" />
<File Id="_75" Source="..\bin\release\System.Reactive.xml" />
<File Id="_76" Source="..\bin\release\System.Speech.dll" />
<File Id="_77" Source="..\bin\release\Transitions.dll" />
<File Id="_78" Source="..\bin\release\Updater.exe" />
<File Id="_79" Source="..\bin\release\Updater.exe.config" />
<File Id="_80" Source="..\bin\release\Updater.pdb" />
<File Id="_81" Source="..\bin\release\version.exe" />
<File Id="_82" Source="..\bin\release\version.txt" />
<File Id="_83" Source="..\bin\release\ZedGraph.dll" />
</Component>
<Directory Id="aircraft79" Name="aircraft">
<Component Id="_comp80" Guid="626e4768-abf0-4b69-bd4c-a203dba6a6a6">
<File Id="_81" Source="..\bin\release\aircraft\placeholder.txt" />
<Directory Id="aircraft83" Name="aircraft">
<Component Id="_comp84" Guid="8739c9c5-9787-44cd-bcde-35025a1b5820">
<File Id="_85" Source="..\bin\release\aircraft\placeholder.txt" />
</Component>
<Directory Id="arducopter81" Name="arducopter">
<Component Id="_comp82" Guid="2d01715e-d29d-4f10-bd83-ec9c9a91e44d">
<File Id="_83" Source="..\bin\release\aircraft\arducopter\arducopter-set.xml" />
<File Id="_84" Source="..\bin\release\aircraft\arducopter\arducopter.jpg" />
<File Id="_85" Source="..\bin\release\aircraft\arducopter\arducopter.xml" />
<File Id="_86" Source="..\bin\release\aircraft\arducopter\initfile.xml" />
<File Id="_87" Source="..\bin\release\aircraft\arducopter\plus_quad2-set.xml" />
<File Id="_88" Source="..\bin\release\aircraft\arducopter\plus_quad2.xml" />
<File Id="_89" Source="..\bin\release\aircraft\arducopter\quad.nas" />
<File Id="_90" Source="..\bin\release\aircraft\arducopter\README" />
<Directory Id="arducopter85" Name="arducopter">
<Component Id="_comp86" Guid="e01e29a2-4aca-4800-986a-25b7dfd5657e">
<File Id="_87" Source="..\bin\release\aircraft\arducopter\arducopter-set.xml" />
<File Id="_88" Source="..\bin\release\aircraft\arducopter\arducopter.jpg" />
<File Id="_89" Source="..\bin\release\aircraft\arducopter\arducopter.xml" />
<File Id="_90" Source="..\bin\release\aircraft\arducopter\initfile.xml" />
<File Id="_91" Source="..\bin\release\aircraft\arducopter\plus_quad2-set.xml" />
<File Id="_92" Source="..\bin\release\aircraft\arducopter\plus_quad2.xml" />
<File Id="_93" Source="..\bin\release\aircraft\arducopter\quad.nas" />
<File Id="_94" Source="..\bin\release\aircraft\arducopter\README" />
</Component>
<Directory Id="data90" Name="data">
<Component Id="_comp91" Guid="35c92295-3274-4062-83b2-f9b57e04dc98">
<File Id="_92" Source="..\bin\release\aircraft\arducopter\data\arducopter_half_step.txt" />
<File Id="_93" Source="..\bin\release\aircraft\arducopter\data\arducopter_step.txt" />
<File Id="_94" Source="..\bin\release\aircraft\arducopter\data\rw_generic_pylon.ac" />
<Directory Id="data94" Name="data">
<Component Id="_comp95" Guid="bb75ec93-e59c-437b-b6e0-2310376d997e">
<File Id="_96" Source="..\bin\release\aircraft\arducopter\data\arducopter_half_step.txt" />
<File Id="_97" Source="..\bin\release\aircraft\arducopter\data\arducopter_step.txt" />
<File Id="_98" Source="..\bin\release\aircraft\arducopter\data\rw_generic_pylon.ac" />
</Component>
</Directory>
<Directory Id="Engines94" Name="Engines">
<Component Id="_comp95" Guid="79cc8885-7ed4-4900-8001-8e8fec577e1f">
<File Id="_96" Source="..\bin\release\aircraft\arducopter\Engines\a2830-12.xml" />
<File Id="_97" Source="..\bin\release\aircraft\arducopter\Engines\prop10x4.5.xml" />
<Directory Id="Engines98" Name="Engines">
<Component Id="_comp99" Guid="149a1e9f-9cdf-4976-97e3-b7aed7457824">
<File Id="_100" Source="..\bin\release\aircraft\arducopter\Engines\a2830-12.xml" />
<File Id="_101" Source="..\bin\release\aircraft\arducopter\Engines\prop10x4.5.xml" />
</Component>
</Directory>
<Directory Id="Models97" Name="Models">
<Component Id="_comp98" Guid="823617c4-8c7a-4185-b6a4-ef3afa9cf058">
<File Id="_99" Source="..\bin\release\aircraft\arducopter\Models\arducopter.ac" />
<File Id="_100" Source="..\bin\release\aircraft\arducopter\Models\arducopter.xml" />
<File Id="_101" Source="..\bin\release\aircraft\arducopter\Models\plus_quad.ac" />
<File Id="_102" Source="..\bin\release\aircraft\arducopter\Models\plus_quad2.ac" />
<File Id="_103" Source="..\bin\release\aircraft\arducopter\Models\plus_quad2.xml" />
<File Id="_104" Source="..\bin\release\aircraft\arducopter\Models\quad.3ds" />
<File Id="_105" Source="..\bin\release\aircraft\arducopter\Models\shareware_output.3ds" />
<File Id="_106" Source="..\bin\release\aircraft\arducopter\Models\Untitled.ac" />
<File Id="_107" Source="..\bin\release\aircraft\arducopter\Models\Y6_test.ac" />
<Directory Id="Models101" Name="Models">
<Component Id="_comp102" Guid="4f421295-b0b3-4545-874b-e83a43a18106">
<File Id="_103" Source="..\bin\release\aircraft\arducopter\Models\arducopter.ac" />
<File Id="_104" Source="..\bin\release\aircraft\arducopter\Models\arducopter.xml" />
<File Id="_105" Source="..\bin\release\aircraft\arducopter\Models\plus_quad.ac" />
<File Id="_106" Source="..\bin\release\aircraft\arducopter\Models\plus_quad2.ac" />
<File Id="_107" Source="..\bin\release\aircraft\arducopter\Models\plus_quad2.xml" />
<File Id="_108" Source="..\bin\release\aircraft\arducopter\Models\quad.3ds" />
<File Id="_109" Source="..\bin\release\aircraft\arducopter\Models\shareware_output.3ds" />
<File Id="_110" Source="..\bin\release\aircraft\arducopter\Models\Untitled.ac" />
<File Id="_111" Source="..\bin\release\aircraft\arducopter\Models\Y6_test.ac" />
</Component>
</Directory>
</Directory>
<Directory Id="Rascal107" Name="Rascal">
<Component Id="_comp108" Guid="d62d5f01-c08a-4dee-a4e1-07f1d7259a88">
<File Id="_109" Source="..\bin\release\aircraft\Rascal\Rascal-keyboard.xml" />
<File Id="_110" Source="..\bin\release\aircraft\Rascal\Rascal-submodels.xml" />
<File Id="_111" Source="..\bin\release\aircraft\Rascal\Rascal.xml" />
<File Id="_112" Source="..\bin\release\aircraft\Rascal\Rascal110-JSBSim-set.xml" />
<File Id="_113" Source="..\bin\release\aircraft\Rascal\Rascal110-JSBSim.xml" />
<File Id="_114" Source="..\bin\release\aircraft\Rascal\Rascal110-splash.rgb" />
<File Id="_115" Source="..\bin\release\aircraft\Rascal\README.Rascal" />
<File Id="_116" Source="..\bin\release\aircraft\Rascal\reset_CMAC.xml" />
<File Id="_117" Source="..\bin\release\aircraft\Rascal\thumbnail.jpg" />
<Directory Id="Rascal111" Name="Rascal">
<Component Id="_comp112" Guid="f6974dca-c2f9-4093-817a-cd99a6247423">
<File Id="_113" Source="..\bin\release\aircraft\Rascal\Rascal-keyboard.xml" />
<File Id="_114" Source="..\bin\release\aircraft\Rascal\Rascal-submodels.xml" />
<File Id="_115" Source="..\bin\release\aircraft\Rascal\Rascal.xml" />
<File Id="_116" Source="..\bin\release\aircraft\Rascal\Rascal110-JSBSim-set.xml" />
<File Id="_117" Source="..\bin\release\aircraft\Rascal\Rascal110-JSBSim.xml" />
<File Id="_118" Source="..\bin\release\aircraft\Rascal\Rascal110-splash.rgb" />
<File Id="_119" Source="..\bin\release\aircraft\Rascal\README.Rascal" />
<File Id="_120" Source="..\bin\release\aircraft\Rascal\reset_CMAC.xml" />
<File Id="_121" Source="..\bin\release\aircraft\Rascal\thumbnail.jpg" />
</Component>
<Directory Id="Engines117" Name="Engines">
<Component Id="_comp118" Guid="261e663c-9ac0-4808-b8dd-56e21ded8ecf">
<File Id="_119" Source="..\bin\release\aircraft\Rascal\Engines\18x8.xml" />
<File Id="_120" Source="..\bin\release\aircraft\Rascal\Engines\Zenoah_G-26A.xml" />
<Directory Id="Engines121" Name="Engines">
<Component Id="_comp122" Guid="0832588c-7450-4add-a90f-182138f6c304">
<File Id="_123" Source="..\bin\release\aircraft\Rascal\Engines\18x8.xml" />
<File Id="_124" Source="..\bin\release\aircraft\Rascal\Engines\Zenoah_G-26A.xml" />
</Component>
</Directory>
<Directory Id="Models120" Name="Models">
<Component Id="_comp121" Guid="c1a6789d-950d-4d95-9cc7-a501c8011c3d">
<File Id="_122" Source="..\bin\release\aircraft\Rascal\Models\Rascal.rgb" />
<File Id="_123" Source="..\bin\release\aircraft\Rascal\Models\Rascal110-000-013.ac" />
<File Id="_124" Source="..\bin\release\aircraft\Rascal\Models\Rascal110.xml" />
<File Id="_125" Source="..\bin\release\aircraft\Rascal\Models\smoke.png" />
<File Id="_126" Source="..\bin\release\aircraft\Rascal\Models\smokeW.xml" />
<File Id="_127" Source="..\bin\release\aircraft\Rascal\Models\Trajectory-Marker.ac" />
<File Id="_128" Source="..\bin\release\aircraft\Rascal\Models\Trajectory-Marker.xml" />
<Directory Id="Models124" Name="Models">
<Component Id="_comp125" Guid="7576d9f1-61c7-4573-ac79-45bc35ee7e63">
<File Id="_126" Source="..\bin\release\aircraft\Rascal\Models\Rascal.rgb" />
<File Id="_127" Source="..\bin\release\aircraft\Rascal\Models\Rascal110-000-013.ac" />
<File Id="_128" Source="..\bin\release\aircraft\Rascal\Models\Rascal110.xml" />
<File Id="_129" Source="..\bin\release\aircraft\Rascal\Models\smoke.png" />
<File Id="_130" Source="..\bin\release\aircraft\Rascal\Models\smokeW.xml" />
<File Id="_131" Source="..\bin\release\aircraft\Rascal\Models\Trajectory-Marker.ac" />
<File Id="_132" Source="..\bin\release\aircraft\Rascal\Models\Trajectory-Marker.xml" />
</Component>
</Directory>
<Directory Id="Systems128" Name="Systems">
<Component Id="_comp129" Guid="d0209c82-a212-4fdb-a21c-595ebef257e2">
<File Id="_130" Source="..\bin\release\aircraft\Rascal\Systems\110-autopilot.xml" />
<File Id="_131" Source="..\bin\release\aircraft\Rascal\Systems\airdata.nas" />
<File Id="_132" Source="..\bin\release\aircraft\Rascal\Systems\electrical.xml" />
<File Id="_133" Source="..\bin\release\aircraft\Rascal\Systems\main.nas" />
<File Id="_134" Source="..\bin\release\aircraft\Rascal\Systems\ugear.nas" />
<Directory Id="Systems132" Name="Systems">
<Component Id="_comp133" Guid="f0c415a8-601d-417a-9590-831c5f77c1df">
<File Id="_134" Source="..\bin\release\aircraft\Rascal\Systems\110-autopilot.xml" />
<File Id="_135" Source="..\bin\release\aircraft\Rascal\Systems\airdata.nas" />
<File Id="_136" Source="..\bin\release\aircraft\Rascal\Systems\electrical.xml" />
<File Id="_137" Source="..\bin\release\aircraft\Rascal\Systems\main.nas" />
<File Id="_138" Source="..\bin\release\aircraft\Rascal\Systems\ugear.nas" />
</Component>
</Directory>
</Directory>
</Directory>
<Directory Id="Driver134" Name="Driver">
<Component Id="_comp135" Guid="2b339b16-e81e-4446-a577-89186b2add10">
<File Id="_136" Source="..\bin\release\Driver\Arduino MEGA 2560.inf" />
<Directory Id="Driver138" Name="Driver">
<Component Id="_comp139" Guid="c0b8d7b1-9907-4b02-891d-1e94033c8224">
<File Id="_140" Source="..\bin\release\Driver\Arduino MEGA 2560.inf" />
</Component>
</Directory>
<Directory Id="es_ES136" Name="es-ES">
<Component Id="_comp137" Guid="84622c60-6bc5-4536-b534-3ca384e85739">
<File Id="_138" Source="..\bin\release\es-ES\ArdupilotMegaPlanner10.resources.dll" />
<Directory Id="es_ES140" Name="es-ES">
<Component Id="_comp141" Guid="ac064042-354b-4bff-b59c-84697790dc85">
<File Id="_142" Source="..\bin\release\es-ES\ArdupilotMegaPlanner10.resources.dll" />
</Component>
</Directory>
<Directory Id="fr138" Name="fr">
<Component Id="_comp139" Guid="db29830b-f195-4683-98e5-1a29dd1f90db">
<File Id="_140" Source="..\bin\release\fr\ArdupilotMegaPlanner10.resources.dll" />
<Directory Id="fr142" Name="fr">
<Component Id="_comp143" Guid="e9d71399-7e31-437c-823a-37717df08c03">
<File Id="_144" Source="..\bin\release\fr\ArdupilotMegaPlanner10.resources.dll" />
</Component>
</Directory>
<Directory Id="it_IT140" Name="it-IT">
<Component Id="_comp141" Guid="d948fc7b-ad86-4be1-8491-a9ce57665c0d">
<File Id="_142" Source="..\bin\release\it-IT\ArdupilotMegaPlanner10.resources.dll" />
<Directory Id="it_IT144" Name="it-IT">
<Component Id="_comp145" Guid="a7816e99-06df-42d8-9444-b55c8d754ec6">
<File Id="_146" Source="..\bin\release\it-IT\ArdupilotMegaPlanner10.resources.dll" />
</Component>
</Directory>
<Directory Id="jsbsim142" Name="jsbsim">
<Component Id="_comp143" Guid="c2527e3e-d37f-4c08-b35f-89eda4d628e9">
<File Id="_144" Source="..\bin\release\jsbsim\fgout.xml" />
<File Id="_145" Source="..\bin\release\jsbsim\rascal_test.xml" />
<Directory Id="jsbsim146" Name="jsbsim">
<Component Id="_comp147" Guid="c61734d9-4dd2-4384-9b57-53c045c9606a">
<File Id="_148" Source="..\bin\release\jsbsim\fgout.xml" />
<File Id="_149" Source="..\bin\release\jsbsim\rascal_test.xml" />
</Component>
</Directory>
<Directory Id="m3u145" Name="m3u">
<Component Id="_comp146" Guid="b68d9497-a452-413d-8624-6526c7a039e7">
<File Id="_147" Source="..\bin\release\m3u\both.m3u" />
<File Id="_148" Source="..\bin\release\m3u\GeoRefnetworklink.kml" />
<File Id="_149" Source="..\bin\release\m3u\hud.m3u" />
<File Id="_150" Source="..\bin\release\m3u\map.m3u" />
<File Id="_151" Source="..\bin\release\m3u\networklink.kml" />
<Directory Id="m3u149" Name="m3u">
<Component Id="_comp150" Guid="6c79ba31-05ec-4f32-8cf1-c8e708ab8ea5">
<File Id="_151" Source="..\bin\release\m3u\both.m3u" />
<File Id="_152" Source="..\bin\release\m3u\GeoRefnetworklink.kml" />
<File Id="_153" Source="..\bin\release\m3u\hud.m3u" />
<File Id="_154" Source="..\bin\release\m3u\map.m3u" />
<File Id="_155" Source="..\bin\release\m3u\networklink.kml" />
</Component>
</Directory>
<Directory Id="pl151" Name="pl">
<Component Id="_comp152" Guid="359b6787-5f88-437f-bd66-a46fe5fa218f">
<File Id="_153" Source="..\bin\release\pl\ArdupilotMegaPlanner10.resources.dll" />
<Directory Id="pl155" Name="pl">
<Component Id="_comp156" Guid="58491486-881f-4490-92ab-03f5e1606db0">
<File Id="_157" Source="..\bin\release\pl\ArdupilotMegaPlanner10.resources.dll" />
</Component>
</Directory>
<Directory Id="Resources153" Name="Resources">
<Component Id="_comp154" Guid="b0c6b2d3-2d5d-4fd5-ab20-24c95a20fe8c">
<File Id="_155" Source="..\bin\release\Resources\MAVCmd.txt" />
<File Id="_156" Source="..\bin\release\Resources\Welcome_to_Michael_Oborne.rtf" />
<Directory Id="Resources157" Name="Resources">
<Component Id="_comp158" Guid="5fe1820a-7c50-4a0f-9f77-b7adb699b565">
<File Id="_159" Source="..\bin\release\Resources\MAVCmd.txt" />
<File Id="_160" Source="..\bin\release\Resources\Welcome_to_Michael_Oborne.rtf" />
</Component>
</Directory>
<Directory Id="ru_RU156" Name="ru-RU">
<Component Id="_comp157" Guid="e10eddb8-431c-40f2-9e22-70824b73ef02">
<File Id="_158" Source="..\bin\release\ru-RU\ArdupilotMegaPlanner10.resources.dll" />
<Directory Id="ru_RU160" Name="ru-RU">
<Component Id="_comp161" Guid="dd56a5d8-4f93-488a-b6ee-dd6299ea8b22">
<File Id="_162" Source="..\bin\release\ru-RU\ArdupilotMegaPlanner10.resources.dll" />
</Component>
</Directory>
<Directory Id="zh_Hans158" Name="zh-Hans">
<Component Id="_comp159" Guid="c2bffeb8-3994-49ae-9fec-03ff68237f0a">
<File Id="_160" Source="..\bin\release\zh-Hans\ArdupilotMegaPlanner10.resources.dll" />
<Directory Id="zh_Hans162" Name="zh-Hans">
<Component Id="_comp163" Guid="af6ea193-4ca9-461f-9060-ea5f65dc5396">
<File Id="_164" Source="..\bin\release\zh-Hans\ArdupilotMegaPlanner10.resources.dll" />
</Component>
</Directory>
<Directory Id="zh_TW160" Name="zh-TW">
<Component Id="_comp161" Guid="3f203723-7fc9-48f5-af76-4ecb6cce7f35">
<File Id="_162" Source="..\bin\release\zh-TW\ArdupilotMegaPlanner10.resources.dll" />
<Directory Id="zh_TW164" Name="zh-TW">
<Component Id="_comp165" Guid="2e9a21fc-2d73-4de2-98d8-75341c0140c6">
<File Id="_166" Source="..\bin\release\zh-TW\ArdupilotMegaPlanner10.resources.dll" />
</Component>
</Directory>
@ -295,26 +299,26 @@
<ComponentRef Id="InstallDirPermissions" />
<ComponentRef Id="_comp1" />
<ComponentRef Id="_comp80" />
<ComponentRef Id="_comp82" />
<ComponentRef Id="_comp91" />
<ComponentRef Id="_comp84" />
<ComponentRef Id="_comp86" />
<ComponentRef Id="_comp95" />
<ComponentRef Id="_comp98" />
<ComponentRef Id="_comp108" />
<ComponentRef Id="_comp118" />
<ComponentRef Id="_comp121" />
<ComponentRef Id="_comp129" />
<ComponentRef Id="_comp135" />
<ComponentRef Id="_comp137" />
<ComponentRef Id="_comp99" />
<ComponentRef Id="_comp102" />
<ComponentRef Id="_comp112" />
<ComponentRef Id="_comp122" />
<ComponentRef Id="_comp125" />
<ComponentRef Id="_comp133" />
<ComponentRef Id="_comp139" />
<ComponentRef Id="_comp141" />
<ComponentRef Id="_comp143" />
<ComponentRef Id="_comp146" />
<ComponentRef Id="_comp152" />
<ComponentRef Id="_comp154" />
<ComponentRef Id="_comp157" />
<ComponentRef Id="_comp159" />
<ComponentRef Id="_comp145" />
<ComponentRef Id="_comp147" />
<ComponentRef Id="_comp150" />
<ComponentRef Id="_comp156" />
<ComponentRef Id="_comp158" />
<ComponentRef Id="_comp161" />
<ComponentRef Id="_comp163" />
<ComponentRef Id="_comp165" />
<ComponentRef Id="ApplicationShortcut" />

View File

@ -253,6 +253,8 @@ namespace ArdupilotMega.Controls
sw.Start();
zoom = 11;
getImage();
sw.Stop();
@ -261,7 +263,7 @@ namespace ArdupilotMega.Controls
sw.Start();
double increment = step * 1;
double increment = step * 5;
double cleanup = area.Bottom % increment;
double cleanup2 = area.Left % increment;
@ -274,12 +276,12 @@ namespace ArdupilotMega.Controls
{
int heightl = srtm.getAltitude(z, area.Right + area.Left - x, 20);
// Console.WriteLine(x + " " + z);
// Console.WriteLine(x + " " + z);
GL.Color3(Color.White);
// int heightl = 0;
// int heightl = 0;
double scale2 = (Math.Abs(x - area.Left) / area.WidthLng);// / (float)_terrain.Width;

View File

@ -38,7 +38,10 @@ namespace ArdupilotMega
//Common.linearRegression();
//Console.WriteLine(srtm.getAltitude(-35.115676879882812, 117.94178754638671,20));
Console.WriteLine(srtm.getAltitude(-35.115676879882812, 117.94178754638671,20));
// Console.ReadLine();
// return;
/*
Arduino.ArduinoSTKv2 comport = new Arduino.ArduinoSTKv2();

View File

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

View File

@ -251,7 +251,7 @@ namespace resedit
try
{
thisAssembly = Assembly.LoadFile(Path.GetDirectoryName(Application.ExecutablePath) + Path.DirectorySeparatorChar + ci + Path.DirectorySeparatorChar + "ArdupilotMegaPlanner.resources.dll");
thisAssembly = Assembly.LoadFile(Path.GetDirectoryName(Application.ExecutablePath) + Path.DirectorySeparatorChar + ci + Path.DirectorySeparatorChar + "ArdupilotMegaPlanner10.resources.dll");
}
catch { return; }

View File

@ -20,8 +20,6 @@
<F5>Yaw IN</F5>
<F6>Yaw</F6>
<F7>Nav Yaw</F7>
<F8>Roll I</F8>
<F9>Pitch I</F9>
</ATT>
<NTUN>
<F1>WP Dist</F1>
@ -32,20 +30,16 @@
<F6>Nav Roll</F6>
<F7>X Speed</F7>
<F8>Y Speed</F8>
<F9>Nav Lon I</F9>
<F10>Nav Lat I</F10>
</NTUN>
<CTUN>
<F1>Thr in</F1>
<F1>Thr IN</F1>
<F2>Sonar Alt</F2>
<F3>Baro Alt</F3>
<F4>WP Alt</F4>
<F5>Nav Throttle</F5>
<F6>Angle Boost</F6>
<F6>Angle boost</F6>
<F7>Climb Rate</F7>
<F8>Throttle Out</F8>
<F9>Alt Hold Int</F9>
<F10>Thr iInt</F10>
</CTUN>
<PM>
<F1>Gyro Saturation</F1>

View File

@ -27,19 +27,21 @@ namespace ArdupilotMega
static Hashtable filecache = new Hashtable();
static Dictionary<string, short[,]> cache = new Dictionary<string, short[,]>();
public static int getAltitude(double lat, double lng, double zoom)
{
short alt = 0;
lat += 1 / 1199.0;
//lat += 1 / 1199.0;
//lng -= 1 / 1201f;
// lat -35.115676879882812 double
// lng 117.94178754638671 double
// alt 70 short
int x = (int)Math.Floor(lng);
int y = (int)Math.Floor(lat);
int x = (lng < 0) ? (int)(lng-1) : (int)lng;//(int)Math.Floor(lng);
int y = (lat < 0) ? (int)(lat - 1) : (int)lat; ;//(int)Math.Floor(lat);
string ns;
if (y > 0)
@ -63,47 +65,65 @@ namespace ArdupilotMega
try
{
if (filecache.ContainsKey(datadirectory + Path.DirectorySeparatorChar + filename) || File.Exists(datadirectory + Path.DirectorySeparatorChar + filename))
if (cache.ContainsKey(filename) || File.Exists(datadirectory + Path.DirectorySeparatorChar + filename))
{ // srtm hgt files
//FileStream fs = new FileStream(datadirectory + Path.DirectorySeparatorChar + filename, FileMode.Open, FileAccess.Read, FileShare.Read);
MemoryStream fs = readFile(datadirectory + Path.DirectorySeparatorChar + filename);
int size = -1;
if (!cache.ContainsKey(filename))
{
FileStream fs = new FileStream(datadirectory + Path.DirectorySeparatorChar + filename, FileMode.Open, FileAccess.Read, FileShare.Read);
if (fs.Length == (1201 * 1201 * 2))
{
size = 1201;
}
else
{
size = 3601;
}
byte[] altbytes = new byte[2];
short[,] altdata = new short[size, size];
int altlat = 0;
int altlng = 0;
while (fs.Read(altbytes, 0, 2) != 0)
{
altdata[altlat, altlng] = (short)((altbytes[0] << 8) + altbytes[1]);
altlat++;
if (altlat >= size)
{
altlng++;
altlat = 0;
}
}
fs.Close();
cache[filename] = altdata;
}
if (cache[filename].Length == (1201 * 1201))
{
size = 1201;
}
else
{
size = 3601;
}
int posx = 0;
int row = 0;
if (fs.Length <= (1201 * 1201 * 2))
{
posx = (int)(((float)(lng - x)) * (1201 * 2));
row = (int)(((float)(lat - y)) * 1201) * (1201 * 2);
row = (1201 * 1201 * 2) - row;
}
else
{
posx = (int)(((float)(lng - x)) * (3601 * 2));
row = (int)(((float)(lat - y)) * 3601) * (3601 * 2);
row = (3601 * 3601 * 2) - row;
}
posx = (int)(((float)(lng - x)) * (size * 1));
row = (int)(((float)(lat - y)) * (size * 1));
row = size - row;
if (posx % 2 == 1)
{
posx--;
}
//Console.WriteLine(filename + " row " + row + " posx" + posx);
byte[] data = new byte[2];
fs.Seek((int)(row + posx), SeekOrigin.Begin);
fs.Read(data, 0, data.Length);
//fs.Close();
//Array.Reverse(data);
alt = (short)((data[0] << 8) + data[1]) ;//BitConverter.ToInt16(data, 0);
return alt;
return cache[filename][posx, row];
}
string filename2 = "srtm_" + Math.Round((lng + 2.5 + 180) / 5, 0).ToString("00") + "_" + Math.Round((60 - lat + 2.5) / 5, 0).ToString("00") + ".asc";

View File

@ -249,7 +249,7 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(685, 285);
this.ClientSize = new System.Drawing.Size(685, 507);
this.Controls.Add(this.myButton1);
this.Controls.Add(this.BUT_paramgen);
this.Controls.Add(this.BUT_follow_me);

View File

@ -31,11 +31,11 @@ namespace ArdupilotMega
if (System.Diagnostics.Debugger.IsAttached) {
// ArdupilotMega.Controls.OpenGLtest ogl = new Controls.OpenGLtest();
ArdupilotMega.Controls.OpenGLtest ogl = new Controls.OpenGLtest();
// this.Controls.Add(ogl);
this.Controls.Add(ogl);
// ogl.Dock = DockStyle.Fill;
ogl.Dock = DockStyle.Fill;
}
}