|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <MissionCommandTree.h>
Inheritance diagram for MissionCommandTree:
Collaboration diagram for MissionCommandTree:Public Member Functions | |
| MissionCommandTree (bool unitTest=false, QObject *parent=nullptr) | |
| ~MissionCommandTree () | |
| Destructor for the MissionCommandTree class. | |
| QStringList | categoriesForVehicle (Vehicle *vehicle) |
| QVariantList | getCommandsForCategory (Vehicle *vehicle, const QString &category, bool showFlyThroughCommands) |
| QString | friendlyName (MAV_CMD command) const |
| Returns the friendly name for the specified command. | |
| QString | rawName (MAV_CMD command) const |
| Returns the raw name for the specified command. | |
| bool | isLandCommand (MAV_CMD command) const |
| bool | isTakeoffCommand (MAV_CMD command) const |
| const QList< MAV_CMD > & | allCommandIds () const |
| const MissionCommandUIInfo * | getUIInfo (Vehicle *vehicle, QGCMAVLink::VehicleClass_t vtolMode, MAV_CMD command) |
Static Public Member Functions | |
| static MissionCommandTree * | instance () |
Manages a hierarchy of MissionCommandUIInfo.
The static hierarchy allows for overriding mission command ui info based on firmware and vehicle class. The hierarchy of the tree is: FirmwareClassGeneric - VehicleClassGeneric - Base set of all command definitions for any firmware, any vehicle, ui defined by mavlink spec FirmwareClassGeneric - VehicleClassFixedWing Known Firmware, Fixed Wing Any Firmware, Multi Rotor (all types) Known Firmware, Multi Rotor (all types) Any Firmware, VTOL (all types) Known Firmware, VTOL (all types) Any Firmware, Rover Known Firmware, Rover Any Firmware, Sub Known Firmware, Sub For known firmwares, the override files are requested from the FirmwarePlugin.
When ui info is requested for a specific vehicle the static hierarchy in _staticCommandTree is collapsed into the set of available commands in _allCommands taking into account the appropriate set of overrides for the MAV_AUTOPILOT/MAV_TYPE combination associated with the vehicle.
Definition at line 35 of file MissionCommandTree.h.
|
explicit |
Constructs an MissionCommandTree object.
| unitTest | Unit Tests are Running. |
| parent | The parent QObject. |
Definition at line 15 of file MissionCommandTree.cc.
References QGCMAVLink::allVehicleClasses(), QGCMAVLink::FirmwareClassGeneric, QGCMAVLink::firmwareClassToAutopilot(), FirmwarePluginManager::firmwarePluginForAutopilot(), FirmwarePluginManager::instance(), FirmwarePlugin::missionCommandOverrides(), FirmwarePluginManager::supportedFirmwareClasses(), QGCMAVLink::VehicleClassFixedWing, QGCMAVLink::VehicleClassGeneric, QGCMAVLink::VehicleClassMultiRotor, QGCMAVLink::VehicleClassRoverBoat, QGCMAVLink::VehicleClassSub, and QGCMAVLink::VehicleClassVTOL.
| MissionCommandTree::~MissionCommandTree | ( | ) |
Destructor for the MissionCommandTree class.
Definition at line 43 of file MissionCommandTree.cc.
| const QList< MAV_CMD > & MissionCommandTree::allCommandIds | ( | ) | const |
Definition at line 169 of file MissionCommandTree.cc.
References QGCMAVLink::FirmwareClassGeneric, and QGCMAVLink::VehicleClassGeneric.
| QStringList MissionCommandTree::categoriesForVehicle | ( | Vehicle * | vehicle | ) |
Definition at line 192 of file MissionCommandTree.cc.
| QString MissionCommandTree::friendlyName | ( | MAV_CMD | command | ) | const |
Returns the friendly name for the specified command.
Definition at line 137 of file MissionCommandTree.cc.
References QGCMAVLink::FirmwareClassGeneric, MissionCommandUIInfo::friendlyName(), MissionCommandList::getUIInfo(), and QGCMAVLink::VehicleClassGeneric.
Referenced by Vehicle::_sendMavCommandFromList(), and Vehicle::showCommandAckError().
| QVariantList MissionCommandTree::getCommandsForCategory | ( | Vehicle * | vehicle, |
| const QString & | category, | ||
| bool | showFlyThroughCommands | ||
| ) |
| showFlyThroughCommands | - true: all commands shows, false: filter out commands which the vehicle flies through (specifiedCoordinate=true, standaloneCoordinate=false) |
Definition at line 197 of file MissionCommandTree.cc.
References MissionCommandUIInfo::category(), QGCMAVLink::firmwareClassToAutopilot(), FirmwarePluginManager::firmwarePluginForAutopilot(), FirmwarePluginManager::instance(), MissionCommandUIInfo::isStandaloneCoordinate(), MissionCommandUIInfo::specifiesCoordinate(), FirmwarePlugin::supportedMissionCommands(), QGCMAVLink::VehicleClassGeneric, and QGCMAVLink::vehicleClassToMavType().
| const MissionCommandUIInfo * MissionCommandTree::getUIInfo | ( | Vehicle * | vehicle, |
| QGCMAVLink::VehicleClass_t | vtolMode, | ||
| MAV_CMD | command | ||
| ) |
Definition at line 174 of file MissionCommandTree.cc.
Referenced by LandingComplexItem::_createDoLandStartItem(), TransectStyleComplexItem::_load(), TransectStyleComplexItem::amslEntryAlt(), TransectStyleComplexItem::amslExitAlt(), SimpleMissionItem::applyNewAltitude(), SimpleMissionItem::category(), SimpleMissionItem::commandDescription(), SimpleMissionItem::commandName(), SimpleMissionItem::friendlyEditAllowed(), MissionManager::generateResumeMission(), SimpleMissionItem::isLoiterItem(), SimpleMissionItem::isStandaloneCoordinate(), SimpleMissionItem::showLoiterRadius(), SimpleMissionItem::specifiesAltitudeOnly(), and SimpleMissionItem::specifiesCoordinate().
|
static |
Gets the singleton instance of MissionCommandTree.
Definition at line 57 of file MissionCommandTree.cc.
Referenced by LandingComplexItem::_createDoLandStartItem(), PlanManager::_lastMissionReqestString(), TransectStyleComplexItem::_load(), VehicleCameraControl::_mavCommandResult(), Vehicle::_sendMavCommandFromList(), Vehicle::_sendMavCommandWorker(), TransectStyleComplexItem::amslEntryAlt(), TransectStyleComplexItem::amslExitAlt(), SimpleMissionItem::applyNewAltitude(), SimpleMissionItem::category(), SimpleMissionItem::commandDescription(), SimpleMissionItem::commandName(), SimpleMissionItem::friendlyEditAllowed(), MissionManager::generateResumeMission(), SimpleMissionItem::isLandCommand(), SimpleMissionItem::isLoiterItem(), SimpleMissionItem::isStandaloneCoordinate(), TakeoffMissionItem::isTakeoffCommand(), SendMavlinkCommandState::onWaitEntered(), Vehicle::showCommandAckError(), SimpleMissionItem::showLoiterRadius(), SimpleMissionItem::specifiesAltitudeOnly(), and SimpleMissionItem::specifiesCoordinate().
| bool MissionCommandTree::isLandCommand | ( | MAV_CMD | command | ) | const |
Definition at line 153 of file MissionCommandTree.cc.
References QGCMAVLink::FirmwareClassGeneric, MissionCommandList::getUIInfo(), MissionCommandUIInfo::isLandCommand(), and QGCMAVLink::VehicleClassGeneric.
Referenced by SimpleMissionItem::isLandCommand().
| bool MissionCommandTree::isTakeoffCommand | ( | MAV_CMD | command | ) | const |
Definition at line 161 of file MissionCommandTree.cc.
References QGCMAVLink::FirmwareClassGeneric, MissionCommandList::getUIInfo(), MissionCommandUIInfo::isTakeoffCommand(), and QGCMAVLink::VehicleClassGeneric.
Referenced by TakeoffMissionItem::isTakeoffCommand().
| QString MissionCommandTree::rawName | ( | MAV_CMD | command | ) | const |
Returns the raw name for the specified command.
Definition at line 145 of file MissionCommandTree.cc.
References QGCMAVLink::FirmwareClassGeneric, MissionCommandList::getUIInfo(), MissionCommandUIInfo::rawName(), and QGCMAVLink::VehicleClassGeneric.
Referenced by VehicleCameraControl::_mavCommandResult(), Vehicle::_sendMavCommandFromList(), Vehicle::_sendMavCommandWorker(), and Vehicle::showCommandAckError().