FlightGear next
flightgear::WayptController Class Referenceabstract

#include <rnav_waypt_controller.hxx>

Inherited by flightgear::BasicWayptCtl, flightgear::ConstHdgToAltCtl, flightgear::DMEInterceptCtl, flightgear::DirectToController, flightgear::HoldCtl, flightgear::InterceptCtl, flightgear::LegWayptCtl, flightgear::OBSController, flightgear::RunwayCtl, and flightgear::VectorsCtl.

Public Member Functions

virtual ~WayptController ()
 
virtual bool init ()
 
virtual void update (double dt)=0
 
virtual double timeToWaypt () const
 Compute time until the waypoint is done.
 
virtual double distanceToWayptM () const =0
 Compute distance until the waypoint is done.
 
virtual double trueBearingDeg () const
 Bearing to the waypoint, if this value is meaningful.
 
virtual double targetTrackDeg () const
 
virtual double xtrackErrorNm () const
 
virtual double courseDeviationDeg () const
 
virtual SGGeod position () const =0
 Position associated with the waypt.
 
bool isDone () const
 Is this controller finished?
 
virtual bool toFlag () const
 to/from flag - true = to, false = from.
 
virtual std::string status () const
 Allow waypoints to indicate a status value as a string.
 
virtual std::optional< RNAV::LegDatalegData () const
 
WayptRef waypoint () const
 

Static Public Member Functions

static WayptControllercreateForWaypt (RNAV *rnav, const WayptRef &aWpt)
 Static factory method, given a waypoint, return a controller bound to it, of the appropriate type.
 

Protected Member Functions

 WayptController (RNAV *aRNAV, const WayptRef &aWpt)
 
void setDone ()
 
void setSubController (WayptController *sub)
 

Protected Attributes

WayptRef _waypt
 
double _targetTrack
 
RNAV_rnav
 
std::unique_ptr< WayptController_subController
 

Detailed Description

Definition at line 133 of file rnav_waypt_controller.hxx.

Constructor & Destructor Documentation

◆ ~WayptController()

flightgear::WayptController::~WayptController ( )
virtual

Definition at line 83 of file rnav_waypt_controller.cxx.

◆ WayptController()

flightgear::WayptController::WayptController ( RNAV * aRNAV,
const WayptRef & aWpt )
inlineprotected

Definition at line 210 of file rnav_waypt_controller.hxx.

Member Function Documentation

◆ courseDeviationDeg()

double flightgear::WayptController::courseDeviationDeg ( ) const
virtual

◆ createForWaypt()

WayptController * flightgear::WayptController::createForWaypt ( RNAV * rnav,
const WayptRef & aWpt )
static

Static factory method, given a waypoint, return a controller bound to it, of the appropriate type.

Definition at line 1481 of file rnav_waypt_controller.cxx.

◆ distanceToWayptM()

virtual double flightgear::WayptController::distanceToWayptM ( ) const
pure virtual

◆ init()

◆ isDone()

bool flightgear::WayptController::isDone ( ) const

Is this controller finished?

Definition at line 92 of file rnav_waypt_controller.cxx.

◆ legData()

virtual std::optional< RNAV::LegData > flightgear::WayptController::legData ( ) const
inlinevirtual

Reimplemented in flightgear::LegWayptCtl.

Definition at line 191 of file rnav_waypt_controller.hxx.

◆ position()

virtual SGGeod flightgear::WayptController::position ( ) const
pure virtual

Position associated with the waypt.

For static waypoints, this is simply the waypoint position itself; for dynamic points, it's the estimated location at which the controller will be done.

Implemented in flightgear::BasicWayptCtl, flightgear::ConstHdgToAltCtl, flightgear::DirectToController, flightgear::DMEInterceptCtl, flightgear::HoldCtl, flightgear::InterceptCtl, flightgear::LegWayptCtl, flightgear::OBSController, flightgear::RunwayCtl, and flightgear::VectorsCtl.

◆ setDone()

void flightgear::WayptController::setDone ( )
protected

Definition at line 101 of file rnav_waypt_controller.cxx.

◆ setSubController()

void flightgear::WayptController::setSubController ( WayptController * sub)
protected

Definition at line 126 of file rnav_waypt_controller.cxx.

◆ status()

std::string flightgear::WayptController::status ( ) const
virtual

Allow waypoints to indicate a status value as a string.

Useful for more complex controllers, which may have capture / exit states

Reimplemented in flightgear::HoldCtl.

Definition at line 121 of file rnav_waypt_controller.cxx.

◆ targetTrackDeg()

double flightgear::WayptController::targetTrackDeg ( ) const
virtual

Definition at line 144 of file rnav_waypt_controller.cxx.

◆ timeToWaypt()

double flightgear::WayptController::timeToWaypt ( ) const
virtual

Compute time until the waypoint is done.

Reimplemented in flightgear::ConstHdgToAltCtl.

Definition at line 110 of file rnav_waypt_controller.cxx.

◆ toFlag()

virtual bool flightgear::WayptController::toFlag ( ) const
inlinevirtual

to/from flag - true = to, false = from.

Defaults to 'true' because nearly all waypoint controllers become done as soon as this value would become false.

Reimplemented in flightgear::BasicWayptCtl, flightgear::LegWayptCtl, and flightgear::OBSController.

Definition at line 181 of file rnav_waypt_controller.hxx.

◆ trueBearingDeg()

double flightgear::WayptController::trueBearingDeg ( ) const
virtual

Bearing to the waypoint, if this value is meaningful.

Default implementation returns the target track

Reimplemented in flightgear::BasicWayptCtl, flightgear::DirectToController, flightgear::LegWayptCtl, flightgear::OBSController, and flightgear::RunwayCtl.

Definition at line 136 of file rnav_waypt_controller.cxx.

◆ update()

◆ waypoint()

WayptRef flightgear::WayptController::waypoint ( ) const
inline

Definition at line 206 of file rnav_waypt_controller.hxx.

◆ xtrackErrorNm()

double flightgear::WayptController::xtrackErrorNm ( ) const
virtual

Member Data Documentation

◆ _rnav

RNAV* flightgear::WayptController::_rnav
protected

Definition at line 219 of file rnav_waypt_controller.hxx.

◆ _subController

std::unique_ptr<WayptController> flightgear::WayptController::_subController
protected

Definition at line 229 of file rnav_waypt_controller.hxx.

◆ _targetTrack

double flightgear::WayptController::_targetTrack
protected

Definition at line 218 of file rnav_waypt_controller.hxx.

◆ _waypt

WayptRef flightgear::WayptController::_waypt
protected

Definition at line 217 of file rnav_waypt_controller.hxx.


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