QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
MissionController Class Reference

#include <MissionController.h>

+ Inheritance diagram for MissionController:
+ Collaboration diagram for MissionController:

Classes

struct  MissionFlightStatus_t
 

Public Types

enum  SendToVehiclePreCheckState { SendToVehiclePreCheckStateOk , SendToVehiclePreCheckStateNoActiveVehicle , SendToVehiclePreCheckStateFirwmareVehicleMismatch , SendToVehiclePreCheckStateActiveMission }
 

Signals

void visualItemsChanged (void)
 
void splitSegmentChanged (void)
 
void newItemsFromVehicle (void)
 
void missionTotalDistanceChanged (double missionTotalDistance)
 
void missionPlannedDistanceChanged (double missionPlannedDistance)
 
void missionTimeChanged (void)
 
void missionHoverDistanceChanged (double missionHoverDistance)
 
void missionHoverTimeChanged (void)
 
void missionCruiseDistanceChanged (double missionCruiseDistance)
 
void missionCruiseTimeChanged (void)
 
void missionMaxTelemetryChanged (double missionMaxTelemetry)
 
void complexMissionItemNamesChanged (void)
 
void resumeMissionIndexChanged (void)
 
void resumeMissionReady (void)
 
void resumeMissionUploadFail (void)
 
void batteryChangePointChanged (int batteryChangePoint)
 
void batteriesRequiredChanged (int batteriesRequired)
 
void plannedHomePositionChanged (QGeoCoordinate plannedHomePosition)
 
void progressPctChanged (double progressPct)
 
void currentMissionIndexChanged (int currentMissionIndex)
 
void currentPlanViewSeqNumChanged (void)
 
void currentPlanViewVIIndexChanged (void)
 
void currentPlanViewItemChanged (void)
 
void takeoffMissionItemChanged (void)
 
void missionBoundingCubeChanged (void)
 
void missionItemCountChanged (int missionItemCount)
 
void onlyInsertTakeoffValidChanged (void)
 
void isInsertTakeoffValidChanged (void)
 
void isInsertLandValidChanged (void)
 
void hasLandItemChanged (void)
 
void multipleLandPatternsAllowedChanged (void)
 
void isROIActiveChanged (void)
 
void isROIBeginCurrentItemChanged (void)
 
void flyThroughCommandsAllowedChanged (void)
 
void previousCoordinateChanged (void)
 
void minAMSLAltitudeChanged (double minAMSLAltitude)
 
void maxAMSLAltitudeChanged (double maxAMSLAltitude)
 
void recalcTerrainProfile (void)
 
void _recalcMissionFlightStatusSignal (void)
 
void _recalcFlightPathSegmentsSignal (void)
 
void globalAltitudeModeChanged (void)
 
- Signals inherited from PlanElementController
void supportedChanged (bool supported)
 
void containsItemsChanged ()
 
void syncInProgressChanged (bool syncInProgress)
 
void dirtyChanged (bool dirty)
 
void sendComplete (void)
 
void removeAllComplete (void)
 

Public Member Functions

 MissionController (PlanMasterController *masterController, QObject *parent=nullptr)
 
 ~MissionController ()
 
VisualMissionIteminsertSimpleMissionItem (QGeoCoordinate coordinate, int visualItemIndex, bool makeCurrentItem=false)
 
VisualMissionIteminsertTakeoffItem (QGeoCoordinate coordinate, int visualItemIndex, bool makeCurrentItem=false)
 
VisualMissionIteminsertLandItem (QGeoCoordinate coordinate, int visualItemIndex, bool makeCurrentItem=false)
 
VisualMissionIteminsertROIMissionItem (QGeoCoordinate coordinate, int visualItemIndex, bool makeCurrentItem=false)
 
VisualMissionIteminsertCancelROIMissionItem (int visualItemIndex, bool makeCurrentItem=false)
 
VisualMissionIteminsertComplexMissionItem (QString itemName, QGeoCoordinate mapCenterCoordinate, int visualItemIndex, bool makeCurrentItem=false)
 
VisualMissionIteminsertComplexMissionItemFromKMLOrSHP (QString itemName, QString file, int visualItemIndex, bool makeCurrentItem=false)
 
void resumeMission (int resumeIndex)
 
void applyDefaultMissionAltitude (void)
 Updates the altitudes of the items in the current mission to the new default altitude.
 
void setCurrentPlanViewSeqNum (int sequenceNumber, bool force)
 
void repositionMission (const QGeoCoordinate &newHome, bool repositionTakeoffItems=true, bool repositionLandingItems=true)
 
void offsetMission (double eastMeters, double northMeters, double upMeters=0.0, bool offsetTakeoffItems=false, bool offsetLandingItems=false)
 
void rotateMission (double degreesCW, bool rotateTakeoffItems=false, bool rotateLandingItems=false)
 
SendToVehiclePreCheckState sendToVehiclePreCheck (void)
 
int readyForSaveState (void) const
 
bool loadTextFile (QFile &file, QString &errorString)
 
QGCGeoBoundingCubetravelBoundingCube ()
 
