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("Radio Setup is used to calibrate your transmitter. "
19 "It also assign channels for Roll, Pitch, Yaw and Throttle vehicle control as well as determining whether they are reversed.");
20}
21
23{
24 return "/qmlimages/RadioComponentIcon.png";
25}
26
28{
29 return _vehicle->parameterManager()->getParameter(-1, "COM_RC_IN_MODE")->rawValue().toInt() == 1 ? false : true;
30}
31
33{
34 if (_vehicle->parameterManager()->getParameter(-1, "COM_RC_IN_MODE")->rawValue().toInt() != 1) {
35 // The best we can do to detect the need for a radio calibration is look for attitude
36 // controls to be mapped.
37 for(const char* const&mapParam : {"RC_MAP_ROLL", "RC_MAP_PITCH", "RC_MAP_YAW", "RC_MAP_THROTTLE"}) {
38 if (_vehicle->parameterManager()->getParameter(ParameterManager::defaultComponentId, mapParam)->rawValue().toInt() == 0) {
39 return false;
40 }
41 }
42 }
43
44 return true;
45}
46
48{
49 return {"COM_RC_IN_MODE", "RC_MAP_ROLL", "RC_MAP_PITCH", "RC_MAP_YAW", "RC_MAP_THROTTLE"};
50}
51
53{
54 return QUrl::fromUserInput("qrc:/qml/QGroundControl/AutoPilotPlugins/Common/RadioComponent.qml");
55}
56
58{
59 return QUrl::fromUserInput("qrc:/qml/QGroundControl/AutoPilotPlugins/PX4/PX4RadioComponentSummary.qml");
60}
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
ParameterManager * parameterManager()
Definition Vehicle.h:578