QGCMapWidget.h 2.28 KB
Newer Older
lm's avatar
lm committed
1 2 3
#ifndef QGCMAPWIDGET_H
#define QGCMAPWIDGET_H

4
#include <QMap>
lm's avatar
lm committed
5 6
#include "opmapcontrol.h"

lm's avatar
lm committed
7
class UASInterface;
8 9
class UASWaypointManager;
class Waypoint;
10
typedef mapcontrol::WayPointItem WayPointItem;
lm's avatar
lm committed
11

12 13 14
/**
 * @brief Class representing a 2D map using aerial imagery
 */
lm's avatar
lm committed
15
class QGCMapWidget : public mapcontrol::OPMapWidget
lm's avatar
lm committed
16 17 18 19
{
    Q_OBJECT
public:
    explicit QGCMapWidget(QWidget *parent = 0);
lm's avatar
lm committed
20
    ~QGCMapWidget();
lm's avatar
lm committed
21 22

signals:
23
    void homePositionChanged(double latitude, double longitude, double altitude);
24 25 26
    /** @brief Signal for newly created map waypoints */
    void waypointCreated(Waypoint* wp);
    void waypointChanged(Waypoint* wp);
lm's avatar
lm committed
27 28

public slots:
29
    /** @brief Add system to map view */
lm's avatar
lm committed
30
    void addUAS(UASInterface* uas);
31
    /** @brief Update the global position of a system */
lm's avatar
lm committed
32
    void updateGlobalPosition(UASInterface* uas, double lat, double lon, double alt, quint64 usec);
33 34
    /** @brief Update the type, size, etc. of this system */
    void updateSystemSpecs(int uas);
35 36 37 38 39 40 41 42 43 44
    /** @brief Change current system in focus / editing */
    void activeUASSet(UASInterface* uas);
    /** @brief Show a dialog to jump to given GPS coordinates */
    void showGoToDialog();
    /** @brief Update this waypoint for this UAS */
    void updateWaypoint(int uas, Waypoint* wp);
    /** @brief Update the whole waypoint */
    void updateWaypointList(int uas);
    /** @brief Update the home position on the map */
    void updateHomePosition(double latitude, double longitude, double altitude);
45

46 47 48 49
protected slots:
    /** @brief Convert a map edit into a QGC waypoint event */
    void handleMapWaypointEdit(WayPointItem* waypoint);

50
protected:
51 52 53 54 55 56 57
    /** @brief Update the highlighting of the currently controlled system */
    void updateSelectedSystem(int uas);
    /** @brief Set the current mouse position on the map as new home position */

    UASWaypointManager* currWPManager; ///< The current waypoint manager
    QMap<Waypoint* , mapcontrol::WayPointItem*> waypointsToIcons;
    QMap<mapcontrol::WayPointItem*, Waypoint*> iconsToWaypoints;
58
    Waypoint* firingWaypointChange;
59 60 61 62 63 64 65 66 67
//    enum editMode {
//        NONE,
//        WAYPOINTS,
//        SWEEP,
//        UAVS,
//        HOME,
//        SAFE_AREA
//    };
//    enum editMode currEditMode;            ///< The current edit mode on the map
lm's avatar
lm committed
68 69 70 71

};

#endif // QGCMAPWIDGET_H