dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
uavitem.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 UAVITEM_H
28 #define UAVITEM_H
29 
30 #include <QtSvg/QSvgRenderer>
31 
32 #include "mappointitem.h"
33 #include "uavmapfollowtype.h"
34 #include "uavtrailtype.h"
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 UAVItem: public MapPointItem
49  {
50  Q_OBJECT
51  Q_INTERFACES(QGraphicsItem)
52 
53  public:
54  enum { Type = UserType + TYPE_UAVITEM };
55  UAVItem(MapGraphicItem* map,TLMapWidget* parent, QString uavPic=QString::fromUtf8(":/uavs/images/mapquad.png"));
56  ~UAVItem();
57 
63  void SetNED(double NED[3]);
69  void SetGroundspeed(double vNED[3], int m_maxUpdateRate);
75  void SetCAS(double CAS);
81  void SetYawRate(double yawRate_dps);
88  void SetUAVPos(internals::PointLatLng const& position,int const& altitude);
94  void SetUAVHeading(qreal const& value);
95 
101  void SetMapFollowType(UAVMapFollowType::Types const& value){mapfollowtype=value;}
107  void SetTrailType(UAVTrailType::Types const& value);
113  UAVMapFollowType::Types GetMapFollowType()const{return mapfollowtype;}
119  UAVTrailType::Types GetTrailType()const{return trailtype;}
120 
121  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
122  QWidget *widget);
123  QRectF boundingRect() const;
130  void SetTrailTime(int const& seconds){trailtime=seconds;}
137  int TrailTime()const{return trailtime;}
146  void SetTrailDistance(int const& distance){traildistance=distance;}
155  int TrailDistance()const{return traildistance;}
161  bool ShowTrail()const{return showtrail;}
167  bool ShowTrailLine()const{return showtrailline;}
173  void SetShowTrail(bool const& value);
179  void SetShowTrailLine(bool const& value);
183  void DeleteTrail()const;
189  bool AutoSetReached()const{return autosetreached;}
195  void SetAutoSetReached(bool const& value){autosetreached=value;}
201  double AutoSetDistance()const{return autosetdistance;}
207  void SetAutoSetDistance(double const& value){autosetdistance=value;}
208 
209  int type() const;
210 
211  void SetUavPic(QString UAVPic);
212  void SetShowUAVInfo(bool const& value);
213  void updateTextOverlay();
214  private:
215  void generateArrowhead();
216  TLMapWidget* mapwidget;
217  QPolygonF arrowHead;
218  QLineF arrowShaft;
219  UAVMapFollowType::Types mapfollowtype;
220  UAVTrailType::Types trailtype;
221  internals::PointLatLng lastcoord;
222  double NED[3];
223  double vNED[3];
224  double CAS_mps;
225  double groundspeed_kph;
226  double groundspeed_mps;
227  double yawRate_dps;
228  double trendRadius;
229  double trendSpanAngle;
230  float meters2pixels;
231  double precalcRings;
232  double ringTime;
233  QPixmap pic;
234  core::Point localposition;
235  QGraphicsItemGroup* trail;
236  QGraphicsItemGroup * trailLine;
237  internals::PointLatLng lasttrailline;
238  QTime timer;
239  bool showtrail;
240  bool showtrailline;
241  int trailtime;
242  int traildistance;
243  bool autosetreached;
244  double autosetdistance;
245  bool showUAVInfo;
246  static double groundspeed_mps_filt;
247  float boundingRectSize;
248  bool showJustChanged;
249 
250  bool refreshPaint_flag;
251 
252  QPainterPath textPath;
253 
254  public slots:
255  void RefreshPos();
256  void setOpacitySlot(qreal opacity);
257  void zoomChangedSlot();
258  signals:
259  void UAVReachedWayPoint(int const& waypointnumber,WayPointItem* waypoint);
260  void UAVLeftSafetyBouble(internals::PointLatLng const& position);
261  void setChildPosition();
262  void setChildLine();
263  };
264 }
265 #endif // UAVITEM_H
A graphicsItem representing a WayPoint.
axis equal end function NED
Definition: OPPlots.m:63
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
A QGraphicsItem representing the UAV.
Definition: uavitem.h:48