QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
PX4RadioComponent.cc
Go to the documentation of this file.
1#include "PX4RadioComponent.h"
2#include "ParameterManager.h"
3#include "Vehicle.h"
4
5PX4RadioComponent::PX4RadioComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent)
6 : VehicleComponent(vehicle, autopilot, AutoPilotPlugin::KnownRadioVehicleComponent, parent)
7 , _name(tr("Radio"))
8{
9}
10
11QString PX4RadioComponent::name(void) const
12{
13 return _name;
14}
15
17{
18 return tr("Configure and calibrate your transmitter and assign control channels.");
19}
20
22{
23 return "/qmlimages/RadioComponentIcon.png";
24}
25
27{
28 return _vehicle->parameterManager()->getParameter(-1, "COM_RC_IN_MODE")->rawValue().toInt() == 1 ? false : true;
29}
30
32{
33 if (_vehicle->parameterManager()->getParameter(-1, "COM_RC_IN_MODE")->rawValue().toInt() != 1) {
34 // The best we can do to detect the need for a radio calibration is look for attitude
35 // controls to be mapped.
36 for(const char* const&mapParam : {"RC_MAP_ROLL", "RC_MAP_PITCH", "RC_MAP_YAW", "RC_MAP_THROTTLE"}) {
38 return false;
39 }
40 }
41 }
42
43 return true;
44}
45
47{
48 return {"COM_RC_IN_MODE", "RC_MAP_ROLL", "RC_MAP_PITCH", "RC_MAP_YAW", "RC_MAP_THROTTLE"};
49}
50
52{
53 return QUrl::fromUserInput("qrc:/qml/QGroundControl/AutoPilotPlugins/Common/RadioComponent.qml");
54}
55
57{
58 return QUrl::fromUserInput("qrc:/qml/QGroundControl/AutoPilotPlugins/PX4/PX4RadioComponentSummary.qml");
59}
The AutoPilotPlugin class is an abstract base class which represents the methods and objects which ar...
QVariant rawValue() const
Value after translation.
Definition Fact.h:85
virtual QUrl summaryQmlSource(void) const
virtual QUrl setupSource(void) const
virtual bool requiresSetup(void) const
virtual QString iconResource(void) const
PX4RadioComponent(Vehicle *vehicle, AutoPilotPlugin *autopilot, QObject *parent=nullptr)
virtual QString name(void) const
virtual bool setupComplete(void) const
virtual QString description(void) const
virtual QStringList setupCompleteChangedTriggerList(void) const
Fact * getParameter(int componentId, const QString &paramName)
static constexpr int defaultComponentId
A vehicle component is an object which abstracts the physical portion of a vehicle into a set of conf...
ParameterManager * parameterManager()
Definition Vehicle.h:573