QGeoCoordinate takeoffCoordinate ()
 
bool supported (void) const final
 true: controller is waiting for the current load to complete
 
void start (bool flyView) final
 Should be called immediately upon Component.onCompleted.
 
void save (QJsonObject &json) final
 
bool load (const QJsonObject &json, QString &errorString) final
 
void loadFromVehicle (void) final
 
void sendToVehicle (void) final
 
void removeAll (void) final
 Removes all from controller only.
 
void removeAllFromVehicle (void) final
 
bool syncInProgress (void) const final
 
bool dirty (void) const final
 
void setDirty (bool dirty) final
 
bool containsItems (void) const final
 
bool showPlanFromManagerVehicle (void) final
 
void addMissionToKML (KMLPlanDomDocument &planKML)
 
QmlObjectListModelvisualItems (void)
 
QmlObjectTreeModelvisualItemsTree (void)
 
QPersistentModelIndex planFileGroupIndex (void) const
 
QPersistentModelIndex defaultsGroupIndex (void) const
 
QPersistentModelIndex missionGroupIndex (void) const
 
QPersistentModelIndex fenceGroupIndex (void) const
 
QPersistentModelIndex rallyGroupIndex (void) const
 
QmlObjectListModelsimpleFlightPathSegments (void)
 
QmlObjectListModeldirectionArrows (void)
 
QStringList complexMissionItemNames (void) const
 
QGeoCoordinate plannedHomePosition (void) const
 
VisualMissionItemcurrentPlanViewItem (void) const
 
TakeoffMissionItemtakeoffMissionItem (void) const
 
double progressPct (void) const
 
QString surveyComplexItemName (void) const
 
QString corridorScanComplexItemName (void) const
 
QString structureScanComplexItemName (void) const
 
bool isInsertTakeoffValid (void) const
 
bool multipleLandPatternsAllowed (void) const
 
double minAMSLAltitude (void) const
 
double maxAMSLAltitude (void) const
 
int missionItemCount (void) const
 
int currentMissionIndex (void) const
 
int resumeMissionIndex (void) const
 
int currentPlanViewSeqNum (void) const
 
int currentPlanViewVIIndex (void) const
 
double missionTotalDistance (void) const
 
double missionPlannedDistance (void) const
 
double missionTime (void) const
 
double missionHoverDistance (void) const
 
double missionHoverTime (void) const
 
double missionCruiseDistance (void) const
 
double missionCruiseTime (void) const
 
double missionMaxTelemetry (void) const
 
int batteryChangePoint (void) const
 -1 for not supported, 0 for not needed
 
int batteriesRequired (void) const
 -1 for not supported
 
bool isFirstLandingComplexItem (const LandingComplexItem *item) const
 
bool isEmpty (void) const
 
QGroundControlQmlGlobal::AltMode globalAltitudeMode (void)
 
QGroundControlQmlGlobal::AltMode globalAltitudeModeDefault (void)
 
void setGlobalAltitudeMode (QGroundControlQmlGlobal::AltMode altMode)
 
- Public Member Functions inherited from PlanElementController
 PlanElementController (PlanMasterController *masterController, QObject *parent=nullptr)
 
 ~PlanElementController ()
 
PlanMasterController *masterController READ masterController CONSTANT (bool supported READ supported NOTIFY supportedChanged) 1(bool containsItems READ containsItems NOTIFY containsItemsChanged) 1(bool syncInProgress READ syncInProgress NOTIFY syncInProgressChanged) 1(bool dirty READ dirty WRITE setDirty NOTIFY dirtyChanged) PlanMasterController *masterController(void)
 < true: Elemement is non-empty
 

Static Public Member Functions

static void sendItemsToVehicle (Vehicle *vehicle, QmlObjectListModel *visualMissionItems)
 Sends the mission items to the specified vehicle.
 

Public Attributes

