2020-10-24 20:07:28 +08:00
|
|
|
/**
|
2020-09-23 18:41:12 +08:00
|
|
|
******************************************************************************
|
|
|
|
|
*
|
|
|
|
|
* @file opmapwidget.h
|
|
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
|
|
|
|
|
* @brief The Map Widget, this is the part exposed to the user
|
|
|
|
|
* @see The GNU Public License (GPL) Version 3
|
|
|
|
|
* @defgroup OPMapWidget
|
|
|
|
|
* @{
|
|
|
|
|
*
|
|
|
|
|
*****************************************************************************/
|
|
|
|
|
/*
|
|
|
|
|
* 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 OPMAPWIDGET_H
|
|
|
|
|
#define OPMAPWIDGET_H
|
|
|
|
|
|
|
|
|
|
#include "mapgraphicitem.h"
|
|
|
|
|
#include "geodecoderstatus.h"
|
|
|
|
|
#include "maptype.h"
|
|
|
|
|
#include "languagetype.h"
|
|
|
|
|
#include "diagnostics.h"
|
|
|
|
|
#include "configuration.h"
|
|
|
|
|
#include <QObject>
|
|
|
|
|
#include <QtOpenGL/QGLWidget>
|
|
|
|
|
#include "waypointitem.h"
|
|
|
|
|
#include "QtSvg/QGraphicsSvgItem"
|
|
|
|
|
#include "QGraphicsView"
|
|
|
|
|
#include "uavitem.h"
|
|
|
|
|
#include "gpsitem.h"
|
|
|
|
|
#include "homeitem.h"
|
|
|
|
|
#include "mapripper.h"
|
|
|
|
|
#include "waypointline.h"
|
|
|
|
|
#include "waypointcircle.h"
|
|
|
|
|
#include "waypointitem.h"
|
|
|
|
|
|
|
|
|
|
#include "AltitudeItem.h"
|
|
|
|
|
|
|
|
|
|
#include <QJsonObject>
|
|
|
|
|
#include "QTextStream"
|
|
|
|
|
|
2020-10-11 19:10:57 +08:00
|
|
|
#include <QTranslator>
|
|
|
|
|
|
2022-04-01 21:37:32 +08:00
|
|
|
|
|
|
|
|
#include "waypointbutton.h"
|
|
|
|
|
#include "waypointsetting.h"
|
2022-04-07 11:20:58 +08:00
|
|
|
//#include "missiondialog.h"
|
|
|
|
|
//#include "ruledialog.h"
|
2022-04-06 16:25:17 +08:00
|
|
|
#include "QDialog"
|
2022-04-06 21:24:37 +08:00
|
|
|
|
|
|
|
|
#include "measureline.h"
|
|
|
|
|
|
2022-05-11 15:12:08 +08:00
|
|
|
#include "geoFencecircle.h"
|
|
|
|
|
#include "geoFenceitem.h"
|
|
|
|
|
#include "geoFenceitemline.h"
|
|
|
|
|
|
|
|
|
|
|
2022-04-06 21:24:37 +08:00
|
|
|
|
2020-09-23 18:41:12 +08:00
|
|
|
namespace mapcontrol {
|
|
|
|
|
|
|
|
|
|
#ifdef QtopmapWidget
|
|
|
|
|
#include <mapwidgetglobal.h>
|
|
|
|
|
class OPMAPWIDGETSHARED_EXPORT UAVItem;
|
|
|
|
|
class OPMAPWIDGETSHARED_EXPORT GPSItem;
|
|
|
|
|
class OPMAPWIDGETSHARED_EXPORT HomeItem;
|
|
|
|
|
#else
|
|
|
|
|
class UAVItem;
|
|
|
|
|
class GPSItem;
|
|
|
|
|
class HomeItem;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Collection of static functions to help dealing with various enums used
|
|
|
|
|
* Contains functions for enumToString conversio, StringToEnum, QStringList of enum values...
|
|
|
|
|
*
|
|
|
|
|
* @class Helper opmapwidget.h "opmapwidget.h"
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifdef QtopmapWidget
|
|
|
|
|
#include <mapwidgetglobal.h>
|
|
|
|
|
class OPMAPWIDGETSHARED_EXPORT Helper {
|
|
|
|
|
#else
|
|
|
|
|
class Helper {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
static MapType::Types MapTypeFromString(QString const & value)
|
|
|
|
|
{
|
|
|
|
|
return MapType::TypeByStr(value);
|
|
|
|
|
}
|
|
|
|
|
static QString StrFromMapType(MapType::Types const & value)
|
|
|
|
|
{
|
|
|
|
|
return MapType::StrByType(value);
|
|
|
|
|
}
|
|
|
|
|
static QStringList MapTypes()
|
|
|
|
|
{
|
|
|
|
|
return MapType::TypesList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static GeoCoderStatusCode::Types GeoCoderStatusCodeFromString(QString const & value)
|
|
|
|
|
{
|
|
|
|
|
return GeoCoderStatusCode::TypeByStr(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static QString StrFromGeoCoderStatusCode(GeoCoderStatusCode::Types const & value)
|
|
|
|
|
{
|
|
|
|
|
return GeoCoderStatusCode::StrByType(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static QStringList GeoCoderTypes()
|
|
|
|
|
{
|
|
|
|
|
return GeoCoderStatusCode::TypesList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static internals::MouseWheelZoomType::Types MouseWheelZoomTypeFromString(QString const & value)
|
|
|
|
|
{
|
|
|
|
|
return internals::MouseWheelZoomType::TypeByStr(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static QString StrFromMouseWheelZoomType(internals::MouseWheelZoomType::Types const & value)
|
|
|
|
|
{
|
|
|
|
|
return internals::MouseWheelZoomType::StrByType(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static QStringList MouseWheelZoomTypes()
|
|
|
|
|
{
|
|
|
|
|
return internals::MouseWheelZoomType::TypesList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static core::LanguageType::Types LanguageTypeFromString(QString const & value)
|
|
|
|
|
{
|
|
|
|
|
return core::LanguageType::TypeByStr(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static QString StrFromLanguageType(core::LanguageType::Types const & value)
|
|
|
|
|
{
|
|
|
|
|
return core::LanguageType::StrByType(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static QStringList LanguageTypes()
|
|
|
|
|
{
|
|
|
|
|
return core::LanguageType::TypesList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static core::AccessMode::Types AccessModeFromString(QString const & value)
|
|
|
|
|
{
|
|
|
|
|
return core::AccessMode::TypeByStr(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static QString StrFromAccessMode(core::AccessMode::Types const & value)
|
|
|
|
|
{
|
|
|
|
|
return core::AccessMode::StrByType(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static QStringList AccessModeTypes()
|
|
|
|
|
{
|
|
|
|
|
return core::AccessMode::TypesList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static UAVMapFollowType::Types UAVMapFollowFromString(QString const & value)
|
|
|
|
|
{
|
|
|
|
|
return UAVMapFollowType::TypeByStr(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static QString StrFromUAVMapFollow(UAVMapFollowType::Types const & value)
|
|
|
|
|
{
|
|
|
|
|
return UAVMapFollowType::StrByType(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static QStringList UAVMapFollowTypes()
|
|
|
|
|
{
|
|
|
|
|
return UAVMapFollowType::TypesList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static UAVTrailType::Types UAVTrailTypeFromString(QString const & value)
|
|
|
|
|
{
|
|
|
|
|
return UAVTrailType::TypeByStr(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static QString StrFromUAVTrailType(UAVTrailType::Types const & value)
|
|
|
|
|
{
|
|
|
|
|
return UAVTrailType::StrByType(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static QStringList UAVTrailTypes()
|
|
|
|
|
{
|
|
|
|
|
return UAVTrailType::TypesList();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef QtopmapWidget
|
|
|
|
|
#include <mapwidgetglobal.h>
|
|
|
|
|
class OPMAPWIDGETSHARED_EXPORT OPMapWidget : public QGraphicsView {
|
|
|
|
|
#else
|
|
|
|
|
class OPMapWidget : public QGraphicsView {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
// Q_PROPERTY(int MaxZoom READ MaxZoom WRITE SetMaxZoom)
|
|
|
|
|
Q_PROPERTY(int MinZoom READ MinZoom WRITE SetMinZoom)
|
|
|
|
|
Q_PROPERTY(bool ShowTileGridLines READ ShowTileGridLines WRITE SetShowTileGridLines)
|
|
|
|
|
Q_PROPERTY(double Zoom READ ZoomTotal WRITE SetZoom)
|
|
|
|
|
Q_PROPERTY(qreal Rotate READ Rotate WRITE SetRotate)
|
|
|
|
|
Q_ENUMS(internals::MouseWheelZoomType::Types)
|
|
|
|
|
Q_ENUMS(core::GeoCoderStatusCode::Types)
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
QSize sizeHint() const;
|
|
|
|
|
/**
|
|
|
|
|
* @brief Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param parent parent widget
|
|
|
|
|
* @param config pointer to configuration classed to be used
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
OPMapWidget(QWidget *parent = 0, Configuration *config = new Configuration);
|
|
|
|
|
~OPMapWidget();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool ShowTileGridLines() const
|
|
|
|
|
{
|
|
|
|
|
return map->showTileGridLines;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SetShowTileGridLines(bool const & value)
|
|
|
|
|
{
|
|
|
|
|
map->showTileGridLines = value; map->update();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int MaxZoom() const
|
|
|
|
|
{
|
|
|
|
|
return map->MaxZoom();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// void SetMaxZoom(int const& value){map->maxZoom = value;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int MinZoom() const
|
|
|
|
|
{
|
|
|
|
|
return map->minZoom;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SetMinZoom(int const & value)
|
|
|
|
|
{
|
|
|
|
|
map->minZoom = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internals::MouseWheelZoomType::Types GetMouseWheelZoomType()
|
|
|
|
|
{
|
|
|
|
|
return map->core->GetMouseWheelZoomType();
|
|
|
|
|
}
|
|
|
|
|
void SetMouseWheelZoomType(internals::MouseWheelZoomType::Types const & value)
|
|
|
|
|
{
|
|
|
|
|
map->core->SetMouseWheelZoomType(value);
|
|
|
|
|
}
|
|
|
|
|
// void SetMouseWheelZoomTypeByStr(const QString &value){map->core->SetMouseWheelZoomType(internals::MouseWheelZoomType::TypeByStr(value));}
|
|
|
|
|
// QString GetMouseWheelZoomTypeStr(){return map->GetMouseWheelZoomTypeStr();}
|
|
|
|
|
|
|
|
|
|
internals::RectLatLng SelectedArea() const
|
|
|
|
|
{
|
|
|
|
|
return map->selectedArea;
|
|
|
|
|
}
|
|
|
|
|
void SetSelectedArea(internals::RectLatLng const & value)
|
|
|
|
|
{
|
|
|
|
|
map->selectedArea = value; this->update();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CanDragMap() const
|
|
|
|
|
{
|
|
|
|
|
return map->CanDragMap();
|
|
|
|
|
}
|
|
|
|
|
void SetCanDragMap(bool const & value)
|
|
|
|
|
{
|
|
|
|
|
map->SetCanDragMap(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internals::PointLatLng CurrentPosition() const
|
|
|
|
|
{
|
|
|
|
|
return map->core->CurrentPosition();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SetCurrentPosition();
|
|
|
|
|
void SetCurrentPosition(internals::PointLatLng const & value);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double ZoomReal()
|
|
|
|
|
{
|
|
|
|
|
return map->Zoom();
|
|
|
|
|
}
|
|
|
|
|
double ZoomDigi()
|
|
|
|
|
{
|
|
|
|
|
return map->ZoomDigi();
|
|
|
|
|
}
|
|
|
|
|
double ZoomTotal()
|
|
|
|
|
{
|
|
|
|
|
return map->ZoomTotal();
|
|
|
|
|
}
|
|
|
|
|
void SetZoom(double const & value)
|
|
|
|
|
{
|
|
|
|
|
map->SetZoom(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
qreal Rotate()
|
|
|
|
|
{
|
|
|
|
|
return map->rotation;
|
|
|
|
|
}
|
|
|
|
|
void SetRotate(qreal const & value);
|
|
|
|
|
|
|
|
|
|
void ReloadMap()
|
|
|
|
|
{
|
|
|
|
|
map->ReloadMap(); map->resize();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GeoCoderStatusCode::Types SetCurrentPositionByKeywords(QString const & keys)
|
|
|
|
|
{
|
|
|
|
|
return map->SetCurrentPositionByKeywords(keys);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool UseOpenGL()
|
|
|
|
|
{
|
|
|
|
|
return useOpenGL;
|
|
|
|
|
}
|
|
|
|
|
void SetUseOpenGL(bool const & value);
|
|
|
|
|
|
|
|
|
|
MapType::Types GetMapType()
|
|
|
|
|
{
|
|
|
|
|
return map->core->GetMapType();
|
|
|
|
|
}
|
|
|
|
|
void SetMapType(MapType::Types const & value)
|
|
|
|
|
{
|
|
|
|
|
map->lastimage = QImage(); map->core->SetMapType(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool isStarted()
|
|
|
|
|
{
|
|
|
|
|
return map->core->isStarted();
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-25 09:34:12 +08:00
|
|
|
|
|
|
|
|
int getUAVCurrent(void);
|
|
|
|
|
|
2020-09-23 18:41:12 +08:00
|
|
|
Configuration *configuration;
|
|
|
|
|
|
|
|
|
|
internals::PointLatLng currentMousePosition();
|
|
|
|
|
|
|
|
|
|
void SetFollowMouse(bool const & value)
|
|
|
|
|
{
|
|
|
|
|
followmouse = value; this->setMouseTracking(followmouse);
|
|
|
|
|
}
|
|
|
|
|
bool FollowMouse()
|
|
|
|
|
{
|
|
|
|
|
return followmouse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internals::PointLatLng GetFromLocalToLatLng(QPointF p)
|
|
|
|
|
{
|
|
|
|
|
return map->FromLocalToLatLng(p.x(), p.y());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WayPointItem *WPCreate();
|
|
|
|
|
void WPCreate(WayPointItem *item);
|
|
|
|
|
WayPointItem *WPCreate(internals::PointLatLng const & coord, int const & altitude);
|
|
|
|
|
WayPointItem *WPCreate(internals::PointLatLng const & coord, int const & altitude, QString const & description);
|
|
|
|
|
WayPointItem *WPCreate(const distBearingAltitude &relativeCoord, const QString &description);
|
|
|
|
|
|
2022-04-19 15:50:57 +08:00
|
|
|
int getWaypointSize(int group);
|
2020-09-23 18:41:12 +08:00
|
|
|
|
|
|
|
|
void WPRenumber(WayPointItem *item, int const & newnumber);
|
|
|
|
|
void SetShowCompass(bool const & value);
|
|
|
|
|
void setOverlayOpacity(qreal value);
|
|
|
|
|
|
|
|
|
|
UAVItem *UAV;
|
|
|
|
|
GPSItem *GPS;
|
|
|
|
|
HomeItem *Home;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AltitudeItem *altitudeitem;
|
|
|
|
|
|
2022-04-01 21:37:32 +08:00
|
|
|
WayPointSetting *waypointsetting;
|
|
|
|
|
|
2022-04-06 21:24:37 +08:00
|
|
|
MeasureLine *measureline = nullptr;
|
|
|
|
|
|
2022-04-19 15:50:57 +08:00
|
|
|
int currentGroup = 3;//编辑情况
|
|
|
|
|
int currentMissionType = 0;//显示情况
|
2022-04-01 21:37:32 +08:00
|
|
|
|
2022-04-10 12:04:50 +08:00
|
|
|
QMap<int,QMap<int,WayPointItem *>> waypointgroups;//group index point
|
|
|
|
|
|
2022-04-01 21:37:32 +08:00
|
|
|
|
2020-09-23 18:41:12 +08:00
|
|
|
void SetShowUAV(bool const & value);
|
|
|
|
|
bool ShowUAV() const
|
|
|
|
|
{
|
|
|
|
|
return showuav;
|
|
|
|
|
}
|
|
|
|
|
void SetShowHome(bool const & value);
|
|
|
|
|
bool ShowHome() const
|
|
|
|
|
{
|
|
|
|
|
return showhome;
|
|
|
|
|
}
|
|
|
|
|
void SetShowDiagnostics(bool const & value);
|
|
|
|
|
void SetUavPic(QString UAVPic);
|
|
|
|
|
WayPointLine *WPLineCreate(WayPointItem *from, WayPointItem *to, QColor color, bool dashed = false, int width = -1);
|
|
|
|
|
WayPointLine *WPLineCreate(HomeItem *from, WayPointItem *to, QColor color, bool dashed = false, int width = -1);
|
2022-04-19 15:50:57 +08:00
|
|
|
void WPLineUpdate(int group);
|
|
|
|
|
|
|
|
|
|
|
2020-09-23 18:41:12 +08:00
|
|
|
WayPointCircle *WPCircleCreate(WayPointItem *center, double radius, bool clockwise, QColor color, bool dashed = false, int width = -1);
|
|
|
|
|
WayPointCircle *WPCircleCreate(HomeItem *center, double radius, bool clockwise, QColor color, bool dashed = false, int width = -1);
|
|
|
|
|
void deleteAllOverlays();
|
|
|
|
|
void WPSetVisibleAll(bool value);
|
|
|
|
|
WayPointItem *magicWPCreate();
|
|
|
|
|
bool WPPresent();
|
|
|
|
|
|
2022-04-19 20:31:40 +08:00
|
|
|
WayPointItem *WPFind(int group,int number);
|
2020-09-23 18:41:12 +08:00
|
|
|
|
|
|
|
|
QList<WayPointItem *> WPSelected();
|
|
|
|
|
void setSelectedWP(QList<WayPointItem *> list);
|
|
|
|
|
void setSelectedWP(int number);
|
|
|
|
|
void setSelectedWP(WayPointItem *item);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool WPLock() const
|
|
|
|
|
{
|
|
|
|
|
return isWPLock;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void setWPLock(bool const & lock);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool WPCreate() const
|
|
|
|
|
{
|
|
|
|
|
return isWPCreate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void setWPCreate(bool const & value);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void setUAVPos(int sysid,int compid,double x,double y,double z);
|
|
|
|
|
void setUAVHeading(int sysid,int compid,float Heading);
|
2022-05-26 14:03:37 +08:00
|
|
|
void setUAVSpeed(int sysid,int compid,qreal Ma,qreal Speed);
|
2020-09-23 18:41:12 +08:00
|
|
|
void DeleteTrail(void);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double TotalDistance(void)
|
|
|
|
|
{
|
|
|
|
|
return totalDistance;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2022-04-10 12:04:50 +08:00
|
|
|
|
2020-09-23 18:41:12 +08:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
internals::Core *core;
|
|
|
|
|
MapGraphicItem *map;
|
|
|
|
|
QGraphicsScene mscene;
|
|
|
|
|
bool useOpenGL;
|
|
|
|
|
GeoCoderStatusCode x;
|
|
|
|
|
MapType y;
|
|
|
|
|
core::AccessMode xx;
|
|
|
|
|
internals::PointLatLng currentmouseposition;
|
|
|
|
|
bool followmouse;
|
|
|
|
|
void ConnectWP(WayPointItem *item);
|
|
|
|
|
QGraphicsSvgItem *compass;
|
|
|
|
|
bool showuav;
|
|
|
|
|
bool showhome;
|
|
|
|
|
QTimer *diagTimer;
|
|
|
|
|
QGraphicsTextItem *diagGraphItem;
|
|
|
|
|
bool showDiag;
|
|
|
|
|
qreal overlayOpacity;
|
|
|
|
|
|
|
|
|
|
bool isWPCreate;
|
|
|
|
|
bool isWPLock;
|
|
|
|
|
bool isLNOP = false;
|
|
|
|
|
|
2022-04-06 16:25:17 +08:00
|
|
|
bool isMeasure = false;
|
|
|
|
|
|
|
|
|
|
|
2020-09-23 18:41:12 +08:00
|
|
|
QString waypointMessage;
|
|
|
|
|
|
|
|
|
|
double totalDistance = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QTimer *NoOperationTimer = nullptr;
|
|
|
|
|
|
2022-05-28 20:25:24 +08:00
|
|
|
//MapRipper * mapRipper = nullptr;
|
2022-04-06 21:24:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
internals::PointLatLng point_begin;
|
|
|
|
|
internals::PointLatLng point_end;
|
|
|
|
|
|
|
|
|
|
int measurenumber = 1;
|
|
|
|
|
|
2022-05-09 17:57:48 +08:00
|
|
|
bool isShowTip = false;
|
|
|
|
|
|
2022-05-17 15:06:08 +08:00
|
|
|
int fenceCount = 0;
|
2022-04-06 21:24:37 +08:00
|
|
|
|
2020-09-23 18:41:12 +08:00
|
|
|
private slots:
|
|
|
|
|
void diagRefresh();
|
|
|
|
|
// WayPointItem* item;//apagar
|
|
|
|
|
|
|
|
|
|
void NOPTimeout();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void resizeEvent(QResizeEvent *event);
|
|
|
|
|
void showEvent(QShowEvent *event);
|
|
|
|
|
void closeEvent(QCloseEvent *event);
|
|
|
|
|
void mouseMoveEvent(QMouseEvent *event);
|
|
|
|
|
void mouseDoubleClickEvent(QMouseEvent *event);
|
|
|
|
|
void mousePressEvent(QMouseEvent *event);
|
|
|
|
|
void mouseReleaseEvent(QMouseEvent *event);
|
2022-03-30 16:56:32 +08:00
|
|
|
|
|
|
|
|
void dragEnterEvent(QDragEnterEvent *event);
|
|
|
|
|
void dropEvent(QDropEvent *event);
|
|
|
|
|
|
2020-09-23 18:41:12 +08:00
|
|
|
// private slots:
|
|
|
|
|
signals:
|
2022-05-09 12:10:07 +08:00
|
|
|
|
2022-05-28 20:25:24 +08:00
|
|
|
void cancelRequest();
|
|
|
|
|
void percentageChanged(int const & perc);
|
|
|
|
|
void numberOfTilesChanged(int const & total, int const & actual);
|
|
|
|
|
void providerChanged(QString const & prov, int const & zoom);
|
|
|
|
|
void ripfinished();
|
|
|
|
|
|
2022-05-09 12:10:07 +08:00
|
|
|
void settableClicked(void);
|
|
|
|
|
|
2020-09-23 18:41:12 +08:00
|
|
|
void showMessage(const QString &message,int TimeOut = 0);
|
|
|
|
|
|
|
|
|
|
//map property
|
|
|
|
|
void MapTypes(QStringList list);
|
|
|
|
|
|
2022-05-07 17:53:54 +08:00
|
|
|
void settableGroup(int);
|
2020-09-23 18:41:12 +08:00
|
|
|
|
|
|
|
|
void TotalDistanceUpdate(double);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void WPNeedToUpdata(int number);
|
|
|
|
|
|
|
|
|
|
void WPChanged(int Number,double Lat,double Lng);
|
|
|
|
|
void EmitCurrentMousePosition(internals::PointLatLng);
|
|
|
|
|
|
|
|
|
|
void zoomChanged(double zoomt, double zoom, double zoomd);
|
|
|
|
|
|
|
|
|
|
void WPNumberChanged(int const & oldnumber, int const & newnumber, WayPointItem *waypoint);
|
|
|
|
|
void WPValuesChanged(WayPointItem *waypoint);
|
|
|
|
|
|
|
|
|
|
void WPReached(WayPointItem *waypoint);
|
|
|
|
|
|
|
|
|
|
void WPCreated(int const & number, WayPointItem *waypoint);
|
|
|
|
|
|
|
|
|
|
void WPInserted(int const & number, WayPointItem *waypoint);
|
|
|
|
|
void WPDeleted(int const & number, WayPointItem *waypoint);
|
|
|
|
|
|
|
|
|
|
void WPLocalPositionChanged(QPointF, WayPointItem *);
|
|
|
|
|
void WPManualCoordChange(WayPointItem *);
|
|
|
|
|
void UAVReachedWayPoint(int const & waypointnumber, WayPointItem *waypoint);
|
|
|
|
|
void UAVLeftSafetyBouble(internals::PointLatLng const & position);
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
void OnTilesStillToLoad(int number);
|
|
|
|
|
void OnWayPointDoubleClicked(WayPointItem *waypoint);
|
|
|
|
|
|
|
|
|
|
void selectedWPChanged(QList<WayPointItem *>);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MousePressEvent(QMouseEvent *event);
|
|
|
|
|
void MouseReleaseEvent(QMouseEvent *event);
|
|
|
|
|
void MouseDoubleClickEvent(QMouseEvent *event);
|
|
|
|
|
|
|
|
|
|
|
2020-12-06 20:29:25 +08:00
|
|
|
void PointNumber(QList<int> nums);
|
2020-09-23 18:41:12 +08:00
|
|
|
|
|
|
|
|
void setWPProperty(float param1,float param2,float param3,float param4,
|
|
|
|
|
int32_t x,int32_t y,float z,
|
|
|
|
|
uint16_t seq,
|
|
|
|
|
uint16_t group,
|
|
|
|
|
uint16_t command,
|
|
|
|
|
uint8_t target_system,
|
|
|
|
|
uint8_t target_component,
|
|
|
|
|
uint8_t frame,
|
|
|
|
|
uint8_t current,
|
|
|
|
|
uint8_t autocontinue,
|
|
|
|
|
uint8_t mission_type);
|
|
|
|
|
|
|
|
|
|
void WPProperty(float param1,float param2,float param3,float param4,
|
|
|
|
|
int32_t x,int32_t y,float z,
|
|
|
|
|
uint16_t seq,
|
|
|
|
|
uint16_t group,
|
|
|
|
|
uint16_t command,
|
|
|
|
|
uint8_t target_system,
|
|
|
|
|
uint8_t target_component,
|
|
|
|
|
uint8_t frame,
|
|
|
|
|
uint8_t current,
|
|
|
|
|
uint8_t autocontinue,
|
|
|
|
|
uint8_t mission_type);
|
|
|
|
|
|
|
|
|
|
void allPoint(QMap<int,int> list);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-09 17:58:02 +08:00
|
|
|
void signal_WPDownload(uint8_t m_sysid, uint8_t m_compid,int missiontype);
|
|
|
|
|
void signal_WPUpload(uint8_t m_sysid, uint8_t m_compid, uint32_t count,int missiontype);
|
2020-09-23 18:41:12 +08:00
|
|
|
|
2022-05-17 15:06:08 +08:00
|
|
|
void signal_FenceUpload(uint8_t m_sysid, uint8_t m_compid, uint32_t count,int missiontype);
|
2020-09-23 18:41:12 +08:00
|
|
|
|
|
|
|
|
void transmitPoint(float param1,float param2,float param3,float param4,
|
|
|
|
|
int32_t x,int32_t y,float z,
|
|
|
|
|
uint16_t seq,
|
|
|
|
|
uint16_t group,
|
|
|
|
|
uint16_t command,
|
|
|
|
|
uint8_t target_system,
|
|
|
|
|
uint8_t target_component,
|
|
|
|
|
uint8_t frame,
|
|
|
|
|
uint8_t current,
|
|
|
|
|
uint8_t autocontinue,
|
|
|
|
|
uint8_t mission_type);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void uav_selected(int sys,int comp);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void setCurrent(int seq);
|
|
|
|
|
|
2022-05-07 17:53:54 +08:00
|
|
|
void measureState(bool);
|
|
|
|
|
|
|
|
|
|
|
2020-09-23 18:41:12 +08:00
|
|
|
|
2022-05-12 15:36:29 +08:00
|
|
|
void createFenceCircle(int group,qreal radius,bool inclusion,qreal lat,qreal lng);
|
|
|
|
|
void createFencePolygon(int group,qreal vertex,bool inclusion,QList<QPointF> latlng);
|
|
|
|
|
|
2022-05-18 18:04:15 +08:00
|
|
|
void updateFenceCircle(int group,qreal radius, bool inclusion, qreal lat, qreal lng);
|
|
|
|
|
void updateFencePolygon(int group,qreal vertex,bool inclusion,QList<QPointF> latlng);
|
|
|
|
|
|
2022-05-17 15:06:08 +08:00
|
|
|
void sendFence(qreal Vertex,
|
|
|
|
|
qreal group,
|
|
|
|
|
qreal Lat,
|
|
|
|
|
qreal Lng,
|
|
|
|
|
uint16_t FecneSeq,
|
|
|
|
|
uint16_t command,
|
|
|
|
|
uint16_t sysid,
|
|
|
|
|
uint16_t compid,
|
|
|
|
|
uint16_t currentGroup);
|
|
|
|
|
|
2022-05-26 14:03:37 +08:00
|
|
|
void currentPointSeleted(int group,int point);
|
2022-05-17 15:06:08 +08:00
|
|
|
|
2022-05-12 15:36:29 +08:00
|
|
|
|
2020-09-23 18:41:12 +08:00
|
|
|
public slots:
|
|
|
|
|
|
2022-05-06 17:53:06 +08:00
|
|
|
void getAllPoints(int group);
|
2022-04-10 12:04:50 +08:00
|
|
|
void groupchanged(int value);
|
|
|
|
|
|
|
|
|
|
|
2022-05-11 15:12:08 +08:00
|
|
|
void find_PointNumber(int group);
|
2020-09-23 18:41:12 +08:00
|
|
|
|
|
|
|
|
void updateMessage(void);
|
|
|
|
|
|
|
|
|
|
void addUAV(int sysid, int compid);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-26 14:03:37 +08:00
|
|
|
|
2020-09-23 18:41:12 +08:00
|
|
|
void getMapTypes(void);
|
|
|
|
|
void setMapTypes(QVariant value);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ElevationChanged(int seq,double value);
|
|
|
|
|
void AltitudeChanged(int seq,double value);
|
|
|
|
|
void setCurrentPoint(int value);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void receivedPoint(float param1,float param2,float param3,float param4,
|
|
|
|
|
int32_t x,int32_t y,float z,
|
|
|
|
|
uint16_t seq,
|
|
|
|
|
uint16_t group,
|
|
|
|
|
uint16_t command,
|
|
|
|
|
uint8_t target_system,
|
|
|
|
|
uint8_t target_component,
|
|
|
|
|
uint8_t frame,
|
|
|
|
|
uint8_t current,
|
|
|
|
|
uint8_t autocontinue,
|
|
|
|
|
uint8_t mission_type);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void WPLineDelete(WayPointItem *from, WayPointItem *to);
|
|
|
|
|
WayPointLine *WPLineFind(WayPointItem *from, WayPointItem *to);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void WPDelete(WayPointItem *item);
|
2022-04-06 16:25:17 +08:00
|
|
|
void WPDelete(void);
|
2020-09-23 18:41:12 +08:00
|
|
|
void WPDeleteAll();
|
2022-05-03 23:52:20 +08:00
|
|
|
void WPAdd(void);
|
2020-09-23 18:41:12 +08:00
|
|
|
|
2022-04-06 16:25:17 +08:00
|
|
|
void WPInsert();
|
2020-09-23 18:41:12 +08:00
|
|
|
void WPInsert(WayPointItem *item, int const & position);
|
|
|
|
|
WayPointItem *WPInsert(internals::PointLatLng const & coord, int const & altitude, int const & position);
|
|
|
|
|
WayPointItem *WPInsert(internals::PointLatLng const & coord, int const & altitude, QString const & description, int const & position);
|
|
|
|
|
WayPointItem *WPInsert(const distBearingAltitude &relative, const QString &description, const int &position);
|
|
|
|
|
|
|
|
|
|
void WPLocalChanged(QPointF p, WayPointItem *w);
|
|
|
|
|
|
|
|
|
|
void WPFollowPrevious(bool flag,WayPointItem *waypoint);
|
|
|
|
|
|
|
|
|
|
void WPSetCurrent(int seq);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void WPLoad(QString path);
|
|
|
|
|
void WPSave(QString path);
|
|
|
|
|
void WPDownload(void);
|
|
|
|
|
void WPUpload(void);
|
|
|
|
|
|
2022-04-09 15:29:44 +08:00
|
|
|
void WPGroup(int value);
|
|
|
|
|
|
|
|
|
|
|
2022-04-06 16:25:17 +08:00
|
|
|
void ruler_clicked(void);
|
|
|
|
|
void table_clicked(void);
|
2020-09-23 18:41:12 +08:00
|
|
|
|
2022-05-03 23:52:20 +08:00
|
|
|
void WPnearPoint(int dir);
|
2020-09-23 18:41:12 +08:00
|
|
|
void WPotherPoint(int number);
|
|
|
|
|
|
|
|
|
|
void WPsearchall(void);
|
|
|
|
|
|
|
|
|
|
void WPSendItemOK(uint16_t seq,bool flag);
|
|
|
|
|
|
|
|
|
|
void RipMap();
|
|
|
|
|
void OnSelectionChanged();
|
2022-05-09 15:27:56 +08:00
|
|
|
|
|
|
|
|
void WPShowTip(bool flag);
|
2022-05-12 15:36:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
void setFenceCircle(int group,qreal radius, bool inclusion, qreal lat, qreal lng);
|
|
|
|
|
void setFencePolygon(int group,qreal vertex,bool inclusion,QList<QPointF> latlng);
|
|
|
|
|
|
2022-05-18 18:04:15 +08:00
|
|
|
|
|
|
|
|
|
2022-05-17 15:06:08 +08:00
|
|
|
void addCircle();
|
|
|
|
|
void addPolygon();
|
|
|
|
|
void delFence(int group);
|
|
|
|
|
|
2022-05-26 14:03:37 +08:00
|
|
|
void getCurrentPoint(int group);
|
2022-05-17 15:06:08 +08:00
|
|
|
|
2022-05-28 20:25:24 +08:00
|
|
|
|
|
|
|
|
void userRipMap(bool start,qreal lat_l,qreal lng_l,qreal lat_r,qreal lng_r,qint8 zoom);
|
|
|
|
|
|
2020-09-23 18:41:12 +08:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
#endif // OPMAPWIDGET_H
|