WimaGOperationArea.h 4.14 KB
Newer Older
1
#pragma once
2

3 4 5 6
#include <QObject>
#include "WimaArea.h"
#include "SettingsFact.h"
#include "WimaTrackerPolyline.h"
7
#include "WimaGOperationArea.h"
8

9 10 11
#include "QScopedPointer"

class WimaGOperationArea : public WimaArea
12
{
13
    Q_OBJECT
14
public:
15 16 17
    WimaGOperationArea(QObject* parent = nullptr);
    WimaGOperationArea(WimaArea* other, QObject* parent = nullptr);

18 19 20 21
    Q_PROPERTY(Fact*                    bottomLayerAltitude     READ bottomLayerAltitude    CONSTANT)
    Q_PROPERTY(Fact*                    numberOfLayers          READ numberOfLayers         CONSTANT)
    Q_PROPERTY(Fact*                    layerDistance           READ layerDistance          CONSTANT)
    Q_PROPERTY(Fact*                    borderPolygonOffset     READ borderPolygonOffset    CONSTANT)
22 23
    /*Q_PROPERTY(QmlObjectListModel*      vehicleList                 READ vehicleList                                                    NOTIFY vehicleListChanged)
    Q_PROPERTY(QmlObjectListModel*      vehiclePolygons             READ vehiclePolygons                                                NOTIFY vehiclePolygonsChanged)*/
24
    Q_PROPERTY(WimaTrackerPolyline*     polyline            READ polyline               CONSTANT)
25
    Q_PROPERTY(QGCMapPolygon*           borderPolygon       READ borderPolygon          NOTIFY      borderPolygonChanged)
26 27 28 29


    Q_INVOKABLE void addVehicle                 (WimaVehicle *vehicle);
    Q_INVOKABLE void removeVehicle              (int vehicleIndex);
30
                void setVehicleCorridor         (WimaVCorridor* corridor);
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
    /*Q_INVOKABLE void recalculatesubPolygons     ();
    Q_INVOKABLE void removeAllVehicles          ();
    Q_INVOKABLE void addVehiclePolygon          ();
    Q_INVOKABLE void removeVehiclePolygon       (int polygonIndex);
    Q_INVOKABLE void removeVehiclePolygon       (WimaVehicleMeasurementPolygon *wimaPolygon);*/


    // Overrides from WimaPolygon
    QString         mapVisualQML    (void) const { return "WimaGOperationAreaMapVisual.qml";}
    QString         editorQML       (void) const { return "WimaGOperationAreaEditor.qml";}

    // Property accessors
    Fact*                               bottomLayerAltitude     (void)       { return &_bottomLayerAltitude;}
    Fact*                               numberOfLayers          (void)       { return &_numberOfLayers;}
    Fact*                               layerDistance           (void)       { return &_layerDistance;}
46
    Fact*                               borderPolygonOffset   (void)       { return &_borderPolygonOffset;}
47 48 49
    /*QmlObjectListModel*                 vehicleList             (void) const { return _vehicleList;}
    QmlObjectListModel*                 vehiclePolygons         (void) const { return _vehiclePolygons;}*/
    WimaTrackerPolyline*                polyline                (void)       { return &_polyline;}
50
    WimaVCorridor*                      vehicleCorridor         (void)       { return _vehicleCorridor;}
51
    QGCMapPolygon*                      borderPolygon           (void)       { return &_borderPolygon;}
52 53 54 55 56 57


    static const char* settingsGroup;
    static const char* bottomLayerAltitudeName;
    static const char* numberOfLayersName;
    static const char* layerDistanceName;
58
    static const char* borderPolygonOffsetName;
59 60 61 62 63 64 65 66 67


signals:
    void bottomLayerAltitudeChanged     (void);
    void numberOfLayersChanged          (void);
    void layerDistanceChanged           (void);
    //void vehicleListChanged             (void);
    void polylineChanged                (void);
    //void vehiclePolygonsChanged         (void);
68
    void vehicleCorridorChanged         (WimaVCorridor* corridor);
69 70 71 72 73
    void borderPolygonChanged           (void);

private slots:
    void recalcBorderPolygon            (void);

74 75 76 77 78 79 80

private:
    QMap<QString, FactMetaData*> _metaDataMap;

    SettingsFact            _bottomLayerAltitude;
    SettingsFact            _numberOfLayers;
    SettingsFact            _layerDistance;
81
    SettingsFact            _borderPolygonOffset;
82 83 84 85


    /*QmlObjectListModel*     _vehicleList;
    QmlObjectListModel*     _vehiclePolygons;*/
86 87
    WimaTrackerPolyline     _polyline;
    WimaVCorridor*          _vehicleCorridor;
88
    QGCMapPolygon           _borderPolygon;
89

90 91 92



93 94
};

95