QGCMapWidget.h 1.93 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;
lm's avatar
lm committed
10

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

signals:
22
    void homePositionChanged(double latitude, double longitude, double altitude);
lm's avatar
lm committed
23 24

public slots:
25
    /** @brief Add system to map view */
lm's avatar
lm committed
26
    void addUAS(UASInterface* uas);
27
    /** @brief Update the global position of a system */
lm's avatar
lm committed
28
    void updateGlobalPosition(UASInterface* uas, double lat, double lon, double alt, quint64 usec);
29 30
    /** @brief Update the type, size, etc. of this system */
    void updateSystemSpecs(int uas);
31 32 33 34 35 36 37 38 39 40
    /** @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);
41 42

protected:
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
    /** @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;
//    enum editMode {
//        NONE,
//        WAYPOINTS,
//        SWEEP,
//        UAVS,
//        HOME,
//        SAFE_AREA
//    };
//    enum editMode currEditMode;            ///< The current edit mode on the map
lm's avatar
lm committed
59 60 61 62

};

#endif // QGCMAPWIDGET_H