SnakeDataManager.h 1.57 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
#pragma once

#include <QObject>
#include <QThread>
#include <QList>
#include <QGeoCoordinate>

#include "QNemoProgress.h"
#include "QNemoHeartbeat.h"

11
#include <boost/units/systems/si.hpp>
12 13 14 15 16 17 18 19


using namespace boost::units;
using Length = quantity<si::length>;
using Area = quantity<si::area>;

class SnakeImpl;

20 21 22 23 24 25 26
enum class NemoStatus{
    NotConnected = 0,
    Connected = 1,
    Timeout = -1,
    InvalidHeartbeat = -2
};

27 28 29 30 31 32 33 34 35 36 37 38 39 40
class SnakeDataManager : public QThread{
    Q_OBJECT

public:
    using SnakeImplPtr  = std::unique_ptr<SnakeImpl>;

    SnakeDataManager(QObject *parent = nullptr);
    ~SnakeDataManager() override;


    void setMeasurementArea     (const QList<QGeoCoordinate>  &measurementArea);
    void setServiceArea         (const QList<QGeoCoordinate>  &serviceArea);
    void setCorridor            (const QList<QGeoCoordinate>  &corridor);

41 42
    QNemoProgress nemoProgress();
    int nemoStatus();
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
    bool calcInProgress();

    Length lineDistance() const;
    void setLineDistance(Length lineDistance);

    Length minTransectLength() const;
    void setMinTransectLength(Length minTransectLength);

    Area minTileArea() const;
    void setMinTileArea(Area minTileArea);

    Length tileHeight() const;
    void setTileHeight(Length tileHeight);

    Length tileWidth() const;
    void setTileWidth(Length tileWidth);

60 61
    void enableRosBridge();
    void disableRosBride();
62

63 64 65 66
signals:
    void nemoProgressChanged();
    void nemoStatusChanged(int status);
    void calcInProgressChanged(bool inProgress);
67 68 69 70

protected:
    void run() override;
private:
Valentin Platzgummer's avatar
Valentin Platzgummer committed
71
    SnakeImplPtr pImpl;
72 73 74 75 76 77 78 79 80 81
};