dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
gpsitem.h
Go to the documentation of this file.
1 
13 /*
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 * for more details.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, see <http://www.gnu.org/licenses/>
26 */
27 #ifndef GPSITEM_H
28 #define GPSITEM_H
29 
30 #include "mappointitem.h"
31 
32 #include "uavmapfollowtype.h"
33 #include "uavtrailtype.h"
34 #include <QtSvg/QSvgRenderer>
35 #include "trailitem.h"
36 #include "traillineitem.h"
37 #include "../core/corecommon.h"
38 
39 namespace mapcontrol
40 {
41  class WayPointItem;
42  class TLMapWidget;
48  class TLMAPWIDGET_EXPORT GPSItem: public MapPointItem
49  {
50  Q_OBJECT
51  Q_INTERFACES(QGraphicsItem)
52 
53  public:
54  enum { Type = UserType + TYPE_GPSITEM };
55  GPSItem(MapGraphicItem* map,TLMapWidget* parent, QString uavPic=QString::fromUtf8(":/uavs/images/mapquad.png"));
56  ~GPSItem();
63  void SetUAVPos(internals::PointLatLng const& position,int const& altitude);
69  void SetUAVHeading(qreal const& value);
70 
76  void SetMapFollowType(UAVMapFollowType::Types const& value){mapfollowtype=value;}
82  void SetTrailType(UAVTrailType::Types const& value);
88  UAVMapFollowType::Types GetMapFollowType()const{return mapfollowtype;}
94  UAVTrailType::Types GetTrailType()const{return trailtype;}
95 
96  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
97  QWidget *widget);
98  QRectF boundingRect() const;
105  void SetTrailTime(int const& seconds){trailtime=seconds;}
112  int TrailTime()const{return trailtime;}
121  void SetTrailDistance(int const& distance){traildistance=distance;}
130  int TrailDistance()const{return traildistance;}
136  bool ShowTrail()const{return showtrail;}
142  bool ShowTrailLine()const{return showtrailline;}
148  void SetShowTrail(bool const& value);
154  void SetShowTrailLine(bool const& value);
158  void DeleteTrail()const;
164  bool AutoSetReached()const{return autosetreached;}
170  void SetAutoSetReached(bool const& value){autosetreached=value;}
176  double AutoSetDistance()const{return autosetdistance;}
182  void SetAutoSetDistance(double const& value){autosetdistance=value;}
183 
184  int type() const;
185 
186  void SetUavPic(QString UAVPic);
187  private:
188  UAVMapFollowType::Types mapfollowtype;
189  UAVTrailType::Types trailtype;
190  internals::PointLatLng lastcoord;
191  QPixmap pic;
192  core::Point localposition;
193  TLMapWidget* mapwidget;
194  QGraphicsItemGroup* trail;
195  QGraphicsItemGroup * trailLine;
196  internals::PointLatLng lasttrailline;
197  QTime timer;
198  bool showtrail;
199  bool showtrailline;
200  int trailtime;
201  int traildistance;
202  bool autosetreached;
203  double Distance3D(internals::PointLatLng const& coord, int const& altitude);
204  double autosetdistance;
205 
206  public slots:
207  void RefreshPos();
208  void setOpacitySlot(qreal opacity);
209  signals:
210  void UAVReachedWayPoint(int const& waypointnumber,WayPointItem* waypoint);
211  void UAVLeftSafetyBouble(internals::PointLatLng const& position);
212  void setChildPosition();
213  void setChildLine();
214  };
215 }
216 #endif // GPSITEM_H
A graphicsItem representing a WayPoint.
A graphicsItem representing a MapPointItem.
A graphicsItem representing a WayPoint.
An enum representing the uav trailing modes.
The main graphicsItem used on the widget, contains the map and map logic.
An enum representing the various map follow modes.
A QGraphicsItem representing a MapPointItem.
Definition: mappointitem.h:56
A QGraphicsItem representing a WayPoint.
Definition: waypointitem.h:41