APM Planner 1.1.78

recommit
This commit is contained in:
Michael Oborne 2012-05-03 12:40:50 +08:00
parent c485cc57c9
commit 0b8dca31e5
17 changed files with 508 additions and 302 deletions

View File

@ -231,6 +231,12 @@
<Compile Include="Attributes\DisplayTextAttribute.cs" />
<Compile Include="Attributes\PrivateAttribute.cs" />
<Compile Include="CodeGen.cs" />
<Compile Include="Controls\HSI.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\HSI.Designer.cs">
<DependentUpon>HSI.cs</DependentUpon>
</Compile>
<Compile Include="Controls\IDynamicParameterControl.cs" />
<Compile Include="Controls\OpenGLtest.cs">
<SubType>UserControl</SubType>
@ -596,6 +602,9 @@
<EmbeddedResource Include="Controls\ConfigPanel.resx">
<DependentUpon>ConfigPanel.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\HSI.resx">
<DependentUpon>HSI.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\ProgressReporterDialogue.resx">
<DependentUpon>ProgressReporterDialogue.cs</DependentUpon>
</EmbeddedResource>

View File

@ -0,0 +1,47 @@
namespace ArdupilotMega.Controls
{
partial class HSI
{
/// <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();
//
// HSI
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackgroundImage = global::ArdupilotMega.Properties.Resources.Gaugebg;
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.DoubleBuffered = true;
this.Name = "HSI";
this.ResumeLayout(false);
}
#endregion
}
}

View File

@ -0,0 +1,160 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ArdupilotMega.Controls
{
public partial class HSI : UserControl
{
Bitmap _headingimage;
bool drawnheading = false;
int _heading = 0;
int _navbearing = 0;
[System.ComponentModel.Browsable(true)]
public int Heading
{
get { return _heading; }
set { _heading = value; this.Invalidate(); }
}
[System.ComponentModel.Browsable(true)]
public int NavHeading
{
get { return _navbearing; }
set { _navbearing = value; }
}
public HSI()
{
InitializeComponent();
_headingimage = new Bitmap(this.Width, this.Height);
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
int _radiusinside = (int)(Width / 3.6f);
int _radiusoutside = (int)(Width / 2.2f);
// drawnheading = false;
if (drawnheading == false || this.DesignMode)
{
_headingimage = new Bitmap(Width, Height);
Graphics g = Graphics.FromImage(_headingimage);
g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Bicubic;
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
//Graphics g = e.Graphics;
g.TranslateTransform(this.Width/2,this.Height /2);
int font = this.Width / 14;
for (int a = 0; a <= 360; a += 5)
{
if (a == 0)
{
g.DrawString("N".PadLeft(2), new Font(FontFamily.GenericSansSerif, font), Brushes.White, new PointF(-font, -_radiusoutside));
g.DrawLine(Pens.White, 0, _radiusinside, 0, _radiusinside + 11);
}
else if (a == 90)
{
g.DrawString("E".PadLeft(2), new Font(FontFamily.GenericSansSerif, font), Brushes.White, new PointF(-font, -_radiusoutside));
g.DrawLine(Pens.White, 0, _radiusinside, 0, _radiusinside + 11);
}
else if (a == 180)
{
g.DrawString("S".PadLeft(2), new Font(FontFamily.GenericSansSerif, font), Brushes.White, new PointF(-font, -_radiusoutside));
g.DrawLine(Pens.White, 0, _radiusinside, 0, _radiusinside + 11);
}
else if (a == 270)
{
g.DrawString("W".PadLeft(2), new Font(FontFamily.GenericSansSerif, font), Brushes.White, new PointF(-font, -_radiusoutside));
g.DrawLine(Pens.White, 0, _radiusinside, 0, _radiusinside + 11);
}
else if (a == 360)
{
// ignore it, as we process it at 0
}
else if ((a % 30) == 0) // number labeled
{
g.DrawString((a / 10).ToString("0").PadLeft(2), new Font(FontFamily.GenericSansSerif, font), Brushes.White, new PointF(-font, -_radiusoutside));
g.DrawLine(Pens.White, 0, _radiusinside, 0, _radiusinside + 11);
}
else if (a % 10 == 0) // larger line
{
g.DrawLine(Pens.White, 0, _radiusinside, 0, _radiusinside + 7);
}
else if (a % 5 == 0) // small line
{
g.DrawLine(Pens.White, 0, _radiusinside, 0, _radiusinside + 4);
}
g.RotateTransform(5);
}
g.ResetTransform();
drawnheading = true;
}
e.Graphics.TranslateTransform(Width / 2, Height / 2);
e.Graphics.RotateTransform(-Heading);
e.Graphics.DrawImage(_headingimage, new Rectangle(-Width / 2, - Height/2,Width,Height));
e.Graphics.RotateTransform(Heading);
Pen or = new Pen(Color.DarkOrange,2);
// body
e.Graphics.DrawLine(or, 0, 30, 0, -10);
// wing
e.Graphics.DrawLine(or, -30, 0, 30, 0);
//tail
e.Graphics.DrawLine(or, -10, 25, 10, 25);
e.Graphics.DrawLine(new Pen(Color.White,2),0,-_radiusoutside,0,-_radiusinside);
e.Graphics.RotateTransform(NavHeading - Heading);
Point[] headbug = new Point[7];
headbug[0] = new Point(-5, -_radiusoutside + 0);
headbug[1] = new Point(-5, -_radiusoutside + 4);
headbug[2] = new Point(-3, -_radiusoutside + 4);
headbug[3] = new Point(0, -_radiusoutside + 8);
headbug[4] = new Point(3, -_radiusoutside + 4);
headbug[5] = new Point(5, -_radiusoutside + 4);
headbug[6] = new Point(5, -_radiusoutside + 0);
e.Graphics.DrawLines(or, headbug);
// this.Invalidate();
}
protected override void OnResize(EventArgs e)
{
Width = Height;
base.OnResize(e);
this.Invalidate();
drawnheading = false;
}
}
}

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

