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

This class is used to encapsulate the QGeoCoordinate associated with a Rally Point into a QObject such that it can be used in a QmlObjectListMode for Qml. More...

#include <RallyPoint.h>

Inheritance diagram for RallyPoint:
Collaboration diagram for RallyPoint:

Signals

void coordinateChanged (const QGeoCoordinate &coordinate)
void altitudeFrameChanged (void)
void terrainQueryFailedChanged (void)
void dirtyChanged (bool dirty)

Public Member Functions

 RallyPoint (const QGeoCoordinate &coordinate, QGroundControlQmlGlobal::AltitudeFrame altitudeFrame=QGroundControlQmlGlobal::AltitudeFrameRelative, QObject *parent=nullptr)
 RallyPoint (const RallyPoint &other, QObject *parent=nullptr)
 ~RallyPoint ()
const RallyPoint & operator= (const RallyPoint &other)
QGeoCoordinate coordinate (void) const
void setCoordinate (const QGeoCoordinate &coordinate)
Fact * latitude (void)
Fact * longitude (void)
Fact * altitude (void)
QGroundControlQmlGlobal::AltitudeFrame altitudeFrame (void) const
void setAltitudeFrame (QGroundControlQmlGlobal::AltitudeFrame altitudeFrame)
bool terrainQueryFailed (void) const
bool terrainQueryPending (void) const
 true: a terrain answer is on its way and will change the altitude. A failed query is not pending.
bool dirty (void) const
void setDirty (bool dirty)
Q_INVOKABLE void changeAltitudeFrame (QGroundControlQmlGlobal::AltitudeFrame altitudeFrame, double seedAltitude=0, bool seedFromTerrain=false)
Q_INVOKABLE void useTerrainAltitude (bool switchToAbsoluteOnFailure=false)

Static Public Member Functions

static double getDefaultFactAltitude ()
static MAV_FRAME mavFrame (QGroundControlQmlGlobal::AltitudeFrame altitudeFrame)
static QGroundControlQmlGlobal::AltitudeFrame altitudeFrameFromMavFrame (MAV_FRAME mavFrame)

Detailed Description

This class is used to encapsulate the QGeoCoordinate associated with a Rally Point into a QObject such that it can be used in a QmlObjectListMode for Qml.

Definition at line 20 of file RallyPoint.h.

Constructor & Destructor Documentation

◆ RallyPoint() [1/2]

RallyPoint::RallyPoint ( const QGeoCoordinate & coordinate,
QGroundControlQmlGlobal::AltitudeFrame altitudeFrame = QGroundControlQmlGlobal::AltitudeFrameRelative,
QObject * parent = nullptr )

Definition at line 7 of file RallyPoint.cc.

References altitudeFrame(), and coordinate().

Referenced by operator=(), and RallyPoint().

◆ RallyPoint() [2/2]

RallyPoint::RallyPoint ( const RallyPoint & other,
QObject * parent = nullptr )

Definition at line 24 of file RallyPoint.cc.

References RallyPoint(), and Fact::rawValue().

◆ ~RallyPoint()

RallyPoint::~RallyPoint ( )

Definition at line 52 of file RallyPoint.cc.

Member Function Documentation

◆ altitude()

Fact * RallyPoint::altitude ( void )
inline

Definition at line 51 of file RallyPoint.h.

Referenced by dirtyChanged().

◆ altitudeFrame()

◆ altitudeFrameChanged

void RallyPoint::altitudeFrameChanged ( void )
signal

Referenced by setAltitudeFrame().

◆ altitudeFrameFromMavFrame()

◆ changeAltitudeFrame()

void RallyPoint::changeAltitudeFrame ( QGroundControlQmlGlobal::AltitudeFrame altitudeFrame,
double seedAltitude = 0,
bool seedFromTerrain = false )

User-driven frame change. The frame switches immediately and the altitude is reset to seedAltitude, except Absolute with seedFromTerrain which asks for the terrain elevation at the point instead (see useTerrainAltitude). Selecting a frame other than Absolute also cancels a pending terrain request.

Definition at line 121 of file RallyPoint.cc.

References altitudeFrame(), QGroundControlQmlGlobal::AltitudeFrameAbsolute, setAltitudeFrame(), and useTerrainAltitude().

◆ coordinate()

QGeoCoordinate RallyPoint::coordinate ( void ) const

◆ coordinateChanged

void RallyPoint::coordinateChanged ( const QGeoCoordinate & coordinate)
signal

References coordinate().

Referenced by operator=(), and setCoordinate().

◆ dirty()

bool RallyPoint::dirty ( void ) const
inline

Definition at line 62 of file RallyPoint.h.

Referenced by dirtyChanged(), and setDirty().

◆ dirtyChanged

void RallyPoint::dirtyChanged ( bool dirty)
signal

◆ getDefaultFactAltitude()

double RallyPoint::getDefaultFactAltitude ( )
static

Definition at line 265 of file RallyPoint.cc.

Referenced by RallyPointController::addPoint().

◆ latitude()

Fact * RallyPoint::latitude ( void )
inline

Definition at line 47 of file RallyPoint.h.

◆ longitude()

Fact * RallyPoint::longitude ( void )
inline

Definition at line 49 of file RallyPoint.h.

◆ mavFrame()

◆ operator=()

const RallyPoint & RallyPoint::operator= ( const RallyPoint & other)

◆ setAltitudeFrame()

void RallyPoint::setAltitudeFrame ( QGroundControlQmlGlobal::AltitudeFrame altitudeFrame)

Definition at line 104 of file RallyPoint.cc.

References altitudeFrame(), altitudeFrameChanged(), and setDirty().

Referenced by changeAltitudeFrame(), and operator=().

◆ setCoordinate()

void RallyPoint::setCoordinate ( const QGeoCoordinate & coordinate)

Definition at line 93 of file RallyPoint.cc.

References coordinate(), coordinateChanged(), and setDirty().

◆ setDirty()

void RallyPoint::setDirty ( bool dirty)

Definition at line 113 of file RallyPoint.cc.

References dirty(), and dirtyChanged().

Referenced by setAltitudeFrame(), and setCoordinate().

◆ terrainQueryFailed()

bool RallyPoint::terrainQueryFailed ( void ) const
inline

Definition at line 57 of file RallyPoint.h.

◆ terrainQueryFailedChanged

void RallyPoint::terrainQueryFailedChanged ( void )
signal

◆ terrainQueryPending()

bool RallyPoint::terrainQueryPending ( void ) const
inline

true: a terrain answer is on its way and will change the altitude. A failed query is not pending.

Definition at line 60 of file RallyPoint.h.

Referenced by RallyPointController::terrainQueryPending().

◆ useTerrainAltitude()

void RallyPoint::useTerrainAltitude ( bool switchToAbsoluteOnFailure = false)

Asks for the terrain elevation at the point. On success the point switches to the Absolute frame with that elevation as altitude and follows the terrain while it moves, until the altitude is edited. On failure the altitude is left unchanged and the frame too, unless switchToAbsoluteOnFailure is set. That lets the user enter an AMSL altitude when terrain data is not available.

Definition at line 145 of file RallyPoint.cc.

Referenced by RallyPointController::addPoint(), and changeAltitudeFrame().


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