QmlObjectListModel *visualItems READ visualItems NOTIFY visualItemsChanged(QmlObjectTreeModel *visualItemsTree READ visualItemsTree CONSTANT) 1(QPersistentModelIndex planFileGroupIndex READ planFileGroupIndex CONSTANT) 1(QPersistentModelIndex defaultsGroupIndex READ defaultsGroupIndex CONSTANT) 1(QPersistentModelIndex missionGroupIndex READ missionGroupIndex CONSTANT) 1(QPersistentModelIndex fenceGroupIndex READ fenceGroupIndex CONSTANT) 1(QPersistentModelIndex rallyGroupIndex READ rallyGroupIndex CONSTANT) 1(QmlObjectListModel *simpleFlightPathSegments READ simpleFlightPathSegments CONSTANT) 1(QmlObjectListModel *directionArrows READ directionArrows CONSTANT) 1(QStringList complexMissionItemNames READ complexMissionItemNames NOTIFY complexMissionItemNamesChanged) 1(QGeoCoordinate plannedHomePosition READ plannedHomePosition NOTIFY plannedHomePositionChanged) 1(QGeoCoordinate previousCoordinate MEMBER _previousCoordinate NOTIFY previousCoordinateChanged) 1(FlightPathSegment *splitSegment MEMBER _splitSegment NOTIFY splitSegmentChanged) 1(double progressPct READ progressPct NOTIFY progressPctChanged) 1(int missionItemCount READ missionItemCount NOTIFY missionItemCountChanged) 1(int currentMissionIndex READ currentMissionIndex NOTIFY currentMissionIndexChanged) 1(int resumeMissionIndex READ resumeMissionIndex NOTIFY resumeMissionIndexChanged) 1(int currentPlanViewSeqNum READ currentPlanViewSeqNum NOTIFY currentPlanViewSeqNumChanged) 1(int currentPlanViewVIIndex READ currentPlanViewVIIndex NOTIFY currentPlanViewVIIndexChanged) 1(VisualMissionItem *currentPlanViewItem READ currentPlanViewItem NOTIFY currentPlanViewItemChanged) 1(TakeoffMissionItem *takeoffMissionItem READ takeoffMissionItem NOTIFY takeoffMissionItemChanged) 1(double missionTotalDistance READ missionTotalDistance NOTIFY missionTotalDistanceChanged) 1(double missionPlannedDistance READ missionPlannedDistance NOTIFY missionPlannedDistanceChanged) 1(double missionTime READ missionTime NOTIFY missionTimeChanged) 1(double missionHoverDistance READ missionHoverDistance NOTIFY missionHoverDistanceChanged) 1(double missionCruiseDistance READ missionCruiseDistance NOTIFY missionCruiseDistanceChanged) 1(double missionHoverTime READ missionHoverTime NOTIFY missionHoverTimeChanged) 1(double missionCruiseTime READ missionCruiseTime NOTIFY missionCruiseTimeChanged) 1(double missionMaxTelemetry READ missionMaxTelemetry NOTIFY missionMaxTelemetryChanged) 1(int batteryChangePoint READ batteryChangePoint NOTIFY batteryChangePointChanged) 1(int batteriesRequired READ batteriesRequired NOTIFY batteriesRequiredChanged) 1(QGCGeoBoundingCube *travelBoundingCube READ travelBoundingCube NOTIFY missionBoundingCubeChanged) 1(QString surveyComplexItemName READ surveyComplexItemName CONSTANT) 1(QString corridorScanComplexItemName READ corridorScanComplexItemName CONSTANT) 1(QString structureScanComplexItemName READ structureScanComplexItemName CONSTANT) 1(bool onlyInsertTakeoffValid MEMBER _onlyInsertTakeoffValid NOTIFY onlyInsertTakeoffValidChanged) 1(bool isInsertTakeoffValid MEMBER _isInsertTakeoffValid NOTIFY isInsertTakeoffValidChanged) 1(bool isInsertLandValid MEMBER _isInsertLandValid NOTIFY isInsertLandValidChanged) 1(bool hasLandItem MEMBER _hasLandItem NOTIFY hasLandItemChanged) 1(bool multipleLandPatternsAllowed READ multipleLandPatternsAllowed NOTIFY multipleLandPatternsAllowedChanged) 1(bool isROIActive MEMBER _isROIActive NOTIFY isROIActiveChanged) 1(bool isROIBeginCurrentItem MEMBER _isROIBeginCurrentItem NOTIFY isROIBeginCurrentItemChanged) 1(bool flyThroughCommandsAllowed MEMBER _flyThroughCommandsAllowed NOTIFY flyThroughCommandsAllowedChanged) 1(double minAMSLAltitude MEMBER _minAMSLAltitude NOTIFY minAMSLAltitudeChanged) 1(double maxAMSLAltitude MEMBER _maxAMSLAltitude NOTIFY maxAMSLAltitudeChanged) 1(QGroundControlQmlGlobal in visualItemIndexForObject )(QObject *object) const
 < Used by Plan view only for interactive editing
 

Static Public Attributes

static constexpr int kPlanFileGroupRow = 0
 
static constexpr int kDefaultsGroupRow = 1
 
static constexpr int kMissionGroupRow = 2
 
static constexpr int kFenceGroupRow = 3
 
static constexpr int kRallyGroupRow = 4
 
static constexpr int kGroupCount = 5
 

Additional Inherited Members

- Protected Attributes inherited from PlanElementController
PlanMasterController_masterController
 
bool _flyView
 

Detailed Description

Definition at line 36 of file MissionController.h.

Member Enumeration Documentation

◆ SendToVehiclePreCheckState

Enumerator
SendToVehiclePreCheckStateOk 
SendToVehiclePreCheckStateNoActiveVehicle 
SendToVehiclePreCheckStateFirwmareVehicleMismatch 
SendToVehiclePreCheckStateActiveMission 

Definition at line 234 of file MissionController.h.

Constructor & Destructor Documentation

◆ MissionController()

◆ ~MissionController()

MissionController::~MissionController ( )

Definition at line 64 of file MissionController.cc.

Member Function Documentation

◆ _recalcFlightPathSegmentsSignal

void MissionController::_recalcFlightPathSegmentsSignal ( void  )
signal

◆ _recalcMissionFlightStatusSignal

