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/QLoggingCategory>
4#include <QtCore/QObject>
5#include <QtCore/QString>
6#include <QtQmlIntegration/QtQmlIntegration>
7
8#include "MAVLinkLib.h"
9
10Q_DECLARE_LOGGING_CATEGORY(MAVLinkInspectorControllerLog)
11
12class LinkInterface;
16class QTimer;
17class Vehicle;
18
20class MAVLinkInspectorController : public QObject
21{
22 Q_OBJECT
23 QML_ELEMENT
24 Q_MOC_INCLUDE("LinkInterface.h")
25 Q_MOC_INCLUDE("Vehicle.h")
26 Q_MOC_INCLUDE("MAVLinkSystem.h")
27 Q_MOC_INCLUDE("MAVLinkChartController.h")
28 Q_MOC_INCLUDE("QmlObjectListModel.h")
29 Q_PROPERTY(QmlObjectListModel *systems READ systems NOTIFY systemsChanged)
31 Q_PROPERTY(QStringList timeScales READ timeScales NOTIFY timeScalesChanged)
32 Q_PROPERTY(QStringList rangeList READ rangeList NOTIFY rangeListChanged)
33 Q_PROPERTY(QStringList systemNames READ systemNames NOTIFY systemsChanged)
34
35 struct TimeScale_st
36 {
37 TimeScale_st(const QString &label_, uint32_t timeScale_);
38
39 QString label;
40 uint32_t timeScale;
41 };
42
43 struct Range_st
44 {
45 Range_st(const QString &label_, qreal range_);
46
47 QString label;
48 qreal range;
49 };
50
51public:
52 explicit MAVLinkInspectorController(QObject *parent = nullptr);
54
55 Q_INVOKABLE void setActiveSystem(int systemId);
56 Q_INVOKABLE void setMessageInterval(int32_t rate) const;
57
58 QmlObjectListModel *systems() const { return _systems; }
59 QGCMAVLinkSystem *activeSystem() const { return _activeSystem; }
60 QStringList systemNames() const { return _systemNames; }
61 QStringList timeScales();
62 QStringList rangeList();
63
64 const QList<TimeScale_st*> &timeScaleSt() const { return _timeScaleSt; }
65 const QList<Range_st*> &rangeSt() const { return _rangeSt; }
66
67signals:
72
73private slots:
74 void _receiveMessage(LinkInterface *link, const mavlink_message_t &message);
75 void _refreshFrequency();
76 void _setActiveVehicle(Vehicle *vehicle);
77 void _vehicleAdded(Vehicle *vehicle);
78 void _vehicleRemoved(const Vehicle *vehicle);
79
80private:
81 QGCMAVLinkSystem *_findVehicle(uint8_t id);
82 uint8_t _selectedSystemID() const;
83 uint8_t _selectedComponentID() const;
84
85 QStringList _timeScales;
86 QStringList _rangeList;
87 QStringList _systemNames;
88 QList<TimeScale_st*>_timeScaleSt;
89 QList<Range_st*> _rangeSt;
90 QGCMAVLinkSystem *_activeSystem = nullptr;
91 QTimer *_updateFrequencyTimer = nullptr;
92 QmlObjectListModel *_systems = nullptr;
93};
Q_DECLARE_LOGGING_CATEGORY(AndroidSerialLog)
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)
QmlObjectListModel * systems() const
const QList< TimeScale_st * > & timeScaleSt() const
const QList< Range_st * > & rangeSt() const
void setMessageInterval(int32_t rate) const
QGCMAVLinkSystem * activeSystem() const