QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
MAVLinkSystem.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QLoggingCategory>
4#include <QtCore/QObject>
5#include <QtCore/QStringList>
6#include <QtQmlIntegration/QtQmlIntegration>
7
9
10Q_DECLARE_LOGGING_CATEGORY(MAVLinkSystemLog)
11
13
14class QGCMAVLinkSystem : public QObject
15{
16 Q_OBJECT
17 // QML_ELEMENT
18 Q_PROPERTY(quint8 id READ id CONSTANT)
19 Q_PROPERTY(QmlObjectListModel *messages READ messages CONSTANT)
20 Q_PROPERTY(QList<int> compIDs READ compIDs NOTIFY compIDsChanged)
21 Q_PROPERTY(QStringList compIDsStr READ compIDsStr NOTIFY compIDsChanged)
22 Q_PROPERTY(int selected READ selected WRITE setSelected NOTIFY selectedChanged)
23public:
24 QGCMAVLinkSystem(quint8 id, QObject *parent = nullptr);
26
27 quint8 id() const { return _systemID; }
28 QmlObjectListModel *messages() const { return _messages; }
29 QList<int> compIDs() const { return _compIDs; }
30 QStringList compIDsStr() const { return _compIDsStr; }
31 int selected() const { return _selected; }
32
33 void setSelected(int sel);
34 QGCMAVLinkMessage *findMessage(uint32_t id, uint8_t compId);
35 int findMessage(const QGCMAVLinkMessage *message);
36 void append(QGCMAVLinkMessage *message);
37 QGCMAVLinkMessage *selectedMsg();
38
39signals:
42
43private:
44 void _checkCompID(const QGCMAVLinkMessage *message);
45 void _resetSelection();
46
47private:
48 quint8 _systemID = 0;
49 QmlObjectListModel *_messages = nullptr;
50 QList<int> _compIDs;
51 QStringList _compIDsStr;
52 int _selected = 0;
53};
Q_DECLARE_LOGGING_CATEGORY(AndroidSerialLog)
void selectedChanged()