9 _deviceIds = QStringList({QStringLiteral(
"CAL_GYRO0_ID"), QStringLiteral(
"CAL_ACC0_ID") });
12 _airspeedCalTriggerParams <<
"SENS_DPRES_OFF";
14 _airspeedCalTriggerParams <<
"SYS_HAS_NUM_ASPD";
16 _airspeedCalTriggerParams <<
"FW_ARSP_MODE" <<
"CBRK_AIRSPD_CHK";
28 return tr(
"Configure and calibrate gyroscope, accelerometer, magnetometer, and airspeed sensors.");
33 return "/qmlimages/SensorsComponentIcon.png";
43 for (
const QString &triggerParam : std::as_const(_deviceIds)) {
48 bool magEnabled =
true;
79 triggers << _deviceIds << _magCalParam << _magEnabledParam;
81 triggers << _airspeedCalTriggerParams;
89 return QUrl::fromUserInput(
"qrc:/qml/QGroundControl/AutoPilotPlugins/PX4/SensorsComponent.qml");
94 QStringList sectionList;
97 bool allMagsDisabled =
false;
101 if (!allMagsDisabled) {
102 sectionList << tr(
"Compass");
105 sectionList << tr(
"Gyroscope");
106 sectionList << tr(
"Accelerometer");
107 sectionList << tr(
"Level Horizon");
109 if (_airspeedCalSupported()) {
110 sectionList << tr(
"Airspeed");
113 sectionList << tr(
"Orientations");
123 summaryQml =
"qrc:/qml/QGroundControl/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml";
125 summaryQml =
"qrc:/qml/QGroundControl/AutoPilotPlugins/PX4/SensorsComponentSummary.qml";
128 return QUrl::fromUserInput(summaryQml);
131 bool SensorsComponent::_airspeedCalSupported(
void)
const
149 bool SensorsComponent::_airspeedCalRequired(
void)
const
158 if (sectionName == tr(
"Compass")) {
159 bool magEnabled =
true;
163 if (!magEnabled)
return true;
166 if (sectionName == tr(
"Gyroscope")) {
169 if (sectionName == tr(
"Accelerometer")) {
172 if (sectionName == tr(
"Level Horizon")) {
177 if (sectionName == tr(
"Airspeed")) {
178 return !_airspeedCalRequired();
The AutoPilotPlugin class is an abstract base class which represents the methods and objects which ar...
QVariant rawValue() const
Value after translation.
bool parameterExists(int componentId, const QString ¶mName) const
Fact * getParameter(int componentId, const QString ¶mName)
static constexpr int defaultComponentId
virtual bool requiresSetup(void) const override
virtual QUrl setupSource(void) const override
virtual QString iconResource(void) const override
bool sectionSetupComplete(const QString §ionName) const override
Returns setup-complete status for a named section. Default returns true (no per-section tracking).
QStringList setupCompleteChangedTriggerList(void) const override
QStringList sections() const override
virtual bool setupComplete(void) const override
virtual QString name(void) const override
virtual QUrl summaryQmlSource(void) const override
SensorsComponent(Vehicle *vehicle, AutoPilotPlugin *autopilot, QObject *parent=nullptr)
virtual QString description(void) const override
A vehicle component is an object which abstracts the physical portion of a vehicle into a set of conf...
int firmwareMinorVersion() const
ParameterManager * parameterManager()
int firmwareMajorVersion() const