From 10736204be95c86c875f8e05ba72be44fe678ea5 Mon Sep 17 00:00:00 2001 From: zedamota Date: Sat, 7 Aug 2010 14:47:48 +0000 Subject: [PATCH] OP37/GCS MapLib - Fixed a bug reported by PeterG, and deleted Nokia from the credits again (still haven't received the free phone :)) git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1230 ebee16cc-31ac-478f-84a7-5cbb03baadba --- .../opmapcontrol/src/mapwidget/mapripform.cpp | 3 +-- .../opmapcontrol/src/mapwidget/mapripform.h | 3 +-- .../opmapcontrol/src/mapwidget/mapripper.cpp | 3 +-- .../opmapcontrol/src/mapwidget/mapripper.h | 3 +-- .../src/mapwidget/opmapwidget.cpp | 3 +++ .../opmapcontrol/src/mapwidget/opmapwidget.h | 20 +++++++++++++++++++ .../opmapcontrol/src/mapwidget/uavitem.cpp | 3 ++- 7 files changed, 29 insertions(+), 9 deletions(-) diff --git a/ground/src/libs/opmapcontrol/src/mapwidget/mapripform.cpp b/ground/src/libs/opmapcontrol/src/mapwidget/mapripform.cpp index 150aa5c38..bbd1725a1 100644 --- a/ground/src/libs/opmapcontrol/src/mapwidget/mapripform.cpp +++ b/ground/src/libs/opmapcontrol/src/mapwidget/mapripform.cpp @@ -3,8 +3,7 @@ * * @file mapripform.cpp * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. -* Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. -* @brief The main graphicsItem used on the widget, contains the map and map logic +* @brief Form to be used with the MapRipper class * @see The GNU Public License (GPL) Version 3 * @defgroup OPMapWidget * @{ diff --git a/ground/src/libs/opmapcontrol/src/mapwidget/mapripform.h b/ground/src/libs/opmapcontrol/src/mapwidget/mapripform.h index fa53a8e47..b1ff3637f 100644 --- a/ground/src/libs/opmapcontrol/src/mapwidget/mapripform.h +++ b/ground/src/libs/opmapcontrol/src/mapwidget/mapripform.h @@ -3,8 +3,7 @@ * * @file mapripform.h * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. -* Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. -* @brief The main graphicsItem used on the widget, contains the map and map logic +* @brief Form to be used with the MapRipper class * @see The GNU Public License (GPL) Version 3 * @defgroup OPMapWidget * @{ diff --git a/ground/src/libs/opmapcontrol/src/mapwidget/mapripper.cpp b/ground/src/libs/opmapcontrol/src/mapwidget/mapripper.cpp index 72226546e..00a2053cd 100644 --- a/ground/src/libs/opmapcontrol/src/mapwidget/mapripper.cpp +++ b/ground/src/libs/opmapcontrol/src/mapwidget/mapripper.cpp @@ -3,8 +3,7 @@ * * @file mapripper.cpp * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. -* Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. -* @brief The main graphicsItem used on the widget, contains the map and map logic +* @brief A class that allows ripping of a selection of the map * @see The GNU Public License (GPL) Version 3 * @defgroup OPMapWidget * @{ diff --git a/ground/src/libs/opmapcontrol/src/mapwidget/mapripper.h b/ground/src/libs/opmapcontrol/src/mapwidget/mapripper.h index ad19c34a2..6b2087a12 100644 --- a/ground/src/libs/opmapcontrol/src/mapwidget/mapripper.h +++ b/ground/src/libs/opmapcontrol/src/mapwidget/mapripper.h @@ -3,8 +3,7 @@ * * @file mapripper.h * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. -* Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. -* @brief The main graphicsItem used on the widget, contains the map and map logic +* @brief A class that allows ripping of a selection of the map * @see The GNU Public License (GPL) Version 3 * @defgroup OPMapWidget * @{ diff --git a/ground/src/libs/opmapcontrol/src/mapwidget/opmapwidget.cpp b/ground/src/libs/opmapcontrol/src/mapwidget/opmapwidget.cpp index 298ede87b..9413e5aa8 100644 --- a/ground/src/libs/opmapcontrol/src/mapwidget/opmapwidget.cpp +++ b/ground/src/libs/opmapcontrol/src/mapwidget/opmapwidget.cpp @@ -64,6 +64,8 @@ namespace mapcontrol { UAV=new UAVItem(map,this); UAV->setParentItem(map); + connect(this,SIGNAL(UAVLeftSafetyBouble(internals::PointLatLng)),UAV,SIGNAL(UAVLeftSafetyBouble(internals::PointLatLng))); + connect(this,SIGNAL(UAVReachedWayPoint(int,WayPointItem*)),UAV,SIGNAL(UAVReachedWayPoint(int,WayPointItem*))); } else if(!value) { @@ -115,6 +117,7 @@ namespace mapcontrol OPMapWidget::~OPMapWidget() { delete UAV; + delete Home; delete map; delete core; delete configuration; diff --git a/ground/src/libs/opmapcontrol/src/mapwidget/opmapwidget.h b/ground/src/libs/opmapcontrol/src/mapwidget/opmapwidget.h index 0fe7a8742..ad4ef3676 100644 --- a/ground/src/libs/opmapcontrol/src/mapwidget/opmapwidget.h +++ b/ground/src/libs/opmapcontrol/src/mapwidget/opmapwidget.h @@ -382,6 +382,13 @@ namespace mapcontrol * @param number new WayPoint number * @param waypoint WayPoint inserted */ + void WPReached(WayPointItem* waypoint); + /** + * @brief Fires when a new WayPoint is inserted + * + * @param number new WayPoint number + * @param waypoint WayPoint inserted + */ void WPInserted(int const& number,WayPointItem* waypoint); /** * @brief Fires When a WayPoint is deleted @@ -389,6 +396,19 @@ namespace mapcontrol * @param number number of the deleted WayPoint */ void WPDeleted(int const& number); + /** + * @brief Fires When a WayPoint is Reached + * + * @param number number of the Reached WayPoint + */ + void UAVReachedWayPoint(int const& waypointnumber,WayPointItem* waypoint); + /** + * @brief Fires When the UAV lives the safety bouble + * + * @param position the position of the UAV + */ + void UAVLeftSafetyBouble(internals::PointLatLng const& position); + /** * @brief Fires when map position changes * diff --git a/ground/src/libs/opmapcontrol/src/mapwidget/uavitem.cpp b/ground/src/libs/opmapcontrol/src/mapwidget/uavitem.cpp index 474f62f2f..fbd3ae3cf 100644 --- a/ground/src/libs/opmapcontrol/src/mapwidget/uavitem.cpp +++ b/ground/src/libs/opmapcontrol/src/mapwidget/uavitem.cpp @@ -113,6 +113,7 @@ namespace mapcontrol } if(mapwidget->Home!=0) { + //verify if the UAV is inside the safety bouble if(Distance3D(mapwidget->Home->Coord(),mapwidget->Home->Altitude())>mapwidget->Home->SafeArea()) { if(mapwidget->Home->safe!=false); @@ -124,7 +125,7 @@ namespace mapcontrol } else { - if(mapwidget->Home->safe!=true); + if(mapwidget->Home->safe!=true) { mapwidget->Home->safe=true; mapwidget->Home->update();