You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
2.0 KiB
C++
79 lines
2.0 KiB
C++
#ifndef SHOWPLANE_H
|
|
#define SHOWPLANE_H
|
|
|
|
#include <QObject>
|
|
#include <QList>
|
|
#include <QTimer>
|
|
#include <QVector>
|
|
#include <QMap>
|
|
#include <QMutex>
|
|
#include "qmapcontrol.h"
|
|
#include "plane.h"
|
|
#include "Map/UGDynamicLayer.h"
|
|
|
|
using namespace UGC;
|
|
|
|
class ShowPlane : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit ShowPlane(QObject *parent = nullptr);
|
|
ShowPlane(QMapControl *pMapControl);
|
|
|
|
~ShowPlane();
|
|
|
|
void startFly();
|
|
void stopFly();
|
|
|
|
void addPlane(Plane* plane);
|
|
void setRefreshTime(int ms);
|
|
|
|
public slots:
|
|
//接收飞机的位置信息
|
|
void receivePosition(QList<double> lon,QList<double> lat,QList<double> heading);
|
|
void receivePositionInfo(QMap<int,QList<double>>& qmapLon,QMap<int,QList<double>>& qmapLat,QMap<int,QList<double>>& qmapHeading);
|
|
|
|
signals:
|
|
void requestPositionInfo(int ms);//请求飞机位置信息
|
|
void rejectPositionInfo();//停止接收飞机位置信息
|
|
//test
|
|
void sendPostion(QMapControl* pMapControl,double currentLon1,double currentLat1,double heading,double relativeAltitude,double speed);
|
|
|
|
private:
|
|
void movePlane(QMap<int,QList<double>> qmapLon,QMap<int,QList<double>> qmapLat,QMap<int,QList<double>> qmapHeading);
|
|
private:
|
|
QMapControl* m_pMapControl;
|
|
UGDynamicLayer* m_pDynamicLayer;
|
|
|
|
QList<Plane*> m_planes;
|
|
|
|
int refreshTime;
|
|
|
|
QTimer m_timer;
|
|
QMutex mutex;
|
|
|
|
//存储飞机的位置信息的列表
|
|
// QMap<int,QVector<double>> qmapLon; //经度
|
|
// QMap<int,QVector<double>> qmapLat; //纬度
|
|
// QMap<int,QVector<double>> qmapHeading; //航向
|
|
|
|
QMap<int,QList<double>>* qmapLon; //经度
|
|
QMap<int,QList<double>>* qmapLat; //纬度
|
|
QMap<int,QList<double>>* qmapHeading; //航向
|
|
|
|
//容量最大值
|
|
const int MAX = 60;
|
|
|
|
// int num_data = 0;
|
|
|
|
private:
|
|
void addPlaneToDyLayer(); //添加飞机到动态层
|
|
|
|
void addPlaneDyLayer(QMapControl* pMapControl); //添加飞机图层
|
|
|
|
//清除部分容器值
|
|
void removePositionContainer(int count);
|
|
};
|
|
|
|
#endif // SHOWPLANE_H
|