void MissionController::_recalcMissionFlightStatusSignal ( void  )
signal

Referenced by MissionController().

◆ addMissionToKML()

void MissionController::addMissionToKML ( KMLPlanDomDocument planKML)

Definition at line 273 of file MissionController.cc.

References KMLPlanDomDocument::addMission().

Referenced by PlanMasterController::saveToKml().

◆ applyDefaultMissionAltitude()

void MissionController::applyDefaultMissionAltitude ( void  )

Updates the altitudes of the items in the current mission to the new default altitude.

Definition at line 2437 of file MissionController.cc.

References VisualMissionItem::applyNewAltitude(), QmlObjectListModel::count(), AppSettings::defaultMissionItemAltitude(), and QmlObjectListModel::value().

◆ batteriesRequired()

int MissionController::batteriesRequired ( void  ) const
inline

-1 for not supported

Definition at line 315 of file MissionController.h.

References MissionController::MissionFlightStatus_t::batteriesRequired.

◆ batteriesRequiredChanged

void MissionController::batteriesRequiredChanged ( int  batteriesRequired)
signal

◆ batteryChangePoint()

int MissionController::batteryChangePoint ( void  ) const
inline

-1 for not supported, 0 for not needed

Definition at line 314 of file MissionController.h.

References MissionController::MissionFlightStatus_t::batteryChangePoint.

◆ batteryChangePointChanged

void MissionController::batteryChangePointChanged ( int  batteryChangePoint)
signal

◆ complexMissionItemNames()

QStringList MissionController::complexMissionItemNames ( void  ) const

◆ complexMissionItemNamesChanged

void MissionController::complexMissionItemNamesChanged ( void  )
signal

◆ containsItems()

bool MissionController::containsItems ( void  ) const
finalvirtual

Implements PlanElementController.

Definition at line 2388 of file MissionController.cc.

References QmlObjectListModel::count().

Referenced by PlanMasterController::containsItems().

◆ corridorScanComplexItemName()

QString MissionController::corridorScanComplexItemName ( void  ) const

Definition at line 2950 of file MissionController.cc.

References CorridorScanComplexItem::name.

◆ currentMissionIndex()

int MissionController::currentMissionIndex ( void  ) const

◆ currentMissionIndexChanged

void MissionController::currentMissionIndexChanged ( int  currentMissionIndex)
signal

◆ currentPlanViewItem()

VisualMissionItem * MissionController::currentPlanViewItem ( void  ) const
inline

Definition at line 288 of file MissionController.h.

◆ currentPlanViewItemChanged

void MissionController::currentPlanViewItemChanged ( void  )
signal

◆ currentPlanViewSeqNum()

int MissionController::currentPlanViewSeqNum ( void  ) const
inline

Definition at line 302 of file MissionController.h.

◆ currentPlanViewSeqNumChanged

void MissionController::currentPlanViewSeqNumChanged ( void  )
signal

◆ currentPlanViewVIIndex()

int MissionController::currentPlanViewVIIndex ( void  ) const
inline

Definition at line 303 of file MissionController.h.

◆ currentPlanViewVIIndexChanged

void MissionController::currentPlanViewVIIndexChanged ( void  )
signal

◆ defaultsGroupIndex()

QPersistentModelIndex MissionController::defaultsGroupIndex ( void  ) const
inline

Definition at line 280 of file MissionController.h.

◆ directionArrows()

QmlObjectListModel * MissionController::directionArrows ( void  )
inline

Definition at line 285 of file MissionController.h.

◆ dirty()

bool MissionController::dirty ( void  ) const
finalvirtual

Implements PlanElementController.

Definition at line 2337 of file MissionController.cc.

Referenced by setDirty().

◆ fenceGroupIndex()

QPersistentModelIndex MissionController::fenceGroupIndex ( void  ) const
inline

Definition at line 282 of file MissionController.h.

◆ flyThroughCommandsAllowedChanged

void MissionController::flyThroughCommandsAllowedChanged ( void  )
signal

◆ globalAltitudeMode()

QGroundControlQmlGlobal::AltMode MissionController::globalAltitudeMode ( void  )

Definition at line 2988 of file MissionController.cc.

Referenced by insertComplexMissionItem().

◆ globalAltitudeModeChanged

void MissionController::globalAltitudeModeChanged ( void  )
signal

Referenced by setGlobalAltitudeMode().

◆ globalAltitudeModeDefault()

QGroundControlQmlGlobal::AltMode MissionController::globalAltitudeModeDefault ( void  )

◆ hasLandItemChanged

void MissionController::hasLandItemChanged ( void  )
signal

◆ insertCancelROIMissionItem()

VisualMissionItem * MissionController::insertCancelROIMissionItem ( int  visualItemIndex,
bool  makeCurrentItem = false 
)

Add a new Cancel ROI mission item to the list

Parameters
visualItemIndexindex to insert at, -1 for end of list
makeCurrentItemtrue: Make this item the current item
Returns
Newly created item

Definition at line 419 of file MissionController.cc.

