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/QObject>
4#include <QtCore/QStringList>
5#include <QtQmlIntegration/QtQmlIntegration>
6
9
10class QGCMAVLinkSystem : public QObject
11{
12 Q_OBJECT
13 // QML_ELEMENT
14 Q_MOC_INCLUDE("QmlObjectListModel.h")
15 Q_PROPERTY(quint8 id READ id CONSTANT)
16 Q_PROPERTY(QmlObjectListModel *messages READ messages CONSTANT)
17 Q_PROPERTY(QList<int> compIDs READ compIDs NOTIFY compIDsChanged)
18 Q_PROPERTY(QStringList compIDsStr READ compIDsStr NOTIFY compIDsChanged)
19 Q_PROPERTY(int selected READ selected WRITE setSelected NOTIFY selectedChanged)
20public:
21 QGCMAVLinkSystem(quint8 id, QObject *parent = nullptr);
23
24 quint8 id() const { return _systemID; }
25 QmlObjectListModel *messages() const { return _messages; }
26 QList<int> compIDs() const { return _compIDs; }
27 QStringList compIDsStr() const { return _compIDsStr; }
28 int selected() const { return _selected; }
29
30 void setSelected(int sel);
31 QGCMAVLinkMessage *findMessage(uint32_t id, uint8_t compId, const QString &instanceValue = QString());
32 int findMessage(const QGCMAVLinkMessage *message);
33 void append(QGCMAVLinkMessage *message);
35
36signals:
39
40private:
41 void _checkCompID(const QGCMAVLinkMessage *message);
42 void _resetSelection();
43
44private:
45 quint8 _systemID = 0;
46 QmlObjectListModel *_messages = nullptr;
47 QList<int> _compIDs;
48 QStringList _compIDsStr;
49 int _selected = 0;
50};
QmlObjectListModel * messages() const
QList< int > compIDs() const
void setSelected(int sel)
QGCMAVLinkMessage * selectedMsg()
QGCMAVLinkMessage * findMessage(uint32_t id, uint8_t compId, const QString &instanceValue=QString())
quint8 id() const
int selected() const
void selectedChanged()
QStringList compIDsStr() const
void append(QGCMAVLinkMessage *message)