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 "MAVLinkLib.h"
4
5#include <QtCore/QLoggingCategory>
6#include <QtCore/QObject>
7#include <QtQmlIntegration/QtQmlIntegration>
8
9Q_DECLARE_LOGGING_CATEGORY(MavlinkActionLog)
10
11class Vehicle;
12
13class MavlinkAction: public QObject
14{
15 Q_OBJECT
16 QML_ELEMENT
17 Q_MOC_INCLUDE("Vehicle.h")
18 Q_PROPERTY(QString label READ label CONSTANT)
19 Q_PROPERTY(QString description READ description CONSTANT)
20
21public:
22 explicit MavlinkAction(QObject *parent = nullptr);
24 const QString &label,
25 const QString &description,
26 MAV_CMD mavCmd,
27 MAV_COMPONENT compId,
28 float param1,
29 float param2,
30 float param3,
31 float param4,
32 float param5,
33 float param6,
34 float param7,
35 QObject *parent = nullptr
36 );
38
39 Q_INVOKABLE void sendTo(Vehicle *vehicle);
40
41 const QString &label() const { return _label; }
42 const QString &description() const { return _description; }
43
44private:
45 const QString _label;
46 const QString _description;
47 const MAV_CMD _mavCmd = MAV_CMD_ENUM_END;
48 const MAV_COMPONENT _compId = MAV_COMPONENT_ENUM_END;
49 const float _params[7]{};
50};
Q_DECLARE_LOGGING_CATEGORY(AndroidSerialLog)