References Vehicle::firmwarePlugin(), SimpleMissionItem::missionItem(), SimpleMissionItem::setCommand(), MissionItem::setParam1(), FirmwarePlugin::supportedMissionCommands(), and QGCMAVLink::VehicleClassGeneric.

◆ insertComplexMissionItem()

VisualMissionItem * MissionController::insertComplexMissionItem ( QString  itemName,
QGeoCoordinate  mapCenterCoordinate,
int  visualItemIndex,
bool  makeCurrentItem = false 
)

Add a new complex mission item to the list

Parameters
itemNameName of complex item to create (from complexMissionItemNames)
mapCenterCoordinatecoordinate for current center of map
visualItemIndexindex to insert at, -1 for end of list
makeCurrentItemtrue: Make this item the current item
Returns
Newly created item

Definition at line 431 of file MissionController.cc.

References PlanElementController::_flyView, PlanElementController::_masterController, QGroundControlQmlGlobal::AltitudeModeMixed, globalAltitudeMode(), CorridorScanComplexItem::name, FixedWingLandingComplexItem::name, StructureScanComplexItem::name, SurveyComplexItem::name, VTOLLandingComplexItem::name, and VisualMissionItem::setCoordinate().

Referenced by CorridorScanPlanCreator::createPlan(), StructureScanPlanCreator::createPlan(), SurveyPlanCreator::createPlan(), and insertLandItem().

◆ insertComplexMissionItemFromKMLOrSHP()

VisualMissionItem * MissionController::insertComplexMissionItemFromKMLOrSHP ( QString  itemName,
QString  file,
int  visualItemIndex,
bool  makeCurrentItem = false 
)

Add a new complex mission item to the list

Parameters
itemNameName of complex item to create (from complexMissionItemNames)
filekml or shp file to load from shape from
coordinateCoordinate for item
visualItemIndexindex to insert at, -1 for end of list
makeCurrentItemtrue: Make this item the current item
Returns
Newly created item

Definition at line 465 of file MissionController.cc.

References PlanElementController::_flyView, PlanElementController::_masterController, CorridorScanComplexItem::name, StructureScanComplexItem::name, and SurveyComplexItem::name.

◆ insertLandItem()

VisualMissionItem * MissionController::insertLandItem ( QGeoCoordinate  coordinate,
int  visualItemIndex,
bool  makeCurrentItem = false 
)

Add a new land item to the list

Parameters
coordinateCoordinate for item
visualItemIndexindex to insert at, -1 for end of list
makeCurrentItemtrue: Make this item the current item
Returns
Newly created item

Definition at line 394 of file MissionController.cc.

References Vehicle::fixedWing(), insertComplexMissionItem(), FixedWingLandingComplexItem::name, VTOLLandingComplexItem::name, and Vehicle::vtol().

Referenced by CorridorScanPlanCreator::createPlan(), StructureScanPlanCreator::createPlan(), and SurveyPlanCreator::createPlan().

◆ insertROIMissionItem()

VisualMissionItem * MissionController::insertROIMissionItem ( QGeoCoordinate  coordinate,
int  visualItemIndex,
bool  makeCurrentItem = false 
)

Add a new ROI mission item to the list

Parameters
coordinateCoordinate for item
visualItemIndexindex to insert at, -1 for end of list
makeCurrentItemtrue: Make this item the current item
Returns
Newly created item

Definition at line 407 of file MissionController.cc.

References Vehicle::firmwarePlugin(), SimpleMissionItem::missionItem(), SimpleMissionItem::setCommand(), MissionItem::setParam1(), FirmwarePlugin::supportedMissionCommands(), and QGCMAVLink::VehicleClassGeneric.

◆ insertSimpleMissionItem()

VisualMissionItem * MissionController::insertSimpleMissionItem ( QGeoCoordinate  coordinate,
int  visualItemIndex,
bool  makeCurrentItem = false 
)

Add a new simple mission item to the list

Parameters
coordinateCoordinate for item
visualItemIndexindex to insert at, -1 for end of list
makeCurrentItemtrue: Make this item the current item
Returns
Newly created item

Definition at line 348 of file MissionController.cc.

◆ insertTakeoffItem()

VisualMissionItem * MissionController::insertTakeoffItem ( QGeoCoordinate  coordinate,
int  visualItemIndex,
bool  makeCurrentItem = false 
)

◆ isEmpty()

bool MissionController::isEmpty ( void  ) const

Definition at line 2934 of file MissionController.cc.

References QmlObjectListModel::count().

Referenced by PlanMasterController::isEmpty().

◆ isFirstLandingComplexItem()

bool MissionController::isFirstLandingComplexItem ( const LandingComplexItem item) const

◆ isInsertLandValidChanged

void MissionController::isInsertLandValidChanged ( void  )
signal

◆ isInsertTakeoffValid()

bool MissionController::isInsertTakeoffValid ( void  ) const

◆ isInsertTakeoffValidChanged

void MissionController::isInsertTakeoffValidChanged ( void  )
signal

◆ isROIActiveChanged

void MissionController::isROIActiveChanged ( void  )
signal

◆ isROIBeginCurrentItemChanged

void MissionController::isROIBeginCurrentItemChanged ( void  )
signal

