mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 22:48:29 -04:00
25bcfdd1e7
add arduino chip detect fix apm2,2.5 dialog test add write timeout. this will stop planner hangs on bad serial devices. change quickview decimal places to 0.00 fix map clicking issue. fix wind direction wrapping add airspeed use modify firmware screen from Marooned major flightdata tab change. add save/load polygon from file add some error handling dialogs
61 lines
1.5 KiB
C#
61 lines
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace ArdupilotMega.Controls
|
|
{
|
|
/// <summary>
|
|
/// Mono handles calls from other thread difrently - this prevents those crashs
|
|
/// </summary>
|
|
class myGMAP : GMap.NET.WindowsForms.GMapControl
|
|
{
|
|
public bool inOnPaint = false;
|
|
string otherthread = "";
|
|
int lastx = 0;
|
|
int lasty = 0;
|
|
|
|
public myGMAP()
|
|
: base()
|
|
{
|
|
this.Text = "Map";
|
|
}
|
|
|
|
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
|
|
{
|
|
if (inOnPaint)
|
|
{
|
|
Console.WriteLine("Was in onpaint Gmap th:" + System.Threading.Thread.CurrentThread.Name + " in " + otherthread);
|
|
return;
|
|
}
|
|
|
|
otherthread = System.Threading.Thread.CurrentThread.Name;
|
|
|
|
inOnPaint = true;
|
|
|
|
try
|
|
{
|
|
base.OnPaint(e);
|
|
}
|
|
catch (Exception ex) { Console.WriteLine(ex.ToString()); }
|
|
|
|
inOnPaint = false;
|
|
}
|
|
|
|
protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e)
|
|
{
|
|
try
|
|
{
|
|
if (e.X == lastx && e.Y == lasty)
|
|
return;
|
|
|
|
lastx = e.X;
|
|
lasty = e.Y;
|
|
|
|
base.OnMouseMove(e);
|
|
}
|
|
catch (Exception ex) { Console.WriteLine(ex.ToString()); }
|
|
}
|
|
}
|
|
}
|