QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
MavlinkAction.h
Go to the documentation of this file.
1#pragma once
2
3#include "MAVLinkEnums.h"
4
5#include <QtCore/QObject>
6#include <QtQmlIntegration/QtQmlIntegration>
7
8class Vehicle;
9
10class MavlinkAction: public QObject
11{
12 Q_OBJECT
13 QML_ELEMENT
14 Q_MOC_INCLUDE("Vehicle.h")
15 Q_PROPERTY(QString label READ label CONSTANT)
16 Q_PROPERTY(QString description READ description CONSTANT)
17
18public:
19 explicit MavlinkAction(QObject *parent = nullptr);
21 const QString &label,
22 const QString &description,
23 MAV_CMD mavCmd,
24 MAV_COMPONENT compId,
25 float param1,
26 float param2,
27 float param3,
28 float param4,
29 float param5,
30 float param6,
31 float param7,
32 QObject *parent = nullptr
33 );
35
36 Q_INVOKABLE void sendTo(Vehicle *vehicle);
37
38 const QString &label() const { return _label; }
39 const QString &description() const { return _description; }
40
41private:
42 const QString _label;
43 const QString _description;
44 const MAV_CMD _mavCmd = MAV_CMD_ENUM_END;
45 const MAV_COMPONENT _compId = MAV_COMPONENT_ENUM_END;
46 const float _params[7]{};
47};
const QString & label() const
const QString & description() const
Q_INVOKABLE void sendTo(Vehicle *vehicle)