QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
SyslinkComponentController.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QVariant>
4#include <QtQmlIntegration/QtQmlIntegration>
5
7
8class Fact;
9class Vehicle;
10
12{
13 Q_OBJECT
14 QML_ELEMENT
15 Q_PROPERTY(int radioChannel READ radioChannel WRITE setRadioChannel NOTIFY radioChannelChanged)
16 Q_PROPERTY(QString radioAddress READ radioAddress WRITE setRadioAddress NOTIFY radioAddressChanged)
17 Q_PROPERTY(int radioRate READ radioRate WRITE setRadioRate NOTIFY radioRateChanged)
18 Q_PROPERTY(QStringList radioRates READ radioRates CONSTANT)
19
20public:
21 explicit SyslinkComponentController(QObject *parent = nullptr);
23
24 Q_INVOKABLE void resetDefaults() const;
25
26 int radioChannel() const;
27 QString radioAddress() const;
28 int radioRate() const;
29 QStringList radioRates() const { return _dataRates; }
30 Vehicle *vehicle() const { return _vehicle; }
31
32 void setRadioChannel(int num) const;
33 void setRadioAddress(const QString &str) const;
34 void setRadioRate(int idx) const;
35
36signals:
40
41private slots:
42 void _channelChanged(QVariant value) { Q_UNUSED(value); emit radioChannelChanged(); }
43 void _addressChanged(QVariant value) { Q_UNUSED(value); emit radioAddressChanged(); }
44 void _rateChanged(QVariant value) { Q_UNUSED(value); emit radioRateChanged(); }
45
46private:
47 const QStringList _dataRates = { QStringLiteral("750Kb/s"), QStringLiteral("1Mb/s"), QStringLiteral("2Mb/s") };
48
49 Fact *_chan = nullptr;
50 Fact *_rate = nullptr;
51 Fact *_addr1 = nullptr;
52 Fact *_addr2 = nullptr;
53};
Used for handling missing Facts from C++ code.
A Fact is used to hold a single value within the system.
Definition Fact.h:17
Q_INVOKABLE void resetDefaults() const
void setRadioAddress(const QString &str) const