#ifndef SHOWPLANE_H
#define SHOWPLANE_H

#include <QObject>
#include <QList>
#include <QTimer>
#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);

signals:

private slots:
    void movePlane();
private:
    QMapControl* m_pMapControl;
    UGDynamicLayer* m_pDynamicLayer;

    QList<Plane*> m_planes;

    QTimer m_timer;

private:
    void addPlaneToDyLayer();  //添加飞机到动态层

    void addPlaneDyLayer(QMapControl* pMapControl); //添加飞机图层
};

#endif // SHOWPLANE_H