1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

LP-572 Change the setCoord() threshold from 11m to 21cm

This commit is contained in:
Laurent Lalanne 2017-12-27 16:33:40 +01:00
parent fada2f659c
commit 16d22e28d2

View File

@ -29,6 +29,8 @@
#include "homeitem.h" #include "homeitem.h"
#include <QGraphicsSceneMouseEvent> #include <QGraphicsSceneMouseEvent>
#define COORDINATES_THRESHOLD 0.000002 // ~21cm
namespace mapcontrol { namespace mapcontrol {
WayPointItem::WayPointItem(const internals::PointLatLng &coord, int const & altitude, MapGraphicItem *map, wptype type) : coord(coord), reached(false), description(""), shownumber(true), isDragging(false), altitude(altitude), map(map), myType(type) WayPointItem::WayPointItem(const internals::PointLatLng &coord, int const & altitude, MapGraphicItem *map, wptype type) : coord(coord), reached(false), description(""), shownumber(true), isDragging(false), altitude(altitude), map(map), myType(type)
{ {
@ -259,7 +261,9 @@ void WayPointItem::setRelativeCoord(distBearingAltitude value)
void WayPointItem::SetCoord(const internals::PointLatLng &value) void WayPointItem::SetCoord(const internals::PointLatLng &value)
{ {
if (qAbs(Coord().Lat() - value.Lat()) < 0.0001 && qAbs(Coord().Lng() - value.Lng()) < 0.0001) { // If no changes from previous coordinates, return.
if ((qAbs(Coord().Lat() - value.Lat()) < COORDINATES_THRESHOLD) &&
(qAbs(Coord().Lng() - value.Lng()) < COORDINATES_THRESHOLD)) {
return; return;
} }
coord = value; coord = value;