Mission Planner 1.2.26

move mavlink structure/currentstate around for future mods
update old firmware git hashs
mod some error descriptions
AP_mount camera trigger mod
modify raw param display with units/range/desc
add radio support for 868mhz
update ch7 options
updated dataflashlog format
small df log parser mod for bad gps loc
renable menu to always dock. right click for autohide
This commit is contained in:
Michael Oborne 2012-12-07 17:19:46 +08:00
parent b973d50d79
commit 1b56a10b9a
74 changed files with 3868 additions and 1700 deletions

View File

@ -1,4 +1,5 @@
0.9 - added rfd900a 1.0 - added rf freeq for 868
0.9 - added rfd900a
0.8 - fix settings saving. 0.8 - fix settings saving.
0.7 - fix typos - log rssi screen to log as well 0.7 - fix typos - log rssi screen to log as well
0.6 - add terminal logging to file, fix remote radio config 0.6 - add terminal logging to file, fix remote radio config

View File

@ -1588,7 +1588,7 @@
</value> </value>
</data> </data>
<data name="$this.Text" xml:space="preserve"> <data name="$this.Text" xml:space="preserve">
<value>3DRRadio Config 0.9</value> <value>3DRRadio Config 1.0</value>
</data> </data>
<data name="&gt;&gt;settingsToolStripMenuItem.Name" xml:space="preserve"> <data name="&gt;&gt;settingsToolStripMenuItem.Name" xml:space="preserve">
<value>settingsToolStripMenuItem</value> <value>settingsToolStripMenuItem</value>

View File

@ -198,7 +198,7 @@ namespace ArdupilotMega.Antenna
try try
{ {
// 10 hz - position updates default to 3 hz on the stream rate // 10 hz - position updates default to 3 hz on the stream rate
tracker.PanAndTilt(MainV2.cs.AZToMAV, MainV2.cs.ELToMAV); tracker.PanAndTilt(MainV2.comPort.MAV.cs.AZToMAV, MainV2.comPort.MAV.cs.ELToMAV);
System.Threading.Thread.Sleep(100); System.Threading.Thread.Sleep(100);
} }
catch { } catch { }
@ -262,7 +262,7 @@ namespace ArdupilotMega.Antenna
void tm1_Tick(object item) void tm1_Tick(object item)
{ {
float snr = MainV2.cs.localsnrdb; float snr = MainV2.comPort.MAV.cs.localsnrdb;
float best = snr; float best = snr;
float tilt = 0; float tilt = 0;
@ -316,13 +316,13 @@ namespace ArdupilotMega.Antenna
System.Threading.Thread.Sleep(2000); System.Threading.Thread.Sleep(2000);
Console.WriteLine("Angle " + n + " snr " + MainV2.cs.localsnrdb); Console.WriteLine("Angle " + n + " snr " + MainV2.comPort.MAV.cs.localsnrdb);
if (MainV2.cs.localsnrdb > lastsnr) if (MainV2.comPort.MAV.cs.localsnrdb > lastsnr)
{ {
best = n; best = n;
lastsnr = MainV2.cs.localsnrdb; lastsnr = MainV2.comPort.MAV.cs.localsnrdb;
} }
} }

View File

@ -292,6 +292,12 @@
<DependentUpon>ConnectionStats.cs</DependentUpon> <DependentUpon>ConnectionStats.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Controls\CustomMessageBox.cs" /> <Compile Include="Controls\CustomMessageBox.cs" />
<Compile Include="Controls\FlashMessage.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\FlashMessage.designer.cs">
<DependentUpon>FlashMessage.cs</DependentUpon>
</Compile>
<Compile Include="Controls\HSI.cs"> <Compile Include="Controls\HSI.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
@ -412,6 +418,12 @@
<Compile Include="GCSViews\ConfigurationView\ConfigAteryxSensors.Designer.cs"> <Compile Include="GCSViews\ConfigurationView\ConfigAteryxSensors.Designer.cs">
<DependentUpon>ConfigAteryxSensors.cs</DependentUpon> <DependentUpon>ConfigAteryxSensors.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="GCSViews\ConfigurationView\ConfigSignalization.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GCSViews\ConfigurationView\ConfigSignalization.designer.cs">
<DependentUpon>ConfigSignalization.cs</DependentUpon>
</Compile>
<Compile Include="HIL\Hil.cs" /> <Compile Include="HIL\Hil.cs" />
<None Include="HIL\JSBSim.cs" /> <None Include="HIL\JSBSim.cs" />
<Compile Include="HIL\Wind.cs" /> <Compile Include="HIL\Wind.cs" />
@ -730,6 +742,9 @@
<EmbeddedResource Include="Controls\ConnectionStats.resx"> <EmbeddedResource Include="Controls\ConnectionStats.resx">
<DependentUpon>ConnectionStats.cs</DependentUpon> <DependentUpon>ConnectionStats.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Controls\FlashMessage.resx">
<DependentUpon>FlashMessage.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\HSI.resx"> <EmbeddedResource Include="Controls\HSI.resx">
<DependentUpon>HSI.cs</DependentUpon> <DependentUpon>HSI.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@ -844,6 +859,9 @@
<EmbeddedResource Include="GCSViews\ConfigurationView\ConfigRawParams.fr.resx"> <EmbeddedResource Include="GCSViews\ConfigurationView\ConfigRawParams.fr.resx">
<DependentUpon>ConfigRawParams.cs</DependentUpon> <DependentUpon>ConfigRawParams.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="GCSViews\ConfigurationView\ConfigSignalization.resx">
<DependentUpon>ConfigSignalization.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GCSViews\ConfigurationView\ConfigTradHeli.de-DE.resx"> <EmbeddedResource Include="GCSViews\ConfigurationView\ConfigTradHeli.de-DE.resx">
<DependentUpon>ConfigTradHeli.cs</DependentUpon> <DependentUpon>ConfigTradHeli.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@ -1203,6 +1221,7 @@
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="GCSViews\Help.zh-TW.resx"> <EmbeddedResource Include="GCSViews\Help.zh-TW.resx">
<DependentUpon>Help.cs</DependentUpon> <DependentUpon>Help.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="GCSViews\Simulation.fr.resx"> <EmbeddedResource Include="GCSViews\Simulation.fr.resx">
<DependentUpon>Simulation.cs</DependentUpon> <DependentUpon>Simulation.cs</DependentUpon>
@ -1343,6 +1362,7 @@
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="GCSViews\Help.zh-Hans.resx"> <EmbeddedResource Include="GCSViews\Help.zh-Hans.resx">
<DependentUpon>Help.cs</DependentUpon> <DependentUpon>Help.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="GCSViews\Simulation.resx"> <EmbeddedResource Include="GCSViews\Simulation.resx">
<DependentUpon>Simulation.cs</DependentUpon> <DependentUpon>Simulation.cs</DependentUpon>
@ -1425,8 +1445,6 @@
<None Include="block_plane_0.dae"> <None Include="block_plane_0.dae">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> </None>
<None Include="Resources\Welcome_CN.rtf" />
<None Include="Resources\Welcome_TW.rtf" />
<None Include="Resources\Welcome_to_Michael_Oborne.rtf"> <None Include="Resources\Welcome_to_Michael_Oborne.rtf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> </None>

View File

@ -1,4 +1,34 @@
* Mission Planner 1.2.22 * Mission Planner 1.2.26
move mavlink structure/currentstate around for future mods
update old firmware git hashs
mod some error descriptions
AP_mount camera trigger mod
modify raw param display with units/range/desc
add radio support for 868mhz
update ch7 options
updated dataflashlog format
small df log parser mod for bad gps loc
renable menu to always dock. right click for autohide
* Mission Planner 1.2.25
fix scaling problem on arducopter config tab. when linking is enabled
* Mission Planner 1.2.24
failsafe: hide element not needed
ap_limits back - beta
add new accel setup - beta
fix planner config screen exception
fix quickview desc/units if never been configured
* Mission Planner 1.2.23
ammend serial dispose on usb devices detach
add item currentstate item description and units
ammend battery screen for 3dr power module
add trackbar zoom to flight data
add unit desccription
ammend PREFLIGHT_REBOOT_SHUTDOWN timeout
* Mission Planner 1.2.22
fix speed modification scale fix speed modification scale
fix typo on antenna Tracker fix typo on antenna Tracker
setup for ThemeManager.cs setup for ThemeManager.cs

View File

@ -201,29 +201,29 @@ namespace ArdupilotMega
double width = (MainMap.Manager.GetDistance(MainMap.FromLocalToLatLng(0, 0), MainMap.FromLocalToLatLng(MainMap.Width, 0)) * 1000.0); double width = (MainMap.Manager.GetDistance(MainMap.FromLocalToLatLng(0, 0), MainMap.FromLocalToLatLng(MainMap.Width, 0)) * 1000.0);
double m2pixelwidth = MainMap.Width / width; double m2pixelwidth = MainMap.Width / width;
float alpha = ((desired_lead_dist * (float)m2pixelwidth) / MainV2.cs.radius) * rad2deg; float alpha = ((desired_lead_dist * (float)m2pixelwidth) / MainV2.comPort.MAV.cs.radius) * rad2deg;
if (MainV2.cs.radius < -1) if (MainV2.comPort.MAV.cs.radius < -1)
{ {
// fixme // fixme
float p1 = (float)Math.Cos((cog) * deg2rad) * MainV2.cs.radius + MainV2.cs.radius; float p1 = (float)Math.Cos((cog) * deg2rad) * MainV2.comPort.MAV.cs.radius + MainV2.comPort.MAV.cs.radius;
float p2 = (float)Math.Sin((cog) * deg2rad) * MainV2.cs.radius + MainV2.cs.radius; float p2 = (float)Math.Sin((cog) * deg2rad) * MainV2.comPort.MAV.cs.radius + MainV2.comPort.MAV.cs.radius;
g.DrawArc(new Pen(Color.HotPink, 2), p1, p2, Math.Abs(MainV2.cs.radius) * 2, Math.Abs(MainV2.cs.radius) * 2, cog, alpha); g.DrawArc(new Pen(Color.HotPink, 2), p1, p2, Math.Abs(MainV2.comPort.MAV.cs.radius) * 2, Math.Abs(MainV2.comPort.MAV.cs.radius) * 2, cog, alpha);
} }
else if (MainV2.cs.radius > 1) else if (MainV2.comPort.MAV.cs.radius > 1)
{ {
// correct // correct
float p1 = (float)Math.Cos((cog - 180) * deg2rad) * MainV2.cs.radius + MainV2.cs.radius; float p1 = (float)Math.Cos((cog - 180) * deg2rad) * MainV2.comPort.MAV.cs.radius + MainV2.comPort.MAV.cs.radius;
float p2 = (float)Math.Sin((cog - 180) * deg2rad) * MainV2.cs.radius + MainV2.cs.radius; float p2 = (float)Math.Sin((cog - 180) * deg2rad) * MainV2.comPort.MAV.cs.radius + MainV2.comPort.MAV.cs.radius;
g.DrawArc(new Pen(Color.HotPink, 2), -p1, -p2, MainV2.cs.radius * 2, MainV2.cs.radius * 2, cog - 180, alpha); g.DrawArc(new Pen(Color.HotPink, 2), -p1, -p2, MainV2.comPort.MAV.cs.radius * 2, MainV2.comPort.MAV.cs.radius * 2, cog - 180, alpha);
} }
} }
@ -543,20 +543,18 @@ namespace ArdupilotMega
{ {
[DisplayText("Do Nothing")] [DisplayText("Do Nothing")]
CH7_DO_NOTHING = 0, CH7_DO_NOTHING = 0,
[DisplayText("Set Hover")]
CH7_SET_HOVER = 1,
[DisplayText("Flip")] [DisplayText("Flip")]
CH7_FLIP = 2, CH7_FLIP = 2,
[DisplayText("Simple Mode")] [DisplayText("Simple Mode")]
CH7_SIMPLE_MODE = 3, CH7_SIMPLE_MODE = 3,
[DisplayText("Return to Launch")] [DisplayText("Return to Launch")]
CH7_RTL = 4, CH7_RTL = 4,
[DisplayText("Automatic Trim")] [DisplayText("Save Trim")]
CH7_AUTO_TRIM = 5, CH7_AUTO_TRIM = 5,
[DisplayText("ADC Filter")]
CH7_ADC_FILTER = 6,
[DisplayText("Save Waypoint")] [DisplayText("Save Waypoint")]
CH7_SAVE_WP = 7 CH7_SAVE_WP = 7,
[DisplayText("Camera Trigger")]
CH7_CAMERA_TRIGGER = 9
} }
public enum ac2ch6modes public enum ac2ch6modes
@ -699,15 +697,15 @@ namespace ArdupilotMega
public static Type getModes() public static Type getModes()
{ {
if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane)
{ {
return typeof(apmmodes); return typeof(apmmodes);
} }
else if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2) else if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduCopter2)
{ {
return typeof(ac2modes); return typeof(ac2modes);
} }
else if (MainV2.cs.firmware == MainV2.Firmwares.ArduRover) else if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduRover)
{ {
return typeof(aprovermodes); return typeof(aprovermodes);
} }
@ -717,17 +715,17 @@ namespace ArdupilotMega
public static List<KeyValuePair<int,string>> getModesList() public static List<KeyValuePair<int,string>> getModesList()
{ {
if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane)
{ {
var flightModes = EnumTranslator.Translate<apmmodes>(); var flightModes = EnumTranslator.Translate<apmmodes>();
return flightModes.ToList(); return flightModes.ToList();
} }
else if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2) else if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduCopter2)
{ {
var flightModes = EnumTranslator.Translate<ac2modes>(); var flightModes = EnumTranslator.Translate<ac2modes>();
return flightModes.ToList(); return flightModes.ToList();
} }
else if (MainV2.cs.firmware == MainV2.Firmwares.ArduRover) else if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduRover)
{ {
var flightModes = EnumTranslator.Translate<aprovermodes>(); var flightModes = EnumTranslator.Translate<aprovermodes>();
return flightModes.ToList(); return flightModes.ToList();
@ -897,26 +895,26 @@ namespace ArdupilotMega
public static string speechConversion(string input) public static string speechConversion(string input)
{ {
if (MainV2.cs.wpno == 0) if (MainV2.comPort.MAV.cs.wpno == 0)
{ {
input = input.Replace("{wpn}", "Home"); input = input.Replace("{wpn}", "Home");
} }
else else
{ {
input = input.Replace("{wpn}", MainV2.cs.wpno.ToString()); input = input.Replace("{wpn}", MainV2.comPort.MAV.cs.wpno.ToString());
} }
input = input.Replace("{asp}", MainV2.cs.airspeed.ToString("0")); input = input.Replace("{asp}", MainV2.comPort.MAV.cs.airspeed.ToString("0"));
input = input.Replace("{alt}", MainV2.cs.alt.ToString("0")); input = input.Replace("{alt}", MainV2.comPort.MAV.cs.alt.ToString("0"));
input = input.Replace("{wpa}", MainV2.cs.targetalt.ToString("0")); input = input.Replace("{wpa}", MainV2.comPort.MAV.cs.targetalt.ToString("0"));
input = input.Replace("{gsp}", MainV2.cs.groundspeed.ToString("0")); input = input.Replace("{gsp}", MainV2.comPort.MAV.cs.groundspeed.ToString("0"));
input = input.Replace("{mode}", MainV2.cs.mode.ToString()); input = input.Replace("{mode}", MainV2.comPort.MAV.cs.mode.ToString());
input = input.Replace("{batv}", MainV2.cs.battery_voltage.ToString("0.00")); input = input.Replace("{batv}", MainV2.comPort.MAV.cs.battery_voltage.ToString("0.00"));
return input; return input;
} }

View File

@ -35,7 +35,7 @@ namespace ArdupilotMega.Controls
public void PopulateData() public void PopulateData()
{ {
// process hashdefines and update display // process hashdefines and update display
foreach (string value in MainV2.comPort.param.Keys) foreach (string value in MainV2.comPort.MAV.param.Keys)
{ {
if (value == null || value == "") // older ap version have a null param if (value == null || value == "") // older ap version have a null param
continue; continue;
@ -44,7 +44,7 @@ namespace ArdupilotMega.Controls
{ {
try try
{ {
float numbervalue = (float)MainV2.comPort.param[value]; float numbervalue = (float)MainV2.comPort.MAV.param[value];
MAVLink.modifyParamForDisplay(true, value, ref numbervalue); MAVLink.modifyParamForDisplay(true, value, ref numbervalue);

View File

@ -0,0 +1,142 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Collections;
namespace ArdupilotMega.Controls
{
public partial class FlashMessage : Label
{
private const int fadeInterval = 20; //time in ms between "frames" of animation
private const int fadeDuration = 200; //overall animation duration in ms in one direction
private const int desiredHeight = 20; //desired height to animate to
private const int inOutDelay = 800 / fadeInterval; //number in ms between in and out
private const float fadeStepValue = desiredHeight * (float)fadeInterval / (float)fadeDuration;
private int inOutDelayCounter;
private int direction;
private int heightVisible;
private bool disposeOnComplete;
private Timer fadeTimer;
private bool inOut;
private Queue messages = new Queue();
public FlashMessage()
{
Visible = false;
Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
Font = new System.Drawing.Font("Microsoft Sans Serif", 9.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
Location = new Point(0, 0);
TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
fadeTimer = new Timer();
fadeTimer.Interval = fadeInterval;
fadeTimer.Tick += new EventHandler(fadeTimer_Tick);
}
public void FadeInOut(string msg, bool success)
{
if (Visible)
{
messages.Enqueue(new { msg = msg, success = success });
}
else
{
if (this.Parent != null) Width = this.Parent.ClientSize.Width;
BringToFront();
direction = 1;
inOut = true;
inOutDelayCounter = inOutDelay;
heightVisible = Height = 0;
Text = msg;
BackColor = success ? Color.YellowGreen : Color.Coral;
}
Visible = true;
fadeTimer.Enabled = true;
}
//public void FadeIn(string msg, bool success)
//{
// if (this.Parent != null) Width = this.Parent.ClientSize.Width;
// BringToFront();
// direction = 1;
// inOut = false;
// heightVisible = Height = 0;
// if (Visible)
// {
// messages.Enqueue(msg);
// }
// else
// {
// Text = msg;
// }
// BackColor = success ? Color.YellowGreen : Color.Coral;
// Visible = true;
// fadeTimer.Enabled = true;
//}
private void FadeOut(bool disposeOnComplete = false)
{
if (this.Parent != null) Width = this.Parent.ClientSize.Width;
BringToFront();
direction = -1;
inOut = false;
heightVisible = Height = desiredHeight;
this.disposeOnComplete = disposeOnComplete;
fadeTimer.Enabled = true;
}
private void fadeTimer_Tick(object sender, EventArgs e)
{
bool done = false;
heightVisible += (int)Math.Round(direction * fadeStepValue);
if (heightVisible < 0) { done = true; heightVisible = 0; }
if (heightVisible > desiredHeight) { done = true; heightVisible = desiredHeight; }
Height = heightVisible;
if (done)
{
if (inOut)
{
if (--inOutDelayCounter == 0)
{
FadeOut(disposeOnComplete);
}
}
else
{
if (messages.Count > 0)
{
Object o = messages.Dequeue();
Text = (string)o.GetType().GetProperty("msg").GetValue(o, null);
bool success = (bool)o.GetType().GetProperty("success").GetValue(o, null);
BackColor = success ? Color.YellowGreen : Color.Coral;
direction = 1;
inOut = true;
inOutDelayCounter = inOutDelay;
heightVisible = Height = 0;
//Text = (messages.Dequeue()).msg;
}
else
{
fadeTimer.Enabled = false;
Visible = false;
if (direction == -1) //hide after fadeOut
{
if (disposeOnComplete) this.Dispose();
}
}
}
}
else
{
//this.Height = heightVisible;
//this.Invalidate();
}
}
}
}

View File

@ -0,0 +1,46 @@
using System.Windows.Forms;
using System.Drawing;
namespace ArdupilotMega.Controls
{
partial class FlashMessage
{
public AutoScaleMode AutoScaleMode = AutoScaleMode.Font;
/// <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.SuspendLayout();
//
// FlashMessage
//
this.BackColor = System.Drawing.Color.Coral;
this.Name = "FM_info";
this.ResumeLayout(false);
}
#endregion
}
}

View File

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

View File

@ -169,7 +169,7 @@ namespace ArdupilotMega.Controls
//public float FontSize; //public float FontSize;
public string Header; public string Header;
public System.Reflection.PropertyInfo Item; public System.Reflection.PropertyInfo Item;
public float GetValue { get { return (float)Item.GetValue((object)MainV2.cs, null); } } public float GetValue { get { return (float)Item.GetValue((object)MainV2.comPort.MAV.cs, null); } }
} }
public Hashtable CustomItems = new Hashtable(); public Hashtable CustomItems = new Hashtable();

View File

@ -151,9 +151,9 @@ namespace ArdupilotMega
return _ch3percent; return _ch3percent;
try try
{ {
if (MainV2.comPort.param.ContainsKey("RC3_MIN")) if (MainV2.comPort.MAV.param.ContainsKey("RC3_MIN"))
{ {
return (int)((ch3out - float.Parse(MainV2.comPort.param["RC3_MIN"].ToString())) / (float.Parse(MainV2.comPort.param["RC3_MAX"].ToString()) - float.Parse(MainV2.comPort.param["RC3_MIN"].ToString())) * 100); return (int)((ch3out - float.Parse(MainV2.comPort.MAV.param["RC3_MIN"].ToString())) / (float.Parse(MainV2.comPort.MAV.param["RC3_MAX"].ToString()) - float.Parse(MainV2.comPort.MAV.param["RC3_MIN"].ToString())) * 100);
} }
else else
{ {
@ -437,11 +437,11 @@ namespace ArdupilotMega
if (desc.Contains("(dist)")) if (desc.Contains("(dist)"))
{ {
desc = desc.Replace("(dist)", "(" + MainV2.cs.DistanceUnit + ")"); desc = desc.Replace("(dist)", "(" + MainV2.comPort.MAV.cs.DistanceUnit + ")");
} }
else if (desc.Contains("(speed)")) else if (desc.Contains("(speed)"))
{ {
desc = desc.Replace("(speed)", "(" + MainV2.cs.SpeedUnit + ")"); desc = desc.Replace("(speed)", "(" + MainV2.comPort.MAV.cs.SpeedUnit + ")");
} }
return desc; return desc;
@ -490,10 +490,10 @@ namespace ArdupilotMega
dowindcalc(); dowindcalc();
} }
if (mavinterface.packets[MAVLink.MAVLINK_MSG_ID_STATUSTEXT] != null) // status text if (mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_STATUSTEXT] != null) // status text
{ {
string logdata = DateTime.Now + " " + Encoding.ASCII.GetString(mavinterface.packets[MAVLink.MAVLINK_MSG_ID_STATUSTEXT], 6, mavinterface.packets[MAVLink.MAVLINK_MSG_ID_STATUSTEXT].Length - 6); string logdata = DateTime.Now + " " + Encoding.ASCII.GetString(mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_STATUSTEXT], 6, mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_STATUSTEXT].Length - 6);
int ind = logdata.IndexOf('\0'); int ind = logdata.IndexOf('\0');
if (ind != -1) if (ind != -1)
@ -509,10 +509,10 @@ namespace ArdupilotMega
} }
catch { } catch { }
mavinterface.packets[MAVLink.MAVLINK_MSG_ID_STATUSTEXT] = null; mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_STATUSTEXT] = null;
} }
byte[] bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_RC_CHANNELS_SCALED]; byte[] bytearray = mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_RC_CHANNELS_SCALED];
if (bytearray != null) // hil mavlink 0.9 if (bytearray != null) // hil mavlink 0.9
{ {
@ -530,7 +530,7 @@ namespace ArdupilotMega
//MAVLink.packets[MAVLink.MAVLINK_MSG_ID_RC_CHANNELS_SCALED] = null; //MAVLink.packets[MAVLink.MAVLINK_MSG_ID_RC_CHANNELS_SCALED] = null;
} }
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_HIL_CONTROLS]; bytearray = mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_HIL_CONTROLS];
if (bytearray != null) // hil mavlink 0.9 and 1.0 if (bytearray != null) // hil mavlink 0.9 and 1.0
{ {
@ -544,7 +544,7 @@ namespace ArdupilotMega
//MAVLink.packets[MAVLink.MAVLINK_MSG_ID_HIL_CONTROLS] = null; //MAVLink.packets[MAVLink.MAVLINK_MSG_ID_HIL_CONTROLS] = null;
} }
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_HWSTATUS]; bytearray = mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_HWSTATUS];
if (bytearray != null) if (bytearray != null)
{ {
@ -556,7 +556,7 @@ namespace ArdupilotMega
//MAVLink.packets[MAVLink.MAVLINK_MSG_ID_HWSTATUS] = null; //MAVLink.packets[MAVLink.MAVLINK_MSG_ID_HWSTATUS] = null;
} }
bytearray = mavinterface.packets[ArdupilotMega.MAVLink.MAVLINK_MSG_ID_WIND]; bytearray = mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_WIND];
if (bytearray != null) if (bytearray != null)
{ {
var wind = bytearray.ByteArrayToStructure<MAVLink.mavlink_wind_t>(6); var wind = bytearray.ByteArrayToStructure<MAVLink.mavlink_wind_t>(6);
@ -572,7 +572,7 @@ namespace ArdupilotMega
#if MAVLINK10 #if MAVLINK10
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_HEARTBEAT]; bytearray = mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_HEARTBEAT];
if (bytearray != null) if (bytearray != null)
{ {
var hb = bytearray.ByteArrayToStructure<MAVLink.mavlink_heartbeat_t>(6); var hb = bytearray.ByteArrayToStructure<MAVLink.mavlink_heartbeat_t>(6);
@ -669,7 +669,7 @@ namespace ArdupilotMega
} }
bytearray = mavinterface.packets[ArdupilotMega.MAVLink.MAVLINK_MSG_ID_SYS_STATUS]; bytearray = mavinterface.MAV.packets[ArdupilotMega.MAVLink.MAVLINK_MSG_ID_SYS_STATUS];
if (bytearray != null) if (bytearray != null)
{ {
var sysstatus = bytearray.ByteArrayToStructure<MAVLink.mavlink_sys_status_t>(6); var sysstatus = bytearray.ByteArrayToStructure<MAVLink.mavlink_sys_status_t>(6);
@ -684,7 +684,7 @@ namespace ArdupilotMega
} }
#else #else
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_SYS_STATUS]; bytearray = mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_SYS_STATUS];
if (bytearray != null) if (bytearray != null)
{ {
@ -802,7 +802,7 @@ namespace ArdupilotMega
} }
#endif #endif
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_SCALED_PRESSURE]; bytearray = mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_SCALED_PRESSURE];
if (bytearray != null) if (bytearray != null)
{ {
var pres = bytearray.ByteArrayToStructure<MAVLink.mavlink_scaled_pressure_t>(6); var pres = bytearray.ByteArrayToStructure<MAVLink.mavlink_scaled_pressure_t>(6);
@ -810,7 +810,7 @@ namespace ArdupilotMega
press_temp = pres.temperature; press_temp = pres.temperature;
} }
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_SENSOR_OFFSETS]; bytearray = mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_SENSOR_OFFSETS];
if (bytearray != null) if (bytearray != null)
{ {
var sensofs = bytearray.ByteArrayToStructure<MAVLink.mavlink_sensor_offsets_t>(6); var sensofs = bytearray.ByteArrayToStructure<MAVLink.mavlink_sensor_offsets_t>(6);
@ -833,7 +833,7 @@ namespace ArdupilotMega
} }
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_ATTITUDE]; bytearray = mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_ATTITUDE];
if (bytearray != null) if (bytearray != null)
{ {
@ -847,7 +847,7 @@ namespace ArdupilotMega
//MAVLink.packets[MAVLink.MAVLINK_MSG_ID_ATTITUDE] = null; //MAVLink.packets[MAVLink.MAVLINK_MSG_ID_ATTITUDE] = null;
} }
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_GPS_RAW_INT]; bytearray = mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_GPS_RAW_INT];
if (bytearray != null) if (bytearray != null)
{ {
var gps = bytearray.ByteArrayToStructure<MAVLink.mavlink_gps_raw_int_t>(6); var gps = bytearray.ByteArrayToStructure<MAVLink.mavlink_gps_raw_int_t>(6);
@ -872,14 +872,14 @@ namespace ArdupilotMega
//MAVLink.packets[MAVLink.MAVLINK_MSG_ID_GPS_RAW] = null; //MAVLink.packets[MAVLink.MAVLINK_MSG_ID_GPS_RAW] = null;
} }
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_GPS_STATUS]; bytearray = mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_GPS_STATUS];
if (bytearray != null) if (bytearray != null)
{ {
var gps = bytearray.ByteArrayToStructure<MAVLink.mavlink_gps_status_t>(6); var gps = bytearray.ByteArrayToStructure<MAVLink.mavlink_gps_status_t>(6);
satcount = gps.satellites_visible; satcount = gps.satellites_visible;
} }
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_RADIO]; bytearray = mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_RADIO];
if (bytearray != null) if (bytearray != null)
{ {
var radio = bytearray.ByteArrayToStructure<MAVLink.mavlink_radio_t>(6); var radio = bytearray.ByteArrayToStructure<MAVLink.mavlink_radio_t>(6);
@ -892,7 +892,7 @@ namespace ArdupilotMega
fixedp = radio.fixedp; fixedp = radio.fixedp;
} }
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_GLOBAL_POSITION_INT]; bytearray = mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_GLOBAL_POSITION_INT];
if (bytearray != null) if (bytearray != null)
{ {
var loc = bytearray.ByteArrayToStructure<MAVLink.mavlink_global_position_int_t>(6); var loc = bytearray.ByteArrayToStructure<MAVLink.mavlink_global_position_int_t>(6);
@ -912,7 +912,7 @@ namespace ArdupilotMega
} }
} }
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_MISSION_CURRENT]; bytearray = mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_MISSION_CURRENT];
if (bytearray != null) if (bytearray != null)
{ {
var wpcur = bytearray.ByteArrayToStructure<MAVLink.mavlink_mission_current_t>(6); var wpcur = bytearray.ByteArrayToStructure<MAVLink.mavlink_mission_current_t>(6);
@ -929,7 +929,7 @@ namespace ArdupilotMega
//MAVLink.packets[ArdupilotMega.MAVLink.MAVLINK_MSG_ID_WAYPOINT_CURRENT] = null; //MAVLink.packets[ArdupilotMega.MAVLink.MAVLINK_MSG_ID_WAYPOINT_CURRENT] = null;
} }
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT]; bytearray = mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT];
if (bytearray != null) if (bytearray != null)
{ {
@ -947,7 +947,7 @@ namespace ArdupilotMega
//MAVLink.packets[MAVLink.MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT] = null; //MAVLink.packets[MAVLink.MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT] = null;
} }
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_RC_CHANNELS_RAW]; bytearray = mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_RC_CHANNELS_RAW];
if (bytearray != null) if (bytearray != null)
{ {
var rcin = bytearray.ByteArrayToStructure<MAVLink.mavlink_rc_channels_raw_t>(6); var rcin = bytearray.ByteArrayToStructure<MAVLink.mavlink_rc_channels_raw_t>(6);
@ -967,7 +967,7 @@ namespace ArdupilotMega
//MAVLink.packets[MAVLink.MAVLINK_MSG_ID_RC_CHANNELS_RAW] = null; //MAVLink.packets[MAVLink.MAVLINK_MSG_ID_RC_CHANNELS_RAW] = null;
} }
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_SERVO_OUTPUT_RAW]; bytearray = mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_SERVO_OUTPUT_RAW];
if (bytearray != null) if (bytearray != null)
{ {
var servoout = bytearray.ByteArrayToStructure<MAVLink.mavlink_servo_output_raw_t>(6); var servoout = bytearray.ByteArrayToStructure<MAVLink.mavlink_servo_output_raw_t>(6);
@ -985,7 +985,7 @@ namespace ArdupilotMega
} }
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_RAW_IMU]; bytearray = mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_RAW_IMU];
if (bytearray != null) if (bytearray != null)
{ {
var imu = bytearray.ByteArrayToStructure<MAVLink.mavlink_raw_imu_t>(6); var imu = bytearray.ByteArrayToStructure<MAVLink.mavlink_raw_imu_t>(6);
@ -1005,7 +1005,7 @@ namespace ArdupilotMega
//MAVLink.packets[MAVLink.MAVLINK_MSG_ID_RAW_IMU] = null; //MAVLink.packets[MAVLink.MAVLINK_MSG_ID_RAW_IMU] = null;
} }
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_SCALED_IMU]; bytearray = mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_SCALED_IMU];
if (bytearray != null) if (bytearray != null)
{ {
var imu = bytearray.ByteArrayToStructure<MAVLink.mavlink_scaled_imu_t>(6); var imu = bytearray.ByteArrayToStructure<MAVLink.mavlink_scaled_imu_t>(6);
@ -1022,7 +1022,7 @@ namespace ArdupilotMega
} }
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_VFR_HUD]; bytearray = mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_VFR_HUD];
if (bytearray != null) if (bytearray != null)
{ {
var vfr = bytearray.ByteArrayToStructure<MAVLink.mavlink_vfr_hud_t>(6); var vfr = bytearray.ByteArrayToStructure<MAVLink.mavlink_vfr_hud_t>(6);
@ -1051,7 +1051,7 @@ namespace ArdupilotMega
//MAVLink.packets[MAVLink.MAVLINK_MSG_ID_VFR_HUD] = null; //MAVLink.packets[MAVLink.MAVLINK_MSG_ID_VFR_HUD] = null;
} }
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_MEMINFO]; bytearray = mavinterface.MAV.packets[MAVLink.MAVLINK_MSG_ID_MEMINFO];
if (bytearray != null) if (bytearray != null)
{ {
var mem = bytearray.ByteArrayToStructure<MAVLink.mavlink_meminfo_t>(6); var mem = bytearray.ByteArrayToStructure<MAVLink.mavlink_meminfo_t>(6);

View File

@ -43,7 +43,7 @@ namespace ArdupilotMega
lastloc = loc; lastloc = loc;
} }
this.homealt = homealt / MainV2.cs.multiplierdist; this.homealt = homealt / MainV2.comPort.MAV.cs.multiplierdist;
Form frm = Common.LoadingBox("Loading", "Downloading Google Earth Data"); Form frm = Common.LoadingBox("Loading", "Downloading Google Earth Data");
@ -82,7 +82,7 @@ namespace ArdupilotMega
a += planloc.GetDistance(lastloc); a += planloc.GetDistance(lastloc);
} }
list1.Add(a, planloc.Alt / MainV2.cs.multiplierdist, 0, planloc.Tag); // homealt list1.Add(a, planloc.Alt / MainV2.comPort.MAV.cs.multiplierdist, 0, planloc.Tag); // homealt
lastloc = planloc; lastloc = planloc;
count++; count++;

View File

@ -57,18 +57,18 @@ namespace ArdupilotMega
string alt = "100"; string alt = "100";
if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduCopter2)
{ {
alt = (10 * MainV2.cs.multiplierdist).ToString("0"); alt = (10 * MainV2.comPort.MAV.cs.multiplierdist).ToString("0");
} }
else else
{ {
alt = (100 * MainV2.cs.multiplierdist).ToString("0"); alt = (100 * MainV2.comPort.MAV.cs.multiplierdist).ToString("0");
} }
if (DialogResult.Cancel == Common.InputBox("Enter Alt", "Enter Alt (relative to home alt)", ref alt)) if (DialogResult.Cancel == Common.InputBox("Enter Alt", "Enter Alt (relative to home alt)", ref alt))
return; return;
intalt = (int)(100 * MainV2.cs.multiplierdist); intalt = (int)(100 * MainV2.comPort.MAV.cs.multiplierdist);
if (!int.TryParse(alt, out intalt)) if (!int.TryParse(alt, out intalt))
{ {
CustomMessageBox.Show("Bad Alt"); CustomMessageBox.Show("Bad Alt");
@ -97,7 +97,7 @@ namespace ArdupilotMega
{ {
string line = comPort.ReadLine(); string line = comPort.ReadLine();
//string line = string.Format("$GP{0},{1:HHmmss},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},", "GGA", DateTime.Now.ToUniversalTime(), Math.Abs(lat * 100), MainV2.cs.lat < 0 ? "S" : "N", Math.Abs(lng * 100), MainV2.cs.lng < 0 ? "W" : "E", MainV2.cs.gpsstatus, MainV2.cs.satcount, MainV2.cs.gpshdop, MainV2.cs.alt, "M", 0, "M", ""); //string line = string.Format("$GP{0},{1:HHmmss},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},", "GGA", DateTime.Now.ToUniversalTime(), Math.Abs(lat * 100), MainV2.comPort.MAV.cs.lat < 0 ? "S" : "N", Math.Abs(lng * 100), MainV2.comPort.MAV.cs.lng < 0 ? "W" : "E", MainV2.comPort.MAV.cs.gpsstatus, MainV2.comPort.MAV.cs.satcount, MainV2.comPort.MAV.cs.gpshdop, MainV2.comPort.MAV.cs.alt, "M", 0, "M", "");
if (line.StartsWith("$GPGGA")) // if (line.StartsWith("$GPGGA")) //
{ {
string[] items = line.Trim().Split(',','*'); string[] items = line.Trim().Split(',','*');

View File

@ -41,7 +41,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
private void LIM_ENABLED_CheckedChanged(object sender, EventArgs e) private void LIM_ENABLED_CheckedChanged(object sender, EventArgs e)
{ {
if (!MainV2.comPort.param.ContainsKey("LIM_ENABLED")) if (!MainV2.comPort.MAV.param.ContainsKey("LIM_ENABLED"))
{ {
CustomMessageBox.Show("This feature is not enabled in your firmware."); CustomMessageBox.Show("This feature is not enabled in your firmware.");
return; return;
@ -80,7 +80,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
void PopulateData() void PopulateData()
{ {
Hashtable copy = new Hashtable(MainV2.comPort.param); Hashtable copy = new Hashtable(MainV2.comPort.MAV.param);
foreach (string key in copy.Keys) foreach (string key in copy.Keys)
{ {

View File

@ -29,7 +29,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
} }
else else
{ {
if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane)
{ {
this.Enabled = true; this.Enabled = true;
} }
@ -42,8 +42,8 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
startup = true; startup = true;
if (MainV2.comPort.param["MANUAL_LEVEL"] != null) if (MainV2.comPort.MAV.param["MANUAL_LEVEL"] != null)
CHK_manuallevel.Checked = MainV2.comPort.param["MANUAL_LEVEL"].ToString() == "1" ? true : false; CHK_manuallevel.Checked = MainV2.comPort.MAV.param["MANUAL_LEVEL"].ToString() == "1" ? true : false;
startup = false; startup = false;
} }

View File

@ -79,13 +79,13 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
public void Activate() public void Activate()
{ {
if (!MainV2.comPort.param.ContainsKey("FRAME")) if (!MainV2.comPort.MAV.param.ContainsKey("FRAME"))
{ {
this.Enabled = false; this.Enabled = false;
return; return;
} }
if ((float)MainV2.comPort.param["FRAME"] == 0) if ((float)MainV2.comPort.MAV.param["FRAME"] == 0)
{ {
this.radioButton_Plus.Checked = true; this.radioButton_Plus.Checked = true;
pictureBoxX.Opacity = DisabledOpacity; pictureBoxX.Opacity = DisabledOpacity;
@ -147,13 +147,13 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
{ {
ConfigAccelerometerCalibrationQuad local = (ConfigAccelerometerCalibrationQuad)item; ConfigAccelerometerCalibrationQuad local = (ConfigAccelerometerCalibrationQuad)item;
while (!(MainV2.cs.message.Contains("Calibration successful") || MainV2.cs.message.Contains("Calibration failed"))) while (!(MainV2.comPort.MAV.cs.message.Contains("Calibration successful") || MainV2.comPort.MAV.cs.message.Contains("Calibration failed")))
{ {
System.Threading.Thread.Sleep(10); System.Threading.Thread.Sleep(10);
// read the message // read the message
MainV2.comPort.readPacket(); MainV2.comPort.readPacket();
// update cs with the message // update cs with the message
MainV2.cs.UpdateCurrentSettings(null); MainV2.comPort.MAV.cs.UpdateCurrentSettings(null);
// update user display // update user display
local.UpdateUserMessage(); local.UpdateUserMessage();
} }
@ -170,7 +170,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
{ {
this.Invoke((MethodInvoker)delegate() this.Invoke((MethodInvoker)delegate()
{ {
lbl_Accel_user.Text = MainV2.cs.message; lbl_Accel_user.Text = MainV2.comPort.MAV.cs.message;
}); });
} }
} }

View File

@ -30,12 +30,9 @@
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConfigArducopter)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConfigArducopter));
this.myLabel3 = new ArdupilotMega.Controls.MyLabel();
this.TUNE_LOW = new System.Windows.Forms.NumericUpDown(); this.TUNE_LOW = new System.Windows.Forms.NumericUpDown();
this.TUNE_HIGH = new System.Windows.Forms.NumericUpDown(); this.TUNE_HIGH = new System.Windows.Forms.NumericUpDown();
this.myLabel2 = new ArdupilotMega.Controls.MyLabel();
this.TUNE = new System.Windows.Forms.ComboBox(); this.TUNE = new System.Windows.Forms.ComboBox();
this.myLabel1 = new ArdupilotMega.Controls.MyLabel();
this.CH7_OPT = new System.Windows.Forms.ComboBox(); this.CH7_OPT = new System.Windows.Forms.ComboBox();
this.groupBox5 = new System.Windows.Forms.GroupBox(); this.groupBox5 = new System.Windows.Forms.GroupBox();
this.THR_RATE_D = new System.Windows.Forms.NumericUpDown(); this.THR_RATE_D = new System.Windows.Forms.NumericUpDown();
@ -126,8 +123,6 @@
this.RATE_RLL_P = new System.Windows.Forms.NumericUpDown(); this.RATE_RLL_P = new System.Windows.Forms.NumericUpDown();
this.label91 = new System.Windows.Forms.Label(); this.label91 = new System.Windows.Forms.Label();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.BUT_writePIDS = new ArdupilotMega.Controls.MyButton();
this.BUT_rerequestparams = new ArdupilotMega.Controls.MyButton();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.LOITER_LAT_D = new System.Windows.Forms.NumericUpDown(); this.LOITER_LAT_D = new System.Windows.Forms.NumericUpDown();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
@ -137,6 +132,11 @@
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
this.LOITER_LAT_P = new System.Windows.Forms.NumericUpDown(); this.LOITER_LAT_P = new System.Windows.Forms.NumericUpDown();
this.label4 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label();
this.BUT_rerequestparams = new ArdupilotMega.Controls.MyButton();
this.BUT_writePIDS = new ArdupilotMega.Controls.MyButton();
this.myLabel3 = new ArdupilotMega.Controls.MyLabel();
this.myLabel2 = new ArdupilotMega.Controls.MyLabel();
this.myLabel1 = new ArdupilotMega.Controls.MyLabel();
((System.ComponentModel.ISupportInitialize)(this.TUNE_LOW)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.TUNE_LOW)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.TUNE_HIGH)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.TUNE_HIGH)).BeginInit();
this.groupBox5.SuspendLayout(); this.groupBox5.SuspendLayout();
@ -195,12 +195,6 @@
((System.ComponentModel.ISupportInitialize)(this.LOITER_LAT_P)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.LOITER_LAT_P)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// myLabel3
//
resources.ApplyResources(this.myLabel3, "myLabel3");
this.myLabel3.Name = "myLabel3";
this.myLabel3.resize = false;
//
// TUNE_LOW // TUNE_LOW
// //
resources.ApplyResources(this.TUNE_LOW, "TUNE_LOW"); resources.ApplyResources(this.TUNE_LOW, "TUNE_LOW");
@ -211,63 +205,19 @@
resources.ApplyResources(this.TUNE_HIGH, "TUNE_HIGH"); resources.ApplyResources(this.TUNE_HIGH, "TUNE_HIGH");
this.TUNE_HIGH.Name = "TUNE_HIGH"; this.TUNE_HIGH.Name = "TUNE_HIGH";
// //
// myLabel2
//
resources.ApplyResources(this.myLabel2, "myLabel2");
this.myLabel2.Name = "myLabel2";
this.myLabel2.resize = false;
//
// TUNE // TUNE
// //
this.TUNE.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.TUNE.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.TUNE.DropDownWidth = 150; this.TUNE.DropDownWidth = 150;
this.TUNE.FormattingEnabled = true; this.TUNE.FormattingEnabled = true;
this.TUNE.Items.AddRange(new object[] {
resources.GetString("TUNE.Items"),
resources.GetString("TUNE.Items1"),
resources.GetString("TUNE.Items2"),
resources.GetString("TUNE.Items3"),
resources.GetString("TUNE.Items4"),
resources.GetString("TUNE.Items5"),
resources.GetString("TUNE.Items6"),
resources.GetString("TUNE.Items7"),
resources.GetString("TUNE.Items8"),
resources.GetString("TUNE.Items9"),
resources.GetString("TUNE.Items10"),
resources.GetString("TUNE.Items11"),
resources.GetString("TUNE.Items12"),
resources.GetString("TUNE.Items13"),
resources.GetString("TUNE.Items14"),
resources.GetString("TUNE.Items15"),
resources.GetString("TUNE.Items16"),
resources.GetString("TUNE.Items17"),
resources.GetString("TUNE.Items18"),
resources.GetString("TUNE.Items19"),
resources.GetString("TUNE.Items20"),
resources.GetString("TUNE.Items21")});
resources.ApplyResources(this.TUNE, "TUNE"); resources.ApplyResources(this.TUNE, "TUNE");
this.TUNE.Name = "TUNE"; this.TUNE.Name = "TUNE";
// //
// myLabel1
//
resources.ApplyResources(this.myLabel1, "myLabel1");
this.myLabel1.Name = "myLabel1";
this.myLabel1.resize = false;
//
// CH7_OPT // CH7_OPT
// //
this.CH7_OPT.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.CH7_OPT.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CH7_OPT.DropDownWidth = 150; this.CH7_OPT.DropDownWidth = 150;
this.CH7_OPT.FormattingEnabled = true; this.CH7_OPT.FormattingEnabled = true;
this.CH7_OPT.Items.AddRange(new object[] {
resources.GetString("CH7_OPT.Items"),
resources.GetString("CH7_OPT.Items1"),
resources.GetString("CH7_OPT.Items2"),
resources.GetString("CH7_OPT.Items3"),
resources.GetString("CH7_OPT.Items4"),
resources.GetString("CH7_OPT.Items5"),
resources.GetString("CH7_OPT.Items6"),
resources.GetString("CH7_OPT.Items7")});
resources.ApplyResources(this.CH7_OPT, "CH7_OPT"); resources.ApplyResources(this.CH7_OPT, "CH7_OPT");
this.CH7_OPT.Name = "CH7_OPT"; this.CH7_OPT.Name = "CH7_OPT";
// //
@ -812,20 +762,6 @@
this.toolTip1.InitialDelay = 500; this.toolTip1.InitialDelay = 500;
this.toolTip1.ReshowDelay = 100; this.toolTip1.ReshowDelay = 100;
// //
// BUT_writePIDS
//
resources.ApplyResources(this.BUT_writePIDS, "BUT_writePIDS");
this.BUT_writePIDS.Name = "BUT_writePIDS";
this.BUT_writePIDS.UseVisualStyleBackColor = true;
this.BUT_writePIDS.Click += new System.EventHandler(this.BUT_writePIDS_Click);
//
// BUT_rerequestparams
//
resources.ApplyResources(this.BUT_rerequestparams, "BUT_rerequestparams");
this.BUT_rerequestparams.Name = "BUT_rerequestparams";
this.BUT_rerequestparams.UseVisualStyleBackColor = true;
this.BUT_rerequestparams.Click += new System.EventHandler(this.BUT_rerequestparams_Click);
//
// groupBox1 // groupBox1
// //
this.groupBox1.Controls.Add(this.LOITER_LAT_D); this.groupBox1.Controls.Add(this.LOITER_LAT_D);
@ -880,6 +816,38 @@
resources.ApplyResources(this.label4, "label4"); resources.ApplyResources(this.label4, "label4");
this.label4.Name = "label4"; this.label4.Name = "label4";
// //
// BUT_rerequestparams
//
resources.ApplyResources(this.BUT_rerequestparams, "BUT_rerequestparams");
this.BUT_rerequestparams.Name = "BUT_rerequestparams";
this.BUT_rerequestparams.UseVisualStyleBackColor = true;
this.BUT_rerequestparams.Click += new System.EventHandler(this.BUT_rerequestparams_Click);
//
// BUT_writePIDS
//
resources.ApplyResources(this.BUT_writePIDS, "BUT_writePIDS");
this.BUT_writePIDS.Name = "BUT_writePIDS";
this.BUT_writePIDS.UseVisualStyleBackColor = true;
this.BUT_writePIDS.Click += new System.EventHandler(this.BUT_writePIDS_Click);
//
// myLabel3
//
resources.ApplyResources(this.myLabel3, "myLabel3");
this.myLabel3.Name = "myLabel3";
this.myLabel3.resize = false;
//
// myLabel2
//
resources.ApplyResources(this.myLabel2, "myLabel2");
this.myLabel2.Name = "myLabel2";
this.myLabel2.resize = false;
//
// myLabel1
//
resources.ApplyResources(this.myLabel1, "myLabel1");
this.myLabel1.Name = "myLabel1";
this.myLabel1.resize = false;
//
// ConfigArducopter // ConfigArducopter
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");

View File

@ -43,7 +43,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
} }
else else
{ {
if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduCopter2)
{ {
this.Enabled = true; this.Enabled = true;
} }
@ -163,7 +163,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
// process hashdefines and update display // process hashdefines and update display
foreach (string value in MainV2.comPort.param.Keys) foreach (string value in MainV2.comPort.MAV.param.Keys)
{ {
if (value == null || value == "") if (value == null || value == "")
continue; continue;
@ -180,7 +180,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
if (ctl.GetType() == typeof(NumericUpDown)) if (ctl.GetType() == typeof(NumericUpDown))
{ {
float numbervalue = (float)MainV2.comPort.param[value]; float numbervalue = (float)MainV2.comPort.MAV.param[value];
MAVLink.modifyParamForDisplay(true, value, ref numbervalue); MAVLink.modifyParamForDisplay(true, value, ref numbervalue);
@ -231,7 +231,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
ComboBox thisctl = ((ComboBox)ctl); ComboBox thisctl = ((ComboBox)ctl);
thisctl.SelectedValue = (int)(float)MainV2.comPort.param[value]; thisctl.SelectedValue = (int)(float)MainV2.comPort.MAV.param[value];
thisctl.Validated += new EventHandler(ComboBox_Validated); thisctl.Validated += new EventHandler(ComboBox_Validated);

View File

@ -118,37 +118,13 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="myLabel3.Location" type="System.Drawing.Point, System.Drawing">
<value>364, 321</value>
</data>
<data name="myLabel3.Size" type="System.Drawing.Size, System.Drawing">
<value>29, 23</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="myLabel3.TabIndex" type="System.Int32, mscorlib">
<value>42</value>
</data>
<data name="myLabel3.Text" xml:space="preserve">
<value>Min</value>
</data>
<data name="&gt;&gt;myLabel3.Name" xml:space="preserve">
<value>myLabel3</value>
</data>
<data name="&gt;&gt;myLabel3.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4666.36788, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;myLabel3.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;myLabel3.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="TUNE_LOW.Location" type="System.Drawing.Point, System.Drawing"> <data name="TUNE_LOW.Location" type="System.Drawing.Point, System.Drawing">
<value>399, 324</value> <value>399, 324</value>
</data> </data>
<data name="TUNE_LOW.Size" type="System.Drawing.Size, System.Drawing"> <data name="TUNE_LOW.Size" type="System.Drawing.Size, System.Drawing">
<value>51, 20</value> <value>51, 20</value>
</data> </data>
<assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="TUNE_LOW.TabIndex" type="System.Int32, mscorlib"> <data name="TUNE_LOW.TabIndex" type="System.Int32, mscorlib">
<value>41</value> <value>41</value>
</data> </data>
@ -185,96 +161,6 @@
<data name="&gt;&gt;TUNE_HIGH.ZOrder" xml:space="preserve"> <data name="&gt;&gt;TUNE_HIGH.ZOrder" xml:space="preserve">
<value>5</value> <value>5</value>
</data> </data>
<data name="myLabel2.Location" type="System.Drawing.Point, System.Drawing">
<value>364, 296</value>
</data>
<data name="myLabel2.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 23</value>
</data>
<data name="myLabel2.TabIndex" type="System.Int32, mscorlib">
<value>39</value>
</data>
<data name="myLabel2.Text" xml:space="preserve">
<value>Ch6 Opt</value>
</data>
<data name="&gt;&gt;myLabel2.Name" xml:space="preserve">
<value>myLabel2</value>
</data>
<data name="&gt;&gt;myLabel2.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4666.36788, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;myLabel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;myLabel2.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="TUNE.Items" xml:space="preserve">
<value>CH6_NONE</value>
</data>
<data name="TUNE.Items1" xml:space="preserve">
<value>CH6_STABILIZE_KP</value>
</data>
<data name="TUNE.Items2" xml:space="preserve">
<value>CH6_STABILIZE_KI</value>
</data>
<data name="TUNE.Items3" xml:space="preserve">
<value>CH6_YAW_KP</value>
</data>
<data name="TUNE.Items4" xml:space="preserve">
<value>CH6_RATE_KP</value>
</data>
<data name="TUNE.Items5" xml:space="preserve">
<value>CH6_RATE_KI</value>
</data>
<data name="TUNE.Items6" xml:space="preserve">
<value>CH6_YAW_RATE_KP</value>
</data>
<data name="TUNE.Items7" xml:space="preserve">
<value>CH6_THROTTLE_KP</value>
</data>
<data name="TUNE.Items8" xml:space="preserve">
<value>CH6_TOP_BOTTOM_RATIO</value>
</data>
<data name="TUNE.Items9" xml:space="preserve">
<value>CH6_RELAY</value>
</data>
<data name="TUNE.Items10" xml:space="preserve">
<value>CH6_TRAVERSE_SPEED</value>
</data>
<data name="TUNE.Items11" xml:space="preserve">
<value>CH6_NAV_P</value>
</data>
<data name="TUNE.Items12" xml:space="preserve">
<value>CH6_LOITER_P</value>
</data>
<data name="TUNE.Items13" xml:space="preserve">
<value>CH6_HELI_EXTERNAL_GYRO</value>
</data>
<data name="TUNE.Items14" xml:space="preserve">
<value>CH6_THR_HOLD_KP</value>
</data>
<data name="TUNE.Items15" xml:space="preserve">
<value>CH6_Z_GAIN</value>
</data>
<data name="TUNE.Items16" xml:space="preserve">
<value>CH6_DAMP</value>
</data>
<data name="TUNE.Items17" xml:space="preserve">
<value>CH6_OPTFLOW_KP</value>
</data>
<data name="TUNE.Items18" xml:space="preserve">
<value>CH6_OPTFLOW_KI</value>
</data>
<data name="TUNE.Items19" xml:space="preserve">
<value>CH6_OPTFLOW_KD</value>
</data>
<data name="TUNE.Items20" xml:space="preserve">
<value>CH6_NAV_I</value>
</data>
<data name="TUNE.Items21" xml:space="preserve">
<value>CH6_RATE_KD</value>
</data>
<data name="TUNE.Location" type="System.Drawing.Point, System.Drawing"> <data name="TUNE.Location" type="System.Drawing.Point, System.Drawing">
<value>423, 296</value> <value>423, 296</value>
</data> </data>
@ -296,54 +182,6 @@
<data name="&gt;&gt;TUNE.ZOrder" xml:space="preserve"> <data name="&gt;&gt;TUNE.ZOrder" xml:space="preserve">
<value>7</value> <value>7</value>
</data> </data>
<data name="myLabel1.Location" type="System.Drawing.Point, System.Drawing">
<value>364, 348</value>
</data>
<data name="myLabel1.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 23</value>
</data>
<data name="myLabel1.TabIndex" type="System.Int32, mscorlib">
<value>37</value>
</data>
<data name="myLabel1.Text" xml:space="preserve">
<value>Ch7 Opt</value>
</data>
<data name="&gt;&gt;myLabel1.Name" xml:space="preserve">
<value>myLabel1</value>
</data>
<data name="&gt;&gt;myLabel1.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4666.36788, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;myLabel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;myLabel1.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="CH7_OPT.Items" xml:space="preserve">
<value>Do Nothing</value>
</data>
<data name="CH7_OPT.Items1" xml:space="preserve">
<value />
</data>
<data name="CH7_OPT.Items2" xml:space="preserve">
<value />
</data>
<data name="CH7_OPT.Items3" xml:space="preserve">
<value>Simple Mode</value>
</data>
<data name="CH7_OPT.Items4" xml:space="preserve">
<value>RTL</value>
</data>
<data name="CH7_OPT.Items5" xml:space="preserve">
<value />
</data>
<data name="CH7_OPT.Items6" xml:space="preserve">
<value />
</data>
<data name="CH7_OPT.Items7" xml:space="preserve">
<value>Save WP</value>
</data>
<data name="CH7_OPT.Location" type="System.Drawing.Point, System.Drawing"> <data name="CH7_OPT.Location" type="System.Drawing.Point, System.Drawing">
<value>423, 348</value> <value>423, 348</value>
</data> </data>
@ -2487,63 +2325,6 @@
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
<data name="BUT_writePIDS.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="BUT_writePIDS.Location" type="System.Drawing.Point, System.Drawing">
<value>255, 383</value>
</data>
<data name="BUT_writePIDS.Size" type="System.Drawing.Size, System.Drawing">
<value>103, 19</value>
</data>
<data name="BUT_writePIDS.TabIndex" type="System.Int32, mscorlib">
<value>70</value>
</data>
<data name="BUT_writePIDS.Text" xml:space="preserve">
<value>Write Params</value>
</data>
<data name="&gt;&gt;BUT_writePIDS.Name" xml:space="preserve">
<value>BUT_writePIDS</value>
</data>
<data name="&gt;&gt;BUT_writePIDS.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4666.36788, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_writePIDS.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;BUT_writePIDS.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="BUT_rerequestparams.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="BUT_rerequestparams.Location" type="System.Drawing.Point, System.Drawing">
<value>364, 383</value>
</data>
<data name="BUT_rerequestparams.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 15, 0, 0</value>
</data>
<data name="BUT_rerequestparams.Size" type="System.Drawing.Size, System.Drawing">
<value>103, 19</value>
</data>
<data name="BUT_rerequestparams.TabIndex" type="System.Int32, mscorlib">
<value>74</value>
</data>
<data name="BUT_rerequestparams.Text" xml:space="preserve">
<value>Refresh Params</value>
</data>
<data name="&gt;&gt;BUT_rerequestparams.Name" xml:space="preserve">
<value>BUT_rerequestparams</value>
</data>
<data name="&gt;&gt;BUT_rerequestparams.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4666.36788, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_rerequestparams.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;BUT_rerequestparams.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="LOITER_LAT_D.Location" type="System.Drawing.Point, System.Drawing"> <data name="LOITER_LAT_D.Location" type="System.Drawing.Point, System.Drawing">
<value>80, 60</value> <value>80, 60</value>
</data> </data>
@ -2760,6 +2541,135 @@
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve"> <data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>0</value> <value>0</value>
</data> </data>
<data name="BUT_rerequestparams.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="BUT_rerequestparams.Location" type="System.Drawing.Point, System.Drawing">
<value>364, 383</value>
</data>
<data name="BUT_rerequestparams.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 15, 0, 0</value>
</data>
<data name="BUT_rerequestparams.Size" type="System.Drawing.Size, System.Drawing">
<value>103, 19</value>
</data>
<data name="BUT_rerequestparams.TabIndex" type="System.Int32, mscorlib">
<value>74</value>
</data>
<data name="BUT_rerequestparams.Text" xml:space="preserve">
<value>Refresh Params</value>
</data>
<data name="&gt;&gt;BUT_rerequestparams.Name" xml:space="preserve">
<value>BUT_rerequestparams</value>
</data>
<data name="&gt;&gt;BUT_rerequestparams.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4724.22562, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_rerequestparams.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;BUT_rerequestparams.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="BUT_writePIDS.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="BUT_writePIDS.Location" type="System.Drawing.Point, System.Drawing">
<value>255, 383</value>
</data>
<data name="BUT_writePIDS.Size" type="System.Drawing.Size, System.Drawing">
<value>103, 19</value>
</data>
<data name="BUT_writePIDS.TabIndex" type="System.Int32, mscorlib">
<value>70</value>
</data>
<data name="BUT_writePIDS.Text" xml:space="preserve">
<value>Write Params</value>
</data>
<data name="&gt;&gt;BUT_writePIDS.Name" xml:space="preserve">
<value>BUT_writePIDS</value>
</data>
<data name="&gt;&gt;BUT_writePIDS.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4724.22562, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_writePIDS.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;BUT_writePIDS.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="myLabel3.Location" type="System.Drawing.Point, System.Drawing">
<value>364, 321</value>
</data>
<data name="myLabel3.Size" type="System.Drawing.Size, System.Drawing">
<value>29, 23</value>
</data>
<data name="myLabel3.TabIndex" type="System.Int32, mscorlib">
<value>42</value>
</data>
<data name="myLabel3.Text" xml:space="preserve">
<value>Min</value>
</data>
<data name="&gt;&gt;myLabel3.Name" xml:space="preserve">
<value>myLabel3</value>
</data>
<data name="&gt;&gt;myLabel3.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4724.22562, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;myLabel3.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;myLabel3.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="myLabel2.Location" type="System.Drawing.Point, System.Drawing">
<value>364, 296</value>
</data>
<data name="myLabel2.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 23</value>
</data>
<data name="myLabel2.TabIndex" type="System.Int32, mscorlib">
<value>39</value>
</data>
<data name="myLabel2.Text" xml:space="preserve">
<value>Ch6 Opt</value>
</data>
<data name="&gt;&gt;myLabel2.Name" xml:space="preserve">
<value>myLabel2</value>
</data>
<data name="&gt;&gt;myLabel2.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4724.22562, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;myLabel2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;myLabel2.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="myLabel1.Location" type="System.Drawing.Point, System.Drawing">
<value>364, 348</value>
</data>
<data name="myLabel1.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 23</value>
</data>
<data name="myLabel1.TabIndex" type="System.Int32, mscorlib">
<value>37</value>
</data>
<data name="myLabel1.Text" xml:space="preserve">
<value>Ch7 Opt</value>
</data>
<data name="&gt;&gt;myLabel1.Name" xml:space="preserve">
<value>myLabel1</value>
</data>
<data name="&gt;&gt;myLabel1.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4724.22562, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;myLabel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;myLabel1.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>

View File

@ -32,7 +32,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
} }
else else
{ {
if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane)
{ {
this.Enabled = true; this.Enabled = true;
} }
@ -153,7 +153,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
disableNumericUpDownControls(this); disableNumericUpDownControls(this);
// process hashdefines and update display // process hashdefines and update display
foreach (string value in MainV2.comPort.param.Keys) foreach (string value in MainV2.comPort.MAV.param.Keys)
{ {
if (value == null || value == "") if (value == null || value == "")
continue; continue;
@ -167,7 +167,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
if (ctl.GetType() == typeof(NumericUpDown)) if (ctl.GetType() == typeof(NumericUpDown))
{ {
float numbervalue = (float)MainV2.comPort.param[value]; float numbervalue = (float)MainV2.comPort.MAV.param[value];
MAVLink.modifyParamForDisplay(true, value,ref numbervalue); MAVLink.modifyParamForDisplay(true, value,ref numbervalue);
@ -214,7 +214,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
ComboBox thisctl = ((ComboBox)ctl); ComboBox thisctl = ((ComboBox)ctl);
thisctl.SelectedIndex = (int)(float)MainV2.comPort.param[value]; thisctl.SelectedIndex = (int)(float)MainV2.comPort.MAV.param[value];
thisctl.Validated += new EventHandler(ComboBox_Validated); thisctl.Validated += new EventHandler(ComboBox_Validated);
} }

View File

@ -32,7 +32,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
} }
else else
{ {
if (MainV2.cs.firmware == MainV2.Firmwares.ArduRover) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduRover)
{ {
this.Enabled = true; this.Enabled = true;
} }
@ -153,7 +153,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
disableNumericUpDownControls(this); disableNumericUpDownControls(this);
// process hashdefines and update display // process hashdefines and update display
foreach (string value in MainV2.comPort.param.Keys) foreach (string value in MainV2.comPort.MAV.param.Keys)
{ {
if (value == null || value == "") if (value == null || value == "")
continue; continue;
@ -167,7 +167,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
if (ctl.GetType() == typeof(NumericUpDown)) if (ctl.GetType() == typeof(NumericUpDown))
{ {
float numbervalue = (float)MainV2.comPort.param[value]; float numbervalue = (float)MainV2.comPort.MAV.param[value];
MAVLink.modifyParamForDisplay(true, value, ref numbervalue); MAVLink.modifyParamForDisplay(true, value, ref numbervalue);
@ -214,7 +214,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
ComboBox thisctl = ((ComboBox)ctl); ComboBox thisctl = ((ComboBox)ctl);
thisctl.SelectedIndex = (int)(float)MainV2.comPort.param[value]; thisctl.SelectedIndex = (int)(float)MainV2.comPort.MAV.param[value];
thisctl.Validated += new EventHandler(ComboBox_Validated); thisctl.Validated += new EventHandler(ComboBox_Validated);
} }

View File

@ -38,7 +38,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
} }
else else
{ {
if (MainV2.cs.firmware == MainV2.Firmwares.Ateryx) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.Ateryx)
{ {
this.Enabled = true; this.Enabled = true;
} }
@ -159,7 +159,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
disableNumericUpDownControls(this); disableNumericUpDownControls(this);
// process hashdefines and update display // process hashdefines and update display
foreach (string value in MainV2.comPort.param.Keys) foreach (string value in MainV2.comPort.MAV.param.Keys)
{ {
if (value == null || value == "") if (value == null || value == "")
continue; continue;
@ -176,7 +176,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
NumericUpDown thisctl = ((NumericUpDown)ctl); NumericUpDown thisctl = ((NumericUpDown)ctl);
thisctl.Maximum = 9000; thisctl.Maximum = 9000;
thisctl.Minimum = -9000; thisctl.Minimum = -9000;
thisctl.Value = (decimal)(float)MainV2.comPort.param[value]; thisctl.Value = (decimal)(float)MainV2.comPort.MAV.param[value];
thisctl.Increment = (decimal)0.001; thisctl.Increment = (decimal)0.001;
if (thisctl.Name.EndsWith("_P") || thisctl.Name.EndsWith("_I") || thisctl.Name.EndsWith("_D") if (thisctl.Name.EndsWith("_P") || thisctl.Name.EndsWith("_I") || thisctl.Name.EndsWith("_D")
|| thisctl.Name.EndsWith("_LOW") || thisctl.Name.EndsWith("_HIGH") || thisctl.Value == 0 || thisctl.Name.EndsWith("_LOW") || thisctl.Name.EndsWith("_HIGH") || thisctl.Value == 0
@ -216,7 +216,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
ComboBox thisctl = ((ComboBox)ctl); ComboBox thisctl = ((ComboBox)ctl);
thisctl.SelectedIndex = (int)(float)MainV2.comPort.param[value]; thisctl.SelectedIndex = (int)(float)MainV2.comPort.MAV.param[value];
thisctl.Validated += new EventHandler(ComboBox_Validated); thisctl.Validated += new EventHandler(ComboBox_Validated);
} }
@ -353,7 +353,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
{ {
((Button)sender).Enabled = false; ((Button)sender).Enabled = false;
if ((MainV2.cs.airspeed > 7.0) || (MainV2.cs.groundspeed > 10.0)) if ((MainV2.comPort.MAV.cs.airspeed > 7.0) || (MainV2.comPort.MAV.cs.groundspeed > 10.0))
{ {
MessageBox.Show("Unable - UAV airborne"); MessageBox.Show("Unable - UAV airborne");
((Button)sender).Enabled = true; ((Button)sender).Enabled = true;
@ -379,7 +379,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
if (dr == System.Windows.Forms.DialogResult.Yes) if (dr == System.Windows.Forms.DialogResult.Yes)
{ {
if ((MainV2.cs.airspeed > 7.0) || (MainV2.cs.groundspeed > 7.0)) if ((MainV2.comPort.MAV.cs.airspeed > 7.0) || (MainV2.comPort.MAV.cs.groundspeed > 7.0))
{ {
MessageBox.Show("Unable - UAV airborne"); MessageBox.Show("Unable - UAV airborne");
((Button)sender).Enabled = true; ((Button)sender).Enabled = true;

View File

@ -29,7 +29,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
} }
else else
{ {
if (MainV2.cs.firmware == MainV2.Firmwares.Ateryx) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.Ateryx)
{ {
this.Enabled = true; this.Enabled = true;
} }
@ -55,7 +55,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
((Button)sender).Enabled = false; ((Button)sender).Enabled = false;
if ((MainV2.cs.airspeed > 7.0) || (MainV2.cs.groundspeed > 10.0)) if ((MainV2.comPort.MAV.cs.airspeed > 7.0) || (MainV2.comPort.MAV.cs.groundspeed > 10.0))
{ {
MessageBox.Show("Unable - UAV airborne"); MessageBox.Show("Unable - UAV airborne");
((Button)sender).Enabled = true; ((Button)sender).Enabled = true;
@ -79,7 +79,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
{ {
((Button)sender).Enabled = false; ((Button)sender).Enabled = false;
if ((MainV2.cs.airspeed > 7.0) || (MainV2.cs.groundspeed > 10.0)) if ((MainV2.comPort.MAV.cs.airspeed > 7.0) || (MainV2.comPort.MAV.cs.groundspeed > 10.0))
{ {
MessageBox.Show("Unable - UAV airborne"); MessageBox.Show("Unable - UAV airborne");
((Button)sender).Enabled = true; ((Button)sender).Enabled = true;
@ -101,7 +101,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
private void timer1_Tick(object sender, EventArgs e) private void timer1_Tick(object sender, EventArgs e)
{ {
MainV2.cs.UpdateCurrentSettings(bindingSource1); MainV2.comPort.MAV.cs.UpdateCurrentSettings(bindingSource1);
} }
} }
} }

View File

@ -49,7 +49,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
return; return;
try try
{ {
if (MainV2.comPort.param["BATT_CAPACITY"] == null) if (MainV2.comPort.MAV.param["BATT_CAPACITY"] == null)
{ {
CustomMessageBox.Show("Not Available"); CustomMessageBox.Show("Not Available");
} }
@ -66,7 +66,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
return; return;
try try
{ {
if (MainV2.comPort.param["BATT_MONITOR"] == null) if (MainV2.comPort.MAV.param["BATT_MONITOR"] == null)
{ {
CustomMessageBox.Show("Not Available"); CustomMessageBox.Show("Not Available");
} }
@ -117,7 +117,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
return; return;
try try
{ {
if (MainV2.comPort.param["INPUT_VOLTS"] == null) if (MainV2.comPort.MAV.param["INPUT_VOLTS"] == null)
{ {
CustomMessageBox.Show("Not Available"); CustomMessageBox.Show("Not Available");
} }
@ -151,7 +151,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
try try
{ {
if (MainV2.comPort.param["VOLT_DIVIDER"] == null) if (MainV2.comPort.MAV.param["VOLT_DIVIDER"] == null)
{ {
CustomMessageBox.Show("Not Available"); CustomMessageBox.Show("Not Available");
} }
@ -173,7 +173,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
return; return;
try try
{ {
if (MainV2.comPort.param["VOLT_DIVIDER"] == null) if (MainV2.comPort.MAV.param["VOLT_DIVIDER"] == null)
{ {
CustomMessageBox.Show("Not Available"); CustomMessageBox.Show("Not Available");
} }
@ -195,7 +195,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
return; return;
try try
{ {
if (MainV2.comPort.param["AMP_PER_VOLT"] == null) if (MainV2.comPort.MAV.param["AMP_PER_VOLT"] == null)
{ {
CustomMessageBox.Show("Not Available"); CustomMessageBox.Show("Not Available");
} }
@ -304,28 +304,28 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
{ {
startup = true; startup = true;
bool not_supported = false; bool not_supported = false;
if (MainV2.comPort.param["BATT_MONITOR"] != null) if (MainV2.comPort.MAV.param["BATT_MONITOR"] != null)
{ {
if (MainV2.comPort.param["BATT_MONITOR"].ToString() != "0.0") if (MainV2.comPort.MAV.param["BATT_MONITOR"].ToString() != "0.0")
{ {
CMB_batmontype.SelectedIndex = getIndex(CMB_batmontype, (int)float.Parse(MainV2.comPort.param["BATT_MONITOR"].ToString())); CMB_batmontype.SelectedIndex = getIndex(CMB_batmontype, (int)float.Parse(MainV2.comPort.MAV.param["BATT_MONITOR"].ToString()));
} }
} }
if (MainV2.comPort.param["BATT_CAPACITY"] != null) if (MainV2.comPort.MAV.param["BATT_CAPACITY"] != null)
TXT_battcapacity.Text = MainV2.comPort.param["BATT_CAPACITY"].ToString(); TXT_battcapacity.Text = MainV2.comPort.MAV.param["BATT_CAPACITY"].ToString();
if (MainV2.comPort.param["INPUT_VOLTS"] != null) if (MainV2.comPort.MAV.param["INPUT_VOLTS"] != null)
TXT_inputvoltage.Text = MainV2.comPort.param["INPUT_VOLTS"].ToString(); TXT_inputvoltage.Text = MainV2.comPort.MAV.param["INPUT_VOLTS"].ToString();
else else
not_supported = true; not_supported = true;
TXT_voltage.Text = MainV2.cs.battery_voltage.ToString(); TXT_voltage.Text = MainV2.comPort.MAV.cs.battery_voltage.ToString();
TXT_measuredvoltage.Text = TXT_voltage.Text; TXT_measuredvoltage.Text = TXT_voltage.Text;
if (MainV2.comPort.param["VOLT_DIVIDER"] != null) if (MainV2.comPort.MAV.param["VOLT_DIVIDER"] != null)
TXT_divider.Text = MainV2.comPort.param["VOLT_DIVIDER"].ToString(); TXT_divider.Text = MainV2.comPort.MAV.param["VOLT_DIVIDER"].ToString();
else else
not_supported = true; not_supported = true;
if (MainV2.comPort.param["AMP_PER_VOLT"] != null) if (MainV2.comPort.MAV.param["AMP_PER_VOLT"] != null)
TXT_ampspervolt.Text = MainV2.comPort.param["AMP_PER_VOLT"].ToString(); TXT_ampspervolt.Text = MainV2.comPort.MAV.param["AMP_PER_VOLT"].ToString();
else else
not_supported = true; not_supported = true;
if (not_supported) if (not_supported)
@ -359,11 +359,11 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
CMB_batmonsensortype.SelectedIndex = 0; CMB_batmonsensortype.SelectedIndex = 0;
} }
if (MainV2.comPort.param["BATT_VOLT_PIN"] != null) if (MainV2.comPort.MAV.param["BATT_VOLT_PIN"] != null)
{ {
CMB_apmversion.Enabled = true; CMB_apmversion.Enabled = true;
float value = (float)MainV2.comPort.param["BATT_VOLT_PIN"]; float value = (float)MainV2.comPort.MAV.param["BATT_VOLT_PIN"];
if (value == 0) // apm1 if (value == 0) // apm1
{ {
CMB_apmversion.SelectedIndex = 0; CMB_apmversion.SelectedIndex = 0;
@ -402,7 +402,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
private void timer1_Tick(object sender, EventArgs e) private void timer1_Tick(object sender, EventArgs e)
{ {
TXT_voltage.Text = MainV2.cs.battery_voltage.ToString(); TXT_voltage.Text = MainV2.comPort.MAV.cs.battery_voltage.ToString();
} }
private void CMB_apmversion_SelectedIndexChanged(object sender, EventArgs e) private void CMB_apmversion_SelectedIndexChanged(object sender, EventArgs e)

View File

@ -35,7 +35,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
// update all linked controls - 10hz // update all linked controls - 10hz
try try
{ {
MainV2.cs.UpdateCurrentSettings(currentStateBindingSource); MainV2.comPort.MAV.cs.UpdateCurrentSettings(currentStateBindingSource);
} }
catch { } catch { }
} }
@ -43,15 +43,15 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
public void Activate() public void Activate()
{ {
// arducopter // arducopter
mavlinkCheckBoxfs_batt_enable.setup(1, 0, "FS_BATT_ENABLE", MainV2.comPort.param); mavlinkCheckBoxfs_batt_enable.setup(1, 0, "FS_BATT_ENABLE", MainV2.comPort.MAV.param);
// plane // plane
mavlinkCheckBoxthr_fs.setup(1, 0, "THR_FAILSAFE", MainV2.comPort.param, mavlinkNumericUpDownthr_fs_value); mavlinkCheckBoxthr_fs.setup(1, 0, "THR_FAILSAFE", MainV2.comPort.MAV.param, mavlinkNumericUpDownthr_fs_value);
mavlinkNumericUpDownthr_fs_value.setup(800, 1200, 1, 1, "THR_FS_VALUE", MainV2.comPort.param); mavlinkNumericUpDownthr_fs_value.setup(800, 1200, 1, 1, "THR_FS_VALUE", MainV2.comPort.MAV.param);
mavlinkCheckBoxthr_fs_action.setup(1, 0, "THR_FS_ACTION",MainV2.comPort.param); mavlinkCheckBoxthr_fs_action.setup(1, 0, "THR_FS_ACTION",MainV2.comPort.MAV.param);
mavlinkCheckBoxgcs_fs.setup(1, 0, "FS_GCS_ENABL", MainV2.comPort.param); mavlinkCheckBoxgcs_fs.setup(1, 0, "FS_GCS_ENABL", MainV2.comPort.MAV.param);
mavlinkCheckBoxshort_fs.setup(1, 0, "FS_SHORT_ACTN", MainV2.comPort.param); mavlinkCheckBoxshort_fs.setup(1, 0, "FS_SHORT_ACTN", MainV2.comPort.MAV.param);
mavlinkCheckBoxlong_fs.setup(1, 0, "FS_LONG_ACTN", MainV2.comPort.param); mavlinkCheckBoxlong_fs.setup(1, 0, "FS_LONG_ACTN", MainV2.comPort.MAV.param);
timer.Enabled = true; timer.Enabled = true;
timer.Interval = 100; timer.Interval = 100;
@ -109,7 +109,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
private void lbl_currentmode_TextChanged(object sender, EventArgs e) private void lbl_currentmode_TextChanged(object sender, EventArgs e)
{ {
if (MainV2.cs.ch3in < (float)MainV2.comPort.param["THR_FS_VALUE"]) if (MainV2.comPort.MAV.cs.ch3in < (float)MainV2.comPort.MAV.param["THR_FS_VALUE"])
{ {
lbl_currentmode.ForeColor = Color.Red; lbl_currentmode.ForeColor = Color.Red;
} }

View File

@ -25,43 +25,43 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
{ {
try try
{ {
MainV2.cs.UpdateCurrentSettings(currentStateBindingSource); MainV2.comPort.MAV.cs.UpdateCurrentSettings(currentStateBindingSource);
} }
catch { } catch { }
float pwm = 0; float pwm = 0;
if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane || MainV2.cs.firmware == MainV2.Firmwares.ArduRover) // APM if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane || MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduRover) // APM
{ {
if (MainV2.comPort.param.ContainsKey("FLTMODE_CH")) if (MainV2.comPort.MAV.param.ContainsKey("FLTMODE_CH"))
{ {
switch ((int)(float)MainV2.comPort.param["FLTMODE_CH"]) switch ((int)(float)MainV2.comPort.MAV.param["FLTMODE_CH"])
{ {
case 5: case 5:
pwm = MainV2.cs.ch5in; pwm = MainV2.comPort.MAV.cs.ch5in;
break; break;
case 6: case 6:
pwm = MainV2.cs.ch6in; pwm = MainV2.comPort.MAV.cs.ch6in;
break; break;
case 7: case 7:
pwm = MainV2.cs.ch7in; pwm = MainV2.comPort.MAV.cs.ch7in;
break; break;
case 8: case 8:
pwm = MainV2.cs.ch8in; pwm = MainV2.comPort.MAV.cs.ch8in;
break; break;
default: default:
break; break;
} }
LBL_flightmodepwm.Text = MainV2.comPort.param["FLTMODE_CH"].ToString() + ": " + pwm.ToString(); LBL_flightmodepwm.Text = MainV2.comPort.MAV.param["FLTMODE_CH"].ToString() + ": " + pwm.ToString();
} }
} }
if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2) // ac2 if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduCopter2) // ac2
{ {
pwm = MainV2.cs.ch5in; pwm = MainV2.comPort.MAV.cs.ch5in;
LBL_flightmodepwm.Text = "5: " + MainV2.cs.ch5in.ToString(); LBL_flightmodepwm.Text = "5: " + MainV2.comPort.MAV.cs.ch5in.ToString();
} }
Control[] fmodelist = new Control[] { CMB_fmode1, CMB_fmode2, CMB_fmode3, CMB_fmode4, CMB_fmode5, CMB_fmode6 }; Control[] fmodelist = new Control[] { CMB_fmode1, CMB_fmode2, CMB_fmode3, CMB_fmode4, CMB_fmode5, CMB_fmode6 };
@ -100,11 +100,11 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
MainV2.comPort.setParam("FLTMODE5", (float)Int32.Parse(CMB_fmode5.SelectedValue.ToString())); MainV2.comPort.setParam("FLTMODE5", (float)Int32.Parse(CMB_fmode5.SelectedValue.ToString()));
MainV2.comPort.setParam("FLTMODE6", (float)Int32.Parse(CMB_fmode6.SelectedValue.ToString())); MainV2.comPort.setParam("FLTMODE6", (float)Int32.Parse(CMB_fmode6.SelectedValue.ToString()));
if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2) // ac2 if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduCopter2) // ac2
{ {
float value = (float)(CB_simple1.Checked ? (int)SimpleMode.Simple1 : 0) + (CB_simple2.Checked ? (int)SimpleMode.Simple2 : 0) + (CB_simple3.Checked ? (int)SimpleMode.Simple3 : 0) float value = (float)(CB_simple1.Checked ? (int)SimpleMode.Simple1 : 0) + (CB_simple2.Checked ? (int)SimpleMode.Simple2 : 0) + (CB_simple3.Checked ? (int)SimpleMode.Simple3 : 0)
+ (CB_simple4.Checked ? (int)SimpleMode.Simple4 : 0) + (CB_simple5.Checked ? (int)SimpleMode.Simple5 : 0) + (CB_simple6.Checked ? (int)SimpleMode.Simple6 : 0); + (CB_simple4.Checked ? (int)SimpleMode.Simple4 : 0) + (CB_simple5.Checked ? (int)SimpleMode.Simple5 : 0) + (CB_simple6.Checked ? (int)SimpleMode.Simple6 : 0);
if (MainV2.comPort.param.ContainsKey("SIMPLE")) if (MainV2.comPort.MAV.param.ContainsKey("SIMPLE"))
MainV2.comPort.setParam("SIMPLE", value); MainV2.comPort.setParam("SIMPLE", value);
} }
} }
@ -131,7 +131,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
public void Activate() public void Activate()
{ {
if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane) // APM if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane) // APM
{ {
CB_simple1.Visible = false; CB_simple1.Visible = false;
CB_simple2.Visible = false; CB_simple2.Visible = false;
@ -168,17 +168,17 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
try try
{ {
CMB_fmode1.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.apmmodes), MainV2.comPort.param["FLTMODE1"].ToString())); CMB_fmode1.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.apmmodes), MainV2.comPort.MAV.param["FLTMODE1"].ToString()));
CMB_fmode2.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.apmmodes), MainV2.comPort.param["FLTMODE2"].ToString())); CMB_fmode2.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.apmmodes), MainV2.comPort.MAV.param["FLTMODE2"].ToString()));
CMB_fmode3.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.apmmodes), MainV2.comPort.param["FLTMODE3"].ToString())); CMB_fmode3.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.apmmodes), MainV2.comPort.MAV.param["FLTMODE3"].ToString()));
CMB_fmode4.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.apmmodes), MainV2.comPort.param["FLTMODE4"].ToString())); CMB_fmode4.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.apmmodes), MainV2.comPort.MAV.param["FLTMODE4"].ToString()));
CMB_fmode5.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.apmmodes), MainV2.comPort.param["FLTMODE5"].ToString())); CMB_fmode5.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.apmmodes), MainV2.comPort.MAV.param["FLTMODE5"].ToString()));
CMB_fmode6.Text = Common.apmmodes.MANUAL.ToString(); CMB_fmode6.Text = Common.apmmodes.MANUAL.ToString();
CMB_fmode6.Enabled = false; CMB_fmode6.Enabled = false;
} }
catch { } catch { }
} }
else if (MainV2.cs.firmware == MainV2.Firmwares.ArduRover) // APM else if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduRover) // APM
{ {
CB_simple1.Visible = false; CB_simple1.Visible = false;
CB_simple2.Visible = false; CB_simple2.Visible = false;
@ -215,16 +215,16 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
try try
{ {
CMB_fmode1.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.aprovermodes), MainV2.comPort.param["FLTMODE1"].ToString())); CMB_fmode1.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.aprovermodes), MainV2.comPort.MAV.param["FLTMODE1"].ToString()));
CMB_fmode2.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.aprovermodes), MainV2.comPort.param["FLTMODE2"].ToString())); CMB_fmode2.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.aprovermodes), MainV2.comPort.MAV.param["FLTMODE2"].ToString()));
CMB_fmode3.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.aprovermodes), MainV2.comPort.param["FLTMODE3"].ToString())); CMB_fmode3.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.aprovermodes), MainV2.comPort.MAV.param["FLTMODE3"].ToString()));
CMB_fmode4.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.aprovermodes), MainV2.comPort.param["FLTMODE4"].ToString())); CMB_fmode4.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.aprovermodes), MainV2.comPort.MAV.param["FLTMODE4"].ToString()));
CMB_fmode5.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.aprovermodes), MainV2.comPort.param["FLTMODE5"].ToString())); CMB_fmode5.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.aprovermodes), MainV2.comPort.MAV.param["FLTMODE5"].ToString()));
CMB_fmode6.Text = Common.aprovermodes.MANUAL.ToString(); CMB_fmode6.Text = Common.aprovermodes.MANUAL.ToString();
CMB_fmode6.Enabled = false; CMB_fmode6.Enabled = false;
} }
catch { } catch { }
} else if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2) // ac2 } else if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduCopter2) // ac2
{ {
var flightModes = EnumTranslator.Translate<Common.ac2modes>(); var flightModes = EnumTranslator.Translate<Common.ac2modes>();
@ -254,15 +254,15 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
try try
{ {
CMB_fmode1.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.ac2modes), MainV2.comPort.param["FLTMODE1"].ToString())); CMB_fmode1.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.ac2modes), MainV2.comPort.MAV.param["FLTMODE1"].ToString()));
CMB_fmode2.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.ac2modes), MainV2.comPort.param["FLTMODE2"].ToString())); CMB_fmode2.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.ac2modes), MainV2.comPort.MAV.param["FLTMODE2"].ToString()));
CMB_fmode3.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.ac2modes), MainV2.comPort.param["FLTMODE3"].ToString())); CMB_fmode3.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.ac2modes), MainV2.comPort.MAV.param["FLTMODE3"].ToString()));
CMB_fmode4.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.ac2modes), MainV2.comPort.param["FLTMODE4"].ToString())); CMB_fmode4.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.ac2modes), MainV2.comPort.MAV.param["FLTMODE4"].ToString()));
CMB_fmode5.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.ac2modes), MainV2.comPort.param["FLTMODE5"].ToString())); CMB_fmode5.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.ac2modes), MainV2.comPort.MAV.param["FLTMODE5"].ToString()));
CMB_fmode6.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.ac2modes), MainV2.comPort.param["FLTMODE6"].ToString())); CMB_fmode6.Text = EnumTranslator.GetDisplayText(Enum.Parse(typeof(Common.ac2modes), MainV2.comPort.MAV.param["FLTMODE6"].ToString()));
CMB_fmode6.Enabled = true; CMB_fmode6.Enabled = true;
int simple = int.Parse(MainV2.comPort.param["SIMPLE"].ToString()); int simple = int.Parse(MainV2.comPort.MAV.param["SIMPLE"].ToString());
CB_simple1.Checked = ((simple >> 0 & 1) == 1); CB_simple1.Checked = ((simple >> 0 & 1) == 1);
CB_simple2.Checked = ((simple >> 1 & 1) == 1); CB_simple2.Checked = ((simple >> 1 & 1) == 1);

View File

@ -158,7 +158,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
_params.Clear(); _params.Clear();
// When the parameter list is changed, re sort the list for our View's purposes // When the parameter list is changed, re sort the list for our View's purposes
MainV2.comPort.param.Keys.ForEach(x => MainV2.comPort.MAV.param.Keys.ForEach(x =>
{ {
string displayName = _parameterMetaDataRepository.GetParameterMetaData(x.ToString(), ParameterMetaDataConstants.DisplayName); string displayName = _parameterMetaDataRepository.GetParameterMetaData(x.ToString(), ParameterMetaDataConstants.DisplayName);
string parameterMode = _parameterMetaDataRepository.GetParameterMetaData(x.ToString(), ParameterMetaDataConstants.User); string parameterMode = _parameterMetaDataRepository.GetParameterMetaData(x.ToString(), ParameterMetaDataConstants.User);
@ -216,7 +216,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
{ {
bool controlAdded = false; bool controlAdded = false;
string value = ((float)MainV2.comPort.param[x.Key]).ToString("0.###", CultureInfo.InvariantCulture); string value = ((float)MainV2.comPort.MAV.param[x.Key]).ToString("0.###", CultureInfo.InvariantCulture);
string description = _parameterMetaDataRepository.GetParameterMetaData(x.Key, ParameterMetaDataConstants.Description); string description = _parameterMetaDataRepository.GetParameterMetaData(x.Key, ParameterMetaDataConstants.Description);
string displayName = x.Value + " (" + x.Key + ")"; string displayName = x.Value + " (" + x.Key + ")";
string units = _parameterMetaDataRepository.GetParameterMetaData(x.Key, ParameterMetaDataConstants.Units); string units = _parameterMetaDataRepository.GetParameterMetaData(x.Key, ParameterMetaDataConstants.Units);

View File

@ -29,9 +29,9 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
List<Tuple<float, float, float>> data = new List<Tuple<float, float, float>>(); List<Tuple<float, float, float>> data = new List<Tuple<float, float, float>>();
// backup current rate and set to 10 hz // backup current rate and set to 10 hz
byte backupratesens = MainV2.cs.ratesensors; byte backupratesens = MainV2.comPort.MAV.cs.ratesensors;
MainV2.cs.ratesensors = 10; MainV2.comPort.MAV.cs.ratesensors = 10;
MainV2.comPort.requestDatastream((byte)MAVLink.MAV_DATA_STREAM.RAW_SENSORS, MainV2.cs.ratesensors); // mag captures at 10 hz MainV2.comPort.requestDatastream((byte)MAVLink.MAV_DATA_STREAM.RAW_SENSORS, MainV2.comPort.MAV.cs.ratesensors); // mag captures at 10 hz
CustomMessageBox.Show("Data will be collected for 30 seconds, Please click ok and move the apm around all axises"); CustomMessageBox.Show("Data will be collected for 30 seconds, Please click ok and move the apm around all axises");
@ -46,24 +46,24 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
// dont let the gui hang // dont let the gui hang
Application.DoEvents(); Application.DoEvents();
if (oldmx != MainV2.cs.mx && if (oldmx != MainV2.comPort.MAV.cs.mx &&
oldmy != MainV2.cs.my && oldmy != MainV2.comPort.MAV.cs.my &&
oldmz != MainV2.cs.mz) oldmz != MainV2.comPort.MAV.cs.mz)
{ {
data.Add(new Tuple<float, float, float>( data.Add(new Tuple<float, float, float>(
MainV2.cs.mx - (float)MainV2.cs.mag_ofs_x, MainV2.comPort.MAV.cs.mx - (float)MainV2.comPort.MAV.cs.mag_ofs_x,
MainV2.cs.my - (float)MainV2.cs.mag_ofs_y, MainV2.comPort.MAV.cs.my - (float)MainV2.comPort.MAV.cs.mag_ofs_y,
MainV2.cs.mz - (float)MainV2.cs.mag_ofs_z)); MainV2.comPort.MAV.cs.mz - (float)MainV2.comPort.MAV.cs.mag_ofs_z));
oldmx = MainV2.cs.mx; oldmx = MainV2.comPort.MAV.cs.mx;
oldmy = MainV2.cs.my; oldmy = MainV2.comPort.MAV.cs.my;
oldmz = MainV2.cs.mz; oldmz = MainV2.comPort.MAV.cs.mz;
} }
} }
// restore old sensor rate // restore old sensor rate
MainV2.cs.ratesensors = backupratesens; MainV2.comPort.MAV.cs.ratesensors = backupratesens;
MainV2.comPort.requestDatastream((byte)MAVLink.MAV_DATA_STREAM.RAW_SENSORS, MainV2.cs.ratesensors); MainV2.comPort.requestDatastream((byte)MAVLink.MAV_DATA_STREAM.RAW_SENSORS, MainV2.comPort.MAV.cs.ratesensors);
if (data.Count < 10) if (data.Count < 10)
{ {
@ -98,7 +98,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
return; return;
try try
{ {
if (MainV2.comPort.param["COMPASS_DEC"] == null) if (MainV2.comPort.MAV.param["COMPASS_DEC"] == null)
{ {
CustomMessageBox.Show("Not Available"); CustomMessageBox.Show("Not Available");
} }
@ -148,7 +148,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
return; return;
try try
{ {
if (MainV2.comPort.param["MAG_ENABLE"] == null) if (MainV2.comPort.MAV.param["MAG_ENABLE"] == null)
{ {
CustomMessageBox.Show("Not Available"); CustomMessageBox.Show("Not Available");
} }
@ -166,7 +166,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
return; return;
try try
{ {
if (MainV2.comPort.param["SONAR_ENABLE"] == null) if (MainV2.comPort.MAV.param["SONAR_ENABLE"] == null)
{ {
CustomMessageBox.Show("Not Available"); CustomMessageBox.Show("Not Available");
} }
@ -184,9 +184,9 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
return; return;
try try
{ {
if (MainV2.comPort.param["ARSPD_ENABLE"] == null) if (MainV2.comPort.MAV.param["ARSPD_ENABLE"] == null)
{ {
CustomMessageBox.Show("Not Available on " + MainV2.cs.firmware.ToString()); CustomMessageBox.Show("Not Available on " + MainV2.comPort.MAV.cs.firmware.ToString());
} }
else else
{ {
@ -203,9 +203,9 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
return; return;
try try
{ {
if (MainV2.comPort.param["FLOW_ENABLE"] == null) if (MainV2.comPort.MAV.param["FLOW_ENABLE"] == null)
{ {
CustomMessageBox.Show("Not Available on " + MainV2.cs.firmware.ToString()); CustomMessageBox.Show("Not Available on " + MainV2.comPort.MAV.cs.firmware.ToString());
} }
else else
{ {
@ -221,9 +221,9 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
return; return;
try try
{ {
if (MainV2.comPort.param["SONAR_TYPE"] == null) if (MainV2.comPort.MAV.param["SONAR_TYPE"] == null)
{ {
CustomMessageBox.Show("Not Available on " + MainV2.cs.firmware.ToString()); CustomMessageBox.Show("Not Available on " + MainV2.comPort.MAV.cs.firmware.ToString());
} }
else else
{ {
@ -247,23 +247,23 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
startup = true; startup = true;
CHK_airspeeduse.setup(1, 0, "ARSPD_USE", MainV2.comPort.param); CHK_airspeeduse.setup(1, 0, "ARSPD_USE", MainV2.comPort.MAV.param);
CHK_enableairspeed.setup(1, 0, "ARSPD_ENABLE", MainV2.comPort.param); CHK_enableairspeed.setup(1, 0, "ARSPD_ENABLE", MainV2.comPort.MAV.param);
CHK_enablecompass.setup(1, 0, "MAG_ENABLE", MainV2.comPort.param, TXT_declination); CHK_enablecompass.setup(1, 0, "MAG_ENABLE", MainV2.comPort.MAV.param, TXT_declination);
CHK_enableoptflow.setup(1,0,"FLOW_ENABLE", MainV2.comPort.param); CHK_enableoptflow.setup(1,0,"FLOW_ENABLE", MainV2.comPort.MAV.param);
CHK_enablesonar.setup(1, 0, "SONAR_ENABLE", MainV2.comPort.param, CMB_sonartype); CHK_enablesonar.setup(1, 0, "SONAR_ENABLE", MainV2.comPort.MAV.param, CMB_sonartype);
if (MainV2.comPort.param["COMPASS_DEC"] != null) if (MainV2.comPort.MAV.param["COMPASS_DEC"] != null)
{ {
TXT_declination.Text = (float.Parse(MainV2.comPort.param["COMPASS_DEC"].ToString()) * rad2deg).ToString(); TXT_declination.Text = (float.Parse(MainV2.comPort.MAV.param["COMPASS_DEC"].ToString()) * rad2deg).ToString();
} }
if (MainV2.comPort.param["SONAR_TYPE"] != null) if (MainV2.comPort.MAV.param["SONAR_TYPE"] != null)
{ {
CMB_sonartype.SelectedIndex = int.Parse(MainV2.comPort.param["SONAR_TYPE"].ToString()); CMB_sonartype.SelectedIndex = int.Parse(MainV2.comPort.MAV.param["SONAR_TYPE"].ToString());
} }
if (MainV2.comPort.param["COMPASS_AUTODEC"] != null) if (MainV2.comPort.MAV.param["COMPASS_AUTODEC"] != null)
{ {
CHK_autodec.Checked = MainV2.comPort.param["COMPASS_AUTODEC"].ToString() == "1" ? true : false; CHK_autodec.Checked = MainV2.comPort.MAV.param["COMPASS_AUTODEC"].ToString() == "1" ? true : false;
} }
startup = false; startup = false;
@ -295,9 +295,9 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
return; return;
try try
{ {
if (MainV2.comPort.param["COMPASS_AUTODEC"] == null) if (MainV2.comPort.MAV.param["COMPASS_AUTODEC"] == null)
{ {
CustomMessageBox.Show("Not Available on " + MainV2.cs.firmware.ToString()); CustomMessageBox.Show("Not Available on " + MainV2.comPort.MAV.cs.firmware.ToString());
} }
else else
{ {

View File

@ -22,19 +22,14 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
public ConfigMount() public ConfigMount()
{ {
InitializeComponent(); InitializeComponent();
PBOX_WarningIcon.Opacity = 0.0F;
LBL_Error.Opacity = 0.0F;
var delay = new Transition(new TransitionType_Linear(2000)); var delay = new Transition(new TransitionType_Linear(2000));
var fadeIn = new Transition(new TransitionType_Linear(800)); var fadeIn = new Transition(new TransitionType_Linear(800));
fadeIn.add(PBOX_WarningIcon, "Opacity", 1.0F);
fadeIn.add(LBL_Error, "Opacity", 1.0F);
_ErrorTransition = new[] { delay, fadeIn }; _ErrorTransition = new[] { delay, fadeIn };
_NoErrorTransition = new Transition(new TransitionType_Linear(10)); _NoErrorTransition = new Transition(new TransitionType_Linear(10));
_NoErrorTransition.add(PBOX_WarningIcon, "Opacity", 0.0F);
_NoErrorTransition.add(LBL_Error, "Opacity", 0.0F);
//setup button actions //setup button actions
foreach (var btn in Controls.Cast<Control>().OfType<Button>()) foreach (var btn in Controls.Cast<Control>().OfType<Button>())
@ -45,7 +40,9 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
SetErrorMessageOpacity(); SetErrorMessageOpacity();
if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane) comboBox1.Items.AddRange(Enum.GetNames(typeof(ChannelCameraShutter)));
if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane)
{ {
mavlinkComboBoxTilt.Items.AddRange(Enum.GetNames(typeof(Channelap))); mavlinkComboBoxTilt.Items.AddRange(Enum.GetNames(typeof(Channelap)));
mavlinkComboBoxRoll.Items.AddRange(Enum.GetNames(typeof(Channelap))); mavlinkComboBoxRoll.Items.AddRange(Enum.GetNames(typeof(Channelap)));
@ -84,6 +81,19 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
RC11 = 1 RC11 = 1
} }
enum ChannelCameraShutter
{
Disable = 0,
RC5 = 5,
RC6 = 6,
RC7 = 7,
RC8 = 8,
RC10 = 10,
RC11 = 11,
Relay = 1,
Transistor = 4
}
enum Channelinput enum Channelinput
{ {
Disable = 0, Disable = 0,
@ -95,13 +105,13 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
public void Activate() public void Activate()
{ {
Hashtable copy = new Hashtable(MainV2.comPort.param); Hashtable copy = new Hashtable(MainV2.comPort.MAV.param);
foreach (string item in copy.Keys) foreach (string item in copy.Keys)
{ {
if (item.EndsWith("_FUNCTION")) if (item.EndsWith("_FUNCTION"))
{ {
switch (MainV2.comPort.param[item].ToString()) switch (MainV2.comPort.MAV.param[item].ToString())
{ {
case "6": case "6":
mavlinkComboBoxPan.Text = item.Replace("_FUNCTION", ""); mavlinkComboBoxPan.Text = item.Replace("_FUNCTION", "");
@ -112,6 +122,9 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
case "8": case "8":
mavlinkComboBoxRoll.Text = item.Replace("_FUNCTION", ""); mavlinkComboBoxRoll.Text = item.Replace("_FUNCTION", "");
break; break;
case "10":
comboBox1.Text = item.Replace("_FUNCTION", "");
break;
default: default:
break; break;
} }
@ -122,25 +135,26 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
try try
{ {
updateShutter();
updatePitch(); updatePitch();
updateRoll(); updateRoll();
updateYaw(); updateYaw();
CHK_stab_tilt.setup(1, 0, ParamHead+"STAB_TILT", MainV2.comPort.param); CHK_stab_tilt.setup(1, 0, ParamHead+"STAB_TILT", MainV2.comPort.MAV.param);
CHK_stab_roll.setup(1, 0, ParamHead+"STAB_ROLL", MainV2.comPort.param); CHK_stab_roll.setup(1, 0, ParamHead+"STAB_ROLL", MainV2.comPort.MAV.param);
CHK_stab_pan.setup(1, 0, ParamHead+"STAB_PAN", MainV2.comPort.param); CHK_stab_pan.setup(1, 0, ParamHead+"STAB_PAN", MainV2.comPort.MAV.param);
NUD_CONTROL_x.setup(-180, 180, 100, 1, ParamHead+"CONTROL_X",MainV2.comPort.param); NUD_CONTROL_x.setup(-180, 180, 100, 1, ParamHead+"CONTROL_X",MainV2.comPort.MAV.param);
NUD_CONTROL_y.setup(-180, 180, 100, 1, ParamHead+"CONTROL_Y", MainV2.comPort.param); NUD_CONTROL_y.setup(-180, 180, 100, 1, ParamHead+"CONTROL_Y", MainV2.comPort.MAV.param);
NUD_CONTROL_z.setup(-180, 180, 100, 1, ParamHead+"CONTROL_Z", MainV2.comPort.param); NUD_CONTROL_z.setup(-180, 180, 100, 1, ParamHead+"CONTROL_Z", MainV2.comPort.MAV.param);
NUD_NEUTRAL_x.setup(-180, 180, 100, 1, ParamHead+"NEUTRAL_X", MainV2.comPort.param); NUD_NEUTRAL_x.setup(-180, 180, 100, 1, ParamHead+"NEUTRAL_X", MainV2.comPort.MAV.param);
NUD_NEUTRAL_y.setup(-180, 180, 100, 1, ParamHead+"NEUTRAL_Y", MainV2.comPort.param); NUD_NEUTRAL_y.setup(-180, 180, 100, 1, ParamHead+"NEUTRAL_Y", MainV2.comPort.MAV.param);
NUD_NEUTRAL_z.setup(-180, 180, 100, 1, ParamHead+"NEUTRAL_Z", MainV2.comPort.param); NUD_NEUTRAL_z.setup(-180, 180, 100, 1, ParamHead+"NEUTRAL_Z", MainV2.comPort.MAV.param);
NUD_RETRACT_x.setup(-180, 180, 100, 1, ParamHead+"RETRACT_X", MainV2.comPort.param); NUD_RETRACT_x.setup(-180, 180, 100, 1, ParamHead+"RETRACT_X", MainV2.comPort.MAV.param);
NUD_RETRACT_y.setup(-180, 180, 100, 1, ParamHead+"RETRACT_Y", MainV2.comPort.param); NUD_RETRACT_y.setup(-180, 180, 100, 1, ParamHead+"RETRACT_Y", MainV2.comPort.MAV.param);
NUD_RETRACT_z.setup(-180, 180, 100, 1, ParamHead+"RETRACT_Z", MainV2.comPort.param); NUD_RETRACT_z.setup(-180, 180, 100, 1, ParamHead+"RETRACT_Z", MainV2.comPort.MAV.param);
} }
catch (Exception ex) { CustomMessageBox.Show("Failed to set Param\n" + ex.ToString()); this.Enabled = false; return; } catch (Exception ex) { CustomMessageBox.Show("Failed to set Param\n" + ex.ToString()); this.Enabled = false; return; }
} }
@ -149,8 +163,8 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
{ {
foreach (string item in cmb.Items) foreach (string item in cmb.Items)
{ {
if (MainV2.comPort.param.ContainsKey(item+"_FUNCTION")) { if (MainV2.comPort.MAV.param.ContainsKey(item+"_FUNCTION")) {
float ans = (float)MainV2.comPort.param[item+"_FUNCTION"]; float ans = (float)MainV2.comPort.MAV.param[item+"_FUNCTION"];
if (item == exclude) if (item == exclude)
continue; continue;
@ -163,6 +177,47 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
} }
} }
void updateShutter()
{
// shutter
if (comboBox1.Text == "")
return;
if (comboBox1.Text != "Disable")
{
if (comboBox1.Text == ChannelCameraShutter.Relay.ToString())
{
ensureDisabled(comboBox1, 10);
MainV2.comPort.setParam("CAM_TRIGG_TYPE", 1);
}
else if (comboBox1.Text == ChannelCameraShutter.Transistor.ToString())
{
ensureDisabled(comboBox1, 10);
MainV2.comPort.setParam("CAM_TRIGG_TYPE", 4);
}
else
{
MainV2.comPort.setParam(comboBox1.Text + "_FUNCTION", 10);
// servo
MainV2.comPort.setParam("CAM_TRIGG_TYPE", 0);
}
}
else
{
// servo
MainV2.comPort.setParam("CAM_TRIGG_TYPE", 0);
ensureDisabled(comboBox1, 10);
}
mavlinkNumericUpDownShutM.setup(800, 2200, 1, 1, comboBox1.Text + "_MIN", MainV2.comPort.MAV.param);
mavlinkNumericUpDownShutMX.setup(800, 2200, 1, 1, comboBox1.Text + "_MAX", MainV2.comPort.MAV.param);
mavlinkNumericUpDown1.setup(800, 2200, 1, 1, "CAM_SERVO_OFF", MainV2.comPort.MAV.param);
mavlinkNumericUpDown2.setup(800, 2200, 1, 1, "CAM_SERVO_ON", MainV2.comPort.MAV.param);
mavlinkNumericUpDown5.setup(1, 200, 1, 1, "CAM_DURATION", MainV2.comPort.MAV.param);
}
void updatePitch() void updatePitch()
{ {
// pitch // pitch
@ -181,12 +236,12 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
} }
mavlinkNumericUpDownTSM.setup(800, 2200, 1, 1, mavlinkComboBoxTilt.Text +"_MIN", MainV2.comPort.param); mavlinkNumericUpDownTSM.setup(800, 2200, 1, 1, mavlinkComboBoxTilt.Text +"_MIN", MainV2.comPort.MAV.param);
mavlinkNumericUpDownTSMX.setup(800, 2200, 1, 1, mavlinkComboBoxTilt.Text + "_MAX", MainV2.comPort.param); mavlinkNumericUpDownTSMX.setup(800, 2200, 1, 1, mavlinkComboBoxTilt.Text + "_MAX", MainV2.comPort.MAV.param);
mavlinkNumericUpDownTAM.setup(-90, 0, 100, 1, ParamHead+"ANGMIN_TIL", MainV2.comPort.param); mavlinkNumericUpDownTAM.setup(-90, 0, 100, 1, ParamHead+"ANGMIN_TIL", MainV2.comPort.MAV.param);
mavlinkNumericUpDownTAMX.setup(0, 90, 100, 1, ParamHead+"ANGMAX_TIL", MainV2.comPort.param); mavlinkNumericUpDownTAMX.setup(0, 90, 100, 1, ParamHead+"ANGMAX_TIL", MainV2.comPort.MAV.param);
mavlinkCheckBoxTR.setup(-1, 1, mavlinkComboBoxTilt.Text + "_REV", MainV2.comPort.param); mavlinkCheckBoxTR.setup(-1, 1, mavlinkComboBoxTilt.Text + "_REV", MainV2.comPort.MAV.param);
CMB_inputch_tilt.setup(typeof(Channelinput), ParamHead+"RC_IN_TILT", MainV2.comPort.param); CMB_inputch_tilt.setup(typeof(Channelinput), ParamHead+"RC_IN_TILT", MainV2.comPort.MAV.param);
} }
void updateRoll() void updateRoll()
@ -206,12 +261,12 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
ensureDisabled(mavlinkComboBoxRoll,8); ensureDisabled(mavlinkComboBoxRoll,8);
} }
mavlinkNumericUpDownRSM.setup(800, 2200, 1, 1, mavlinkComboBoxRoll.Text +"_MIN", MainV2.comPort.param); mavlinkNumericUpDownRSM.setup(800, 2200, 1, 1, mavlinkComboBoxRoll.Text +"_MIN", MainV2.comPort.MAV.param);
mavlinkNumericUpDownRSMX.setup(800, 2200, 1, 1, mavlinkComboBoxRoll.Text + "_MAX", MainV2.comPort.param); mavlinkNumericUpDownRSMX.setup(800, 2200, 1, 1, mavlinkComboBoxRoll.Text + "_MAX", MainV2.comPort.MAV.param);
mavlinkNumericUpDownRAM.setup(-90, 0, 100, 1, ParamHead+"ANGMIN_ROL", MainV2.comPort.param); mavlinkNumericUpDownRAM.setup(-90, 0, 100, 1, ParamHead+"ANGMIN_ROL", MainV2.comPort.MAV.param);
mavlinkNumericUpDownRAMX.setup(0, 90, 100, 1, ParamHead+"ANGMAX_ROL", MainV2.comPort.param); mavlinkNumericUpDownRAMX.setup(0, 90, 100, 1, ParamHead+"ANGMAX_ROL", MainV2.comPort.MAV.param);
mavlinkCheckBoxRR.setup(-1, 1, mavlinkComboBoxRoll.Text + "_REV", MainV2.comPort.param); mavlinkCheckBoxRR.setup(-1, 1, mavlinkComboBoxRoll.Text + "_REV", MainV2.comPort.MAV.param);
CMB_inputch_roll.setup(typeof(Channelinput), ParamHead+"RC_IN_ROLL", MainV2.comPort.param); CMB_inputch_roll.setup(typeof(Channelinput), ParamHead+"RC_IN_ROLL", MainV2.comPort.MAV.param);
} }
void updateYaw() void updateYaw()
@ -231,12 +286,12 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
ensureDisabled(mavlinkComboBoxPan,6); ensureDisabled(mavlinkComboBoxPan,6);
} }
mavlinkNumericUpDownPSM.setup(800, 2200, 1, 1, mavlinkComboBoxPan.Text + "_MIN", MainV2.comPort.param); mavlinkNumericUpDownPSM.setup(800, 2200, 1, 1, mavlinkComboBoxPan.Text + "_MIN", MainV2.comPort.MAV.param);
mavlinkNumericUpDownPSMX.setup(800, 2200, 1, 1, mavlinkComboBoxPan.Text + "_MAX", MainV2.comPort.param); mavlinkNumericUpDownPSMX.setup(800, 2200, 1, 1, mavlinkComboBoxPan.Text + "_MAX", MainV2.comPort.MAV.param);
mavlinkNumericUpDownPAM.setup(-90, 0, 100, 1, ParamHead+"ANGMIN_PAN", MainV2.comPort.param); mavlinkNumericUpDownPAM.setup(-90, 0, 100, 1, ParamHead+"ANGMIN_PAN", MainV2.comPort.MAV.param);
mavlinkNumericUpDownPAMX.setup(0, 90, 100, 1, ParamHead+"ANGMAX_PAN", MainV2.comPort.param); mavlinkNumericUpDownPAMX.setup(0, 90, 100, 1, ParamHead+"ANGMAX_PAN", MainV2.comPort.MAV.param);
mavlinkCheckBoxPR.setup(-1, 1, mavlinkComboBoxPan.Text + "_REV", MainV2.comPort.param); mavlinkCheckBoxPR.setup(-1, 1, mavlinkComboBoxPan.Text + "_REV", MainV2.comPort.MAV.param);
CMB_inputch_pan.setup(typeof(Channelinput), ParamHead+"RC_IN_PAN", MainV2.comPort.param); CMB_inputch_pan.setup(typeof(Channelinput), ParamHead+"RC_IN_PAN", MainV2.comPort.MAV.param);
} }
private void SetErrorMessageOpacity() private void SetErrorMessageOpacity()
@ -311,9 +366,10 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
ensureDisabled(cmb, 8, mavlinkComboBoxRoll.Text); ensureDisabled(cmb, 8, mavlinkComboBoxRoll.Text);
// enable 3 axis stabilize // enable 3 axis stabilize
if (MainV2.comPort.param.ContainsKey(ParamHead+"MODE")) if (MainV2.comPort.MAV.param.ContainsKey(ParamHead+"MODE"))
MainV2.comPort.setParam(ParamHead+"MODE", 3); MainV2.comPort.setParam(ParamHead+"MODE", 3);
updateShutter();
updatePitch(); updatePitch();
updateRoll(); updateRoll();
updateYaw(); updateYaw();

View File

@ -84,8 +84,6 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
this.mavlinkNumericUpDownRSM = new ArdupilotMega.Controls.MavlinkNumericUpDown(); this.mavlinkNumericUpDownRSM = new ArdupilotMega.Controls.MavlinkNumericUpDown();
this.mavlinkNumericUpDownRSMX = new ArdupilotMega.Controls.MavlinkNumericUpDown(); this.mavlinkNumericUpDownRSMX = new ArdupilotMega.Controls.MavlinkNumericUpDown();
this.mavlinkCheckBoxRR = new ArdupilotMega.Controls.MavlinkCheckBox(); this.mavlinkCheckBoxRR = new ArdupilotMega.Controls.MavlinkCheckBox();
this.LBL_Error = new ArdupilotMega.Controls.LabelWithPseudoOpacity();
this.PBOX_WarningIcon = new ArdupilotMega.Controls.PictureBoxWithPseudoOpacity();
this.groupBox4 = new System.Windows.Forms.GroupBox(); this.groupBox4 = new System.Windows.Forms.GroupBox();
this.label27 = new System.Windows.Forms.Label(); this.label27 = new System.Windows.Forms.Label();
this.NUD_RETRACT_z = new ArdupilotMega.Controls.MavlinkNumericUpDown(); this.NUD_RETRACT_z = new ArdupilotMega.Controls.MavlinkNumericUpDown();
@ -110,6 +108,23 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
this.CHK_stab_tilt = new ArdupilotMega.Controls.MavlinkCheckBox(); this.CHK_stab_tilt = new ArdupilotMega.Controls.MavlinkCheckBox();
this.CHK_stab_roll = new ArdupilotMega.Controls.MavlinkCheckBox(); this.CHK_stab_roll = new ArdupilotMega.Controls.MavlinkCheckBox();
this.CHK_stab_pan = new ArdupilotMega.Controls.MavlinkCheckBox(); this.CHK_stab_pan = new ArdupilotMega.Controls.MavlinkCheckBox();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.label35 = new System.Windows.Forms.Label();
this.label36 = new System.Windows.Forms.Label();
this.label37 = new System.Windows.Forms.Label();
this.label38 = new System.Windows.Forms.Label();
this.mavlinkNumericUpDown1 = new ArdupilotMega.Controls.MavlinkNumericUpDown();
this.mavlinkNumericUpDown2 = new ArdupilotMega.Controls.MavlinkNumericUpDown();
this.label39 = new System.Windows.Forms.Label();
this.label40 = new System.Windows.Forms.Label();
this.mavlinkNumericUpDownShutM = new ArdupilotMega.Controls.MavlinkNumericUpDown();
this.mavlinkNumericUpDownShutMX = new ArdupilotMega.Controls.MavlinkNumericUpDown();
this.label41 = new System.Windows.Forms.Label();
this.groupBox7 = new System.Windows.Forms.GroupBox();
this.pictureBox4 = new System.Windows.Forms.PictureBox();
this.label34 = new System.Windows.Forms.Label();
this.mavlinkNumericUpDown5 = new ArdupilotMega.Controls.MavlinkNumericUpDown();
this.label42 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
@ -125,7 +140,6 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDownRAMX)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDownRAMX)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDownRSM)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDownRSM)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDownRSMX)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDownRSMX)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.PBOX_WarningIcon)).BeginInit();
this.groupBox4.SuspendLayout(); this.groupBox4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.NUD_RETRACT_z)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_RETRACT_z)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_RETRACT_y)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_RETRACT_y)).BeginInit();
@ -138,6 +152,12 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
((System.ComponentModel.ISupportInitialize)(this.NUD_CONTROL_z)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_CONTROL_z)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_CONTROL_y)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_CONTROL_y)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_CONTROL_x)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_CONTROL_x)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDown1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDown2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDownShutM)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDownShutMX)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDown5)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// pictureBox1 // pictureBox1
@ -170,13 +190,11 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
// label5 // label5
// //
resources.ApplyResources(this.label5, "label5"); resources.ApplyResources(this.label5, "label5");
this.label5.ForeColor = System.Drawing.Color.WhiteSmoke;
this.label5.Name = "label5"; this.label5.Name = "label5";
// //
// label6 // label6
// //
resources.ApplyResources(this.label6, "label6"); resources.ApplyResources(this.label6, "label6");
this.label6.ForeColor = System.Drawing.Color.WhiteSmoke;
this.label6.Name = "label6"; this.label6.Name = "label6";
// //
// LNK_wiki // LNK_wiki
@ -191,7 +209,6 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
// label15 // label15
// //
resources.ApplyResources(this.label15, "label15"); resources.ApplyResources(this.label15, "label15");
this.label15.ForeColor = System.Drawing.Color.WhiteSmoke;
this.label15.Name = "label15"; this.label15.Name = "label15";
// //
// groupBox3 // groupBox3
@ -741,21 +758,6 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
this.mavlinkCheckBoxRR.ParamName = null; this.mavlinkCheckBoxRR.ParamName = null;
this.mavlinkCheckBoxRR.UseVisualStyleBackColor = true; this.mavlinkCheckBoxRR.UseVisualStyleBackColor = true;
// //
// LBL_Error
//
resources.ApplyResources(this.LBL_Error, "LBL_Error");
this.LBL_Error.DoubleBuffered = true;
this.LBL_Error.ForeColor = System.Drawing.Color.WhiteSmoke;
this.LBL_Error.Name = "LBL_Error";
//
// PBOX_WarningIcon
//
resources.ApplyResources(this.PBOX_WarningIcon, "PBOX_WarningIcon");
this.PBOX_WarningIcon.Image = global::ArdupilotMega.Properties.Resources.iconWarning32;
this.PBOX_WarningIcon.Name = "PBOX_WarningIcon";
this.PBOX_WarningIcon.Opacity = 0.5F;
this.PBOX_WarningIcon.TabStop = false;
//
// groupBox4 // groupBox4
// //
this.groupBox4.Controls.Add(this.label27); this.groupBox4.Controls.Add(this.label27);
@ -1083,9 +1085,226 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
this.CHK_stab_pan.ParamName = null; this.CHK_stab_pan.ParamName = null;
this.CHK_stab_pan.UseVisualStyleBackColor = true; this.CHK_stab_pan.UseVisualStyleBackColor = true;
// //
// comboBox1
//
this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox1.FormattingEnabled = true;
resources.ApplyResources(this.comboBox1, "comboBox1");
this.comboBox1.Name = "comboBox1";
this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.mavlinkComboBox_SelectedIndexChanged);
//
// label35
//
resources.ApplyResources(this.label35, "label35");
this.label35.Name = "label35";
//
// label36
//
resources.ApplyResources(this.label36, "label36");
this.label36.Name = "label36";
//
// label37
//
resources.ApplyResources(this.label37, "label37");
this.label37.Name = "label37";
//
// label38
//
resources.ApplyResources(this.label38, "label38");
this.label38.Name = "label38";
//
// mavlinkNumericUpDown1
//
resources.ApplyResources(this.mavlinkNumericUpDown1, "mavlinkNumericUpDown1");
this.mavlinkNumericUpDown1.Increment = new decimal(new int[] {
10,
0,
0,
0});
this.mavlinkNumericUpDown1.Max = 1F;
this.mavlinkNumericUpDown1.Maximum = new decimal(new int[] {
2200,
0,
0,
0});
this.mavlinkNumericUpDown1.Min = 0F;
this.mavlinkNumericUpDown1.Name = "mavlinkNumericUpDown1";
this.mavlinkNumericUpDown1.param = null;
this.mavlinkNumericUpDown1.ParamName = null;
this.mavlinkNumericUpDown1.Value = new decimal(new int[] {
1000,
0,
0,
0});
//
// mavlinkNumericUpDown2
//
resources.ApplyResources(this.mavlinkNumericUpDown2, "mavlinkNumericUpDown2");
this.mavlinkNumericUpDown2.Increment = new decimal(new int[] {
10,
0,
0,
0});
this.mavlinkNumericUpDown2.Max = 1F;
this.mavlinkNumericUpDown2.Maximum = new decimal(new int[] {
2200,
0,
0,
0});
this.mavlinkNumericUpDown2.Min = 0F;
this.mavlinkNumericUpDown2.Minimum = new decimal(new int[] {
800,
0,
0,
0});
this.mavlinkNumericUpDown2.Name = "mavlinkNumericUpDown2";
this.mavlinkNumericUpDown2.param = null;
this.mavlinkNumericUpDown2.ParamName = null;
this.mavlinkNumericUpDown2.Value = new decimal(new int[] {
2000,
0,
0,
0});
//
// label39
//
resources.ApplyResources(this.label39, "label39");
this.label39.Name = "label39";
//
// label40
//
resources.ApplyResources(this.label40, "label40");
this.label40.Name = "label40";
//
// mavlinkNumericUpDownShutM
//
resources.ApplyResources(this.mavlinkNumericUpDownShutM, "mavlinkNumericUpDownShutM");
this.mavlinkNumericUpDownShutM.Increment = new decimal(new int[] {
10,
0,
0,
0});
this.mavlinkNumericUpDownShutM.Max = 1F;
this.mavlinkNumericUpDownShutM.Maximum = new decimal(new int[] {
2200,
0,
0,
0});
this.mavlinkNumericUpDownShutM.Min = 0F;
this.mavlinkNumericUpDownShutM.Minimum = new decimal(new int[] {
800,
0,
0,
0});
this.mavlinkNumericUpDownShutM.Name = "mavlinkNumericUpDownShutM";
this.mavlinkNumericUpDownShutM.param = null;
this.mavlinkNumericUpDownShutM.ParamName = null;
this.mavlinkNumericUpDownShutM.Value = new decimal(new int[] {
1000,
0,
0,
0});
//
// mavlinkNumericUpDownShutMX
//
resources.ApplyResources(this.mavlinkNumericUpDownShutMX, "mavlinkNumericUpDownShutMX");
this.mavlinkNumericUpDownShutMX.Increment = new decimal(new int[] {
10,
0,
0,
0});
this.mavlinkNumericUpDownShutMX.Max = 1F;
this.mavlinkNumericUpDownShutMX.Maximum = new decimal(new int[] {
2200,
0,
0,
0});
this.mavlinkNumericUpDownShutMX.Min = 0F;
this.mavlinkNumericUpDownShutMX.Minimum = new decimal(new int[] {
800,
0,
0,
0});
this.mavlinkNumericUpDownShutMX.Name = "mavlinkNumericUpDownShutMX";
this.mavlinkNumericUpDownShutMX.param = null;
this.mavlinkNumericUpDownShutMX.ParamName = null;
this.mavlinkNumericUpDownShutMX.Value = new decimal(new int[] {
2000,
0,
0,
0});
//
// label41
//
resources.ApplyResources(this.label41, "label41");
this.label41.Name = "label41";
//
// groupBox7
//
resources.ApplyResources(this.groupBox7, "groupBox7");
this.groupBox7.Name = "groupBox7";
this.groupBox7.TabStop = false;
//
// pictureBox4
//
this.pictureBox4.BackgroundImage = global::ArdupilotMega.Properties.Resources.cameraGimalYaw;
resources.ApplyResources(this.pictureBox4, "pictureBox4");
this.pictureBox4.Name = "pictureBox4";
this.pictureBox4.TabStop = false;
//
// label34
//
resources.ApplyResources(this.label34, "label34");
this.label34.Name = "label34";
//
// mavlinkNumericUpDown5
//
resources.ApplyResources(this.mavlinkNumericUpDown5, "mavlinkNumericUpDown5");
this.mavlinkNumericUpDown5.Increment = new decimal(new int[] {
10,
0,
0,
0});
this.mavlinkNumericUpDown5.Max = 1F;
this.mavlinkNumericUpDown5.Min = 0F;
this.mavlinkNumericUpDown5.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.mavlinkNumericUpDown5.Name = "mavlinkNumericUpDown5";
this.mavlinkNumericUpDown5.param = null;
this.mavlinkNumericUpDown5.ParamName = null;
this.mavlinkNumericUpDown5.Value = new decimal(new int[] {
20,
0,
0,
0});
//
// label42
//
resources.ApplyResources(this.label42, "label42");
this.label42.Name = "label42";
//
// ConfigMount // ConfigMount
// //
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(44)))), ((int)(((byte)(45))))); this.Controls.Add(this.label42);
this.Controls.Add(this.label34);
this.Controls.Add(this.mavlinkNumericUpDown5);
this.Controls.Add(this.comboBox1);
this.Controls.Add(this.label35);
this.Controls.Add(this.label36);
this.Controls.Add(this.label37);
this.Controls.Add(this.label38);
this.Controls.Add(this.mavlinkNumericUpDown1);
this.Controls.Add(this.mavlinkNumericUpDown2);
this.Controls.Add(this.label39);
this.Controls.Add(this.label40);
this.Controls.Add(this.mavlinkNumericUpDownShutM);
this.Controls.Add(this.mavlinkNumericUpDownShutMX);
this.Controls.Add(this.label41);
this.Controls.Add(this.groupBox7);
this.Controls.Add(this.pictureBox4);
this.Controls.Add(this.CHK_stab_pan); this.Controls.Add(this.CHK_stab_pan);
this.Controls.Add(this.CHK_stab_roll); this.Controls.Add(this.CHK_stab_roll);
this.Controls.Add(this.CHK_stab_tilt); this.Controls.Add(this.CHK_stab_tilt);
@ -1138,8 +1357,6 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
this.Controls.Add(this.groupBox3); this.Controls.Add(this.groupBox3);
this.Controls.Add(this.pictureBox3); this.Controls.Add(this.pictureBox3);
this.Controls.Add(this.LNK_wiki); this.Controls.Add(this.LNK_wiki);
this.Controls.Add(this.LBL_Error);
this.Controls.Add(this.PBOX_WarningIcon);
this.Controls.Add(this.label6); this.Controls.Add(this.label6);
this.Controls.Add(this.label5); this.Controls.Add(this.label5);
this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox2);
@ -1163,7 +1380,6 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDownRAMX)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDownRAMX)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDownRSM)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDownRSM)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDownRSMX)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDownRSMX)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.PBOX_WarningIcon)).EndInit();
this.groupBox4.ResumeLayout(false); this.groupBox4.ResumeLayout(false);
this.groupBox4.PerformLayout(); this.groupBox4.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.NUD_RETRACT_z)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_RETRACT_z)).EndInit();
@ -1179,6 +1395,12 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
((System.ComponentModel.ISupportInitialize)(this.NUD_CONTROL_z)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_CONTROL_z)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_CONTROL_y)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_CONTROL_y)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_CONTROL_x)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_CONTROL_x)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDown1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDown2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDownShutM)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDownShutMX)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.mavlinkNumericUpDown5)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@ -1192,8 +1414,6 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Label label6; private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label5;
private PictureBoxWithPseudoOpacity PBOX_WarningIcon;
private LabelWithPseudoOpacity LBL_Error;
private System.Windows.Forms.LinkLabel LNK_wiki; private System.Windows.Forms.LinkLabel LNK_wiki;
private System.Windows.Forms.Label label15; private System.Windows.Forms.Label label15;
private System.Windows.Forms.GroupBox groupBox3; private System.Windows.Forms.GroupBox groupBox3;
@ -1264,6 +1484,23 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
private MavlinkCheckBox CHK_stab_tilt; private MavlinkCheckBox CHK_stab_tilt;
private MavlinkCheckBox CHK_stab_roll; private MavlinkCheckBox CHK_stab_roll;
private MavlinkCheckBox CHK_stab_pan; private MavlinkCheckBox CHK_stab_pan;
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.Label label35;
private System.Windows.Forms.Label label36;
private System.Windows.Forms.Label label37;
private System.Windows.Forms.Label label38;
private MavlinkNumericUpDown mavlinkNumericUpDown1;
private MavlinkNumericUpDown mavlinkNumericUpDown2;
private System.Windows.Forms.Label label39;
private System.Windows.Forms.Label label40;
private MavlinkNumericUpDown mavlinkNumericUpDownShutM;
private MavlinkNumericUpDown mavlinkNumericUpDownShutMX;
private System.Windows.Forms.Label label41;
private System.Windows.Forms.GroupBox groupBox7;
private System.Windows.Forms.PictureBox pictureBox4;
private System.Windows.Forms.Label label34;
private MavlinkNumericUpDown mavlinkNumericUpDown5;
private System.Windows.Forms.Label label42;
} }
} }

View File

@ -332,10 +332,10 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
if (startup) if (startup)
return; return;
MainV2.config[((ComboBox)sender).Name] = ((ComboBox)sender).Text; MainV2.config[((ComboBox)sender).Name] = ((ComboBox)sender).Text;
MainV2.cs.rateattitude = byte.Parse(((ComboBox)sender).Text); MainV2.comPort.MAV.cs.rateattitude = byte.Parse(((ComboBox)sender).Text);
MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.EXTRA1, MainV2.cs.rateattitude); // request attitude MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.EXTRA1, MainV2.comPort.MAV.cs.rateattitude); // request attitude
MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.EXTRA2, MainV2.cs.rateattitude); // request vfr MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.EXTRA2, MainV2.comPort.MAV.cs.rateattitude); // request vfr
} }
private void CMB_rateposition_SelectedIndexChanged(object sender, EventArgs e) private void CMB_rateposition_SelectedIndexChanged(object sender, EventArgs e)
@ -343,9 +343,9 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
if (startup) if (startup)
return; return;
MainV2.config[((ComboBox)sender).Name] = ((ComboBox)sender).Text; MainV2.config[((ComboBox)sender).Name] = ((ComboBox)sender).Text;
MainV2.cs.rateposition = byte.Parse(((ComboBox)sender).Text); MainV2.comPort.MAV.cs.rateposition = byte.Parse(((ComboBox)sender).Text);
MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.POSITION, MainV2.cs.rateposition); // request gps MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.POSITION, MainV2.comPort.MAV.cs.rateposition); // request gps
} }
private void CMB_ratestatus_SelectedIndexChanged(object sender, EventArgs e) private void CMB_ratestatus_SelectedIndexChanged(object sender, EventArgs e)
@ -353,9 +353,9 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
if (startup) if (startup)
return; return;
MainV2.config[((ComboBox)sender).Name] = ((ComboBox)sender).Text; MainV2.config[((ComboBox)sender).Name] = ((ComboBox)sender).Text;
MainV2.cs.ratestatus = byte.Parse(((ComboBox)sender).Text); MainV2.comPort.MAV.cs.ratestatus = byte.Parse(((ComboBox)sender).Text);
MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.EXTENDED_STATUS, MainV2.cs.ratestatus); // mode MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.EXTENDED_STATUS, MainV2.comPort.MAV.cs.ratestatus); // mode
} }
private void CMB_raterc_SelectedIndexChanged(object sender, EventArgs e) private void CMB_raterc_SelectedIndexChanged(object sender, EventArgs e)
@ -363,9 +363,9 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
if (startup) if (startup)
return; return;
MainV2.config[((ComboBox)sender).Name] = ((ComboBox)sender).Text; MainV2.config[((ComboBox)sender).Name] = ((ComboBox)sender).Text;
MainV2.cs.raterc = byte.Parse(((ComboBox)sender).Text); MainV2.comPort.MAV.cs.raterc = byte.Parse(((ComboBox)sender).Text);
MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.RC_CHANNELS, MainV2.cs.raterc); // request rc info MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.RC_CHANNELS, MainV2.comPort.MAV.cs.raterc); // request rc info
} }
private void CMB_ratesensors_SelectedIndexChanged(object sender, EventArgs e) private void CMB_ratesensors_SelectedIndexChanged(object sender, EventArgs e)
@ -373,10 +373,10 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
if (startup) if (startup)
return; return;
MainV2.config[((ComboBox)sender).Name] = ((ComboBox)sender).Text; MainV2.config[((ComboBox)sender).Name] = ((ComboBox)sender).Text;
MainV2.cs.ratesensors = byte.Parse(((ComboBox)sender).Text); MainV2.comPort.MAV.cs.ratesensors = byte.Parse(((ComboBox)sender).Text);
MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.EXTRA3, MainV2.cs.ratesensors); // request extra stuff - tridge MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.EXTRA3, MainV2.comPort.MAV.cs.ratesensors); // request extra stuff - tridge
MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.RAW_SENSORS, MainV2.cs.ratesensors); // request raw sensor MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.RAW_SENSORS, MainV2.comPort.MAV.cs.ratesensors); // request raw sensor
} }
private void CHK_mavdebug_CheckedChanged(object sender, EventArgs e) private void CHK_mavdebug_CheckedChanged(object sender, EventArgs e)
@ -407,7 +407,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
if (MainV2.config["speechaltheight"] != null) if (MainV2.config["speechaltheight"] != null)
speechstring = MainV2.config["speechaltheight"].ToString(); speechstring = MainV2.config["speechaltheight"].ToString();
Common.InputBox("Min Alt", "What altitude do you want to warn at? (relative to home)", ref speechstring); Common.InputBox("Min Alt", "What altitude do you want to warn at? (relative to home)", ref speechstring);
MainV2.config["speechaltheight"] = (double.Parse(speechstring) / MainV2.cs.multiplierdist).ToString(); // save as m MainV2.config["speechaltheight"] = (double.Parse(speechstring) / MainV2.comPort.MAV.cs.multiplierdist).ToString(); // save as m
} }
} }
@ -555,11 +555,11 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
// setup other config state // setup other config state
SetCheckboxFromConfig("CHK_resetapmonconnect", CHK_resetapmonconnect); SetCheckboxFromConfig("CHK_resetapmonconnect", CHK_resetapmonconnect);
CMB_rateattitude.Text = MainV2.cs.rateattitude.ToString(); CMB_rateattitude.Text = MainV2.comPort.MAV.cs.rateattitude.ToString();
CMB_rateposition.Text = MainV2.cs.rateposition.ToString(); CMB_rateposition.Text = MainV2.comPort.MAV.cs.rateposition.ToString();
CMB_raterc.Text = MainV2.cs.raterc.ToString(); CMB_raterc.Text = MainV2.comPort.MAV.cs.raterc.ToString();
CMB_ratestatus.Text = MainV2.cs.ratestatus.ToString(); CMB_ratestatus.Text = MainV2.comPort.MAV.cs.ratestatus.ToString();
CMB_ratesensors.Text = MainV2.cs.ratesensors.ToString(); CMB_ratesensors.Text = MainV2.comPort.MAV.cs.ratesensors.ToString();
SetCheckboxFromConfig("CHK_GDIPlus", CHK_GDIPlus); SetCheckboxFromConfig("CHK_GDIPlus", CHK_GDIPlus);
SetCheckboxFromConfig("CHK_maprotation", CHK_maprotation); SetCheckboxFromConfig("CHK_maprotation", CHK_maprotation);

View File

@ -48,7 +48,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
// update all linked controls - 10hz // update all linked controls - 10hz
try try
{ {
MainV2.cs.UpdateCurrentSettings(currentStateBindingSource); MainV2.comPort.MAV.cs.UpdateCurrentSettings(currentStateBindingSource);
} }
catch { } catch { }
} }
@ -61,14 +61,14 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
startup = true; startup = true;
if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane)
{ {
try try
{ {
CHK_mixmode.Checked = MainV2.comPort.param["ELEVON_MIXING"].ToString() == "1"; CHK_mixmode.Checked = MainV2.comPort.MAV.param["ELEVON_MIXING"].ToString() == "1";
CHK_elevonrev.Checked = MainV2.comPort.param["ELEVON_REVERSE"].ToString() == "1"; CHK_elevonrev.Checked = MainV2.comPort.MAV.param["ELEVON_REVERSE"].ToString() == "1";
CHK_elevonch1rev.Checked = MainV2.comPort.param["ELEVON_CH1_REV"].ToString() == "1"; CHK_elevonch1rev.Checked = MainV2.comPort.MAV.param["ELEVON_CH1_REV"].ToString() == "1";
CHK_elevonch2rev.Checked = MainV2.comPort.param["ELEVON_CH2_REV"].ToString() == "1"; CHK_elevonch2rev.Checked = MainV2.comPort.MAV.param["ELEVON_CH2_REV"].ToString() == "1";
} }
catch { } // this will fail on arducopter catch { } // this will fail on arducopter
} }
@ -76,7 +76,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
{ {
groupBoxElevons.Visible = false; groupBoxElevons.Visible = false;
if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduCopter2)
{ {
CHK_revch1.Visible = false; CHK_revch1.Visible = false;
CHK_revch2.Visible = false; CHK_revch2.Visible = false;
@ -86,10 +86,10 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
} }
try try
{ {
CHK_revch1.Checked = MainV2.comPort.param["RC1_REV"].ToString() == "-1"; CHK_revch1.Checked = MainV2.comPort.MAV.param["RC1_REV"].ToString() == "-1";
CHK_revch2.Checked = MainV2.comPort.param["RC2_REV"].ToString() == "-1"; CHK_revch2.Checked = MainV2.comPort.MAV.param["RC2_REV"].ToString() == "-1";
CHK_revch3.Checked = MainV2.comPort.param["RC3_REV"].ToString() == "-1"; CHK_revch3.Checked = MainV2.comPort.MAV.param["RC3_REV"].ToString() == "-1";
CHK_revch4.Checked = MainV2.comPort.param["RC4_REV"].ToString() == "-1"; CHK_revch4.Checked = MainV2.comPort.MAV.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; startup = false;
@ -106,15 +106,15 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
CustomMessageBox.Show("Ensure your transmitter is on and receiver is powered and connected\nEnsure your motor does not have power/no props!!!"); CustomMessageBox.Show("Ensure your transmitter is on and receiver is powered and connected\nEnsure your motor does not have power/no props!!!");
byte oldrc = MainV2.cs.raterc; byte oldrc = MainV2.comPort.MAV.cs.raterc;
byte oldatt = MainV2.cs.rateattitude; byte oldatt = MainV2.comPort.MAV.cs.rateattitude;
byte oldpos = MainV2.cs.rateposition; byte oldpos = MainV2.comPort.MAV.cs.rateposition;
byte oldstatus = MainV2.cs.ratestatus; byte oldstatus = MainV2.comPort.MAV.cs.ratestatus;
MainV2.cs.raterc = 10; MainV2.comPort.MAV.cs.raterc = 10;
MainV2.cs.rateattitude = 0; MainV2.comPort.MAV.cs.rateattitude = 0;
MainV2.cs.rateposition = 0; MainV2.comPort.MAV.cs.rateposition = 0;
MainV2.cs.ratestatus = 0; MainV2.comPort.MAV.cs.ratestatus = 0;
try try
{ {
@ -135,34 +135,34 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
System.Threading.Thread.Sleep(5); System.Threading.Thread.Sleep(5);
MainV2.cs.UpdateCurrentSettings(currentStateBindingSource, true, MainV2.comPort); MainV2.comPort.MAV.cs.UpdateCurrentSettings(currentStateBindingSource, true, MainV2.comPort);
// check for non 0 values // check for non 0 values
if (MainV2.cs.ch1in > 800 && MainV2.cs.ch1in < 2200) if (MainV2.comPort.MAV.cs.ch1in > 800 && MainV2.comPort.MAV.cs.ch1in < 2200)
{ {
rcmin[0] = Math.Min(rcmin[0], MainV2.cs.ch1in); rcmin[0] = Math.Min(rcmin[0], MainV2.comPort.MAV.cs.ch1in);
rcmax[0] = Math.Max(rcmax[0], MainV2.cs.ch1in); rcmax[0] = Math.Max(rcmax[0], MainV2.comPort.MAV.cs.ch1in);
rcmin[1] = Math.Min(rcmin[1], MainV2.cs.ch2in); rcmin[1] = Math.Min(rcmin[1], MainV2.comPort.MAV.cs.ch2in);
rcmax[1] = Math.Max(rcmax[1], MainV2.cs.ch2in); rcmax[1] = Math.Max(rcmax[1], MainV2.comPort.MAV.cs.ch2in);
rcmin[2] = Math.Min(rcmin[2], MainV2.cs.ch3in); rcmin[2] = Math.Min(rcmin[2], MainV2.comPort.MAV.cs.ch3in);
rcmax[2] = Math.Max(rcmax[2], MainV2.cs.ch3in); rcmax[2] = Math.Max(rcmax[2], MainV2.comPort.MAV.cs.ch3in);
rcmin[3] = Math.Min(rcmin[3], MainV2.cs.ch4in); rcmin[3] = Math.Min(rcmin[3], MainV2.comPort.MAV.cs.ch4in);
rcmax[3] = Math.Max(rcmax[3], MainV2.cs.ch4in); rcmax[3] = Math.Max(rcmax[3], MainV2.comPort.MAV.cs.ch4in);
rcmin[4] = Math.Min(rcmin[4], MainV2.cs.ch5in); rcmin[4] = Math.Min(rcmin[4], MainV2.comPort.MAV.cs.ch5in);
rcmax[4] = Math.Max(rcmax[4], MainV2.cs.ch5in); rcmax[4] = Math.Max(rcmax[4], MainV2.comPort.MAV.cs.ch5in);
rcmin[5] = Math.Min(rcmin[5], MainV2.cs.ch6in); rcmin[5] = Math.Min(rcmin[5], MainV2.comPort.MAV.cs.ch6in);
rcmax[5] = Math.Max(rcmax[5], MainV2.cs.ch6in); rcmax[5] = Math.Max(rcmax[5], MainV2.comPort.MAV.cs.ch6in);
rcmin[6] = Math.Min(rcmin[6], MainV2.cs.ch7in); rcmin[6] = Math.Min(rcmin[6], MainV2.comPort.MAV.cs.ch7in);
rcmax[6] = Math.Max(rcmax[6], MainV2.cs.ch7in); rcmax[6] = Math.Max(rcmax[6], MainV2.comPort.MAV.cs.ch7in);
rcmin[7] = Math.Min(rcmin[7], MainV2.cs.ch8in); rcmin[7] = Math.Min(rcmin[7], MainV2.comPort.MAV.cs.ch8in);
rcmax[7] = Math.Max(rcmax[7], MainV2.cs.ch8in); rcmax[7] = Math.Max(rcmax[7], MainV2.comPort.MAV.cs.ch8in);
BARroll.minline = (int)rcmin[0]; BARroll.minline = (int)rcmin[0];
BARroll.maxline = (int)rcmax[0]; BARroll.maxline = (int)rcmax[0];
@ -193,16 +193,16 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
CustomMessageBox.Show("Ensure all your sticks are centered and throttle is down, and click ok to continue"); CustomMessageBox.Show("Ensure all your sticks are centered and throttle is down, and click ok to continue");
MainV2.cs.UpdateCurrentSettings(currentStateBindingSource, true, MainV2.comPort); MainV2.comPort.MAV.cs.UpdateCurrentSettings(currentStateBindingSource, true, MainV2.comPort);
rctrim[0] = MainV2.cs.ch1in; rctrim[0] = MainV2.comPort.MAV.cs.ch1in;
rctrim[1] = MainV2.cs.ch2in; rctrim[1] = MainV2.comPort.MAV.cs.ch2in;
rctrim[2] = MainV2.cs.ch3in; rctrim[2] = MainV2.comPort.MAV.cs.ch3in;
rctrim[3] = MainV2.cs.ch4in; rctrim[3] = MainV2.comPort.MAV.cs.ch4in;
rctrim[4] = MainV2.cs.ch5in; rctrim[4] = MainV2.comPort.MAV.cs.ch5in;
rctrim[5] = MainV2.cs.ch6in; rctrim[5] = MainV2.comPort.MAV.cs.ch6in;
rctrim[6] = MainV2.cs.ch7in; rctrim[6] = MainV2.comPort.MAV.cs.ch7in;
rctrim[7] = MainV2.cs.ch8in; rctrim[7] = MainV2.comPort.MAV.cs.ch8in;
string data = "---------------\n"; string data = "---------------\n";
@ -225,10 +225,10 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
data = data + "CH" + (a + 1) + " " + rcmin[a] + " | " + rcmax[a] + "\n"; data = data + "CH" + (a + 1) + " " + rcmin[a] + " | " + rcmax[a] + "\n";
} }
MainV2.cs.raterc = oldrc; MainV2.comPort.MAV.cs.raterc = oldrc;
MainV2.cs.rateattitude = oldatt; MainV2.comPort.MAV.cs.rateattitude = oldatt;
MainV2.cs.rateposition = oldpos; MainV2.comPort.MAV.cs.rateposition = oldpos;
MainV2.cs.ratestatus = oldstatus; MainV2.comPort.MAV.cs.ratestatus = oldstatus;
try try
{ {
@ -249,9 +249,9 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
return; return;
try try
{ {
if (MainV2.comPort.param["ELEVON_MIXING"] == null) if (MainV2.comPort.MAV.param["ELEVON_MIXING"] == null)
{ {
CustomMessageBox.Show("Not Available on " + MainV2.cs.firmware.ToString()); CustomMessageBox.Show("Not Available on " + MainV2.comPort.MAV.cs.firmware.ToString());
} }
else else
{ {
@ -267,9 +267,9 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
return; return;
try try
{ {
if (MainV2.comPort.param["ELEVON_REVERSE"] == null) if (MainV2.comPort.MAV.param["ELEVON_REVERSE"] == null)
{ {
CustomMessageBox.Show("Not Available on " + MainV2.cs.firmware.ToString()); CustomMessageBox.Show("Not Available on " + MainV2.comPort.MAV.cs.firmware.ToString());
} }
else else
{ {
@ -285,9 +285,9 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
return; return;
try try
{ {
if (MainV2.comPort.param["ELEVON_CH1_REV"] == null) if (MainV2.comPort.MAV.param["ELEVON_CH1_REV"] == null)
{ {
CustomMessageBox.Show("Not Available on " + MainV2.cs.firmware.ToString()); CustomMessageBox.Show("Not Available on " + MainV2.comPort.MAV.cs.firmware.ToString());
} }
else else
{ {
@ -303,9 +303,9 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
return; return;
try try
{ {
if (MainV2.comPort.param["ELEVON_CH2_REV"] == null) if (MainV2.comPort.MAV.param["ELEVON_CH2_REV"] == null)
{ {
CustomMessageBox.Show("Not Available on " + MainV2.cs.firmware.ToString()); CustomMessageBox.Show("Not Available on " + MainV2.comPort.MAV.cs.firmware.ToString());
} }
else else
{ {
@ -352,7 +352,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
if (startup) if (startup)
return; return;
if (MainV2.comPort.param["SWITCH_ENABLE"] != null && (float)MainV2.comPort.param["SWITCH_ENABLE"] == 1) if (MainV2.comPort.MAV.param["SWITCH_ENABLE"] != null && (float)MainV2.comPort.MAV.param["SWITCH_ENABLE"] == 1)
{ {
try try
{ {

View File

@ -31,6 +31,7 @@
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConfigRawParams)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConfigRawParams));
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
this.BUT_compare = new ArdupilotMega.Controls.MyButton(); this.BUT_compare = new ArdupilotMega.Controls.MyButton();
this.BUT_rerequestparams = new ArdupilotMega.Controls.MyButton(); this.BUT_rerequestparams = new ArdupilotMega.Controls.MyButton();
@ -38,11 +39,13 @@
this.BUT_save = new ArdupilotMega.Controls.MyButton(); this.BUT_save = new ArdupilotMega.Controls.MyButton();
this.BUT_load = new ArdupilotMega.Controls.MyButton(); this.BUT_load = new ArdupilotMega.Controls.MyButton();
this.Params = new System.Windows.Forms.DataGridView(); this.Params = new System.Windows.Forms.DataGridView();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.label1 = new System.Windows.Forms.Label();
this.Command = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Command = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Value = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Value = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Units = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Options = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Desc = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Desc = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.label1 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.Params)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.Params)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
@ -86,6 +89,7 @@
this.Params.AllowUserToAddRows = false; this.Params.AllowUserToAddRows = false;
this.Params.AllowUserToDeleteRows = false; this.Params.AllowUserToDeleteRows = false;
resources.ApplyResources(this.Params, "Params"); resources.ApplyResources(this.Params, "Params");
this.Params.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.Maroon; dataGridViewCellStyle1.BackColor = System.Drawing.Color.Maroon;
dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
@ -98,30 +102,22 @@
this.Params.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.Params.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Command, this.Command,
this.Value, this.Value,
this.Units,
this.Options,
this.Desc}); this.Desc});
this.Params.Name = "Params"; this.Params.Name = "Params";
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.ActiveCaption; dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.ActiveCaption;
dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.Params.RowHeadersDefaultCellStyle = dataGridViewCellStyle2; this.Params.RowHeadersDefaultCellStyle = dataGridViewCellStyle3;
this.Params.RowHeadersVisible = false; this.Params.RowHeadersVisible = false;
this.Params.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToDisplayedHeaders;
this.Params.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.Params_CellValueChanged); this.Params.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.Params_CellValueChanged);
// //
// toolTip1
//
this.toolTip1.AutoPopDelay = 180000;
this.toolTip1.InitialDelay = 500;
this.toolTip1.ReshowDelay = 100;
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// Command // Command
// //
resources.ApplyResources(this.Command, "Command"); resources.ApplyResources(this.Command, "Command");
@ -133,13 +129,38 @@
resources.ApplyResources(this.Value, "Value"); resources.ApplyResources(this.Value, "Value");
this.Value.Name = "Value"; this.Value.Name = "Value";
// //
// Units
//
resources.ApplyResources(this.Units, "Units");
this.Units.Name = "Units";
this.Units.ReadOnly = true;
//
// Options
//
resources.ApplyResources(this.Options, "Options");
this.Options.Name = "Options";
this.Options.ReadOnly = true;
//
// Desc // Desc
// //
this.Desc.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; this.Desc.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.Desc.DefaultCellStyle = dataGridViewCellStyle2;
resources.ApplyResources(this.Desc, "Desc"); resources.ApplyResources(this.Desc, "Desc");
this.Desc.Name = "Desc"; this.Desc.Name = "Desc";
this.Desc.ReadOnly = true; this.Desc.ReadOnly = true;
// //
// toolTip1
//
this.toolTip1.AutoPopDelay = 180000;
this.toolTip1.InitialDelay = 500;
this.toolTip1.ReshowDelay = 100;
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// ConfigRawParams // ConfigRawParams
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
@ -170,6 +191,8 @@
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.DataGridViewTextBoxColumn Command; private System.Windows.Forms.DataGridViewTextBoxColumn Command;
private System.Windows.Forms.DataGridViewTextBoxColumn Value; private System.Windows.Forms.DataGridViewTextBoxColumn Value;
private System.Windows.Forms.DataGridViewTextBoxColumn Units;
private System.Windows.Forms.DataGridViewTextBoxColumn Options;
private System.Windows.Forms.DataGridViewTextBoxColumn Desc; private System.Windows.Forms.DataGridViewTextBoxColumn Desc;
} }
} }

View File

@ -172,7 +172,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
{ {
StreamWriter sw = new StreamWriter(sfd.OpenFile()); StreamWriter sw = new StreamWriter(sfd.OpenFile());
string input = DateTime.Now + " Frame : "; string input = DateTime.Now + " Frame : ";
if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane)
{ {
input = DateTime.Now + " Plane: Skywalker"; input = DateTime.Now + " Plane: Skywalker";
} }
@ -254,7 +254,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
{ {
param2 = loadParamFile(ofd.FileName); param2 = loadParamFile(ofd.FileName);
Form paramCompareForm = new ParamCompare(Params, MainV2.comPort.param, param2); Form paramCompareForm = new ParamCompare(Params, MainV2.comPort.MAV.param, param2);
ThemeManager.ApplyThemeTo(paramCompareForm); ThemeManager.ApplyThemeTo(paramCompareForm);
paramCompareForm.ShowDialog(); paramCompareForm.ShowDialog();
@ -385,7 +385,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
Params.Rows.Clear(); Params.Rows.Clear();
// process hashdefines and update display // process hashdefines and update display
foreach (string value in MainV2.comPort.param.Keys) foreach (string value in MainV2.comPort.MAV.param.Keys)
{ {
if (value == null || value == "") if (value == null || value == "")
continue; continue;
@ -394,7 +394,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
Params.Rows.Add(); Params.Rows.Add();
Params.Rows[Params.RowCount - 1].Cells[Command.Index].Value = value; Params.Rows[Params.RowCount - 1].Cells[Command.Index].Value = value;
Params.Rows[Params.RowCount - 1].Cells[Value.Index].Value = ((float)MainV2.comPort.param[value]).ToString("0.###"); Params.Rows[Params.RowCount - 1].Cells[Value.Index].Value = ((float)MainV2.comPort.MAV.param[value]).ToString("0.###");
try try
{ {
string metaDataDescription = _parameterMetaDataRepository.GetParameterMetaData(value, ParameterMetaDataConstants.Description); string metaDataDescription = _parameterMetaDataRepository.GetParameterMetaData(value, ParameterMetaDataConstants.Description);
@ -405,27 +405,20 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
string range = _parameterMetaDataRepository.GetParameterMetaData(value, ParameterMetaDataConstants.Range); string range = _parameterMetaDataRepository.GetParameterMetaData(value, ParameterMetaDataConstants.Range);
string options = _parameterMetaDataRepository.GetParameterMetaData(value, ParameterMetaDataConstants.Values); string options = _parameterMetaDataRepository.GetParameterMetaData(value, ParameterMetaDataConstants.Values);
string units = _parameterMetaDataRepository.GetParameterMetaData(value, ParameterMetaDataConstants.Units);
if (!string.IsNullOrEmpty(range)) Params.Rows[Params.RowCount - 1].Cells[Units.Index].Value = units;
{ Params.Rows[Params.RowCount - 1].Cells[Options.Index].Value = range + options;
range = " Range: " + range; Params.Rows[Params.RowCount - 1].Cells[Desc.Index].Value = metaDataDescription;
}
if (!string.IsNullOrEmpty(options))
{
options = " Options: " + options;
}
Params.Rows[Params.RowCount - 1].Cells[Desc.Index].Value = range + options;
} }
else if (tooltips[value] != null) else if (tooltips[value] != null)
{ {
Params.Rows[Params.RowCount - 1].Cells[Command.Index].ToolTipText = ((paramsettings)tooltips[value]).desc; //Params.Rows[Params.RowCount - 1].Cells[Command.Index].ToolTipText = ((paramsettings)tooltips[value]).desc;
//Params.Rows[Params.RowCount - 1].Cells[RawValue.Index].ToolTipText = ((paramsettings)tooltips[value]).desc; //Params.Rows[Params.RowCount - 1].Cells[RawValue.Index].ToolTipText = ((paramsettings)tooltips[value]).desc;
Params.Rows[Params.RowCount - 1].Cells[Value.Index].ToolTipText = ((paramsettings)tooltips[value]).desc; // Params.Rows[Params.RowCount - 1].Cells[Value.Index].ToolTipText = ((paramsettings)tooltips[value]).desc;
Params.Rows[Params.RowCount - 1].Cells[Desc.Index].Value = "Old: "+((paramsettings)tooltips[value]).desc; // Params.Rows[Params.RowCount - 1].Cells[Desc.Index].Value = "Old: "+((paramsettings)tooltips[value]).desc;
//Params.Rows[Params.RowCount - 1].Cells[Default.Index].Value = ((paramsettings)tooltips[value]).normalvalue; //Params.Rows[Params.RowCount - 1].Cells[Default.Index].Value = ((paramsettings)tooltips[value]).normalvalue;
//Params.Rows[Params.RowCount - 1].Cells[mavScale.Index].Value = ((paramsettings)tooltips[value]).scale; //Params.Rows[Params.RowCount - 1].Cells[mavScale.Index].Value = ((paramsettings)tooltips[value]).scale;

View File

@ -126,7 +126,7 @@
</data> </data>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="BUT_compare.Location" type="System.Drawing.Point, System.Drawing"> <data name="BUT_compare.Location" type="System.Drawing.Point, System.Drawing">
<value>506, 119</value> <value>631, 119</value>
</data> </data>
<data name="BUT_compare.Size" type="System.Drawing.Size, System.Drawing"> <data name="BUT_compare.Size" type="System.Drawing.Size, System.Drawing">
<value>103, 19</value> <value>103, 19</value>
@ -142,7 +142,7 @@
<value>BUT_compare</value> <value>BUT_compare</value>
</data> </data>
<data name="&gt;&gt;BUT_compare.Type" xml:space="preserve"> <data name="&gt;&gt;BUT_compare.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4711.17948, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4724.30400, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;BUT_compare.Parent" xml:space="preserve"> <data name="&gt;&gt;BUT_compare.Parent" xml:space="preserve">
<value>$this</value> <value>$this</value>
@ -157,7 +157,7 @@
<value>NoControl</value> <value>NoControl</value>
</data> </data>
<data name="BUT_rerequestparams.Location" type="System.Drawing.Point, System.Drawing"> <data name="BUT_rerequestparams.Location" type="System.Drawing.Point, System.Drawing">
<value>506, 94</value> <value>631, 94</value>
</data> </data>
<data name="BUT_rerequestparams.Size" type="System.Drawing.Size, System.Drawing"> <data name="BUT_rerequestparams.Size" type="System.Drawing.Size, System.Drawing">
<value>103, 19</value> <value>103, 19</value>
@ -172,7 +172,7 @@
<value>BUT_rerequestparams</value> <value>BUT_rerequestparams</value>
</data> </data>
<data name="&gt;&gt;BUT_rerequestparams.Type" xml:space="preserve"> <data name="&gt;&gt;BUT_rerequestparams.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4711.17948, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4724.30400, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;BUT_rerequestparams.Parent" xml:space="preserve"> <data name="&gt;&gt;BUT_rerequestparams.Parent" xml:space="preserve">
<value>$this</value> <value>$this</value>
@ -187,7 +187,7 @@
<value>NoControl</value> <value>NoControl</value>
</data> </data>
<data name="BUT_writePIDS.Location" type="System.Drawing.Point, System.Drawing"> <data name="BUT_writePIDS.Location" type="System.Drawing.Point, System.Drawing">
<value>506, 69</value> <value>631, 69</value>
</data> </data>
<data name="BUT_writePIDS.Size" type="System.Drawing.Size, System.Drawing"> <data name="BUT_writePIDS.Size" type="System.Drawing.Size, System.Drawing">
<value>103, 19</value> <value>103, 19</value>
@ -202,7 +202,7 @@
<value>BUT_writePIDS</value> <value>BUT_writePIDS</value>
</data> </data>
<data name="&gt;&gt;BUT_writePIDS.Type" xml:space="preserve"> <data name="&gt;&gt;BUT_writePIDS.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4711.17948, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4724.30400, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;BUT_writePIDS.Parent" xml:space="preserve"> <data name="&gt;&gt;BUT_writePIDS.Parent" xml:space="preserve">
<value>$this</value> <value>$this</value>
@ -217,7 +217,7 @@
<value>NoControl</value> <value>NoControl</value>
</data> </data>
<data name="BUT_save.Location" type="System.Drawing.Point, System.Drawing"> <data name="BUT_save.Location" type="System.Drawing.Point, System.Drawing">
<value>506, 35</value> <value>631, 35</value>
</data> </data>
<data name="BUT_save.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms"> <data name="BUT_save.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 0, 0</value> <value>0, 0, 0, 0</value>
@ -235,7 +235,7 @@
<value>BUT_save</value> <value>BUT_save</value>
</data> </data>
<data name="&gt;&gt;BUT_save.Type" xml:space="preserve"> <data name="&gt;&gt;BUT_save.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4711.17948, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4724.30400, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;BUT_save.Parent" xml:space="preserve"> <data name="&gt;&gt;BUT_save.Parent" xml:space="preserve">
<value>$this</value> <value>$this</value>
@ -250,7 +250,7 @@
<value>NoControl</value> <value>NoControl</value>
</data> </data>
<data name="BUT_load.Location" type="System.Drawing.Point, System.Drawing"> <data name="BUT_load.Location" type="System.Drawing.Point, System.Drawing">
<value>506, 7</value> <value>631, 7</value>
</data> </data>
<data name="BUT_load.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms"> <data name="BUT_load.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 0, 0</value> <value>0, 0, 0, 0</value>
@ -268,7 +268,7 @@
<value>BUT_load</value> <value>BUT_load</value>
</data> </data>
<data name="&gt;&gt;BUT_load.Type" xml:space="preserve"> <data name="&gt;&gt;BUT_load.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4711.17948, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4724.30400, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;BUT_load.Parent" xml:space="preserve"> <data name="&gt;&gt;BUT_load.Parent" xml:space="preserve">
<value>$this</value> <value>$this</value>
@ -297,23 +297,32 @@
<data name="Value.Width" type="System.Int32, mscorlib"> <data name="Value.Width" type="System.Int32, mscorlib">
<value>80</value> <value>80</value>
</data> </data>
<metadata name="Units.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="Units.HeaderText" xml:space="preserve">
<value>Units</value>
</data>
<data name="Units.Width" type="System.Int32, mscorlib">
<value>60</value>
</data>
<metadata name="Options.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="Options.HeaderText" xml:space="preserve">
<value>Options</value>
</data>
<metadata name="Desc.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Desc.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<data name="Desc.HeaderText" xml:space="preserve"> <data name="Desc.HeaderText" xml:space="preserve">
<value>Desc</value> <value>Desc</value>
</data> </data>
<data name="Desc.Width" type="System.Int32, mscorlib">
<value>57</value>
</data>
<data name="Params.Location" type="System.Drawing.Point, System.Drawing"> <data name="Params.Location" type="System.Drawing.Point, System.Drawing">
<value>14, 3</value> <value>14, 3</value>
</data> </data>
<data name="Params.RowHeadersWidth" type="System.Int32, mscorlib">
<value>150</value>
</data>
<data name="Params.Size" type="System.Drawing.Size, System.Drawing"> <data name="Params.Size" type="System.Drawing.Size, System.Drawing">
<value>486, 302</value> <value>611, 302</value>
</data> </data>
<data name="Params.TabIndex" type="System.Int32, mscorlib"> <data name="Params.TabIndex" type="System.Int32, mscorlib">
<value>68</value> <value>68</value>
@ -340,7 +349,7 @@
<value>True</value> <value>True</value>
</data> </data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing"> <data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>506, 169</value> <value>631, 169</value>
</data> </data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing"> <data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>109, 26</value> <value>109, 26</value>
@ -374,13 +383,7 @@ format with no scaling</value>
<value>6, 13</value> <value>6, 13</value>
</data> </data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing"> <data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>625, 305</value> <value>750, 305</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>
<data name="&gt;&gt;Command.Name" xml:space="preserve"> <data name="&gt;&gt;Command.Name" xml:space="preserve">
<value>Command</value> <value>Command</value>
@ -394,12 +397,30 @@ format with no scaling</value>
<data name="&gt;&gt;Value.Type" xml:space="preserve"> <data name="&gt;&gt;Value.Type" xml:space="preserve">
<value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;Units.Name" xml:space="preserve">
<value>Units</value>
</data>
<data name="&gt;&gt;Units.Type" xml:space="preserve">
<value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;Options.Name" xml:space="preserve">
<value>Options</value>
</data>
<data name="&gt;&gt;Options.Type" xml:space="preserve">
<value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;Desc.Name" xml:space="preserve"> <data name="&gt;&gt;Desc.Name" xml:space="preserve">
<value>Desc</value> <value>Desc</value>
</data> </data>
<data name="&gt;&gt;Desc.Type" xml:space="preserve"> <data name="&gt;&gt;Desc.Type" xml:space="preserve">
<value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </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"> <data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>ConfigRawParams</value> <value>ConfigRawParams</value>
</data> </data>

View File

@ -0,0 +1,287 @@
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;
using ArdupilotMega.Controls.BackstageView;
using System.Reflection;
namespace ArdupilotMega.GCSViews.ConfigurationView
{
public partial class ConfigSignalization : UserControl, IActivate
{
[Flags]
public enum BeeperMode : byte
{
Startup = 1,
Arm = 2,
Disarm = 4,
Armed = 8,
GPS = 16,
Voltage = 32,
CH7 = 64,
Landing = 128
}
public enum LedStyle : byte
{
None = 0,
Legacy = 1,
Features = 2,
Disco = 3
}
[Flags]
public enum LedMode : byte
{
[Description("Motor, TODO: add description")]
Motor = 1,
[Description("GPS, TODO: add description")]
GPS = 2,
[Description("Aux, TODO: add description")]
Aux = 4,
[Description("Assign AN5 to LED (0) or beeper (1)")]
Beeper = 8,
[Description("Low battery - fast flash (0) / oscillate (1)")]
Voltage = 16,
[Description("Nav blink - motors")]
Nav_blink_motor = 32,
[Description("Nav blink - GPS")]
Nav_blink_GPS = 64
}
public enum LedModeX : byte
{
Off = 0,
On = 1,
Armed = 2,
GPS = 3,
Aux = 4,
[Description("Low battery - fast flash")]
Low_batt_fast = 5,
[Description("Low battery - oscillate")]
Low_batt_oscillate = 6,
[Description("Nav blink - motors")]
Nav_blink_motor = 7,
[Description("Nav blink - GPS")]
Nav_blink_GPS = 8
}
public ConfigSignalization()
{
InitializeComponent();
}
public void Activate()
{
if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane)
{
}
else if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduRover)
{
}
else if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduCopter2)
{
Object value;
//read BEEPER_MODE
try
{
value = MainV2.comPort.param["BEEPER_MODE"];
if (value == null)
{
Setup.flashMessage.FadeInOut("Reading BEEPER_MODE failed", false);
}
else
{
BeeperMode beeper_mode = (BeeperMode)System.Convert.ToSByte(value);
CB_beeper_0.Checked = (beeper_mode & BeeperMode.Startup) == BeeperMode.Startup;
CB_beeper_1.Checked = (beeper_mode & BeeperMode.Arm) == BeeperMode.Arm;
CB_beeper_2.Checked = (beeper_mode & BeeperMode.Disarm) == BeeperMode.Disarm;
CB_beeper_3.Checked = (beeper_mode & BeeperMode.Armed) == BeeperMode.Armed;
CB_beeper_4.Checked = (beeper_mode & BeeperMode.GPS) == BeeperMode.GPS;
CB_beeper_5.Checked = (beeper_mode & BeeperMode.Voltage) == BeeperMode.Voltage;
CB_beeper_6.Checked = (beeper_mode & BeeperMode.CH7) == BeeperMode.CH7;
CB_beeper_7.Checked = (beeper_mode & BeeperMode.Landing) == BeeperMode.Landing;
Setup.flashMessage.FadeInOut("Reading BEEPER_MODE succeed", true);
}
}
catch {
Setup.flashMessage.FadeInOut("Reading BEEPER_MODE failed", false);
}
//read LED_STYLE
try
{
value = MainV2.comPort.param["LED_STYLE"];
if (value == null)
{
Setup.flashMessage.FadeInOut("Reading LED_STYLE failed", false);
}
else
{
LedStyle led_style = (LedStyle)System.Convert.ToSByte(value);
CMB_leds_style.DataSource = Enum.GetValues(typeof(LedStyle));
CMB_leds_style.SelectedItem = led_style;
Setup.flashMessage.FadeInOut("Reading LED_STYLE succeed", true);
}
}
catch
{
Setup.flashMessage.FadeInOut("Reading LED_STYLE failed", false);
}
CMB_led_1.DataSource = Enum.GetValues(typeof(LedMode));
//read LED_MODE
try
{
value = MainV2.comPort.param["LED_MODE"];
if (value == null)
{
Setup.flashMessage.FadeInOut("Reading LED_MODE failed", false);
}
else
{
LedMode led_mode = (LedMode)System.Convert.ToSByte(value);
CB_leds_legacy_1.Checked = (led_mode & LedMode.Motor) == LedMode.Motor;
CB_leds_legacy_2.Checked = (led_mode & LedMode.GPS) == LedMode.GPS;
CB_leds_legacy_3.Checked = (led_mode & LedMode.Aux) == LedMode.Aux;
CB_leds_legacy_4.Checked = (led_mode & LedMode.Beeper) == LedMode.Beeper;
CB_leds_legacy_5.Checked = (led_mode & LedMode.Voltage) == LedMode.Voltage;
CB_leds_legacy_6.Checked = (led_mode & LedMode.Nav_blink_motor) == LedMode.Nav_blink_motor;
CB_leds_legacy_7.Checked = (led_mode & LedMode.Nav_blink_GPS) == LedMode.Nav_blink_GPS;
Setup.flashMessage.FadeInOut("Reading LED_MODE succeed", true);
}
}
catch
{
Setup.flashMessage.FadeInOut("Reading LED_MODE failed", false);
}
}
}
private void B_beeper_write_Click(object sender, EventArgs e)
{
try
{
BeeperMode beeper_mode =
(CB_beeper_0.Checked ? BeeperMode.Startup : 0) |
(CB_beeper_1.Checked ? BeeperMode.Arm : 0) |
(CB_beeper_2.Checked ? BeeperMode.Disarm : 0) |
(CB_beeper_3.Checked ? BeeperMode.Armed : 0) |
(CB_beeper_4.Checked ? BeeperMode.GPS : 0) |
(CB_beeper_5.Checked ? BeeperMode.Voltage : 0) |
(CB_beeper_6.Checked ? BeeperMode.CH7 : 0) |
(CB_beeper_7.Checked ? BeeperMode.Landing : 0);
if (MainV2.comPort.setParam("BEEPER_MODE", (byte)beeper_mode))
{
Setup.flashMessage.FadeInOut("Writing BEEPER_MODE succeed", true);
}
else
{
Setup.flashMessage.FadeInOut("Writing BEEPER_MODE failed", false);
}
}
catch
{
Setup.flashMessage.FadeInOut("Writing BEEPER_MODE failed", false);
}
}
private void B_leds_write_Click(object sender, EventArgs e)
{
//write LED_STYLE
try
{
LedStyle led_style = (LedStyle)Enum.Parse(typeof(LedStyle), CMB_leds_style.SelectedItem.ToString());
if (MainV2.comPort.setParam("LED_STYLE", (byte)led_style))
{
Setup.flashMessage.FadeInOut("Writing LED_STYLE succeed", true);
}
else
{
Setup.flashMessage.FadeInOut("Writing LED_STYLE failed", false);
}
}
catch
{
Setup.flashMessage.FadeInOut("Writing LED_STYLE failed", false);
}
//write LED_MODE
try
{
LedMode led_mode =
(CB_leds_legacy_1.Checked ? LedMode.Motor : 0) |
(CB_leds_legacy_2.Checked ? LedMode.GPS : 0) |
(CB_leds_legacy_3.Checked ? LedMode.Aux : 0) |
(CB_leds_legacy_4.Checked ? LedMode.Beeper : 0) |
(CB_leds_legacy_5.Checked ? LedMode.Voltage : 0) |
(CB_leds_legacy_6.Checked ? LedMode.Nav_blink_motor : 0) |
(CB_leds_legacy_7.Checked ? LedMode.Nav_blink_GPS : 0);
if (MainV2.comPort.setParam("LED_MODE", (byte)led_mode))
{
Setup.flashMessage.FadeInOut("Writing LED_MODE succeed", true);
}
else
{
Setup.flashMessage.FadeInOut("Writing LED_MODE failed", false);
}
}
catch
{
Setup.flashMessage.FadeInOut("Writing LED_MODE failed", false);
}
}
private void CMB_leds_style_SelectedIndexChanged(object sender, EventArgs e)
{
LedStyle led_style = (LedStyle)Enum.Parse(typeof(LedStyle), ((ComboBox)sender).SelectedItem.ToString());
switch (led_style)
{
case LedStyle.None:
P_leds_mode_combo.Visible = false;
P_leds_mode_legacy.Visible = false;
break;
case LedStyle.Legacy:
P_leds_mode_combo.Visible = false;
P_leds_mode_legacy.Visible = true;
break;
case LedStyle.Features:
P_leds_mode_combo.Visible = true;
P_leds_mode_legacy.Visible = false;
break;
case LedStyle.Disco:
P_leds_mode_combo.Visible = false;
P_leds_mode_legacy.Visible = false;
break;
}
}
private void CMB_Format(object sender, ListControlConvertEventArgs e)
{
LedMode item = (LedMode)e.ListItem;
e.Value = GetEnumDescription((LedMode)item);
}
public static string GetEnumDescription(Enum value)
{
FieldInfo fi = value.GetType().GetField(value.ToString());
DescriptionAttribute[] attributes = (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttribute), false);
if (attributes != null && attributes.Length > 0)
{
return attributes[0].Description;
}
else
{
return value.ToString();
}
}
}
}

View File

@ -0,0 +1,623 @@
namespace ArdupilotMega.GCSViews.ConfigurationView
{
partial class ConfigSignalization
{
/// <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.L_beeper_pin = new System.Windows.Forms.Label();
this.L_beeper_functions = new System.Windows.Forms.Label();
this.CB_beeper_0 = new System.Windows.Forms.CheckBox();
this.CB_beeper_1 = new System.Windows.Forms.CheckBox();
this.CB_beeper_2 = new System.Windows.Forms.CheckBox();
this.CB_beeper_3 = new System.Windows.Forms.CheckBox();
this.CB_beeper_4 = new System.Windows.Forms.CheckBox();
this.CB_beeper_5 = new System.Windows.Forms.CheckBox();
this.CB_beeper_6 = new System.Windows.Forms.CheckBox();
this.CB_beeper_7 = new System.Windows.Forms.CheckBox();
this.CMB_beeper_pin = new System.Windows.Forms.ComboBox();
this.GB_leds = new System.Windows.Forms.GroupBox();
this.P_leds_mode_legacy = new System.Windows.Forms.Panel();
this.CB_leds_legacy_1 = new System.Windows.Forms.CheckBox();
this.CB_leds_legacy_2 = new System.Windows.Forms.CheckBox();
this.CB_leds_legacy_3 = new System.Windows.Forms.CheckBox();
this.CB_leds_legacy_4 = new System.Windows.Forms.CheckBox();
this.CB_leds_legacy_5 = new System.Windows.Forms.CheckBox();
this.CB_leds_legacy_6 = new System.Windows.Forms.CheckBox();
this.CB_leds_legacy_7 = new System.Windows.Forms.CheckBox();
this.CB_leds_legacy_8 = new System.Windows.Forms.CheckBox();
this.L_leds_type = new System.Windows.Forms.Label();
this.CMB_leds_style = new System.Windows.Forms.ComboBox();
this.P_leds_mode_combo = new System.Windows.Forms.Panel();
this.L_led_1 = new System.Windows.Forms.Label();
this.CMB_led_1 = new System.Windows.Forms.ComboBox();
this.L_led_2 = new System.Windows.Forms.Label();
this.CMB_led_2 = new System.Windows.Forms.ComboBox();
this.L_led_3 = new System.Windows.Forms.Label();
this.CMB_led_3 = new System.Windows.Forms.ComboBox();
this.L_led_4 = new System.Windows.Forms.Label();
this.CMB_led_4 = new System.Windows.Forms.ComboBox();
this.L_led_5 = new System.Windows.Forms.Label();
this.CMB_led_5 = new System.Windows.Forms.ComboBox();
this.L_led_6 = new System.Windows.Forms.Label();
this.CMB_led_6 = new System.Windows.Forms.ComboBox();
this.L_led_7 = new System.Windows.Forms.Label();
this.CMB_led_7 = new System.Windows.Forms.ComboBox();
this.L_led_8 = new System.Windows.Forms.Label();
this.CMB_led_8 = new System.Windows.Forms.ComboBox();
this.GB_beeper = new System.Windows.Forms.GroupBox();
this.B_beeper_write = new ArdupilotMega.Controls.MyButton();
this.B_leds_write = new ArdupilotMega.Controls.MyButton();
this.GB_leds.SuspendLayout();
this.P_leds_mode_legacy.SuspendLayout();
this.P_leds_mode_combo.SuspendLayout();
this.GB_beeper.SuspendLayout();
this.SuspendLayout();
//
// L_beeper_pin
//
this.L_beeper_pin.AutoSize = true;
this.L_beeper_pin.Location = new System.Drawing.Point(6, 31);
this.L_beeper_pin.Name = "L_beeper_pin";
this.L_beeper_pin.Size = new System.Drawing.Size(186, 13);
this.L_beeper_pin.TabIndex = 4;
this.L_beeper_pin.Text = "Select pin where beeper is connected\r\n";
//
// L_beeper_functions
//
this.L_beeper_functions.AutoSize = true;
this.L_beeper_functions.Location = new System.Drawing.Point(6, 75);
this.L_beeper_functions.Name = "L_beeper_functions";
this.L_beeper_functions.Size = new System.Drawing.Size(105, 13);
this.L_beeper_functions.TabIndex = 5;
this.L_beeper_functions.Text = "Select when to beep";
//
// CB_beeper_0
//
this.CB_beeper_0.AutoSize = true;
this.CB_beeper_0.Location = new System.Drawing.Point(9, 91);
this.CB_beeper_0.Name = "CB_beeper_0";
this.CB_beeper_0.Size = new System.Drawing.Size(75, 17);
this.CB_beeper_0.TabIndex = 2;
this.CB_beeper_0.Text = "On startup";
this.CB_beeper_0.UseVisualStyleBackColor = true;
//
// CB_beeper_1
//
this.CB_beeper_1.AutoSize = true;
this.CB_beeper_1.Location = new System.Drawing.Point(9, 114);
this.CB_beeper_1.Name = "CB_beeper_1";
this.CB_beeper_1.Size = new System.Drawing.Size(74, 17);
this.CB_beeper_1.TabIndex = 3;
this.CB_beeper_1.Text = "On arming";
this.CB_beeper_1.UseVisualStyleBackColor = true;
//
// CB_beeper_2
//
this.CB_beeper_2.AutoSize = true;
this.CB_beeper_2.Location = new System.Drawing.Point(9, 137);
this.CB_beeper_2.Name = "CB_beeper_2";
this.CB_beeper_2.Size = new System.Drawing.Size(87, 17);
this.CB_beeper_2.TabIndex = 4;
this.CB_beeper_2.Text = "On disarming";
this.CB_beeper_2.UseVisualStyleBackColor = true;
//
// CB_beeper_3
//
this.CB_beeper_3.AutoSize = true;
this.CB_beeper_3.Location = new System.Drawing.Point(9, 160);
this.CB_beeper_3.Name = "CB_beeper_3";
this.CB_beeper_3.Size = new System.Drawing.Size(159, 17);
this.CB_beeper_3.TabIndex = 5;
this.CB_beeper_3.Text = "When armed and on ground";
this.CB_beeper_3.UseVisualStyleBackColor = true;
//
// CB_beeper_4
//
this.CB_beeper_4.AutoSize = true;
this.CB_beeper_4.Location = new System.Drawing.Point(9, 181);
this.CB_beeper_4.Name = "CB_beeper_4";
this.CB_beeper_4.Size = new System.Drawing.Size(111, 17);
this.CB_beeper_4.TabIndex = 6;
this.CB_beeper_4.Text = "On GPS home set";
this.CB_beeper_4.UseVisualStyleBackColor = true;
//
// CB_beeper_5
//
this.CB_beeper_5.AutoSize = true;
this.CB_beeper_5.Location = new System.Drawing.Point(9, 204);
this.CB_beeper_5.Name = "CB_beeper_5";
this.CB_beeper_5.Size = new System.Drawing.Size(97, 17);
this.CB_beeper_5.TabIndex = 7;
this.CB_beeper_5.Text = "On low voltage";
this.CB_beeper_5.UseVisualStyleBackColor = true;
//
// CB_beeper_6
//
this.CB_beeper_6.AutoSize = true;
this.CB_beeper_6.Location = new System.Drawing.Point(9, 227);
this.CB_beeper_6.Name = "CB_beeper_6";
this.CB_beeper_6.Size = new System.Drawing.Size(112, 17);
this.CB_beeper_6.TabIndex = 8;
this.CB_beeper_6.Text = "When CH7 is high";
this.CB_beeper_6.UseVisualStyleBackColor = true;
//
// CB_beeper_7
//
this.CB_beeper_7.AutoSize = true;
this.CB_beeper_7.Location = new System.Drawing.Point(9, 250);
this.CB_beeper_7.Name = "CB_beeper_7";
this.CB_beeper_7.Size = new System.Drawing.Size(142, 17);
this.CB_beeper_7.TabIndex = 9;
this.CB_beeper_7.Text = "When in auto land mode";
this.CB_beeper_7.UseVisualStyleBackColor = true;
//
// CMB_beeper_pin
//
this.CMB_beeper_pin.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
this.CMB_beeper_pin.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
this.CMB_beeper_pin.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CMB_beeper_pin.Enabled = false;
this.CMB_beeper_pin.FormattingEnabled = true;
this.CMB_beeper_pin.Items.AddRange(new object[] {
"AN0",
"AN1",
"AN2",
"AN3",
"AN4",
"AN5",
"AN6",
"AN7",
"AN8",
"AN9",
"AN10",
"AN11",
"AN12",
"AN13",
"AN14",
"AN15"});
this.CMB_beeper_pin.Location = new System.Drawing.Point(6, 47);
this.CMB_beeper_pin.Name = "CMB_beeper_pin";
this.CMB_beeper_pin.Size = new System.Drawing.Size(121, 21);
this.CMB_beeper_pin.TabIndex = 1;
//
// GB_leds
//
this.GB_leds.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.GB_leds.Controls.Add(this.P_leds_mode_legacy);
this.GB_leds.Controls.Add(this.B_leds_write);
this.GB_leds.Controls.Add(this.L_leds_type);
this.GB_leds.Controls.Add(this.CMB_leds_style);
this.GB_leds.Controls.Add(this.P_leds_mode_combo);
this.GB_leds.Location = new System.Drawing.Point(253, 0);
this.GB_leds.Name = "GB_leds";
this.GB_leds.Size = new System.Drawing.Size(252, 347);
this.GB_leds.TabIndex = 10;
this.GB_leds.TabStop = false;
this.GB_leds.Text = "LEDs settings";
//
// P_leds_mode_legacy
//
this.P_leds_mode_legacy.Controls.Add(this.CB_leds_legacy_1);
this.P_leds_mode_legacy.Controls.Add(this.CB_leds_legacy_2);
this.P_leds_mode_legacy.Controls.Add(this.CB_leds_legacy_3);
this.P_leds_mode_legacy.Controls.Add(this.CB_leds_legacy_4);
this.P_leds_mode_legacy.Controls.Add(this.CB_leds_legacy_5);
this.P_leds_mode_legacy.Controls.Add(this.CB_leds_legacy_6);
this.P_leds_mode_legacy.Controls.Add(this.CB_leds_legacy_7);
this.P_leds_mode_legacy.Controls.Add(this.CB_leds_legacy_8);
this.P_leds_mode_legacy.Location = new System.Drawing.Point(2, 73);
this.P_leds_mode_legacy.Name = "P_leds_mode_legacy";
this.P_leds_mode_legacy.Size = new System.Drawing.Size(247, 214);
this.P_leds_mode_legacy.TabIndex = 23;
//
// CB_leds_legacy_1
//
this.CB_leds_legacy_1.AutoSize = true;
this.CB_leds_legacy_1.Location = new System.Drawing.Point(7, 2);
this.CB_leds_legacy_1.Name = "CB_leds_legacy_1";
this.CB_leds_legacy_1.Size = new System.Drawing.Size(53, 17);
this.CB_leds_legacy_1.TabIndex = 0;
this.CB_leds_legacy_1.Text = "Motor";
this.CB_leds_legacy_1.UseVisualStyleBackColor = true;
//
// CB_leds_legacy_2
//
this.CB_leds_legacy_2.AutoSize = true;
this.CB_leds_legacy_2.Location = new System.Drawing.Point(7, 23);
this.CB_leds_legacy_2.Name = "CB_leds_legacy_2";
this.CB_leds_legacy_2.Size = new System.Drawing.Size(48, 17);
this.CB_leds_legacy_2.TabIndex = 1;
this.CB_leds_legacy_2.Text = "GPS";
this.CB_leds_legacy_2.UseVisualStyleBackColor = true;
//
// CB_leds_legacy_3
//
this.CB_leds_legacy_3.AutoSize = true;
this.CB_leds_legacy_3.Location = new System.Drawing.Point(7, 46);
this.CB_leds_legacy_3.Name = "CB_leds_legacy_3";
this.CB_leds_legacy_3.Size = new System.Drawing.Size(44, 17);
this.CB_leds_legacy_3.TabIndex = 2;
this.CB_leds_legacy_3.Text = "Aux";
this.CB_leds_legacy_3.UseVisualStyleBackColor = true;
//
// CB_leds_legacy_4
//
this.CB_leds_legacy_4.AutoSize = true;
this.CB_leds_legacy_4.Location = new System.Drawing.Point(7, 69);
this.CB_leds_legacy_4.Name = "CB_leds_legacy_4";
this.CB_leds_legacy_4.Size = new System.Drawing.Size(60, 17);
this.CB_leds_legacy_4.TabIndex = 3;
this.CB_leds_legacy_4.Text = "Beeper";
this.CB_leds_legacy_4.UseVisualStyleBackColor = true;
//
// CB_leds_legacy_5
//
this.CB_leds_legacy_5.AutoSize = true;
this.CB_leds_legacy_5.Location = new System.Drawing.Point(7, 92);
this.CB_leds_legacy_5.Name = "CB_leds_legacy_5";
this.CB_leds_legacy_5.Size = new System.Drawing.Size(219, 17);
this.CB_leds_legacy_5.TabIndex = 4;
this.CB_leds_legacy_5.Text = "Fast flash (0) / oscillate (1) on low battery";
this.CB_leds_legacy_5.UseVisualStyleBackColor = true;
//
// CB_leds_legacy_6
//
this.CB_leds_legacy_6.AutoSize = true;
this.CB_leds_legacy_6.Location = new System.Drawing.Point(7, 115);
this.CB_leds_legacy_6.Name = "CB_leds_legacy_6";
this.CB_leds_legacy_6.Size = new System.Drawing.Size(99, 17);
this.CB_leds_legacy_6.TabIndex = 5;
this.CB_leds_legacy_6.Text = "Motor nav blink";
this.CB_leds_legacy_6.UseVisualStyleBackColor = true;
//
// CB_leds_legacy_7
//
this.CB_leds_legacy_7.AutoSize = true;
this.CB_leds_legacy_7.Location = new System.Drawing.Point(7, 138);
this.CB_leds_legacy_7.Name = "CB_leds_legacy_7";
this.CB_leds_legacy_7.Size = new System.Drawing.Size(94, 17);
this.CB_leds_legacy_7.TabIndex = 6;
this.CB_leds_legacy_7.Text = "GPS nav blink";
this.CB_leds_legacy_7.UseVisualStyleBackColor = true;
//
// CB_leds_legacy_8
//
this.CB_leds_legacy_8.AutoSize = true;
this.CB_leds_legacy_8.Enabled = false;
this.CB_leds_legacy_8.Location = new System.Drawing.Point(7, 161);
this.CB_leds_legacy_8.Name = "CB_leds_legacy_8";
this.CB_leds_legacy_8.Size = new System.Drawing.Size(63, 17);
this.CB_leds_legacy_8.TabIndex = 7;
this.CB_leds_legacy_8.Text = "Unused";
this.CB_leds_legacy_8.UseVisualStyleBackColor = true;
//
// L_leds_type
//
this.L_leds_type.AutoSize = true;
this.L_leds_type.Location = new System.Drawing.Point(6, 31);
this.L_leds_type.Name = "L_leds_type";
this.L_leds_type.Size = new System.Drawing.Size(139, 13);
this.L_leds_type.TabIndex = 10;
this.L_leds_type.Text = "Select type of LEDs handler";
//
// CMB_leds_style
//
this.CMB_leds_style.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CMB_leds_style.Enabled = false;
this.CMB_leds_style.FormattingEnabled = true;
this.CMB_leds_style.Location = new System.Drawing.Point(7, 46);
this.CMB_leds_style.Name = "CMB_leds_style";
this.CMB_leds_style.Size = new System.Drawing.Size(121, 21);
this.CMB_leds_style.TabIndex = 21;
this.CMB_leds_style.SelectedIndexChanged += new System.EventHandler(this.CMB_leds_style_SelectedIndexChanged);
//
// P_leds_mode_combo
//
this.P_leds_mode_combo.Controls.Add(this.L_led_1);
this.P_leds_mode_combo.Controls.Add(this.CMB_led_1);
this.P_leds_mode_combo.Controls.Add(this.L_led_2);
this.P_leds_mode_combo.Controls.Add(this.CMB_led_2);
this.P_leds_mode_combo.Controls.Add(this.L_led_3);
this.P_leds_mode_combo.Controls.Add(this.CMB_led_3);
this.P_leds_mode_combo.Controls.Add(this.L_led_4);
this.P_leds_mode_combo.Controls.Add(this.CMB_led_4);
this.P_leds_mode_combo.Controls.Add(this.L_led_5);
this.P_leds_mode_combo.Controls.Add(this.CMB_led_5);
this.P_leds_mode_combo.Controls.Add(this.L_led_6);
this.P_leds_mode_combo.Controls.Add(this.CMB_led_6);
this.P_leds_mode_combo.Controls.Add(this.L_led_7);
this.P_leds_mode_combo.Controls.Add(this.CMB_led_7);
this.P_leds_mode_combo.Controls.Add(this.L_led_8);
this.P_leds_mode_combo.Controls.Add(this.CMB_led_8);
this.P_leds_mode_combo.Location = new System.Drawing.Point(2, 73);
this.P_leds_mode_combo.Name = "P_leds_mode_combo";
this.P_leds_mode_combo.Size = new System.Drawing.Size(247, 214);
this.P_leds_mode_combo.TabIndex = 23;
//
// L_led_1
//
this.L_led_1.AutoSize = true;
this.L_led_1.Location = new System.Drawing.Point(6, 7);
this.L_led_1.Name = "L_led_1";
this.L_led_1.Size = new System.Drawing.Size(34, 13);
this.L_led_1.TabIndex = 23;
this.L_led_1.Text = "LED1";
//
// CMB_led_1
//
this.CMB_led_1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CMB_led_1.FormattingEnabled = true;
this.CMB_led_1.Location = new System.Drawing.Point(46, 5);
this.CMB_led_1.Name = "CMB_led_1";
this.CMB_led_1.Size = new System.Drawing.Size(166, 21);
this.CMB_led_1.TabIndex = 24;
this.CMB_led_1.Format += new System.Windows.Forms.ListControlConvertEventHandler(this.CMB_Format);
//
// L_led_2
//
this.L_led_2.AutoSize = true;
this.L_led_2.Location = new System.Drawing.Point(6, 34);
this.L_led_2.Name = "L_led_2";
this.L_led_2.Size = new System.Drawing.Size(34, 13);
this.L_led_2.TabIndex = 25;
this.L_led_2.Text = "LED2";
//
// CMB_led_2
//
this.CMB_led_2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CMB_led_2.FormattingEnabled = true;
this.CMB_led_2.Location = new System.Drawing.Point(46, 31);
this.CMB_led_2.Name = "CMB_led_2";
this.CMB_led_2.Size = new System.Drawing.Size(166, 21);
this.CMB_led_2.TabIndex = 26;
this.CMB_led_2.Format += new System.Windows.Forms.ListControlConvertEventHandler(this.CMB_Format);
//
// L_led_3
//
this.L_led_3.AutoSize = true;
this.L_led_3.Location = new System.Drawing.Point(6, 61);
this.L_led_3.Name = "L_led_3";
this.L_led_3.Size = new System.Drawing.Size(34, 13);
this.L_led_3.TabIndex = 27;
this.L_led_3.Text = "LED3";
//
// CMB_led_3
//
this.CMB_led_3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CMB_led_3.FormattingEnabled = true;
this.CMB_led_3.Location = new System.Drawing.Point(46, 57);
this.CMB_led_3.Name = "CMB_led_3";
this.CMB_led_3.Size = new System.Drawing.Size(166, 21);
this.CMB_led_3.TabIndex = 28;
this.CMB_led_3.Format += new System.Windows.Forms.ListControlConvertEventHandler(this.CMB_Format);
//
// L_led_4
//
this.L_led_4.AutoSize = true;
this.L_led_4.Location = new System.Drawing.Point(6, 88);
this.L_led_4.Name = "L_led_4";
this.L_led_4.Size = new System.Drawing.Size(34, 13);
this.L_led_4.TabIndex = 29;
this.L_led_4.Text = "LED4";
//
// CMB_led_4
//
this.CMB_led_4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CMB_led_4.FormattingEnabled = true;
this.CMB_led_4.Location = new System.Drawing.Point(46, 83);
this.CMB_led_4.Name = "CMB_led_4";
this.CMB_led_4.Size = new System.Drawing.Size(166, 21);
this.CMB_led_4.TabIndex = 30;
this.CMB_led_4.Format += new System.Windows.Forms.ListControlConvertEventHandler(this.CMB_Format);
//
// L_led_5
//
this.L_led_5.AutoSize = true;
this.L_led_5.Location = new System.Drawing.Point(6, 115);
this.L_led_5.Name = "L_led_5";
this.L_led_5.Size = new System.Drawing.Size(34, 13);
this.L_led_5.TabIndex = 31;
this.L_led_5.Text = "LED5";
//
// CMB_led_5
//
this.CMB_led_5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CMB_led_5.FormattingEnabled = true;
this.CMB_led_5.Location = new System.Drawing.Point(46, 109);
this.CMB_led_5.Name = "CMB_led_5";
this.CMB_led_5.Size = new System.Drawing.Size(166, 21);
this.CMB_led_5.TabIndex = 32;
this.CMB_led_5.Format += new System.Windows.Forms.ListControlConvertEventHandler(this.CMB_Format);
//
// L_led_6
//
this.L_led_6.AutoSize = true;
this.L_led_6.Location = new System.Drawing.Point(6, 142);
this.L_led_6.Name = "L_led_6";
this.L_led_6.Size = new System.Drawing.Size(34, 13);
this.L_led_6.TabIndex = 33;
this.L_led_6.Text = "LED6";
//
// CMB_led_6
//
this.CMB_led_6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CMB_led_6.FormattingEnabled = true;
this.CMB_led_6.Location = new System.Drawing.Point(46, 135);
this.CMB_led_6.Name = "CMB_led_6";
this.CMB_led_6.Size = new System.Drawing.Size(166, 21);
this.CMB_led_6.TabIndex = 34;
this.CMB_led_6.Format += new System.Windows.Forms.ListControlConvertEventHandler(this.CMB_Format);
//
// L_led_7
//
this.L_led_7.AutoSize = true;
this.L_led_7.Location = new System.Drawing.Point(6, 169);
this.L_led_7.Name = "L_led_7";
this.L_led_7.Size = new System.Drawing.Size(34, 13);
this.L_led_7.TabIndex = 35;
this.L_led_7.Text = "LED7";
//
// CMB_led_7
//
this.CMB_led_7.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CMB_led_7.FormattingEnabled = true;
this.CMB_led_7.Location = new System.Drawing.Point(46, 161);
this.CMB_led_7.Name = "CMB_led_7";
this.CMB_led_7.Size = new System.Drawing.Size(166, 21);
this.CMB_led_7.TabIndex = 36;
this.CMB_led_7.Format += new System.Windows.Forms.ListControlConvertEventHandler(this.CMB_Format);
//
// L_led_8
//
this.L_led_8.AutoSize = true;
this.L_led_8.Location = new System.Drawing.Point(6, 196);
this.L_led_8.Name = "L_led_8";
this.L_led_8.Size = new System.Drawing.Size(34, 13);
this.L_led_8.TabIndex = 37;
this.L_led_8.Text = "LED8";
//
// CMB_led_8
//
this.CMB_led_8.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CMB_led_8.FormattingEnabled = true;
this.CMB_led_8.Location = new System.Drawing.Point(46, 187);
this.CMB_led_8.Name = "CMB_led_8";
this.CMB_led_8.Size = new System.Drawing.Size(166, 21);
this.CMB_led_8.TabIndex = 38;
this.CMB_led_8.Format += new System.Windows.Forms.ListControlConvertEventHandler(this.CMB_Format);
//
// GB_beeper
//
this.GB_beeper.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.GB_beeper.Controls.Add(this.B_beeper_write);
this.GB_beeper.Controls.Add(this.L_beeper_pin);
this.GB_beeper.Controls.Add(this.CB_beeper_0);
this.GB_beeper.Controls.Add(this.CB_beeper_4);
this.GB_beeper.Controls.Add(this.CMB_beeper_pin);
this.GB_beeper.Controls.Add(this.CB_beeper_5);
this.GB_beeper.Controls.Add(this.L_beeper_functions);
this.GB_beeper.Controls.Add(this.CB_beeper_6);
this.GB_beeper.Controls.Add(this.CB_beeper_1);
this.GB_beeper.Controls.Add(this.CB_beeper_7);
this.GB_beeper.Controls.Add(this.CB_beeper_3);
this.GB_beeper.Controls.Add(this.CB_beeper_2);
this.GB_beeper.Location = new System.Drawing.Point(0, 0);
this.GB_beeper.Name = "GB_beeper";
this.GB_beeper.Size = new System.Drawing.Size(252, 347);
this.GB_beeper.TabIndex = 11;
this.GB_beeper.TabStop = false;
this.GB_beeper.Text = "Beeper settings";
//
// B_beeper_write
//
this.B_beeper_write.Location = new System.Drawing.Point(83, 318);
this.B_beeper_write.Name = "B_beeper_write";
this.B_beeper_write.Size = new System.Drawing.Size(85, 23);
this.B_beeper_write.TabIndex = 10;
this.B_beeper_write.Text = "Write changes";
this.B_beeper_write.UseVisualStyleBackColor = true;
this.B_beeper_write.Click += new System.EventHandler(this.B_beeper_write_Click);
//
// B_leds_write
//
this.B_leds_write.Location = new System.Drawing.Point(82, 318);
this.B_leds_write.Name = "B_leds_write";
this.B_leds_write.Size = new System.Drawing.Size(85, 23);
this.B_leds_write.TabIndex = 22;
this.B_leds_write.Text = "Write changes";
this.B_leds_write.UseVisualStyleBackColor = true;
this.B_leds_write.Click += new System.EventHandler(this.B_leds_write_Click);
//
// ConfigSignalization
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.GB_beeper);
this.Controls.Add(this.GB_leds);
this.Name = "ConfigSignalization";
this.Size = new System.Drawing.Size(506, 350);
this.GB_leds.ResumeLayout(false);
this.GB_leds.PerformLayout();
this.P_leds_mode_legacy.ResumeLayout(false);
this.P_leds_mode_legacy.PerformLayout();
this.P_leds_mode_combo.ResumeLayout(false);
this.P_leds_mode_combo.PerformLayout();
this.GB_beeper.ResumeLayout(false);
this.GB_beeper.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ComboBox CMB_beeper_pin;
private System.Windows.Forms.Label L_beeper_pin;
private System.Windows.Forms.Label L_beeper_functions;
private System.Windows.Forms.CheckBox CB_beeper_0;
private System.Windows.Forms.CheckBox CB_beeper_1;
private System.Windows.Forms.CheckBox CB_beeper_2;
private System.Windows.Forms.CheckBox CB_beeper_3;
private System.Windows.Forms.CheckBox CB_beeper_4;
private System.Windows.Forms.CheckBox CB_beeper_5;
private System.Windows.Forms.CheckBox CB_beeper_6;
private System.Windows.Forms.CheckBox CB_beeper_7;
private System.Windows.Forms.GroupBox GB_leds;
private System.Windows.Forms.GroupBox GB_beeper;
private System.Windows.Forms.Label L_leds_type;
private System.Windows.Forms.ComboBox CMB_leds_style;
private Controls.MyButton B_leds_write;
private Controls.MyButton B_beeper_write;
private System.Windows.Forms.Panel P_leds_mode_combo;
private System.Windows.Forms.Panel P_leds_mode_legacy;
private System.Windows.Forms.Label L_led_1;
private System.Windows.Forms.ComboBox CMB_led_1;
private System.Windows.Forms.Label L_led_2;
private System.Windows.Forms.ComboBox CMB_led_2;
private System.Windows.Forms.Label L_led_3;
private System.Windows.Forms.ComboBox CMB_led_3;
private System.Windows.Forms.Label L_led_4;
private System.Windows.Forms.ComboBox CMB_led_4;
private System.Windows.Forms.Label L_led_5;
private System.Windows.Forms.ComboBox CMB_led_5;
private System.Windows.Forms.Label L_led_6;
private System.Windows.Forms.ComboBox CMB_led_6;
private System.Windows.Forms.Label L_led_7;
private System.Windows.Forms.ComboBox CMB_led_7;
private System.Windows.Forms.Label L_led_8;
private System.Windows.Forms.ComboBox CMB_led_8;
private System.Windows.Forms.CheckBox CB_leds_legacy_8;
private System.Windows.Forms.CheckBox CB_leds_legacy_7;
private System.Windows.Forms.CheckBox CB_leds_legacy_6;
private System.Windows.Forms.CheckBox CB_leds_legacy_5;
private System.Windows.Forms.CheckBox CB_leds_legacy_4;
private System.Windows.Forms.CheckBox CB_leds_legacy_3;
private System.Windows.Forms.CheckBox CB_leds_legacy_2;
private System.Windows.Forms.CheckBox CB_leds_legacy_1;
}
}

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

@ -29,9 +29,9 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
return; return;
try try
{ {
if (MainV2.comPort.param["H_SWASH_TYPE"] == null) if (MainV2.comPort.MAV.param["H_SWASH_TYPE"] == null)
{ {
CustomMessageBox.Show("Not Available on " + MainV2.cs.firmware.ToString()); CustomMessageBox.Show("Not Available on " + MainV2.comPort.MAV.cs.firmware.ToString());
} }
else else
{ {
@ -45,7 +45,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
{ {
try try
{ {
if (MainV2.comPort.param["H_SV_MAN"].ToString() == "1") if (MainV2.comPort.MAV.param["H_SV_MAN"].ToString() == "1")
{ {
MainV2.comPort.setParam("H_COL_MIN", int.Parse(H_COL_MIN.Text)); MainV2.comPort.setParam("H_COL_MIN", int.Parse(H_COL_MIN.Text));
MainV2.comPort.setParam("H_COL_MAX", int.Parse(H_COL_MAX.Text)); MainV2.comPort.setParam("H_COL_MAX", int.Parse(H_COL_MAX.Text));
@ -77,7 +77,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
{ {
try try
{ {
if (MainV2.comPort.param["H_SV_MAN"].ToString() == "1") if (MainV2.comPort.MAV.param["H_SV_MAN"].ToString() == "1")
{ {
MainV2.comPort.setParam("HS4_MIN", int.Parse(HS4_MIN.Text)); MainV2.comPort.setParam("HS4_MIN", int.Parse(HS4_MIN.Text));
MainV2.comPort.setParam("HS4_MAX", int.Parse(HS4_MAX.Text)); MainV2.comPort.setParam("HS4_MAX", int.Parse(HS4_MAX.Text));
@ -255,9 +255,9 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
try try
{ {
MainV2.comPort.setParam("H_COL_MID", MainV2.cs.ch3in); MainV2.comPort.setParam("H_COL_MID", MainV2.comPort.MAV.cs.ch3in);
H_COL_MID.Text = MainV2.comPort.param["H_COL_MID"].ToString(); H_COL_MID.Text = MainV2.comPort.MAV.param["H_COL_MID"].ToString();
} }
catch { CustomMessageBox.Show("Set H_COL_MID failed"); } catch { CustomMessageBox.Show("Set H_COL_MID failed"); }
} }
@ -371,7 +371,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
public void Activate() public void Activate()
{ {
if (MainV2.comPort.param["H_GYR_ENABLE"] == null) if (MainV2.comPort.MAV.param["H_GYR_ENABLE"] == null)
{ {
this.Enabled = false; this.Enabled = false;
return; return;
@ -383,26 +383,26 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
timer.Interval = 100; timer.Interval = 100;
timer.Start(); timer.Start();
mavlinkNumericUpDown1min.setup(800,1400,1,1,"HS1_MIN",MainV2.comPort.param); mavlinkNumericUpDown1min.setup(800,1400,1,1,"HS1_MIN",MainV2.comPort.MAV.param);
mavlinkNumericUpDown1max.setup(1600,2200,1,1,"HS1_MAX",MainV2.comPort.param); mavlinkNumericUpDown1max.setup(1600,2200,1,1,"HS1_MAX",MainV2.comPort.MAV.param);
mavlinkNumericUpDown2min.setup(800, 1400, 1, 1, "HS2_MIN", MainV2.comPort.param); mavlinkNumericUpDown2min.setup(800, 1400, 1, 1, "HS2_MIN", MainV2.comPort.MAV.param);
mavlinkNumericUpDown2max.setup(1600, 2200, 1, 1, "HS2_MAX", MainV2.comPort.param); mavlinkNumericUpDown2max.setup(1600, 2200, 1, 1, "HS2_MAX", MainV2.comPort.MAV.param);
mavlinkNumericUpDown3min.setup(800, 1400, 1, 1, "HS3_MIN", MainV2.comPort.param); mavlinkNumericUpDown3min.setup(800, 1400, 1, 1, "HS3_MIN", MainV2.comPort.MAV.param);
mavlinkNumericUpDown3max.setup(1600, 2200, 1, 1, "HS3_MAX", MainV2.comPort.param); mavlinkNumericUpDown3max.setup(1600, 2200, 1, 1, "HS3_MAX", MainV2.comPort.MAV.param);
mavlinkNumericUpDownpitchmax.setup(10, 65, 100, 1, "H_PIT_MAX", MainV2.comPort.param); mavlinkNumericUpDownpitchmax.setup(10, 65, 100, 1, "H_PIT_MAX", MainV2.comPort.MAV.param);
mavlinkNumericUpDownrollmax.setup(10, 65, 100, 1, "H_ROL_MAX", MainV2.comPort.param); mavlinkNumericUpDownrollmax.setup(10, 65, 100, 1, "H_ROL_MAX", MainV2.comPort.MAV.param);
startup = true; startup = true;
try try
{ {
if (MainV2.comPort.param.ContainsKey("H_SWASH_TYPE")) if (MainV2.comPort.MAV.param.ContainsKey("H_SWASH_TYPE"))
{ {
CCPM.Checked = MainV2.comPort.param["H_SWASH_TYPE"].ToString() == "0" ? true : false; CCPM.Checked = MainV2.comPort.MAV.param["H_SWASH_TYPE"].ToString() == "0" ? true : false;
H_SWASH_TYPE.Checked = !CCPM.Checked; H_SWASH_TYPE.Checked = !CCPM.Checked;
} }
foreach (string value in MainV2.comPort.param.Keys) foreach (string value in MainV2.comPort.MAV.param.Keys)
{ {
if (value == "") if (value == "")
continue; continue;
@ -413,34 +413,34 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
if (control[0].GetType() == typeof(TextBox)) if (control[0].GetType() == typeof(TextBox))
{ {
TextBox temp = (TextBox)control[0]; TextBox temp = (TextBox)control[0];
string option = MainV2.comPort.param[value].ToString(); string option = MainV2.comPort.MAV.param[value].ToString();
temp.Text = option; temp.Text = option;
} }
if (control[0].GetType() == typeof(NumericUpDown)) if (control[0].GetType() == typeof(NumericUpDown))
{ {
NumericUpDown temp = (NumericUpDown)control[0]; NumericUpDown temp = (NumericUpDown)control[0];
string option = MainV2.comPort.param[value].ToString(); string option = MainV2.comPort.MAV.param[value].ToString();
temp.Text = option; temp.Text = option;
} }
if (control[0].GetType() == typeof(CheckBox)) if (control[0].GetType() == typeof(CheckBox))
{ {
CheckBox temp = (CheckBox)control[0]; CheckBox temp = (CheckBox)control[0];
string option = MainV2.comPort.param[value].ToString(); string option = MainV2.comPort.MAV.param[value].ToString();
temp.Checked = option == "1" ? true : false; temp.Checked = option == "1" ? true : false;
} }
if (control[0].GetType() == typeof(MyTrackBar)) if (control[0].GetType() == typeof(MyTrackBar))
{ {
ArdupilotMega.Controls.MyTrackBar temp = (MyTrackBar)control[0]; ArdupilotMega.Controls.MyTrackBar temp = (MyTrackBar)control[0];
string option = MainV2.comPort.param[value].ToString(); string option = MainV2.comPort.MAV.param[value].ToString();
temp.Value = int.Parse(option); temp.Value = int.Parse(option);
} }
} }
} }
HS1_REV.Checked = MainV2.comPort.param["HS1_REV"].ToString() == "-1"; HS1_REV.Checked = MainV2.comPort.MAV.param["HS1_REV"].ToString() == "-1";
HS2_REV.Checked = MainV2.comPort.param["HS2_REV"].ToString() == "-1"; HS2_REV.Checked = MainV2.comPort.MAV.param["HS2_REV"].ToString() == "-1";
HS3_REV.Checked = MainV2.comPort.param["HS3_REV"].ToString() == "-1"; HS3_REV.Checked = MainV2.comPort.MAV.param["HS3_REV"].ToString() == "-1";
HS4_REV.Checked = MainV2.comPort.param["HS4_REV"].ToString() == "-1"; HS4_REV.Checked = MainV2.comPort.MAV.param["HS4_REV"].ToString() == "-1";
} }
catch { } catch { }
@ -451,11 +451,11 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
{ {
try try
{ {
MainV2.cs.UpdateCurrentSettings(currentStateBindingSource); MainV2.comPort.MAV.cs.UpdateCurrentSettings(currentStateBindingSource);
} }
catch { } catch { }
if (MainV2.comPort.param["H_SV_MAN"] == null || MainV2.comPort.param["H_SV_MAN"].ToString() == "0") if (MainV2.comPort.MAV.param["H_SV_MAN"] == null || MainV2.comPort.MAV.param["H_SV_MAN"].ToString() == "0")
return; return;
if (HS3.minline == 0) if (HS3.minline == 0)
@ -464,11 +464,11 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
if (HS4.minline == 0) if (HS4.minline == 0)
HS4.minline = 2200; HS4.minline = 2200;
HS3.minline = Math.Min(HS3.minline, (int)MainV2.cs.ch3in); HS3.minline = Math.Min(HS3.minline, (int)MainV2.comPort.MAV.cs.ch3in);
HS3.maxline = Math.Max(HS3.maxline, (int)MainV2.cs.ch3in); HS3.maxline = Math.Max(HS3.maxline, (int)MainV2.comPort.MAV.cs.ch3in);
HS4.minline = Math.Min(HS4.minline, (int)MainV2.cs.ch4in); HS4.minline = Math.Min(HS4.minline, (int)MainV2.comPort.MAV.cs.ch4in);
HS4.maxline = Math.Max(HS4.maxline, (int)MainV2.cs.ch4in); HS4.maxline = Math.Max(HS4.maxline, (int)MainV2.comPort.MAV.cs.ch4in);
if (!inpwmdetect) if (!inpwmdetect)
{ {

View File

@ -15,6 +15,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
{ {
// remember the last page accessed // remember the last page accessed
static string lastpagename = ""; static string lastpagename = "";
public static Controls.FlashMessage flashMessage = new Controls.FlashMessage();
BackstageView.BackstageViewPage hardware; BackstageView.BackstageViewPage hardware;
BackstageView.BackstageViewPage standardpage; BackstageView.BackstageViewPage standardpage;
@ -24,6 +25,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
{ {
InitializeComponent(); InitializeComponent();
ThemeManager.ApplyThemeTo(this); ThemeManager.ApplyThemeTo(this);
this.Controls.Add(flashMessage);
} }
private void Setup_Load(object sender, EventArgs e) private void Setup_Load(object sender, EventArgs e)
@ -70,7 +72,7 @@ If you are just setting up 3DR radios, you may continue without connecting.");
{ {
/****************************** Common **************************/ /****************************** Common **************************/
if ((MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2) || (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane) || (MainV2.cs.firmware == MainV2.Firmwares.ArduRover)) if ((MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduCopter2) || (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane) || (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduRover))
{ {
AddBackstageViewPage(new ConfigRadioInput(), "Radio Calibration"); AddBackstageViewPage(new ConfigRadioInput(), "Radio Calibration");
AddBackstageViewPage(new ConfigFlightModes(), "Flight Modes"); AddBackstageViewPage(new ConfigFlightModes(), "Flight Modes");
@ -79,7 +81,7 @@ If you are just setting up 3DR radios, you may continue without connecting.");
AddBackstageViewPage(new ConfigBatteryMonitoring(), "Battery Monitor", hardware); AddBackstageViewPage(new ConfigBatteryMonitoring(), "Battery Monitor", hardware);
} }
if ((MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2) || (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane) || (MainV2.cs.firmware == MainV2.Firmwares.ArduRover)) if ((MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduCopter2) || (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane) || (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduRover))
{ {
standardpage = AddBackstageViewPage(new ConfigFriendlyParams { ParameterMode = ParameterMetaDataConstants.Standard }, "Standard Params"); standardpage = AddBackstageViewPage(new ConfigFriendlyParams { ParameterMode = ParameterMetaDataConstants.Standard }, "Standard Params");
advancedpage = AddBackstageViewPage(new ConfigFriendlyParams { ParameterMode = ParameterMetaDataConstants.Advanced }, "Advanced Params"); advancedpage = AddBackstageViewPage(new ConfigFriendlyParams { ParameterMode = ParameterMetaDataConstants.Advanced }, "Advanced Params");
@ -87,8 +89,10 @@ If you are just setting up 3DR radios, you may continue without connecting.");
AddBackstageViewPage(new ConfigRawParams(), "Adv Parameter List", advancedpage); AddBackstageViewPage(new ConfigRawParams(), "Adv Parameter List", advancedpage);
/******************************HELI **************************/ /******************************HELI **************************/
if (MainV2.comPort.param["H_GYR_ENABLE"] != null) // heli if (MainV2.comPort.MAV.param["H_GYR_ENABLE"] != null) // heli
{ {
// AddBackstageViewPage(new ConfigSignalization(), "Signalization", hardware);
AddBackstageViewPage(new ConfigMount(), "Camera Gimbal", hardware); AddBackstageViewPage(new ConfigMount(), "Camera Gimbal", hardware);
AddBackstageViewPage(new ConfigAccelerometerCalibrationQuad(), "ArduCopter Level"); AddBackstageViewPage(new ConfigAccelerometerCalibrationQuad(), "ArduCopter Level");
@ -102,8 +106,10 @@ If you are just setting up 3DR radios, you may continue without connecting.");
// AddBackstageViewPage(new ConfigAP_Limits(), "GeoFence"); // AddBackstageViewPage(new ConfigAP_Limits(), "GeoFence");
} }
/****************************** ArduCopter **************************/ /****************************** ArduCopter **************************/
else if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2) else if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduCopter2)
{ {
// AddBackstageViewPage(new ConfigSignalization(), "Signalization", hardware);
AddBackstageViewPage(new ConfigMount(), "Camera Gimbal", hardware); AddBackstageViewPage(new ConfigMount(), "Camera Gimbal", hardware);
AddBackstageViewPage(new ConfigAccelerometerCalibrationQuad(), "ArduCopter Level"); AddBackstageViewPage(new ConfigAccelerometerCalibrationQuad(), "ArduCopter Level");
@ -115,7 +121,7 @@ If you are just setting up 3DR radios, you may continue without connecting.");
AddBackstageViewPage(new ConfigAP_Limits(), "GeoFence"); AddBackstageViewPage(new ConfigAP_Limits(), "GeoFence");
} }
/****************************** ArduPlane **************************/ /****************************** ArduPlane **************************/
else if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane) else if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane)
{ {
AddBackstageViewPage(new ConfigMount(), "Camera Gimbal", hardware); AddBackstageViewPage(new ConfigMount(), "Camera Gimbal", hardware);
@ -123,12 +129,12 @@ If you are just setting up 3DR radios, you may continue without connecting.");
AddBackstageViewPage(new ConfigArduplane(), "ArduPlane Pids", standardpage); AddBackstageViewPage(new ConfigArduplane(), "ArduPlane Pids", standardpage);
} }
/****************************** ArduRover **************************/ /****************************** ArduRover **************************/
else if (MainV2.cs.firmware == MainV2.Firmwares.ArduRover) else if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduRover)
{ {
//AddBackstageViewPage(new ConfigAccelerometerCalibrationPlane(), "ArduRover Level")); //AddBackstageViewPage(new ConfigAccelerometerCalibrationPlane(), "ArduRover Level"));
AddBackstageViewPage(new ConfigArdurover(), "ArduRover Pids", standardpage); AddBackstageViewPage(new ConfigArdurover(), "ArduRover Pids", standardpage);
} }
else if (MainV2.cs.firmware == MainV2.Firmwares.Ateryx) else if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.Ateryx)
{ {
AddBackstageViewPage(new ConfigAteryxSensors(), "Ateryx Zero Sensors"); AddBackstageViewPage(new ConfigAteryxSensors(), "Ateryx Zero Sensors");

View File

@ -34,7 +34,7 @@ namespace ArdupilotMega.GCSViews
//"http://meee146-planner.googlecode.com/git/Tools/ArdupilotMegaPlanner/Firmware/AC2-Y6-1280.hex" //"http://meee146-planner.googlecode.com/git/Tools/ArdupilotMegaPlanner/Firmware/AC2-Y6-1280.hex"
readonly string oldurl = ("https://meee146-planner.googlecode.com/git-history/!Hash!/Tools/ArdupilotMegaPlanner/Firmware/firmware2.xml"); readonly string oldurl = ("https://meee146-planner.googlecode.com/git-history/!Hash!/Tools/ArdupilotMegaPlanner/Firmware/firmware2.xml");
readonly string oldfirmwareurl = ("https://meee146-planner.googlecode.com/git-history/!Hash!/Tools/ArdupilotMegaPlanner/Firmware/!Firmware!"); readonly string oldfirmwareurl = ("https://meee146-planner.googlecode.com/git-history/!Hash!/Tools/ArdupilotMegaPlanner/Firmware/!Firmware!");
string[] oldurls = new string[] { "55ec5eaf662a56044ea25c894d235d17185f0660", "cb5b736976c7ed791ea45675c31f588ecb8228d4", "bcd5239322df38db011f183e48d596f215803838", "8709cc418e00326295abc562530413c0089807a7", "06a64192df594b0f81233dfb1f0214aab2cb2603", "7853ef3fad98e5053f228b7c1748c76858c4d282", "abe930ce723267697542388ef181328f00371f40", "26305d5790333f730cd396afcd08c165cde33ed7", "bc1f26ca40b076e3d06f173adad772fb25aa6512", "dfc5737c5efc1e7b78e908829a097624c273d9d7", "682065db449b6c79d89717908ed8beea1ed6a03a", "b21116847d35472b9ab770408cbeb88ed2ed0a95", "511e00bc89a554aea8768a274bff28af532cd335", "1da56714aa1ed88dcdb078a90d33bcef4eb4315f", "8aa4c7a1ed07648f31335926cc6bcc06c87dc536" }; string[] oldurls = new string[] { "bb5ee0e1c3e643e7e359ffb4c8bde34aa7d4f996", "55ec5eaf662a56044ea25c894d235d17185f0660", "cb5b736976c7ed791ea45675c31f588ecb8228d4", "bcd5239322df38db011f183e48d596f215803838", "8709cc418e00326295abc562530413c0089807a7", "06a64192df594b0f81233dfb1f0214aab2cb2603", "7853ef3fad98e5053f228b7c1748c76858c4d282", "abe930ce723267697542388ef181328f00371f40", "26305d5790333f730cd396afcd08c165cde33ed7", "bc1f26ca40b076e3d06f173adad772fb25aa6512", "dfc5737c5efc1e7b78e908829a097624c273d9d7", "682065db449b6c79d89717908ed8beea1ed6a03a", "b21116847d35472b9ab770408cbeb88ed2ed0a95", "511e00bc89a554aea8768a274bff28af532cd335", "1da56714aa1ed88dcdb078a90d33bcef4eb4315f", "8aa4c7a1ed07648f31335926cc6bcc06c87dc536" };
List<software> softwares = new List<software>(); List<software> softwares = new List<software>();
bool flashing = false; bool flashing = false;

View File

@ -1116,12 +1116,12 @@
// splitContainer1.Panel2 // splitContainer1.Panel2
// //
this.splitContainer1.Panel2.ContextMenuStrip = this.contextMenuStripMap; this.splitContainer1.Panel2.ContextMenuStrip = this.contextMenuStripMap;
this.splitContainer1.Panel2.Controls.Add(this.gMapControl1);
this.splitContainer1.Panel2.Controls.Add(this.TRK_zoom);
this.splitContainer1.Panel2.Controls.Add(this.lbl_winddir); this.splitContainer1.Panel2.Controls.Add(this.lbl_winddir);
this.splitContainer1.Panel2.Controls.Add(this.lbl_windvel); this.splitContainer1.Panel2.Controls.Add(this.lbl_windvel);
this.splitContainer1.Panel2.Controls.Add(this.lbl_hdop); this.splitContainer1.Panel2.Controls.Add(this.lbl_hdop);
this.splitContainer1.Panel2.Controls.Add(this.lbl_sats); this.splitContainer1.Panel2.Controls.Add(this.lbl_sats);
this.splitContainer1.Panel2.Controls.Add(this.gMapControl1);
this.splitContainer1.Panel2.Controls.Add(this.TRK_zoom);
// //
// zg1 // zg1
// //

View File

@ -235,7 +235,7 @@ namespace ArdupilotMega.GCSViews
int x = 10; int x = 10;
int y = 10; int y = 10;
object thisBoxed = MainV2.cs; object thisBoxed = MainV2.comPort.MAV.cs;
Type test = thisBoxed.GetType(); Type test = thisBoxed.GetType();
foreach (var field in test.GetProperties()) foreach (var field in test.GetProperties())
@ -336,7 +336,7 @@ namespace ArdupilotMega.GCSViews
if (ctls.Length > 0) if (ctls.Length > 0)
{ {
// set description // set description
((QuickView)ctls[0]).desc = MainV2.cs.GetNameandUnit(MainV2.config["quickView" + f].ToString()); ((QuickView)ctls[0]).desc = MainV2.comPort.MAV.cs.GetNameandUnit(MainV2.config["quickView" + f].ToString());
// set databinding for value // set databinding for value
((QuickView)ctls[0]).DataBindings.Clear(); ((QuickView)ctls[0]).DataBindings.Clear();
@ -351,14 +351,14 @@ namespace ArdupilotMega.GCSViews
Control[] ctls = this.Controls.Find("quickView" + f, true); Control[] ctls = this.Controls.Find("quickView" + f, true);
if (ctls.Length > 0) if (ctls.Length > 0)
{ {
((QuickView)ctls[0]).desc = MainV2.cs.GetNameandUnit(((QuickView)ctls[0]).desc); ((QuickView)ctls[0]).desc = MainV2.comPort.MAV.cs.GetNameandUnit(((QuickView)ctls[0]).desc);
} }
} }
catch { } catch { }
} }
} }
if (MainV2.comPort.param.ContainsKey("BATT_MONITOR") && (float)MainV2.comPort.param["BATT_MONITOR"] != 0) if (MainV2.comPort.MAV.param.ContainsKey("BATT_MONITOR") && (float)MainV2.comPort.MAV.param["BATT_MONITOR"] != 0)
{ {
hud1.batteryon = true; hud1.batteryon = true;
} }
@ -490,13 +490,13 @@ namespace ArdupilotMega.GCSViews
//System.Threading.Thread.Sleep(1000); //System.Threading.Thread.Sleep(1000);
//comPort.requestDatastream((byte)ArdupilotMega.MAVLink09.MAV_DATA_STREAM.RAW_CONTROLLER, 0); // request servoout //comPort.requestDatastream((byte)ArdupilotMega.MAVLink09.MAV_DATA_STREAM.RAW_CONTROLLER, 0); // request servoout
MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.EXTENDED_STATUS, MainV2.cs.ratestatus); // mode MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.EXTENDED_STATUS, MainV2.comPort.MAV.cs.ratestatus); // mode
MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.POSITION, MainV2.cs.rateposition); // request gps MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.POSITION, MainV2.comPort.MAV.cs.rateposition); // request gps
MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.EXTRA1, MainV2.cs.rateattitude); // request attitude MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.EXTRA1, MainV2.comPort.MAV.cs.rateattitude); // request attitude
MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.EXTRA2, MainV2.cs.rateattitude); // request vfr MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.EXTRA2, MainV2.comPort.MAV.cs.rateattitude); // request vfr
MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.EXTRA3, MainV2.cs.ratesensors); // request extra stuff - tridge MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.EXTRA3, MainV2.comPort.MAV.cs.ratesensors); // request extra stuff - tridge
MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.RAW_SENSORS, MainV2.cs.ratesensors); // request raw sensor MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.RAW_SENSORS, MainV2.comPort.MAV.cs.ratesensors); // request raw sensor
MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.RC_CHANNELS, MainV2.cs.raterc); // request rc info MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.RC_CHANNELS, MainV2.comPort.MAV.cs.raterc); // request rc info
} }
catch { log.Error("Failed to request rates"); } catch { log.Error("Failed to request rates"); }
lastdata = DateTime.Now.AddSeconds(120); // prevent flooding lastdata = DateTime.Now.AddSeconds(120); // prevent flooding
@ -643,8 +643,8 @@ namespace ArdupilotMega.GCSViews
if (ArdupilotMega.Controls.OpenGLtest.instance != null) 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.rpy = new OpenTK.Vector3(MainV2.comPort.MAV.cs.roll, MainV2.comPort.MAV.cs.pitch, MainV2.comPort.MAV.cs.yaw);
ArdupilotMega.Controls.OpenGLtest.instance.LocationCenter = new PointLatLngAlt(MainV2.cs.lat, MainV2.cs.lng, MainV2.cs.alt, "here"); ArdupilotMega.Controls.OpenGLtest.instance.LocationCenter = new PointLatLngAlt(MainV2.comPort.MAV.cs.lat, MainV2.comPort.MAV.cs.lng, MainV2.comPort.MAV.cs.alt, "here");
} }
if (tunning.AddMilliseconds(50) < DateTime.Now && CB_tuning.Checked == true) if (tunning.AddMilliseconds(50) < DateTime.Now && CB_tuning.Checked == true)
@ -652,25 +652,25 @@ namespace ArdupilotMega.GCSViews
double time = (Environment.TickCount - tickStart) / 1000.0; double time = (Environment.TickCount - tickStart) / 1000.0;
if (list1item != null) if (list1item != null)
list1.Add(time, (float)list1item.GetValue((object)MainV2.cs, null)); list1.Add(time, (float)list1item.GetValue((object)MainV2.comPort.MAV.cs, null));
if (list2item != null) if (list2item != null)
list2.Add(time, (float)list2item.GetValue((object)MainV2.cs, null)); list2.Add(time, (float)list2item.GetValue((object)MainV2.comPort.MAV.cs, null));
if (list3item != null) if (list3item != null)
list3.Add(time, (float)list3item.GetValue((object)MainV2.cs, null)); list3.Add(time, (float)list3item.GetValue((object)MainV2.comPort.MAV.cs, null));
if (list4item != null) if (list4item != null)
list4.Add(time, (float)list4item.GetValue((object)MainV2.cs, null)); list4.Add(time, (float)list4item.GetValue((object)MainV2.comPort.MAV.cs, null));
if (list5item != null) if (list5item != null)
list5.Add(time, (float)list5item.GetValue((object)MainV2.cs, null)); list5.Add(time, (float)list5item.GetValue((object)MainV2.comPort.MAV.cs, null));
if (list6item != null) if (list6item != null)
list6.Add(time, (float)list6item.GetValue((object)MainV2.cs, null)); list6.Add(time, (float)list6item.GetValue((object)MainV2.comPort.MAV.cs, null));
if (list7item != null) if (list7item != null)
list7.Add(time, (float)list7item.GetValue((object)MainV2.cs, null)); list7.Add(time, (float)list7item.GetValue((object)MainV2.comPort.MAV.cs, null));
if (list8item != null) if (list8item != null)
list8.Add(time, (float)list8item.GetValue((object)MainV2.cs, null)); list8.Add(time, (float)list8item.GetValue((object)MainV2.comPort.MAV.cs, null));
if (list9item != null) if (list9item != null)
list9.Add(time, (float)list9item.GetValue((object)MainV2.cs, null)); list9.Add(time, (float)list9item.GetValue((object)MainV2.comPort.MAV.cs, null));
if (list10item != null) if (list10item != null)
list10.Add(time, (float)list10item.GetValue((object)MainV2.cs, null)); list10.Add(time, (float)list10item.GetValue((object)MainV2.comPort.MAV.cs, null));
} }
if (tracklast.AddSeconds(1) < DateTime.Now) if (tracklast.AddSeconds(1) < DateTime.Now)
@ -687,7 +687,7 @@ namespace ArdupilotMega.GCSViews
routes.Routes.Add(route); routes.Routes.Add(route);
} }
PointLatLng currentloc = new PointLatLng(MainV2.cs.lat, MainV2.cs.lng); PointLatLng currentloc = new PointLatLng(MainV2.comPort.MAV.cs.lat, MainV2.comPort.MAV.cs.lng);
gMapControl1.HoldInvalidation = true; gMapControl1.HoldInvalidation = true;
@ -704,7 +704,7 @@ namespace ArdupilotMega.GCSViews
// 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())); route.Points.RemoveRange(0, route.Points.Count - int.Parse(MainV2.config["NUM_tracklength"].ToString()));
} }
if (MainV2.cs.lat != 0) if (MainV2.comPort.MAV.cs.lat != 0)
{ {
// trackPoints.Add(currentloc); // trackPoints.Add(currentloc);
route.Points.Add(currentloc); route.Points.Add(currentloc);
@ -734,7 +734,7 @@ namespace ArdupilotMega.GCSViews
//Console.WriteLine("Doing FD WP's"); //Console.WriteLine("Doing FD WP's");
updateMissionRouteMarkers(); updateMissionRouteMarkers();
foreach (MAVLink.mavlink_mission_item_t plla in MainV2.comPort.wps.Values) foreach (MAVLink.mavlink_mission_item_t plla in MainV2.comPort.MAV.wps.Values)
{ {
if (plla.x == 0 || plla.y == 0) if (plla.x == 0 || plla.y == 0)
continue; continue;
@ -774,22 +774,22 @@ namespace ArdupilotMega.GCSViews
routes.Markers.Add(new GMapMarkerCross(currentloc)); routes.Markers.Add(new GMapMarkerCross(currentloc));
} }
if (MainV2.cs.mode.ToLower() == "guided" && MainV2.comPort.GuidedMode.x != 0) if (MainV2.comPort.MAV.cs.mode.ToLower() == "guided" && MainV2.comPort.MAV.GuidedMode.x != 0)
{ {
addpolygonmarker("Guided Mode", MainV2.comPort.GuidedMode.y, MainV2.comPort.GuidedMode.x, (int)MainV2.comPort.GuidedMode.z, Color.Blue, routes); addpolygonmarker("Guided Mode", MainV2.comPort.MAV.GuidedMode.y, MainV2.comPort.MAV.GuidedMode.x, (int)MainV2.comPort.MAV.GuidedMode.z, Color.Blue, routes);
} }
if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane)
{ {
routes.Markers[0] = (new GMapMarkerPlane(currentloc, MainV2.cs.yaw, MainV2.cs.groundcourse, MainV2.cs.nav_bearing, MainV2.cs.target_bearing, gMapControl1) { ToolTipText = MainV2.cs.alt.ToString("0"), ToolTipMode = MarkerTooltipMode.Always }); routes.Markers[0] = (new GMapMarkerPlane(currentloc, MainV2.comPort.MAV.cs.yaw, MainV2.comPort.MAV.cs.groundcourse, MainV2.comPort.MAV.cs.nav_bearing, MainV2.comPort.MAV.cs.target_bearing, gMapControl1) { ToolTipText = MainV2.comPort.MAV.cs.alt.ToString("0"), ToolTipMode = MarkerTooltipMode.Always });
} }
else if (MainV2.cs.firmware == MainV2.Firmwares.ArduRover) else if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduRover)
{ {
routes.Markers[0] = (new GMapMarkerRover(currentloc, MainV2.cs.yaw, MainV2.cs.groundcourse, MainV2.cs.nav_bearing, MainV2.cs.target_bearing, gMapControl1)); routes.Markers[0] = (new GMapMarkerRover(currentloc, MainV2.comPort.MAV.cs.yaw, MainV2.comPort.MAV.cs.groundcourse, MainV2.comPort.MAV.cs.nav_bearing, MainV2.comPort.MAV.cs.target_bearing, gMapControl1));
} }
else else
{ {
routes.Markers[0] = (new GMapMarkerQuad(currentloc, MainV2.cs.yaw, MainV2.cs.groundcourse, MainV2.cs.nav_bearing)); routes.Markers[0] = (new GMapMarkerQuad(currentloc, MainV2.comPort.MAV.cs.yaw, MainV2.comPort.MAV.cs.groundcourse, MainV2.comPort.MAV.cs.nav_bearing));
} }
if (route.Points[route.Points.Count - 1].Lat != 0 && (mapupdate.AddSeconds(3) < DateTime.Now) && CHK_autopan.Checked) if (route.Points[route.Points.Count - 1].Lat != 0 && (mapupdate.AddSeconds(3) < DateTime.Now) && CHK_autopan.Checked)
@ -823,7 +823,7 @@ namespace ArdupilotMega.GCSViews
{ {
this.Invoke((System.Windows.Forms.MethodInvoker)delegate() this.Invoke((System.Windows.Forms.MethodInvoker)delegate()
{ {
gMapControl1.Bearing = (int)MainV2.cs.yaw; gMapControl1.Bearing = (int)MainV2.comPort.MAV.cs.yaw;
}); });
} }
@ -889,7 +889,7 @@ namespace ArdupilotMega.GCSViews
{ {
try try
{ {
MainV2.cs.UpdateCurrentSettings(bindingSource1); MainV2.comPort.MAV.cs.UpdateCurrentSettings(bindingSource1);
} }
catch { } catch { }
}); });
@ -951,7 +951,7 @@ namespace ArdupilotMega.GCSViews
mBorders.InnerMarker = m; mBorders.InnerMarker = m;
try try
{ {
mBorders.wprad = (int)(float.Parse(ArdupilotMega.MainV2.config["TXT_WPRad"].ToString()) / MainV2.cs.multiplierdist); mBorders.wprad = (int)(float.Parse(ArdupilotMega.MainV2.config["TXT_WPRad"].ToString()) / MainV2.comPort.MAV.cs.multiplierdist);
} }
catch { } catch { }
mBorders.MainMap = gMapControl1; mBorders.MainMap = gMapControl1;
@ -1243,11 +1243,11 @@ namespace ArdupilotMega.GCSViews
return; return;
} }
if (MainV2.comPort.GuidedMode.z == 0) if (MainV2.comPort.MAV.GuidedMode.z == 0)
{ {
flyToHereAltToolStripMenuItem_Click(null, null); flyToHereAltToolStripMenuItem_Click(null, null);
if (MainV2.comPort.GuidedMode.z == 0) if (MainV2.comPort.MAV.GuidedMode.z == 0)
return; return;
} }
@ -1260,7 +1260,7 @@ namespace ArdupilotMega.GCSViews
Locationwp gotohere = new Locationwp(); Locationwp gotohere = new Locationwp();
gotohere.id = (byte)MAVLink.MAV_CMD.WAYPOINT; gotohere.id = (byte)MAVLink.MAV_CMD.WAYPOINT;
gotohere.alt = (float)(MainV2.comPort.GuidedMode.z); // back to m gotohere.alt = (float)(MainV2.comPort.MAV.GuidedMode.z); // back to m
gotohere.lat = (float)(gotolocation.Lat); gotohere.lat = (float)(gotolocation.Lat);
gotohere.lng = (float)(gotolocation.Lng); gotohere.lng = (float)(gotolocation.Lng);
@ -1317,7 +1317,7 @@ namespace ArdupilotMega.GCSViews
marker = new GMapMarkerRect(point); marker = new GMapMarkerRect(point);
marker.ToolTip = new GMapToolTip(marker); marker.ToolTip = new GMapToolTip(marker);
marker.ToolTipMode = MarkerTooltipMode.Always; marker.ToolTipMode = MarkerTooltipMode.Always;
marker.ToolTipText = "Dist to Home: " + ((gMapControl1.Manager.GetDistance(point, MainV2.cs.HomeLocation.Point()) * 1000) * MainV2.cs.multiplierdist).ToString("0"); marker.ToolTipText = "Dist to Home: " + ((gMapControl1.Manager.GetDistance(point, MainV2.comPort.MAV.cs.HomeLocation.Point()) * 1000) * MainV2.comPort.MAV.cs.multiplierdist).ToString("0");
routes.Markers.Add(marker); routes.Markers.Add(marker);
} }
@ -1332,20 +1332,20 @@ namespace ArdupilotMega.GCSViews
} }
// QUAD // QUAD
if (MainV2.comPort.param.ContainsKey("WP_SPEED_MAX")) if (MainV2.comPort.MAV.param.ContainsKey("WP_SPEED_MAX"))
{ {
modifyandSetSpeed.Value = (decimal)((float)MainV2.comPort.param["WP_SPEED_MAX"] / 100.0); modifyandSetSpeed.Value = (decimal)((float)MainV2.comPort.MAV.param["WP_SPEED_MAX"] / 100.0);
} // plane with airspeed } // plane with airspeed
else if (MainV2.comPort.param.ContainsKey("TRIM_ARSPD_CM") && MainV2.comPort.param.ContainsKey("ARSPD_ENABLE") else if (MainV2.comPort.MAV.param.ContainsKey("TRIM_ARSPD_CM") && MainV2.comPort.MAV.param.ContainsKey("ARSPD_ENABLE")
&& MainV2.comPort.param.ContainsKey("ARSPD_USE") && (float)MainV2.comPort.param["ARSPD_ENABLE"] == 1 && MainV2.comPort.MAV.param.ContainsKey("ARSPD_USE") && (float)MainV2.comPort.MAV.param["ARSPD_ENABLE"] == 1
&& (float)MainV2.comPort.param["ARSPD_USE"] == 1) && (float)MainV2.comPort.MAV.param["ARSPD_USE"] == 1)
{ {
modifyandSetSpeed.Value = (decimal)((float)MainV2.comPort.param["TRIM_ARSPD_CM"] / 100.0); modifyandSetSpeed.Value = (decimal)((float)MainV2.comPort.MAV.param["TRIM_ARSPD_CM"] / 100.0);
} // plane without airspeed } // plane without airspeed
else if (MainV2.comPort.param.ContainsKey("TRIM_THROTTLE") && MainV2.comPort.param.ContainsKey("ARSPD_USE") else if (MainV2.comPort.MAV.param.ContainsKey("TRIM_THROTTLE") && MainV2.comPort.MAV.param.ContainsKey("ARSPD_USE")
&& (float)MainV2.comPort.param["ARSPD_USE"] == 0) && (float)MainV2.comPort.MAV.param["ARSPD_USE"] == 0)
{ {
modifyandSetSpeed.Value = (decimal)(float)MainV2.comPort.param["TRIM_THROTTLE"]; // percent modifyandSetSpeed.Value = (decimal)(float)MainV2.comPort.MAV.param["TRIM_THROTTLE"]; // percent
} }
MainV2.comPort.ParamListChanged += FlightData_ParentChanged; MainV2.comPort.ParamListChanged += FlightData_ParentChanged;
@ -1358,13 +1358,13 @@ namespace ArdupilotMega.GCSViews
private void BUT_Homealt_Click(object sender, EventArgs e) private void BUT_Homealt_Click(object sender, EventArgs e)
{ {
if (MainV2.cs.altoffsethome != 0) if (MainV2.comPort.MAV.cs.altoffsethome != 0)
{ {
MainV2.cs.altoffsethome = 0; MainV2.comPort.MAV.cs.altoffsethome = 0;
} }
else else
{ {
MainV2.cs.altoffsethome = MainV2.cs.alt / MainV2.cs.multiplierdist; MainV2.comPort.MAV.cs.altoffsethome = MainV2.comPort.MAV.cs.alt / MainV2.comPort.MAV.cs.multiplierdist;
} }
} }
@ -1542,9 +1542,9 @@ namespace ArdupilotMega.GCSViews
CMB_setwp.Items.Add("0 (Home)"); CMB_setwp.Items.Add("0 (Home)");
if (MainV2.comPort.param["CMD_TOTAL"] != null) if (MainV2.comPort.MAV.param["CMD_TOTAL"] != null)
{ {
int wps = int.Parse(MainV2.comPort.param["CMD_TOTAL"].ToString()); int wps = int.Parse(MainV2.comPort.MAV.param["CMD_TOTAL"].ToString());
for (int z = 1; z <= wps; z++) for (int z = 1; z <= wps; z++)
{ {
CMB_setwp.Items.Add(z.ToString()); CMB_setwp.Items.Add(z.ToString());
@ -1579,9 +1579,9 @@ namespace ArdupilotMega.GCSViews
try try
{ {
((Button)sender).Enabled = false; ((Button)sender).Enabled = false;
if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane)
MainV2.comPort.setMode("Manual"); MainV2.comPort.setMode("Manual");
if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduCopter2)
MainV2.comPort.setMode("Stabilize"); MainV2.comPort.setMode("Stabilize");
} }
@ -1763,7 +1763,7 @@ namespace ArdupilotMega.GCSViews
y += 20; y += 20;
object thisBoxed = MainV2.cs; object thisBoxed = MainV2.comPort.MAV.cs;
Type test = thisBoxed.GetType(); Type test = thisBoxed.GetType();
foreach (var field in test.GetProperties()) foreach (var field in test.GetProperties())
@ -1844,7 +1844,7 @@ namespace ArdupilotMega.GCSViews
int x = 10; int x = 10;
int y = 10; int y = 10;
object thisBoxed = MainV2.cs; object thisBoxed = MainV2.comPort.MAV.cs;
Type test = thisBoxed.GetType(); Type test = thisBoxed.GetType();
foreach (var field in test.GetProperties()) foreach (var field in test.GetProperties())
@ -1898,7 +1898,7 @@ namespace ArdupilotMega.GCSViews
void addHudUserItem(ref HUD.Custom cust, CheckBox sender) void addHudUserItem(ref HUD.Custom cust, CheckBox sender)
{ {
setupPropertyInfo(ref cust.Item, (sender).Name, MainV2.cs); setupPropertyInfo(ref cust.Item, (sender).Name, MainV2.comPort.MAV.cs);
hud1.CustomItems.Add((sender).Name, cust); hud1.CustomItems.Add((sender).Name, cust);
@ -1952,7 +1952,7 @@ namespace ArdupilotMega.GCSViews
{ {
if (list1item == null) if (list1item == null)
{ {
if (setupPropertyInfo(ref list1item, ((CheckBox)sender).Name, MainV2.cs)) if (setupPropertyInfo(ref list1item, ((CheckBox)sender).Name, MainV2.comPort.MAV.cs))
{ {
list1.Clear(); list1.Clear();
list1curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list1, Color.Red, SymbolType.None); list1curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list1, Color.Red, SymbolType.None);
@ -1960,7 +1960,7 @@ namespace ArdupilotMega.GCSViews
} }
else if (list2item == null) else if (list2item == null)
{ {
if (setupPropertyInfo(ref list2item, ((CheckBox)sender).Name, MainV2.cs)) if (setupPropertyInfo(ref list2item, ((CheckBox)sender).Name, MainV2.comPort.MAV.cs))
{ {
list2.Clear(); list2.Clear();
list2curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list2, Color.Blue, SymbolType.None); list2curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list2, Color.Blue, SymbolType.None);
@ -1968,7 +1968,7 @@ namespace ArdupilotMega.GCSViews
} }
else if (list3item == null) else if (list3item == null)
{ {
if (setupPropertyInfo(ref list3item, ((CheckBox)sender).Name, MainV2.cs)) if (setupPropertyInfo(ref list3item, ((CheckBox)sender).Name, MainV2.comPort.MAV.cs))
{ {
list3.Clear(); list3.Clear();
list3curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list3, Color.Green, SymbolType.None); list3curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list3, Color.Green, SymbolType.None);
@ -1976,7 +1976,7 @@ namespace ArdupilotMega.GCSViews
} }
else if (list4item == null) else if (list4item == null)
{ {
if (setupPropertyInfo(ref list4item, ((CheckBox)sender).Name, MainV2.cs)) if (setupPropertyInfo(ref list4item, ((CheckBox)sender).Name, MainV2.comPort.MAV.cs))
{ {
list4.Clear(); list4.Clear();
list4curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list4, Color.Orange, SymbolType.None); list4curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list4, Color.Orange, SymbolType.None);
@ -1984,7 +1984,7 @@ namespace ArdupilotMega.GCSViews
} }
else if (list5item == null) else if (list5item == null)
{ {
if (setupPropertyInfo(ref list5item, ((CheckBox)sender).Name, MainV2.cs)) if (setupPropertyInfo(ref list5item, ((CheckBox)sender).Name, MainV2.comPort.MAV.cs))
{ {
list5.Clear(); list5.Clear();
list5curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list5, Color.Yellow, SymbolType.None); list5curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list5, Color.Yellow, SymbolType.None);
@ -1992,7 +1992,7 @@ namespace ArdupilotMega.GCSViews
} }
else if (list6item == null) else if (list6item == null)
{ {
if (setupPropertyInfo(ref list6item, ((CheckBox)sender).Name, MainV2.cs)) if (setupPropertyInfo(ref list6item, ((CheckBox)sender).Name, MainV2.comPort.MAV.cs))
{ {
list6.Clear(); list6.Clear();
list6curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list6, Color.Magenta, SymbolType.None); list6curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list6, Color.Magenta, SymbolType.None);
@ -2000,7 +2000,7 @@ namespace ArdupilotMega.GCSViews
} }
else if (list7item == null) else if (list7item == null)
{ {
if (setupPropertyInfo(ref list7item, ((CheckBox)sender).Name, MainV2.cs)) if (setupPropertyInfo(ref list7item, ((CheckBox)sender).Name, MainV2.comPort.MAV.cs))
{ {
list7.Clear(); list7.Clear();
list7curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list7, Color.Purple, SymbolType.None); list7curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list7, Color.Purple, SymbolType.None);
@ -2008,7 +2008,7 @@ namespace ArdupilotMega.GCSViews
} }
else if (list8item == null) else if (list8item == null)
{ {
if (setupPropertyInfo(ref list8item, ((CheckBox)sender).Name, MainV2.cs)) if (setupPropertyInfo(ref list8item, ((CheckBox)sender).Name, MainV2.comPort.MAV.cs))
{ {
list8.Clear(); list8.Clear();
list8curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list8, Color.LimeGreen, SymbolType.None); list8curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list8, Color.LimeGreen, SymbolType.None);
@ -2016,7 +2016,7 @@ namespace ArdupilotMega.GCSViews
} }
else if (list9item == null) else if (list9item == null)
{ {
if (setupPropertyInfo(ref list9item, ((CheckBox)sender).Name, MainV2.cs)) if (setupPropertyInfo(ref list9item, ((CheckBox)sender).Name, MainV2.comPort.MAV.cs))
{ {
list9.Clear(); list9.Clear();
list9curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list9, Color.Cyan, SymbolType.None); list9curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list9, Color.Cyan, SymbolType.None);
@ -2024,7 +2024,7 @@ namespace ArdupilotMega.GCSViews
} }
else if (list10item == null) else if (list10item == null)
{ {
if (setupPropertyInfo(ref list10item, ((CheckBox)sender).Name, MainV2.cs)) if (setupPropertyInfo(ref list10item, ((CheckBox)sender).Name, MainV2.comPort.MAV.cs))
{ {
list10.Clear(); list10.Clear();
list10curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list10, Color.Violet, SymbolType.None); list10curve = zg1.GraphPane.AddCurve(((CheckBox)sender).Name, list10, Color.Violet, SymbolType.None);
@ -2119,10 +2119,10 @@ namespace ArdupilotMega.GCSViews
return; return;
} }
string alt = (100 * MainV2.cs.multiplierdist).ToString("0"); string alt = (100 * MainV2.comPort.MAV.cs.multiplierdist).ToString("0");
Common.InputBox("Enter Alt", "Enter Target Alt (absolute)", ref alt); Common.InputBox("Enter Alt", "Enter Target Alt (absolute)", ref alt);
int intalt = (int)(100 * MainV2.cs.multiplierdist); int intalt = (int)(100 * MainV2.comPort.MAV.cs.multiplierdist);
if (!int.TryParse(alt, out intalt)) if (!int.TryParse(alt, out intalt))
{ {
CustomMessageBox.Show("Bad Alt"); CustomMessageBox.Show("Bad Alt");
@ -2136,7 +2136,7 @@ namespace ArdupilotMega.GCSViews
} }
MainV2.comPort.setMountConfigure(MAVLink.MAV_MOUNT_MODE.GPS_POINT, true, true, true); MainV2.comPort.setMountConfigure(MAVLink.MAV_MOUNT_MODE.GPS_POINT, true, true, true);
MainV2.comPort.setMountControl(gotolocation.Lat, gotolocation.Lng, (int)(intalt / MainV2.cs.multiplierdist), true); MainV2.comPort.setMountControl(gotolocation.Lat, gotolocation.Lng, (int)(intalt / MainV2.comPort.MAV.cs.multiplierdist), true);
} }
@ -2305,7 +2305,7 @@ print 'Roll complete'
int x = 10; int x = 10;
int y = 10; int y = 10;
object thisBoxed = MainV2.cs; object thisBoxed = MainV2.comPort.MAV.cs;
Type test = thisBoxed.GetType(); Type test = thisBoxed.GetType();
foreach (var field in test.GetProperties()) foreach (var field in test.GetProperties())
@ -2326,7 +2326,7 @@ print 'Roll complete'
CheckBox chk_box = new CheckBox(); CheckBox chk_box = new CheckBox();
if (((QuickView)sender).Tag == field.Name) if (((QuickView)sender).Tag.ToString() == field.Name)
chk_box.Checked = true; chk_box.Checked = true;
chk_box.Text = field.Name; chk_box.Text = field.Name;
@ -2366,7 +2366,7 @@ print 'Roll complete'
string desc = ((CheckBox)sender).Name; string desc = ((CheckBox)sender).Name;
((QuickView)((CheckBox)sender).Tag).Tag = desc; ((QuickView)((CheckBox)sender).Tag).Tag = desc;
desc = MainV2.cs.GetNameandUnit(desc); desc = MainV2.comPort.MAV.cs.GetNameandUnit(desc);
((QuickView)((CheckBox)sender).Tag).desc = desc; ((QuickView)((CheckBox)sender).Tag).desc = desc;
@ -2383,13 +2383,13 @@ print 'Roll complete'
{ {
string alt = "100"; string alt = "100";
if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduCopter2)
{ {
alt = (10 * MainV2.cs.multiplierdist).ToString("0"); alt = (10 * MainV2.comPort.MAV.cs.multiplierdist).ToString("0");
} }
else else
{ {
alt = (100 * MainV2.cs.multiplierdist).ToString("0"); alt = (100 * MainV2.comPort.MAV.cs.multiplierdist).ToString("0");
} }
if (MainV2.config.ContainsKey("guided_alt")) if (MainV2.config.ContainsKey("guided_alt"))
@ -2400,18 +2400,18 @@ print 'Roll complete'
MainV2.config["guided_alt"] = alt; MainV2.config["guided_alt"] = alt;
int intalt = (int)(100 * MainV2.cs.multiplierdist); int intalt = (int)(100 * MainV2.comPort.MAV.cs.multiplierdist);
if (!int.TryParse(alt, out intalt)) if (!int.TryParse(alt, out intalt))
{ {
CustomMessageBox.Show("Bad Alt"); CustomMessageBox.Show("Bad Alt");
return; return;
} }
MainV2.comPort.GuidedMode.z = intalt; MainV2.comPort.MAV.GuidedMode.z = intalt;
if (MainV2.cs.mode == "Guided") if (MainV2.comPort.MAV.cs.mode == "Guided")
{ {
MainV2.comPort.setGuidedModeWP(new Locationwp() { alt = (float)MainV2.comPort.GuidedMode.z, lat = (float)MainV2.comPort.GuidedMode.x, lng = (float)MainV2.comPort.GuidedMode.y }); MainV2.comPort.setGuidedModeWP(new Locationwp() { alt = (float)MainV2.comPort.MAV.GuidedMode.z, lat = (float)MainV2.comPort.MAV.GuidedMode.x, lng = (float)MainV2.comPort.MAV.GuidedMode.y });
} }
} }
@ -2511,7 +2511,7 @@ print 'Roll complete'
// arm the MAV // arm the MAV
try try
{ {
bool ans = MainV2.comPort.doARM(MainV2.cs.armed); bool ans = MainV2.comPort.doARM(MainV2.comPort.MAV.cs.armed);
if (ans == false) if (ans == false)
CustomMessageBox.Show("Error: Arm message rejected by MAV"); CustomMessageBox.Show("Error: Arm message rejected by MAV");
} }
@ -2525,10 +2525,10 @@ print 'Roll complete'
int newalt = (int)modifyandSetAlt.Value; int newalt = (int)modifyandSetAlt.Value;
try try
{ {
MainV2.comPort.setNewWPAlt(new Locationwp() { alt = newalt / MainV2.cs.multiplierdist }); MainV2.comPort.setNewWPAlt(new Locationwp() { alt = newalt / MainV2.comPort.MAV.cs.multiplierdist });
} }
catch { CustomMessageBox.Show("Error sending command"); } catch { CustomMessageBox.Show("Error sending new Alt"); }
//MainV2.comPort.setNextWPTargetAlt((ushort)MainV2.cs.wpno, newalt); //MainV2.comPort.setNextWPTargetAlt((ushort)MainV2.comPort.MAV.cs.wpno, newalt);
} }
private void gMapControl1_MouseLeave(object sender, EventArgs e) private void gMapControl1_MouseLeave(object sender, EventArgs e)
@ -2543,32 +2543,32 @@ print 'Roll complete'
private void modifyandSetSpeed_Click(object sender, EventArgs e) private void modifyandSetSpeed_Click(object sender, EventArgs e)
{ {
// QUAD // QUAD
if (MainV2.comPort.param.ContainsKey("WP_SPEED_MAX")) if (MainV2.comPort.MAV.param.ContainsKey("WP_SPEED_MAX"))
{ {
try try
{ {
MainV2.comPort.setParam("WP_SPEED_MAX", ((float)modifyandSetSpeed.Value * 100.0f)); MainV2.comPort.setParam("WP_SPEED_MAX", ((float)modifyandSetSpeed.Value * 100.0f));
} }
catch { CustomMessageBox.Show("Error sending command"); } catch { CustomMessageBox.Show("Error sending WP_SPEED_MAX command"); }
} // plane with airspeed } // plane with airspeed
else if (MainV2.comPort.param.ContainsKey("TRIM_ARSPD_CM") && MainV2.comPort.param.ContainsKey("ARSPD_ENABLE") else if (MainV2.comPort.MAV.param.ContainsKey("TRIM_ARSPD_CM") && MainV2.comPort.MAV.param.ContainsKey("ARSPD_ENABLE")
&& MainV2.comPort.param.ContainsKey("ARSPD_USE") && (float)MainV2.comPort.param["ARSPD_ENABLE"] == 1 && MainV2.comPort.MAV.param.ContainsKey("ARSPD_USE") && (float)MainV2.comPort.MAV.param["ARSPD_ENABLE"] == 1
&& (float)MainV2.comPort.param["ARSPD_USE"] == 1) && (float)MainV2.comPort.MAV.param["ARSPD_USE"] == 1)
{ {
try try
{ {
MainV2.comPort.setParam("TRIM_ARSPD_CM", ((float)modifyandSetSpeed.Value * 100.0f)); MainV2.comPort.setParam("TRIM_ARSPD_CM", ((float)modifyandSetSpeed.Value * 100.0f));
} }
catch { CustomMessageBox.Show("Error sending command"); } catch { CustomMessageBox.Show("Error sending TRIM_ARSPD_CM command"); }
} // plane without airspeed } // plane without airspeed
else if (MainV2.comPort.param.ContainsKey("TRIM_THROTTLE") && MainV2.comPort.param.ContainsKey("ARSPD_USE") else if (MainV2.comPort.MAV.param.ContainsKey("TRIM_THROTTLE") && MainV2.comPort.MAV.param.ContainsKey("ARSPD_USE")
&& (float)MainV2.comPort.param["ARSPD_USE"] == 0) && (float)MainV2.comPort.MAV.param["ARSPD_USE"] == 0)
{ {
try try
{ {
MainV2.comPort.setParam("TRIM_THROTTLE", (float)modifyandSetSpeed.Value); MainV2.comPort.setParam("TRIM_THROTTLE", (float)modifyandSetSpeed.Value);
} }
catch { CustomMessageBox.Show("Error sending command"); } catch { CustomMessageBox.Show("Error sending TRIM_THROTTLE command"); }
} }
} }

View File

@ -244,7 +244,7 @@
<value>hud1</value> <value>hud1</value>
</data> </data>
<data name="&gt;&gt;hud1.Type" xml:space="preserve"> <data name="&gt;&gt;hud1.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.HUD, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.HUD, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;hud1.Parent" xml:space="preserve"> <data name="&gt;&gt;hud1.Parent" xml:space="preserve">
<value>SubMainLeft.Panel1</value> <value>SubMainLeft.Panel1</value>
@ -283,7 +283,7 @@
<value>quickView6</value> <value>quickView6</value>
</data> </data>
<data name="&gt;&gt;quickView6.Type" xml:space="preserve"> <data name="&gt;&gt;quickView6.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;quickView6.Parent" xml:space="preserve"> <data name="&gt;&gt;quickView6.Parent" xml:space="preserve">
<value>tabQuick</value> <value>tabQuick</value>
@ -307,7 +307,7 @@
<value>quickView5</value> <value>quickView5</value>
</data> </data>
<data name="&gt;&gt;quickView5.Type" xml:space="preserve"> <data name="&gt;&gt;quickView5.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;quickView5.Parent" xml:space="preserve"> <data name="&gt;&gt;quickView5.Parent" xml:space="preserve">
<value>tabQuick</value> <value>tabQuick</value>
@ -331,7 +331,7 @@
<value>quickView4</value> <value>quickView4</value>
</data> </data>
<data name="&gt;&gt;quickView4.Type" xml:space="preserve"> <data name="&gt;&gt;quickView4.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;quickView4.Parent" xml:space="preserve"> <data name="&gt;&gt;quickView4.Parent" xml:space="preserve">
<value>tabQuick</value> <value>tabQuick</value>
@ -355,7 +355,7 @@
<value>quickView3</value> <value>quickView3</value>
</data> </data>
<data name="&gt;&gt;quickView3.Type" xml:space="preserve"> <data name="&gt;&gt;quickView3.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;quickView3.Parent" xml:space="preserve"> <data name="&gt;&gt;quickView3.Parent" xml:space="preserve">
<value>tabQuick</value> <value>tabQuick</value>
@ -379,7 +379,7 @@
<value>quickView2</value> <value>quickView2</value>
</data> </data>
<data name="&gt;&gt;quickView2.Type" xml:space="preserve"> <data name="&gt;&gt;quickView2.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;quickView2.Parent" xml:space="preserve"> <data name="&gt;&gt;quickView2.Parent" xml:space="preserve">
<value>tabQuick</value> <value>tabQuick</value>
@ -409,7 +409,7 @@
<value>quickView1</value> <value>quickView1</value>
</data> </data>
<data name="&gt;&gt;quickView1.Type" xml:space="preserve"> <data name="&gt;&gt;quickView1.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.QuickView, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;quickView1.Parent" xml:space="preserve"> <data name="&gt;&gt;quickView1.Parent" xml:space="preserve">
<value>tabQuick</value> <value>tabQuick</value>
@ -457,7 +457,7 @@
<value>modifyandSetSpeed</value> <value>modifyandSetSpeed</value>
</data> </data>
<data name="&gt;&gt;modifyandSetSpeed.Type" xml:space="preserve"> <data name="&gt;&gt;modifyandSetSpeed.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.ModifyandSet, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.ModifyandSet, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;modifyandSetSpeed.Parent" xml:space="preserve"> <data name="&gt;&gt;modifyandSetSpeed.Parent" xml:space="preserve">
<value>tabActions</value> <value>tabActions</value>
@ -478,7 +478,7 @@
<value>modifyandSetAlt</value> <value>modifyandSetAlt</value>
</data> </data>
<data name="&gt;&gt;modifyandSetAlt.Type" xml:space="preserve"> <data name="&gt;&gt;modifyandSetAlt.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.ModifyandSet, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.ModifyandSet, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;modifyandSetAlt.Parent" xml:space="preserve"> <data name="&gt;&gt;modifyandSetAlt.Parent" xml:space="preserve">
<value>tabActions</value> <value>tabActions</value>
@ -511,7 +511,7 @@
<value>BUT_ARM</value> <value>BUT_ARM</value>
</data> </data>
<data name="&gt;&gt;BUT_ARM.Type" xml:space="preserve"> <data name="&gt;&gt;BUT_ARM.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;BUT_ARM.Parent" xml:space="preserve"> <data name="&gt;&gt;BUT_ARM.Parent" xml:space="preserve">
<value>tabActions</value> <value>tabActions</value>
@ -538,7 +538,7 @@
<value>BUT_script</value> <value>BUT_script</value>
</data> </data>
<data name="&gt;&gt;BUT_script.Type" xml:space="preserve"> <data name="&gt;&gt;BUT_script.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;BUT_script.Parent" xml:space="preserve"> <data name="&gt;&gt;BUT_script.Parent" xml:space="preserve">
<value>tabActions</value> <value>tabActions</value>
@ -568,7 +568,7 @@
<value>BUT_joystick</value> <value>BUT_joystick</value>
</data> </data>
<data name="&gt;&gt;BUT_joystick.Type" xml:space="preserve"> <data name="&gt;&gt;BUT_joystick.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;BUT_joystick.Parent" xml:space="preserve"> <data name="&gt;&gt;BUT_joystick.Parent" xml:space="preserve">
<value>tabActions</value> <value>tabActions</value>
@ -598,7 +598,7 @@
<value>BUT_quickmanual</value> <value>BUT_quickmanual</value>
</data> </data>
<data name="&gt;&gt;BUT_quickmanual.Type" xml:space="preserve"> <data name="&gt;&gt;BUT_quickmanual.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;BUT_quickmanual.Parent" xml:space="preserve"> <data name="&gt;&gt;BUT_quickmanual.Parent" xml:space="preserve">
<value>tabActions</value> <value>tabActions</value>
@ -628,7 +628,7 @@
<value>BUT_quickrtl</value> <value>BUT_quickrtl</value>
</data> </data>
<data name="&gt;&gt;BUT_quickrtl.Type" xml:space="preserve"> <data name="&gt;&gt;BUT_quickrtl.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;BUT_quickrtl.Parent" xml:space="preserve"> <data name="&gt;&gt;BUT_quickrtl.Parent" xml:space="preserve">
<value>tabActions</value> <value>tabActions</value>
@ -658,7 +658,7 @@
<value>BUT_quickauto</value> <value>BUT_quickauto</value>
</data> </data>
<data name="&gt;&gt;BUT_quickauto.Type" xml:space="preserve"> <data name="&gt;&gt;BUT_quickauto.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;BUT_quickauto.Parent" xml:space="preserve"> <data name="&gt;&gt;BUT_quickauto.Parent" xml:space="preserve">
<value>tabActions</value> <value>tabActions</value>
@ -712,7 +712,7 @@
<value>BUT_setwp</value> <value>BUT_setwp</value>
</data> </data>
<data name="&gt;&gt;BUT_setwp.Type" xml:space="preserve"> <data name="&gt;&gt;BUT_setwp.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;BUT_setwp.Parent" xml:space="preserve"> <data name="&gt;&gt;BUT_setwp.Parent" xml:space="preserve">
<value>tabActions</value> <value>tabActions</value>
@ -763,7 +763,7 @@
<value>BUT_setmode</value> <value>BUT_setmode</value>
</data> </data>
<data name="&gt;&gt;BUT_setmode.Type" xml:space="preserve"> <data name="&gt;&gt;BUT_setmode.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;BUT_setmode.Parent" xml:space="preserve"> <data name="&gt;&gt;BUT_setmode.Parent" xml:space="preserve">
<value>tabActions</value> <value>tabActions</value>
@ -793,7 +793,7 @@
<value>BUT_clear_track</value> <value>BUT_clear_track</value>
</data> </data>
<data name="&gt;&gt;BUT_clear_track.Type" xml:space="preserve"> <data name="&gt;&gt;BUT_clear_track.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;BUT_clear_track.Parent" xml:space="preserve"> <data name="&gt;&gt;BUT_clear_track.Parent" xml:space="preserve">
<value>tabActions</value> <value>tabActions</value>
@ -844,7 +844,7 @@
<value>BUT_Homealt</value> <value>BUT_Homealt</value>
</data> </data>
<data name="&gt;&gt;BUT_Homealt.Type" xml:space="preserve"> <data name="&gt;&gt;BUT_Homealt.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;BUT_Homealt.Parent" xml:space="preserve"> <data name="&gt;&gt;BUT_Homealt.Parent" xml:space="preserve">
<value>tabActions</value> <value>tabActions</value>
@ -874,7 +874,7 @@
<value>BUT_RAWSensor</value> <value>BUT_RAWSensor</value>
</data> </data>
<data name="&gt;&gt;BUT_RAWSensor.Type" xml:space="preserve"> <data name="&gt;&gt;BUT_RAWSensor.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;BUT_RAWSensor.Parent" xml:space="preserve"> <data name="&gt;&gt;BUT_RAWSensor.Parent" xml:space="preserve">
<value>tabActions</value> <value>tabActions</value>
@ -904,7 +904,7 @@
<value>BUTrestartmission</value> <value>BUTrestartmission</value>
</data> </data>
<data name="&gt;&gt;BUTrestartmission.Type" xml:space="preserve"> <data name="&gt;&gt;BUTrestartmission.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;BUTrestartmission.Parent" xml:space="preserve"> <data name="&gt;&gt;BUTrestartmission.Parent" xml:space="preserve">
<value>tabActions</value> <value>tabActions</value>
@ -934,7 +934,7 @@
<value>BUTactiondo</value> <value>BUTactiondo</value>
</data> </data>
<data name="&gt;&gt;BUTactiondo.Type" xml:space="preserve"> <data name="&gt;&gt;BUTactiondo.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;BUTactiondo.Parent" xml:space="preserve"> <data name="&gt;&gt;BUTactiondo.Parent" xml:space="preserve">
<value>tabActions</value> <value>tabActions</value>
@ -988,7 +988,7 @@
<value>Gvspeed</value> <value>Gvspeed</value>
</data> </data>
<data name="&gt;&gt;Gvspeed.Type" xml:space="preserve"> <data name="&gt;&gt;Gvspeed.Type" xml:space="preserve">
<value>AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;Gvspeed.Parent" xml:space="preserve"> <data name="&gt;&gt;Gvspeed.Parent" xml:space="preserve">
<value>tabGauges</value> <value>tabGauges</value>
@ -1018,7 +1018,7 @@
<value>Gheading</value> <value>Gheading</value>
</data> </data>
<data name="&gt;&gt;Gheading.Type" xml:space="preserve"> <data name="&gt;&gt;Gheading.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.HSI, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.HSI, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;Gheading.Parent" xml:space="preserve"> <data name="&gt;&gt;Gheading.Parent" xml:space="preserve">
<value>tabGauges</value> <value>tabGauges</value>
@ -1048,7 +1048,7 @@
<value>Galt</value> <value>Galt</value>
</data> </data>
<data name="&gt;&gt;Galt.Type" xml:space="preserve"> <data name="&gt;&gt;Galt.Type" xml:space="preserve">
<value>AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;Galt.Parent" xml:space="preserve"> <data name="&gt;&gt;Galt.Parent" xml:space="preserve">
<value>tabGauges</value> <value>tabGauges</value>
@ -1081,7 +1081,7 @@
<value>Gspeed</value> <value>Gspeed</value>
</data> </data>
<data name="&gt;&gt;Gspeed.Type" xml:space="preserve"> <data name="&gt;&gt;Gspeed.Type" xml:space="preserve">
<value>AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>AGaugeApp.AGauge, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;Gspeed.Parent" xml:space="preserve"> <data name="&gt;&gt;Gspeed.Parent" xml:space="preserve">
<value>tabGauges</value> <value>tabGauges</value>
@ -1165,7 +1165,7 @@
<value>lbl_playbackspeed</value> <value>lbl_playbackspeed</value>
</data> </data>
<data name="&gt;&gt;lbl_playbackspeed.Type" xml:space="preserve"> <data name="&gt;&gt;lbl_playbackspeed.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;lbl_playbackspeed.Parent" xml:space="preserve"> <data name="&gt;&gt;lbl_playbackspeed.Parent" xml:space="preserve">
<value>tabTLogs</value> <value>tabTLogs</value>
@ -1192,7 +1192,7 @@
<value>lbl_logpercent</value> <value>lbl_logpercent</value>
</data> </data>
<data name="&gt;&gt;lbl_logpercent.Type" xml:space="preserve"> <data name="&gt;&gt;lbl_logpercent.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;lbl_logpercent.Parent" xml:space="preserve"> <data name="&gt;&gt;lbl_logpercent.Parent" xml:space="preserve">
<value>tabTLogs</value> <value>tabTLogs</value>
@ -1219,7 +1219,7 @@
<value>NUM_playbackspeed</value> <value>NUM_playbackspeed</value>
</data> </data>
<data name="&gt;&gt;NUM_playbackspeed.Type" xml:space="preserve"> <data name="&gt;&gt;NUM_playbackspeed.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyTrackBar, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyTrackBar, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;NUM_playbackspeed.Parent" xml:space="preserve"> <data name="&gt;&gt;NUM_playbackspeed.Parent" xml:space="preserve">
<value>tabTLogs</value> <value>tabTLogs</value>
@ -1246,7 +1246,7 @@
<value>BUT_log2kml</value> <value>BUT_log2kml</value>
</data> </data>
<data name="&gt;&gt;BUT_log2kml.Type" xml:space="preserve"> <data name="&gt;&gt;BUT_log2kml.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;BUT_log2kml.Parent" xml:space="preserve"> <data name="&gt;&gt;BUT_log2kml.Parent" xml:space="preserve">
<value>tabTLogs</value> <value>tabTLogs</value>
@ -1300,7 +1300,7 @@
<value>BUT_playlog</value> <value>BUT_playlog</value>
</data> </data>
<data name="&gt;&gt;BUT_playlog.Type" xml:space="preserve"> <data name="&gt;&gt;BUT_playlog.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;BUT_playlog.Parent" xml:space="preserve"> <data name="&gt;&gt;BUT_playlog.Parent" xml:space="preserve">
<value>tabTLogs</value> <value>tabTLogs</value>
@ -1327,7 +1327,7 @@
<value>BUT_loadtelem</value> <value>BUT_loadtelem</value>
</data> </data>
<data name="&gt;&gt;BUT_loadtelem.Type" xml:space="preserve"> <data name="&gt;&gt;BUT_loadtelem.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;BUT_loadtelem.Parent" xml:space="preserve"> <data name="&gt;&gt;BUT_loadtelem.Parent" xml:space="preserve">
<value>tabTLogs</value> <value>tabTLogs</value>
@ -1491,6 +1491,132 @@
<data name="&gt;&gt;splitContainer1.Panel1.ZOrder" xml:space="preserve"> <data name="&gt;&gt;splitContainer1.Panel1.ZOrder" xml:space="preserve">
<value>0</value> <value>0</value>
</data> </data>
<data name="lbl_winddir.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="lbl_winddir.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 3</value>
</data>
<data name="lbl_winddir.Size" type="System.Drawing.Size, System.Drawing">
<value>46, 12</value>
</data>
<data name="lbl_winddir.TabIndex" type="System.Int32, mscorlib">
<value>68</value>
</data>
<data name="lbl_winddir.Text" xml:space="preserve">
<value>Dir: 0</value>
</data>
<data name="lbl_winddir.ToolTip" xml:space="preserve">
<value>Estimated Wind Direction</value>
</data>
<data name="&gt;&gt;lbl_winddir.Name" xml:space="preserve">
<value>lbl_winddir</value>
</data>
<data name="&gt;&gt;lbl_winddir.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_winddir.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
</data>
<data name="&gt;&gt;lbl_winddir.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="lbl_windvel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="lbl_windvel.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 23</value>
</data>
<data name="lbl_windvel.Size" type="System.Drawing.Size, System.Drawing">
<value>48, 12</value>
</data>
<data name="lbl_windvel.TabIndex" type="System.Int32, mscorlib">
<value>69</value>
</data>
<data name="lbl_windvel.Text" xml:space="preserve">
<value>Vel: 0</value>
</data>
<data name="lbl_windvel.ToolTip" xml:space="preserve">
<value>Estimated Wind Velocity</value>
</data>
<data name="&gt;&gt;lbl_windvel.Name" xml:space="preserve">
<value>lbl_windvel</value>
</data>
<data name="&gt;&gt;lbl_windvel.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_windvel.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
</data>
<data name="&gt;&gt;lbl_windvel.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="lbl_hdop.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Bottom, Left</value>
</data>
<data name="lbl_hdop.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="lbl_hdop.Location" type="System.Drawing.Point, System.Drawing">
<value>-1, 390</value>
</data>
<data name="lbl_hdop.Size" type="System.Drawing.Size, System.Drawing">
<value>43, 12</value>
</data>
<data name="lbl_hdop.TabIndex" type="System.Int32, mscorlib">
<value>70</value>
</data>
<data name="lbl_hdop.Text" xml:space="preserve">
<value>hdop: 0</value>
</data>
<data name="lbl_hdop.ToolTip" xml:space="preserve">
<value>gps hdop</value>
</data>
<data name="&gt;&gt;lbl_hdop.Name" xml:space="preserve">
<value>lbl_hdop</value>
</data>
<data name="&gt;&gt;lbl_hdop.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_hdop.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
</data>
<data name="&gt;&gt;lbl_hdop.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="lbl_sats.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Bottom, Left</value>
</data>
<data name="lbl_sats.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="lbl_sats.Location" type="System.Drawing.Point, System.Drawing">
<value>-1, 408</value>
</data>
<data name="lbl_sats.Size" type="System.Drawing.Size, System.Drawing">
<value>40, 12</value>
</data>
<data name="lbl_sats.TabIndex" type="System.Int32, mscorlib">
<value>71</value>
</data>
<data name="lbl_sats.Text" xml:space="preserve">
<value>Sats: 0</value>
</data>
<data name="lbl_sats.ToolTip" xml:space="preserve">
<value>Satallite Count</value>
</data>
<data name="&gt;&gt;lbl_sats.Name" xml:space="preserve">
<value>lbl_sats</value>
</data>
<data name="&gt;&gt;lbl_sats.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_sats.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
</data>
<data name="&gt;&gt;lbl_sats.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="gMapControl1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <data name="gMapControl1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value> <value>Fill</value>
</data> </data>
@ -1655,13 +1781,13 @@
<value>gMapControl1</value> <value>gMapControl1</value>
</data> </data>
<data name="&gt;&gt;gMapControl1.Type" xml:space="preserve"> <data name="&gt;&gt;gMapControl1.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.myGMAP, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.myGMAP, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;gMapControl1.Parent" xml:space="preserve"> <data name="&gt;&gt;gMapControl1.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value> <value>splitContainer1.Panel2</value>
</data> </data>
<data name="&gt;&gt;gMapControl1.ZOrder" xml:space="preserve"> <data name="&gt;&gt;gMapControl1.ZOrder" xml:space="preserve">
<value>0</value> <value>4</value>
</data> </data>
<data name="TRK_zoom.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <data name="TRK_zoom.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Right</value> <value>Right</value>
@ -1682,138 +1808,12 @@
<value>TRK_zoom</value> <value>TRK_zoom</value>
</data> </data>
<data name="&gt;&gt;TRK_zoom.Type" xml:space="preserve"> <data name="&gt;&gt;TRK_zoom.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyTrackBar, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyTrackBar, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;TRK_zoom.Parent" xml:space="preserve"> <data name="&gt;&gt;TRK_zoom.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value> <value>splitContainer1.Panel2</value>
</data> </data>
<data name="&gt;&gt;TRK_zoom.ZOrder" xml:space="preserve"> <data name="&gt;&gt;TRK_zoom.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="lbl_winddir.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="lbl_winddir.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 3</value>
</data>
<data name="lbl_winddir.Size" type="System.Drawing.Size, System.Drawing">
<value>46, 12</value>
</data>
<data name="lbl_winddir.TabIndex" type="System.Int32, mscorlib">
<value>68</value>
</data>
<data name="lbl_winddir.Text" xml:space="preserve">
<value>Dir: 0</value>
</data>
<data name="lbl_winddir.ToolTip" xml:space="preserve">
<value>Estimated Wind Direction</value>
</data>
<data name="&gt;&gt;lbl_winddir.Name" xml:space="preserve">
<value>lbl_winddir</value>
</data>
<data name="&gt;&gt;lbl_winddir.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_winddir.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
</data>
<data name="&gt;&gt;lbl_winddir.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="lbl_windvel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="lbl_windvel.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 23</value>
</data>
<data name="lbl_windvel.Size" type="System.Drawing.Size, System.Drawing">
<value>48, 12</value>
</data>
<data name="lbl_windvel.TabIndex" type="System.Int32, mscorlib">
<value>69</value>
</data>
<data name="lbl_windvel.Text" xml:space="preserve">
<value>Vel: 0</value>
</data>
<data name="lbl_windvel.ToolTip" xml:space="preserve">
<value>Estimated Wind Velocity</value>
</data>
<data name="&gt;&gt;lbl_windvel.Name" xml:space="preserve">
<value>lbl_windvel</value>
</data>
<data name="&gt;&gt;lbl_windvel.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_windvel.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
</data>
<data name="&gt;&gt;lbl_windvel.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="lbl_hdop.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Bottom, Left</value>
</data>
<data name="lbl_hdop.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="lbl_hdop.Location" type="System.Drawing.Point, System.Drawing">
<value>-1, 390</value>
</data>
<data name="lbl_hdop.Size" type="System.Drawing.Size, System.Drawing">
<value>43, 12</value>
</data>
<data name="lbl_hdop.TabIndex" type="System.Int32, mscorlib">
<value>70</value>
</data>
<data name="lbl_hdop.Text" xml:space="preserve">
<value>hdop: 0</value>
</data>
<data name="lbl_hdop.ToolTip" xml:space="preserve">
<value>gps hdop</value>
</data>
<data name="&gt;&gt;lbl_hdop.Name" xml:space="preserve">
<value>lbl_hdop</value>
</data>
<data name="&gt;&gt;lbl_hdop.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_hdop.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
</data>
<data name="&gt;&gt;lbl_hdop.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="lbl_sats.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Bottom, Left</value>
</data>
<data name="lbl_sats.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="lbl_sats.Location" type="System.Drawing.Point, System.Drawing">
<value>-1, 408</value>
</data>
<data name="lbl_sats.Size" type="System.Drawing.Size, System.Drawing">
<value>40, 12</value>
</data>
<data name="lbl_sats.TabIndex" type="System.Int32, mscorlib">
<value>71</value>
</data>
<data name="lbl_sats.Text" xml:space="preserve">
<value>Sats: 0</value>
</data>
<data name="lbl_sats.ToolTip" xml:space="preserve">
<value>Satallite Count</value>
</data>
<data name="&gt;&gt;lbl_sats.Name" xml:space="preserve">
<value>lbl_sats</value>
</data>
<data name="&gt;&gt;lbl_sats.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_sats.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
</data>
<data name="&gt;&gt;lbl_sats.ZOrder" xml:space="preserve">
<value>5</value> <value>5</value>
</data> </data>
<data name="&gt;&gt;splitContainer1.Panel2.Name" xml:space="preserve"> <data name="&gt;&gt;splitContainer1.Panel2.Name" xml:space="preserve">
@ -1871,7 +1871,7 @@
<value>TXT_lat</value> <value>TXT_lat</value>
</data> </data>
<data name="&gt;&gt;TXT_lat.Type" xml:space="preserve"> <data name="&gt;&gt;TXT_lat.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;TXT_lat.Parent" xml:space="preserve"> <data name="&gt;&gt;TXT_lat.Parent" xml:space="preserve">
<value>panel1</value> <value>panel1</value>
@ -1928,7 +1928,7 @@
<value>label1</value> <value>label1</value>
</data> </data>
<data name="&gt;&gt;label1.Type" xml:space="preserve"> <data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve"> <data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>panel1</value> <value>panel1</value>
@ -1958,7 +1958,7 @@
<value>TXT_long</value> <value>TXT_long</value>
</data> </data>
<data name="&gt;&gt;TXT_long.Type" xml:space="preserve"> <data name="&gt;&gt;TXT_long.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;TXT_long.Parent" xml:space="preserve"> <data name="&gt;&gt;TXT_long.Parent" xml:space="preserve">
<value>panel1</value> <value>panel1</value>
@ -1988,7 +1988,7 @@
<value>TXT_alt</value> <value>TXT_alt</value>
</data> </data>
<data name="&gt;&gt;TXT_alt.Type" xml:space="preserve"> <data name="&gt;&gt;TXT_alt.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;TXT_alt.Parent" xml:space="preserve"> <data name="&gt;&gt;TXT_alt.Parent" xml:space="preserve">
<value>panel1</value> <value>panel1</value>
@ -2279,6 +2279,6 @@
<value>FlightData</value> <value>FlightData</value>
</data> </data>
<data name="&gt;&gt;$this.Type" xml:space="preserve"> <data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.MyUserControl, ArdupilotMegaPlanner10, Version=1.1.4716.12475, Culture=neutral, PublicKeyToken=null</value> <value>System.Windows.Forms.MyUserControl, ArdupilotMegaPlanner10, Version=1.1.4723.32619, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
</root> </root>

View File

@ -174,7 +174,7 @@ namespace ArdupilotMega.GCSViews
if (pointno == "Tracker Home") if (pointno == "Tracker Home")
{ {
MainV2.cs.TrackerLocation = new PointLatLngAlt(lat, lng, alt, ""); MainV2.comPort.MAV.cs.TrackerLocation = new PointLatLngAlt(lat, lng, alt, "");
return; return;
} }
@ -249,7 +249,7 @@ namespace ArdupilotMega.GCSViews
cell.Value = alt.ToString(); cell.Value = alt.ToString();
if (ans == 0) // default if (ans == 0) // default
cell.Value = 50; cell.Value = 50;
if (ans == 0 && MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2) if (ans == 0 && MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduCopter2)
cell.Value = 15; cell.Value = 15;
// online verify height // online verify height
if (isonline && CHK_geheight.Checked) if (isonline && CHK_geheight.Checked)
@ -495,11 +495,11 @@ namespace ArdupilotMega.GCSViews
{ {
reader.Read(); reader.Read();
reader.ReadStartElement("CMD"); reader.ReadStartElement("CMD");
if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane)
{ {
reader.ReadToFollowing("APM"); reader.ReadToFollowing("APM");
} }
else if (MainV2.cs.firmware == MainV2.Firmwares.ArduRover) else if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduRover)
{ {
reader.ReadToFollowing("APRover"); reader.ReadToFollowing("APRover");
} }
@ -595,13 +595,13 @@ namespace ArdupilotMega.GCSViews
config(false); config(false);
if (MainV2.cs.HomeLocation.Lat != 0 && MainV2.cs.HomeLocation.Lng != 0) if (MainV2.comPort.MAV.cs.HomeLocation.Lat != 0 && MainV2.comPort.MAV.cs.HomeLocation.Lng != 0)
{ {
TXT_homelat.Text = MainV2.cs.HomeLocation.Lat.ToString(); TXT_homelat.Text = MainV2.comPort.MAV.cs.HomeLocation.Lat.ToString();
TXT_homelng.Text = MainV2.cs.HomeLocation.Lng.ToString(); TXT_homelng.Text = MainV2.comPort.MAV.cs.HomeLocation.Lng.ToString();
TXT_homealt.Text = MainV2.cs.HomeLocation.Alt.ToString(); TXT_homealt.Text = MainV2.comPort.MAV.cs.HomeLocation.Alt.ToString();
} }
@ -848,7 +848,7 @@ namespace ArdupilotMega.GCSViews
GMapMarkerRect mBorders = new GMapMarkerRect(point); GMapMarkerRect mBorders = new GMapMarkerRect(point);
{ {
mBorders.InnerMarker = m; mBorders.InnerMarker = m;
mBorders.wprad = (int)(float.Parse(TXT_WPRad.Text) / MainV2.cs.multiplierdist); mBorders.wprad = (int)(float.Parse(TXT_WPRad.Text) / MainV2.comPort.MAV.cs.multiplierdist);
mBorders.MainMap = MainMap; mBorders.MainMap = MainMap;
if (color.HasValue) if (color.HasValue)
{ {
@ -1151,7 +1151,7 @@ namespace ArdupilotMega.GCSViews
sw.Write("\t" + double.Parse(Commands.Rows[a].Cells[Param4.Index].Value.ToString()).ToString("0.000000", new System.Globalization.CultureInfo("en-US"))); sw.Write("\t" + double.Parse(Commands.Rows[a].Cells[Param4.Index].Value.ToString()).ToString("0.000000", new System.Globalization.CultureInfo("en-US")));
sw.Write("\t" + double.Parse(Commands.Rows[a].Cells[Lat.Index].Value.ToString()).ToString("0.000000", new System.Globalization.CultureInfo("en-US"))); sw.Write("\t" + double.Parse(Commands.Rows[a].Cells[Lat.Index].Value.ToString()).ToString("0.000000", new System.Globalization.CultureInfo("en-US")));
sw.Write("\t" + double.Parse(Commands.Rows[a].Cells[Lon.Index].Value.ToString()).ToString("0.000000", new System.Globalization.CultureInfo("en-US"))); sw.Write("\t" + double.Parse(Commands.Rows[a].Cells[Lon.Index].Value.ToString()).ToString("0.000000", new System.Globalization.CultureInfo("en-US")));
sw.Write("\t" + (double.Parse(Commands.Rows[a].Cells[Alt.Index].Value.ToString()) / MainV2.cs.multiplierdist).ToString("0.000000", new System.Globalization.CultureInfo("en-US"))); sw.Write("\t" + (double.Parse(Commands.Rows[a].Cells[Alt.Index].Value.ToString()) / MainV2.comPort.MAV.cs.multiplierdist).ToString("0.000000", new System.Globalization.CultureInfo("en-US")));
sw.Write("\t" + 1); sw.Write("\t" + 1);
sw.WriteLine(""); sw.WriteLine("");
} }
@ -1205,7 +1205,7 @@ namespace ArdupilotMega.GCSViews
MainV2.giveComport = true; MainV2.giveComport = true;
param = port.param; param = port.MAV.param;
log.Info("Getting WP #"); log.Info("Getting WP #");
@ -1322,7 +1322,7 @@ namespace ArdupilotMega.GCSViews
home.id = (byte)MAVLink.MAV_CMD.WAYPOINT; home.id = (byte)MAVLink.MAV_CMD.WAYPOINT;
home.lat = (float.Parse(TXT_homelat.Text)); home.lat = (float.Parse(TXT_homelat.Text));
home.lng = (float.Parse(TXT_homelng.Text)); home.lng = (float.Parse(TXT_homelng.Text));
home.alt = (float.Parse(TXT_homealt.Text) / MainV2.cs.multiplierdist); // use saved home home.alt = (float.Parse(TXT_homealt.Text) / MainV2.comPort.MAV.cs.multiplierdist); // use saved home
} }
catch { throw new Exception("Your home location is invalid"); } catch { throw new Exception("Your home location is invalid"); }
@ -1356,7 +1356,7 @@ namespace ArdupilotMega.GCSViews
} }
} }
temp.alt = (float)(double.Parse(Commands.Rows[a].Cells[Alt.Index].Value.ToString()) / MainV2.cs.multiplierdist); temp.alt = (float)(double.Parse(Commands.Rows[a].Cells[Alt.Index].Value.ToString()) / MainV2.comPort.MAV.cs.multiplierdist);
temp.lat = (float)(double.Parse(Commands.Rows[a].Cells[Lat.Index].Value.ToString())); temp.lat = (float)(double.Parse(Commands.Rows[a].Cells[Lat.Index].Value.ToString()));
temp.lng = (float)(double.Parse(Commands.Rows[a].Cells[Lon.Index].Value.ToString())); temp.lng = (float)(double.Parse(Commands.Rows[a].Cells[Lon.Index].Value.ToString()));
@ -1379,22 +1379,22 @@ namespace ArdupilotMega.GCSViews
if (CHK_holdalt.Checked) if (CHK_holdalt.Checked)
{ {
port.setParam("ALT_HOLD_RTL", int.Parse(TXT_DefaultAlt.Text) / MainV2.cs.multiplierdist * 100); port.setParam("ALT_HOLD_RTL", int.Parse(TXT_DefaultAlt.Text) / MainV2.comPort.MAV.cs.multiplierdist * 100);
} }
else else
{ {
port.setParam("ALT_HOLD_RTL", -1); port.setParam("ALT_HOLD_RTL", -1);
} }
port.setParam("WP_RADIUS", (byte)int.Parse(TXT_WPRad.Text) / MainV2.cs.multiplierdist); port.setParam("WP_RADIUS", (byte)int.Parse(TXT_WPRad.Text) / MainV2.comPort.MAV.cs.multiplierdist);
try try
{ {
port.setParam("WP_LOITER_RAD", (byte)(int.Parse(TXT_loiterrad.Text) / MainV2.cs.multiplierdist)); port.setParam("WP_LOITER_RAD", (byte)(int.Parse(TXT_loiterrad.Text) / MainV2.comPort.MAV.cs.multiplierdist));
} }
catch catch
{ {
port.setParam("LOITER_RAD", (byte)int.Parse(TXT_loiterrad.Text) / MainV2.cs.multiplierdist); port.setParam("LOITER_RAD", (byte)int.Parse(TXT_loiterrad.Text) / MainV2.comPort.MAV.cs.multiplierdist);
} }
((Controls.ProgressReporterDialogue)sender).UpdateProgressAndStatus(100, "Done."); ((Controls.ProgressReporterDialogue)sender).UpdateProgressAndStatus(100, "Done.");
@ -1465,7 +1465,7 @@ namespace ArdupilotMega.GCSViews
} }
cell = Commands.Rows[i].Cells[Alt.Index] as DataGridViewTextBoxCell; cell = Commands.Rows[i].Cells[Alt.Index] as DataGridViewTextBoxCell;
cell.Value = Math.Round((temp.alt * MainV2.cs.multiplierdist), 0); cell.Value = Math.Round((temp.alt * MainV2.comPort.MAV.cs.multiplierdist), 0);
cell = Commands.Rows[i].Cells[Lat.Index] as DataGridViewTextBoxCell; cell = Commands.Rows[i].Cells[Lat.Index] as DataGridViewTextBoxCell;
cell.Value = (double)temp.lat; cell.Value = (double)temp.lat;
cell = Commands.Rows[i].Cells[Lon.Index] as DataGridViewTextBoxCell; cell = Commands.Rows[i].Cells[Lon.Index] as DataGridViewTextBoxCell;
@ -1484,7 +1484,7 @@ namespace ArdupilotMega.GCSViews
{ {
log.Info("Setting wp params"); log.Info("Setting wp params");
string hold_alt = ((int)((float)param["ALT_HOLD_RTL"] * MainV2.cs.multiplierdist / 100.0)).ToString(); string hold_alt = ((int)((float)param["ALT_HOLD_RTL"] * MainV2.comPort.MAV.cs.multiplierdist / 100.0)).ToString();
log.Info("param ALT_HOLD_RTL " + hold_alt); log.Info("param ALT_HOLD_RTL " + hold_alt);
@ -1493,17 +1493,17 @@ namespace ArdupilotMega.GCSViews
TXT_DefaultAlt.Text = hold_alt; TXT_DefaultAlt.Text = hold_alt;
} }
TXT_WPRad.Text = ((int)((float)param["WP_RADIUS"] * MainV2.cs.multiplierdist)).ToString(); TXT_WPRad.Text = ((int)((float)param["WP_RADIUS"] * MainV2.comPort.MAV.cs.multiplierdist)).ToString();
log.Info("param WP_RADIUS " + TXT_WPRad.Text); log.Info("param WP_RADIUS " + TXT_WPRad.Text);
try try
{ {
if (param["LOITER_RADIUS"] != null) if (param["LOITER_RADIUS"] != null)
TXT_loiterrad.Text = ((int)((float)param["LOITER_RADIUS"] * MainV2.cs.multiplierdist)).ToString(); TXT_loiterrad.Text = ((int)((float)param["LOITER_RADIUS"] * MainV2.comPort.MAV.cs.multiplierdist)).ToString();
if (param["WP_LOITER_RAD"] != null) if (param["WP_LOITER_RAD"] != null)
TXT_loiterrad.Text = ((int)((float)param["WP_LOITER_RAD"] * MainV2.cs.multiplierdist)).ToString(); TXT_loiterrad.Text = ((int)((float)param["WP_LOITER_RAD"] * MainV2.comPort.MAV.cs.multiplierdist)).ToString();
log.Info("param LOITER_RADIUS " + TXT_loiterrad.Text); log.Info("param LOITER_RADIUS " + TXT_loiterrad.Text);
} }
@ -1534,7 +1534,7 @@ namespace ArdupilotMega.GCSViews
cellhome = Commands.Rows[0].Cells[Lon.Index] as DataGridViewTextBoxCell; cellhome = Commands.Rows[0].Cells[Lon.Index] as DataGridViewTextBoxCell;
TXT_homelng.Text = (double.Parse(cellhome.Value.ToString())).ToString(); TXT_homelng.Text = (double.Parse(cellhome.Value.ToString())).ToString();
cellhome = Commands.Rows[0].Cells[Alt.Index] as DataGridViewTextBoxCell; cellhome = Commands.Rows[0].Cells[Alt.Index] as DataGridViewTextBoxCell;
TXT_homealt.Text = (double.Parse(cellhome.Value.ToString()) * MainV2.cs.multiplierdist).ToString(); TXT_homealt.Text = (double.Parse(cellhome.Value.ToString()) * MainV2.comPort.MAV.cs.multiplierdist).ToString();
} }
} }
} }
@ -1719,7 +1719,7 @@ namespace ArdupilotMega.GCSViews
sethome = false; sethome = false;
try try
{ {
MainV2.cs.HomeLocation.Lat = double.Parse(TXT_homelat.Text); MainV2.comPort.MAV.cs.HomeLocation.Lat = double.Parse(TXT_homelat.Text);
} }
catch { } catch { }
writeKML(); writeKML();
@ -1731,7 +1731,7 @@ namespace ArdupilotMega.GCSViews
sethome = false; sethome = false;
try try
{ {
MainV2.cs.HomeLocation.Lng = double.Parse(TXT_homelng.Text); MainV2.comPort.MAV.cs.HomeLocation.Lng = double.Parse(TXT_homelng.Text);
} }
catch { } catch { }
writeKML(); writeKML();
@ -1742,7 +1742,7 @@ namespace ArdupilotMega.GCSViews
sethome = false; sethome = false;
try try
{ {
MainV2.cs.HomeLocation.Alt = double.Parse(TXT_homealt.Text); MainV2.comPort.MAV.cs.HomeLocation.Alt = double.Parse(TXT_homealt.Text);
} }
catch { } catch { }
writeKML(); writeKML();
@ -2340,7 +2340,7 @@ namespace ArdupilotMega.GCSViews
} }
catch { } catch { }
return alt * MainV2.cs.multiplierdist; return alt * MainV2.comPort.MAV.cs.multiplierdist;
} }
private void TXT_homelat_Enter(object sender, EventArgs e) private void TXT_homelat_Enter(object sender, EventArgs e)
@ -2468,11 +2468,11 @@ namespace ArdupilotMega.GCSViews
private void label4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) private void label4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{ {
if (MainV2.cs.lat != 0) if (MainV2.comPort.MAV.cs.lat != 0)
{ {
TXT_homealt.Text = (MainV2.cs.alt).ToString("0"); TXT_homealt.Text = (MainV2.comPort.MAV.cs.alt).ToString("0");
TXT_homelat.Text = MainV2.cs.lat.ToString(); TXT_homelat.Text = MainV2.comPort.MAV.cs.lat.ToString();
TXT_homelng.Text = MainV2.cs.lng.ToString(); TXT_homelng.Text = MainV2.comPort.MAV.cs.lng.ToString();
} }
else else
{ {
@ -2659,7 +2659,11 @@ namespace ArdupilotMega.GCSViews
{ {
if (int.TryParse(CurentRectMarker.InnerMarker.Tag.ToString(), out no)) if (int.TryParse(CurentRectMarker.InnerMarker.Tag.ToString(), out no))
{ {
Commands.Rows.RemoveAt(no - 1); // home is 0 try
{
Commands.Rows.RemoveAt(no - 1); // home is 0
}
catch { CustomMessageBox.Show("error selecting wp, please try again."); }
} }
else if (int.TryParse(CurentRectMarker.InnerMarker.Tag.ToString().Replace("grid", ""), out no)) else if (int.TryParse(CurentRectMarker.InnerMarker.Tag.ToString().Replace("grid", ""), out no))
{ {
@ -2762,32 +2766,32 @@ namespace ArdupilotMega.GCSViews
routes.Markers.Clear(); routes.Markers.Clear();
if (MainV2.cs.TrackerLocation != MainV2.cs.HomeLocation && MainV2.cs.TrackerLocation.Lng != 0) if (MainV2.comPort.MAV.cs.TrackerLocation != MainV2.comPort.MAV.cs.HomeLocation && MainV2.comPort.MAV.cs.TrackerLocation.Lng != 0)
{ {
addpolygonmarker("Tracker Home", MainV2.cs.TrackerLocation.Lng, MainV2.cs.TrackerLocation.Lat, (int)MainV2.cs.TrackerLocation.Alt, Color.Blue, routes); addpolygonmarker("Tracker Home", MainV2.comPort.MAV.cs.TrackerLocation.Lng, MainV2.comPort.MAV.cs.TrackerLocation.Lat, (int)MainV2.comPort.MAV.cs.TrackerLocation.Alt, Color.Blue, routes);
} }
if (MainV2.cs.lat == 0 || MainV2.cs.lng == 0) if (MainV2.comPort.MAV.cs.lat == 0 || MainV2.comPort.MAV.cs.lng == 0)
return; return;
PointLatLng currentloc = new PointLatLng(MainV2.cs.lat, MainV2.cs.lng); PointLatLng currentloc = new PointLatLng(MainV2.comPort.MAV.cs.lat, MainV2.comPort.MAV.cs.lng);
if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane)
{ {
routes.Markers.Add(new GMapMarkerPlane(currentloc, MainV2.cs.yaw, MainV2.cs.groundcourse, MainV2.cs.nav_bearing, MainV2.cs.target_bearing, MainMap)); routes.Markers.Add(new GMapMarkerPlane(currentloc, MainV2.comPort.MAV.cs.yaw, MainV2.comPort.MAV.cs.groundcourse, MainV2.comPort.MAV.cs.nav_bearing, MainV2.comPort.MAV.cs.target_bearing, MainMap));
} }
else if (MainV2.cs.firmware == MainV2.Firmwares.ArduRover) else if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduRover)
{ {
routes.Markers.Add(new GMapMarkerRover(currentloc, MainV2.cs.yaw, MainV2.cs.groundcourse, MainV2.cs.nav_bearing, MainV2.cs.target_bearing, MainMap)); routes.Markers.Add(new GMapMarkerRover(currentloc, MainV2.comPort.MAV.cs.yaw, MainV2.comPort.MAV.cs.groundcourse, MainV2.comPort.MAV.cs.nav_bearing, MainV2.comPort.MAV.cs.target_bearing, MainMap));
} }
else else
{ {
routes.Markers.Add(new GMapMarkerQuad(currentloc, MainV2.cs.yaw, MainV2.cs.groundcourse, MainV2.cs.nav_bearing)); routes.Markers.Add(new GMapMarkerQuad(currentloc, MainV2.comPort.MAV.cs.yaw, MainV2.comPort.MAV.cs.groundcourse, MainV2.comPort.MAV.cs.nav_bearing));
} }
if (MainV2.cs.mode.ToLower() == "guided" && MainV2.comPort.GuidedMode.x != 0) if (MainV2.comPort.MAV.cs.mode.ToLower() == "guided" && MainV2.comPort.MAV.GuidedMode.x != 0)
{ {
addpolygonmarker("Guided Mode", MainV2.comPort.GuidedMode.y, MainV2.comPort.GuidedMode.x, (int)MainV2.comPort.GuidedMode.z, Color.Blue, routes); addpolygonmarker("Guided Mode", MainV2.comPort.MAV.GuidedMode.y, MainV2.comPort.MAV.GuidedMode.x, (int)MainV2.comPort.MAV.GuidedMode.z, Color.Blue, routes);
} }
@ -2811,7 +2815,7 @@ namespace ArdupilotMega.GCSViews
mBorders.InnerMarker = m; mBorders.InnerMarker = m;
try try
{ {
mBorders.wprad = (int)(float.Parse(ArdupilotMega.MainV2.config["TXT_WPRad"].ToString()) / MainV2.cs.multiplierdist); mBorders.wprad = (int)(float.Parse(ArdupilotMega.MainV2.config["TXT_WPRad"].ToString()) / MainV2.comPort.MAV.cs.multiplierdist);
} }
catch { } catch { }
mBorders.MainMap = MainMap; mBorders.MainMap = MainMap;
@ -2831,7 +2835,7 @@ namespace ArdupilotMega.GCSViews
{ {
polygongridmode = false; polygongridmode = false;
//FENCE_TOTAL //FENCE_TOTAL
if (MainV2.comPort.param["FENCE_ACTION"] == null) if (MainV2.comPort.MAV.param["FENCE_ACTION"] == null)
{ {
CustomMessageBox.Show("Not Supported"); CustomMessageBox.Show("Not Supported");
return; return;
@ -2866,10 +2870,10 @@ namespace ArdupilotMega.GCSViews
return; return;
} }
string minalts = (int.Parse(MainV2.comPort.param["FENCE_MINALT"].ToString()) * MainV2.cs.multiplierdist).ToString("0"); string minalts = (int.Parse(MainV2.comPort.MAV.param["FENCE_MINALT"].ToString()) * MainV2.comPort.MAV.cs.multiplierdist).ToString("0");
Common.InputBox("Min Alt", "Box Minimum Altitude?", ref minalts); Common.InputBox("Min Alt", "Box Minimum Altitude?", ref minalts);
string maxalts = (int.Parse(MainV2.comPort.param["FENCE_MAXALT"].ToString()) * MainV2.cs.multiplierdist).ToString("0"); string maxalts = (int.Parse(MainV2.comPort.MAV.param["FENCE_MAXALT"].ToString()) * MainV2.comPort.MAV.cs.multiplierdist).ToString("0");
Common.InputBox("Max Alt", "Box Maximum Altitude?", ref maxalts); Common.InputBox("Max Alt", "Box Maximum Altitude?", ref maxalts);
int minalt = 0; int minalt = 0;
@ -2900,7 +2904,7 @@ namespace ArdupilotMega.GCSViews
try try
{ {
if (MainV2.comPort.param["FENCE_ACTION"].ToString() != "0") if (MainV2.comPort.MAV.param["FENCE_ACTION"].ToString() != "0")
MainV2.comPort.setParam("FENCE_ACTION", 0); MainV2.comPort.setParam("FENCE_ACTION", 0);
} }
catch catch
@ -2959,13 +2963,13 @@ namespace ArdupilotMega.GCSViews
polygongridmode = false; polygongridmode = false;
int count = 1; int count = 1;
if (MainV2.comPort.param["FENCE_ACTION"] == null || MainV2.comPort.param["FENCE_TOTAL"] == null) if (MainV2.comPort.MAV.param["FENCE_ACTION"] == null || MainV2.comPort.MAV.param["FENCE_TOTAL"] == null)
{ {
CustomMessageBox.Show("Not Supported"); CustomMessageBox.Show("Not Supported");
return; return;
} }
if (int.Parse(MainV2.comPort.param["FENCE_TOTAL"].ToString()) <= 1) if (int.Parse(MainV2.comPort.MAV.param["FENCE_TOTAL"].ToString()) <= 1)
{ {
CustomMessageBox.Show("Nothing to download"); CustomMessageBox.Show("Nothing to download");
return; return;
@ -3225,7 +3229,7 @@ namespace ArdupilotMega.GCSViews
{ {
timer1.Start(); timer1.Start();
if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduCopter2)
{ {
CHK_altmode.Visible = false; CHK_altmode.Visible = false;
} }
@ -3297,13 +3301,13 @@ namespace ArdupilotMega.GCSViews
double heightdist = MainMap.Manager.GetDistance(arearect.LocationTopLeft, bottomleft) * 1000; double heightdist = MainMap.Manager.GetDistance(arearect.LocationTopLeft, bottomleft) * 1000;
double widthdist = MainMap.Manager.GetDistance(arearect.LocationTopLeft, topright) * 1000; double widthdist = MainMap.Manager.GetDistance(arearect.LocationTopLeft, topright) * 1000;
string alt = (100 * MainV2.cs.multiplierdist).ToString("0"); string alt = (100 * MainV2.comPort.MAV.cs.multiplierdist).ToString("0");
Common.InputBox("Altitude", "Relative Altitude", ref alt); Common.InputBox("Altitude", "Relative Altitude", ref alt);
string distance = (50 * MainV2.cs.multiplierdist).ToString("0"); string distance = (50 * MainV2.comPort.MAV.cs.multiplierdist).ToString("0");
Common.InputBox("Distance", "Distance between lines", ref distance); Common.InputBox("Distance", "Distance between lines", ref distance);
string wpevery = (40 * MainV2.cs.multiplierdist).ToString("0"); string wpevery = (40 * MainV2.comPort.MAV.cs.multiplierdist).ToString("0");
Common.InputBox("Every", "Put a WP every x distance (-1 for none)", ref wpevery); Common.InputBox("Every", "Put a WP every x distance (-1 for none)", ref wpevery);
string angle = (90).ToString("0"); string angle = (90).ToString("0");
@ -3337,8 +3341,8 @@ namespace ArdupilotMega.GCSViews
double x1 = Math.Sin((double.Parse(angle)) * deg2rad); double x1 = Math.Sin((double.Parse(angle)) * deg2rad);
// get x y step amount in lat lng from m // get x y step amount in lat lng from m
double latdiff = arearect.HeightLat / ((heightdist / (double.Parse(distance) * (x1) / MainV2.cs.multiplierdist))); double latdiff = arearect.HeightLat / ((heightdist / (double.Parse(distance) * (x1) / MainV2.comPort.MAV.cs.multiplierdist)));
double lngdiff = arearect.WidthLng / ((widthdist / (double.Parse(distance) * (y1) / MainV2.cs.multiplierdist))); double lngdiff = arearect.WidthLng / ((widthdist / (double.Parse(distance) * (y1) / MainV2.comPort.MAV.cs.multiplierdist)));
double latlngdiff = Math.Sqrt(latdiff * latdiff + lngdiff * lngdiff); double latlngdiff = Math.Sqrt(latdiff * latdiff + lngdiff * lngdiff);
@ -3347,7 +3351,7 @@ namespace ArdupilotMega.GCSViews
double fulllatdiff = arearect.HeightLat * x1 * 2; double fulllatdiff = arearect.HeightLat * x1 * 2;
double fulllngdiff = arearect.WidthLng * y1 * 2; double fulllngdiff = arearect.WidthLng * y1 * 2;
int altitude = (int)(double.Parse(alt) / MainV2.cs.multiplierdist); int altitude = (int)(double.Parse(alt) / MainV2.comPort.MAV.cs.multiplierdist);
// draw a grid // draw a grid
double x = arearect.LocationMiddle.Lng; double x = arearect.LocationMiddle.Lng;
@ -3363,8 +3367,8 @@ namespace ArdupilotMega.GCSViews
x1 = Math.Sin((double.Parse(angle) + 90) * deg2rad); x1 = Math.Sin((double.Parse(angle) + 90) * deg2rad);
// get x y step amount in lat lng from m // get x y step amount in lat lng from m
latdiff = arearect.HeightLat / ((heightdist / (double.Parse(distance) * (y1) / MainV2.cs.multiplierdist))); latdiff = arearect.HeightLat / ((heightdist / (double.Parse(distance) * (y1) / MainV2.comPort.MAV.cs.multiplierdist)));
lngdiff = arearect.WidthLng / ((widthdist / (double.Parse(distance) * (x1) / MainV2.cs.multiplierdist))); lngdiff = arearect.WidthLng / ((widthdist / (double.Parse(distance) * (x1) / MainV2.comPort.MAV.cs.multiplierdist)));
quickadd = true; quickadd = true;
@ -3507,7 +3511,7 @@ namespace ArdupilotMega.GCSViews
// int fixme; // int fixme;
// foreach (PointLatLng pnt in PathFind.FindPath(MainV2.cs.HomeLocation.Point(),grid)) // foreach (PointLatLng pnt in PathFind.FindPath(MainV2.comPort.MAV.cs.HomeLocation.Point(),grid))
// { // {
// callMe(pnt.Lat, pnt.Lng, altitude); // callMe(pnt.Lat, pnt.Lng, altitude);
// } // }
@ -3516,11 +3520,11 @@ namespace ArdupilotMega.GCSViews
quickadd = true; quickadd = true;
linelatlng closest = findClosestLine(MainV2.cs.HomeLocation.Point(), grid); linelatlng closest = findClosestLine(MainV2.comPort.MAV.cs.HomeLocation.Point(), grid);
PointLatLng lastpnt; PointLatLng lastpnt;
if (MainMap.Manager.GetDistance(closest.p1, MainV2.cs.HomeLocation.Point()) < MainMap.Manager.GetDistance(closest.p2, MainV2.cs.HomeLocation.Point())) if (MainMap.Manager.GetDistance(closest.p1, MainV2.comPort.MAV.cs.HomeLocation.Point()) < MainMap.Manager.GetDistance(closest.p2, MainV2.comPort.MAV.cs.HomeLocation.Point()))
{ {
lastpnt = closest.p1; lastpnt = closest.p1;
} }
@ -3666,14 +3670,14 @@ namespace ArdupilotMega.GCSViews
string alt = (100 * MainV2.cs.multiplierdist).ToString("0"); string alt = (100 * MainV2.comPort.MAV.cs.multiplierdist).ToString("0");
Common.InputBox("Altitude", "Relative Altitude", ref alt); Common.InputBox("Altitude", "Relative Altitude", ref alt);
string distance = (50 * MainV2.cs.multiplierdist).ToString("0"); string distance = (50 * MainV2.comPort.MAV.cs.multiplierdist).ToString("0");
Common.InputBox("Distance", "Distance between lines", ref distance); Common.InputBox("Distance", "Distance between lines", ref distance);
string wpevery = (40 * MainV2.cs.multiplierdist).ToString("0"); string wpevery = (40 * MainV2.comPort.MAV.cs.multiplierdist).ToString("0");
Common.InputBox("Every", "Put a WP every x distance (-1 for none)", ref wpevery); Common.InputBox("Every", "Put a WP every x distance (-1 for none)", ref wpevery);
string angle = (90).ToString("0"); string angle = (90).ToString("0");
@ -3710,8 +3714,8 @@ namespace ArdupilotMega.GCSViews
double y1 = Math.Sin((double.Parse(angle)) * deg2rad); double y1 = Math.Sin((double.Parse(angle)) * deg2rad);
// get x y step amount in lat lng from m // get x y step amount in lat lng from m
double latdiff = arearect.HeightLat / ((heightdist / (double.Parse(distance) * (y1) / MainV2.cs.multiplierdist))); double latdiff = arearect.HeightLat / ((heightdist / (double.Parse(distance) * (y1) / MainV2.comPort.MAV.cs.multiplierdist)));
double lngdiff = arearect.WidthLng / ((widthdist / (double.Parse(distance) * (x1) / MainV2.cs.multiplierdist))); double lngdiff = arearect.WidthLng / ((widthdist / (double.Parse(distance) * (x1) / MainV2.comPort.MAV.cs.multiplierdist)));
double latlngdiff = Math.Sqrt(latdiff * latdiff + lngdiff * lngdiff); double latlngdiff = Math.Sqrt(latdiff * latdiff + lngdiff * lngdiff);
@ -3721,9 +3725,9 @@ namespace ArdupilotMega.GCSViews
// lat - up down // lat - up down
// lng - left right // lng - left right
int overshootdist = 0;// (int)(double.Parse(overshoot) / MainV2.cs.multiplierdist); int overshootdist = 0;// (int)(double.Parse(overshoot) / MainV2.comPort.MAV.cs.multiplierdist);
int altitude = (int)(double.Parse(alt) / MainV2.cs.multiplierdist); int altitude = (int)(double.Parse(alt) / MainV2.comPort.MAV.cs.multiplierdist);
double overshootdistlng = arearect.WidthLng / widthdist * overshootdist; double overshootdistlng = arearect.WidthLng / widthdist * overshootdist;
@ -4150,7 +4154,7 @@ namespace ArdupilotMega.GCSViews
// take off pitch // take off pitch
int topi = 0; int topi = 0;
if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane)
{ {
string top = "15"; string top = "15";
@ -4188,7 +4192,7 @@ namespace ArdupilotMega.GCSViews
private void trackerHomeToolStripMenuItem_Click(object sender, EventArgs e) private void trackerHomeToolStripMenuItem_Click(object sender, EventArgs e)
{ {
MainV2.cs.TrackerLocation = new PointLatLngAlt(end) { Alt = MainV2.cs.HomeAlt }; MainV2.comPort.MAV.cs.TrackerLocation = new PointLatLngAlt(end) { Alt = MainV2.comPort.MAV.cs.HomeAlt };
} }
private void gridV2ToolStripMenuItem_Click(object sender, EventArgs e) private void gridV2ToolStripMenuItem_Click(object sender, EventArgs e)
@ -4316,7 +4320,7 @@ namespace ArdupilotMega.GCSViews
private void contextMenuStrip1_Opening(object sender, CancelEventArgs e) private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
{ {
if (MainV2.cs.firmware != MainV2.Firmwares.ArduPlane) if (MainV2.comPort.MAV.cs.firmware != MainV2.Firmwares.ArduPlane)
{ {
geoFenceToolStripMenuItem.Enabled = false; geoFenceToolStripMenuItem.Enabled = false;
} }

View File

@ -123,8 +123,4 @@
<data name="BUT_updatecheck.Text" xml:space="preserve"> <data name="BUT_updatecheck.Text" xml:space="preserve">
<value>检查更新</value> <value>检查更新</value>
</data> </data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Help_text" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Welcome_CN.rtf;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
</root> </root>

View File

@ -123,8 +123,4 @@
<data name="BUT_updatecheck.Text" xml:space="preserve"> <data name="BUT_updatecheck.Text" xml:space="preserve">
<value>檢查更新</value> <value>檢查更新</value>
</data> </data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Help_text" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Welcome_TW.rtf;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
</root> </root>

View File

@ -566,7 +566,7 @@ namespace ArdupilotMega.GCSViews
DateTime lastdata = DateTime.MinValue; DateTime lastdata = DateTime.MinValue;
// set enable hil status flag - sends base_mode = 0 // 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); MainV2.comPort.setMode(new MAVLink.mavlink_set_mode_t() { target_system = MainV2.comPort.MAV.sysid }, MAVLink.MAV_MODE_FLAG.HIL_ENABLED);
while (threadrun == 1) while (threadrun == 1)
{ {
@ -623,7 +623,7 @@ namespace ArdupilotMega.GCSViews
try try
{ {
MainV2.cs.UpdateCurrentSettings(null); // when true this uses alot more cpu time MainV2.comPort.MAV.cs.UpdateCurrentSettings(null); // when true this uses alot more cpu time
if ((DateTime.Now - simsendtime).TotalMilliseconds > 19) if ((DateTime.Now - simsendtime).TotalMilliseconds > 19)
{ {
@ -677,8 +677,8 @@ namespace ArdupilotMega.GCSViews
//JSBSimSEND.Client.Send(System.Text.Encoding.ASCII.GetBytes("set position/h-agl-ft 0\r\n")); //JSBSimSEND.Client.Send(System.Text.Encoding.ASCII.GetBytes("set position/h-agl-ft 0\r\n"));
JSBSimSEND.Client.Send(System.Text.Encoding.ASCII.GetBytes("set position/lat-gc-deg " + MainV2.cs.HomeLocation.Lat + "\r\n")); JSBSimSEND.Client.Send(System.Text.Encoding.ASCII.GetBytes("set position/lat-gc-deg " + MainV2.comPort.MAV.cs.HomeLocation.Lat + "\r\n"));
JSBSimSEND.Client.Send(System.Text.Encoding.ASCII.GetBytes("set position/long-gc-deg " + MainV2.cs.HomeLocation.Lng + "\r\n")); JSBSimSEND.Client.Send(System.Text.Encoding.ASCII.GetBytes("set position/long-gc-deg " + MainV2.comPort.MAV.cs.HomeLocation.Lng + "\r\n"));
JSBSimSEND.Client.Send(System.Text.Encoding.ASCII.GetBytes("set attitude/phi-rad 0\r\n")); JSBSimSEND.Client.Send(System.Text.Encoding.ASCII.GetBytes("set attitude/phi-rad 0\r\n"));
JSBSimSEND.Client.Send(System.Text.Encoding.ASCII.GetBytes("set attitude/theta-rad 0\r\n")); JSBSimSEND.Client.Send(System.Text.Encoding.ASCII.GetBytes("set attitude/theta-rad 0\r\n"));
@ -1026,9 +1026,9 @@ namespace ArdupilotMega.GCSViews
hilstate.yaw = (float)sitldata.yawDeg * deg2rad; // (rad) hilstate.yaw = (float)sitldata.yawDeg * deg2rad; // (rad)
hilstate.yawspeed = (float)sitldata.yawRate * deg2rad; // (rad/s) hilstate.yawspeed = (float)sitldata.yawRate * deg2rad; // (rad/s)
hilstate.vx = (short)(sitldata.speedN * 100); // m/s * 100 hilstate.vx = (short)(sitldata.speedE * 100); // m/s * 100
hilstate.vy = (short)(sitldata.speedE * 100); // m/s * 100 hilstate.vy = (short)(sitldata.speedN * 100); // m/s * 100
hilstate.vz = 0; // m/s * 100 hilstate.vz = 0; // m/s * 100 - + speed down
hilstate.xacc = (short)(sitldata.xAccel * 1000); // (mg) hilstate.xacc = (short)(sitldata.xAccel * 1000); // (mg)
hilstate.yacc = (short)(sitldata.yAccel * 1000); // (mg) hilstate.yacc = (short)(sitldata.yAccel * 1000); // (mg)
@ -1084,11 +1084,11 @@ namespace ArdupilotMega.GCSViews
TXT_heading.Text = (heading * rad2deg).ToString("0.000"); TXT_heading.Text = (heading * rad2deg).ToString("0.000");
TXT_yaw.Text = (yaw * rad2deg).ToString("0.000"); TXT_yaw.Text = (yaw * rad2deg).ToString("0.000");
TXT_wpdist.Text = MainV2.cs.wp_dist.ToString(); TXT_wpdist.Text = MainV2.comPort.MAV.cs.wp_dist.ToString();
TXT_bererror.Text = MainV2.cs.ber_error.ToString(); TXT_bererror.Text = MainV2.comPort.MAV.cs.ber_error.ToString();
TXT_alterror.Text = MainV2.cs.alt_error.ToString(); TXT_alterror.Text = MainV2.comPort.MAV.cs.alt_error.ToString();
TXT_WP.Text = MainV2.cs.wpno.ToString(); TXT_WP.Text = MainV2.comPort.MAV.cs.wpno.ToString();
TXT_control_mode.Text = MainV2.cs.mode; TXT_control_mode.Text = MainV2.comPort.MAV.cs.mode;
}); });
} }
catch { this.Invoke((MethodInvoker)delegate { OutputLog.AppendText("NO SIM data - exep\n"); }); } catch { this.Invoke((MethodInvoker)delegate { OutputLog.AppendText("NO SIM data - exep\n"); }); }
@ -1104,10 +1104,10 @@ namespace ArdupilotMega.GCSViews
double[] m = new double[4]; double[] m = new double[4];
m[0] = (ushort)MainV2.cs.ch1out; m[0] = (ushort)MainV2.comPort.MAV.cs.ch1out;
m[1] = (ushort)MainV2.cs.ch2out; m[1] = (ushort)MainV2.comPort.MAV.cs.ch2out;
m[2] = (ushort)MainV2.cs.ch3out; m[2] = (ushort)MainV2.comPort.MAV.cs.ch3out;
m[3] = (ushort)MainV2.cs.ch4out; m[3] = (ushort)MainV2.comPort.MAV.cs.ch4out;
if (!RAD_softFlightGear.Checked) if (!RAD_softFlightGear.Checked)
{ {
@ -1176,24 +1176,24 @@ namespace ArdupilotMega.GCSViews
if (heli) if (heli)
{ {
roll_out = (float)MainV2.cs.hilch1 / rollgain; roll_out = (float)MainV2.comPort.MAV.cs.hilch1 / rollgain;
pitch_out = (float)MainV2.cs.hilch2 / pitchgain; pitch_out = (float)MainV2.comPort.MAV.cs.hilch2 / pitchgain;
throttle_out = 1; throttle_out = 1;
rudder_out = (float)MainV2.cs.hilch4 / -ruddergain; rudder_out = (float)MainV2.comPort.MAV.cs.hilch4 / -ruddergain;
collective_out = (float)(MainV2.cs.hilch3 - 1500) / throttlegain; collective_out = (float)(MainV2.comPort.MAV.cs.hilch3 - 1500) / throttlegain;
} }
else else
{ {
roll_out = (float)MainV2.cs.hilch1 / rollgain; roll_out = (float)MainV2.comPort.MAV.cs.hilch1 / rollgain;
pitch_out = (float)MainV2.cs.hilch2 / pitchgain; pitch_out = (float)MainV2.comPort.MAV.cs.hilch2 / pitchgain;
throttle_out = ((float)MainV2.cs.hilch3) / throttlegain; throttle_out = ((float)MainV2.comPort.MAV.cs.hilch3) / throttlegain;
rudder_out = (float)MainV2.cs.hilch4 / ruddergain; rudder_out = (float)MainV2.comPort.MAV.cs.hilch4 / ruddergain;
if (RAD_aerosimrc.Checked && CHK_quad.Checked) if (RAD_aerosimrc.Checked && CHK_quad.Checked)
{ {
throttle_out = ((float)MainV2.cs.hilch7 / 2 + 5000) / throttlegain; throttle_out = ((float)MainV2.comPort.MAV.cs.hilch7 / 2 + 5000) / throttlegain;
//throttle_out = (float)(MainV2.cs.hilch7 - 1100) / throttlegain; //throttle_out = (float)(MainV2.comPort.MAV.cs.hilch7 - 1100) / throttlegain;
} }
} }
@ -1292,10 +1292,10 @@ namespace ArdupilotMega.GCSViews
if (CHK_quad.Checked) if (CHK_quad.Checked)
{ {
//MainV2.cs.ch1out = 1100; //MainV2.comPort.MAV.cs.ch1out = 1100;
//MainV2.cs.ch2out = 1100; //MainV2.comPort.MAV.cs.ch2out = 1100;
//MainV2.cs.ch3out = 1100; //MainV2.comPort.MAV.cs.ch3out = 1100;
//MainV2.cs.ch4out = 1100; //MainV2.comPort.MAV.cs.ch4out = 1100;
//ac //ac
// 3 front // 3 front
@ -1303,10 +1303,10 @@ namespace ArdupilotMega.GCSViews
// 4 back // 4 back
// 2 left // 2 left
Array.Copy(BitConverter.GetBytes((double)((MainV2.cs.ch3out - 1100) / 800 * 2 - 1)), 0, AeroSimRC, 0, 8); // motor 1 = front Array.Copy(BitConverter.GetBytes((double)((MainV2.comPort.MAV.cs.ch3out - 1100) / 800 * 2 - 1)), 0, AeroSimRC, 0, 8); // motor 1 = front
Array.Copy(BitConverter.GetBytes((double)((MainV2.cs.ch1out - 1100) / 800 * 2 - 1)), 0, AeroSimRC, 8, 8); // motor 2 = right Array.Copy(BitConverter.GetBytes((double)((MainV2.comPort.MAV.cs.ch1out - 1100) / 800 * 2 - 1)), 0, AeroSimRC, 8, 8); // motor 2 = right
Array.Copy(BitConverter.GetBytes((double)((MainV2.cs.ch4out - 1100) / 800 * 2 - 1)), 0, AeroSimRC, 16, 8);// motor 3 = back Array.Copy(BitConverter.GetBytes((double)((MainV2.comPort.MAV.cs.ch4out - 1100) / 800 * 2 - 1)), 0, AeroSimRC, 16, 8);// motor 3 = back
Array.Copy(BitConverter.GetBytes((double)((MainV2.cs.ch2out - 1100) / 800 * 2 - 1)), 0, AeroSimRC, 24, 8);// motor 4 = left Array.Copy(BitConverter.GetBytes((double)((MainV2.comPort.MAV.cs.ch2out - 1100) / 800 * 2 - 1)), 0, AeroSimRC, 24, 8);// motor 4 = left
} }
else else

View File

@ -155,10 +155,10 @@ namespace ArdupilotMega.HIL
} }
public override void SendToSim() public override void SendToSim()
{ {
roll_out = (float)MainV2.cs.hilch1 / rollgain; roll_out = (float)MainV2.comPort.MAV.cs.hilch1 / rollgain;
pitch_out = (float)MainV2.cs.hilch2 / pitchgain; pitch_out = (float)MainV2.comPort.MAV.cs.hilch2 / pitchgain;
throttle_out = ((float)MainV2.cs.hilch3) / throttlegain; throttle_out = ((float)MainV2.comPort.MAV.cs.hilch3) / throttlegain;
rudder_out = (float)MainV2.cs.hilch4 / ruddergain; rudder_out = (float)MainV2.comPort.MAV.cs.hilch4 / ruddergain;
// Limit min and max // Limit min and max
roll_out = Constrain(roll_out, -1, 1); roll_out = Constrain(roll_out, -1, 1);

View File

@ -304,30 +304,30 @@ namespace ArdupilotMega
ushort pitch = pickchannel(2, JoyChannels[2].axis, false, JoyChannels[2].expo); ushort pitch = pickchannel(2, JoyChannels[2].axis, false, JoyChannels[2].expo);
if (getJoystickAxis(1) != Joystick.joystickaxis.None) if (getJoystickAxis(1) != Joystick.joystickaxis.None)
MainV2.cs.rcoverridech1 = (ushort)(BOOL_TO_SIGN(JoyChannels[1].reverse) * ((int)(pitch - 1500) - (int)(roll - 1500)) / 2 + 1500); MainV2.comPort.MAV.cs.rcoverridech1 = (ushort)(BOOL_TO_SIGN(JoyChannels[1].reverse) * ((int)(pitch - 1500) - (int)(roll - 1500)) / 2 + 1500);
if (getJoystickAxis(2) != Joystick.joystickaxis.None) if (getJoystickAxis(2) != Joystick.joystickaxis.None)
MainV2.cs.rcoverridech2 = (ushort)(BOOL_TO_SIGN(JoyChannels[2].reverse) * ((int)(pitch - 1500) + (int)(roll - 1500)) / 2 + 1500); MainV2.comPort.MAV.cs.rcoverridech2 = (ushort)(BOOL_TO_SIGN(JoyChannels[2].reverse) * ((int)(pitch - 1500) + (int)(roll - 1500)) / 2 + 1500);
} }
else else
{ {
if (getJoystickAxis(1) != Joystick.joystickaxis.None) if (getJoystickAxis(1) != Joystick.joystickaxis.None)
MainV2.cs.rcoverridech1 = pickchannel(1, JoyChannels[1].axis, JoyChannels[1].reverse, JoyChannels[1].expo);//(ushort)(((int)state.Rz / 65.535) + 1000); MainV2.comPort.MAV.cs.rcoverridech1 = pickchannel(1, JoyChannels[1].axis, JoyChannels[1].reverse, JoyChannels[1].expo);//(ushort)(((int)state.Rz / 65.535) + 1000);
if (getJoystickAxis(2) != Joystick.joystickaxis.None) if (getJoystickAxis(2) != Joystick.joystickaxis.None)
MainV2.cs.rcoverridech2 = pickchannel(2, JoyChannels[2].axis, JoyChannels[2].reverse, JoyChannels[2].expo);//(ushort)(((int)state.Y / 65.535) + 1000); MainV2.comPort.MAV.cs.rcoverridech2 = pickchannel(2, JoyChannels[2].axis, JoyChannels[2].reverse, JoyChannels[2].expo);//(ushort)(((int)state.Y / 65.535) + 1000);
} }
if (getJoystickAxis(3) != Joystick.joystickaxis.None) if (getJoystickAxis(3) != Joystick.joystickaxis.None)
MainV2.cs.rcoverridech3 = pickchannel(3, JoyChannels[3].axis, JoyChannels[3].reverse, JoyChannels[3].expo);//(ushort)(1000 - ((int)slider[0] / 65.535) + 1000); MainV2.comPort.MAV.cs.rcoverridech3 = pickchannel(3, JoyChannels[3].axis, JoyChannels[3].reverse, JoyChannels[3].expo);//(ushort)(1000 - ((int)slider[0] / 65.535) + 1000);
if (getJoystickAxis(4) != Joystick.joystickaxis.None) if (getJoystickAxis(4) != Joystick.joystickaxis.None)
MainV2.cs.rcoverridech4 = pickchannel(4, JoyChannels[4].axis, JoyChannels[4].reverse, JoyChannels[4].expo);//(ushort)(((int)state.X / 65.535) + 1000); MainV2.comPort.MAV.cs.rcoverridech4 = pickchannel(4, JoyChannels[4].axis, JoyChannels[4].reverse, JoyChannels[4].expo);//(ushort)(((int)state.X / 65.535) + 1000);
if (getJoystickAxis(5) != Joystick.joystickaxis.None) if (getJoystickAxis(5) != Joystick.joystickaxis.None)
MainV2.cs.rcoverridech5 = pickchannel(5, JoyChannels[5].axis, JoyChannels[5].reverse, JoyChannels[5].expo); MainV2.comPort.MAV.cs.rcoverridech5 = pickchannel(5, JoyChannels[5].axis, JoyChannels[5].reverse, JoyChannels[5].expo);
if (getJoystickAxis(6) != Joystick.joystickaxis.None) if (getJoystickAxis(6) != Joystick.joystickaxis.None)
MainV2.cs.rcoverridech6 = pickchannel(6, JoyChannels[6].axis, JoyChannels[6].reverse, JoyChannels[6].expo); MainV2.comPort.MAV.cs.rcoverridech6 = pickchannel(6, JoyChannels[6].axis, JoyChannels[6].reverse, JoyChannels[6].expo);
if (getJoystickAxis(7) != Joystick.joystickaxis.None) if (getJoystickAxis(7) != Joystick.joystickaxis.None)
MainV2.cs.rcoverridech7 = pickchannel(7, JoyChannels[7].axis, JoyChannels[7].reverse, JoyChannels[7].expo); MainV2.comPort.MAV.cs.rcoverridech7 = pickchannel(7, JoyChannels[7].axis, JoyChannels[7].reverse, JoyChannels[7].expo);
if (getJoystickAxis(8) != Joystick.joystickaxis.None) if (getJoystickAxis(8) != Joystick.joystickaxis.None)
MainV2.cs.rcoverridech8 = pickchannel(8, JoyChannels[8].axis, JoyChannels[8].reverse, JoyChannels[8].expo); MainV2.comPort.MAV.cs.rcoverridech8 = pickchannel(8, JoyChannels[8].axis, JoyChannels[8].reverse, JoyChannels[8].expo);
foreach (JoyButton but in JoyButtons) foreach (JoyButton but in JoyButtons)
{ {
@ -346,7 +346,7 @@ namespace ArdupilotMega
} }
} }
//Console.WriteLine("{0} {1} {2} {3}", MainV2.cs.rcoverridech1, MainV2.cs.rcoverridech2, MainV2.cs.rcoverridech3, MainV2.cs.rcoverridech4); //Console.WriteLine("{0} {1} {2} {3}", MainV2.comPort.MAV.cs.rcoverridech1, MainV2.comPort.MAV.cs.rcoverridech2, MainV2.comPort.MAV.cs.rcoverridech3, MainV2.comPort.MAV.cs.rcoverridech4);
} }
catch (Exception ex) { log.Info("Joystick thread error "+ex.ToString()); } // so we cant fall out catch (Exception ex) { log.Info("Joystick thread error "+ex.ToString()); } // so we cant fall out
} }
@ -503,13 +503,13 @@ namespace ArdupilotMega
{ {
int min, max, trim = 0; int min, max, trim = 0;
if (MainV2.comPort.param.Count > 0) if (MainV2.comPort.MAV.param.Count > 0)
{ {
try try
{ {
min = (int)(float)(MainV2.comPort.param["RC" + chan + "_MIN"]); min = (int)(float)(MainV2.comPort.MAV.param["RC" + chan + "_MIN"]);
max = (int)(float)(MainV2.comPort.param["RC" + chan + "_MAX"]); max = (int)(float)(MainV2.comPort.MAV.param["RC" + chan + "_MAX"]);
trim = (int)(float)(MainV2.comPort.param["RC" + chan + "_TRIM"]); trim = (int)(float)(MainV2.comPort.MAV.param["RC" + chan + "_TRIM"]);
} }
catch { catch {
min = 1000; min = 1000;

View File

@ -151,8 +151,8 @@ namespace ArdupilotMega
{ {
MAVLink.mavlink_rc_channels_override_t rc = new MAVLink.mavlink_rc_channels_override_t(); MAVLink.mavlink_rc_channels_override_t rc = new MAVLink.mavlink_rc_channels_override_t();
rc.target_component = MainV2.comPort.compid; rc.target_component = MainV2.comPort.MAV.compid;
rc.target_system = MainV2.comPort.sysid; rc.target_system = MainV2.comPort.MAV.sysid;
rc.chan1_raw = 0; rc.chan1_raw = 0;
rc.chan2_raw = 0; rc.chan2_raw = 0;
@ -264,28 +264,28 @@ namespace ArdupilotMega
MainV2.joystick.elevons = CHK_elevons.Checked; MainV2.joystick.elevons = CHK_elevons.Checked;
MainV2.cs.rcoverridech1 = joy.getValueForChannel(1, CMB_joysticks.Text); MainV2.comPort.MAV.cs.rcoverridech1 = joy.getValueForChannel(1, CMB_joysticks.Text);
MainV2.cs.rcoverridech2 = joy.getValueForChannel(2, CMB_joysticks.Text); MainV2.comPort.MAV.cs.rcoverridech2 = joy.getValueForChannel(2, CMB_joysticks.Text);
MainV2.cs.rcoverridech3 = joy.getValueForChannel(3, CMB_joysticks.Text); MainV2.comPort.MAV.cs.rcoverridech3 = joy.getValueForChannel(3, CMB_joysticks.Text);
MainV2.cs.rcoverridech4 = joy.getValueForChannel(4, CMB_joysticks.Text); MainV2.comPort.MAV.cs.rcoverridech4 = joy.getValueForChannel(4, CMB_joysticks.Text);
MainV2.cs.rcoverridech5 = joy.getValueForChannel(5, CMB_joysticks.Text); MainV2.comPort.MAV.cs.rcoverridech5 = joy.getValueForChannel(5, CMB_joysticks.Text);
MainV2.cs.rcoverridech6 = joy.getValueForChannel(6, CMB_joysticks.Text); MainV2.comPort.MAV.cs.rcoverridech6 = joy.getValueForChannel(6, CMB_joysticks.Text);
MainV2.cs.rcoverridech7 = joy.getValueForChannel(7, CMB_joysticks.Text); MainV2.comPort.MAV.cs.rcoverridech7 = joy.getValueForChannel(7, CMB_joysticks.Text);
MainV2.cs.rcoverridech8 = joy.getValueForChannel(8, CMB_joysticks.Text); MainV2.comPort.MAV.cs.rcoverridech8 = joy.getValueForChannel(8, CMB_joysticks.Text);
//Console.WriteLine(DateTime.Now.Millisecond + " end "); //Console.WriteLine(DateTime.Now.Millisecond + " end ");
} }
} }
catch { } catch { }
progressBar1.Value = MainV2.cs.rcoverridech1; progressBar1.Value = MainV2.comPort.MAV.cs.rcoverridech1;
progressBar2.Value = MainV2.cs.rcoverridech2; progressBar2.Value = MainV2.comPort.MAV.cs.rcoverridech2;
progressBar3.Value = MainV2.cs.rcoverridech3; progressBar3.Value = MainV2.comPort.MAV.cs.rcoverridech3;
progressBar4.Value = MainV2.cs.rcoverridech4; progressBar4.Value = MainV2.comPort.MAV.cs.rcoverridech4;
horizontalProgressBar1.Value = MainV2.cs.rcoverridech5; horizontalProgressBar1.Value = MainV2.comPort.MAV.cs.rcoverridech5;
horizontalProgressBar2.Value = MainV2.cs.rcoverridech6; horizontalProgressBar2.Value = MainV2.comPort.MAV.cs.rcoverridech6;
horizontalProgressBar3.Value = MainV2.cs.rcoverridech7; horizontalProgressBar3.Value = MainV2.comPort.MAV.cs.rcoverridech7;
horizontalProgressBar4.Value = MainV2.cs.rcoverridech8; horizontalProgressBar4.Value = MainV2.comPort.MAV.cs.rcoverridech8;
try try
{ {

View File

@ -388,9 +388,14 @@ namespace ArdupilotMega
} }
if (items[0].Contains("GPS") && items[2] == "1" && items[4] != "0" && items[4] != "-1" && lastline != line) // check gps line and fixed status if (items[0].Contains("GPS") && items[2] == "1" && items[4] != "0" && items[4] != "-1" && lastline != line) // check gps line and fixed status
{ {
MainV2.comPort.MAV.cs.firmware = MainV2.Firmwares.ArduPlane;
if (position[positionindex] == null) if (position[positionindex] == null)
position[positionindex] = new List<Point3D>(); position[positionindex] = new List<Point3D>();
if (double.Parse(items[4], new System.Globalization.CultureInfo("en-US")) == 0)
return;
double alt = double.Parse(items[6], new System.Globalization.CultureInfo("en-US")); double alt = double.Parse(items[6], new System.Globalization.CultureInfo("en-US"));
if (items.Length == 11 && items[6] == "0.0000") if (items.Length == 11 && items[6] == "0.0000")
@ -404,11 +409,16 @@ namespace ArdupilotMega
lastpos = (position[positionindex][position[positionindex].Count - 1]); lastpos = (position[positionindex][position[positionindex].Count - 1]);
lastline = line; lastline = line;
} }
if (items[0].Contains("GPS") && items[4] != "0" && items[4] != "-1" && items.Length <= 9) if (items[0].Contains("GPS") && items[4] != "0" && items[4] != "-1" && items.Length <= 9) // AC
{ {
MainV2.comPort.MAV.cs.firmware = MainV2.Firmwares.ArduCopter2;
if (position[positionindex] == null) if (position[positionindex] == null)
position[positionindex] = new List<Point3D>(); position[positionindex] = new List<Point3D>();
if (double.Parse(items[4], new System.Globalization.CultureInfo("en-US")) == 0)
return;
double alt = double.Parse(items[5], new System.Globalization.CultureInfo("en-US")); double alt = double.Parse(items[5], new System.Globalization.CultureInfo("en-US"));
position[positionindex].Add(new Point3D(double.Parse(items[4], new System.Globalization.CultureInfo("en-US")), double.Parse(items[3], new System.Globalization.CultureInfo("en-US")), alt)); position[positionindex].Add(new Point3D(double.Parse(items[4], new System.Globalization.CultureInfo("en-US")), double.Parse(items[3], new System.Globalization.CultureInfo("en-US")), alt));
@ -522,7 +532,7 @@ namespace ArdupilotMega
AltitudeMode altmode = AltitudeMode.absolute; AltitudeMode altmode = AltitudeMode.absolute;
if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduCopter2)
{ {
altmode = AltitudeMode.relativeToGround; // because of sonar, this is both right and wrong. right for sonar, wrong in terms of gps as the land slopes off. altmode = AltitudeMode.relativeToGround; // because of sonar, this is both right and wrong. right for sonar, wrong in terms of gps as the land slopes off.
} }

View File

@ -160,11 +160,11 @@ namespace ArdupilotMega
{ {
reader.Read(); reader.Read();
reader.ReadStartElement("LOGFORMAT"); reader.ReadStartElement("LOGFORMAT");
if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane)
{ {
reader.ReadToFollowing("APM"); reader.ReadToFollowing("APM");
} }
else if (MainV2.cs.firmware == MainV2.Firmwares.ArduRover) else if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduRover)
{ {
reader.ReadToFollowing("APRover"); reader.ReadToFollowing("APRover");
} }

View File

@ -91,7 +91,7 @@ namespace ArdupilotMega
mine.logreadmode = true; mine.logreadmode = true;
mine.packets.Initialize(); // clear mine.MAV.packets.Initialize(); // clear
// gather data // gather data
while (mine.logplaybackfile.BaseStream.Position < mine.logplaybackfile.BaseStream.Length) while (mine.logplaybackfile.BaseStream.Position < mine.logplaybackfile.BaseStream.Length)
@ -249,7 +249,7 @@ namespace ArdupilotMega
/// <param name="ofs">offsets</param> /// <param name="ofs">offsets</param>
public static void SaveOffsets(double[] ofs) public static void SaveOffsets(double[] ofs)
{ {
if (MainV2.comPort.param.ContainsKey("COMPASS_OFS_X") && MainV2.comPort.BaseStream.IsOpen) if (MainV2.comPort.MAV.param.ContainsKey("COMPASS_OFS_X") && MainV2.comPort.BaseStream.IsOpen)
{ {
try try
{ {

View File

@ -28,6 +28,7 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainV2)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainV2));
this.MyView = new ArdupilotMega.Controls.MainSwitcher(); this.MyView = new ArdupilotMega.Controls.MainSwitcher();
this.MainMenu = new System.Windows.Forms.MenuStrip(); this.MainMenu = new System.Windows.Forms.MenuStrip();
@ -42,8 +43,11 @@
this.toolStripConnectionControl = new ArdupilotMega.Controls.ToolStripConnectionControl(); this.toolStripConnectionControl = new ArdupilotMega.Controls.ToolStripConnectionControl();
this.menu = new ArdupilotMega.Controls.MyButton(); this.menu = new ArdupilotMega.Controls.MyButton();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.CTX_mainmenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.autoHideToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MainMenu.SuspendLayout(); this.MainMenu.SuspendLayout();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.CTX_mainmenu.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// MyView // MyView
@ -58,6 +62,7 @@
// MainMenu // MainMenu
// //
this.MainMenu.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("MainMenu.BackgroundImage"))); this.MainMenu.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("MainMenu.BackgroundImage")));
this.MainMenu.ContextMenuStrip = this.CTX_mainmenu;
this.MainMenu.GripMargin = new System.Windows.Forms.Padding(0); this.MainMenu.GripMargin = new System.Windows.Forms.Padding(0);
this.MainMenu.ImageScalingSize = new System.Drawing.Size(76, 76); this.MainMenu.ImageScalingSize = new System.Drawing.Size(76, 76);
this.MainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.MainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -231,6 +236,23 @@
this.panel1.Visible = false; this.panel1.Visible = false;
this.panel1.MouseLeave += new System.EventHandler(this.MainMenu_MouseLeave); this.panel1.MouseLeave += new System.EventHandler(this.MainMenu_MouseLeave);
// //
// CTX_mainmenu
//
this.CTX_mainmenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.autoHideToolStripMenuItem});
this.CTX_mainmenu.Name = "CTX_mainmenu";
this.CTX_mainmenu.Size = new System.Drawing.Size(153, 48);
//
// autoHideToolStripMenuItem
//
this.autoHideToolStripMenuItem.Checked = true;
this.autoHideToolStripMenuItem.CheckOnClick = true;
this.autoHideToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.autoHideToolStripMenuItem.Name = "autoHideToolStripMenuItem";
this.autoHideToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.autoHideToolStripMenuItem.Text = "AutoHide";
this.autoHideToolStripMenuItem.Click += new System.EventHandler(this.autoHideToolStripMenuItem_Click);
//
// MainV2 // MainV2
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -254,6 +276,7 @@
this.MainMenu.PerformLayout(); this.MainMenu.PerformLayout();
this.panel1.ResumeLayout(false); this.panel1.ResumeLayout(false);
this.panel1.PerformLayout(); this.panel1.PerformLayout();
this.CTX_mainmenu.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@ -275,5 +298,7 @@
private Controls.ToolStripConnectionControl toolStripConnectionControl; private Controls.ToolStripConnectionControl toolStripConnectionControl;
private Controls.MyButton menu; private Controls.MyButton menu;
private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.ContextMenuStrip CTX_mainmenu;
private System.Windows.Forms.ToolStripMenuItem autoHideToolStripMenuItem;
} }
} }

View File

@ -83,10 +83,6 @@ namespace ArdupilotMega
/// </summary> /// </summary>
public static WebCamService.Capture cam = null; public static WebCamService.Capture cam = null;
/// <summary> /// <summary>
/// the static global state of the currently connected MAV
/// </summary>
public static CurrentState cs = new CurrentState();
/// <summary>
/// controls the main serial reader thread /// controls the main serial reader thread
/// </summary> /// </summary>
bool serialThread = false; bool serialThread = false;
@ -153,7 +149,6 @@ namespace ArdupilotMega
log.Info("Mainv2 ctor"); log.Info("Mainv2 ctor");
Form splash = Program.Splash; Form splash = Program.Splash;
splash.Show();
string strVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); string strVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
@ -303,49 +298,48 @@ namespace ArdupilotMega
this.Width = int.Parse(config["MainWidth"].ToString()); this.Width = int.Parse(config["MainWidth"].ToString());
if (config["CMB_rateattitude"] != null) if (config["CMB_rateattitude"] != null)
MainV2.cs.rateattitude = byte.Parse(config["CMB_rateattitude"].ToString()); MainV2.comPort.MAV.cs.rateattitude = byte.Parse(config["CMB_rateattitude"].ToString());
if (config["CMB_rateposition"] != null) if (config["CMB_rateposition"] != null)
MainV2.cs.rateposition = byte.Parse(config["CMB_rateposition"].ToString()); MainV2.comPort.MAV.cs.rateposition = byte.Parse(config["CMB_rateposition"].ToString());
if (config["CMB_ratestatus"] != null) if (config["CMB_ratestatus"] != null)
MainV2.cs.ratestatus = byte.Parse(config["CMB_ratestatus"].ToString()); MainV2.comPort.MAV.cs.ratestatus = byte.Parse(config["CMB_ratestatus"].ToString());
if (config["CMB_raterc"] != null) if (config["CMB_raterc"] != null)
MainV2.cs.raterc = byte.Parse(config["CMB_raterc"].ToString()); MainV2.comPort.MAV.cs.raterc = byte.Parse(config["CMB_raterc"].ToString());
if (config["CMB_ratesensors"] != null) if (config["CMB_ratesensors"] != null)
MainV2.cs.ratesensors = byte.Parse(config["CMB_ratesensors"].ToString()); MainV2.comPort.MAV.cs.ratesensors = byte.Parse(config["CMB_ratesensors"].ToString());
if (config["speechenable"] != null) if (config["speechenable"] != null)
MainV2.speechEnable = bool.Parse(config["speechenable"].ToString()); MainV2.speechEnable = bool.Parse(config["speechenable"].ToString());
//int fixme; //int fixme;
/* /*
MainV2.cs.rateattitude = 50; MainV2.comPort.MAV.cs.rateattitude = 50;
MainV2.cs.rateposition = 50; MainV2.comPort.MAV.cs.rateposition = 50;
MainV2.cs.ratestatus = 50; MainV2.comPort.MAV.cs.ratestatus = 50;
MainV2.cs.raterc = 50; MainV2.comPort.MAV.cs.raterc = 50;
MainV2.cs.ratesensors = 50; MainV2.comPort.MAV.cs.ratesensors = 50;
*/ */
try try
{ {
if (config["TXT_homelat"] != null) if (config["TXT_homelat"] != null)
cs.HomeLocation.Lat = double.Parse(config["TXT_homelat"].ToString()); MainV2.comPort.MAV.cs.HomeLocation.Lat = double.Parse(config["TXT_homelat"].ToString());
if (config["TXT_homelng"] != null) if (config["TXT_homelng"] != null)
cs.HomeLocation.Lng = double.Parse(config["TXT_homelng"].ToString()); MainV2.comPort.MAV.cs.HomeLocation.Lng = double.Parse(config["TXT_homelng"].ToString());
if (config["TXT_homealt"] != null) if (config["TXT_homealt"] != null)
cs.HomeLocation.Alt = double.Parse(config["TXT_homealt"].ToString()); MainV2.comPort.MAV.cs.HomeLocation.Alt = double.Parse(config["TXT_homealt"].ToString());
} }
catch { } catch { }
} }
catch { } catch { }
if (cs.rateattitude == 0) // initilised to 10, configured above from save if (MainV2.comPort.MAV.cs.rateattitude == 0) // initilised to 10, configured above from save
{ {
CustomMessageBox.Show("NOTE: your attitude rate is 0, the hud will not work\nChange in Configuration > Planner > Telemetry Rates"); CustomMessageBox.Show("NOTE: your attitude rate is 0, the hud will not work\nChange in Configuration > Planner > Telemetry Rates");
} }
//System.Threading.Thread.Sleep(2000); //System.Threading.Thread.Sleep(2000);
// make sure new enough .net framework is installed // make sure new enough .net framework is installed
@ -484,7 +478,7 @@ namespace ArdupilotMega
giveComport = false; giveComport = false;
// sanity check // sanity check
if (comPort.BaseStream.IsOpen && cs.groundspeed > 4) if (comPort.BaseStream.IsOpen && MainV2.comPort.MAV.cs.groundspeed > 4)
{ {
if (DialogResult.No == CustomMessageBox.Show("Your model is still moving are you sure you want to disconnect?", "Disconnect", MessageBoxButtons.YesNo)) if (DialogResult.No == CustomMessageBox.Show("Your model is still moving are you sure you want to disconnect?", "Disconnect", MessageBoxButtons.YesNo))
{ {
@ -601,17 +595,17 @@ namespace ArdupilotMega
comPort.Open(true); comPort.Open(true);
// detect firmware we are conected to. // detect firmware we are conected to.
if (comPort.param["SYSID_SW_TYPE"] != null) if (comPort.MAV.param["SYSID_SW_TYPE"] != null)
{ {
if (float.Parse(comPort.param["SYSID_SW_TYPE"].ToString()) == 10) if (float.Parse(comPort.MAV.param["SYSID_SW_TYPE"].ToString()) == 10)
{ {
_connectionControl.TOOL_APMFirmware.SelectedIndex = _connectionControl.TOOL_APMFirmware.Items.IndexOf(Firmwares.ArduCopter2); _connectionControl.TOOL_APMFirmware.SelectedIndex = _connectionControl.TOOL_APMFirmware.Items.IndexOf(Firmwares.ArduCopter2);
} }
else if (float.Parse(comPort.param["SYSID_SW_TYPE"].ToString()) == 20) else if (float.Parse(comPort.MAV.param["SYSID_SW_TYPE"].ToString()) == 20)
{ {
_connectionControl.TOOL_APMFirmware.SelectedIndex = _connectionControl.TOOL_APMFirmware.Items.IndexOf(Firmwares.ArduRover); _connectionControl.TOOL_APMFirmware.SelectedIndex = _connectionControl.TOOL_APMFirmware.Items.IndexOf(Firmwares.ArduRover);
} }
else if (float.Parse(comPort.param["SYSID_SW_TYPE"].ToString()) == 0) else if (float.Parse(comPort.MAV.param["SYSID_SW_TYPE"].ToString()) == 0)
{ {
_connectionControl.TOOL_APMFirmware.SelectedIndex = _connectionControl.TOOL_APMFirmware.Items.IndexOf(Firmwares.ArduPlane); _connectionControl.TOOL_APMFirmware.SelectedIndex = _connectionControl.TOOL_APMFirmware.Items.IndexOf(Firmwares.ArduPlane);
} }
@ -779,7 +773,7 @@ namespace ArdupilotMega
xmlwriter.WriteElementString("baudrate", _connectionControl.CMB_baudrate.Text); xmlwriter.WriteElementString("baudrate", _connectionControl.CMB_baudrate.Text);
xmlwriter.WriteElementString("APMFirmware", MainV2.cs.firmware.ToString()); xmlwriter.WriteElementString("APMFirmware", MainV2.comPort.MAV.cs.firmware.ToString());
foreach (string key in config.Keys) foreach (string key in config.Keys)
{ {
@ -839,7 +833,7 @@ namespace ArdupilotMega
_connectionControl.TOOL_APMFirmware.SelectedIndex = _connectionControl.TOOL_APMFirmware.FindStringExact(temp3); _connectionControl.TOOL_APMFirmware.SelectedIndex = _connectionControl.TOOL_APMFirmware.FindStringExact(temp3);
if (_connectionControl.TOOL_APMFirmware.SelectedIndex == -1) if (_connectionControl.TOOL_APMFirmware.SelectedIndex == -1)
_connectionControl.TOOL_APMFirmware.SelectedIndex = 0; _connectionControl.TOOL_APMFirmware.SelectedIndex = 0;
MainV2.cs.firmware = (MainV2.Firmwares)Enum.Parse(typeof(MainV2.Firmwares), _connectionControl.TOOL_APMFirmware.Text); MainV2.comPort.MAV.cs.firmware = (MainV2.Firmwares)Enum.Parse(typeof(MainV2.Firmwares), _connectionControl.TOOL_APMFirmware.Text);
break; break;
case "Config": case "Config":
break; break;
@ -907,40 +901,40 @@ namespace ArdupilotMega
{ {
MAVLink.mavlink_rc_channels_override_t rc = new MAVLink.mavlink_rc_channels_override_t(); MAVLink.mavlink_rc_channels_override_t rc = new MAVLink.mavlink_rc_channels_override_t();
rc.target_component = comPort.compid; rc.target_component = comPort.MAV.compid;
rc.target_system = comPort.sysid; rc.target_system = comPort.MAV.sysid;
if (joystick.getJoystickAxis(1) != Joystick.joystickaxis.None) if (joystick.getJoystickAxis(1) != Joystick.joystickaxis.None)
rc.chan1_raw = cs.rcoverridech1;//(ushort)(((int)state.Rz / 65.535) + 1000); rc.chan1_raw = MainV2.comPort.MAV.cs.rcoverridech1;//(ushort)(((int)state.Rz / 65.535) + 1000);
if (joystick.getJoystickAxis(2) != Joystick.joystickaxis.None) if (joystick.getJoystickAxis(2) != Joystick.joystickaxis.None)
rc.chan2_raw = cs.rcoverridech2;//(ushort)(((int)state.Y / 65.535) + 1000); rc.chan2_raw = MainV2.comPort.MAV.cs.rcoverridech2;//(ushort)(((int)state.Y / 65.535) + 1000);
if (joystick.getJoystickAxis(3) != Joystick.joystickaxis.None) if (joystick.getJoystickAxis(3) != Joystick.joystickaxis.None)
rc.chan3_raw = cs.rcoverridech3;//(ushort)(1000 - ((int)slider[0] / 65.535 ) + 1000); rc.chan3_raw = MainV2.comPort.MAV.cs.rcoverridech3;//(ushort)(1000 - ((int)slider[0] / 65.535 ) + 1000);
if (joystick.getJoystickAxis(4) != Joystick.joystickaxis.None) if (joystick.getJoystickAxis(4) != Joystick.joystickaxis.None)
rc.chan4_raw = cs.rcoverridech4;//(ushort)(((int)state.X / 65.535) + 1000); rc.chan4_raw = MainV2.comPort.MAV.cs.rcoverridech4;//(ushort)(((int)state.X / 65.535) + 1000);
if (joystick.getJoystickAxis(5) != Joystick.joystickaxis.None) if (joystick.getJoystickAxis(5) != Joystick.joystickaxis.None)
rc.chan5_raw = cs.rcoverridech5; rc.chan5_raw = MainV2.comPort.MAV.cs.rcoverridech5;
if (joystick.getJoystickAxis(6) != Joystick.joystickaxis.None) if (joystick.getJoystickAxis(6) != Joystick.joystickaxis.None)
rc.chan6_raw = cs.rcoverridech6; rc.chan6_raw = MainV2.comPort.MAV.cs.rcoverridech6;
if (joystick.getJoystickAxis(7) != Joystick.joystickaxis.None) if (joystick.getJoystickAxis(7) != Joystick.joystickaxis.None)
rc.chan7_raw = cs.rcoverridech7; rc.chan7_raw = MainV2.comPort.MAV.cs.rcoverridech7;
if (joystick.getJoystickAxis(8) != Joystick.joystickaxis.None) if (joystick.getJoystickAxis(8) != Joystick.joystickaxis.None)
rc.chan8_raw = cs.rcoverridech8; rc.chan8_raw = MainV2.comPort.MAV.cs.rcoverridech8;
if (lastjoystick.AddMilliseconds(rate) < DateTime.Now) if (lastjoystick.AddMilliseconds(rate) < DateTime.Now)
{ {
/* /*
if (cs.rssi > 0 && cs.remrssi > 0) if (MainV2.comPort.MAV.cs.rssi > 0 && MainV2.comPort.MAV.cs.remrssi > 0)
{ {
if (lastratechange.Second != DateTime.Now.Second) if (lastratechange.Second != DateTime.Now.Second)
{ {
if (cs.txbuffer > 90) if (MainV2.comPort.MAV.cs.txbuffer > 90)
{ {
if (rate < 20) if (rate < 20)
rate = 21; rate = 21;
rate--; rate--;
if (cs.linkqualitygcs < 70) if (MainV2.comPort.MAV.cs.linkqualitygcs < 70)
rate = 50; rate = 50;
} }
else else
@ -1052,13 +1046,13 @@ namespace ArdupilotMega
UpdateConnectIcon(); UpdateConnectIcon();
// 30 seconds interval speech options // 30 seconds interval speech options
if (speechEnable && speechEngine != null && (DateTime.Now - speechcustomtime).TotalSeconds > 30 && MainV2.cs.lat != 0 && (MainV2.comPort.logreadmode || comPort.BaseStream.IsOpen)) if (speechEnable && speechEngine != null && (DateTime.Now - speechcustomtime).TotalSeconds > 30 && MainV2.comPort.MAV.cs.lat != 0 && (MainV2.comPort.logreadmode || comPort.BaseStream.IsOpen))
{ {
//speechbatteryvolt //speechbatteryvolt
float warnvolt = 0; float warnvolt = 0;
float.TryParse(MainV2.getConfig("speechbatteryvolt"), out warnvolt); float.TryParse(MainV2.getConfig("speechbatteryvolt"), out warnvolt);
if (MainV2.getConfig("speechbatteryenabled") == "True" && MainV2.cs.battery_voltage <= warnvolt) if (MainV2.getConfig("speechbatteryenabled") == "True" && MainV2.comPort.MAV.cs.battery_voltage <= warnvolt)
{ {
MainV2.speechEngine.SpeakAsync(Common.speechConversion(MainV2.getConfig("speechbattery"))); MainV2.speechEngine.SpeakAsync(Common.speechConversion(MainV2.getConfig("speechbattery")));
} }
@ -1078,7 +1072,7 @@ namespace ArdupilotMega
float.TryParse(MainV2.getConfig("speechaltheight"), out warnalt); float.TryParse(MainV2.getConfig("speechaltheight"), out warnalt);
try try
{ {
if (MainV2.getConfig("speechaltenabled") == "True" && (MainV2.cs.alt - (int)double.Parse(MainV2.getConfig("TXT_homealt"))) <= warnalt) if (MainV2.getConfig("speechaltenabled") == "True" && (MainV2.comPort.MAV.cs.alt - (int)double.Parse(MainV2.getConfig("TXT_homealt"))) <= warnalt)
{ {
if (MainV2.speechEngine.State == SynthesizerState.Ready) if (MainV2.speechEngine.State == SynthesizerState.Ready)
MainV2.speechEngine.SpeakAsync(Common.speechConversion(MainV2.getConfig("speechalt"))); MainV2.speechEngine.SpeakAsync(Common.speechConversion(MainV2.getConfig("speechalt")));
@ -1097,7 +1091,7 @@ namespace ArdupilotMega
// make sure we attenuate the link quality if we dont see any valid packets // make sure we attenuate the link quality if we dont see any valid packets
if ((DateTime.Now - comPort.lastvalidpacket).TotalSeconds > 10) if ((DateTime.Now - comPort.lastvalidpacket).TotalSeconds > 10)
{ {
MainV2.cs.linkqualitygcs = 0; MainV2.comPort.MAV.cs.linkqualitygcs = 0;
} }
// attenuate the link qualty over time // attenuate the link qualty over time
@ -1105,7 +1099,7 @@ namespace ArdupilotMega
{ {
if (linkqualitytime.Second != DateTime.Now.Second) if (linkqualitytime.Second != DateTime.Now.Second)
{ {
MainV2.cs.linkqualitygcs = (ushort)(MainV2.cs.linkqualitygcs * 0.8f); MainV2.comPort.MAV.cs.linkqualitygcs = (ushort)(MainV2.comPort.MAV.cs.linkqualitygcs * 0.8f);
linkqualitytime = DateTime.Now; linkqualitytime = DateTime.Now;
GCSViews.FlightData.myhud.Invalidate(); GCSViews.FlightData.myhud.Invalidate();
@ -1196,7 +1190,7 @@ namespace ArdupilotMega
} }
using (Pen pen = new Pen(Color.Black)) using (Pen pen = new Pen(Color.Black))
{ {
//e.Graphics.DrawRectangle(pen, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); //e.GraphiMainV2.comPort.MAV.cs.DrawRectangle(pen, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1);
} }
} }
} }
@ -1209,6 +1203,18 @@ namespace ArdupilotMega
private void MainV2_Load(object sender, EventArgs e) private void MainV2_Load(object sender, EventArgs e)
{ {
// check if its defined, and force to show it if not known about
if (config["menu_autohide"] == null)
{
config["menu_autohide"] = "false";
}
try
{
AutoHideMenu(bool.Parse(config["menu_autohide"].ToString()));
}
catch { }
MyView.AddScreen(new MainSwitcher.Screen("FlightData", FlightData, true)); MyView.AddScreen(new MainSwitcher.Screen("FlightData", FlightData, true));
MyView.AddScreen(new MainSwitcher.Screen("FlightPlanner", FlightPlanner, true)); MyView.AddScreen(new MainSwitcher.Screen("FlightPlanner", FlightPlanner, true));
MyView.AddScreen(new MainSwitcher.Screen("Config", new GCSViews.ConfigurationView.Setup(), false)); MyView.AddScreen(new MainSwitcher.Screen("Config", new GCSViews.ConfigurationView.Setup(), false));
@ -1221,6 +1227,7 @@ namespace ArdupilotMega
//int fixme; //int fixme;
MenuFlightData_Click(sender, e); MenuFlightData_Click(sender, e);
// for long running tasks using own threads. // for long running tasks using own threads.
// for short use threadpool // for short use threadpool
@ -1384,7 +1391,7 @@ namespace ArdupilotMega
byte[] packet = new byte[256]; byte[] packet = new byte[256];
string sendme = cs.roll + "," + cs.pitch + "," + cs.yaw; string sendme = MainV2.comPort.MAV.cs.roll + "," + MainV2.comPort.MAV.cs.pitch + "," + MainV2.comPort.MAV.cs.yaw;
packet[0] = 0x81; // fin - binary packet[0] = 0x81; // fin - binary
packet[1] = (byte)sendme.Length; packet[1] = (byte)sendme.Length;
@ -1427,17 +1434,17 @@ namespace ArdupilotMega
pmplane.Visibility = true; pmplane.Visibility = true;
SharpKml.Dom.Location loc = new SharpKml.Dom.Location(); SharpKml.Dom.Location loc = new SharpKml.Dom.Location();
loc.Latitude = cs.lat; loc.Latitude = MainV2.comPort.MAV.cs.lat;
loc.Longitude = cs.lng; loc.Longitude = MainV2.comPort.MAV.cs.lng;
loc.Altitude = cs.alt; loc.Altitude = MainV2.comPort.MAV.cs.alt;
if (loc.Altitude < 0) if (loc.Altitude < 0)
loc.Altitude = 0.01; loc.Altitude = 0.01;
SharpKml.Dom.Orientation ori = new SharpKml.Dom.Orientation(); SharpKml.Dom.Orientation ori = new SharpKml.Dom.Orientation();
ori.Heading = cs.yaw; ori.Heading = MainV2.comPort.MAV.cs.yaw;
ori.Roll = -cs.roll; ori.Roll = -MainV2.comPort.MAV.cs.roll;
ori.Tilt = -cs.pitch; ori.Tilt = -MainV2.comPort.MAV.cs.pitch;
SharpKml.Dom.Scale sca = new SharpKml.Dom.Scale(); SharpKml.Dom.Scale sca = new SharpKml.Dom.Scale();
@ -1464,7 +1471,7 @@ namespace ArdupilotMega
Latitude = loc.Latitude.Value, Latitude = loc.Latitude.Value,
Longitude = loc.Longitude.Value, Longitude = loc.Longitude.Value,
Tilt = 80, Tilt = 80,
Heading = cs.yaw, Heading = MainV2.comPort.MAV.cs.yaw,
AltitudeMode = SharpKml.Dom.AltitudeMode.Absolute, AltitudeMode = SharpKml.Dom.AltitudeMode.Absolute,
Range = 50 Range = 50
}; };
@ -1475,7 +1482,7 @@ namespace ArdupilotMega
SharpKml.Dom.CoordinateCollection coords = new SharpKml.Dom.CoordinateCollection(); SharpKml.Dom.CoordinateCollection coords = new SharpKml.Dom.CoordinateCollection();
foreach (var point in MainV2.comPort.wps.Values) foreach (var point in MainV2.comPort.MAV.wps.Values)
{ {
coords.Add(new SharpKml.Base.Vector(point.x, point.y, point.z)); coords.Add(new SharpKml.Base.Vector(point.x, point.y, point.z));
} }
@ -1635,7 +1642,7 @@ namespace ArdupilotMega
private void TOOL_APMFirmware_SelectedIndexChanged(object sender, EventArgs e) private void TOOL_APMFirmware_SelectedIndexChanged(object sender, EventArgs e)
{ {
MainV2.cs.firmware = (MainV2.Firmwares)Enum.Parse(typeof(MainV2.Firmwares), _connectionControl.TOOL_APMFirmware.Text); MainV2.comPort.MAV.cs.firmware = (MainV2.Firmwares)Enum.Parse(typeof(MainV2.Firmwares), _connectionControl.TOOL_APMFirmware.Text);
} }
private void MainV2_Resize(object sender, EventArgs e) private void MainV2_Resize(object sender, EventArgs e)
@ -2257,19 +2264,19 @@ namespace ArdupilotMega
switch ((Common.distances)Enum.Parse(typeof(Common.distances), MainV2.config["distunits"].ToString())) switch ((Common.distances)Enum.Parse(typeof(Common.distances), MainV2.config["distunits"].ToString()))
{ {
case Common.distances.Meters: case Common.distances.Meters:
MainV2.cs.multiplierdist = 1; MainV2.comPort.MAV.cs.multiplierdist = 1;
MainV2.cs.DistanceUnit = "Meters"; MainV2.comPort.MAV.cs.DistanceUnit = "Meters";
break; break;
case Common.distances.Feet: case Common.distances.Feet:
MainV2.cs.multiplierdist = 3.2808399f; MainV2.comPort.MAV.cs.multiplierdist = 3.2808399f;
MainV2.cs.DistanceUnit = "Feet"; MainV2.comPort.MAV.cs.DistanceUnit = "Feet";
break; break;
} }
} }
else else
{ {
MainV2.cs.multiplierdist = 1; MainV2.comPort.MAV.cs.multiplierdist = 1;
MainV2.cs.DistanceUnit = "Meters"; MainV2.comPort.MAV.cs.DistanceUnit = "Meters";
} }
// speed // speed
@ -2278,31 +2285,31 @@ namespace ArdupilotMega
switch ((Common.speeds)Enum.Parse(typeof(Common.speeds), MainV2.config["speedunits"].ToString())) switch ((Common.speeds)Enum.Parse(typeof(Common.speeds), MainV2.config["speedunits"].ToString()))
{ {
case Common.speeds.ms: case Common.speeds.ms:
MainV2.cs.multiplierspeed = 1; MainV2.comPort.MAV.cs.multiplierspeed = 1;
MainV2.cs.SpeedUnit = "m/s"; MainV2.comPort.MAV.cs.SpeedUnit = "m/s";
break; break;
case Common.speeds.fps: case Common.speeds.fps:
MainV2.cs.multiplierdist = 3.2808399f; MainV2.comPort.MAV.cs.multiplierdist = 3.2808399f;
MainV2.cs.SpeedUnit = "fps"; MainV2.comPort.MAV.cs.SpeedUnit = "fps";
break; break;
case Common.speeds.kph: case Common.speeds.kph:
MainV2.cs.multiplierspeed = 3.6f; MainV2.comPort.MAV.cs.multiplierspeed = 3.6f;
MainV2.cs.SpeedUnit = "kph"; MainV2.comPort.MAV.cs.SpeedUnit = "kph";
break; break;
case Common.speeds.mph: case Common.speeds.mph:
MainV2.cs.multiplierspeed = 2.23693629f; MainV2.comPort.MAV.cs.multiplierspeed = 2.23693629f;
MainV2.cs.SpeedUnit = "mph"; MainV2.comPort.MAV.cs.SpeedUnit = "mph";
break; break;
case Common.speeds.knots: case Common.speeds.knots:
MainV2.cs.multiplierspeed = 1.94384449f; MainV2.comPort.MAV.cs.multiplierspeed = 1.94384449f;
MainV2.cs.SpeedUnit = "knots"; MainV2.comPort.MAV.cs.SpeedUnit = "knots";
break; break;
} }
} }
else else
{ {
MainV2.cs.multiplierspeed = 1; MainV2.comPort.MAV.cs.multiplierspeed = 1;
MainV2.cs.SpeedUnit = "m/s"; MainV2.comPort.MAV.cs.SpeedUnit = "m/s";
} }
} }
catch { } catch { }
@ -2359,5 +2366,42 @@ namespace ArdupilotMega
panel1.Visible = true; panel1.Visible = true;
this.ResumeLayout(); this.ResumeLayout();
} }
private void autoHideToolStripMenuItem_Click(object sender, EventArgs e)
{
AutoHideMenu(autoHideToolStripMenuItem.Checked);
config["menu_autohide"] = autoHideToolStripMenuItem.Checked.ToString();
}
void AutoHideMenu(bool hide)
{
autoHideToolStripMenuItem.Checked = hide;
if (!hide)
{
this.SuspendLayout();
panel1.Dock = DockStyle.Top;
panel1.SendToBack();
panel1.Visible = true;
menu.Visible = false;
MainMenu.MouseLeave -= MainMenu_MouseLeave;
panel1.MouseLeave -= MainMenu_MouseLeave;
toolStripConnectionControl.MouseLeave -= MainMenu_MouseLeave;
this.ResumeLayout();
}
else
{
this.SuspendLayout();
panel1.Dock = DockStyle.None;
panel1.Visible = false;
MainMenu.MouseLeave += MainMenu_MouseLeave;
panel1.MouseLeave += MainMenu_MouseLeave;
toolStripConnectionControl.MouseLeave += MainMenu_MouseLeave;
menu.Visible = true;
menu.SendToBack();
this.ResumeLayout();
}
}
} }
} }

View File

@ -178,6 +178,9 @@
F7RNPD7QJqsL9YCOnc3vfuwBNe17h7wL9uHpUD//2Q== F7RNPD7QJqsL9YCOnc3vfuwBNe17h7wL9uHpUD//2Q==
</value> </value>
</data> </data>
<metadata name="CTX_mainmenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>127, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>46</value> <value>46</value>
</metadata> </metadata>

View File

@ -25,6 +25,90 @@ namespace ArdupilotMega
public ICommsSerial BaseStream { get; set; } public ICommsSerial BaseStream { get; set; }
public event EventHandler ParamListChanged; public event EventHandler ParamListChanged;
/// <summary>
/// mavlink remote sysid
/// </summary>
public byte sysid { get { return MAV.sysid; } set { MAV.sysid = value; } }
/// <summary>
/// mavlink remove compid
/// </summary>
public byte compid { get { return MAV.compid; } set { MAV.compid = value; } }
/// <summary>
/// storage for whole paramater list
/// </summary>
public Hashtable param { get { return MAV.param; } set { MAV.param = value; } }
/// <summary>
/// storage of a previous packet recevied of a specific type
/// </summary>
public byte[][] packets { get { return MAV.packets; } set { MAV.packets = value; } }
/// <summary>
/// mavlink ap type
/// </summary>
public MAV_TYPE aptype { get { return MAV.aptype; } set { MAV.aptype = value; } }
public MAV_AUTOPILOT apname { get { return MAV.apname; } set { MAV.apname = value; } }
/// <summary>
/// used as a snapshot of what is loaded on the ap atm. - derived from the stream
/// </summary>
public Dictionary<int, mavlink_mission_item_t> wps { get { return MAV.wps; } set { MAV.wps = value; } }
/// <summary>
/// Store the guided mode wp location
/// </summary>
public mavlink_mission_item_t GuidedMode { get { return MAV.GuidedMode; } set { MAV.GuidedMode = value; } }
internal int recvpacketcount { get { return MAV.recvpacketcount; } set { MAV.recvpacketcount = value; } }
public MAVState MAV = new MAVState();
public class MAVState
{
public MAVState()
{
this.sysid = 0;
this.compid = 0;
this.param = new Hashtable();
this.packets = new byte[0x100][];
this.aptype = 0;
this.apname = 0;
this.recvpacketcount = 0;
}
/// <summary>
/// the static global state of the currently connected MAV
/// </summary>
public CurrentState cs = new CurrentState();
/// <summary>
/// mavlink remote sysid
/// </summary>
public byte sysid { get; set; }
/// <summary>
/// mavlink remove compid
/// </summary>
public byte compid { get; set; }
/// <summary>
/// storage for whole paramater list
/// </summary>
public Hashtable param { get; set; }
/// <summary>
/// storage of a previous packet recevied of a specific type
/// </summary>
public byte[][] packets { get; set; }
/// <summary>
/// mavlink ap type
/// </summary>
public MAV_TYPE aptype { get; set; }
public MAV_AUTOPILOT apname { get; set; }
/// <summary>
/// used as a snapshot of what is loaded on the ap atm. - derived from the stream
/// </summary>
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();
internal int recvpacketcount = 0;
}
private const double CONNECT_TIMEOUT_SECONDS = 30; private const double CONNECT_TIMEOUT_SECONDS = 30;
/// <summary> /// <summary>
@ -36,22 +120,7 @@ namespace ArdupilotMega
/// used for outbound packet sending /// used for outbound packet sending
/// </summary> /// </summary>
byte packetcount = 0; byte packetcount = 0;
/// <summary>
/// mavlink remote sysid
/// </summary>
public byte sysid { get; set; }
/// <summary>
/// mavlink remove compid
/// </summary>
public byte compid { get; set; }
/// <summary>
/// storage for whole paramater list
/// </summary>
public Hashtable param { get; set; }
/// <summary>
/// storage of a previous packet recevied of a specific type
/// </summary>
public byte[][] packets { get; set; }
/// <summary> /// <summary>
/// used to calc packets per second on any single message type - used for stream rate comparaison /// used to calc packets per second on any single message type - used for stream rate comparaison
/// </summary> /// </summary>
@ -105,19 +174,7 @@ namespace ArdupilotMega
/// mavlink version /// mavlink version
/// </summary> /// </summary>
byte mavlinkversion = 0; byte mavlinkversion = 0;
/// <summary>
/// mavlink ap type
/// </summary>
public MAV_TYPE aptype { get; set; }
public MAV_AUTOPILOT apname { get; set; }
/// <summary>
/// used as a snapshot of what is loaded on the ap atm. - derived from the stream
/// </summary>
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> /// <summary>
/// turns on console packet display /// turns on console packet display
/// </summary> /// </summary>
@ -135,7 +192,6 @@ namespace ArdupilotMega
int bps2 = 0; int bps2 = 0;
public int bps { get; set; } public int bps { get; set; }
public DateTime bpstime { get; set; } public DateTime bpstime { get; set; }
int recvpacketcount = 0;
float synclost; float synclost;
float packetslost = 0; float packetslost = 0;
@ -147,10 +203,7 @@ namespace ArdupilotMega
// init fields // init fields
this.BaseStream = new SerialPort(); this.BaseStream = new SerialPort();
this.packetcount = 0; this.packetcount = 0;
this.sysid = 0;
this.compid = 0;
this.param = new Hashtable();
this.packets = new byte[0x100][];
this.packetspersecond = new double[0x100]; this.packetspersecond = new double[0x100];
this.packetspersecondbuild = new DateTime[0x100]; this.packetspersecondbuild = new DateTime[0x100];
this._bytesReceivedSubj = new Subject<int>(); this._bytesReceivedSubj = new Subject<int>();
@ -161,8 +214,7 @@ namespace ArdupilotMega
this.lastvalidpacket = DateTime.Now; this.lastvalidpacket = DateTime.Now;
this.oldlogformat = false; this.oldlogformat = false;
this.mavlinkversion = 0; this.mavlinkversion = 0;
this.aptype = 0;
this.apname = 0;
this.debugmavlink = false; this.debugmavlink = false;
this.logreadmode = false; this.logreadmode = false;
this.lastlogread = DateTime.MinValue; this.lastlogread = DateTime.MinValue;
@ -173,7 +225,7 @@ namespace ArdupilotMega
this.bps2 = 0; this.bps2 = 0;
this.bps = 0; this.bps = 0;
this.bpstime = DateTime.Now; this.bpstime = DateTime.Now;
this.recvpacketcount = 0;
this.packetslost = 0f; this.packetslost = 0f;
this.packetsnotlost = 0f; this.packetsnotlost = 0f;
this.packetlosttimer = DateTime.Now; this.packetlosttimer = DateTime.Now;
@ -1600,7 +1652,7 @@ namespace ArdupilotMega
loc.lat = ((wp.x)); loc.lat = ((wp.x));
loc.lng = ((wp.y)); loc.lng = ((wp.y));
/* /*
if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane)
{ {
switch (loc.id) switch (loc.id)
{ // Switch to map APM command fields inot MAVLink command fields { // Switch to map APM command fields inot MAVLink command fields
@ -2239,7 +2291,7 @@ namespace ArdupilotMega
} }
else else
{ {
MainV2.cs.datetime = DateTime.Now; MainV2.comPort.MAV.cs.datetime = DateTime.Now;
DateTime to = DateTime.Now.AddMilliseconds(BaseStream.ReadTimeout); DateTime to = DateTime.Now.AddMilliseconds(BaseStream.ReadTimeout);
@ -2386,7 +2438,7 @@ namespace ArdupilotMega
packetsnotlost = (packetsnotlost * 0.8f); packetsnotlost = (packetsnotlost * 0.8f);
} }
MainV2.cs.linkqualitygcs = (ushort)((packetsnotlost / (packetsnotlost + packetslost)) * 100.0); MainV2.comPort.MAV.cs.linkqualitygcs = (ushort)((packetsnotlost / (packetsnotlost + packetslost)) * 100.0);
if (bpstime.Second != DateTime.Now.Second && !logreadmode) if (bpstime.Second != DateTime.Now.Second && !logreadmode)
{ {
@ -2758,7 +2810,7 @@ namespace ArdupilotMega
} }
catch { } catch { }
MainV2.cs.datetime = lastlogread; MainV2.comPort.MAV.cs.datetime = lastlogread;
int length = 5; int length = 5;
int a = 0; int a = 0;
@ -2795,7 +2847,7 @@ namespace ArdupilotMega
public bool translateMode(string modein, ref MAVLink.mavlink_set_mode_t mode) public bool translateMode(string modein, ref MAVLink.mavlink_set_mode_t mode)
{ {
//MAVLink09.mavlink_set_mode_t mode = new MAVLink09.mavlink_set_mode_t(); //MAVLink09.mavlink_set_mode_t mode = new MAVLink09.mavlink_set_mode_t();
mode.target_system = MainV2.comPort.sysid; mode.target_system = MainV2.comPort.MAV.sysid;
try try
{ {
@ -2855,13 +2907,13 @@ namespace ArdupilotMega
switch (aptype) switch (aptype)
{ {
case MAVLink.MAV_TYPE.FIXED_WING: case MAVLink.MAV_TYPE.FIXED_WING:
MainV2.cs.firmware = MainV2.Firmwares.ArduPlane; MainV2.comPort.MAV.cs.firmware = MainV2.Firmwares.ArduPlane;
break; break;
case MAVLink.MAV_TYPE.QUADROTOR: case MAVLink.MAV_TYPE.QUADROTOR:
MainV2.cs.firmware = MainV2.Firmwares.ArduCopter2; MainV2.comPort.MAV.cs.firmware = MainV2.Firmwares.ArduCopter2;
break; break;
case MAVLink.MAV_TYPE.GROUND_ROVER: case MAVLink.MAV_TYPE.GROUND_ROVER:
MainV2.cs.firmware = MainV2.Firmwares.ArduRover; MainV2.comPort.MAV.cs.firmware = MainV2.Firmwares.ArduRover;
break; break;
default: default:
break; break;

View File

@ -59,11 +59,11 @@ namespace ArdupilotMega
{ {
SharpKml.Dom.AltitudeMode altmode = SharpKml.Dom.AltitudeMode.Absolute; SharpKml.Dom.AltitudeMode altmode = SharpKml.Dom.AltitudeMode.Absolute;
if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane || MainV2.cs.firmware == MainV2.Firmwares.ArduRover) if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane || MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduRover)
{ {
altmode = SharpKml.Dom.AltitudeMode.Absolute; altmode = SharpKml.Dom.AltitudeMode.Absolute;
} }
else if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2) else if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduCopter2)
{ {
altmode = SharpKml.Dom.AltitudeMode.RelativeToGround; altmode = SharpKml.Dom.AltitudeMode.RelativeToGround;
} }
@ -392,7 +392,7 @@ namespace ArdupilotMega
catch (Exception ex) { log.Debug(ex.ToString()); CustomMessageBox.Show("Log Can not be opened. Are you still connected?"); return; } catch (Exception ex) { log.Debug(ex.ToString()); CustomMessageBox.Show("Log Can not be opened. Are you still connected?"); return; }
mine.logreadmode = true; mine.logreadmode = true;
mine.packets.Initialize(); // clear mine.MAV.packets.Initialize(); // clear
CurrentState cs = new CurrentState(); CurrentState cs = new CurrentState();
@ -561,7 +561,7 @@ namespace ArdupilotMega
mine.logreadmode = true; mine.logreadmode = true;
mine.packets.Initialize(); // clear mine.MAV.packets.Initialize(); // clear
StreamWriter sw = new StreamWriter(Path.GetDirectoryName(logfile)+ Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(logfile) + ".txt"); StreamWriter sw = new StreamWriter(Path.GetDirectoryName(logfile)+ Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(logfile) + ".txt");
@ -676,7 +676,7 @@ namespace ArdupilotMega
catch (Exception ex) { log.Debug(ex.ToString()); CustomMessageBox.Show("Log Can not be opened. Are you still connected?"); return options; } catch (Exception ex) { log.Debug(ex.ToString()); CustomMessageBox.Show("Log Can not be opened. Are you still connected?"); return options; }
MavlinkInterface.logreadmode = true; MavlinkInterface.logreadmode = true;
MavlinkInterface.packets.Initialize(); // clear MavlinkInterface.MAV.packets.Initialize(); // clear
CurrentState cs = new CurrentState(); CurrentState cs = new CurrentState();
@ -1235,7 +1235,7 @@ namespace ArdupilotMega
catch (Exception ex) { log.Debug(ex.ToString()); CustomMessageBox.Show("Log Can not be opened. Are you still connected?"); return; } catch (Exception ex) { log.Debug(ex.ToString()); CustomMessageBox.Show("Log Can not be opened. Are you still connected?"); return; }
mine.logreadmode = true; mine.logreadmode = true;
mine.packets.Initialize(); // clear mine.MAV.packets.Initialize(); // clear
StreamWriter sw = new StreamWriter(Path.GetDirectoryName(logfile) + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(logfile) + ".csv"); StreamWriter sw = new StreamWriter(Path.GetDirectoryName(logfile) + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(logfile) + ".csv");
@ -1300,7 +1300,7 @@ namespace ArdupilotMega
mine.logreadmode = true; mine.logreadmode = true;
mine.packets.Initialize(); // clear mine.MAV.packets.Initialize(); // clear
StreamWriter sw = new StreamWriter(Path.GetDirectoryName(logfile) + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(logfile) + ".param"); StreamWriter sw = new StreamWriter(Path.GetDirectoryName(logfile) + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(logfile) + ".param");
@ -1312,9 +1312,9 @@ namespace ArdupilotMega
mine.getParamList(); mine.getParamList();
foreach (string item in mine.param.Keys) foreach (string item in mine.MAV.param.Keys)
{ {
sw.WriteLine(item + "\t" + mine.param[item]); sw.WriteLine(item + "\t" + mine.MAV.param[item]);
} }
sw.Close(); sw.Close();
@ -1367,7 +1367,7 @@ namespace ArdupilotMega
mine.logreadmode = true; mine.logreadmode = true;
mine.packets.Initialize(); // clear mine.MAV.packets.Initialize(); // clear
while (mine.logplaybackfile.BaseStream.Position < mine.logplaybackfile.BaseStream.Length) while (mine.logplaybackfile.BaseStream.Position < mine.logplaybackfile.BaseStream.Length)
{ {
@ -1407,7 +1407,7 @@ namespace ArdupilotMega
sw.Write("\t" + wp.p4.ToString("0.000000", new System.Globalization.CultureInfo("en-US"))); sw.Write("\t" + wp.p4.ToString("0.000000", new System.Globalization.CultureInfo("en-US")));
sw.Write("\t" + wp.lat.ToString("0.000000", new System.Globalization.CultureInfo("en-US"))); sw.Write("\t" + wp.lat.ToString("0.000000", new System.Globalization.CultureInfo("en-US")));
sw.Write("\t" + wp.lng.ToString("0.000000", new System.Globalization.CultureInfo("en-US"))); sw.Write("\t" + wp.lng.ToString("0.000000", new System.Globalization.CultureInfo("en-US")));
sw.Write("\t" + (wp.alt / MainV2.cs.multiplierdist).ToString("0.000000", new System.Globalization.CultureInfo("en-US"))); sw.Write("\t" + (wp.alt / MainV2.comPort.MAV.cs.multiplierdist).ToString("0.000000", new System.Globalization.CultureInfo("en-US")));
sw.Write("\t" + 1); sw.Write("\t" + 1);
sw.WriteLine(""); sw.WriteLine("");
} }

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" xmlns:iis='http://schemas.microsoft.com/wix/IIsExtension' > <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" xmlns:iis='http://schemas.microsoft.com/wix/IIsExtension' >
<Product Id="*" Name="Mission Planner" Language="1033" Version="1.2.22" Manufacturer="Michael Oborne" UpgradeCode="{625389D7-EB3C-4d77-A5F6-A285CF99437D}"> <Product Id="*" Name="Mission Planner" Language="1033" Version="1.2.25" Manufacturer="Michael Oborne" UpgradeCode="{625389D7-EB3C-4d77-A5F6-A285CF99437D}">
<Package Description="Mission Planner Installer" Comments="Mission Planner Installer" Manufacturer="Michael Oborne" InstallerVersion="200" Compressed="yes" /> <Package Description="Mission Planner Installer" Comments="Mission Planner Installer" Manufacturer="Michael Oborne" InstallerVersion="200" Compressed="yes" />
<Upgrade Id="{625389D7-EB3C-4d77-A5F6-A285CF99437D}"> <Upgrade Id="{625389D7-EB3C-4d77-A5F6-A285CF99437D}">
<UpgradeVersion OnlyDetect="yes" Minimum="1.2.22" Property="NEWERVERSIONDETECTED" IncludeMinimum="no" /> <UpgradeVersion OnlyDetect="yes" Minimum="1.2.25" Property="NEWERVERSIONDETECTED" IncludeMinimum="no" />
<UpgradeVersion OnlyDetect="no" Maximum="1.2.22" Property="OLDERVERSIONBEINGUPGRADED" IncludeMaximum="no" /> <UpgradeVersion OnlyDetect="no" Maximum="1.2.25" Property="OLDERVERSIONBEINGUPGRADED" IncludeMaximum="no" />
</Upgrade> </Upgrade>
<InstallExecuteSequence> <InstallExecuteSequence>
@ -31,7 +31,7 @@
<Permission User="Everyone" GenericAll="yes" /> <Permission User="Everyone" GenericAll="yes" />
</CreateFolder> </CreateFolder>
</Component> </Component>
<Component Id="_comp1" Guid="ed64115d-7954-4054-b1fe-074419886510"> <Component Id="_comp1" Guid="8eda8864-af82-496a-aa0f-abec8aa5cf38">
<File Id="_2" Source="..\bin\release\.gdbinit" /> <File Id="_2" Source="..\bin\release\.gdbinit" />
<File Id="_3" Source="..\bin\release\.gitignore" /> <File Id="_3" Source="..\bin\release\.gitignore" />
<File Id="_4" Source="..\bin\release\aerosim3.91.txt" /> <File Id="_4" Source="..\bin\release\aerosim3.91.txt" />
@ -45,215 +45,223 @@
<File Id="_12" Source="..\bin\release\ArdupilotMegaPlanner.application" /> <File Id="_12" Source="..\bin\release\ArdupilotMegaPlanner.application" />
<File Id="_13" Source="..\bin\release\ArdupilotMegaPlanner.exe.config" /> <File Id="_13" Source="..\bin\release\ArdupilotMegaPlanner.exe.config" />
<File Id="_14" Source="..\bin\release\ArdupilotMegaPlanner.exe.manifest" /> <File Id="_14" Source="..\bin\release\ArdupilotMegaPlanner.exe.manifest" />
<File Id="_15" Source="..\bin\release\ArdupilotMegaPlanner10.application" /> <File Id="_15" Source="..\bin\release\ArdupilotMegaPlanner10.exe" ><netfx:NativeImage Id="ngen_ArdupilotMegaPlannerexe"/> </File>
<File Id="_16" Source="..\bin\release\ArdupilotMegaPlanner10.exe" ><netfx:NativeImage Id="ngen_ArdupilotMegaPlannerexe"/> </File> <File Id="_16" Source="..\bin\release\ArdupilotMegaPlanner10.exe.config" />
<File Id="_17" Source="..\bin\release\ArdupilotMegaPlanner10.exe.config" /> <File Id="_17" Source="..\bin\release\ArdupilotMegaPlanner10.pdb" />
<File Id="_18" Source="..\bin\release\ArdupilotMegaPlanner10.exe.manifest" /> <File Id="_18" Source="..\bin\release\block_plane_0.dae" />
<File Id="_19" Source="..\bin\release\ArdupilotMegaPlanner10.pdb" /> <File Id="_19" Source="..\bin\release\BSE.Windows.Forms.dll" />
<File Id="_20" Source="..\bin\release\block_plane_0.dae" /> <File Id="_20" Source="..\bin\release\BSE.Windows.Forms.pdb" />
<File Id="_21" Source="..\bin\release\BSE.Windows.Forms.dll" /> <File Id="_21" Source="..\bin\release\BSE.Windows.Forms.xml" />
<File Id="_22" Source="..\bin\release\BSE.Windows.Forms.pdb" /> <File Id="_22" Source="..\bin\release\Core.dll" />
<File Id="_23" Source="..\bin\release\BSE.Windows.Forms.xml" /> <File Id="_23" Source="..\bin\release\dataflashlog.xml" />
<File Id="_24" Source="..\bin\release\Core.dll" /> <File Id="_24" Source="..\bin\release\DirectShowLib-2005.dll" />
<File Id="_25" Source="..\bin\release\dataflashlog.xml" /> <File Id="_25" Source="..\bin\release\eeprom.bin" />
<File Id="_26" Source="..\bin\release\DirectShowLib-2005.dll" /> <File Id="_26" Source="..\bin\release\FDLayout.xml" />
<File Id="_27" Source="..\bin\release\eeprom.bin" /> <File Id="_27" Source="..\bin\release\FDscreen.xml" />
<File Id="_28" Source="..\bin\release\FDLayout.xml" /> <File Id="_28" Source="..\bin\release\GMap.NET.Core.dll" />
<File Id="_29" Source="..\bin\release\FDscreen.xml" /> <File Id="_29" Source="..\bin\release\GMap.NET.Core.pdb" />
<File Id="_30" Source="..\bin\release\GMap.NET.Core.dll" /> <File Id="_30" Source="..\bin\release\GMap.NET.WindowsForms.dll" />
<File Id="_31" Source="..\bin\release\GMap.NET.Core.pdb" /> <File Id="_31" Source="..\bin\release\GMap.NET.WindowsForms.pdb" />
<File Id="_32" Source="..\bin\release\GMap.NET.WindowsForms.dll" /> <File Id="_32" Source="..\bin\release\hud.html" />
<File Id="_33" Source="..\bin\release\GMap.NET.WindowsForms.pdb" /> <File Id="_33" Source="..\bin\release\ICSharpCode.SharpZipLib.dll" />
<File Id="_34" Source="..\bin\release\hud.html" /> <File Id="_34" Source="..\bin\release\Ionic.Zip.Reduced.dll" />
<File Id="_35" Source="..\bin\release\ICSharpCode.SharpZipLib.dll" /> <File Id="_35" Source="..\bin\release\IronPython.dll" />
<File Id="_36" Source="..\bin\release\Ionic.Zip.Reduced.dll" /> <File Id="_36" Source="..\bin\release\IronPython.Modules.dll" />
<File Id="_37" Source="..\bin\release\IronPython.dll" /> <File Id="_37" Source="..\bin\release\KMLib.dll" />
<File Id="_38" Source="..\bin\release\IronPython.Modules.dll" /> <File Id="_38" Source="..\bin\release\log4net.dll" />
<File Id="_39" Source="..\bin\release\KMLib.dll" /> <File Id="_39" Source="..\bin\release\mavcmd.xml" />
<File Id="_40" Source="..\bin\release\log4net.dll" /> <File Id="_40" Source="..\bin\release\MAVLink.xml" />
<File Id="_41" Source="..\bin\release\mavcmd.xml" /> <File Id="_41" Source="..\bin\release\MetaDataExtractor.dll" />
<File Id="_42" Source="..\bin\release\MAVLink.xml" /> <File Id="_42" Source="..\bin\release\Microsoft.DirectX.DirectInput.dll" />
<File Id="_43" Source="..\bin\release\MetaDataExtractor.dll" /> <File Id="_43" Source="..\bin\release\Microsoft.DirectX.dll" />
<File Id="_44" Source="..\bin\release\Microsoft.DirectX.dll" /> <File Id="_44" Source="..\bin\release\Microsoft.Dynamic.dll" />
<File Id="_45" Source="..\bin\release\Microsoft.Dynamic.dll" /> <File Id="_45" Source="..\bin\release\Microsoft.Scripting.Core.dll" />
<File Id="_46" Source="..\bin\release\Microsoft.Scripting.Core.dll" /> <File Id="_46" Source="..\bin\release\Microsoft.Scripting.Debugging.dll" />
<File Id="_47" Source="..\bin\release\Microsoft.Scripting.Debugging.dll" /> <File Id="_47" Source="..\bin\release\Microsoft.Scripting.dll" />
<File Id="_48" Source="..\bin\release\Microsoft.Scripting.dll" /> <File Id="_48" Source="..\bin\release\Microsoft.Scripting.ExtensionAttribute.dll" />
<File Id="_49" Source="..\bin\release\Microsoft.Scripting.ExtensionAttribute.dll" /> <File Id="_49" Source="..\bin\release\netDxf.dll" />
<File Id="_50" Source="..\bin\release\netDxf.dll" /> <File Id="_50" Source="..\bin\release\OpenTK.dll" />
<File Id="_51" Source="..\bin\release\OpenTK.dll" /> <File Id="_51" Source="..\bin\release\OpenTK.dll.config" />
<File Id="_52" Source="..\bin\release\OpenTK.dll.config" /> <File Id="_52" Source="..\bin\release\OpenTK.GLControl.dll" />
<File Id="_53" Source="..\bin\release\OpenTK.GLControl.dll" /> <File Id="_53" Source="..\bin\release\ParameterMetaData.xml" />
<File Id="_54" Source="..\bin\release\ParameterMetaData.xml" /> <File Id="_54" Source="..\bin\release\px4uploader.exe" />
<File Id="_55" Source="..\bin\release\px4uploader.exe" /> <File Id="_55" Source="..\bin\release\px4uploader.exe.config" />
<File Id="_56" Source="..\bin\release\px4uploader.exe.config" /> <File Id="_56" Source="..\bin\release\px4uploader.pdb" />
<File Id="_57" Source="..\bin\release\px4uploader.pdb" /> <File Id="_57" Source="..\bin\release\quadhil.xml" />
<File Id="_58" Source="..\bin\release\quadhil.xml" /> <File Id="_58" Source="..\bin\release\runme" />
<File Id="_59" Source="..\bin\release\runme" /> <File Id="_59" Source="..\bin\release\serialsent.raw" />
<File Id="_60" Source="..\bin\release\serialsent.raw" /> <File Id="_60" Source="..\bin\release\SharpKml.dll" />
<File Id="_61" Source="..\bin\release\SharpKml.dll" /> <File Id="_61" Source="..\bin\release\SharpKml.pdb" />
<File Id="_62" Source="..\bin\release\SharpKml.pdb" /> <File Id="_62" Source="..\bin\release\SharpKml.xml" />
<File Id="_63" Source="..\bin\release\SharpKml.xml" /> <File Id="_63" Source="..\bin\release\System.Data.SQLite.dll" />
<File Id="_64" Source="..\bin\release\System.Data.SQLite.dll" /> <File Id="_64" Source="..\bin\release\System.Reactive.dll" />
<File Id="_65" Source="..\bin\release\System.Reactive.dll" /> <File Id="_65" Source="..\bin\release\System.Reactive.xml" />
<File Id="_66" Source="..\bin\release\System.Reactive.xml" /> <File Id="_66" Source="..\bin\release\System.Speech.dll" />
<File Id="_67" Source="..\bin\release\System.Speech.dll" /> <File Id="_67" Source="..\bin\release\Transitions.dll" />
<File Id="_68" Source="..\bin\release\Transitions.dll" /> <File Id="_68" Source="..\bin\release\Updater.exe" />
<File Id="_69" Source="..\bin\release\Updater.exe" /> <File Id="_69" Source="..\bin\release\Updater.exe.config" />
<File Id="_70" Source="..\bin\release\Updater.exe.config" /> <File Id="_70" Source="..\bin\release\Updater.pdb" />
<File Id="_71" Source="..\bin\release\Updater.pdb" /> <File Id="_71" Source="..\bin\release\version.exe" />
<File Id="_72" Source="..\bin\release\version.exe" /> <File Id="_72" Source="..\bin\release\version.txt" />
<File Id="_73" Source="..\bin\release\version.txt" /> <File Id="_73" Source="..\bin\release\ZedGraph.dll" />
<File Id="_74" Source="..\bin\release\ZedGraph.dll" />
</Component> </Component>
<Directory Id="aircraft74" Name="aircraft"> <Directory Id="aircraft73" Name="aircraft">
<Component Id="_comp75" Guid="7dec8f4d-d8f9-4ee0-a8cb-c039a58da002"> <Component Id="_comp74" Guid="ef20ba3d-39a7-4477-9233-f3909045a2c9">
<File Id="_76" Source="..\bin\release\aircraft\placeholder.txt" /> <File Id="_75" Source="..\bin\release\aircraft\placeholder.txt" />
</Component> </Component>
<Directory Id="arducopter76" Name="arducopter"> <Directory Id="arducopter75" Name="arducopter">
<Component Id="_comp77" Guid="4853c92d-b285-4698-95e0-97e33339266f"> <Component Id="_comp76" Guid="ed499a14-18e1-40ed-9453-87f0d5fccbe5">
<File Id="_78" Source="..\bin\release\aircraft\arducopter\arducopter-set.xml" /> <File Id="_77" Source="..\bin\release\aircraft\arducopter\arducopter-set.xml" />
<File Id="_79" Source="..\bin\release\aircraft\arducopter\arducopter.jpg" /> <File Id="_78" Source="..\bin\release\aircraft\arducopter\arducopter.jpg" />
<File Id="_80" Source="..\bin\release\aircraft\arducopter\arducopter.xml" /> <File Id="_79" Source="..\bin\release\aircraft\arducopter\arducopter.xml" />
<File Id="_81" Source="..\bin\release\aircraft\arducopter\initfile.xml" /> <File Id="_80" Source="..\bin\release\aircraft\arducopter\initfile.xml" />
<File Id="_82" Source="..\bin\release\aircraft\arducopter\plus_quad2-set.xml" /> <File Id="_81" Source="..\bin\release\aircraft\arducopter\plus_quad2-set.xml" />
<File Id="_83" Source="..\bin\release\aircraft\arducopter\plus_quad2.xml" /> <File Id="_82" Source="..\bin\release\aircraft\arducopter\plus_quad2.xml" />
<File Id="_84" Source="..\bin\release\aircraft\arducopter\quad.nas" /> <File Id="_83" Source="..\bin\release\aircraft\arducopter\quad.nas" />
<File Id="_85" Source="..\bin\release\aircraft\arducopter\README" /> <File Id="_84" Source="..\bin\release\aircraft\arducopter\README" />
</Component> </Component>
<Directory Id="data85" Name="data"> <Directory Id="data84" Name="data">
<Component Id="_comp86" Guid="6aae134a-5ac6-4390-864d-c8d340a53f8f"> <Component Id="_comp85" Guid="3bd5e16c-ac2d-402b-b263-fa7f698d328f">
<File Id="_87" Source="..\bin\release\aircraft\arducopter\data\arducopter_half_step.txt" /> <File Id="_86" Source="..\bin\release\aircraft\arducopter\data\arducopter_half_step.txt" />
<File Id="_88" Source="..\bin\release\aircraft\arducopter\data\arducopter_step.txt" /> <File Id="_87" Source="..\bin\release\aircraft\arducopter\data\arducopter_step.txt" />
<File Id="_89" Source="..\bin\release\aircraft\arducopter\data\rw_generic_pylon.ac" /> <File Id="_88" Source="..\bin\release\aircraft\arducopter\data\rw_generic_pylon.ac" />
</Component> </Component>
</Directory> </Directory>
<Directory Id="Engines89" Name="Engines"> <Directory Id="Engines88" Name="Engines">
<Component Id="_comp90" Guid="e3037f26-5c51-4a89-9814-a664d0c5c11c"> <Component Id="_comp89" Guid="ff2beef6-2c12-430c-9e08-cc92a434d312">
<File Id="_91" Source="..\bin\release\aircraft\arducopter\Engines\a2830-12.xml" /> <File Id="_90" Source="..\bin\release\aircraft\arducopter\Engines\a2830-12.xml" />
<File Id="_92" Source="..\bin\release\aircraft\arducopter\Engines\prop10x4.5.xml" /> <File Id="_91" Source="..\bin\release\aircraft\arducopter\Engines\prop10x4.5.xml" />
</Component> </Component>
</Directory> </Directory>
<Directory Id="Models92" Name="Models"> <Directory Id="Models91" Name="Models">
<Component Id="_comp93" Guid="a26a9c6a-9a1c-4207-b250-41eafeab728a"> <Component Id="_comp92" Guid="dd1c4dbe-13f3-49d7-8ad4-9d791154b616">
<File Id="_94" Source="..\bin\release\aircraft\arducopter\Models\arducopter.ac" /> <File Id="_93" Source="..\bin\release\aircraft\arducopter\Models\arducopter.ac" />
<File Id="_95" Source="..\bin\release\aircraft\arducopter\Models\arducopter.xml" /> <File Id="_94" Source="..\bin\release\aircraft\arducopter\Models\arducopter.xml" />
<File Id="_96" Source="..\bin\release\aircraft\arducopter\Models\plus_quad.ac" /> <File Id="_95" Source="..\bin\release\aircraft\arducopter\Models\plus_quad.ac" />
<File Id="_97" Source="..\bin\release\aircraft\arducopter\Models\plus_quad2.ac" /> <File Id="_96" Source="..\bin\release\aircraft\arducopter\Models\plus_quad2.ac" />
<File Id="_98" Source="..\bin\release\aircraft\arducopter\Models\plus_quad2.xml" /> <File Id="_97" Source="..\bin\release\aircraft\arducopter\Models\plus_quad2.xml" />
<File Id="_99" Source="..\bin\release\aircraft\arducopter\Models\quad.3ds" /> <File Id="_98" Source="..\bin\release\aircraft\arducopter\Models\quad.3ds" />
<File Id="_100" Source="..\bin\release\aircraft\arducopter\Models\shareware_output.3ds" /> <File Id="_99" Source="..\bin\release\aircraft\arducopter\Models\shareware_output.3ds" />
<File Id="_101" Source="..\bin\release\aircraft\arducopter\Models\Untitled.ac" /> <File Id="_100" Source="..\bin\release\aircraft\arducopter\Models\Untitled.ac" />
<File Id="_102" Source="..\bin\release\aircraft\arducopter\Models\Y6_test.ac" /> <File Id="_101" Source="..\bin\release\aircraft\arducopter\Models\Y6_test.ac" />
</Component> </Component>
</Directory> </Directory>
</Directory> </Directory>
<Directory Id="Rascal102" Name="Rascal"> <Directory Id="Rascal101" Name="Rascal">
<Component Id="_comp103" Guid="f993262f-465f-4089-9514-1b8cb3d38309"> <Component Id="_comp102" Guid="8e12a66c-496f-4061-b983-39dd323a02d8">
<File Id="_104" Source="..\bin\release\aircraft\Rascal\Rascal-keyboard.xml" /> <File Id="_103" Source="..\bin\release\aircraft\Rascal\Rascal-keyboard.xml" />
<File Id="_105" Source="..\bin\release\aircraft\Rascal\Rascal-submodels.xml" /> <File Id="_104" Source="..\bin\release\aircraft\Rascal\Rascal-submodels.xml" />
<File Id="_106" Source="..\bin\release\aircraft\Rascal\Rascal.xml" /> <File Id="_105" Source="..\bin\release\aircraft\Rascal\Rascal.xml" />
<File Id="_107" Source="..\bin\release\aircraft\Rascal\Rascal110-JSBSim-set.xml" /> <File Id="_106" Source="..\bin\release\aircraft\Rascal\Rascal110-JSBSim-set.xml" />
<File Id="_108" Source="..\bin\release\aircraft\Rascal\Rascal110-JSBSim.xml" /> <File Id="_107" Source="..\bin\release\aircraft\Rascal\Rascal110-JSBSim.xml" />
<File Id="_109" Source="..\bin\release\aircraft\Rascal\Rascal110-splash.rgb" /> <File Id="_108" Source="..\bin\release\aircraft\Rascal\Rascal110-splash.rgb" />
<File Id="_110" Source="..\bin\release\aircraft\Rascal\README.Rascal" /> <File Id="_109" Source="..\bin\release\aircraft\Rascal\README.Rascal" />
<File Id="_111" Source="..\bin\release\aircraft\Rascal\reset_CMAC.xml" /> <File Id="_110" Source="..\bin\release\aircraft\Rascal\reset_CMAC.xml" />
<File Id="_112" Source="..\bin\release\aircraft\Rascal\thumbnail.jpg" /> <File Id="_111" Source="..\bin\release\aircraft\Rascal\thumbnail.jpg" />
</Component> </Component>
<Directory Id="Engines112" Name="Engines"> <Directory Id="Engines111" Name="Engines">
<Component Id="_comp113" Guid="077e7060-483b-44af-9f2c-4d4f7734c8fa"> <Component Id="_comp112" Guid="29c6a326-4b22-4bea-86c5-45acb89ad1b3">
<File Id="_114" Source="..\bin\release\aircraft\Rascal\Engines\18x8.xml" /> <File Id="_113" Source="..\bin\release\aircraft\Rascal\Engines\18x8.xml" />
<File Id="_115" Source="..\bin\release\aircraft\Rascal\Engines\Zenoah_G-26A.xml" /> <File Id="_114" Source="..\bin\release\aircraft\Rascal\Engines\Zenoah_G-26A.xml" />
</Component> </Component>
</Directory> </Directory>
<Directory Id="Models115" Name="Models"> <Directory Id="Models114" Name="Models">
<Component Id="_comp116" Guid="60f00e28-eb29-4c72-862a-ff822e5088c1"> <Component Id="_comp115" Guid="2bf62e16-131d-4044-9f9e-85f46165e864">
<File Id="_117" Source="..\bin\release\aircraft\Rascal\Models\Rascal.rgb" /> <File Id="_116" Source="..\bin\release\aircraft\Rascal\Models\Rascal.rgb" />
<File Id="_118" Source="..\bin\release\aircraft\Rascal\Models\Rascal110-000-013.ac" /> <File Id="_117" Source="..\bin\release\aircraft\Rascal\Models\Rascal110-000-013.ac" />
<File Id="_119" Source="..\bin\release\aircraft\Rascal\Models\Rascal110.xml" /> <File Id="_118" Source="..\bin\release\aircraft\Rascal\Models\Rascal110.xml" />
<File Id="_120" Source="..\bin\release\aircraft\Rascal\Models\smoke.png" /> <File Id="_119" Source="..\bin\release\aircraft\Rascal\Models\smoke.png" />
<File Id="_121" Source="..\bin\release\aircraft\Rascal\Models\smokeW.xml" /> <File Id="_120" Source="..\bin\release\aircraft\Rascal\Models\smokeW.xml" />
<File Id="_122" Source="..\bin\release\aircraft\Rascal\Models\Trajectory-Marker.ac" /> <File Id="_121" Source="..\bin\release\aircraft\Rascal\Models\Trajectory-Marker.ac" />
<File Id="_123" Source="..\bin\release\aircraft\Rascal\Models\Trajectory-Marker.xml" /> <File Id="_122" Source="..\bin\release\aircraft\Rascal\Models\Trajectory-Marker.xml" />
</Component> </Component>
</Directory> </Directory>
<Directory Id="Systems123" Name="Systems"> <Directory Id="Systems122" Name="Systems">
<Component Id="_comp124" Guid="a8d3716a-b64c-4bb2-ba69-b94ec3490a28"> <Component Id="_comp123" Guid="7d4cce5e-cc7f-4e7b-bdae-39b4b819b990">
<File Id="_125" Source="..\bin\release\aircraft\Rascal\Systems\110-autopilot.xml" /> <File Id="_124" Source="..\bin\release\aircraft\Rascal\Systems\110-autopilot.xml" />
<File Id="_126" Source="..\bin\release\aircraft\Rascal\Systems\airdata.nas" /> <File Id="_125" Source="..\bin\release\aircraft\Rascal\Systems\airdata.nas" />
<File Id="_127" Source="..\bin\release\aircraft\Rascal\Systems\electrical.xml" /> <File Id="_126" Source="..\bin\release\aircraft\Rascal\Systems\electrical.xml" />
<File Id="_128" Source="..\bin\release\aircraft\Rascal\Systems\main.nas" /> <File Id="_127" Source="..\bin\release\aircraft\Rascal\Systems\main.nas" />
<File Id="_129" Source="..\bin\release\aircraft\Rascal\Systems\ugear.nas" /> <File Id="_128" Source="..\bin\release\aircraft\Rascal\Systems\ugear.nas" />
</Component> </Component>
</Directory> </Directory>
</Directory> </Directory>
</Directory> </Directory>
<Directory Id="de_DE129" Name="de-DE"> <Directory Id="de_DE128" Name="de-DE">
<Component Id="_comp130" Guid="dbcfdd03-4dcc-44f1-aaca-8a6fbfbcce43"> <Component Id="_comp129" Guid="b32fc040-351e-4047-8a03-898c091df6b8">
<File Id="_131" Source="..\bin\release\de-DE\ArdupilotMegaPlanner10.resources.dll" /> <File Id="_130" Source="..\bin\release\de-DE\ArdupilotMegaPlanner10.resources.dll" />
</Component> </Component>
</Directory> </Directory>
<Directory Id="es_ES131" Name="es-ES"> <Directory Id="Driver130" Name="Driver">
<Component Id="_comp132" Guid="897caaa2-e049-4fa9-be8c-89b8656f52d3"> <Component Id="_comp131" Guid="6fea680e-3d6a-4760-a602-db0c16e5c837">
<File Id="_133" Source="..\bin\release\es-ES\ArdupilotMegaPlanner.resources.dll" /> <File Id="_132" Source="..\bin\release\Driver\arduino.cat" />
<File Id="_134" Source="..\bin\release\es-ES\ArdupilotMegaPlanner10.resources.dll" /> <File Id="_133" Source="..\bin\release\Driver\arduino.inf" />
<File Id="_134" Source="..\bin\release\Driver\px4fmu.cat" />
<File Id="_135" Source="..\bin\release\Driver\px4fmu.inf" />
<File Id="_136" Source="..\bin\release\Driver\signed.cer" />
</Component> </Component>
</Directory> </Directory>
<Directory Id="fr134" Name="fr"> <Directory Id="es_ES136" Name="es-ES">
<Component Id="_comp135" Guid="d494e179-b6f2-42f2-bddc-a223f77742f4"> <Component Id="_comp137" Guid="8e85f491-bbc4-447f-bbd7-8e9fd5ec70b1">
<File Id="_136" Source="..\bin\release\fr\ArdupilotMegaPlanner.resources.dll" /> <File Id="_138" Source="..\bin\release\es-ES\ArdupilotMegaPlanner.resources.dll" />
<File Id="_137" Source="..\bin\release\fr\ArdupilotMegaPlanner10.resources.dll" /> <File Id="_139" Source="..\bin\release\es-ES\ArdupilotMegaPlanner10.resources.dll" />
</Component> </Component>
</Directory> </Directory>
<Directory Id="it_IT137" Name="it-IT"> <Directory Id="fr139" Name="fr">
<Component Id="_comp138" Guid="c68bce4d-099f-424c-ad2a-9094648efbaf"> <Component Id="_comp140" Guid="f81019ad-871c-4b7c-a529-1e0c295e873c">
<File Id="_139" Source="..\bin\release\it-IT\ArdupilotMegaPlanner.resources.dll" /> <File Id="_141" Source="..\bin\release\fr\ArdupilotMegaPlanner.resources.dll" />
<File Id="_140" Source="..\bin\release\it-IT\ArdupilotMegaPlanner10.resources.dll" /> <File Id="_142" Source="..\bin\release\fr\ArdupilotMegaPlanner10.resources.dll" />
</Component> </Component>
</Directory> </Directory>
<Directory Id="jsbsim140" Name="jsbsim"> <Directory Id="it_IT142" Name="it-IT">
<Component Id="_comp141" Guid="239bbd79-fcc1-42f3-b241-045fd041c7b5"> <Component Id="_comp143" Guid="f9fa8a36-27cb-4b57-ab47-99edbca336b0">
<File Id="_142" Source="..\bin\release\jsbsim\fgout.xml" /> <File Id="_144" Source="..\bin\release\it-IT\ArdupilotMegaPlanner.resources.dll" />
<File Id="_143" Source="..\bin\release\jsbsim\rascal_test.xml" /> <File Id="_145" Source="..\bin\release\it-IT\ArdupilotMegaPlanner10.resources.dll" />
</Component> </Component>
</Directory> </Directory>
<Directory Id="m3u143" Name="m3u"> <Directory Id="jsbsim145" Name="jsbsim">
<Component Id="_comp144" Guid="85bb1087-b3ed-40d1-af47-3fde8192c4de"> <Component Id="_comp146" Guid="f59985bc-8f32-41ca-aada-ab9f06a26583">
<File Id="_145" Source="..\bin\release\m3u\both.m3u" /> <File Id="_147" Source="..\bin\release\jsbsim\fgout.xml" />
<File Id="_146" Source="..\bin\release\m3u\GeoRefnetworklink.kml" /> <File Id="_148" Source="..\bin\release\jsbsim\rascal_test.xml" />
<File Id="_147" Source="..\bin\release\m3u\hud.m3u" />
<File Id="_148" Source="..\bin\release\m3u\map.m3u" />
<File Id="_149" Source="..\bin\release\m3u\networklink.kml" />
</Component> </Component>
</Directory> </Directory>
<Directory Id="pl149" Name="pl"> <Directory Id="m3u148" Name="m3u">
<Component Id="_comp150" Guid="1c46e22d-f8a3-4600-ac9c-46a55c0d4983"> <Component Id="_comp149" Guid="0e17a3c8-d9f4-4fb4-a782-48cda02b4a83">
<File Id="_151" Source="..\bin\release\pl\ArdupilotMegaPlanner.resources.dll" /> <File Id="_150" Source="..\bin\release\m3u\both.m3u" />
<File Id="_152" Source="..\bin\release\pl\ArdupilotMegaPlanner10.resources.dll" /> <File Id="_151" Source="..\bin\release\m3u\GeoRefnetworklink.kml" />
<File Id="_152" Source="..\bin\release\m3u\hud.m3u" />
<File Id="_153" Source="..\bin\release\m3u\map.m3u" />
<File Id="_154" Source="..\bin\release\m3u\networklink.kml" />
</Component> </Component>
</Directory> </Directory>
<Directory Id="Resources152" Name="Resources"> <Directory Id="pl154" Name="pl">
<Component Id="_comp153" Guid="4843608a-23a2-40bd-b177-ccde23bdcd33"> <Component Id="_comp155" Guid="b3f2efc0-2fff-44bf-a776-9e37a74ed100">
<File Id="_154" Source="..\bin\release\Resources\MAVCmd.txt" /> <File Id="_156" Source="..\bin\release\pl\ArdupilotMegaPlanner.resources.dll" />
<File Id="_155" Source="..\bin\release\Resources\Welcome_to_Michael_Oborne.rtf" /> <File Id="_157" Source="..\bin\release\pl\ArdupilotMegaPlanner10.resources.dll" />
</Component> </Component>
</Directory> </Directory>
<Directory Id="ru_RU155" Name="ru-RU"> <Directory Id="Resources157" Name="Resources">
<Component Id="_comp156" Guid="e5da998d-4ea8-410f-8d1e-e6d400c17fb5"> <Component Id="_comp158" Guid="c2f7719c-1373-4cda-a476-426c417a72b5">
<File Id="_157" Source="..\bin\release\ru-RU\ArdupilotMegaPlanner.resources.dll" /> <File Id="_159" Source="..\bin\release\Resources\MAVCmd.txt" />
<File Id="_158" Source="..\bin\release\ru-RU\ArdupilotMegaPlanner10.resources.dll" /> <File Id="_160" Source="..\bin\release\Resources\Welcome_to_Michael_Oborne.rtf" />
</Component> </Component>
</Directory> </Directory>
<Directory Id="zh_Hans158" Name="zh-Hans"> <Directory Id="ru_RU160" Name="ru-RU">
<Component Id="_comp159" Guid="24c4ecba-7660-4a98-bac1-70f73ecf1eb1"> <Component Id="_comp161" Guid="a4bf1286-c4fc-471d-bf53-cb370acdc205">
<File Id="_160" Source="..\bin\release\zh-Hans\ArdupilotMegaPlanner.resources.dll" /> <File Id="_162" Source="..\bin\release\ru-RU\ArdupilotMegaPlanner.resources.dll" />
<File Id="_161" Source="..\bin\release\zh-Hans\ArdupilotMegaPlanner10.resources.dll" /> <File Id="_163" Source="..\bin\release\ru-RU\ArdupilotMegaPlanner10.resources.dll" />
</Component> </Component>
</Directory> </Directory>
<Directory Id="zh_TW161" Name="zh-TW"> <Directory Id="zh_Hans163" Name="zh-Hans">
<Component Id="_comp162" Guid="dc78168c-2aad-42db-8f0c-3269be35282c"> <Component Id="_comp164" Guid="3052fa6a-f05f-4d91-aedd-2a12785684d7">
<File Id="_163" Source="..\bin\release\zh-TW\ArdupilotMegaPlanner.resources.dll" /> <File Id="_165" Source="..\bin\release\zh-Hans\ArdupilotMegaPlanner.resources.dll" />
<File Id="_164" Source="..\bin\release\zh-TW\ArdupilotMegaPlanner10.resources.dll" /> <File Id="_166" Source="..\bin\release\zh-Hans\ArdupilotMegaPlanner10.resources.dll" />
</Component>
</Directory>
<Directory Id="zh_TW166" Name="zh-TW">
<Component Id="_comp167" Guid="d6efa64a-9952-446a-afd5-b40fbad8c877">
<File Id="_168" Source="..\bin\release\zh-TW\ArdupilotMegaPlanner.resources.dll" />
<File Id="_169" Source="..\bin\release\zh-TW\ArdupilotMegaPlanner10.resources.dll" />
</Component> </Component>
</Directory> </Directory>
@ -311,26 +319,27 @@
<ComponentRef Id="InstallDirPermissions" /> <ComponentRef Id="InstallDirPermissions" />
<ComponentRef Id="_comp1" /> <ComponentRef Id="_comp1" />
<ComponentRef Id="_comp75" /> <ComponentRef Id="_comp74" />
<ComponentRef Id="_comp77" /> <ComponentRef Id="_comp76" />
<ComponentRef Id="_comp86" /> <ComponentRef Id="_comp85" />
<ComponentRef Id="_comp90" /> <ComponentRef Id="_comp89" />
<ComponentRef Id="_comp93" /> <ComponentRef Id="_comp92" />
<ComponentRef Id="_comp103" /> <ComponentRef Id="_comp102" />
<ComponentRef Id="_comp113" /> <ComponentRef Id="_comp112" />
<ComponentRef Id="_comp116" /> <ComponentRef Id="_comp115" />
<ComponentRef Id="_comp124" /> <ComponentRef Id="_comp123" />
<ComponentRef Id="_comp130" /> <ComponentRef Id="_comp129" />
<ComponentRef Id="_comp132" /> <ComponentRef Id="_comp131" />
<ComponentRef Id="_comp135" /> <ComponentRef Id="_comp137" />
<ComponentRef Id="_comp138" /> <ComponentRef Id="_comp140" />
<ComponentRef Id="_comp141" /> <ComponentRef Id="_comp143" />
<ComponentRef Id="_comp144" /> <ComponentRef Id="_comp146" />
<ComponentRef Id="_comp150" /> <ComponentRef Id="_comp149" />
<ComponentRef Id="_comp153" /> <ComponentRef Id="_comp155" />
<ComponentRef Id="_comp156" /> <ComponentRef Id="_comp158" />
<ComponentRef Id="_comp159" /> <ComponentRef Id="_comp161" />
<ComponentRef Id="_comp162" /> <ComponentRef Id="_comp164" />
<ComponentRef Id="_comp167" />
<ComponentRef Id="ApplicationShortcut" /> <ComponentRef Id="ApplicationShortcut" />
@ -350,7 +359,7 @@
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch Mission Planner" /> <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch Mission Planner" />
<!-- Step 3: Include the custom action --> <!-- Step 3: Include the custom action -->
<Property Id="WixShellExecTarget" Value="[#_16]" /> <Property Id="WixShellExecTarget" Value="[#_15]" />
<CustomAction Id="LaunchApplication" <CustomAction Id="LaunchApplication"
BinaryKey="WixCA" BinaryKey="WixCA"
DllEntry="WixShellExec" DllEntry="WixShellExec"

View File

@ -268,11 +268,11 @@ namespace ArdupilotMega.Presenter
private object GetParam(string paramName, Type paramType) private object GetParam(string paramName, Type paramType)
{ {
if (_mavlink.param.ContainsKey(paramName)) if (_mavlink.MAV.param.ContainsKey(paramName))
{ {
return paramType == typeof (bool) return paramType == typeof (bool)
? _mavlink.param[paramName].ToString() == "1" ? _mavlink.MAV.param[paramName].ToString() == "1"
: Convert.ChangeType(_mavlink.param[paramName].ToString(), paramType); : Convert.ChangeType(_mavlink.MAV.param[paramName].ToString(), paramType);
} }
log.ErrorFormat("Could not get param {0}", paramName); log.ErrorFormat("Could not get param {0}", paramName);
return null; return null;

View File

@ -125,6 +125,8 @@ namespace ArdupilotMega
Splash = new ArdupilotMega.Splash(); Splash = new ArdupilotMega.Splash();
Splash.Show(); Splash.Show();
Application.DoEvents();
try try
{ {
Thread.CurrentThread.Name = "Base Thread"; Thread.CurrentThread.Name = "Base Thread";

View File

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

View File

@ -145,45 +145,45 @@ namespace ArdupilotMega
//Console.WriteLine(DateTime.Now.Millisecond + " timer2 serial"); //Console.WriteLine(DateTime.Now.Millisecond + " timer2 serial");
try try
{ {
MainV2.cs.UpdateCurrentSettings(currentStateBindingSource); MainV2.comPort.MAV.cs.UpdateCurrentSettings(currentStateBindingSource);
} }
catch { } catch { }
if (sw != null && sw.BaseStream.CanWrite) if (sw != null && sw.BaseStream.CanWrite)
{ {
sw.WriteLine(string.Format("{0},{1},{2},{3},{4},{5},{6}",DateTime.Now.ToString(), MainV2.cs.ax, MainV2.cs.ay, MainV2.cs.az, MainV2.cs.gx,MainV2.cs.gy, MainV2.cs.gz)); sw.WriteLine(string.Format("{0},{1},{2},{3},{4},{5},{6}",DateTime.Now.ToString(), MainV2.comPort.MAV.cs.ax, MainV2.comPort.MAV.cs.ay, MainV2.comPort.MAV.cs.az, MainV2.comPort.MAV.cs.gx,MainV2.comPort.MAV.cs.gy, MainV2.comPort.MAV.cs.gz));
} }
double time = (Environment.TickCount - tickStart) / 1000.0; double time = (Environment.TickCount - tickStart) / 1000.0;
if (chkax.Checked) if (chkax.Checked)
{ {
list1.Add(time, ArdupilotMega.MainV2.cs.ax); list1.Add(time, ArdupilotMega.MainV2.comPort.MAV.cs.ax);
} }
else { list1.Clear(); } else { list1.Clear(); }
if (chkay.Checked) if (chkay.Checked)
{ {
list2.Add(time, ArdupilotMega.MainV2.cs.ay); list2.Add(time, ArdupilotMega.MainV2.comPort.MAV.cs.ay);
} }
else { list2.Clear(); } else { list2.Clear(); }
if (chkaz.Checked) if (chkaz.Checked)
{ {
list3.Add(time, ArdupilotMega.MainV2.cs.az); list3.Add(time, ArdupilotMega.MainV2.comPort.MAV.cs.az);
} }
else { list3.Clear(); } else { list3.Clear(); }
if (chkgx.Checked) if (chkgx.Checked)
{ {
list4.Add(time, ArdupilotMega.MainV2.cs.gx); list4.Add(time, ArdupilotMega.MainV2.comPort.MAV.cs.gx);
} }
else { list4.Clear(); } else { list4.Clear(); }
if (chkgy.Checked) if (chkgy.Checked)
{ {
list5.Add(time, ArdupilotMega.MainV2.cs.gy); list5.Add(time, ArdupilotMega.MainV2.comPort.MAV.cs.gy);
} }
else { list5.Clear(); } else { list5.Clear(); }
if (chkgz.Checked) if (chkgz.Checked)
{ {
list6.Add(time, ArdupilotMega.MainV2.cs.gz); list6.Add(time, ArdupilotMega.MainV2.comPort.MAV.cs.gz);
} }
else { list6.Clear(); } else { list6.Clear(); }
} }
@ -237,7 +237,7 @@ namespace ArdupilotMega
//comPort.requestDatastream((byte)ArdupilotMega.MAVLink09.MAV_DATA_STREAM.POSITION, 3); // request location //comPort.requestDatastream((byte)ArdupilotMega.MAVLink09.MAV_DATA_STREAM.POSITION, 3); // request location
//comPort.requestDatastream((byte)ArdupilotMega.MAVLink09.MAV_DATA_STREAM.EXTRA1, 3); // request attitude //comPort.requestDatastream((byte)ArdupilotMega.MAVLink09.MAV_DATA_STREAM.EXTRA1, 3); // request attitude
//comPort.requestDatastream((byte)ArdupilotMega.MAVLink09.MAV_DATA_STREAM.EXTRA2, 3); // request vfr //comPort.requestDatastream((byte)ArdupilotMega.MAVLink09.MAV_DATA_STREAM.EXTRA2, 3); // request vfr
MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.RAW_SENSORS, MainV2.cs.ratesensors); // request raw sensor MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.RAW_SENSORS, MainV2.comPort.MAV.cs.ratesensors); // request raw sensor
//comPort.requestDatastream((byte)ArdupilotMega.MAVLink09.MAV_DATA_STREAM.RC_CHANNELS, 3); // request rc info //comPort.requestDatastream((byte)ArdupilotMega.MAVLink09.MAV_DATA_STREAM.RC_CHANNELS, 3); // request rc info
} }
catch catch
@ -250,7 +250,7 @@ namespace ArdupilotMega
private void CMB_rawupdaterate_SelectedIndexChanged(object sender, EventArgs e) private void CMB_rawupdaterate_SelectedIndexChanged(object sender, EventArgs e)
{ {
MainV2.cs.ratesensors = (byte)int.Parse(CMB_rawupdaterate.Text); MainV2.comPort.MAV.cs.ratesensors = (byte)int.Parse(CMB_rawupdaterate.Text);
MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.RAW_SENSORS, (byte)int.Parse(CMB_rawupdaterate.Text)); // request raw sensor MainV2.comPort.requestDatastream((byte)ArdupilotMega.MAVLink.MAV_DATA_STREAM.RAW_SENSORS, (byte)int.Parse(CMB_rawupdaterate.Text)); // request raw sensor
} }

View File

@ -481,6 +481,14 @@ namespace ArdupilotMega
S9.DataSource = Range(414000, 100, 454000); S9.DataSource = Range(414000, 100, 454000);
RS9.DataSource = Range(414000, 100, 454000); RS9.DataSource = Range(414000, 100, 454000);
} }
else if (freq == uploader.Uploader.Code.FREQ_868)
{
S8.DataSource = Range(868000, 100, 869000);
RS8.DataSource = Range(868000, 100, 869000);
S9.DataSource = Range(868000, 100, 869000);
RS9.DataSource = Range(868000, 100, 869000);
}
if (board == uploader.Uploader.Code.DEVICE_ID_RFD900 || board == uploader.Uploader.Code.DEVICE_ID_RFD900A) if (board == uploader.Uploader.Code.DEVICE_ID_RFD900 || board == uploader.Uploader.Code.DEVICE_ID_RFD900A)
{ {

View File

@ -27,7 +27,7 @@ namespace ArdupilotMega
engine = Python.CreateEngine(options); engine = Python.CreateEngine(options);
scope = engine.CreateScope(); scope = engine.CreateScope();
scope.SetVariable("cs", MainV2.cs); scope.SetVariable("cs", MainV2.comPort.MAV.cs);
scope.SetVariable("Script", this); scope.SetVariable("Script", this);
scope.SetVariable("mavutil", this); scope.SetVariable("mavutil", this);
@ -35,7 +35,7 @@ namespace ArdupilotMega
engine.CreateScriptSourceFromString("print cs.roll").Execute(scope); engine.CreateScriptSourceFromString("print cs.roll").Execute(scope);
object thisBoxed = MainV2.cs; object thisBoxed = MainV2.comPort.MAV.cs;
Type test = thisBoxed.GetType(); Type test = thisBoxed.GetType();
foreach (var field in test.GetProperties()) foreach (var field in test.GetProperties())
@ -104,8 +104,8 @@ namespace ArdupilotMega
public float GetParam(string param) public float GetParam(string param)
{ {
if (MainV2.comPort.param[param] != null) if (MainV2.comPort.MAV.param[param] != null)
return (float)MainV2.comPort.param[param]; return (float)MainV2.comPort.MAV.param[param];
return 0.0f; return 0.0f;
} }
@ -119,7 +119,7 @@ namespace ArdupilotMega
public bool WaitFor(string message, int timeout) public bool WaitFor(string message, int timeout)
{ {
int timein = 0; int timein = 0;
while (!MainV2.cs.message.Contains(message)) while (!MainV2.comPort.MAV.cs.message.Contains(message))
{ {
System.Threading.Thread.Sleep(5); System.Threading.Thread.Sleep(5);
timein += 5; timein += 5;
@ -135,41 +135,41 @@ namespace ArdupilotMega
switch (channel) switch (channel)
{ {
case 1: case 1:
MainV2.cs.rcoverridech1 = pwm; MainV2.comPort.MAV.cs.rcoverridech1 = pwm;
rc.chan1_raw = pwm; rc.chan1_raw = pwm;
break; break;
case 2: case 2:
MainV2.cs.rcoverridech2 = pwm; MainV2.comPort.MAV.cs.rcoverridech2 = pwm;
rc.chan2_raw = pwm; rc.chan2_raw = pwm;
break; break;
case 3: case 3:
MainV2.cs.rcoverridech3 = pwm; MainV2.comPort.MAV.cs.rcoverridech3 = pwm;
rc.chan3_raw = pwm; rc.chan3_raw = pwm;
break; break;
case 4: case 4:
MainV2.cs.rcoverridech4 = pwm; MainV2.comPort.MAV.cs.rcoverridech4 = pwm;
rc.chan4_raw = pwm; rc.chan4_raw = pwm;
break; break;
case 5: case 5:
MainV2.cs.rcoverridech5 = pwm; MainV2.comPort.MAV.cs.rcoverridech5 = pwm;
rc.chan5_raw = pwm; rc.chan5_raw = pwm;
break; break;
case 6: case 6:
MainV2.cs.rcoverridech6 = pwm; MainV2.comPort.MAV.cs.rcoverridech6 = pwm;
rc.chan6_raw = pwm; rc.chan6_raw = pwm;
break; break;
case 7: case 7:
MainV2.cs.rcoverridech7 = pwm; MainV2.comPort.MAV.cs.rcoverridech7 = pwm;
rc.chan7_raw = pwm; rc.chan7_raw = pwm;
break; break;
case 8: case 8:
MainV2.cs.rcoverridech8 = pwm; MainV2.comPort.MAV.cs.rcoverridech8 = pwm;
rc.chan8_raw = pwm; rc.chan8_raw = pwm;
break; break;
} }
rc.target_component = MainV2.comPort.compid; rc.target_component = MainV2.comPort.MAV.compid;
rc.target_system = MainV2.comPort.sysid; rc.target_system = MainV2.comPort.MAV.sysid;
if (sendnow) if (sendnow)
{ {

View File

@ -68,14 +68,14 @@ namespace ArdupilotMega
{ {
try try
{ {
double lat = (int)MainV2.cs.lat + ((MainV2.cs.lat - (int)MainV2.cs.lat) * .6f); double lat = (int)MainV2.comPort.MAV.cs.lat + ((MainV2.comPort.MAV.cs.lat - (int)MainV2.comPort.MAV.cs.lat) * .6f);
double lng = (int)MainV2.cs.lng + ((MainV2.cs.lng - (int)MainV2.cs.lng) * .6f); double lng = (int)MainV2.comPort.MAV.cs.lng + ((MainV2.comPort.MAV.cs.lng - (int)MainV2.comPort.MAV.cs.lng) * .6f);
string line = string.Format("$GP{0},{1:HHmmss},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},", "GGA", DateTime.Now.ToUniversalTime(), Math.Abs(lat * 100), MainV2.cs.lat < 0 ? "S" : "N", Math.Abs(lng * 100), MainV2.cs.lng < 0 ? "W" : "E", MainV2.cs.gpsstatus, MainV2.cs.satcount, MainV2.cs.gpshdop, MainV2.cs.alt, "M", 0, "M", ""); string line = string.Format("$GP{0},{1:HHmmss},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},", "GGA", DateTime.Now.ToUniversalTime(), Math.Abs(lat * 100), MainV2.comPort.MAV.cs.lat < 0 ? "S" : "N", Math.Abs(lng * 100), MainV2.comPort.MAV.cs.lng < 0 ? "W" : "E", MainV2.comPort.MAV.cs.gpsstatus, MainV2.comPort.MAV.cs.satcount, MainV2.comPort.MAV.cs.gpshdop, MainV2.comPort.MAV.cs.alt, "M", 0, "M", "");
string checksum = GetChecksum(line); string checksum = GetChecksum(line);
comPort.WriteLine(line + "*" + checksum); comPort.WriteLine(line + "*" + checksum);
line = string.Format("$GP{0},{1:HHmmss},{2},{3},{4},{5},{6},{7},{8},{9:ddMMyy},{10},", "RMC", DateTime.Now.ToUniversalTime(), "A", Math.Abs(lat * 100), MainV2.cs.lat < 0 ? "S" : "N", Math.Abs(lng * 100), MainV2.cs.lng < 0 ? "W" : "E", MainV2.cs.groundspeed * 3.6, MainV2.cs.groundcourse, DateTime.Now, 0); line = string.Format("$GP{0},{1:HHmmss},{2},{3},{4},{5},{6},{7},{8},{9:ddMMyy},{10},", "RMC", DateTime.Now.ToUniversalTime(), "A", Math.Abs(lat * 100), MainV2.comPort.MAV.cs.lat < 0 ? "S" : "N", Math.Abs(lng * 100), MainV2.comPort.MAV.cs.lng < 0 ? "W" : "E", MainV2.comPort.MAV.cs.groundspeed * 3.6, MainV2.comPort.MAV.cs.groundcourse, DateTime.Now, 0);
checksum = GetChecksum(line); checksum = GetChecksum(line);
comPort.WriteLine(line + "*" + checksum); comPort.WriteLine(line + "*" + checksum);

View File

@ -118,19 +118,19 @@ namespace ArdupilotMega
double x,y,z; double x,y,z;
GetGeo(out x, out y, out z, MainV2.cs.lat, MainV2.cs.lng, MainV2.cs.alt); GetGeo(out x, out y, out z, MainV2.comPort.MAV.cs.lat, MainV2.comPort.MAV.cs.lng, MainV2.comPort.MAV.cs.alt);
writeline(string.Format("#5,{0},{1},{2},{3},{4},", x * 100, y * 100, z*100, MainV2.cs.gpshdop + 0.01, MainV2.cs.satcount)); writeline(string.Format("#5,{0},{1},{2},{3},{4},", x * 100, y * 100, z*100, MainV2.comPort.MAV.cs.gpshdop + 0.01, MainV2.comPort.MAV.cs.satcount));
writeline(string.Format("#6,{0},{1},{2},{3},", MainV2.cs.groundspeed * Math.Sin(MainV2.cs.groundcourse * deg2rad), writeline(string.Format("#6,{0},{1},{2},{3},", MainV2.comPort.MAV.cs.groundspeed * Math.Sin(MainV2.comPort.MAV.cs.groundcourse * deg2rad),
MainV2.cs.groundspeed * Math.Cos(MainV2.cs.groundcourse * deg2rad), MainV2.comPort.MAV.cs.groundspeed * Math.Cos(MainV2.comPort.MAV.cs.groundcourse * deg2rad),
MainV2.cs.verticalspeed,2)); MainV2.comPort.MAV.cs.verticalspeed,2));
writeline(string.Format("#7,{0},{1},{2},", MainV2.cs.roll * deg2rad, MainV2.cs.pitch * deg2rad, MainV2.cs.yaw * deg2rad)); writeline(string.Format("#7,{0},{1},{2},", MainV2.comPort.MAV.cs.roll * deg2rad, MainV2.comPort.MAV.cs.pitch * deg2rad, MainV2.comPort.MAV.cs.yaw * deg2rad));
writeline(string.Format("#8,{0},{1},{2},", MainV2.cs.alt , MainV2.cs.alt , MainV2.cs.press_temp)); writeline(string.Format("#8,{0},{1},{2},", MainV2.comPort.MAV.cs.alt , MainV2.comPort.MAV.cs.alt , MainV2.comPort.MAV.cs.press_temp));
writeline(string.Format("#9,{0},{1},{2},", MainV2.cs.mx, MainV2.cs.my, MainV2.cs.mz)); writeline(string.Format("#9,{0},{1},{2},", MainV2.comPort.MAV.cs.mx, MainV2.comPort.MAV.cs.my, MainV2.comPort.MAV.cs.mz));
// writeline(string.Format("#10,{0},{1},{2},", 1.354,-1.549,0.972)); // writeline(string.Format("#10,{0},{1},{2},", 1.354,-1.549,0.972));

View File

@ -47,7 +47,7 @@ namespace ArdupilotMega.Utilities
// Either it will be pulled from a file in the ArduPlane hierarchy or the ArduCopter hierarchy // Either it will be pulled from a file in the ArduPlane hierarchy or the ArduCopter hierarchy
try try
{ {
var element = _parameterMetaDataXML.Element("Params").Element(MainV2.cs.firmware.ToString()); var element = _parameterMetaDataXML.Element("Params").Element(MainV2.comPort.MAV.cs.firmware.ToString());
if (element != null && element.HasElements) if (element != null && element.HasElements)
{ {
var node = element.Element(nodeKey); var node = element.Element(nodeKey);

View File

@ -130,6 +130,15 @@
<F17>INS Lat Vel</F17> <F17>INS Lat Vel</F17>
<F18>INS Lon Vel</F18> <F18>INS Lon Vel</F18>
</INAV> </INAV>
<CAMERA>
<F1>Time</F1>
<F2>Lat</F2>
<F3>Lon</F3>
<F4>Alt</F4>
<F5>Roll</F5>
<F6>Pitch</F6>
<F7>Yaw</F7>
</CAMERA>
<PID-1> <PID-1>
<F1>Err</F1> <F1>Err</F1>
<F2>P</F2> <F2>P</F2>

View File

@ -133,7 +133,7 @@ namespace ArdupilotMega
mine.logplaybackfile = new BinaryReader(File.Open(fn, FileMode.Open, FileAccess.Read, FileShare.Read)); mine.logplaybackfile = new BinaryReader(File.Open(fn, FileMode.Open, FileAccess.Read, FileShare.Read));
mine.logreadmode = true; mine.logreadmode = true;
mine.packets.Initialize(); // clear mine.MAV.packets.Initialize(); // clear
CurrentState cs = new CurrentState(); CurrentState cs = new CurrentState();