@ -340,9 +340,12 @@ namespace ArdupilotMega.Controls
GL.Color4(penn.Color);
GL.Begin(BeginMode.LineStrip);
start -= 90;
start = 360 - start;
start -= 30;
float x = 0, y = 0;
for (int i = (int)start; i <= start + degrees; i++)
for (float i = start; i <= start + degrees; i++)
{
x = (float)Math.Sin(i * deg2rad) * rect.Width / 2;
y = (float)Math.Cos(i * deg2rad) * rect.Height / 2;
@ -813,7 +816,7 @@ namespace ArdupilotMega.Controls
for (int a = -90; a <= 90; a += 5)
{
// limit to 40 degrees
if (a >= _pitch - 34 && a <= _pitch + 25)
if (a >= _pitch - 29 && a <= _pitch + 20)
{
if (a % 10 == 0)
{
@ -841,7 +844,7 @@ namespace ArdupilotMega.Controls
graphicsObject.TranslateTransform(this.Width / 2, this.Height / 2 + this.Height / 14);
graphicsObject.RotateTransform(-_roll);
// graphicsObject.RotateTransform(_roll);
Point[] pointlist = new Point[3];
@ -862,17 +865,25 @@ namespace ArdupilotMega.Controls
redPen.Width = 2;
for (int a = -45; a <= 45; a += 15)
int[] array = new int[] { -60,-45, -30,-20,-10,0,10,20,30,45,60 };
foreach (int a in array)
{
graphicsObject.ResetTransform();
graphicsObject.TranslateTransform(this.Width / 2, this.Height / 2 + this.Height / 14);
graphicsObject.RotateTransform(a);
graphicsObject.RotateTransform(a - _roll);
drawstring(graphicsObject, Math.Abs(a).ToString("##"), font, fontsize, whiteBrush, 0 - 6 - fontoffset, -lengthlong * 2 - extra);
graphicsObject.DrawLine(whitePen, 0, -halfheight, 0, -halfheight - 10);
}
graphicsObject.ResetTransform();
// draw roll ind
Rectangle arcrect = new Rectangle(this.Width / 2 - this.Height / 2, this.Height / 14, this.Height, this.Height);
graphicsObject.DrawArc(whitePen, arcrect, 180 + 30 + -_roll, 120);
//draw centre / current att
Rectangle centercircle = new Rectangle(halfwidth - halfwidth / 2, halfheight - halfwidth / 2, halfwidth, halfwidth);
@ -888,12 +899,6 @@ namespace ArdupilotMega.Controls
graphicsObject.DrawLine(redtemp, halfwidth-1, halfheight, centercircle.Right - halfwidth / 3, halfheight + halfheight / 10);
graphicsObject.DrawLine(redtemp, halfwidth+1, halfheight, centercircle.Left + halfwidth / 3, halfheight + halfheight / 10);
// draw roll ind
Rectangle arcrect = new Rectangle(this.Width / 2 - this.Height / 2, this.Height / 14, this.Height, this.Height);
graphicsObject.DrawArc(whitePen, arcrect, 180 + 45, 90);
//draw heading ind
graphicsObject.ResetClip();
@ -912,8 +917,8 @@ namespace ArdupilotMega.Controls
//bottom line
graphicsObject.DrawLine(whitePen, headbg.Left + 5, headbg.Bottom - 5, headbg.Width - 5, headbg.Bottom - 5);
float space = (headbg.Width - 10) / 60.0f;
int start = (int)Math.Round((_heading - 30),1);
float space = (headbg.Width - 10) / 120.0f;
int start = (int)Math.Round((_heading - 60),1);
// draw for outside the 60 deg
if (_targetheading < start)
@ -921,13 +926,13 @@ namespace ArdupilotMega.Controls
greenPen.Width = 6;
graphicsObject.DrawLine(greenPen, headbg.Left + 5 + space * 0, headbg.Bottom, headbg.Left + 5 + space * (0), headbg.Top);
}
if (_targetheading > _heading + 30)
if (_targetheading > _heading + 60)
{
greenPen.Width = 6;
graphicsObject.DrawLine(greenPen, headbg.Left + 5 + space * 60, headbg.Bottom, headbg.Left + 5 + space * (60), headbg.Top);
}
for (int a = start; a <= _heading + 30; a += 1)
for (int a = start; a <= _heading + 60; a += 1)
{
// target heading
if (((int)(a + 360) % 360) == (int)_targetheading)
@ -943,7 +948,7 @@ namespace ArdupilotMega.Controls
blackPen.Width = 2;
}
if ((int)a % 5 == 0)
if ((int)a % 15 == 0)
{
//Console.WriteLine(a + " " + Math.Round(a, 1, MidpointRounding.AwayFromZero));
//Console.WriteLine(space +" " + a +" "+ (headbg.Left + 5 + space * (a - start)));
@ -973,8 +978,20 @@ namespace ArdupilotMega.Controls
drawstring(graphicsObject, (disp % 360).ToString().PadLeft(3), font, fontsize, whiteBrush, headbg.Left - 5 + space * (a - start) - fontoffset, headbg.Bottom - 24 - (int)(fontoffset * 1.7));
}
}
else if ((int)a % 5 == 0)
{
graphicsObject.DrawLine(whitePen, headbg.Left + 5 + space * (a - start), headbg.Bottom - 5, headbg.Left + 5 + space * (a - start), headbg.Bottom - 10);
}
}
RectangleF rect = new RectangleF(headbg.Width / 2 - fontoffset - fontoffset, 0, fontoffset * 4, (int)(fontoffset * 1.7) + 24);
DrawRectangle(whitePen, rect);
FillRectangle(Brushes.Black, rect);
drawstring(graphicsObject, (heading % 360).ToString("0").PadLeft(3), font, fontsize, whiteBrush, headbg.Width / 2 - fontoffset - fontoffset, headbg.Bottom - 24 - (int)(fontoffset * 1.7));
// Console.WriteLine("HUD 0 " + (DateTime.Now - starttime).TotalMilliseconds + " " + DateTime.Now.Millisecond);
// xtrack error

View File

@ -883,7 +883,7 @@ namespace ArdupilotMega
//climbrate = vfr.climb;
if ((DateTime.Now - lastalt).TotalSeconds >= 0.1 && oldalt != alt)
if ((DateTime.Now - lastalt).TotalSeconds >= 0.2 && oldalt != alt)
{
climbrate = (alt - oldalt) / (float)(DateTime.Now - lastalt).TotalSeconds;
verticalspeed = (alt - oldalt) / (float)(DateTime.Now - lastalt).TotalSeconds;

View File

@ -245,95 +245,99 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
{
if(!String.IsNullOrEmpty(x.Key))
{
bool controlAdded = false;
try
{
bool controlAdded = false;
string value = ((float)MainV2.comPort.param[x.Key]).ToString("0.###");
string description = _parameterMetaDataRepository.GetParameterMetaData(x.Key, ParameterMetaDataConstants.Description);
string displayName = x.Value;
string units = _parameterMetaDataRepository.GetParameterMetaData(x.Key, ParameterMetaDataConstants.Units);
// If this is a range
string rangeRaw = _parameterMetaDataRepository.GetParameterMetaData(x.Key, ParameterMetaDataConstants.Range);
string incrementRaw = _parameterMetaDataRepository.GetParameterMetaData(x.Key, ParameterMetaDataConstants.Increment);
if (!String.IsNullOrEmpty(rangeRaw) && !String.IsNullOrEmpty(incrementRaw))
{
float increment, intValue;
float.TryParse(incrementRaw, out increment);
float.TryParse(value, out intValue);
string value = ((float)MainV2.comPort.param[x.Key]).ToString("0.###");
string description = _parameterMetaDataRepository.GetParameterMetaData(x.Key, ParameterMetaDataConstants.Description);
string displayName = x.Value;
string units = _parameterMetaDataRepository.GetParameterMetaData(x.Key, ParameterMetaDataConstants.Units);
string[] rangeParts = rangeRaw.Split(new[] { ' ' });
if (rangeParts.Count() == 2 && increment > 0)
{
float lowerRange;
float.TryParse(rangeParts[0], out lowerRange);
float upperRange;
float.TryParse(rangeParts[1], out upperRange);
// If this is a range
string rangeRaw = _parameterMetaDataRepository.GetParameterMetaData(x.Key, ParameterMetaDataConstants.Range);
string incrementRaw = _parameterMetaDataRepository.GetParameterMetaData(x.Key, ParameterMetaDataConstants.Increment);
if (!String.IsNullOrEmpty(rangeRaw) && !String.IsNullOrEmpty(incrementRaw))
{
float increment, intValue;
float.TryParse(incrementRaw, out increment);
float.TryParse(value, out intValue);
int scaler = (int)float.Parse((1 / increment).ToString(CultureInfo.InvariantCulture));
int scaledLowerRange = 0, scaledUpperRange = 0;
int scaledIncrement = (int)increment;
if(scaler > 0)
{
scaledLowerRange = (int)(lowerRange * scaler);
scaledUpperRange = (int)(upperRange * scaler);
scaledIncrement = (int)float.Parse((increment * scaler).ToString(CultureInfo.InvariantCulture));
intValue *= scaler;
}
var rangeControl = new RangeControl();
rangeControl.Name = x.Key;
rangeControl.Scaler = scaler;
rangeControl.DescriptionText = FitDescriptionText(units, description);
rangeControl.LabelText = displayName;
rangeControl.TrackBarControl.Minimum = scaledLowerRange;
rangeControl.TrackBarControl.Maximum = scaledUpperRange;
rangeControl.TrackBarControl.TickFrequency = scaledIncrement;
rangeControl.TrackBarControl.Value = (int)intValue;
rangeControl.NumericUpDownControl.Increment = (decimal)increment;
rangeControl.NumericUpDownControl.DecimalPlaces = scaler.ToString(CultureInfo.InvariantCulture).Length - 1;
rangeControl.NumericUpDownControl.Minimum = (decimal) lowerRange;
rangeControl.NumericUpDownControl.Maximum = (decimal)upperRange;
rangeControl.NumericUpDownControl.Value = (decimal)((float)MainV2.comPort.param[x.Key]);
rangeControl.AttachEvents();
tableLayoutPanel1.Controls.Add(rangeControl);
controlAdded = true;
}
}
if (!controlAdded)
{
// If this is a subset of values
string availableValuesRaw = _parameterMetaDataRepository.GetParameterMetaData(x.Key, ParameterMetaDataConstants.Values);
if (!String.IsNullOrEmpty(availableValuesRaw))
{
string[] availableValues = availableValuesRaw.Split(new[] { ',' });
if (availableValues.Any())
{
var valueControl = new ValuesControl();
valueControl.Name = x.Key;
valueControl.DescriptionText = FitDescriptionText(units, description);
valueControl.LabelText = displayName;
var splitValues = new List<KeyValuePair<string, string>>();
// Add the values to the ddl
availableValues.ForEach(val =>
string[] rangeParts = rangeRaw.Split(new[] { ' ' });
if (rangeParts.Count() == 2 && increment > 0)
{
string[] valParts = val.Split(new[]{ ':' });
splitValues.Add(new KeyValuePair<string, string>(valParts[0], (valParts.Length > 1) ? valParts[1] : valParts[0]));
});
valueControl.ComboBoxControl.DisplayMember = "Value";
valueControl.ComboBoxControl.ValueMember = "Key";
valueControl.ComboBoxControl.DataSource = splitValues;
valueControl.ComboBoxControl.SelectedValue = value;
float lowerRange;
float.TryParse(rangeParts[0], out lowerRange);
float upperRange;
float.TryParse(rangeParts[1], out upperRange);
tableLayoutPanel1.Controls.Add(valueControl);
}
}
}
int scaler = (int)float.Parse((1 / increment).ToString(CultureInfo.InvariantCulture));
int scaledLowerRange = 0, scaledUpperRange = 0;
int scaledIncrement = (int)increment;
if (scaler > 0)
{
scaledLowerRange = (int)(lowerRange * scaler);
scaledUpperRange = (int)(upperRange * scaler);
scaledIncrement = (int)float.Parse((increment * scaler).ToString(CultureInfo.InvariantCulture));
intValue *= scaler;
}
var rangeControl = new RangeControl();
rangeControl.Name = x.Key;
rangeControl.Scaler = scaler;
rangeControl.DescriptionText = FitDescriptionText(units, description);
rangeControl.LabelText = displayName;
rangeControl.TrackBarControl.Minimum = scaledLowerRange;
rangeControl.TrackBarControl.Maximum = scaledUpperRange;
rangeControl.TrackBarControl.TickFrequency = scaledIncrement;
rangeControl.TrackBarControl.Value = (int)intValue;
rangeControl.NumericUpDownControl.Increment = (decimal)increment;
rangeControl.NumericUpDownControl.DecimalPlaces = scaler.ToString(CultureInfo.InvariantCulture).Length - 1;
rangeControl.NumericUpDownControl.Minimum = (decimal)lowerRange;
rangeControl.NumericUpDownControl.Maximum = (decimal)upperRange;
rangeControl.NumericUpDownControl.Value = (decimal)((float)MainV2.comPort.param[x.Key]);
rangeControl.AttachEvents();
tableLayoutPanel1.Controls.Add(rangeControl);
controlAdded = true;
}
}
if (!controlAdded)
{
// If this is a subset of values
string availableValuesRaw = _parameterMetaDataRepository.GetParameterMetaData(x.Key, ParameterMetaDataConstants.Values);
if (!String.IsNullOrEmpty(availableValuesRaw))
{
string[] availableValues = availableValuesRaw.Split(new[] { ',' });
if (availableValues.Any())
{
var valueControl = new ValuesControl();
valueControl.Name = x.Key;
valueControl.DescriptionText = FitDescriptionText(units, description);
valueControl.LabelText = displayName;
var splitValues = new List<KeyValuePair<string, string>>();
// Add the values to the ddl
availableValues.ForEach(val =>
{
string[] valParts = val.Split(new[] { ':' });
splitValues.Add(new KeyValuePair<string, string>(valParts[0], (valParts.Length > 1) ? valParts[1] : valParts[0]));
});
valueControl.ComboBoxControl.DisplayMember = "Value";
valueControl.ComboBoxControl.ValueMember = "Key";
valueControl.ComboBoxControl.DataSource = splitValues;
valueControl.ComboBoxControl.SelectedValue = value;
tableLayoutPanel1.Controls.Add(valueControl);
}
}
}
} // if there is an error simply dont show it, ie bad pde file, bad scale etc
catch (Exception ex) { log.Error(ex); }
}
});
}

