WimaServiceArea.h 1.88 KB
Newer Older
1
#pragma once
2

3 4
#include <QObject>
#include "WimaArea.h"
5
#include "WimaTrackerPolyline.h"
6

7
class WimaServiceArea : public WimaArea
8
{
9
    Q_OBJECT
10
public:
11 12
    WimaServiceArea(QObject* parent = nullptr);
    WimaServiceArea(const WimaServiceArea& other, QObject* parent);
13

14 15
    Q_PROPERTY(const QGeoCoordinate&          takeOffPosition READ takeOffPosition    WRITE setTakeOffPosition    NOTIFY takeOffPositionChanged)
    Q_PROPERTY(const QGeoCoordinate&          landPosition    READ landPosition       WRITE setLandPosition       NOTIFY landPositionChanged)
16

17 18 19 20 21
    // Overrides from WimaPolygon
    QString         mapVisualQML    (void) const { return "WimaServiceAreaMapVisual.qml";}
    QString         editorQML       (void) const { return "WimaServiceAreaEditor.qml";}

    // Property acessors
22 23
    const QGeoCoordinate&          takeOffPosition             (void)  const { return _takeOffPosition;}
    const QGeoCoordinate&          landPosition                (void)  const { return _landPosition;}
24

25 26 27 28
    // Member Methodes
    void saveToJson(QJsonObject& json);
    bool loadFromJson(const QJsonObject& json, QString& errorString);

29

30

31 32 33 34
    // Friends
    friend void print(const WimaServiceArea& area, QString& outputStr);
    friend void print(const WimaServiceArea& area);

35 36
    // static Members
    static const char* wimaServiceAreaName;
37 38 39
signals:
    void takeOffPositionChanged         (void);
    void landPositionChanged            (void);
40
    void vehicleCorridorChanged         (WimaVCorridor& corridor);
41 42 43 44 45 46 47

public slots:
    void setTakeOffPosition             (const QGeoCoordinate& coordinate);
    void setLandPosition                (const QGeoCoordinate& coordinate);
    /// Updates this with data from area
    void update(const WimaServiceArea &area);

48
private:
49 50 51 52
    // Member Methodes
    void init();

    // Members
53 54
    QGeoCoordinate      _takeOffPosition;
    QGeoCoordinate      _landPosition;
55 56
};