QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
PX4FlightModeConfig.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QList>
4#include <QtCore/QString>
5#include <QtCore/QStringList>
6#include <QtCore/QVariantList>
7
11namespace PX4FlightModeConfig {
12
14inline constexpr int kModeSlotCount = 6;
15
17inline constexpr int kMaxButtonChannels = 18;
18
25
26struct Choice
27{
28 QString label;
29 int value = 0;
30
31 bool operator==(const Choice&) const = default;
32};
33
35SelectionMethod selectionMethod(int modeChannel, int buttonMask);
36
39QList<int> buttonChannels(int buttonMask);
40
42QList<int> ignoredButtonChannels(int buttonMask);
43
46int externalModeIndex(const QString& paramName, int value);
47
51QList<Choice> modeChoices(const QString& paramName, const QStringList& enumStrings, const QVariantList& enumValues,
52 const QStringList& externalNames, int currentValue);
53
55QString modeName(const QString& paramName, const QStringList& enumStrings, const QVariantList& enumValues,
56 const QStringList& externalNames, int value);
57
58} // namespace PX4FlightModeConfig
QList< int > buttonChannels(int buttonMask)
QString modeName(const QString &paramName, const QStringList &enumStrings, const QVariantList &enumValues, const QStringList &externalNames, int value)
Label of the mode a parameter value selects, as modeChoices shows it. Empty for a value with no choic...
int externalModeIndex(const QString &paramName, int value)
constexpr int kMaxButtonChannels
Number of RC channels RC_MAP_FLTM_BTN has a bit for.
SelectionMethod selectionMethod(int modeChannel, int buttonMask)
PX4 ignores the mode buttons while a mode channel is set.
QList< Choice > modeChoices(const QString &paramName, const QStringList &enumStrings, const QVariantList &enumValues, const QStringList &externalNames, int currentValue)
QList< int > ignoredButtonChannels(int buttonMask)
Channels set in RC_MAP_FLTM_BTN that PX4 ignores, because only the lowest kModeSlotCount get a slot.
constexpr int kModeSlotCount
Number of mode slots, COM_FLTMODE1 to COM_FLTMODE6.
bool operator==(const Choice &) const =default