◆ load()

bool MissionController::load ( const QJsonObject &  json,
QString &  errorString 
)
finalvirtual

Implements PlanElementController.

Definition at line 1022 of file MissionController.cc.

References errorString.

Referenced by PlanMasterController::loadFromFile().

◆ loadFromVehicle()

◆ loadTextFile()

bool MissionController::loadTextFile ( QFile &  file,
QString &  errorString 
)

◆ maxAMSLAltitude()

double MissionController::maxAMSLAltitude ( void  ) const
inline

Definition at line 297 of file MissionController.h.

Referenced by TerrainProfile::updatePaintNode().

◆ maxAMSLAltitudeChanged

void MissionController::maxAMSLAltitudeChanged ( double  maxAMSLAltitude)
signal

◆ minAMSLAltitude()

double MissionController::minAMSLAltitude ( void  ) const
inline

Definition at line 296 of file MissionController.h.

Referenced by TerrainProfile::updatePaintNode().

◆ minAMSLAltitudeChanged

void MissionController::minAMSLAltitudeChanged ( double  minAMSLAltitude)
signal

◆ missionBoundingCubeChanged

void MissionController::missionBoundingCubeChanged ( void  )
signal

◆ missionCruiseDistance()

double MissionController::missionCruiseDistance ( void  ) const
inline

◆ missionCruiseDistanceChanged

void MissionController::missionCruiseDistanceChanged ( double  missionCruiseDistance)
signal

◆ missionCruiseTime()

double MissionController::missionCruiseTime ( void  ) const
inline

◆ missionCruiseTimeChanged

void MissionController::missionCruiseTimeChanged ( void  )
signal

◆ missionGroupIndex()

QPersistentModelIndex MissionController::missionGroupIndex ( void  ) const
inline

Definition at line 281 of file MissionController.h.

◆ missionHoverDistance()

double MissionController::missionHoverDistance ( void  ) const
inline

◆ missionHoverDistanceChanged

void MissionController::missionHoverDistanceChanged ( double  missionHoverDistance)
signal

◆ missionHoverTime()

double MissionController::missionHoverTime ( void  ) const
inline

◆ missionHoverTimeChanged

void MissionController::missionHoverTimeChanged ( void  )
signal

◆ missionItemCount()

int MissionController::missionItemCount ( void  ) const
inline

Definition at line 299 of file MissionController.h.

◆ missionItemCountChanged

void MissionController::missionItemCountChanged ( int  missionItemCount)
signal

◆ missionMaxTelemetry()

double MissionController::missionMaxTelemetry ( void  ) const
inline

◆ missionMaxTelemetryChanged

void MissionController::missionMaxTelemetryChanged ( double  missionMaxTelemetry)
signal

◆ missionPlannedDistance()

double MissionController::missionPlannedDistance ( void  ) const
inline

◆ missionPlannedDistanceChanged

void MissionController::missionPlannedDistanceChanged ( double  missionPlannedDistance)
signal

Referenced by MissionController().

◆ missionTime()

double MissionController::missionTime ( void  ) const
inline

◆ missionTimeChanged

void MissionController::missionTimeChanged ( void  )
signal

◆ missionTotalDistance()

double MissionController::missionTotalDistance ( void  ) const
inline

◆ missionTotalDistanceChanged

void MissionController::missionTotalDistanceChanged ( double  missionTotalDistance)
signal

◆ multipleLandPatternsAllowed()

bool MissionController::multipleLandPatternsAllowed ( void  ) const

◆ multipleLandPatternsAllowedChanged

void MissionController::multipleLandPatternsAllowedChanged ( void  )
signal

Referenced by MissionController().

◆ newItemsFromVehicle

void MissionController::newItemsFromVehicle ( void  )
signal

◆ offsetMission()

void MissionController::offsetMission ( double  eastMeters,
double  northMeters,
double  upMeters = 0.0,
bool  offsetTakeoffItems = false,
bool  offsetLandingItems = false 
)

Offsets all mission items which specify a coordinate by the specified ENU amounts in meters. Home altitude remains unchanged. Requires a valid planned home position; otherwise the mission is not modified and a warning is logged.

Parameters
eastMetersDistance to offset items to the east, in meters
northMetersDistance to offset items to the north, in meters
upMetersDistance to offset items upwards, in meters
offsetTakeoffItemsIf true, items identified as takeoff items (isTakeoffItem) will be offset
offsetLandingItemsIf true, items identified as landing items (isLandCommand) will be offset

Definition at line 2739 of file MissionController.cc.

References VisualMissionItem::applyNewAltitude(), MissionSettingsItem::coordinate(), QmlObjectListModel::count(), VisualMissionItem::editableAlt(), QmlObjectListModel::get(), VisualMissionItem::isLandCommand(), VisualMissionItem::isTakeoffItem(), repositionMission(), VisualMissionItem::specifiesAltitudeOnly(), and VisualMissionItem::specifiesCoordinate().

◆ onlyInsertTakeoffValidChanged

void MissionController::onlyInsertTakeoffValidChanged ( void  )
signal

