2010-06-16 08:52:59 +00:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
*
|
|
|
|
* @file opmapgadgetwidget.h
|
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
|
|
|
* @brief
|
|
|
|
* @see The GNU Public License (GPL) Version 3
|
|
|
|
* @defgroup opmap
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef OPMAP_GADGETWIDGET_H_
|
|
|
|
#define OPMAP_GADGETWIDGET_H_
|
|
|
|
|
|
|
|
#include "opmapcontrol/opmapcontrol.h"
|
|
|
|
#include <QtGui/QWidget>
|
2010-06-20 16:27:18 +00:00
|
|
|
#include <QtGui/QMenu>
|
2010-06-16 08:52:59 +00:00
|
|
|
#include "uavobjects/uavobjectmanager.h"
|
|
|
|
#include "uavobjects/positionactual.h"
|
|
|
|
|
2010-06-21 12:16:25 +00:00
|
|
|
class Ui_OPMap_Widget;
|
2010-06-17 14:57:37 +00:00
|
|
|
|
2010-06-16 08:52:59 +00:00
|
|
|
using namespace mapcontrol;
|
|
|
|
|
|
|
|
class OPMapGadgetWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
OPMapGadgetWidget(QWidget *parent = 0);
|
|
|
|
~OPMapGadgetWidget();
|
|
|
|
|
|
|
|
void setZoom(int value);
|
|
|
|
void setPosition(QPointF pos);
|
|
|
|
void setMapProvider(QString provider);
|
2010-06-18 19:07:04 +00:00
|
|
|
void setUseMemoryCache(bool useMemoryCache);
|
|
|
|
void setCacheLocation(QString cacheLocation);
|
2010-06-16 08:52:59 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void resizeEvent(QResizeEvent *event);
|
2010-06-19 22:16:10 +00:00
|
|
|
void mouseMoveEvent(QMouseEvent *event);
|
2010-06-20 16:27:18 +00:00
|
|
|
void contextMenuEvent(QContextMenuEvent *event);
|
2010-06-16 13:12:28 +00:00
|
|
|
void keyPressEvent(QKeyEvent* event);
|
2010-06-16 08:52:59 +00:00
|
|
|
|
|
|
|
private slots:
|
2010-06-19 22:16:10 +00:00
|
|
|
void updatePosition();
|
|
|
|
|
|
|
|
void statusUpdate();
|
2010-06-16 08:52:59 +00:00
|
|
|
|
2010-06-18 07:29:49 +00:00
|
|
|
void zoomIn();
|
|
|
|
void zoomOut();
|
|
|
|
|
2010-06-20 16:27:18 +00:00
|
|
|
// control panel signals
|
2010-06-21 12:16:25 +00:00
|
|
|
void on_toolButtonReload_clicked();
|
|
|
|
void on_toolButtonFindPlace_clicked();
|
2010-06-20 16:27:18 +00:00
|
|
|
void on_toolButtonRR_clicked();
|
|
|
|
void on_toolButtonRC_clicked();
|
|
|
|
void on_toolButtonRL_clicked();
|
|
|
|
void on_toolButtonZoomM_clicked();
|
|
|
|
void on_toolButtonZoomP_clicked();
|
2010-06-17 15:48:43 +00:00
|
|
|
void on_pushButtonGeoFenceM_clicked();
|
|
|
|
void on_pushButtonGeoFenceP_clicked();
|
2010-06-16 08:52:59 +00:00
|
|
|
|
2010-06-20 08:51:18 +00:00
|
|
|
// map signals
|
2010-06-18 19:07:04 +00:00
|
|
|
void zoomChanged(double zoom);
|
2010-06-20 08:51:18 +00:00
|
|
|
void OnCurrentPositionChanged(internals::PointLatLng point);
|
|
|
|
void OnTileLoadComplete();
|
|
|
|
void OnTileLoadStart();
|
|
|
|
void OnMapDrag();
|
|
|
|
void OnMapZoomChanged();
|
|
|
|
void OnMapTypeChanged(MapType::Types type);
|
|
|
|
void OnEmptyTileError(int zoom, core::Point pos);
|
2010-06-18 19:07:04 +00:00
|
|
|
void OnTilesStillToLoad(int number);
|
|
|
|
|
2010-06-20 16:27:18 +00:00
|
|
|
// context menu signals
|
|
|
|
void reload();
|
|
|
|
void findPlace();
|
2010-06-20 18:18:04 +00:00
|
|
|
void goZoomIn();
|
|
|
|
void goZoomOut();
|
|
|
|
void goMouseClick();
|
2010-06-20 16:27:18 +00:00
|
|
|
void goHome();
|
|
|
|
void goUAV();
|
|
|
|
void followUAV();
|
|
|
|
void openWayPointEditor();
|
|
|
|
void addWayPoint();
|
|
|
|
void deleteWayPoint();
|
|
|
|
void clearWayPoints();
|
|
|
|
void gridLines();
|
|
|
|
void openGL();
|
|
|
|
void zoom2() { setZoom(2); }
|
|
|
|
void zoom3() { setZoom(3); }
|
|
|
|
void zoom4() { setZoom(4); }
|
|
|
|
void zoom5() { setZoom(5); }
|
|
|
|
void zoom6() { setZoom(6); }
|
|
|
|
void zoom7() { setZoom(7); }
|
|
|
|
void zoom8() { setZoom(8); }
|
|
|
|
void zoom9() { setZoom(9); }
|
|
|
|
void zoom10() { setZoom(10); }
|
|
|
|
void zoom11() { setZoom(11); }
|
|
|
|
void zoom12() { setZoom(12); }
|
|
|
|
void zoom13() { setZoom(13); }
|
|
|
|
void zoom14() { setZoom(14); }
|
|
|
|
void zoom15() { setZoom(15); }
|
|
|
|
void zoom16() { setZoom(16); }
|
|
|
|
void zoom17() { setZoom(17); }
|
2010-06-16 08:52:59 +00:00
|
|
|
|
2010-06-20 16:27:18 +00:00
|
|
|
private:
|
2010-06-19 16:59:51 +00:00
|
|
|
double m_heading; // uav heading
|
2010-06-16 08:52:59 +00:00
|
|
|
|
2010-06-19 22:16:10 +00:00
|
|
|
internals::PointLatLng mouse_lat_lon;
|
|
|
|
|
|
|
|
QLabel statusLabel;
|
|
|
|
|
2010-06-16 08:52:59 +00:00
|
|
|
QTimer *m_updateTimer;
|
2010-06-19 22:16:10 +00:00
|
|
|
QTimer *m_statusUpdateTimer;
|
2010-06-16 08:52:59 +00:00
|
|
|
|
|
|
|
PositionActual *m_positionActual;
|
|
|
|
|
2010-06-21 12:16:25 +00:00
|
|
|
Ui_OPMap_Widget *m_widget;
|
2010-06-19 16:59:51 +00:00
|
|
|
|
2010-06-20 16:27:18 +00:00
|
|
|
mapcontrol::OPMapWidget *m_map;
|
2010-06-18 07:29:49 +00:00
|
|
|
|
|
|
|
QPushButton * createTransparentButton(QWidget *parent, QString text, QString icon);
|
|
|
|
void createMapOverlayUserControls();
|
|
|
|
|
2010-06-20 16:27:18 +00:00
|
|
|
void createActions();
|
|
|
|
|
|
|
|
QAction *closeAct;
|
|
|
|
QAction *reloadAct;
|
|
|
|
QAction *findPlaceAct;
|
|
|
|
QAction *zoomInAct;
|
|
|
|
QAction *zoomOutAct;
|
2010-06-20 18:18:04 +00:00
|
|
|
QAction *goMouseClickAct;
|
2010-06-20 16:27:18 +00:00
|
|
|
QAction *goHomeAct;
|
|
|
|
QAction *goUAVAct;
|
|
|
|
QAction *followUAVAct;
|
|
|
|
QAction *wayPointEditorAct;
|
|
|
|
QAction *addWayPointAct;
|
|
|
|
QAction *deleteWayPointAct;
|
|
|
|
QAction *clearWayPointsAct;
|
|
|
|
QAction *gridLinesAct;
|
|
|
|
QAction *openGLAct;
|
|
|
|
|
|
|
|
QActionGroup *zoomActGroup;
|
|
|
|
QAction *zoom2Act;
|
|
|
|
QAction *zoom3Act;
|
|
|
|
QAction *zoom4Act;
|
|
|
|
QAction *zoom5Act;
|
|
|
|
QAction *zoom6Act;
|
|
|
|
QAction *zoom7Act;
|
|
|
|
QAction *zoom8Act;
|
|
|
|
QAction *zoom9Act;
|
|
|
|
QAction *zoom10Act;
|
|
|
|
QAction *zoom11Act;
|
|
|
|
QAction *zoom12Act;
|
|
|
|
QAction *zoom13Act;
|
|
|
|
QAction *zoom14Act;
|
|
|
|
QAction *zoom15Act;
|
|
|
|
QAction *zoom16Act;
|
|
|
|
QAction *zoom17Act;
|
2010-06-16 08:52:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* OPMAP_GADGETWIDGET_H_ */
|