#ifndef WIMACONTROLLER_H
#define WIMACONTROLLER_H

#include <QObject>
#include "QGCMapPolygon.h"
#include "QmlObjectListModel.h"
#include "WimaFlyArea.h"
#include "PlanMasterController.h"
#include "MissionController.h"

class WimaController : public QObject
{
    Q_OBJECT
public:
    explicit WimaController(QObject *parent = nullptr);

    Q_PROPERTY(WimaFlyArea* flyArea                         READ flyArea                                                    CONSTANT)
    Q_PROPERTY(PlanMasterController* masterController       READ masterController       WRITE  setMasterController          NOTIFY   masterControllerChanged)
    Q_PROPERTY(MissionController* missionController         READ missionController      WRITE  setMissionController         NOTIFY   missionControllerChanged)




    //Property Accessors
    WimaFlyArea *flyArea                            (void) { return _flyArea; }
    PlanMasterController* masterController          (void) { return _masterController; }
    MissionController* missionController            (void) { return _missionController; }

    Q_INVOKABLE void start(void);
    Q_INVOKABLE void recalcMission();


    void setMasterController(PlanMasterController* masterC);
    void setMissionController(MissionController* missionC);

signals:
    void masterControllerChanged(PlanMasterController* masterController);
    void missionControllerChanged(MissionController* missionController);


public slots:

private:
    //QmlObjectListModel* _visualItems;
    WimaFlyArea *               _flyArea;
    PlanMasterController*       _masterController;
    MissionController*          _missionController;
};

#endif // WIMACONTROLLER_H
