diff --git a/Tools/ArdupilotMegaPlanner/ArdupilotMega.csproj b/Tools/ArdupilotMegaPlanner/ArdupilotMega.csproj
index f5e006c63c..29064ddc38 100644
--- a/Tools/ArdupilotMegaPlanner/ArdupilotMega.csproj
+++ b/Tools/ArdupilotMegaPlanner/ArdupilotMega.csproj
@@ -231,6 +231,12 @@
+
+ UserControl
+
+
+ HSI.cs
+
UserControl
@@ -596,6 +602,9 @@
ConfigPanel.cs
+
+ HSI.cs
+
ProgressReporterDialogue.cs
diff --git a/Tools/ArdupilotMegaPlanner/Controls/HSI.Designer.cs b/Tools/ArdupilotMegaPlanner/Controls/HSI.Designer.cs
new file mode 100644
index 0000000000..e3e232428b
--- /dev/null
+++ b/Tools/ArdupilotMegaPlanner/Controls/HSI.Designer.cs
@@ -0,0 +1,47 @@
+namespace ArdupilotMega.Controls
+{
+ partial class HSI
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ 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
+ }
+}
diff --git a/Tools/ArdupilotMegaPlanner/Controls/HSI.cs b/Tools/ArdupilotMegaPlanner/Controls/HSI.cs
new file mode 100644
index 0000000000..6f105a6c13
--- /dev/null
+++ b/Tools/ArdupilotMegaPlanner/Controls/HSI.cs
@@ -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;
+ }
+
+ }
+}
diff --git a/Tools/ArdupilotMegaPlanner/Controls/HSI.resx b/Tools/ArdupilotMegaPlanner/Controls/HSI.resx
new file mode 100644
index 0000000000..7080a7d118
--- /dev/null
+++ b/Tools/ArdupilotMegaPlanner/Controls/HSI.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Tools/ArdupilotMegaPlanner/Controls/HUD.cs b/Tools/ArdupilotMegaPlanner/Controls/HUD.cs
index 654b647889..da4faef1e6 100644
--- a/Tools/ArdupilotMegaPlanner/Controls/HUD.cs
+++ b/Tools/ArdupilotMegaPlanner/Controls/HUD.cs
@@ -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
diff --git a/Tools/ArdupilotMegaPlanner/CurrentState.cs b/Tools/ArdupilotMegaPlanner/CurrentState.cs
index f7638fe860..95c47e3881 100644
--- a/Tools/ArdupilotMegaPlanner/CurrentState.cs
+++ b/Tools/ArdupilotMegaPlanner/CurrentState.cs
@@ -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;
diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigFriendlyParams.cs b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigFriendlyParams.cs
index 360d4899be..d44d880a70 100644
--- a/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigFriendlyParams.cs
+++ b/Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigFriendlyParams.cs
@@ -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>();
- // 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(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>();
+ // Add the values to the ddl
+ availableValues.ForEach(val =>
+ {
+ string[] valParts = val.Split(new[] { ':' });
+ splitValues.Add(new KeyValuePair(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); }
}
});
}
diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.Designer.cs b/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.Designer.cs
index 87435b07aa..8e1a73b5a1 100644
--- a/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.Designer.cs
+++ b/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.Designer.cs
@@ -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;
}
}
\ No newline at end of file
diff --git a/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.resx b/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.resx
index d4124399bd..8885edf961 100644
--- a/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.resx
+++ b/Tools/ArdupilotMegaPlanner/GCSViews/FlightData.resx
@@ -134,7 +134,7 @@
Point Camera Here
- 175, 70
+ 175, 48
contextMenuStrip1
@@ -208,7 +208,7 @@
hud1
- ArdupilotMega.Controls.HUD, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.HUD, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
SubMainLeft.Panel1
@@ -247,7 +247,7 @@
BUT_script
- ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
tabActions
@@ -280,7 +280,7 @@
BUT_joystick
- ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
tabActions
@@ -310,7 +310,7 @@
BUT_quickmanual
- ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
tabActions
@@ -340,7 +340,7 @@
BUT_quickrtl
- ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
tabActions
@@ -370,7 +370,7 @@
BUT_quickauto
- ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
tabActions
@@ -424,7 +424,7 @@
BUT_setwp
- ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
tabActions
@@ -475,7 +475,7 @@
BUT_setmode
- ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
tabActions
@@ -505,7 +505,7 @@
BUT_clear_track
- ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
tabActions
@@ -556,7 +556,7 @@
BUT_Homealt
- ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
tabActions
@@ -586,7 +586,7 @@
BUT_RAWSensor
- ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
tabActions
@@ -616,7 +616,7 @@
BUTrestartmission
- ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
tabActions
@@ -646,7 +646,7 @@
BUTactiondo
- ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
tabActions
@@ -700,7 +700,7 @@
Gvspeed
- AGaugeApp.AGauge, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ AGaugeApp.AGauge, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
tabGauges
@@ -730,7 +730,7 @@
Gheading
- AGaugeApp.AGauge, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.HSI, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
tabGauges
@@ -760,7 +760,7 @@
Galt
- AGaugeApp.AGauge, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ AGaugeApp.AGauge, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
tabGauges
@@ -793,7 +793,7 @@
Gspeed
- AGaugeApp.AGauge, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ AGaugeApp.AGauge, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
tabGauges
@@ -874,7 +874,7 @@
lbl_logpercent
- ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
tabTLogs
@@ -925,7 +925,7 @@
BUT_log2kml
- ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
tabTLogs
@@ -976,7 +976,7 @@
BUT_playlog
- ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
tabTLogs
@@ -1003,7 +1003,7 @@
BUT_loadtelem
- ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
tabTLogs
@@ -1192,7 +1192,7 @@
lbl_hdop
- ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
splitContainer1.Panel2
@@ -1225,7 +1225,7 @@
lbl_sats
- ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
splitContainer1.Panel2
@@ -1255,7 +1255,7 @@
lbl_winddir
- ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
splitContainer1.Panel2
@@ -1285,7 +1285,7 @@
lbl_windvel
- ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
splitContainer1.Panel2
@@ -1457,7 +1457,7 @@
gMapControl1
- ArdupilotMega.Controls.myGMAP, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.myGMAP, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
splitContainer1.Panel2
@@ -1520,7 +1520,7 @@
TXT_lat
- ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
panel1
@@ -1577,7 +1577,7 @@
label1
- ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
panel1
@@ -1607,7 +1607,7 @@
TXT_long
- ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
panel1
@@ -1637,7 +1637,7 @@
TXT_alt
- ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
panel1
@@ -1838,7 +1838,7 @@
label6
- ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
$this
@@ -1916,6 +1916,6 @@
FlightData
- System.Windows.Forms.MyUserControl, ArdupilotMegaPlanner, Version=1.1.4498.22301, Culture=neutral, PublicKeyToken=null
+ System.Windows.Forms.MyUserControl, ArdupilotMegaPlanner, Version=1.1.4505.22486, Culture=neutral, PublicKeyToken=null
\ No newline at end of file
diff --git a/Tools/ArdupilotMegaPlanner/Msi/wix.pdb b/Tools/ArdupilotMegaPlanner/Msi/wix.pdb
index 6b13b52e52..f4ce1358c9 100644
Binary files a/Tools/ArdupilotMegaPlanner/Msi/wix.pdb and b/Tools/ArdupilotMegaPlanner/Msi/wix.pdb differ
diff --git a/Tools/ArdupilotMegaPlanner/Program.cs b/Tools/ArdupilotMegaPlanner/Program.cs
index 851d5ab5ca..65f75040f1 100644
--- a/Tools/ArdupilotMegaPlanner/Program.cs
+++ b/Tools/ArdupilotMegaPlanner/Program.cs
@@ -46,7 +46,7 @@ namespace ArdupilotMega
if (System.Diagnostics.Debugger.IsAttached)
{
// testing
- Utilities.ParameterMetaDataParser.GetParameterInformation();
+ // Utilities.ParameterMetaDataParser.GetParameterInformation();
}
try
diff --git a/Tools/ArdupilotMegaPlanner/Properties/AssemblyInfo.cs b/Tools/ArdupilotMegaPlanner/Properties/AssemblyInfo.cs
index 790eaa56ac..7f5cef6217 100644
--- a/Tools/ArdupilotMegaPlanner/Properties/AssemblyInfo.cs
+++ b/Tools/ArdupilotMegaPlanner/Properties/AssemblyInfo.cs
@@ -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("")]
diff --git a/Tools/ArdupilotMegaPlanner/Utilities/ParameterMetaDataParser.cs b/Tools/ArdupilotMegaPlanner/Utilities/ParameterMetaDataParser.cs
index 2bf2cc3444..ecd96c05a5 100644
--- a/Tools/ArdupilotMegaPlanner/Utilities/ParameterMetaDataParser.cs
+++ b/Tools/ArdupilotMegaPlanner/Utilities/ParameterMetaDataParser.cs
@@ -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();
@@ -246,13 +246,13 @@ namespace ArdupilotMega.Utilities
private static void GetIndexOfMarkers(ref List 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);
}
}
}
diff --git a/Tools/ArdupilotMegaPlanner/app.config b/Tools/ArdupilotMegaPlanner/app.config
index 8fb4a25118..a1956f3ab1 100644
--- a/Tools/ArdupilotMegaPlanner/app.config
+++ b/Tools/ArdupilotMegaPlanner/app.config
@@ -7,7 +7,7 @@
+ value="http://meee146-planner.googlecode.com/git/Tools/ArdupilotMegaPlanner/bin/Release/"/>
+ value="http://meee146-planner.googlecode.com/git/Tools/ArdupilotMegaPlanner/bin/Release/"/>