View File

@ -39,7 +39,7 @@
this.BUTactiondo = new ArdupilotMega.Controls.MyButton();
this.tabGauges = new System.Windows.Forms.TabPage();
this.Gvspeed = new AGaugeApp.AGauge();
this.Gheading = new AGaugeApp.AGauge();
this.Gheading = new ArdupilotMega.Controls.HSI();
this.Galt = new AGaugeApp.AGauge();
this.Gspeed = new AGaugeApp.AGauge();
this.tabStatus = new System.Windows.Forms.TabPage();
@ -545,145 +545,11 @@
this.Gheading.BackColor = System.Drawing.Color.Transparent;
this.Gheading.BackgroundImage = global::ArdupilotMega.Properties.Resources.Gaugebg;
resources.ApplyResources(this.Gheading, "Gheading");
this.Gheading.BaseArcColor = System.Drawing.Color.Transparent;
this.Gheading.BaseArcRadius = 60;
this.Gheading.BaseArcStart = 270;
this.Gheading.BaseArcSweep = 360;
this.Gheading.BaseArcWidth = 2;
this.Gheading.basesize = new System.Drawing.Size(150, 150);
this.Gheading.Cap_Idx = ((byte)(0));
this.Gheading.CapColor = System.Drawing.Color.White;
this.Gheading.CapColors = new System.Drawing.Color[] {
System.Drawing.Color.White,
System.Drawing.Color.Black,
System.Drawing.Color.Black,
System.Drawing.Color.Black,
System.Drawing.Color.Black};
this.Gheading.CapPosition = new System.Drawing.Point(55, 85);
this.Gheading.CapsPosition = new System.Drawing.Point[] {
new System.Drawing.Point(55, 85),
new System.Drawing.Point(40, 67),
new System.Drawing.Point(10, 10),
new System.Drawing.Point(10, 10),
new System.Drawing.Point(10, 10)};
this.Gheading.CapsText = new string[] {
"Heading",
"",
"",
"",
""};
this.Gheading.CapText = "Heading";
this.Gheading.Center = new System.Drawing.Point(75, 75);
this.Gheading.DataBindings.Add(new System.Windows.Forms.Binding("Value0", this.bindingSource1, "yaw", true));
this.Gheading.DataBindings.Add(new System.Windows.Forms.Binding("Value1", this.bindingSource1, "nav_bearing", true));
this.Gheading.MaxValue = 359F;
this.Gheading.MinValue = 0F;
this.Gheading.DataBindings.Add(new System.Windows.Forms.Binding("Heading", this.bindingSource1, "yaw", true));
this.Gheading.DataBindings.Add(new System.Windows.Forms.Binding("NavHeading", this.bindingSource1, "nav_bearing", true));
this.Gheading.Heading = 0;
this.Gheading.Name = "Gheading";
this.Gheading.Need_Idx = ((byte)(3));
this.Gheading.NeedleColor1 = AGaugeApp.AGauge.NeedleColorEnum.Gray;
this.Gheading.NeedleColor2 = System.Drawing.Color.White;
this.Gheading.NeedleEnabled = false;
this.Gheading.NeedleRadius = 80;
this.Gheading.NeedlesColor1 = new AGaugeApp.AGauge.NeedleColorEnum[] {
AGaugeApp.AGauge.NeedleColorEnum.Gray,
AGaugeApp.AGauge.NeedleColorEnum.Red,
AGaugeApp.AGauge.NeedleColorEnum.Gray,
AGaugeApp.AGauge.NeedleColorEnum.Gray};
this.Gheading.NeedlesColor2 = new System.Drawing.Color[] {
System.Drawing.Color.White,
System.Drawing.Color.White,
System.Drawing.Color.White,
System.Drawing.Color.White};
this.Gheading.NeedlesEnabled = new bool[] {
true,
true,
false,
false};
this.Gheading.NeedlesRadius = new int[] {
60,
60,
80,
80};
this.Gheading.NeedlesType = new int[] {
0,
0,
0,
0};
this.Gheading.NeedlesWidth = new int[] {
2,
2,
2,
2};
this.Gheading.NeedleType = 0;
this.Gheading.NeedleWidth = 2;
this.Gheading.Range_Idx = ((byte)(0));
this.Gheading.RangeColor = System.Drawing.Color.LightGreen;
this.Gheading.RangeEnabled = false;
this.Gheading.RangeEndValue = 360F;
this.Gheading.RangeInnerRadius = 1;
this.Gheading.RangeOuterRadius = 60;
this.Gheading.RangesColor = new System.Drawing.Color[] {
System.Drawing.Color.LightGreen,
System.Drawing.Color.Red,
System.Drawing.Color.Orange,
System.Drawing.SystemColors.Control,
System.Drawing.SystemColors.Control};
this.Gheading.RangesEnabled = new bool[] {
false,
false,
false,
false,
false};
this.Gheading.RangesEndValue = new float[] {
360F,
200F,
150F,
0F,
0F};
this.Gheading.RangesInnerRadius = new int[] {
1,
1,
1,
70,
70};
this.Gheading.RangesOuterRadius = new int[] {
60,
60,
60,
80,
80};
this.Gheading.RangesStartValue = new float[] {
0F,
150F,
75F,
0F,
0F};
this.Gheading.RangeStartValue = 0F;
this.Gheading.ScaleLinesInterColor = System.Drawing.Color.White;
this.Gheading.ScaleLinesInterInnerRadius = 52;
this.Gheading.ScaleLinesInterOuterRadius = 60;
this.Gheading.ScaleLinesInterWidth = 1;
this.Gheading.ScaleLinesMajorColor = System.Drawing.Color.White;
this.Gheading.ScaleLinesMajorInnerRadius = 50;
this.Gheading.ScaleLinesMajorOuterRadius = 60;
this.Gheading.ScaleLinesMajorStepValue = 45F;
this.Gheading.ScaleLinesMajorWidth = 2;
this.Gheading.ScaleLinesMinorColor = System.Drawing.Color.White;
this.Gheading.ScaleLinesMinorInnerRadius = 55;
this.Gheading.ScaleLinesMinorNumOf = 9;
this.Gheading.ScaleLinesMinorOuterRadius = 60;
this.Gheading.ScaleLinesMinorWidth = 1;
this.Gheading.ScaleNumbersColor = System.Drawing.Color.White;
this.Gheading.ScaleNumbersFormat = null;
this.Gheading.ScaleNumbersRadius = 42;
this.Gheading.ScaleNumbersRotation = 45;
this.Gheading.ScaleNumbersStartScaleLine = 1;
this.Gheading.ScaleNumbersStepScaleLines = 1;
this.Gheading.Value = 0F;
this.Gheading.Value0 = 0F;
this.Gheading.Value1 = 0F;
this.Gheading.Value2 = 0F;
this.Gheading.Value3 = 0F;
this.Gheading.NavHeading = 0;
//
// Galt
//
@ -1329,7 +1195,6 @@
private System.Windows.Forms.TrackBar tracklog;
private ArdupilotMega.Controls.MyButton BUT_playlog;
private ArdupilotMega.Controls.MyButton BUT_loadtelem;
private AGaugeApp.AGauge Gheading;
private AGaugeApp.AGauge Galt;
private AGaugeApp.AGauge Gspeed;
private AGaugeApp.AGauge Gvspeed;
@ -1370,5 +1235,6 @@
private ArdupilotMega.Controls.MyButton BUT_script;
private ArdupilotMega.Controls.MyLabel lbl_hdop;
private ArdupilotMega.Controls.MyLabel lbl_sats;
private Controls.HSI Gheading;
}
}

