mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-11-15 21:05:40 +08:00
APM Planner 1.1.99
Convert to IActivate, IDeactivate scheme, thanks andrew add support for rfcomm* interfaces on linux fix guage off screen draw mono issue. remove use of BackStageViewContentPanel andrews spacer changes - not using dues to screen space issue change configpanel constructor to load xml directly remove IMavlink Interface fix hsi off screen draw issue on mono modify hud to use sprite fonts, instead of drawing via GDI+ modify progress reporter to use a 10hz timer to update screen, using invoke/begininvoke fails on mono at 50hz (over 100ms per call). fix targetalt and target airspeed jumping issue. lots of cleanup on tab switching, ie stoping timers/other 3dr radio status led update update ardurover car icon speedup georef image screen. tested on over 1000 images.
This commit is contained in:
1 parent
80cf794c86
commit
8bebf0c394
86 files changed
+1779
-1137
No files matched your search
@@ -253,7 +253,6 @@
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.CMB_interface);
|
||||
this.Name = "Tracker";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Tracker_FormClosing);
|
||||
((System.ComponentModel.ISupportInitialize)(this.TRK_pantrim)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.TRK_tilttrim)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
@@ -12,7 +12,7 @@ using ArdupilotMega.Utilities;
|
||||
|
||||
namespace ArdupilotMega.Antenna
|
||||
{
|
||||
public partial class Tracker : BackStageViewContentPanel
|
||||
public partial class Tracker : UserControl, IDeactivate
|
||||
{
|
||||
System.Threading.Thread t12;
|
||||
static bool threadrun = false;
|
||||
@@ -217,7 +217,7 @@ namespace ArdupilotMega.Antenna
|
||||
|
||||
}
|
||||
|
||||
private void Tracker_FormClosing(object sender, FormClosingEventArgs e)
|
||||
public void Deactivate()
|
||||
{
|
||||
saveconfig();
|
||||
}
|
||||
|
||||
@@ -308,7 +308,6 @@
|
||||
<DependentUpon>ConfigArdurover.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Presenter\ICommand.cs" />
|
||||
<Compile Include="Mavlink\IMAVLink.cs" />
|
||||
<Compile Include="Utilities\CaptureMJPEG.cs" />
|
||||
<Compile Include="Utilities\CollectionExtensions.cs" />
|
||||
<Compile Include="Utilities\ParameterMetaDataConstants.cs" />
|
||||
@@ -1208,6 +1207,8 @@
|
||||
<None Include="Resources\iconWarning48.png" />
|
||||
<None Include="Resources\cameraGimalPitch1.png" />
|
||||
<None Include="Resources\cameraGimalRoll1.png" />
|
||||
<None Include="Resources\frames_plus.png" />
|
||||
<None Include="Resources\frames_x.png" />
|
||||
<Content Include="Resources\MAVCmd.zh-Hans.txt" />
|
||||
<None Include="Resources\MAVParam.txt" />
|
||||
<Content Include="Resources\MAVParam.zh-Hans.txt" />
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace ArdupilotMega
|
||||
// undo autochange in mouse over
|
||||
if (Pen.Color == Color.Blue)
|
||||
Pen.Color = Color.White;
|
||||
|
||||
|
||||
double width = (MainMap.Manager.GetDistance(MainMap.FromLocalToLatLng(0, 0), MainMap.FromLocalToLatLng(MainMap.Width, 0)) * 1000.0);
|
||||
double height = (MainMap.Manager.GetDistance(MainMap.FromLocalToLatLng(0, 0), MainMap.FromLocalToLatLng(MainMap.Height, 0)) * 1000.0);
|
||||
double m2pixelwidth = MainMap.Width / width;
|
||||
|
||||
@@ -48,6 +48,7 @@ namespace ArdupilotMega.Comms
|
||||
allPorts.AddRange(Directory.GetFiles("/dev/serial/by-id/", "*"));
|
||||
allPorts.AddRange(Directory.GetFiles("/dev/", "ttyACM*"));
|
||||
allPorts.AddRange(Directory.GetFiles("/dev/", "ttyUSB*"));
|
||||
allPorts.AddRange(Directory.GetFiles("/dev/", "rfcomm*"));
|
||||
}
|
||||
|
||||
string[] ports = System.IO.Ports.SerialPort.GetPortNames()
|
||||
|
||||
@@ -1410,6 +1410,8 @@ System.ComponentModel.Description("Enables or disables the range selected by Nee
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region helper
|
||||
@@ -1471,22 +1473,37 @@ System.ComponentModel.Description("Enables or disables the range selected by Nee
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Override to prevent offscreen drawing the control - mono mac
|
||||
/// </summary>
|
||||
public new void Invalidate()
|
||||
{
|
||||
if (!ThisReallyVisible())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
base.Invalidate();
|
||||
}
|
||||
|
||||
public override void Refresh()
|
||||
{
|
||||
base.Refresh();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// this is to fix a mono off screen drawing issue
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool ThisReallyVisible()
|
||||
{
|
||||
if (Parent != null)
|
||||
return this.Bounds.IntersectsWith(Parent.ClientRectangle);
|
||||
|
||||
return true;
|
||||
Control ctl = Control.FromHandle(this.Handle);
|
||||
return ctl.Visible;
|
||||
}
|
||||
|
||||
#region base member overrides
|
||||
protected override void OnPaintBackground(PaintEventArgs pevent)
|
||||
{
|
||||
base.OnPaintBackground(pevent);
|
||||
}
|
||||
|
||||
protected override void OnPaint(PaintEventArgs pe)
|
||||
@@ -1497,9 +1514,11 @@ System.ComponentModel.Description("Enables or disables the range selected by Nee
|
||||
}
|
||||
|
||||
if (!ThisReallyVisible())
|
||||
{
|
||||
Console.WriteLine(this.Visible);
|
||||
base.OnPaint(pe);
|
||||
return;
|
||||
|
||||
base.OnPaint(pe);
|
||||
}
|
||||
|
||||
float scale = 1;
|
||||
|
||||
|
||||
@@ -5,7 +5,31 @@ using System.Windows.Forms;
|
||||
|
||||
namespace ArdupilotMega.Controls.BackstageView
|
||||
{
|
||||
public class BackStageViewContentPanel : UserControl
|
||||
/// <summary>
|
||||
/// The implementor executes some logic on activation, for e.g when moving
|
||||
/// from not selected to selected in a tab control
|
||||
/// </summary>
|
||||
public interface IActivate
|
||||
{
|
||||
// Should be idempotent
|
||||
void Activate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The implementor executes some logic on deactivation, for e.g when moving
|
||||
/// from selected to not selected in a tab control
|
||||
/// </summary>
|
||||
public interface IDeactivate
|
||||
{
|
||||
// Should be idempotent
|
||||
void Deactivate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Base class for user controls that wish to participate as a backstage view
|
||||
/// </summary>
|
||||
[Obsolete("This doesn't do much any more, and should be replaced by indicating lifecycle features with IActivate etc")]
|
||||
public class BackStageViewContentPanel : UserControl, IActivate, IDeactivate
|
||||
{
|
||||
public event FormClosingEventHandler FormClosing;
|
||||
|
||||
@@ -25,5 +49,15 @@ namespace ArdupilotMega.Controls.BackstageView
|
||||
// this is now done on page load via parent control
|
||||
// base.OnLoad(e);
|
||||
}
|
||||
|
||||
public void Activate()
|
||||
{
|
||||
DoLoad(EventArgs.Empty);
|
||||
}
|
||||
|
||||
public void Deactivate()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -37,10 +37,10 @@
|
||||
this.pnlPages.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.pnlPages.Location = new System.Drawing.Point(150, 0);
|
||||
this.pnlPages.Location = new System.Drawing.Point(152, 0);
|
||||
this.pnlPages.MinimumSize = new System.Drawing.Size(100, 0);
|
||||
this.pnlPages.Name = "pnlPages";
|
||||
this.pnlPages.Size = new System.Drawing.Size(297, 192);
|
||||
this.pnlPages.Size = new System.Drawing.Size(291, 192);
|
||||
this.pnlPages.TabIndex = 0;
|
||||
//
|
||||
// pnlMenu
|
||||
@@ -49,7 +49,7 @@
|
||||
| System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.pnlMenu.Location = new System.Drawing.Point(0, 0);
|
||||
this.pnlMenu.Name = "pnlMenu";
|
||||
this.pnlMenu.Size = new System.Drawing.Size(150, 192);
|
||||
this.pnlMenu.Size = new System.Drawing.Size(152, 192);
|
||||
this.pnlMenu.TabIndex = 1;
|
||||
//
|
||||
// BackstageView
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -13,7 +13,7 @@ using ArdupilotMega.Utilities;
|
||||
|
||||
namespace ArdupilotMega.Controls
|
||||
{
|
||||
public partial class ConfigPanel : BackStageViewContentPanel
|
||||
public partial class ConfigPanel : UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// store temp pending changes
|
||||
@@ -22,9 +22,11 @@ namespace ArdupilotMega.Controls
|
||||
// store linked param options
|
||||
Hashtable _linkedParams = new Hashtable();
|
||||
|
||||
public ConfigPanel()
|
||||
public ConfigPanel(string XMLFile)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
LoadXML(XMLFile);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -11,10 +11,10 @@ namespace ArdupilotMega.Controls
|
||||
{
|
||||
public partial class ConnectionStats : UserControl
|
||||
{
|
||||
private readonly IMAVLink _mavlink;
|
||||
private readonly MAVLink _mavlink;
|
||||
private CompositeDisposable _subscriptionsDisposable;
|
||||
|
||||
public ConnectionStats(IMAVLink comPort)
|
||||
public ConnectionStats(MAVLink comPort)
|
||||
: this()
|
||||
{
|
||||
_mavlink = comPort;
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace System.Windows.Forms
|
||||
var msgBoxFrm = new Form
|
||||
{
|
||||
FormBorderStyle = FormBorderStyle.FixedDialog,
|
||||
ShowInTaskbar = false,
|
||||
ShowInTaskbar = true,
|
||||
StartPosition = FormStartPosition.CenterScreen,
|
||||
Text = caption,
|
||||
MaximizeBox = false,
|
||||
@@ -60,7 +60,7 @@ namespace System.Windows.Forms
|
||||
Width = textSize.Width + 50,
|
||||
Height = textSize.Height + 100,
|
||||
TopMost = true,
|
||||
TopLevel = true,
|
||||
TopLevel = true
|
||||
};
|
||||
|
||||
Rectangle screenRectangle = msgBoxFrm.RectangleToScreen(msgBoxFrm.ClientRectangle);
|
||||
@@ -103,6 +103,8 @@ namespace System.Windows.Forms
|
||||
}
|
||||
catch { }
|
||||
|
||||
Console.WriteLine("CustomMessageBox 1");
|
||||
|
||||
if (System.Windows.Forms.Application.OpenForms.Count > 0)
|
||||
{
|
||||
msgBoxFrm.StartPosition = FormStartPosition.Manual;
|
||||
@@ -110,13 +112,17 @@ namespace System.Windows.Forms
|
||||
// center of first form
|
||||
msgBoxFrm.Location = new Point(parentForm.Location.X + parentForm.Width / 2 - msgBoxFrm.Width / 2,
|
||||
parentForm.Location.Y + parentForm.Height / 2 - msgBoxFrm.Height / 2);
|
||||
DialogResult test = msgBoxFrm.ShowDialog();
|
||||
Console.WriteLine("CustomMessageBox 2a");
|
||||
DialogResult test = msgBoxFrm.ShowDialog(null);
|
||||
}
|
||||
else
|
||||
{
|
||||
DialogResult test = msgBoxFrm.ShowDialog();
|
||||
Console.WriteLine("CustomMessageBox 2b");
|
||||
DialogResult test = msgBoxFrm.ShowDialog(null);
|
||||
}
|
||||
|
||||
Console.WriteLine("CustomMessageBox 3");
|
||||
|
||||
DialogResult answer = _state;
|
||||
|
||||
return answer;
|
||||
|
||||
@@ -31,6 +31,29 @@ namespace ArdupilotMega.Controls
|
||||
set { _navbearing = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Override to prevent offscreen drawing the control - mono mac
|
||||
/// </summary>
|
||||
public new void Invalidate()
|
||||
{
|
||||
if (!ThisReallyVisible())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
base.Invalidate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// this is to fix a mono off screen drawing issue
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool ThisReallyVisible()
|
||||
{
|
||||
Control ctl = Control.FromHandle(this.Handle);
|
||||
return ctl.Visible;
|
||||
}
|
||||
|
||||
public HSI()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -35,12 +35,7 @@ namespace ArdupilotMega.Controls
|
||||
throw new ArgumentOutOfRangeException();
|
||||
|
||||
_opacity = value;
|
||||
Console.WriteLine("Opacity:" + _opacity);
|
||||
Invalidate();
|
||||
Invalidate();
|
||||
Invalidate();
|
||||
Invalidate();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,51 +1,73 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ArdupilotMega.Controls
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// A seperator that is fundamentally made from two lines the top 'Primary' and the
|
||||
/// bottom 'Secondary' Thus the height is always 2 pixels
|
||||
/// In addition, the opacity can be modulated for the left, middle and right most
|
||||
/// points, and the color blended between. That way the seperator can be made to
|
||||
/// fade out to the left or right or both, and more subtle UI effects made etc
|
||||
/// </summary>
|
||||
public partial class LineSeparator : UserControl
|
||||
{
|
||||
[Description("Primary Color of the secondary line"), Category("Appearance")]
|
||||
[DefaultValue(typeof(Color), "DarkGray")]
|
||||
public Color PrimaryColor { get; set; }
|
||||
|
||||
[Description("Secondary Color of the secondary line"), Category("Appearance")]
|
||||
[DefaultValue(typeof(Color), "White")]
|
||||
public Color SecondaryColor { get; set; }
|
||||
|
||||
[Description("Opacity at the left most point"), Category("Appearance")]
|
||||
[DefaultValue(typeof(float), "1.0")]
|
||||
public float Opacity1 { get; set; }
|
||||
|
||||
[Description("Opacity at the mid point"), Category("Appearance")]
|
||||
[DefaultValue(typeof(float), "1.0")]
|
||||
public float Opacity2 { get; set; }
|
||||
|
||||
[Description("Opacity at the right most point"), Category("Appearance")]
|
||||
[DefaultValue(typeof(float), "1.0")]
|
||||
public float Opacity3 { get; set; }
|
||||
|
||||
public LineSeparator()
|
||||
{
|
||||
this.PrimaryColor = Color.DarkGray;
|
||||
this.SecondaryColor = Color.White;
|
||||
this.Opacity1 = Opacity2 = Opacity3 = 1f;
|
||||
|
||||
this.Height = 2;
|
||||
|
||||
this.Paint += new PaintEventHandler(LineSeparator_Paint);
|
||||
|
||||
|
||||
this.Paint += LineSeparator_Paint;
|
||||
this.MaximumSize = new Size(2000, 2);
|
||||
|
||||
|
||||
this.MinimumSize = new Size(0, 2);
|
||||
|
||||
//this.Width = 350;
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void LineSeparator_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
Graphics g = e.Graphics;
|
||||
|
||||
g.DrawLine(
|
||||
|
||||
Pens.DarkGray, new Point(0, 0), new Point(this.Width, 0));
|
||||
|
||||
g.DrawLine(
|
||||
|
||||
Pens.White, new Point(0, 1), new Point(this.Width, 1));
|
||||
|
||||
DrawLine(PrimaryColor, 0, e.Graphics);
|
||||
DrawLine(SecondaryColor, 1, e.Graphics);
|
||||
}
|
||||
|
||||
private void DrawLine(Color baseColor, int y, Graphics g)
|
||||
{
|
||||
var c1 = Color.FromArgb((int)(Opacity1 * 255), baseColor.R, baseColor.G, baseColor.B);
|
||||
var c2 = Color.FromArgb((int)(Opacity2 * 255), baseColor.R, baseColor.G, baseColor.B);
|
||||
var c3 = Color.FromArgb((int)(Opacity3 * 255), baseColor.R, baseColor.G, baseColor.B);
|
||||
|
||||
var point1 = new Point(0, y);
|
||||
var point2 = new Point(Width / 2, y);
|
||||
var point = new Point(Width, y);
|
||||
|
||||
var b1 = new LinearGradientBrush(point1, point2, c1, c2);
|
||||
var b2 = new LinearGradientBrush(point2, point, c2, c3);
|
||||
|
||||
g.DrawLine(new Pen(b1), point1, point2);
|
||||
g.DrawLine(new Pen(b2), point2, point);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using ArdupilotMega.Utilities;
|
||||
using ArdupilotMega.Controls.BackstageView;
|
||||
|
||||
namespace ArdupilotMega.Controls
|
||||
{
|
||||
@@ -43,6 +44,11 @@ namespace ArdupilotMega.Controls
|
||||
// check if we need to remove the current control
|
||||
if (!current.Persistent)
|
||||
{
|
||||
if (current.Control is IDeactivate)
|
||||
{
|
||||
((IDeactivate)(current.Control)).Deactivate();
|
||||
}
|
||||
|
||||
// cleanup
|
||||
current.Control.Close();
|
||||
|
||||
@@ -63,6 +69,11 @@ namespace ArdupilotMega.Controls
|
||||
|
||||
nextscreen.Visible = true;
|
||||
|
||||
if (nextscreen.Control is IActivate)
|
||||
{
|
||||
((IActivate)(nextscreen.Control)).Activate();
|
||||
}
|
||||
|
||||
this.Controls.Add(nextscreen.Control);
|
||||
|
||||
ThemeManager.ApplyThemeTo(nextscreen.Control);
|
||||
|
||||
@@ -64,7 +64,22 @@ namespace ArdupilotMega.Controls
|
||||
return this.Bounds.IntersectsWith(Parent.ClientRectangle);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Refresh()
|
||||
{
|
||||
base.Refresh();
|
||||
}
|
||||
|
||||
protected override void OnParentBindingContextChanged(EventArgs e)
|
||||
{
|
||||
base.OnParentBindingContextChanged(e);
|
||||
}
|
||||
|
||||
protected override void OnVisibleChanged(EventArgs e)
|
||||
{
|
||||
base.OnVisibleChanged(e);
|
||||
}
|
||||
|
||||
|
||||
SolidBrush s = new SolidBrush(Color.White);
|
||||
@@ -75,9 +90,7 @@ namespace ArdupilotMega.Controls
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
|
||||
TextRenderer.DrawText(e.Graphics, label, this.Font, new Point(0, 0), ForeColor);
|
||||
/*
|
||||
//return;
|
||||
// TextRenderer.DrawText(e.Graphics, label, this.Font, new Point(0, 0), ForeColor);
|
||||
|
||||
stringFormat.Alignment = StringAlignment.Near;
|
||||
stringFormat.LineAlignment = StringAlignment.Center;
|
||||
@@ -85,7 +98,7 @@ namespace ArdupilotMega.Controls
|
||||
s = new SolidBrush(ForeColor);
|
||||
|
||||
e.Graphics.DrawString(label, this.Font, s, new PointF(0, this.Height / 2.0f), stringFormat);
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
protected override void OnPaintBackground(PaintEventArgs pevent)
|
||||
|
||||
@@ -11,6 +11,10 @@ namespace System.Windows.Forms
|
||||
/// </summary>
|
||||
public class MyUserControl : System.Windows.Forms.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// implement an on closing event to tidy up enviroment.
|
||||
/// Using preedefined refrence as can easerly change betwen form and user control this way.
|
||||
/// </summary>
|
||||
public event FormClosingEventHandler FormClosing;
|
||||
|
||||
public void Close(object sender, FormClosingEventArgs e)
|
||||
|
||||
@@ -17,6 +17,9 @@ namespace ArdupilotMega.Controls
|
||||
private Exception workerException;
|
||||
public ProgressWorkerEventArgs doWorkArgs;
|
||||
|
||||
internal int _progress = -1;
|
||||
internal string _status = "";
|
||||
|
||||
public delegate void DoWorkEventHandler(object sender, ProgressWorkerEventArgs e);
|
||||
|
||||
// This is the event that will be raised on the BG thread
|
||||
@@ -48,7 +51,7 @@ namespace ArdupilotMega.Controls
|
||||
|
||||
// mono fix - ensure the dialog is running
|
||||
while (this.IsHandleCreated == false)
|
||||
System.Threading.Thread.Sleep(5);
|
||||
System.Threading.Thread.Sleep(1);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -59,10 +62,18 @@ namespace ArdupilotMega.Controls
|
||||
// The background operation thew an exception.
|
||||
// Examine the work args, if there is an error, then display that and the exception details
|
||||
// Otherwise display 'Unexpected error' and exception details
|
||||
timer1.Stop();
|
||||
ShowDoneWithError(e, doWorkArgs.ErrorMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
// stop the timer
|
||||
timer1.Stop();
|
||||
// run once more to do final message and progressbar
|
||||
this.Invoke((MethodInvoker)delegate
|
||||
{
|
||||
timer1_Tick(null, null);
|
||||
});
|
||||
|
||||
if (doWorkArgs.CancelRequested && doWorkArgs.CancelAcknowledged)
|
||||
{
|
||||
@@ -183,24 +194,9 @@ namespace ArdupilotMega.Controls
|
||||
if (doWorkArgs.CancelRequested && !doWorkArgs.CancelAcknowledged)
|
||||
return;
|
||||
|
||||
if (this.InvokeRequired)
|
||||
{
|
||||
// invoke async
|
||||
this.BeginInvoke((MethodInvoker) delegate
|
||||
{
|
||||
_progress = progress;
|
||||
_status = status;
|
||||
|
||||
lblProgressMessage.Text = status;
|
||||
if (progress == -1)
|
||||
{
|
||||
this.progressBar1.Style = ProgressBarStyle.Marquee;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.progressBar1.Style = ProgressBarStyle.Continuous;
|
||||
this.progressBar1.Value = progress;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
@@ -212,6 +208,25 @@ namespace ArdupilotMega.Controls
|
||||
CustomMessageBox.Show(message,"Exception Details",MessageBoxButtons.OK,MessageBoxIcon.Information);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// prevent using invokes on main update status call "UpdateProgressAndStatus", as this is slow on mono
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void timer1_Tick(object sender, EventArgs e)
|
||||
{
|
||||
lblProgressMessage.Text = _status;
|
||||
if (_progress == -1)
|
||||
{
|
||||
this.progressBar1.Style = ProgressBarStyle.Marquee;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.progressBar1.Style = ProgressBarStyle.Continuous;
|
||||
this.progressBar1.Value = _progress;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class ProgressWorkerEventArgs : EventArgs
|
||||
|
||||
@@ -33,12 +33,14 @@ namespace ArdupilotMega.Controls
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.progressBar1 = new System.Windows.Forms.ProgressBar();
|
||||
this.lblProgressMessage = new System.Windows.Forms.Label();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.imgWarning = new System.Windows.Forms.PictureBox();
|
||||
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
|
||||
this.btnClose = new System.Windows.Forms.Button();
|
||||
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
||||
((System.ComponentModel.ISupportInitialize)(this.imgWarning)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
@@ -94,7 +96,7 @@ namespace ArdupilotMega.Controls
|
||||
this.linkLabel1.Visible = false;
|
||||
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
|
||||
//
|
||||
// btn_Close
|
||||
// btnClose
|
||||
//
|
||||
this.btnClose.Location = new System.Drawing.Point(213, 109);
|
||||
this.btnClose.Name = "btnClose";
|
||||
@@ -104,6 +106,11 @@ namespace ArdupilotMega.Controls
|
||||
this.btnClose.UseVisualStyleBackColor = true;
|
||||
this.btnClose.Click += new System.EventHandler(this.btn_Close_Click);
|
||||
//
|
||||
// timer1
|
||||
//
|
||||
this.timer1.Enabled = true;
|
||||
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
|
||||
//
|
||||
// ProgressReporterDialogue
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
@@ -123,6 +130,7 @@ namespace ArdupilotMega.Controls
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Progress";
|
||||
this.TopMost = true;
|
||||
((System.ComponentModel.ISupportInitialize)(this.imgWarning)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
@@ -137,5 +145,6 @@ namespace ArdupilotMega.Controls
|
||||
private PictureBox imgWarning;
|
||||
private LinkLabel linkLabel1;
|
||||
private Button btnClose;
|
||||
private Timer timer1;
|
||||
}
|
||||
}
|
||||
@@ -117,4 +117,7 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -10,9 +10,6 @@ namespace ArdupilotMega.Controls
|
||||
{
|
||||
var bgcolor = c.BackColor;
|
||||
int alpha = 255 - ((int)(opacity * 255));
|
||||
|
||||
Console.WriteLine("Alpha:" + alpha);
|
||||
|
||||
|
||||
var opacityColor = Color.FromArgb(alpha, bgcolor.R, bgcolor.G, bgcolor.B);
|
||||
using (var brush = new SolidBrush(opacityColor))
|
||||
|
||||
@@ -78,6 +78,7 @@ namespace ArdupilotMega
|
||||
public float mz { get; set; }
|
||||
|
||||
public float magfield { get { return (float)Math.Sqrt(Math.Pow(mx, 2) + Math.Pow(my, 2) + Math.Pow(mz, 2)); } }
|
||||
public float accelsq { get { return (float)Math.Sqrt(Math.Pow(ax, 2) + Math.Pow(ay, 2) + Math.Pow(az, 2)) / 980.665f; } }
|
||||
|
||||
// calced turn rate
|
||||
public float turnrate { get { if (groundspeed <= 1) return 0; return (roll * 9.8f) / groundspeed; } }
|
||||
@@ -131,9 +132,9 @@ namespace ArdupilotMega
|
||||
public float nav_bearing { get; set; }
|
||||
public float target_bearing { get; set; }
|
||||
public float wp_dist { get { return (_wpdist * multiplierdist); } set { _wpdist = value; } }
|
||||
public float alt_error { get { return _alt_error * multiplierdist; } set { _alt_error = value; _targetalt = (float)Math.Round(alt + alt_error, 0); } }
|
||||
public float alt_error { get { return _alt_error * multiplierdist; } set { if (_alt_error == value) return; _alt_error = value; _targetalt = _targetalt * 0.5f + (float)Math.Round(alt + alt_error, 0) * 0.5f; Console.WriteLine(_targetalt); } }
|
||||
public float ber_error { get { return (target_bearing - yaw); } set { } }
|
||||
public float aspd_error { get { return _aspd_error * multiplierspeed; } set { _aspd_error = value; } }
|
||||
public float aspd_error { get { return _aspd_error * multiplierspeed; } set { if (_aspd_error == value) return; _aspd_error = value; _targetairspeed = _targetairspeed * 0.5f + (float)Math.Round(airspeed + aspd_error / 100, 0) * 0.5f; } }
|
||||
public float xtrack_error { get; set; }
|
||||
public float wpno { get; set; }
|
||||
public string mode { get; set; }
|
||||
@@ -142,12 +143,13 @@ namespace ArdupilotMega
|
||||
float _aspd_error;
|
||||
float _alt_error;
|
||||
float _targetalt;
|
||||
float _targetairspeed;
|
||||
|
||||
public float targetaltd100 { get { return (_targetalt / 100) % 10; } }
|
||||
public float targetalt { get { return _targetalt; } }
|
||||
|
||||
//airspeed_error = (airspeed_error - airspeed);
|
||||
public float targetairspeed { get { return (float)Math.Round(airspeed + aspd_error / 100, 0); } }
|
||||
public float targetairspeed { get { return _targetairspeed; } }
|
||||
|
||||
|
||||
//message
|
||||
@@ -352,7 +354,7 @@ namespace ArdupilotMega
|
||||
UpdateCurrentSettings(bs, false, MainV2.comPort);
|
||||
}
|
||||
*/
|
||||
public void UpdateCurrentSettings(System.Windows.Forms.BindingSource bs, bool updatenow, IMAVLink mavinterface)
|
||||
public void UpdateCurrentSettings(System.Windows.Forms.BindingSource bs, bool updatenow, MAVLink mavinterface)
|
||||
{
|
||||
if (DateTime.Now > lastupdate.AddMilliseconds(19) || updatenow) // 50 hz
|
||||
{
|
||||
@@ -430,24 +432,6 @@ namespace ArdupilotMega
|
||||
//MAVLink.packets[MAVLink.MAVLINK_MSG_ID_HWSTATUS] = null;
|
||||
}
|
||||
|
||||
|
||||
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT];
|
||||
|
||||
if (bytearray != null)
|
||||
{
|
||||
var nav = bytearray.ByteArrayToStructure<MAVLink.mavlink_nav_controller_output_t>(6);
|
||||
|
||||
nav_roll = nav.nav_roll;
|
||||
nav_pitch = nav.nav_pitch;
|
||||
nav_bearing = nav.nav_bearing;
|
||||
target_bearing = nav.target_bearing;
|
||||
wp_dist = nav.wp_dist;
|
||||
alt_error = nav.alt_error;
|
||||
aspd_error = nav.aspd_error;
|
||||
xtrack_error = nav.xtrack_error;
|
||||
|
||||
//MAVLink.packets[MAVLink.MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT] = null;
|
||||
}
|
||||
#if MAVLINK10
|
||||
|
||||
|
||||
@@ -849,6 +833,26 @@ namespace ArdupilotMega
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT];
|
||||
|
||||
if (bytearray != null)
|
||||
{
|
||||
var nav = bytearray.ByteArrayToStructure<MAVLink.mavlink_nav_controller_output_t>(6);
|
||||
|
||||
nav_roll = nav.nav_roll;
|
||||
nav_pitch = nav.nav_pitch;
|
||||
nav_bearing = nav.nav_bearing;
|
||||
target_bearing = nav.target_bearing;
|
||||
wp_dist = nav.wp_dist;
|
||||
alt_error = nav.alt_error;
|
||||
aspd_error = nav.aspd_error;
|
||||
xtrack_error = nav.xtrack_error;
|
||||
|
||||
//MAVLink.packets[MAVLink.MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT] = null;
|
||||
}
|
||||
|
||||
bytearray = mavinterface.packets[MAVLink.MAVLINK_MSG_ID_RC_CHANNELS_RAW];
|
||||
if (bytearray != null)
|
||||
{
|
||||
@@ -964,7 +968,7 @@ namespace ArdupilotMega
|
||||
//System.Diagnostics.Debug.WriteLine(DateTime.Now.Millisecond);
|
||||
//Console.WriteLine(DateTime.Now.Millisecond);
|
||||
bs.DataSource = this;
|
||||
//Console.WriteLine(DateTime.Now.Millisecond + " 1 " + updatenow);
|
||||
// Console.WriteLine(DateTime.Now.Millisecond + " 1 " + updatenow + " " + System.Threading.Thread.CurrentThread.Name);
|
||||
bs.ResetBindings(false);
|
||||
//Console.WriteLine(DateTime.Now.Millisecond + " done ");
|
||||
}
|
||||
|
||||
-1
@@ -259,7 +259,6 @@
|
||||
this.Controls.Add(this.LIM_ENABLED);
|
||||
this.Controls.Add(this.LNK_wiki);
|
||||
this.Name = "ConfigAP_Limits";
|
||||
this.Load += new System.EventHandler(this.ConfigAP_Limits_Load);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.groupBox5.ResumeLayout(false);
|
||||
|
||||
@@ -13,7 +13,7 @@ using System.Diagnostics;
|
||||
|
||||
namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
{
|
||||
public partial class ConfigAP_Limits : BackStageViewContentPanel
|
||||
public partial class ConfigAP_Limits : UserControl, IActivate
|
||||
{
|
||||
public ConfigAP_Limits()
|
||||
{
|
||||
@@ -73,7 +73,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
ProcessChange(sender, e);
|
||||
}
|
||||
|
||||
private void ConfigAP_Limits_Load(object sender, EventArgs e)
|
||||
public void Activate()
|
||||
{
|
||||
PopulateData();
|
||||
}
|
||||
|
||||
-1
@@ -83,7 +83,6 @@
|
||||
this.Controls.Add(this.BUT_levelplane);
|
||||
this.Name = "ConfigAccelerometerCalibrationPlane";
|
||||
this.toolTip1.SetToolTip(this, resources.GetString("$this.ToolTip"));
|
||||
this.Load += new System.EventHandler(this.ConfigAccelerometerCalibration_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@ using ArdupilotMega.Controls;
|
||||
|
||||
namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
{
|
||||
public partial class ConfigAccelerometerCalibrationPlane : BackStageViewContentPanel
|
||||
public partial class ConfigAccelerometerCalibrationPlane : UserControl, IActivate
|
||||
{
|
||||
bool startup = false;
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ConfigAccelerometerCalibration_Load(object sender, EventArgs e)
|
||||
public void Activate()
|
||||
{
|
||||
if (!MainV2.comPort.BaseStream.IsOpen)
|
||||
{
|
||||
|
||||
Tools/ArdupilotMegaPlanner/GCSViews/ConfigurationView/ConfigAccelerometerCalibrationQuad.Designer.cs
Generated
+109
-102
File diff suppressed because it is too large.
Load diff
+75
-47
@@ -1,90 +1,118 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
using ArdupilotMega.Controls.BackstageView;
|
||||
using ArdupilotMega.Controls;
|
||||
using log4net;
|
||||
using Transitions;
|
||||
|
||||
namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
{
|
||||
public partial class ConfigAccelerometerCalibrationQuad : BackStageViewContentPanel
|
||||
public partial class ConfigAccelerometerCalibrationQuad : UserControl, IActivate, IDeactivate
|
||||
{
|
||||
private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private const float DisabledOpacity = 0.2F;
|
||||
private const float EnabledOpacity = 1.0F;
|
||||
|
||||
public ConfigAccelerometerCalibrationQuad()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void pictureBoxQuadX_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
MainV2.comPort.setParam("FRAME", 1f);
|
||||
CustomMessageBox.Show("Set to x");
|
||||
|
||||
lbl_frame.Text = "X";
|
||||
}
|
||||
catch { CustomMessageBox.Show("Set frame failed"); }
|
||||
}
|
||||
|
||||
private void BUT_levelac2_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
#if MAVLINK10
|
||||
Log.Info("Sending level command (mavlink 1.0)");
|
||||
int fixme; // needs to be accel only
|
||||
MainV2.comPort.doCommand(MAVLink.MAV_CMD.PREFLIGHT_CALIBRATION,1,1,1,1,1,1,1);
|
||||
#else
|
||||
log.Info("Sending level command (mavlink 0.9)");
|
||||
MainV2.comPort.doAction(MAVLink.MAV_ACTION.MAV_ACTION_CALIBRATE_ACC);
|
||||
#endif
|
||||
|
||||
BUT_levelac2.Text = "Complete";
|
||||
}
|
||||
catch
|
||||
catch(Exception ex)
|
||||
{
|
||||
Log.Error("Exception on level", ex);
|
||||
CustomMessageBox.Show("Failed to level : ac2 2.0.37+ is required");
|
||||
}
|
||||
}
|
||||
|
||||
private void pictureBoxQuad_Click(object sender, EventArgs e)
|
||||
private void pictureBox_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
MainV2.comPort.setParam("FRAME", 0f);
|
||||
CustomMessageBox.Show("Set to +");
|
||||
lbl_frame.Text = "+";
|
||||
}
|
||||
catch { CustomMessageBox.Show("Set frame failed"); }
|
||||
if (sender == pictureBoxPlus)
|
||||
radioButton_Plus.Checked = true;
|
||||
else
|
||||
radioButton_X.Checked = true;
|
||||
}
|
||||
|
||||
private void ConfigAccelerometerCalibration_Load(object sender, EventArgs e)
|
||||
private void SetPlus()
|
||||
{
|
||||
if (!MainV2.comPort.BaseStream.IsOpen)
|
||||
FadePicBoxes(DisabledOpacity, EnabledOpacity);
|
||||
SetFrameParam(true);
|
||||
}
|
||||
|
||||
private void SetX()
|
||||
{
|
||||
FadePicBoxes(EnabledOpacity, DisabledOpacity);
|
||||
SetFrameParam(false);
|
||||
}
|
||||
|
||||
private void SetFrameParam(bool isPlus)
|
||||
{
|
||||
var f = isPlus ? 0f : 1f;
|
||||
|
||||
try
|
||||
{
|
||||
this.Enabled = false;
|
||||
return;
|
||||
MainV2.comPort.setParam("FRAME", f);
|
||||
}
|
||||
catch
|
||||
{
|
||||
CustomMessageBox.Show("Set frame failed", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
private void FadePicBoxes(float xOpacity, float plusOpacity)
|
||||
{
|
||||
var fade = new Transition(new TransitionType_Linear(400));
|
||||
fade.add(pictureBoxX, "Opacity", xOpacity);
|
||||
fade.add(pictureBoxPlus, "Opacity", plusOpacity);
|
||||
fade.run();
|
||||
}
|
||||
|
||||
public void Activate()
|
||||
{
|
||||
if ((float)MainV2.comPort.param["FRAME"] == 0)
|
||||
{
|
||||
this.radioButton_Plus.Checked = true;
|
||||
pictureBoxX.Opacity = DisabledOpacity;
|
||||
pictureBoxPlus.Opacity = EnabledOpacity;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2)
|
||||
{
|
||||
this.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Enabled = false;
|
||||
return;
|
||||
}
|
||||
this.radioButton_X.Checked = true;
|
||||
pictureBoxX.Opacity = EnabledOpacity;
|
||||
pictureBoxPlus.Opacity = DisabledOpacity;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
lbl_frame.Text = ((float)MainV2.comPort.param["FRAME"] == 0) ? "+" : "X";
|
||||
}
|
||||
catch { lbl_frame.Text = "Invalid Frame"; }
|
||||
radioButton_Plus.CheckedChanged += RadioButtonPlusCheckedChanged;
|
||||
}
|
||||
|
||||
public void Deactivate()
|
||||
{
|
||||
radioButton_Plus.CheckedChanged -= RadioButtonPlusCheckedChanged;
|
||||
|
||||
}
|
||||
|
||||
void RadioButtonPlusCheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (radioButton_X.Checked)
|
||||
SetX();
|
||||
else
|
||||
SetPlus();
|
||||
}
|
||||
}
|
||||
}
|
||||
+256
-232
File diff suppressed because it is too large.
Load diff
+5
-1
@@ -303,6 +303,11 @@
|
||||
// THR_RATE_IMAX
|
||||
//
|
||||
resources.ApplyResources(this.THR_RATE_IMAX, "THR_RATE_IMAX");
|
||||
this.THR_RATE_IMAX.Maximum = new decimal(new int[] {
|
||||
1000,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.THR_RATE_IMAX.Name = "THR_RATE_IMAX";
|
||||
//
|
||||
// THR_RATE_I
|
||||
@@ -896,7 +901,6 @@
|
||||
this.Controls.Add(this.groupBox24);
|
||||
this.Controls.Add(this.groupBox25);
|
||||
this.Name = "ConfigArducopter";
|
||||
this.Load += new System.EventHandler(this.ConfigArducopter_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.TUNE_LOW)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.TUNE_HIGH)).EndInit();
|
||||
this.groupBox5.ResumeLayout(false);
|
||||
|
||||
@@ -12,7 +12,7 @@ using ArdupilotMega.Controls;
|
||||
|
||||
namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
{
|
||||
public partial class ConfigArducopter : BackStageViewContentPanel
|
||||
public partial class ConfigArducopter : UserControl, IActivate
|
||||
{
|
||||
Hashtable changes = new Hashtable();
|
||||
static Hashtable tooltips = new Hashtable();
|
||||
@@ -34,7 +34,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
public string desc;
|
||||
}
|
||||
|
||||
private void ConfigArducopter_Load(object sender, EventArgs e)
|
||||
public void Activate()
|
||||
{
|
||||
if (!MainV2.comPort.BaseStream.IsOpen)
|
||||
{
|
||||
@@ -203,6 +203,12 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
thisctl.Minimum = -180;
|
||||
}
|
||||
|
||||
if (thisctl.Name.ToUpper().EndsWith("THR_RATE_IMAX"))
|
||||
{
|
||||
thisctl.Maximum = 1000; // is a pwm
|
||||
thisctl.Minimum = 0;
|
||||
}
|
||||
|
||||
thisctl.Enabled = true;
|
||||
|
||||
thisctl.BackColor = Color.FromArgb(0x43, 0x44, 0x45);
|
||||
@@ -412,7 +418,8 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
|
||||
((Control)sender).Enabled = true;
|
||||
|
||||
this.DoLoad(new EventArgs());
|
||||
|
||||
this.Activate();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
<value>myLabel3</value>
|
||||
</data>
|
||||
<data name=">>myLabel3.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4564.20854, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4585.13688, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>myLabel3.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
@@ -201,7 +201,7 @@
|
||||
<value>myLabel2</value>
|
||||
</data>
|
||||
<data name=">>myLabel2.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4564.20854, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4585.13688, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>myLabel2.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
@@ -312,7 +312,7 @@
|
||||
<value>myLabel1</value>
|
||||
</data>
|
||||
<data name=">>myLabel1.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4564.20854, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.MyLabel, ArdupilotMegaPlanner10, Version=1.1.4585.13688, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>myLabel1.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
@@ -2506,7 +2506,7 @@
|
||||
<value>BUT_writePIDS</value>
|
||||
</data>
|
||||
<data name=">>BUT_writePIDS.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4564.20854, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4585.13688, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>BUT_writePIDS.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
@@ -2536,7 +2536,7 @@
|
||||
<value>BUT_rerequestparams</value>
|
||||
</data>
|
||||
<data name=">>BUT_rerequestparams.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4564.20854, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4585.13688, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>BUT_rerequestparams.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
@@ -2782,6 +2782,6 @@
|
||||
<value>ConfigArducopter</value>
|
||||
</data>
|
||||
<data name=">>$this.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.BackstageView.BackStageViewContentPanel, ArdupilotMegaPlanner10, Version=1.1.4564.20854, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
</root>
|
||||
-1
@@ -824,7 +824,6 @@
|
||||
this.Controls.Add(this.groupBox9);
|
||||
this.Controls.Add(this.groupBox8);
|
||||
this.Name = "ConfigArduplane";
|
||||
this.Load += new System.EventHandler(this.ConfigArduplane_Load);
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.THR_FS_VALUE)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.THR_MAX)).EndInit();
|
||||
|
||||
@@ -12,7 +12,7 @@ using ArdupilotMega.Controls;
|
||||
|
||||
namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
{
|
||||
public partial class ConfigArduplane : BackStageViewContentPanel
|
||||
public partial class ConfigArduplane : UserControl, IActivate
|
||||
{
|
||||
Hashtable changes = new Hashtable();
|
||||
static Hashtable tooltips = new Hashtable();
|
||||
@@ -23,7 +23,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ConfigArduplane_Load(object sender, EventArgs e)
|
||||
public void Activate()
|
||||
{
|
||||
if (!MainV2.comPort.BaseStream.IsOpen)
|
||||
{
|
||||
@@ -318,7 +318,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
|
||||
((Control)sender).Enabled = true;
|
||||
|
||||
this.DoLoad(new EventArgs());
|
||||
this.Activate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-1
@@ -509,7 +509,6 @@
|
||||
this.Controls.Add(this.groupBox14);
|
||||
this.Controls.Add(this.groupBox11);
|
||||
this.Name = "ConfigArdurover";
|
||||
this.Load += new System.EventHandler(this.ConfigArduplane_Load);
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.THR_FS_VALUE)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.THR_MAX)).EndInit();
|
||||
|
||||
@@ -12,7 +12,7 @@ using ArdupilotMega.Controls;
|
||||
|
||||
namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
{
|
||||
public partial class ConfigArdurover : BackStageViewContentPanel
|
||||
public partial class ConfigArdurover : UserControl, IActivate
|
||||
{
|
||||
Hashtable changes = new Hashtable();
|
||||
static Hashtable tooltips = new Hashtable();
|
||||
@@ -23,7 +23,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ConfigArduplane_Load(object sender, EventArgs e)
|
||||
public void Activate()
|
||||
{
|
||||
if (!MainV2.comPort.BaseStream.IsOpen)
|
||||
{
|
||||
@@ -318,7 +318,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
|
||||
((Control)sender).Enabled = true;
|
||||
|
||||
this.DoLoad(new EventArgs());
|
||||
this.Activate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-2
@@ -186,7 +186,6 @@
|
||||
//
|
||||
// timer1
|
||||
//
|
||||
this.timer1.Enabled = true;
|
||||
this.timer1.Interval = 1000;
|
||||
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
|
||||
//
|
||||
@@ -204,7 +203,6 @@
|
||||
this.Controls.Add(this.CMB_batmontype);
|
||||
this.Controls.Add(this.pictureBox5);
|
||||
this.Name = "ConfigBatteryMonitoring";
|
||||
this.Load += new System.EventHandler(this.ConfigBatteryMonitoring_Load);
|
||||
this.groupBox4.ResumeLayout(false);
|
||||
this.groupBox4.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit();
|
||||
|
||||
@@ -11,7 +11,7 @@ using ArdupilotMega.Controls;
|
||||
|
||||
namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
{
|
||||
public partial class ConfigBatteryMonitoring : BackStageViewContentPanel
|
||||
public partial class ConfigBatteryMonitoring : UserControl, IActivate, IDeactivate
|
||||
{
|
||||
bool startup = false;
|
||||
|
||||
@@ -278,18 +278,13 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
}
|
||||
}
|
||||
|
||||
private void ConfigBatteryMonitoring_Load(object sender, EventArgs e)
|
||||
public void Deactivate()
|
||||
{
|
||||
if (!MainV2.comPort.BaseStream.IsOpen)
|
||||
{
|
||||
this.Enabled = false;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Enabled = true;
|
||||
}
|
||||
timer1.Stop();
|
||||
}
|
||||
|
||||
public void Activate()
|
||||
{
|
||||
startup = true;
|
||||
bool not_supported = false;
|
||||
if (MainV2.comPort.param["BATT_MONITOR"] != null)
|
||||
@@ -345,6 +340,8 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
}
|
||||
|
||||
startup = false;
|
||||
|
||||
timer1.Start();
|
||||
}
|
||||
|
||||
int getIndex(ComboBox ctl, int no)
|
||||
|
||||
@@ -682,6 +682,6 @@ Then subtract 0.3v from that value and enter it in field #1 at left.
|
||||
<value>ConfigBatteryMonitoring</value>
|
||||
</data>
|
||||
<data name=">>$this.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.BackstageView.BackStageViewContentPanel, ArdupilotMegaPlanner10, Version=1.1.4564.19603, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
</root>
|
||||
-1
@@ -574,7 +574,6 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
this.Controls.Add(this.pictureBox1);
|
||||
this.Name = "ConfigCameraStab";
|
||||
this.Size = new System.Drawing.Size(674, 432);
|
||||
this.Load += new System.EventHandler(this.ConfigCameraStab_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.presenterBindingSource)).EndInit();
|
||||
|
||||
@@ -10,7 +10,7 @@ using Transitions;
|
||||
|
||||
namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
{
|
||||
public partial class ConfigCameraStab : BackStageViewContentPanel
|
||||
public partial class ConfigCameraStab : UserControl, IActivate
|
||||
{
|
||||
private ConfigCameraStabPresenter _presenter;
|
||||
private Transition[] _ErrorTransition;
|
||||
@@ -23,7 +23,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
LBL_Error.Opacity = 0.0F;
|
||||
}
|
||||
|
||||
private void ConfigCameraStab_Load(object sender, EventArgs ev)
|
||||
public void Activate()
|
||||
{
|
||||
_presenter = new ConfigCameraStabPresenter(MainV2.comPort);
|
||||
presenterBindingSource.DataSource = _presenter;
|
||||
|
||||
-1
@@ -279,7 +279,6 @@
|
||||
this.Controls.Add(this.CMB_fmode1);
|
||||
this.Controls.Add(this.BUT_SaveModes);
|
||||
this.Name = "ConfigFlightModes";
|
||||
this.Load += new System.EventHandler(this.ConfigFlightModes_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.currentStateBindingSource)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
@@ -12,7 +12,7 @@ using ArdupilotMega.Controls;
|
||||
|
||||
namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
{
|
||||
public partial class ConfigFlightModes : BackStageViewContentPanel
|
||||
public partial class ConfigFlightModes : UserControl, IActivate, IDeactivate
|
||||
{
|
||||
Timer timer = new Timer();
|
||||
|
||||
@@ -124,18 +124,13 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
Simple6 = 32,
|
||||
}
|
||||
|
||||
private void ConfigFlightModes_Load(object sender, EventArgs e)
|
||||
public void Deactivate()
|
||||
{
|
||||
if (!MainV2.comPort.BaseStream.IsOpen)
|
||||
{
|
||||
this.Enabled = false;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Enabled = true;
|
||||
}
|
||||
timer.Stop();
|
||||
}
|
||||
|
||||
public void Activate()
|
||||
{
|
||||
if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane) // APM
|
||||
{
|
||||
CB_simple1.Visible = false;
|
||||
|
||||
-1
@@ -79,7 +79,6 @@
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.Name = "ConfigFriendlyParams";
|
||||
this.Size = new System.Drawing.Size(673, 177);
|
||||
this.Load += new System.EventHandler(this.ConfigRawParamsV2_Load);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ using log4net;
|
||||
|
||||
namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
{
|
||||
public partial class ConfigFriendlyParams : BackStageViewContentPanel
|
||||
public partial class ConfigFriendlyParams : UserControl, IActivate
|
||||
{
|
||||
#region Class Fields
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
|
||||
protected void ConfigRawParamsV2_Load(object sender, EventArgs e)
|
||||
public void Activate()
|
||||
{
|
||||
BindParamList();
|
||||
}
|
||||
@@ -297,6 +297,8 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
catch (Exception ex) { log.Error(ex); }
|
||||
}
|
||||
});
|
||||
|
||||
ThemeManager.ApplyThemeTo(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
-1
@@ -191,7 +191,6 @@
|
||||
this.Controls.Add(this.pictureBox3);
|
||||
this.Controls.Add(this.pictureBox1);
|
||||
this.Name = "ConfigHardwareOptions";
|
||||
this.Load += new System.EventHandler(this.ConfigHardwareOptions_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
|
||||
|
||||
@@ -11,7 +11,7 @@ using ArdupilotMega.Controls;
|
||||
|
||||
namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
{
|
||||
public partial class ConfigHardwareOptions : BackStageViewContentPanel
|
||||
public partial class ConfigHardwareOptions : UserControl, IActivate
|
||||
{
|
||||
bool startup = false;
|
||||
|
||||
@@ -233,7 +233,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
catch { CustomMessageBox.Show("Set SONAR_TYPE Failed"); }
|
||||
}
|
||||
|
||||
private void ConfigHardwareOptions_Load(object sender, EventArgs e)
|
||||
public void Activate()
|
||||
{
|
||||
if (!MainV2.comPort.BaseStream.IsOpen)
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
-1
@@ -269,7 +269,6 @@
|
||||
this.Controls.Add(this.BARyaw);
|
||||
this.Controls.Add(this.BARroll);
|
||||
this.Name = "ConfigRadioInput";
|
||||
this.Load += new System.EventHandler(this.ConfigRadioInput_Load);
|
||||
this.groupBoxElevons.ResumeLayout(false);
|
||||
this.groupBoxElevons.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.currentStateBindingSource)).EndInit();
|
||||
|
||||
@@ -11,7 +11,7 @@ using ArdupilotMega.Controls;
|
||||
|
||||
namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
{
|
||||
public partial class ConfigRadioInput : BackStageViewContentPanel
|
||||
public partial class ConfigRadioInput : UserControl, IActivate, IDeactivate
|
||||
{
|
||||
bool startup = false;
|
||||
bool run = false;
|
||||
@@ -36,10 +36,11 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
|
||||
// setup rc update
|
||||
timer.Tick += new EventHandler(timer_Tick);
|
||||
}
|
||||
|
||||
timer.Enabled = true;
|
||||
timer.Interval = 100;
|
||||
timer.Start();
|
||||
public void Deactivate()
|
||||
{
|
||||
timer.Stop();
|
||||
}
|
||||
|
||||
void timer_Tick(object sender, EventArgs e)
|
||||
@@ -52,17 +53,11 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void ConfigRadioInput_Load(object sender, EventArgs e)
|
||||
public void Activate()
|
||||
{
|
||||
if (!MainV2.comPort.BaseStream.IsOpen)
|
||||
{
|
||||
this.Enabled = false;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Enabled = true;
|
||||
}
|
||||
timer.Enabled = true;
|
||||
timer.Interval = 100;
|
||||
timer.Start();
|
||||
|
||||
startup = true;
|
||||
|
||||
|
||||
-1
@@ -151,7 +151,6 @@
|
||||
this.Controls.Add(this.BUT_load);
|
||||
this.Controls.Add(this.Params);
|
||||
this.Name = "ConfigRawParams";
|
||||
this.Load += new System.EventHandler(this.ConfigRawParams_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.Params)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ using ArdupilotMega.Controls.BackstageView;
|
||||
|
||||
namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
{
|
||||
public partial class ConfigRawParams : BackStageViewContentPanel
|
||||
public partial class ConfigRawParams : UserControl, IActivate
|
||||
{
|
||||
private static readonly ILog log =
|
||||
LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
@@ -424,7 +424,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
Params.Sort(Params.Columns[0], ListSortDirection.Ascending);
|
||||
}
|
||||
|
||||
private void ConfigRawParams_Load(object sender, EventArgs e)
|
||||
public void Activate()
|
||||
{
|
||||
// read tooltips
|
||||
if (tooltips.Count == 0)
|
||||
|
||||
-2
@@ -685,8 +685,6 @@
|
||||
this.Controls.Add(this.HS3);
|
||||
this.Controls.Add(this.Gservoloc);
|
||||
this.Name = "ConfigTradHeli";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ConfigTradHeli_FormClosing);
|
||||
this.Load += new System.EventHandler(this.ConfigTradHeli_Load);
|
||||
this.groupBox5.ResumeLayout(false);
|
||||
this.groupBox5.PerformLayout();
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
|
||||
@@ -11,7 +11,7 @@ using ArdupilotMega.Controls;
|
||||
|
||||
namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
{
|
||||
public partial class ConfigTradHeli : BackStageViewContentPanel
|
||||
public partial class ConfigTradHeli : UserControl, IActivate, IDeactivate
|
||||
{
|
||||
bool startup = false;
|
||||
bool inpwmdetect = false;
|
||||
@@ -368,17 +368,8 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
MainV2.comPort.setParam(((CheckBox)sender).Name, ((CheckBox)sender).Checked == true ? 1.0f : 0.0f);
|
||||
}
|
||||
|
||||
private void ConfigTradHeli_Load(object sender, EventArgs e)
|
||||
public void Activate()
|
||||
{
|
||||
if (!MainV2.comPort.BaseStream.IsOpen)
|
||||
{
|
||||
this.Enabled = false;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Enabled = true;
|
||||
}
|
||||
|
||||
if (MainV2.comPort.param["H_GYR_ENABLE"] == null)
|
||||
{
|
||||
@@ -487,8 +478,10 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
}
|
||||
}
|
||||
|
||||
private void ConfigTradHeli_FormClosing(object sender, FormClosingEventArgs e)
|
||||
public void Deactivate()
|
||||
{
|
||||
timer.Stop();
|
||||
|
||||
startup = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,18 +25,22 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
if (MainV2.comPort.BaseStream.IsOpen)
|
||||
{
|
||||
AddPagesForConnectedState();
|
||||
// backstageView.AddSpacer(20);
|
||||
}
|
||||
|
||||
// These pages work when not connected to an APM
|
||||
AddBackstageViewPage(new ArdupilotMega._3DRradio(), "3DR Radio");
|
||||
AddBackstageViewPage(new ArdupilotMega.Antenna.Tracker(), "Antenna Tracker");
|
||||
//backstageView.AddSpacer(15);
|
||||
AddBackstageViewPage(new ConfigPlanner(), "Planner");
|
||||
|
||||
this.backstageView.ActivatePage(backstageView.Pages[0]);
|
||||
|
||||
if (!MainV2.comPort.BaseStream.IsOpen)
|
||||
{
|
||||
Common.MessageShowAgain("Config Connect", "Please connect (click Connect Button) before using setup!!");
|
||||
ThemeManager.ApplyThemeTo(this);
|
||||
Common.MessageShowAgain("Config Connect", @"Please connect (click Connect Button) before using setup.
|
||||
If you are just setting up 3DR radios, you may continue without connecting.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,8 +65,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
|
||||
AddBackstageViewPage(new ConfigTradHeli(), "Heli Setup");
|
||||
|
||||
var configpanel = new Controls.ConfigPanel();
|
||||
configpanel.LoadXML("ArduCopterConfig.xml");
|
||||
var configpanel = new Controls.ConfigPanel(Application.StartupPath + System.IO.Path.DirectorySeparatorChar + "ArduCopterConfig.xml");
|
||||
AddBackstageViewPage(configpanel, "ArduCopter Pids");
|
||||
|
||||
AddBackstageViewPage(new ConfigArducopter(), "ArduCopter Config");
|
||||
@@ -74,8 +77,7 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
|
||||
AddBackstageViewPage(new ConfigAccelerometerCalibrationQuad(), "ArduCopter Level");
|
||||
|
||||
var configpanel = new Controls.ConfigPanel();
|
||||
configpanel.LoadXML("ArduCopterConfig.xml");
|
||||
var configpanel = new Controls.ConfigPanel(Application.StartupPath + System.IO.Path.DirectorySeparatorChar + "ArduCopterConfig.xml");
|
||||
AddBackstageViewPage(configpanel, "ArduCopter Pids");
|
||||
|
||||
AddBackstageViewPage(new ConfigArducopter(), "ArduCopter Config");
|
||||
@@ -99,9 +101,9 @@ namespace ArdupilotMega.GCSViews.ConfigurationView
|
||||
AddBackstageViewPage(new ConfigRawParams(), "Parameter List");
|
||||
}
|
||||
|
||||
private void AddBackstageViewPage(BackStageViewContentPanel userControl, string headerText)
|
||||
private void AddBackstageViewPage(UserControl userControl, string headerText)
|
||||
{
|
||||
backstageView.AddPage(new BackstageView.BackstageViewPage(userControl, headerText));
|
||||
backstageView.AddPage(userControl, headerText);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1161,6 +1161,7 @@
|
||||
this.Controls.Add(this.label6);
|
||||
this.MinimumSize = new System.Drawing.Size(1008, 461);
|
||||
this.Name = "FlightData";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FlightData_FormClosing);
|
||||
this.Load += new System.EventHandler(this.FlightData_Load);
|
||||
this.Resize += new System.EventHandler(this.FlightData_Resize);
|
||||
this.ParentChanged += new System.EventHandler(this.FlightData_ParentChanged);
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
+19
-10
@@ -111,13 +111,13 @@
|
||||
this.jumpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.jumpstartToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.jumpwPToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.createWpCircleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.ContextMeasure = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.rotateMapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.polygonToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.addPolygonPointToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.clearPolygonToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.clearMissionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.geoFenceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
|
||||
@@ -126,6 +126,7 @@
|
||||
this.setReturnLocationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.loadFromFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.saveToFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.clearMissionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.trackBar1 = new ArdupilotMega.Controls.MyTrackBar();
|
||||
this.label11 = new System.Windows.Forms.Label();
|
||||
this.panelBASE = new System.Windows.Forms.Panel();
|
||||
@@ -721,12 +722,13 @@
|
||||
this.deleteWPToolStripMenuItem,
|
||||
this.loiterToolStripMenuItem,
|
||||
this.jumpToolStripMenuItem,
|
||||
this.createWpCircleToolStripMenuItem,
|
||||
this.toolStripSeparator1,
|
||||
this.ContextMeasure,
|
||||
this.rotateMapToolStripMenuItem,
|
||||
this.polygonToolStripMenuItem,
|
||||
this.clearMissionToolStripMenuItem,
|
||||
this.geoFenceToolStripMenuItem});
|
||||
this.geoFenceToolStripMenuItem,
|
||||
this.clearMissionToolStripMenuItem});
|
||||
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
||||
resources.ApplyResources(this.contextMenuStrip1, "contextMenuStrip1");
|
||||
//
|
||||
@@ -783,6 +785,12 @@
|
||||
resources.ApplyResources(this.jumpwPToolStripMenuItem, "jumpwPToolStripMenuItem");
|
||||
this.jumpwPToolStripMenuItem.Click += new System.EventHandler(this.jumpwPToolStripMenuItem_Click);
|
||||
//
|
||||
// createWpCircleToolStripMenuItem
|
||||
//
|
||||
this.createWpCircleToolStripMenuItem.Name = "createWpCircleToolStripMenuItem";
|
||||
resources.ApplyResources(this.createWpCircleToolStripMenuItem, "createWpCircleToolStripMenuItem");
|
||||
this.createWpCircleToolStripMenuItem.Click += new System.EventHandler(this.createWpCircleToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
@@ -820,12 +828,6 @@
|
||||
resources.ApplyResources(this.clearPolygonToolStripMenuItem, "clearPolygonToolStripMenuItem");
|
||||
this.clearPolygonToolStripMenuItem.Click += new System.EventHandler(this.clearPolygonToolStripMenuItem_Click);
|
||||
//
|
||||
// clearMissionToolStripMenuItem
|
||||
//
|
||||
this.clearMissionToolStripMenuItem.Name = "clearMissionToolStripMenuItem";
|
||||
resources.ApplyResources(this.clearMissionToolStripMenuItem, "clearMissionToolStripMenuItem");
|
||||
this.clearMissionToolStripMenuItem.Click += new System.EventHandler(this.clearMissionToolStripMenuItem_Click);
|
||||
//
|
||||
// geoFenceToolStripMenuItem
|
||||
//
|
||||
this.geoFenceToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
@@ -879,6 +881,12 @@
|
||||
resources.ApplyResources(this.saveToFileToolStripMenuItem, "saveToFileToolStripMenuItem");
|
||||
this.saveToFileToolStripMenuItem.Click += new System.EventHandler(this.saveToFileToolStripMenuItem_Click);
|
||||
//
|
||||
// clearMissionToolStripMenuItem
|
||||
//
|
||||
this.clearMissionToolStripMenuItem.Name = "clearMissionToolStripMenuItem";
|
||||
resources.ApplyResources(this.clearMissionToolStripMenuItem, "clearMissionToolStripMenuItem");
|
||||
this.clearMissionToolStripMenuItem.Click += new System.EventHandler(this.clearMissionToolStripMenuItem_Click);
|
||||
//
|
||||
// trackBar1
|
||||
//
|
||||
resources.ApplyResources(this.trackBar1, "trackBar1");
|
||||
@@ -911,7 +919,6 @@
|
||||
//
|
||||
// timer1
|
||||
//
|
||||
this.timer1.Enabled = true;
|
||||
this.timer1.Interval = 1000;
|
||||
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
|
||||
//
|
||||
@@ -923,6 +930,7 @@
|
||||
this.Controls.Add(this.panelBASE);
|
||||
this.MinimumSize = new System.Drawing.Size(1008, 461);
|
||||
this.Name = "FlightPlanner";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FlightPlanner_FormClosing);
|
||||
this.Load += new System.EventHandler(this.Planner_Load);
|
||||
this.Resize += new System.EventHandler(this.Planner_Resize);
|
||||
((System.ComponentModel.ISupportInitialize)(this.Commands)).EndInit();
|
||||
@@ -1037,5 +1045,6 @@
|
||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
|
||||
private System.Windows.Forms.ToolStripMenuItem GeoFenceuploadToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
|
||||
private System.Windows.Forms.ToolStripMenuItem createWpCircleToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
@@ -23,11 +23,12 @@ using SharpKml.Base;
|
||||
using SharpKml.Dom;
|
||||
using ArdupilotMega.Controls;
|
||||
using ArdupilotMega.Utilities;
|
||||
using ArdupilotMega.Controls.BackstageView;
|
||||
|
||||
|
||||
namespace ArdupilotMega.GCSViews
|
||||
{
|
||||
partial class FlightPlanner : MyUserControl
|
||||
partial class FlightPlanner : MyUserControl, IDeactivate
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
int selectedrow = 0;
|
||||
@@ -697,6 +698,8 @@ namespace ArdupilotMega.GCSViews
|
||||
panelMap_Resize(null, null);
|
||||
|
||||
writeKML();
|
||||
|
||||
timer1.Start();
|
||||
}
|
||||
|
||||
void parser_ElementAdded(object sender, SharpKml.Base.ElementEventArgs e)
|
||||
@@ -1223,7 +1226,7 @@ namespace ArdupilotMega.GCSViews
|
||||
|
||||
try
|
||||
{
|
||||
IMAVLink port = MainV2.comPort;
|
||||
MAVLink port = MainV2.comPort;
|
||||
|
||||
if (!port.BaseStream.IsOpen)
|
||||
{
|
||||
@@ -1256,12 +1259,13 @@ namespace ArdupilotMega.GCSViews
|
||||
catch (Exception ex) { error = 1; CustomMessageBox.Show("Error : " + ex.ToString()); }
|
||||
try
|
||||
{
|
||||
this.BeginInvoke((MethodInvoker)delegate()
|
||||
this.Invoke((MethodInvoker)delegate()
|
||||
{
|
||||
if (error == 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
log.Info("Process " + cmds.Count);
|
||||
processToScreen(cmds);
|
||||
}
|
||||
catch (Exception exx) { log.Info(exx.ToString()); }
|
||||
@@ -1332,7 +1336,7 @@ namespace ArdupilotMega.GCSViews
|
||||
{
|
||||
try
|
||||
{
|
||||
IMAVLink port = MainV2.comPort;
|
||||
MAVLink port = MainV2.comPort;
|
||||
|
||||
if (!port.BaseStream.IsOpen)
|
||||
{
|
||||
@@ -1430,7 +1434,9 @@ namespace ArdupilotMega.GCSViews
|
||||
void processToScreen(List<Locationwp> cmds)
|
||||
{
|
||||
quickadd = true;
|
||||
Commands.Rows.Clear();
|
||||
|
||||
while (Commands.Rows.Count > 0)
|
||||
Commands.Rows.RemoveAt(0);
|
||||
|
||||
if (cmds.Count == 0)
|
||||
{
|
||||
@@ -1500,25 +1506,6 @@ namespace ArdupilotMega.GCSViews
|
||||
}
|
||||
try
|
||||
{
|
||||
DataGridViewTextBoxCell cellhome;
|
||||
cellhome = Commands.Rows[0].Cells[Lat.Index] as DataGridViewTextBoxCell;
|
||||
if (cellhome.Value != null)
|
||||
{
|
||||
if (cellhome.Value.ToString() != TXT_homelat.Text && cellhome.Value.ToString() != "0")
|
||||
{
|
||||
DialogResult dr = CustomMessageBox.Show("Reset Home to loaded coords", "Reset Home Coords", MessageBoxButtons.YesNo);
|
||||
|
||||
if (dr == DialogResult.Yes)
|
||||
{
|
||||
TXT_homelat.Text = (double.Parse(cellhome.Value.ToString())).ToString();
|
||||
cellhome = Commands.Rows[0].Cells[Lon.Index] as DataGridViewTextBoxCell;
|
||||
TXT_homelng.Text = (double.Parse(cellhome.Value.ToString())).ToString();
|
||||
cellhome = Commands.Rows[0].Cells[Alt.Index] as DataGridViewTextBoxCell;
|
||||
TXT_homealt.Text = (double.Parse(cellhome.Value.ToString()) * MainV2.cs.multiplierdist).ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
log.Info("Setting wp params");
|
||||
|
||||
string hold_alt = ((int)((float)param["ALT_HOLD_RTL"] * MainV2.cs.multiplierdist)).ToString();
|
||||
@@ -1551,6 +1538,26 @@ namespace ArdupilotMega.GCSViews
|
||||
CHK_holdalt.Checked = Convert.ToBoolean((float)param["ALT_HOLD_RTL"] > 0);
|
||||
log.Info("param ALT_HOLD_RTL " + CHK_holdalt.Checked.ToString());
|
||||
|
||||
|
||||
|
||||
DataGridViewTextBoxCell cellhome;
|
||||
cellhome = Commands.Rows[0].Cells[Lat.Index] as DataGridViewTextBoxCell;
|
||||
if (cellhome.Value != null)
|
||||
{
|
||||
if (cellhome.Value.ToString() != TXT_homelat.Text && cellhome.Value.ToString() != "0")
|
||||
{
|
||||
DialogResult dr = CustomMessageBox.Show("Reset Home to loaded coords", "Reset Home Coords", MessageBoxButtons.YesNo);
|
||||
|
||||
if (dr == DialogResult.Yes)
|
||||
{
|
||||
TXT_homelat.Text = (double.Parse(cellhome.Value.ToString())).ToString();
|
||||
cellhome = Commands.Rows[0].Cells[Lon.Index] as DataGridViewTextBoxCell;
|
||||
TXT_homelng.Text = (double.Parse(cellhome.Value.ToString())).ToString();
|
||||
cellhome = Commands.Rows[0].Cells[Alt.Index] as DataGridViewTextBoxCell;
|
||||
TXT_homealt.Text = (double.Parse(cellhome.Value.ToString()) * MainV2.cs.multiplierdist).ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex) { log.Info(ex.ToString()); } // if there is no valid home
|
||||
|
||||
@@ -2840,7 +2847,8 @@ namespace ArdupilotMega.GCSViews
|
||||
|
||||
private void clearMissionToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Commands.Rows.Clear();
|
||||
while (Commands.Rows.Count > 0)
|
||||
Commands.Rows.RemoveAt(0);
|
||||
selectedrow = 0;
|
||||
writeKML();
|
||||
}
|
||||
@@ -3394,5 +3402,66 @@ namespace ArdupilotMega.GCSViews
|
||||
return (T)formatter.Deserialize(ms);
|
||||
}
|
||||
}
|
||||
|
||||
private void createWpCircleToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
string RadiusIn = "50";
|
||||
Common.InputBox("Radius", "Radius", ref RadiusIn);
|
||||
|
||||
string Pointsin = "20";
|
||||
Common.InputBox("Points", "Number of points to generate Circle", ref Pointsin);
|
||||
|
||||
int Points = 0;
|
||||
int Radius = 0;
|
||||
|
||||
if (!int.TryParse(RadiusIn, out Radius))
|
||||
{
|
||||
CustomMessageBox.Show("Bad Radius");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!int.TryParse(Pointsin, out Points))
|
||||
{
|
||||
CustomMessageBox.Show("Bad Point value");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
for (double a = 0; a <= 360; a += 360.0f / Points)
|
||||
{
|
||||
|
||||
selectedrow = Commands.Rows.Add();
|
||||
|
||||
Commands.Rows[selectedrow].Cells[Command.Index].Value = MAVLink.MAV_CMD.WAYPOINT.ToString();
|
||||
|
||||
ChangeColumnHeader(MAVLink.MAV_CMD.WAYPOINT.ToString());
|
||||
|
||||
float d = Radius;
|
||||
float R = 6371000;
|
||||
|
||||
var lat2 = Math.Asin(Math.Sin(end.Lat * deg2rad) * Math.Cos(d / R) +
|
||||
Math.Cos(end.Lat * deg2rad) * Math.Sin(d / R) * Math.Cos(a * deg2rad));
|
||||
var lon2 = end.Lng * deg2rad + Math.Atan2(Math.Sin(a * deg2rad) * Math.Sin(d / R) * Math.Cos(end.Lat * deg2rad),
|
||||
Math.Cos(d / R) - Math.Sin(end.Lat * deg2rad) * Math.Sin(lat2));
|
||||
|
||||
PointLatLng pll = new PointLatLng(lat2 * rad2deg, lon2 * rad2deg);
|
||||
|
||||
setfromGE(pll.Lat, pll.Lng, (int)float.Parse(TXT_DefaultAlt.Text));
|
||||
|
||||
}
|
||||
|
||||
//drawnpolygon.Points.Add(new PointLatLng(start.Lat, start.Lng));
|
||||
}
|
||||
|
||||
public void Deactivate()
|
||||
{
|
||||
timer1.Stop();
|
||||
}
|
||||
|
||||
private void FlightPlanner_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
timer1.Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -556,7 +556,7 @@
|
||||
<value>BUT_write</value>
|
||||
</data>
|
||||
<data name=">>BUT_write.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4579.33184, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>BUT_write.Parent" xml:space="preserve">
|
||||
<value>panel5</value>
|
||||
@@ -583,7 +583,7 @@
|
||||
<value>BUT_read</value>
|
||||
</data>
|
||||
<data name=">>BUT_read.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4579.33184, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>BUT_read.Parent" xml:space="preserve">
|
||||
<value>panel5</value>
|
||||
@@ -610,7 +610,7 @@
|
||||
<value>SaveFile</value>
|
||||
</data>
|
||||
<data name=">>SaveFile.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4579.33184, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>SaveFile.Parent" xml:space="preserve">
|
||||
<value>panel5</value>
|
||||
@@ -637,7 +637,7 @@
|
||||
<value>BUT_loadwpfile</value>
|
||||
</data>
|
||||
<data name=">>BUT_loadwpfile.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4579.33184, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>BUT_loadwpfile.Parent" xml:space="preserve">
|
||||
<value>panel5</value>
|
||||
@@ -1261,7 +1261,7 @@
|
||||
<value>BUT_loadkml</value>
|
||||
</data>
|
||||
<data name=">>BUT_loadkml.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4579.33184, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>BUT_loadkml.Parent" xml:space="preserve">
|
||||
<value>panelWaypoints</value>
|
||||
@@ -1291,7 +1291,7 @@
|
||||
<value>BUT_zoomto</value>
|
||||
</data>
|
||||
<data name=">>BUT_zoomto.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4579.33184, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>BUT_zoomto.Parent" xml:space="preserve">
|
||||
<value>panelWaypoints</value>
|
||||
@@ -1321,7 +1321,7 @@
|
||||
<value>BUT_Camera</value>
|
||||
</data>
|
||||
<data name=">>BUT_Camera.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4579.33184, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>BUT_Camera.Parent" xml:space="preserve">
|
||||
<value>panelWaypoints</value>
|
||||
@@ -1351,7 +1351,7 @@
|
||||
<value>BUT_grid</value>
|
||||
</data>
|
||||
<data name=">>BUT_grid.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4579.33184, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>BUT_grid.Parent" xml:space="preserve">
|
||||
<value>panelWaypoints</value>
|
||||
@@ -1381,7 +1381,7 @@
|
||||
<value>BUT_Prefetch</value>
|
||||
</data>
|
||||
<data name=">>BUT_Prefetch.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4579.33184, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>BUT_Prefetch.Parent" xml:space="preserve">
|
||||
<value>panelWaypoints</value>
|
||||
@@ -1411,7 +1411,7 @@
|
||||
<value>button1</value>
|
||||
</data>
|
||||
<data name=">>button1.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4579.33184, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>button1.Parent" xml:space="preserve">
|
||||
<value>panelWaypoints</value>
|
||||
@@ -1441,7 +1441,7 @@
|
||||
<value>BUT_Add</value>
|
||||
</data>
|
||||
<data name=">>BUT_Add.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4579.33184, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>BUT_Add.Parent" xml:space="preserve">
|
||||
<value>panelWaypoints</value>
|
||||
@@ -1647,6 +1647,12 @@
|
||||
<data name="jumpToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>Jump</value>
|
||||
</data>
|
||||
<data name="createWpCircleToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>167, 22</value>
|
||||
</data>
|
||||
<data name="createWpCircleToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>Create Wp Circle</value>
|
||||
</data>
|
||||
<data name="toolStripSeparator1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>164, 6</value>
|
||||
</data>
|
||||
@@ -1680,12 +1686,6 @@
|
||||
<data name="polygonToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>Draw Polygon</value>
|
||||
</data>
|
||||
<data name="clearMissionToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>167, 22</value>
|
||||
</data>
|
||||
<data name="clearMissionToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>Clear Mission</value>
|
||||
</data>
|
||||
<data name="toolStripMenuItem1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>177, 22</value>
|
||||
</data>
|
||||
@@ -1731,8 +1731,14 @@
|
||||
<data name="geoFenceToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>Geo-Fence</value>
|
||||
</data>
|
||||
<data name="clearMissionToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>167, 22</value>
|
||||
</data>
|
||||
<data name="clearMissionToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>Clear Mission</value>
|
||||
</data>
|
||||
<data name="contextMenuStrip1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>168, 208</value>
|
||||
<value>168, 230</value>
|
||||
</data>
|
||||
<data name=">>contextMenuStrip1.Name" xml:space="preserve">
|
||||
<value>contextMenuStrip1</value>
|
||||
@@ -1898,7 +1904,7 @@
|
||||
<value>MainMap</value>
|
||||
</data>
|
||||
<data name=">>MainMap.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.myGMAP, ArdupilotMegaPlanner10, Version=1.1.4579.33184, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.myGMAP, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>MainMap.Parent" xml:space="preserve">
|
||||
<value>panelMap</value>
|
||||
@@ -1928,7 +1934,7 @@
|
||||
<value>trackBar1</value>
|
||||
</data>
|
||||
<data name=">>trackBar1.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.MyTrackBar, ArdupilotMegaPlanner10, Version=1.1.4579.33184, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.MyTrackBar, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>trackBar1.Parent" xml:space="preserve">
|
||||
<value>panelMap</value>
|
||||
@@ -2161,6 +2167,12 @@
|
||||
<data name=">>jumpwPToolStripMenuItem.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>createWpCircleToolStripMenuItem.Name" xml:space="preserve">
|
||||
<value>createWpCircleToolStripMenuItem</value>
|
||||
</data>
|
||||
<data name=">>createWpCircleToolStripMenuItem.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>toolStripSeparator1.Name" xml:space="preserve">
|
||||
<value>toolStripSeparator1</value>
|
||||
</data>
|
||||
@@ -2197,12 +2209,6 @@
|
||||
<data name=">>clearPolygonToolStripMenuItem.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>clearMissionToolStripMenuItem.Name" xml:space="preserve">
|
||||
<value>clearMissionToolStripMenuItem</value>
|
||||
</data>
|
||||
<data name=">>clearMissionToolStripMenuItem.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>geoFenceToolStripMenuItem.Name" xml:space="preserve">
|
||||
<value>geoFenceToolStripMenuItem</value>
|
||||
</data>
|
||||
@@ -2251,6 +2257,12 @@
|
||||
<data name=">>saveToFileToolStripMenuItem.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>clearMissionToolStripMenuItem.Name" xml:space="preserve">
|
||||
<value>clearMissionToolStripMenuItem</value>
|
||||
</data>
|
||||
<data name=">>clearMissionToolStripMenuItem.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>toolTip1.Name" xml:space="preserve">
|
||||
<value>toolTip1</value>
|
||||
</data>
|
||||
@@ -2267,6 +2279,6 @@
|
||||
<value>FlightPlanner</value>
|
||||
</data>
|
||||
<data name=">>$this.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.MyUserControl, ArdupilotMegaPlanner10, Version=1.1.4579.33184, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>System.Windows.Forms.MyUserControl, ArdupilotMegaPlanner10, Version=1.1.4582.39185, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
</root>
|
||||
+1
-8
@@ -40,7 +40,6 @@
|
||||
this.TXT_pitch = new ArdupilotMega.Controls.MyLabel();
|
||||
this.TXT_heading = new ArdupilotMega.Controls.MyLabel();
|
||||
this.TXT_wpdist = new ArdupilotMega.Controls.MyLabel();
|
||||
this.currentStateBindingSource = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.TXT_bererror = new ArdupilotMega.Controls.MyLabel();
|
||||
this.TXT_alterror = new ArdupilotMega.Controls.MyLabel();
|
||||
this.TXT_lat = new ArdupilotMega.Controls.MyLabel();
|
||||
@@ -114,7 +113,6 @@
|
||||
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.RAD_JSBSim = new System.Windows.Forms.RadioButton();
|
||||
this.CHK_xplane10 = new System.Windows.Forms.CheckBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.currentStateBindingSource)).BeginInit();
|
||||
this.panel1.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
this.panel3.SuspendLayout();
|
||||
@@ -200,10 +198,6 @@
|
||||
this.TXT_wpdist.Name = "TXT_wpdist";
|
||||
this.TXT_wpdist.resize = false;
|
||||
//
|
||||
// currentStateBindingSource
|
||||
//
|
||||
this.currentStateBindingSource.DataSource = typeof(ArdupilotMega.CurrentState);
|
||||
//
|
||||
// TXT_bererror
|
||||
//
|
||||
resources.ApplyResources(this.TXT_bererror, "TXT_bererror");
|
||||
@@ -743,8 +737,8 @@
|
||||
this.Controls.Add(this.CHKREV_pitch);
|
||||
this.Controls.Add(this.CHKREV_roll);
|
||||
this.Name = "Simulation";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Simulation_FormClosing);
|
||||
this.Load += new System.EventHandler(this.Simulation_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.currentStateBindingSource)).EndInit();
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.panel3.ResumeLayout(false);
|
||||
@@ -833,7 +827,6 @@
|
||||
private ArdupilotMega.Controls.MyLabel TXT_yaw;
|
||||
private ArdupilotMega.Controls.MyButton but_advsettings;
|
||||
private System.Windows.Forms.CheckBox chkSensor;
|
||||
private System.Windows.Forms.BindingSource currentStateBindingSource;
|
||||
private System.Windows.Forms.CheckBox CHK_quad;
|
||||
private ArdupilotMega.Controls.MyButton BUT_startfgquad;
|
||||
private ArdupilotMega.Controls.MyButton BUT_startfgplane;
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace ArdupilotMega.GCSViews
|
||||
public partial class Simulation : MyUserControl
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
IMAVLink comPort = MainV2.comPort;
|
||||
MAVLink comPort = MainV2.comPort;
|
||||
UdpClient XplanesSEND;
|
||||
UdpClient MavLink;
|
||||
Socket SimulatorRECV;
|
||||
@@ -263,6 +263,8 @@ namespace ArdupilotMega.GCSViews
|
||||
|
||||
private void Simulation_Load(object sender, EventArgs e)
|
||||
{
|
||||
timer_servo_graph.Stop();
|
||||
|
||||
GPSrate.SelectedIndex = 2;
|
||||
|
||||
xmlconfig(false);
|
||||
@@ -725,7 +727,7 @@ namespace ArdupilotMega.GCSViews
|
||||
/// <param name="data">Packet</param>
|
||||
/// <param name="receviedbytes">Length</param>
|
||||
/// <param name="comPort">Com Port</param>
|
||||
private void RECVprocess(byte[] data, int receviedbytes, ArdupilotMega.IMAVLink comPort)
|
||||
private void RECVprocess(byte[] data, int receviedbytes, ArdupilotMega.MAVLink comPort)
|
||||
{
|
||||
#if MAVLINK10
|
||||
ArdupilotMega.MAVLink.mavlink_hil_state_t hilstate = new ArdupilotMega.MAVLink.mavlink_hil_state_t();
|
||||
@@ -2190,5 +2192,10 @@ namespace ArdupilotMega.GCSViews
|
||||
CHKgraphthrottle.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void Simulation_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
timer_servo_graph.Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -147,10 +147,15 @@ namespace ArdupilotMega.GCSViews
|
||||
{
|
||||
threadrun = false;
|
||||
|
||||
if (comPort.IsOpen)
|
||||
try
|
||||
{
|
||||
comPort.Close();
|
||||
if (comPort.IsOpen)
|
||||
{
|
||||
comPort.Close();
|
||||
}
|
||||
}
|
||||
catch { } // Exception System.IO.IOException: The specified port does not exist.
|
||||
|
||||
System.Threading.Thread.Sleep(400);
|
||||
|
||||
MainV2.giveComport = false;
|
||||
|
||||
+1
@@ -77,6 +77,7 @@
|
||||
// TXT_status
|
||||
//
|
||||
resources.ApplyResources(this.TXT_status, "TXT_status");
|
||||
this.TXT_status.ForeColor = System.Drawing.Color.Red;
|
||||
this.TXT_status.Name = "TXT_status";
|
||||
//
|
||||
// BUT_redokml
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
<value>BUT_DLall</value>
|
||||
</data>
|
||||
<data name=">>BUT_DLall.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4537.26254, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4583.40805, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>BUT_DLall.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
@@ -183,7 +183,7 @@
|
||||
<value>BUT_DLthese</value>
|
||||
</data>
|
||||
<data name=">>BUT_DLthese.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4537.26254, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4583.40805, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>BUT_DLthese.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
@@ -207,7 +207,7 @@
|
||||
<value>BUT_clearlogs</value>
|
||||
</data>
|
||||
<data name=">>BUT_clearlogs.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4537.26254, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4583.40805, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>BUT_clearlogs.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
@@ -276,7 +276,7 @@
|
||||
<value>BUT_redokml</value>
|
||||
</data>
|
||||
<data name=">>BUT_redokml.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4537.26254, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4583.40805, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>BUT_redokml.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
@@ -300,7 +300,7 @@
|
||||
<value>BUT_firstperson</value>
|
||||
</data>
|
||||
<data name=">>BUT_firstperson.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4537.26254, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4583.40805, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>BUT_firstperson.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
@@ -328,7 +328,7 @@
|
||||
<value>BUT_dumpdf</value>
|
||||
</data>
|
||||
<data name=">>BUT_dumpdf.Type" xml:space="preserve">
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner, Version=1.1.4537.26254, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ArdupilotMega.Controls.MyButton, ArdupilotMegaPlanner10, Version=1.1.4583.40805, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>BUT_dumpdf.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace ArdupilotMega
|
||||
/// <summary>
|
||||
/// Main Comport interface
|
||||
/// </summary>
|
||||
public static IMAVLink comPort = new MAVLink();
|
||||
public static MAVLink comPort = new MAVLink();
|
||||
/// <summary>
|
||||
/// Comport name
|
||||
/// </summary>
|
||||
@@ -90,10 +90,6 @@ namespace ArdupilotMega
|
||||
/// </summary>
|
||||
bool serialThread = false;
|
||||
/// <summary>
|
||||
/// unused at this point - potential to move all forms to this single binding source. need to evalutate performance/exception issues
|
||||
/// </summary>
|
||||
static internal BindingSource bs;
|
||||
/// <summary>
|
||||
/// used for mini https server for websockets/mjpeg video stream, and network link kmls
|
||||
/// </summary>
|
||||
private TcpListener listener;
|
||||
@@ -977,7 +973,7 @@ namespace ArdupilotMega
|
||||
this.MenuConnect.BackgroundImage = global::ArdupilotMega.Properties.Resources.connect;
|
||||
this.MenuConnect.BackgroundImage.Tag = "Connect";
|
||||
_connectionControl.IsConnected(false);
|
||||
if (_connectionStats != null)
|
||||
if (_connectionStats != null)
|
||||
{
|
||||
_connectionStats.StopUpdates();
|
||||
}
|
||||
@@ -990,7 +986,7 @@ namespace ArdupilotMega
|
||||
{
|
||||
_connectionControl.IsConnected(true);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
connectButtonUpdate = DateTime.Now;
|
||||
}
|
||||
@@ -1014,8 +1010,8 @@ namespace ArdupilotMega
|
||||
|
||||
int minbytes = 10;
|
||||
|
||||
if (MONO)
|
||||
minbytes = 0;
|
||||
// if (MONO)
|
||||
// minbytes = 0;
|
||||
|
||||
DateTime speechcustomtime = DateTime.Now;
|
||||
|
||||
@@ -1081,8 +1077,7 @@ namespace ArdupilotMega
|
||||
MainV2.cs.linkqualitygcs = (ushort)(MainV2.cs.linkqualitygcs * 0.8f);
|
||||
linkqualitytime = DateTime.Now;
|
||||
|
||||
int fixme;
|
||||
//GCSViews.FlightData.myhud.Invalidate();
|
||||
GCSViews.FlightData.myhud.Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1116,16 +1111,19 @@ namespace ArdupilotMega
|
||||
}
|
||||
}
|
||||
|
||||
//Console.WriteLine(DateTime.Now.Millisecond + " " + comPort.BaseStream.BytesToRead);
|
||||
// Console.WriteLine(DateTime.Now.Millisecond + " " + comPort.BaseStream.BytesToRead);
|
||||
|
||||
while (comPort.BaseStream.BytesToRead > minbytes && giveComport == false)
|
||||
{
|
||||
//Console.WriteLine(DateTime.Now.Millisecond + " SR1 " + comPort.BaseStream.BytesToRead );
|
||||
comPort.readPacket();
|
||||
//Console.WriteLine(DateTime.Now.Millisecond + " SR2 " + comPort.BaseStream.BytesToRead);
|
||||
}
|
||||
// Console.WriteLine("SR left");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.Error("Serial Reader fail :" + e.Message);
|
||||
log.Error("Serial Reader fail :" + e.ToString());
|
||||
try
|
||||
{
|
||||
comPort.Close();
|
||||
@@ -1186,7 +1184,7 @@ namespace ArdupilotMega
|
||||
|
||||
private void MainV2_Load(object sender, EventArgs e)
|
||||
{
|
||||
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("Config", new GCSViews.ConfigurationView.Setup(), false));
|
||||
MyView.AddScreen(new MainSwitcher.Screen("Simulation", Simulation, true));
|
||||
@@ -1228,7 +1226,8 @@ namespace ArdupilotMega
|
||||
new Thread(SerialReader)
|
||||
{
|
||||
IsBackground = true,
|
||||
Name = "Main Serial reader"
|
||||
Name = "Main Serial reader",
|
||||
Priority = ThreadPriority.AboveNormal
|
||||
}.Start();
|
||||
|
||||
try
|
||||
@@ -1448,7 +1447,7 @@ namespace ArdupilotMega
|
||||
foreach (var point in GCSViews.FlightPlanner.pointlist)
|
||||
{
|
||||
if (point != null)
|
||||
coords.Add(new SharpKml.Base.Vector(point.Lat, point.Lng, point.Alt));
|
||||
coords.Add(new SharpKml.Base.Vector(point.Lat, point.Lng, point.Alt));
|
||||
|
||||
}
|
||||
|
||||
@@ -1977,7 +1976,7 @@ namespace ArdupilotMega
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
log.Debug(file + " " + bytes);
|
||||
// log.Debug(file + " " + bytes);
|
||||
int len = dataStream.Read(buf1, 0, 1024);
|
||||
if (len == 0)
|
||||
break;
|
||||
@@ -2081,11 +2080,9 @@ namespace ArdupilotMega
|
||||
if (keyData == (Keys.Control | Keys.W)) // test ac config
|
||||
{
|
||||
|
||||
Controls.ConfigPanel cfg = new Controls.ConfigPanel();
|
||||
Controls.ConfigPanel cfg = new Controls.ConfigPanel(Application.StartupPath + System.IO.Path.DirectorySeparatorChar + "ArduCopterConfig.xml");
|
||||
|
||||
cfg.LoadXML("ArduCopterConfig.xml");
|
||||
|
||||
//cfg.ShowDialog();
|
||||
//cfg.Show();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -34,10 +34,10 @@ namespace ArdupilotMega.Presenter
|
||||
private CameraAxisProperties _pitchAxis;
|
||||
private CameraAxisProperties _rollAxis;
|
||||
|
||||
private readonly IMAVLink _mavlink;
|
||||
private readonly MAVLink _mavlink;
|
||||
private readonly Dictionary<string, string> _errors;
|
||||
|
||||
public ConfigCameraStabPresenter(IMAVLink mavlink)
|
||||
public ConfigCameraStabPresenter(MAVLink mavlink)
|
||||
{
|
||||
_mavlink = mavlink;
|
||||
_errors = new Dictionary<string, string>();
|
||||
|
||||
@@ -31,10 +31,6 @@ namespace ArdupilotMega
|
||||
|
||||
Application.Idle += Application_Idle;
|
||||
|
||||
int wt = 0, ct = 0;
|
||||
ThreadPool.GetMaxThreads(out wt, out ct);
|
||||
log.Info("Max Threads: " + wt);
|
||||
|
||||
//MagCalib.ProcessLog();
|
||||
|
||||
//MessageBox.Show("NOTE: This version may break advanced mission scripting");
|
||||
@@ -67,17 +63,7 @@ namespace ArdupilotMega
|
||||
|
||||
return;
|
||||
*/
|
||||
char[] line = "testtesttesttesttest".ToCharArray();
|
||||
|
||||
Delta.delta_encode(ref line);
|
||||
|
||||
Delta.delta_decode(ref line);
|
||||
|
||||
if (System.Diagnostics.Debugger.IsAttached)
|
||||
{
|
||||
// testing
|
||||
// Utilities.ParameterMetaDataParser.GetParameterInformation();
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
@@ -94,13 +80,19 @@ namespace ArdupilotMega
|
||||
}
|
||||
}
|
||||
|
||||
static DateTime lastidle = DateTime.Now;
|
||||
|
||||
static void Application_Idle(object sender, EventArgs e)
|
||||
{
|
||||
//System.Threading.Thread.Sleep(10);
|
||||
//Console.Write("Idle\n");
|
||||
if (lastidle.AddMilliseconds(20) < DateTime.Now)
|
||||
{
|
||||
Application.DoEvents();
|
||||
lastidle = DateTime.Now;
|
||||
}
|
||||
|
||||
System.Threading.Thread.Sleep(20);
|
||||
Application.DoEvents();
|
||||
System.Threading.Thread.Sleep(1);
|
||||
}
|
||||
|
||||
static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
|
||||
|
||||
@@ -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.98")]
|
||||
[assembly: AssemblyFileVersion("1.1.99")]
|
||||
[assembly: NeutralResourcesLanguageAttribute("")]
|
||||
@@ -177,6 +177,18 @@ namespace ArdupilotMega.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
public static System.Drawing.Bitmap frames_plus {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("frames_plus", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
public static System.Drawing.Bitmap frames_x {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("frames_x", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
public static System.Drawing.Bitmap Gaugebg {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Gaugebg", resourceCulture);
|
||||
|
||||
@@ -1234,11 +1234,17 @@
|
||||
<data name="rover" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\car.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="cameraGimalPitch1" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\cameraGimalPitch1.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="cameraGimalRoll1" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\cameraGimalRoll1.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="frames_plus" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\frames_plus.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="frames_x" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\frames_x.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -101,6 +101,8 @@
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.label10 = new System.Windows.Forms.Label();
|
||||
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
|
||||
this.SPLIT_local.Panel1.SuspendLayout();
|
||||
this.SPLIT_local.Panel2.SuspendLayout();
|
||||
this.SPLIT_local.SuspendLayout();
|
||||
@@ -835,10 +837,25 @@
|
||||
resources.ApplyResources(this.label9, "label9");
|
||||
this.label9.Name = "label9";
|
||||
//
|
||||
// label10
|
||||
//
|
||||
resources.ApplyResources(this.label10, "label10");
|
||||
this.label10.Name = "label10";
|
||||
//
|
||||
// linkLabel1
|
||||
//
|
||||
resources.ApplyResources(this.linkLabel1, "linkLabel1");
|
||||
this.linkLabel1.Name = "linkLabel1";
|
||||
this.linkLabel1.TabStop = true;
|
||||
this.toolTip1.SetToolTip(this.linkLabel1, resources.GetString("linkLabel1.ToolTip"));
|
||||
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
|
||||
//
|
||||
// _3DRradio
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.linkLabel1);
|
||||
this.Controls.Add(this.label10);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.BUT_Syncoptions);
|
||||
@@ -942,5 +959,7 @@
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.Label label9;
|
||||
private System.Windows.Forms.Label label10;
|
||||
private System.Windows.Forms.LinkLabel linkLabel1;
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ using System.Text.RegularExpressions;
|
||||
|
||||
namespace ArdupilotMega
|
||||
{
|
||||
public partial class _3DRradio : BackStageViewContentPanel
|
||||
public partial class _3DRradio : UserControl
|
||||
{
|
||||
public delegate void LogEventHandler(string message, int level = 0);
|
||||
|
||||
@@ -719,5 +719,14 @@ namespace ArdupilotMega
|
||||
SPLIT_local.Panel2Collapsed = !CHK_advanced.Checked;
|
||||
SPLIT_remote.Panel2Collapsed = !CHK_advanced.Checked;
|
||||
}
|
||||
|
||||
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
CustomMessageBox.Show(@"The 3DR Radios have 2 status LEDs, one red and one green.
|
||||
green LED blinking - searching for another radio
|
||||
green LED solid - link is established with another radio
|
||||
red LED flashing - transmitting data
|
||||
red LED solid - in firmware update mode");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
Binary file not shown.
|
After Width: | Height: | Size: 131 KiB |
@@ -29,7 +29,7 @@ namespace ArdupilotMega.Utilities
|
||||
parameterLocations.RemoveAll(String.IsNullOrEmpty);
|
||||
|
||||
string sStartupPath = Application.StartupPath;
|
||||
using (var objXmlTextWriter = new XmlTextWriter(String.Format("{0}\\{1}", sStartupPath, ConfigurationManager.AppSettings["ParameterMetaDataXMLFileName"]), null))
|
||||
using (var objXmlTextWriter = new XmlTextWriter(String.Format("{0}{1}{2}", Application.StartupPath, Path.DirectorySeparatorChar, ConfigurationManager.AppSettings["ParameterMetaDataXMLFileName"]), null))
|
||||
{
|
||||
objXmlTextWriter.Formatting = Formatting.Indented;
|
||||
objXmlTextWriter.WriteStartDocument();
|
||||
@@ -96,6 +96,7 @@ namespace ArdupilotMega.Utilities
|
||||
.ForEach(path => path.Value.Split(new []{ ParameterMetaDataConstants.PathDelimeter }, StringSplitOptions.None)
|
||||
.ForEach(separatedPath =>
|
||||
{
|
||||
log.Info("Process "+ node.Key + " : " + separatedPath);
|
||||
// Match based on the regex defined at the top of this class
|
||||
Match pathMatch = _parentDirectoryRegex.Match(separatedPath);
|
||||
if (pathMatch.Success && pathMatch.Groups["Path"] != null && !String.IsNullOrEmpty(pathMatch.Groups["Path"].Value))
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace ArdupilotMega.Utilities
|
||||
|
||||
public void Reload()
|
||||
{
|
||||
string paramMetaDataXMLFileName = String.Format("{0}\\{1}", Application.StartupPath, ConfigurationManager.AppSettings["ParameterMetaDataXMLFileName"]);
|
||||
string paramMetaDataXMLFileName = String.Format("{0}{1}{2}", Application.StartupPath, Path.DirectorySeparatorChar, ConfigurationManager.AppSettings["ParameterMetaDataXMLFileName"]);
|
||||
try
|
||||
{
|
||||
if (File.Exists(paramMetaDataXMLFileName))
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace ArdupilotMega.Utilities
|
||||
DomainUpDown txt = (DomainUpDown)ctl;
|
||||
txt.BorderStyle = BorderStyle.None;
|
||||
}
|
||||
else if (ctl.GetType() == typeof(GroupBox))
|
||||
else if (ctl.GetType() == typeof(GroupBox) || ctl.GetType() == typeof(UserControl))
|
||||
{
|
||||
ctl.BackColor = BGColor;
|
||||
ctl.ForeColor = TextColor;// Color.FromArgb(0xe6, 0xe8, 0xea);
|
||||
|
||||
@@ -215,13 +215,20 @@ namespace ArdupilotMega
|
||||
imagetotime = new Hashtable();
|
||||
|
||||
//logFile = @"C:\Users\hog\Pictures\farm 1-10-2011\100SSCAM\2011-10-01 11-48 1.log";
|
||||
TXT_outputlog.AppendText("Read Log\n");
|
||||
|
||||
List<string[]> list = readLog(logFile);
|
||||
|
||||
TXT_outputlog.AppendText("Log Read\n");
|
||||
|
||||
//dirWithImages = @"C:\Users\hog\Pictures\farm 1-10-2011\100SSCAM";
|
||||
|
||||
TXT_outputlog.AppendText("Read images\n");
|
||||
|
||||
string[] files = Directory.GetFiles(dirWithImages);
|
||||
|
||||
TXT_outputlog.AppendText("images read\n");
|
||||
|
||||
Document kml = new Document();
|
||||
|
||||
StreamWriter sw4 = new StreamWriter(dirWithImages + Path.DirectorySeparatorChar + "loglocation.csv");
|
||||
@@ -242,6 +249,8 @@ namespace ArdupilotMega
|
||||
|
||||
int lastmatchindex = 0;
|
||||
|
||||
TXT_outputlog.AppendText("start Processing\n");
|
||||
|
||||
foreach (string filename in files)
|
||||
{
|
||||
if (filename.ToLower().EndsWith(".jpg") && !filename.ToLower().Contains("_geotag"))
|
||||
@@ -277,7 +286,9 @@ namespace ArdupilotMega
|
||||
|
||||
if (lastmatchindex > (a))
|
||||
continue;
|
||||
//Application.DoEvents();
|
||||
|
||||
if (a % 1000 == 0)
|
||||
Application.DoEvents();
|
||||
|
||||
DateTime logdt = startTime.AddMilliseconds(int.Parse(arr[1])).AddSeconds(offsetseconds);
|
||||
|
||||
@@ -293,6 +304,13 @@ namespace ArdupilotMega
|
||||
first++;
|
||||
}
|
||||
|
||||
// time has past, logs are in time order
|
||||
if (photodt < logdt.AddSeconds(-1))
|
||||
{
|
||||
lastmatchindex = a;
|
||||
break;
|
||||
}
|
||||
|
||||
//Console.Write("ph " + dt + " log " + crap + " \r");
|
||||
|
||||
|
||||
|
||||
@@ -277,7 +277,7 @@ namespace ArdupilotMega
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
Thread.Sleep(500);
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,11 +31,11 @@ namespace ArdupilotMega
|
||||
|
||||
if (System.Diagnostics.Debugger.IsAttached) {
|
||||
|
||||
ArdupilotMega.Controls.OpenGLtest ogl = new Controls.OpenGLtest();
|
||||
// ArdupilotMega.Controls.OpenGLtest ogl = new Controls.OpenGLtest();
|
||||
|
||||
this.Controls.Add(ogl);
|
||||
// this.Controls.Add(ogl);
|
||||
|
||||
ogl.Dock = DockStyle.Fill;
|
||||
// ogl.Dock = DockStyle.Fill;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user