◆ planFileGroupIndex()

QPersistentModelIndex MissionController::planFileGroupIndex ( void  ) const
inline

Definition at line 279 of file MissionController.h.

◆ plannedHomePosition()

◆ plannedHomePositionChanged

void MissionController::plannedHomePositionChanged ( QGeoCoordinate  plannedHomePosition)
signal

◆ previousCoordinateChanged

void MissionController::previousCoordinateChanged ( void  )
signal

◆ progressPct()

double MissionController::progressPct ( void  ) const
inline

Definition at line 290 of file MissionController.h.

◆ progressPctChanged

void MissionController::progressPctChanged ( double  progressPct)
signal

◆ rallyGroupIndex()

QPersistentModelIndex MissionController::rallyGroupIndex ( void  ) const
inline

Definition at line 283 of file MissionController.h.

◆ readyForSaveState()

int MissionController::readyForSaveState ( void  ) const

Determines if the mission has all data needed to be saved or sent to the vehicle. IMPORTANT NOTE: The return value is a VisualMissionItem::ReadForSaveState value. It is an int here to work around a nightmare of circular header dependency problems.

Definition at line 1057 of file MissionController.cc.

References QmlObjectListModel::count(), QmlObjectListModel::get(), VisualMissionItem::ReadyForSave, and VisualMissionItem::readyForSaveState().

Referenced by PlanMasterController::readyForSaveState().

◆ recalcTerrainProfile

◆ removeAll()

void MissionController::removeAll ( void  )
finalvirtual

Removes all from controller only.

Implements PlanElementController.

Definition at line 609 of file MissionController.cc.

References QmlObjectListModel::clearAndDeleteContents(), and setDirty().

Referenced by PlanMasterController::removeAll().

◆ removeAllFromVehicle()

void MissionController::removeAllFromVehicle ( void  )
finalvirtual

Removes all from vehicle and controller Signals removeAllComplete when done

Implements PlanElementController.

Definition at line 2393 of file MissionController.cc.

References PlanElementController::_masterController, PlanMasterController::offline(), PlanManager::removeAll(), and syncInProgress().

Referenced by PlanMasterController::removeAllFromVehicle().

◆ repositionMission()

void MissionController::repositionMission ( const QGeoCoordinate &  newHome,
bool  repositionTakeoffItems = true,
bool  repositionLandingItems = true 
)

Repositions all mission items which specify a coordinate around a new home coordinate. Requires a valid planned home position; otherwise the mission is not modified and a warning is logged.

Parameters
newHomeNew coordinate for the home item
repositionTakeoffItemsIf true, items identified as takeoff items (isTakeoffItem) will be repositioned
repositionLandingItemsIf true, items identified as landing items (isLandCommand) will be repositioned

Definition at line 2697 of file MissionController.cc.

References VisualMissionItem::coordinate(), MissionSettingsItem::coordinate(), QmlObjectListModel::count(), QmlObjectListModel::get(), VisualMissionItem::isLandCommand(), VisualMissionItem::isStandaloneCoordinate(), VisualMissionItem::isTakeoffItem(), VisualMissionItem::setCoordinate(), setDirty(), and VisualMissionItem::specifiesCoordinate().

Referenced by offsetMission().

◆ resumeMission()

void MissionController::resumeMission ( int  resumeIndex)

◆ resumeMissionIndex()

◆ resumeMissionIndexChanged

void MissionController::resumeMissionIndexChanged ( void  )
signal

◆ resumeMissionReady

void MissionController::resumeMissionReady ( void  )
signal

◆ resumeMissionUploadFail

void MissionController::resumeMissionUploadFail ( void  )
signal

◆ rotateMission()

void MissionController::rotateMission ( double  degreesCW,
bool  rotateTakeoffItems = false,
bool  rotateLandingItems = false 
)

Rotates all mission items which specify a coordinate around the up axis of the home position. Complex items are rotated by moving their reference coordinate: their geometry and orientation are not modified. Requires a valid planned home position; otherwise the mission is not modified and a warning is logged.

Parameters
degreesCWAngle to rotate items by, in degrees clockwise
rotateTakeoffItemsIf true, items identified as takeoff items (isTakeoffItem) will be rotated
rotateLandingItemsIf true, items identified as landing items (isLandCommand) will be rotated

Definition at line 2786 of file MissionController.cc.

References VisualMissionItem::coordinate(), MissionSettingsItem::coordinate(), QmlObjectListModel::count(), QmlObjectListModel::get(), VisualMissionItem::isLandCommand(), VisualMissionItem::isStandaloneCoordinate(), VisualMissionItem::isTakeoffItem(), VisualMissionItem::setCoordinate(), setDirty(), and VisualMissionItem::specifiesCoordinate().

◆ save()

◆ sendItemsToVehicle()

void MissionController::sendItemsToVehicle ( Vehicle vehicle,
QmlObjectListModel visualMissionItems 
)
static

Sends the mission items to the specified vehicle.

Definition at line 283 of file MissionController.cc.

References Vehicle::missionManager(), and PlanManager::writeMissionItems().