View File

@ -134,7 +134,7 @@
<value>Point Camera Here</value>
</data>
<data name="contextMenuStrip1.Size" type="System.Drawing.Size, System.Drawing">
<value>175, 70</value>
<value>175, 48</value>
</data>
<data name="&gt;&gt;contextMenuStrip1.Name" xml:space="preserve">
<value>contextMenuStrip1</value>
@ -208,7 +208,7 @@
<value>hud1</value>
</data>
<data name="&gt;&gt;hud1.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.HUD, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.HUD, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;hud1.Parent" xml:space="preserve">
<value>SubMainLeft.Panel1</value>
@ -247,7 +247,7 @@
<value>BUT_script</value>
</data>
<data name="&gt;&gt;BUT_script.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_script.Parent" xml:space="preserve">
<value>tabActions</value>
@ -280,7 +280,7 @@
<value>BUT_joystick</value>
</data>
<data name="&gt;&gt;BUT_joystick.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_joystick.Parent" xml:space="preserve">
<value>tabActions</value>
@ -310,7 +310,7 @@
<value>BUT_quickmanual</value>
</data>
<data name="&gt;&gt;BUT_quickmanual.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_quickmanual.Parent" xml:space="preserve">
<value>tabActions</value>
@ -340,7 +340,7 @@
<value>BUT_quickrtl</value>
</data>
<data name="&gt;&gt;BUT_quickrtl.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_quickrtl.Parent" xml:space="preserve">
<value>tabActions</value>
@ -370,7 +370,7 @@
<value>BUT_quickauto</value>
</data>
<data name="&gt;&gt;BUT_quickauto.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_quickauto.Parent" xml:space="preserve">
<value>tabActions</value>
@ -424,7 +424,7 @@
<value>BUT_setwp</value>
</data>
<data name="&gt;&gt;BUT_setwp.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_setwp.Parent" xml:space="preserve">
<value>tabActions</value>
@ -475,7 +475,7 @@
<value>BUT_setmode</value>
</data>
<data name="&gt;&gt;BUT_setmode.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_setmode.Parent" xml:space="preserve">
<value>tabActions</value>
@ -505,7 +505,7 @@
<value>BUT_clear_track</value>
</data>
<data name="&gt;&gt;BUT_clear_track.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_clear_track.Parent" xml:space="preserve">
<value>tabActions</value>
@ -556,7 +556,7 @@
<value>BUT_Homealt</value>
</data>
<data name="&gt;&gt;BUT_Homealt.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_Homealt.Parent" xml:space="preserve">
<value>tabActions</value>
@ -586,7 +586,7 @@
<value>BUT_RAWSensor</value>
</data>
<data name="&gt;&gt;BUT_RAWSensor.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_RAWSensor.Parent" xml:space="preserve">
<value>tabActions</value>
@ -616,7 +616,7 @@
<value>BUTrestartmission</value>
</data>
<data name="&gt;&gt;BUTrestartmission.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUTrestartmission.Parent" xml:space="preserve">
<value>tabActions</value>
@ -646,7 +646,7 @@
<value>BUTactiondo</value>
</data>
<data name="&gt;&gt;BUTactiondo.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUTactiondo.Parent" xml:space="preserve">
<value>tabActions</value>
@ -700,7 +700,7 @@
<value>Gvspeed</value>
</data>
<data name="&gt;&gt;Gvspeed.Type" xml:space="preserve">
<value>AGaugeApp.AGauge, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>AGaugeApp.AGauge, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;Gvspeed.Parent" xml:space="preserve">
<value>tabGauges</value>
@ -730,7 +730,7 @@
<value>Gheading</value>
</data>
<data name="&gt;&gt;Gheading.Type" xml:space="preserve">
<value>AGaugeApp.AGauge, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.HSI, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;Gheading.Parent" xml:space="preserve">
<value>tabGauges</value>
@ -760,7 +760,7 @@
<value>Galt</value>
</data>
<data name="&gt;&gt;Galt.Type" xml:space="preserve">
<value>AGaugeApp.AGauge, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>AGaugeApp.AGauge, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;Galt.Parent" xml:space="preserve">
<value>tabGauges</value>
@ -793,7 +793,7 @@
<value>Gspeed</value>
</data>
<data name="&gt;&gt;Gspeed.Type" xml:space="preserve">
<value>AGaugeApp.AGauge, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>AGaugeApp.AGauge, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;Gspeed.Parent" xml:space="preserve">
<value>tabGauges</value>
@ -874,7 +874,7 @@
<value>lbl_logpercent</value>
</data>
<data name="&gt;&gt;lbl_logpercent.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_logpercent.Parent" xml:space="preserve">
<value>tabTLogs</value>
@ -925,7 +925,7 @@
<value>BUT_log2kml</value>
</data>
<data name="&gt;&gt;BUT_log2kml.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_log2kml.Parent" xml:space="preserve">
<value>tabTLogs</value>
@ -976,7 +976,7 @@
<value>BUT_playlog</value>
</data>
<data name="&gt;&gt;BUT_playlog.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_playlog.Parent" xml:space="preserve">
<value>tabTLogs</value>
@ -1003,7 +1003,7 @@
<value>BUT_loadtelem</value>
</data>
<data name="&gt;&gt;BUT_loadtelem.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BUT_loadtelem.Parent" xml:space="preserve">
<value>tabTLogs</value>
@ -1192,7 +1192,7 @@
<value>lbl_hdop</value>
</data>
<data name="&gt;&gt;lbl_hdop.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_hdop.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
@ -1225,7 +1225,7 @@
<value>lbl_sats</value>
</data>
<data name="&gt;&gt;lbl_sats.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_sats.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
@ -1255,7 +1255,7 @@
<value>lbl_winddir</value>
</data>
<data name="&gt;&gt;lbl_winddir.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_winddir.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
@ -1285,7 +1285,7 @@
<value>lbl_windvel</value>
</data>
<data name="&gt;&gt;lbl_windvel.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lbl_windvel.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
@ -1457,7 +1457,7 @@
<value>gMapControl1</value>
</data>
<data name="&gt;&gt;gMapControl1.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.myGMAP, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.myGMAP, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;gMapControl1.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
@ -1520,7 +1520,7 @@
<value>TXT_lat</value>
</data>
<data name="&gt;&gt;TXT_lat.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;TXT_lat.Parent" xml:space="preserve">
<value>panel1</value>
@ -1577,7 +1577,7 @@
<value>label1</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>panel1</value>
@ -1607,7 +1607,7 @@
<value>TXT_long</value>
</data>
<data name="&gt;&gt;TXT_long.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;TXT_long.Parent" xml:space="preserve">
<value>panel1</value>
@ -1637,7 +1637,7 @@
<value>TXT_alt</value>
</data>
<data name="&gt;&gt;TXT_alt.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;TXT_alt.Parent" xml:space="preserve">
<value>panel1</value>
@ -1838,7 +1838,7 @@
<value>label6</value>
</data>
<data name="&gt;&gt;label6.Type" xml:space="preserve">
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;label6.Parent" xml:space="preserve">
<value>$this</value>
@ -1916,6 +1916,6 @@
<value>FlightData</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.MyUserControl, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null</value>
<value>System.Windows.Forms.MyUserControl, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>

View File

@ -46,7 +46,7 @@ namespace ArdupilotMega
if (System.Diagnostics.Debugger.IsAttached)
{
// testing
Utilities.ParameterMetaDataParser.GetParameterInformation();
// Utilities.ParameterMetaDataParser.GetParameterInformation();
}
try

View File

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

View File

@ -181,9 +181,9 @@ namespace ArdupilotMega.Utilities
{
// This is the end index for a substring to search for parameter attributes
// If we are on the last index in our collection, we will search to the end of the file
var stopIdx = (i == indicies.Count - 1) ? fileContents.Length : indicies[i + 1];
var stopIdx = (i == indicies.Count - 1) ? fileContents.Length : indicies[i + 1] + 1;
string subStringToSearch = fileContents.Substring(indicies[i], (stopIdx - indicies[i]));
string subStringToSearch = fileContents.Substring(indicies[i], (stopIdx - indicies[i]));
if(!String.IsNullOrEmpty(subStringToSearch))
{
var metaIndicies = new List<int>();
@ -246,13 +246,13 @@ namespace ArdupilotMega.Utilities
private static void GetIndexOfMarkers(ref List<int> indicies, string inspectThis, string delimeter, int prevIdx)
{
// Find the index of the start of a parameter comment
int idx = inspectThis.IndexOf(delimeter, StringComparison.InvariantCultureIgnoreCase);
int idx = inspectThis.IndexOf(delimeter, prevIdx, StringComparison.InvariantCultureIgnoreCase);
// If we can't find one we stop here
if(idx != -1)
{
// Add the index we found
indicies.Add(idx + prevIdx);
indicies.Add(idx);
// Move the index after the parameter delimeter
int newIdx = idx + delimeter.Length;
@ -261,7 +261,7 @@ namespace ArdupilotMega.Utilities
if(newIdx < inspectThis.Length)
{
// Recursively search for the next index
GetIndexOfMarkers(ref indicies, inspectThis.Substring(newIdx, (inspectThis.Length - newIdx)), delimeter, idx + prevIdx);
GetIndexOfMarkers(ref indicies, inspectThis, delimeter, newIdx);
}
}
}

View File

@ -7,7 +7,7 @@
<supportedRuntime version="v2.0.50727"/></startup>
<appSettings>
<add key="UpdateLocation"
value="http://ardupilot-mega.googlecode.com/git/Tools/ArdupilotMegaPlanner/bin/Release/"/>
value="http://meee146-planner.googlecode.com/git/Tools/ArdupilotMegaPlanner/bin/Release/"/>
<add key="ParameterLocations"
value="http://ardupilot-mega.googlecode.com/git/ArduCopter/Parameters.pde;http://ardupilot-mega.googlecode.com/git/ArduPlane/Parameters.pde"/>
<add key="ParameterMetaDataXMLFileName"

View File

@ -7,7 +7,7 @@
<supportedRuntime version="v2.0.50727"/></startup>
<appSettings>
<add key="UpdateLocation"
value="http://ardupilot-mega.googlecode.com/git/Tools/ArdupilotMegaPlanner/bin/Release/"/>
value="http://meee146-planner.googlecode.com/git/Tools/ArdupilotMegaPlanner/bin/Release/"/>
<add key="ParameterLocations"
value="http://ardupilot-mega.googlecode.com/git/ArduCopter/Parameters.pde;http://ardupilot-mega.googlecode.com/git/ArduPlane/Parameters.pde"/>
<add key="ParameterMetaDataXMLFileName"

View File

@ -1 +1 @@
1.1.4503.36159
1.1.4506.13406

View File

@ -48,7 +48,6 @@
this.BUT_flashdl = new ArdupilotMega.Controls.MyButton();
this.BUT_wipeeeprom = new ArdupilotMega.Controls.MyButton();
this.button1 = new ArdupilotMega.Controls.MyButton();
this.test1 = new ArdupilotMega.Controls.OpenGLtest();
this.SuspendLayout();
//
// label1
@ -245,24 +244,11 @@
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// test1
//
this.test1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.test1.BackColor = System.Drawing.Color.Black;
this.test1.Location = new System.Drawing.Point(571, 118);
this.test1.Name = "test1";
this.test1.Size = new System.Drawing.Size(150, 150);
this.test1.TabIndex = 20;
this.test1.VSync = false;
//
// temp
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(731, 281);
this.Controls.Add(this.test1);
this.Controls.Add(this.BUT_magcalib);
this.Controls.Add(this.BUT_ant_track);
this.Controls.Add(this.BUT_follow_me);
@ -313,8 +299,5 @@
private ArdupilotMega.Controls.MyButton BUT_follow_me;
private ArdupilotMega.Controls.MyButton BUT_ant_track;
private ArdupilotMega.Controls.MyButton BUT_magcalib;
private Controls.OpenGLtest test1;
//private SharpVectors.Renderers.Forms.SvgPictureBox svgPictureBox1;
}
}