APMRallyPointManager.h 1.43 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/

#ifndef APMRallyPointManager_H
#define APMRallyPointManager_H

#include "RallyPointManager.h"
#include "QGCMAVLink.h"

class APMRallyPointManager : public RallyPointManager
{
    Q_OBJECT
    
public:
    APMRallyPointManager(Vehicle* vehicle);
    ~APMRallyPointManager();

    // Overrides from RallyPointManager
    bool inProgress             (void) const final;
    void loadFromVehicle        (void) final;
    void sendToVehicle          (const QList<QGeoCoordinate>& rgPoints) final;
28
    bool rallyPointsSupported   (void) const final;
29

30 31
    void removeAll              (void);

32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
    QString editorQml(void) const final { return QStringLiteral("qrc:/FirmwarePlugin/APM/APMRallyPointEditor.qml"); }

private slots:
    void _mavlinkMessageReceived(const mavlink_message_t& message);
    
private:
    void _requestRallyPoint(uint8_t pointIndex);
    void _sendRallyPoint(uint8_t pointIndex);

private:
    bool _readTransactionInProgress;
    bool _writeTransactionInProgress;

    uint8_t _cReadRallyPoints;
    uint8_t _currentRallyPoint;

    static const char* _rallyTotalParam;
};

#endif