Referenced by sendToVehicle().

◆ sendToVehicle()

void MissionController::sendToVehicle ( void  )
finalvirtual

Sends the current plan element to the vehicle Signals sendComplete when done

Implements PlanElementController.

Definition at line 221 of file MissionController.cc.

References PlanElementController::_masterController, QmlObjectListModel::count(), PlanMasterController::offline(), sendItemsToVehicle(), setDirty(), and syncInProgress().

Referenced by PlanMasterController::sendToVehicle().

◆ sendToVehiclePreCheck()

◆ setCurrentPlanViewSeqNum()

void MissionController::setCurrentPlanViewSeqNum ( int  sequenceNumber,
bool  force 
)

◆ setDirty()

void MissionController::setDirty ( bool  dirty)
finalvirtual

◆ setGlobalAltitudeMode()

void MissionController::setGlobalAltitudeMode ( QGroundControlQmlGlobal::AltMode  altMode)

Definition at line 3002 of file MissionController.cc.

References globalAltitudeModeChanged().

Referenced by loadTextFile().

◆ showPlanFromManagerVehicle()

bool MissionController::showPlanFromManagerVehicle ( void  )
finalvirtual

◆ simpleFlightPathSegments()

QmlObjectListModel * MissionController::simpleFlightPathSegments ( void  )
inline

Definition at line 284 of file MissionController.h.

◆ splitSegmentChanged

void MissionController::splitSegmentChanged ( void  )
signal

◆ start()

void MissionController::start ( bool  flyView)
finalvirtual

Should be called immediately upon Component.onCompleted.

Reimplemented from PlanElementController.

Definition at line 113 of file MissionController.cc.

References PlanElementController::_masterController, PlanMasterController::managerVehicleChanged(), and PlanElementController::start().

Referenced by PlanMasterController::startStaticActiveVehicle().

◆ structureScanComplexItemName()

QString MissionController::structureScanComplexItemName ( void  ) const

Definition at line 2955 of file MissionController.cc.

References StructureScanComplexItem::name.

◆ supported()

bool MissionController::supported ( void  ) const
inlinefinalvirtual

true: controller is waiting for the current load to complete

Implements PlanElementController.

Definition at line 258 of file MissionController.h.

◆ surveyComplexItemName()

QString MissionController::surveyComplexItemName ( void  ) const

Definition at line 2945 of file MissionController.cc.

References SurveyComplexItem::name.

◆ syncInProgress()

bool MissionController::syncInProgress ( void  ) const
finalvirtual

◆ takeoffCoordinate()

QGeoCoordinate MissionController::takeoffCoordinate ( )
inline

Definition at line 255 of file MissionController.h.

◆ takeoffMissionItem()

TakeoffMissionItem * MissionController::takeoffMissionItem ( void  ) const
inline

Definition at line 289 of file MissionController.h.

◆ takeoffMissionItemChanged

void MissionController::takeoffMissionItemChanged ( void  )
signal

◆ travelBoundingCube()

QGCGeoBoundingCube * MissionController::travelBoundingCube ( )
inline

Definition at line 254 of file MissionController.h.

◆ visualItems()

QmlObjectListModel * MissionController::visualItems ( void  )
inline

Definition at line 277 of file MissionController.h.

Referenced by TerrainProfile::setMissionController().

◆ visualItemsChanged

void MissionController::visualItemsChanged ( void  )
signal

◆ visualItemsTree()

QmlObjectTreeModel * MissionController::visualItemsTree ( void  )
inline

Definition at line 278 of file MissionController.h.

Member Data Documentation

◆ kDefaultsGroupRow

constexpr int MissionController::kDefaultsGroupRow = 1
staticconstexpr

Definition at line 326 of file MissionController.h.

◆ kFenceGroupRow

constexpr int MissionController::kFenceGroupRow = 3
staticconstexpr

Definition at line 328 of file MissionController.h.

◆ kGroupCount

constexpr int MissionController::kGroupCount = 5
staticconstexpr

Definition at line 330 of file MissionController.h.

◆ kMissionGroupRow

constexpr int MissionController::kMissionGroupRow = 2
staticconstexpr

Definition at line 327 of file MissionController.h.

◆ kPlanFileGroupRow

constexpr int MissionController::kPlanFileGroupRow = 0
staticconstexpr

Definition at line 325 of file MissionController.h.

◆ kRallyGroupRow

constexpr int MissionController::kRallyGroupRow = 4
staticconstexpr

Definition at line 329 of file MissionController.h.

◆ visualItemIndexForObject

int MissionController::visualItemIndexForObject

< Used by Plan view only for interactive editing

< Includes AMSL altitude < Segment which show show + split ui element < True mission item command count (only valid in Fly View) < Returns the item index two which a mission should be resumed. -1 indicates resume mission not available. < Minimum altitude associated with this mission. Used to calculate percentages for terrain status. < Maximum altitude associated with this mission. Used to calculate percentages for terrain status. Returns the visual item index for the given VisualMissionItem object, or -1 if not found

Definition at line 128 of file MissionController.h.


The documentation for this class was generated from the following files: