FlightGear next
FGAIFlightPlan Class Reference

#include <AIFlightPlan.hxx>

Public Member Functions

 FGAIFlightPlan ()
 
 FGAIFlightPlan (const std::string &filename)
 
 FGAIFlightPlan (FGAIAircraft *, const std::string &p, double course, time_t start, time_t remainingTime, FGAirport *dep, FGAirport *arr, bool firstLeg, double radius, double alt, double lat, double lon, double speed, const std::string &fltType, const std::string &acType, const std::string &airline)
 
virtual ~FGAIFlightPlan ()
 
bool readFlightplan (const SGPath &file)
 read a flight-plan from a file.
 
bool readFlightplan (std::istream &stream, const sg_location &loc=sg_location{})
 
FGAIWaypointgetPreviousWaypoint (void) const
 
FGAIWaypointgetCurrentWaypoint (void) const
 
FGAIWaypointgetNextWaypoint (void) const
 
int getNextTurnAngle (void) const
 
void IncrementWaypoint (bool erase)
 
void DecrementWaypoint ()
 
double getDistanceToGo (double lat, double lon, FGAIWaypoint *wp) const
 
int getLeg () const
 
void setLeadDistance (double speed, double bearing, FGAIWaypoint *current, FGAIWaypoint *next)
 Set lead_distance_ft.
 
void setLeadDistance (double distance_ft)
 Set lead_distance_ft.
 
double getLeadDistance (void) const
 
double getBearing (FGAIWaypoint *previous, FGAIWaypoint *next) const
 
double getBearing (const SGGeod &aPos, FGAIWaypoint *next) const
 
double checkTrackLength (const std::string &wptName) const
 
time_t getStartTime () const
 
time_t getArrivalTime () const
 
bool create (FGAIAircraft *, FGAirport *dep, FGAirport *arr, int leg, double alt, double speed, double lat, double lon, bool firstLeg, double radius, const std::string &fltType, const std::string &aircraftType, const std::string &airline, double distance)
 
bool createPushBack (FGAIAircraft *, bool, FGAirport *, double radius, const std::string &, const std::string &, const std::string &)
 
bool createTakeOff (FGAIAircraft *, bool, FGAirport *, const SGGeod &pos, double speed, const std::string &flightType)
 
void setLeg (int val)
 
void setTime (time_t st)
 
double getLeadInAngle () const
 
const std::string & getRunway () const
 
void setRepeat (bool r)
 
bool getRepeat (void) const
 
void restart (void)
 
int getNrOfWayPoints ()
 
int getRouteIndex (int i) const
 
const std::string & getRunway ()
 
bool isActive (time_t time)
 
void incrementLeg ()
 
void setRunway (const std::string &rwy)
 
const char * getRunwayClassFromTrafficType (const std::string &fltType)
 
void addWaypoint (FGAIWaypoint *wpt)
 
void setName (const std::string &n)
 
const std::string & getName ()
 
void setSID (FGAIFlightPlan *fp)
 
FGAIFlightPlangetSID ()
 
FGAIWaypointgetWayPoint (int i)
 
FGAIWaypointgetLastWaypoint () const
 
void shortenToFirst (unsigned int number, const std::string &name)
 
void setGate (const ParkingAssignment &pka)
 
FGParkinggetParkingGate () const
 
FGAirportRef departureAirport () const
 
FGAirportRef arrivalAirport () const
 
bool empty () const
 
wpt_vector_iterator getFirstWayPoint ()
 
wpt_vector_iterator getLastWayPoint ()
 
bool isValidPlan ()
 

Static Public Member Functions

static FGAIFlightPlancreateDummyUserPlan ()
 create a nearly empty FlightPlan for the user aircraft, based on the current position and route-manager data.
 

Detailed Description

Definition at line 123 of file AIFlightPlan.hxx.

Constructor & Destructor Documentation

◆ FGAIFlightPlan() [1/3]

FGAIFlightPlan::FGAIFlightPlan ( )

Definition at line 95 of file AIFlightPlan.cxx.

◆ FGAIFlightPlan() [2/3]

FGAIFlightPlan::FGAIFlightPlan ( const std::string & filename)
explicit

◆ FGAIFlightPlan() [3/3]

FGAIFlightPlan::FGAIFlightPlan ( FGAIAircraft * ,
const std::string & p,
double course,
time_t start,
time_t remainingTime,
FGAirport * dep,
FGAirport * arr,
bool firstLeg,
double radius,
double alt,
double lat,
double lon,
double speed,
const std::string & fltType,
const std::string & acType,
const std::string & airline )

◆ ~FGAIFlightPlan()

FGAIFlightPlan::~FGAIFlightPlan ( )
virtual

Definition at line 167 of file AIFlightPlan.cxx.

Member Function Documentation

◆ addWaypoint()

void FGAIFlightPlan::addWaypoint ( FGAIWaypoint * wpt)

Definition at line 549 of file AIFlightPlan.cxx.

◆ arrivalAirport()

FGAirportRef FGAIFlightPlan::arrivalAirport ( ) const

Definition at line 635 of file AIFlightPlan.cxx.

◆ checkTrackLength()

double FGAIFlightPlan::checkTrackLength ( const std::string & wptName) const

Definition at line 592 of file AIFlightPlan.cxx.

◆ create()

bool FGAIFlightPlan::create ( FGAIAircraft * ,
FGAirport * dep,
FGAirport * arr,
int leg,
double alt,
double speed,
double lat,
double lon,
bool firstLeg,
double radius,
const std::string & fltType,
const std::string & aircraftType,
const std::string & airline,
double distance )

Definition at line 50 of file AIFlightPlanCreate.cxx.

◆ createDummyUserPlan()

FGAIFlightPlan * FGAIFlightPlan::createDummyUserPlan ( )
static

create a nearly empty FlightPlan for the user aircraft, based on the current position and route-manager data.

Definition at line 640 of file AIFlightPlan.cxx.

◆ createPushBack()

bool FGAIFlightPlan::createPushBack ( FGAIAircraft * ,
bool ,
FGAirport * ,
double radius,
const std::string & ,
const std::string & ,
const std::string &  )

Definition at line 45 of file AIFlightPlanCreatePushBack.cxx.

◆ createTakeOff()

bool FGAIFlightPlan::createTakeOff ( FGAIAircraft * ,
bool ,
FGAirport * ,
const SGGeod & pos,
double speed,
const std::string & flightType )

Definition at line 595 of file AIFlightPlanCreate.cxx.

◆ DecrementWaypoint()

void FGAIFlightPlan::DecrementWaypoint ( )

Definition at line 398 of file AIFlightPlan.cxx.

◆ departureAirport()

FGAirportRef FGAIFlightPlan::departureAirport ( ) const

Definition at line 630 of file AIFlightPlan.cxx.

◆ empty()

bool FGAIFlightPlan::empty ( ) const

Definition at line 647 of file AIFlightPlan.cxx.

◆ getArrivalTime()

time_t FGAIFlightPlan::getArrivalTime ( ) const
inline

Definition at line 180 of file AIFlightPlan.hxx.

◆ getBearing() [1/2]

double FGAIFlightPlan::getBearing ( const SGGeod & aPos,
FGAIWaypoint * next ) const

Definition at line 506 of file AIFlightPlan.cxx.

◆ getBearing() [2/2]

double FGAIFlightPlan::getBearing ( FGAIWaypoint * previous,
FGAIWaypoint * next ) const

Definition at line 501 of file AIFlightPlan.cxx.

◆ getCurrentWaypoint()

FGAIWaypoint * FGAIFlightPlan::getCurrentWaypoint ( void ) const

Definition at line 331 of file AIFlightPlan.cxx.

◆ getDistanceToGo()

double FGAIFlightPlan::getDistanceToGo ( double lat,
double lon,
FGAIWaypoint * wp ) const

Definition at line 418 of file AIFlightPlan.cxx.

◆ getFirstWayPoint()

wpt_vector_iterator FGAIFlightPlan::getFirstWayPoint ( )
inline

Definition at line 323 of file AIFlightPlan.hxx.

◆ getLastWayPoint()

wpt_vector_iterator FGAIFlightPlan::getLastWayPoint ( )
inline

Definition at line 324 of file AIFlightPlan.hxx.

◆ getLastWaypoint()

FGAIWaypoint * FGAIFlightPlan::getLastWaypoint ( ) const

Definition at line 310 of file AIFlightPlan.cxx.

◆ getLeadDistance()

double FGAIFlightPlan::getLeadDistance ( void ) const
inline

Definition at line 174 of file AIFlightPlan.hxx.

◆ getLeadInAngle()

double FGAIFlightPlan::getLeadInAngle ( ) const
inline

Definition at line 194 of file AIFlightPlan.hxx.

◆ getLeg()

int FGAIFlightPlan::getLeg ( ) const
inline

Definition at line 168 of file AIFlightPlan.hxx.

◆ getName()

const std::string & FGAIFlightPlan::getName ( )
inline

Definition at line 219 of file AIFlightPlan.hxx.

◆ getNextTurnAngle()

int FGAIFlightPlan::getNextTurnAngle ( void ) const

Definition at line 351 of file AIFlightPlan.cxx.

◆ getNextWaypoint()

FGAIWaypoint * FGAIFlightPlan::getNextWaypoint ( void ) const

Definition at line 338 of file AIFlightPlan.cxx.

◆ getNrOfWayPoints()

int FGAIFlightPlan::getNrOfWayPoints ( )
inline

Definition at line 200 of file AIFlightPlan.hxx.

◆ getParkingGate()

FGParking * FGAIFlightPlan::getParkingGate ( ) const

Definition at line 625 of file AIFlightPlan.cxx.

◆ getPreviousWaypoint()

FGAIWaypoint * FGAIFlightPlan::getPreviousWaypoint ( void ) const

Definition at line 318 of file AIFlightPlan.cxx.

◆ getRepeat()

bool FGAIFlightPlan::getRepeat ( void ) const
inline

Definition at line 198 of file AIFlightPlan.hxx.

◆ getRouteIndex()

int FGAIFlightPlan::getRouteIndex ( int i) const

Definition at line 584 of file AIFlightPlan.cxx.

◆ getRunway() [1/2]

const std::string & FGAIFlightPlan::getRunway ( )
inline

Definition at line 204 of file AIFlightPlan.hxx.

◆ getRunway() [2/2]

const std::string & FGAIFlightPlan::getRunway ( ) const

◆ getRunwayClassFromTrafficType()

const char * FGAIFlightPlan::getRunwayClassFromTrafficType ( const std::string & fltType)
Parameters
fltTypea string describing the type of traffic, normally used for gate assignments
Returns
a converted string that gives the runway preference schedule to be used at aircraft having a preferential runway schedule implemented (i.e. having a rwyprefs.xml file

Currently valid traffic types for gate assignment:

  • gate (commercial gate)
  • cargo (commercial cargo)
  • ga (general aviation)
  • ul (ultralight)
  • mil-fighter (military - fighter)
  • mil-transport (military - transport)

Valid runway classes:

  • com (commercial traffic: jetliners, passenger and cargo)
  • gen (general aviation)
  • ul (ultralight: I can imagine that these may share a runway with ga on some airports)
  • mil (all military traffic)

Definition at line 1250 of file AIFlightPlanCreate.cxx.

◆ getSID()

FGAIFlightPlan * FGAIFlightPlan::getSID ( )
inline

Definition at line 222 of file AIFlightPlan.hxx.

◆ getStartTime()

time_t FGAIFlightPlan::getStartTime ( ) const
inline

Definition at line 179 of file AIFlightPlan.hxx.

◆ getWayPoint()

FGAIWaypoint * FGAIFlightPlan::getWayPoint ( int i)
inline

Definition at line 223 of file AIFlightPlan.hxx.

◆ incrementLeg()

void FGAIFlightPlan::incrementLeg ( )
inline

Definition at line 207 of file AIFlightPlan.hxx.

◆ IncrementWaypoint()

void FGAIFlightPlan::IncrementWaypoint ( bool erase)

Definition at line 357 of file AIFlightPlan.cxx.

◆ isActive()

bool FGAIFlightPlan::isActive ( time_t time)
inline

Definition at line 205 of file AIFlightPlan.hxx.

◆ isValidPlan()

bool FGAIFlightPlan::isValidPlan ( )
inline

Definition at line 325 of file AIFlightPlan.hxx.

◆ readFlightplan() [1/2]

bool FGAIFlightPlan::readFlightplan ( const SGPath & file)

read a flight-plan from a file.

All current contents of the flight-plan are replaced, and the current waypoint is reset to the beginning

Definition at line 226 of file AIFlightPlan.cxx.

◆ readFlightplan() [2/2]

bool FGAIFlightPlan::readFlightplan ( std::istream & stream,
const sg_location & loc = sg_location{} )

Definition at line 232 of file AIFlightPlan.cxx.

◆ restart()

void FGAIFlightPlan::restart ( void )

Definition at line 579 of file AIFlightPlan.cxx.

◆ setGate()

void FGAIFlightPlan::setGate ( const ParkingAssignment & pka)

Definition at line 620 of file AIFlightPlan.cxx.

◆ setLeadDistance() [1/2]

void FGAIFlightPlan::setLeadDistance ( double distance_ft)

Set lead_distance_ft.

Definition at line 492 of file AIFlightPlan.cxx.

◆ setLeadDistance() [2/2]

void FGAIFlightPlan::setLeadDistance ( double speed,
double bearing,
FGAIWaypoint * current,
FGAIWaypoint * next )

Set lead_distance_ft.

sets distance in feet from a lead point to the current waypoint basically a catch radius, that triggers the advancement of WPs

Definition at line 427 of file AIFlightPlan.cxx.

◆ setLeg()

void FGAIFlightPlan::setLeg ( int val)
inline

Definition at line 187 of file AIFlightPlan.hxx.

◆ setName()

void FGAIFlightPlan::setName ( const std::string & n)
inline

Definition at line 218 of file AIFlightPlan.hxx.

◆ setRepeat()

void FGAIFlightPlan::setRepeat ( bool r)
inline

Definition at line 197 of file AIFlightPlan.hxx.

◆ setRunway()

void FGAIFlightPlan::setRunway ( const std::string & rwy)
inline

Definition at line 213 of file AIFlightPlan.hxx.

◆ setSID()

void FGAIFlightPlan::setSID ( FGAIFlightPlan * fp)
inline

Definition at line 221 of file AIFlightPlan.hxx.

◆ setTime()

void FGAIFlightPlan::setTime ( time_t st)
inline

Definition at line 192 of file AIFlightPlan.hxx.

◆ shortenToFirst()

void FGAIFlightPlan::shortenToFirst ( unsigned int number,
const std::string & name )

Definition at line 612 of file AIFlightPlan.cxx.


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