QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
MAVLinkInspectorController.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QObject>
4#include <QtCore/QString>
5#include <QtQmlIntegration/QtQmlIntegration>
6
8
9class LinkInterface;
13class QTimer;
14class Vehicle;
15
18class MAVLinkInspectorController : public QObject
19{
20 Q_OBJECT
21 QML_ELEMENT
22 Q_MOC_INCLUDE("LinkInterface.h")
23 Q_MOC_INCLUDE("Vehicle.h")
24 Q_MOC_INCLUDE("MAVLinkSystem.h")
25 Q_MOC_INCLUDE("MAVLinkChartController.h")
26 Q_MOC_INCLUDE("QmlObjectListModel.h")
27 Q_PROPERTY(QmlObjectListModel *systems READ systems NOTIFY systemsChanged)
29 Q_PROPERTY(QStringList timeScales READ timeScales NOTIFY timeScalesChanged)
30 Q_PROPERTY(QStringList rangeList READ rangeList NOTIFY rangeListChanged)
31 Q_PROPERTY(QStringList systemNames READ systemNames NOTIFY systemsChanged)
32
33 struct TimeScale_st
34 {
35 TimeScale_st(const QString &label_, uint32_t timeScale_);
36
37 QString label;
38 uint32_t timeScale;
39 };
40
41 struct Range_st
42 {
43 Range_st(const QString &label_, qreal range_);
44
45 QString label;
46 qreal range;
47 };
48
49public:
50 explicit MAVLinkInspectorController(QObject *parent = nullptr);
52
53 Q_INVOKABLE void setActiveSystem(int systemId);
54 Q_INVOKABLE void setMessageInterval(int32_t rate) const;
55
56 QmlObjectListModel *systems() const { return _systems; }
57 QGCMAVLinkSystem *activeSystem() const { return _activeSystem; }
58 QStringList systemNames() const;
59 QStringList timeScales();
60 QStringList rangeList();
61
62 const QList<TimeScale_st*> &timeScaleSt() const { return _timeScaleSt; }
63 const QList<Range_st*> &rangeSt() const { return _rangeSt; }
64
65signals:
70
71private slots:
72 void _receiveMessage(LinkInterface *link, const mavlink_message_t &message);
73 void _refreshFrequency();
74 void _setActiveVehicle(Vehicle *vehicle);
75 void _vehicleAdded(Vehicle *vehicle);
76 void _vehicleRemoved(const Vehicle *vehicle);
77
78private:
79 QGCMAVLinkSystem *_findVehicle(uint8_t id);
80 uint8_t _selectedSystemID() const;
81 uint8_t _selectedComponentID() const;
82
83 QStringList _timeScales;
84 QStringList _rangeList;
85 QList<TimeScale_st*>_timeScaleSt;
86 QList<Range_st*> _rangeSt;
87 QGCMAVLinkSystem *_activeSystem = nullptr;
88 QTimer *_updateFrequencyTimer = nullptr;
89 QmlObjectListModel *_systems = nullptr;
90};
struct __mavlink_message mavlink_message_t
The link interface defines the interface for all links used to communicate with the ground station ap...
MAVLink message inspector controller (provides the logic for UI display)
Q_INVOKABLE void setActiveSystem(int systemId)
QmlObjectListModel * systems() const
const QList< TimeScale_st * > & timeScaleSt() const
const QList< Range_st * > & rangeSt() const
Q_INVOKABLE void setMessageInterval(int32_t rate) const
QGCMAVLinkSystem * activeSystem() const