FlightGear next
|
#include <FlightPlan.hxx>
Inherits flightgear::RouteBase.
Classes | |
class | Delegate |
class | DelegateFactory |
abstract interface for creating delegates automatically when a flight-plan is created or loaded More... | |
class | Leg |
flight-plan leg encapsulation More... | |
Public Types | |
using | LegRef = SGSharedPtr<Leg> |
using | DelegateFactoryRef = std::shared_ptr<DelegateFactory> |
using | LegVisitor = std::function<void(Leg*)> |
Public Member Functions | |
virtual | ~FlightPlan () |
virtual std::string | ident () const |
void | setIdent (const std::string &s) |
void | setFollowLegTrackToFixes (bool tf) |
bool | followLegTrackToFixes () const |
void | setMaxFlyByTurnAngle (double deg) |
double | maxFlyByTurnAngle () const |
std::string | icaoAircraftCategory () const |
void | setIcaoAircraftCategory (const std::string &cat) |
std::string | icaoAircraftType () const |
void | setIcaoAircraftType (const std::string &ty) |
FlightPlanRef | clone (const std::string &newIdent={}, bool convertToFlightPlan=false) const |
bool | isRoute () const |
is this flight-pan a route (for planning) or an active flight-plan (which can be flown?) Routes can contain Via, and cannot be active: FlightPlans contain Legs for procedures and airways, i.e what the GPS/FMC actally flies. | |
LegRef | insertWayptAtIndex (Waypt *aWpt, int aIndex) |
void | insertWayptsAtIndex (const WayptVec &wps, int aIndex) |
void | deleteIndex (int index) |
void | clearAll () |
void | clearLegs () |
int | clearWayptsWithFlag (WayptFlag flag) |
int | currentIndex () const |
void | sequence () |
void | setCurrentIndex (int index) |
void | activate () |
void | finish () |
bool | isActive () const |
LegRef | currentLeg () const |
LegRef | nextLeg () const |
LegRef | previousLeg () const |
int | numLegs () const |
LegRef | legAtIndex (int index) const |
int | findWayptIndex (const SGGeod &aPos) const |
int | findWayptIndex (const FGPositionedRef aPos) const |
int | indexOfFirstNonDepartureWaypoint () const |
int | indexOfFirstArrivalWaypoint () const |
int | indexOfFirstApproachWaypoint () const |
int | indexOfDestinationRunwayWaypoint () const |
bool | load (const SGPath &p) |
bool | save (const SGPath &p) const |
bool | save (std::ostream &stream) const |
bool | load (std::istream &stream) |
FGAirportRef | departureAirport () const |
FGAirportRef | destinationAirport () const |
FGRunway * | departureRunway () const |
FGRunway * | destinationRunway () const |
Approach * | approach () const |
void | setDeparture (FGAirport *apt) |
void | setDeparture (FGRunway *rwy) |
void | clearDeparture () |
SID * | sid () const |
Transition * | sidTransition () const |
void | setSID (SID *sid, const std::string &transition=std::string()) |
void | setSID (Transition *sidWithTrans) |
void | clearSID () |
void | setDestination (FGAirport *apt) |
void | setDestination (FGRunway *rwy) |
void | clearDestination () |
FGAirportRef | alternate () const |
void | setAlternate (FGAirportRef alt) |
void | setApproach (Approach *app, const std::string &transition={}) |
note setting an approach will implicitly update the destination airport and runway to match | |
void | setApproach (Transition *approachWithTrans) |
Transition * | approachTransition () const |
STAR * | star () const |
Transition * | starTransition () const |
void | setSTAR (STAR *star, const std::string &transition=std::string()) |
void | setSTAR (Transition *starWithTrans) |
void | clearSTAR () |
double | totalDistanceNm () const |
int | estimatedDurationMinutes () const |
void | setEstimatedDurationMinutes (int minutes) |
void | computeDurationMinutes () |
computeDurationMinutes - use performance data and cruise data to estimate enroute time | |
SGGeod | pointAlongRoute (int aIndex, double aOffsetNm) const |
given a waypoint index, and an offset in NM, find the geodetic position on the route path. | |
SGGeod | pointAlongRouteNorm (int aIndex, double aOffsetNorm) const |
given a waypoint index, find a point at a normalised offset, which must be [-1 . | |
SGGeod | vicinityForInsertIndex (int aIndex) const |
given an index to insert a waypoint into the plan, find the geographical vicinity. | |
WayptRef | waypointFromString (const std::string &target, const SGGeod &vicinity=SGGeod::invalid()) |
Create a WayPoint from a string in the following format:
| |
bool | parseICAORouteString (const std::string &routeData) |
attempt to replace the route waypoints (and potentially the SID and STAR) based on an ICAO standard route string, i.e item 15. | |
std::string | asICAORouteString () const |
void | setFlightRules (ICAOFlightRules rules) |
ICAOFlightRules | flightRules () const |
void | setFlightType (ICAOFlightType type) |
ICAOFlightType | flightType () const |
void | setCallsign (const std::string &callsign) |
std::string | callsign () const |
void | setRemarks (const std::string &remarks) |
std::string | remarks () const |
void | setCruiseSpeedKnots (int kts) |
int | cruiseSpeedKnots () const |
void | setCruiseSpeedMach (double mach) |
double | cruiseSpeedMach () const |
void | setCruiseSpeedKPH (int kmh) |
int | cruiseSpeedKPH () const |
void | setCruiseFlightLevel (int flightLevel) |
int | cruiseFlightLevel () const |
void | setCruiseAltitudeFt (int altFt) |
int | cruiseAltitudeFt () const |
void | setCruiseAltitudeM (int altM) |
int | cruiseAltitudeM () const |
void | addDelegate (Delegate *d) |
void | removeDelegate (Delegate *d) |
void | forEachLeg (const LegVisitor &lv) |
![]() | |
virtual | ~RouteBase () |
Static Public Member Functions | |
static FlightPlanRef | create () |
create a FlightPlan with isRoute not set | |
static FlightPlanRef | createRoute () |
@factory to create a FlightPlan with isRoute=true | |
static void | registerDelegateFactory (DelegateFactoryRef df) |
static void | unregisterDelegateFactory (DelegateFactoryRef df) |
![]() | |
static void | loadAirportProcedures (const SGPath &aPath, FGAirport *aApt) |
static void | dumpRouteToKML (const WayptVec &aRoute, const std::string &aName) |
static void | dumpRouteToKMLLineString (const std::string &aIdent, const WayptVec &aRoute, std::ostream &aStream) |
Friends | |
class | Leg |
Definition at line 57 of file FlightPlan.hxx.
using flightgear::FlightPlan::DelegateFactoryRef = std::shared_ptr<DelegateFactory> |
Definition at line 190 of file FlightPlan.hxx.
using flightgear::FlightPlan::LegRef = SGSharedPtr<Leg> |
Definition at line 187 of file FlightPlan.hxx.
using flightgear::FlightPlan::LegVisitor = std::function<void(Leg*)> |
Definition at line 440 of file FlightPlan.hxx.
|
virtual |
Definition at line 119 of file FlightPlan.cxx.
void flightgear::FlightPlan::activate | ( | ) |
Definition at line 1514 of file FlightPlan.cxx.
void flightgear::FlightPlan::addDelegate | ( | Delegate * | d | ) |
Definition at line 1894 of file FlightPlan.cxx.
FGAirportRef flightgear::FlightPlan::alternate | ( | ) | const |
Definition at line 665 of file FlightPlan.cxx.
|
inline |
Definition at line 284 of file FlightPlan.hxx.
Transition * flightgear::FlightPlan::approachTransition | ( | ) | const |
Definition at line 780 of file FlightPlan.cxx.
std::string flightgear::FlightPlan::asICAORouteString | ( | ) | const |
Definition at line 2140 of file FlightPlan.cxx.
|
inline |
Definition at line 397 of file FlightPlan.hxx.
void flightgear::FlightPlan::clearAll | ( | ) |
Definition at line 304 of file FlightPlan.cxx.
void flightgear::FlightPlan::clearDeparture | ( | ) |
Definition at line 568 of file FlightPlan.cxx.
void flightgear::FlightPlan::clearDestination | ( | ) |
Definition at line 654 of file FlightPlan.cxx.
void flightgear::FlightPlan::clearLegs | ( | ) |
Definition at line 330 of file FlightPlan.cxx.
void flightgear::FlightPlan::clearSID | ( | ) |
Definition at line 604 of file FlightPlan.cxx.
void flightgear::FlightPlan::clearSTAR | ( | ) |
Definition at line 704 of file FlightPlan.cxx.
int flightgear::FlightPlan::clearWayptsWithFlag | ( | WayptFlag | flag | ) |
Definition at line 352 of file FlightPlan.cxx.
FlightPlanRef flightgear::FlightPlan::clone | ( | const std::string & | newIdent = {}, |
bool | convertToFlightPlan = false ) const |
Definition at line 130 of file FlightPlan.cxx.
void flightgear::FlightPlan::computeDurationMinutes | ( | ) |
computeDurationMinutes - use performance data and cruise data to estimate enroute time
Definition at line 719 of file FlightPlan.cxx.
|
static |
create a FlightPlan with isRoute not set
Definition at line 109 of file FlightPlan.cxx.
|
static |
@factory to create a FlightPlan with isRoute=true
Definition at line 114 of file FlightPlan.cxx.
int flightgear::FlightPlan::cruiseAltitudeFt | ( | ) | const |
Definition at line 2278 of file FlightPlan.cxx.
int flightgear::FlightPlan::cruiseAltitudeM | ( | ) | const |
Definition at line 2293 of file FlightPlan.cxx.
int flightgear::FlightPlan::cruiseFlightLevel | ( | ) | const |
Definition at line 2263 of file FlightPlan.cxx.
int flightgear::FlightPlan::cruiseSpeedKnots | ( | ) | const |
Definition at line 2218 of file FlightPlan.cxx.
int flightgear::FlightPlan::cruiseSpeedKPH | ( | ) | const |
Definition at line 2248 of file FlightPlan.cxx.
double flightgear::FlightPlan::cruiseSpeedMach | ( | ) | const |
Definition at line 2233 of file FlightPlan.cxx.
|
inline |
Definition at line 236 of file FlightPlan.hxx.
FlightPlan::LegRef flightgear::FlightPlan::currentLeg | ( | ) | const |
Definition at line 492 of file FlightPlan.cxx.
void flightgear::FlightPlan::deleteIndex | ( | int | index | ) |
Definition at line 274 of file FlightPlan.cxx.
|
inline |
Definition at line 272 of file FlightPlan.hxx.
|
inline |
Definition at line 278 of file FlightPlan.hxx.
|
inline |
Definition at line 275 of file FlightPlan.hxx.
|
inline |
Definition at line 281 of file FlightPlan.hxx.
|
inline |
Definition at line 336 of file FlightPlan.hxx.
int flightgear::FlightPlan::findWayptIndex | ( | const FGPositionedRef | aPos | ) | const |
Definition at line 481 of file FlightPlan.cxx.
int flightgear::FlightPlan::findWayptIndex | ( | const SGGeod & | aPos | ) | const |
Definition at line 470 of file FlightPlan.cxx.
void flightgear::FlightPlan::finish | ( | ) |
Definition at line 449 of file FlightPlan.cxx.
ICAOFlightRules flightgear::FlightPlan::flightRules | ( | ) | const |
Definition at line 2183 of file FlightPlan.cxx.
ICAOFlightType flightgear::FlightPlan::flightType | ( | ) | const |
Definition at line 2203 of file FlightPlan.cxx.
bool flightgear::FlightPlan::followLegTrackToFixes | ( | ) | const |
Definition at line 1932 of file FlightPlan.cxx.
void flightgear::FlightPlan::forEachLeg | ( | const LegVisitor & | lv | ) |
Definition at line 2298 of file FlightPlan.cxx.
std::string flightgear::FlightPlan::icaoAircraftCategory | ( | ) | const |
Definition at line 1947 of file FlightPlan.cxx.
|
inline |
Definition at line 87 of file FlightPlan.hxx.
|
virtual |
Implements flightgear::RouteBase.
Definition at line 193 of file FlightPlan.cxx.
int flightgear::FlightPlan::indexOfDestinationRunwayWaypoint | ( | ) | const |
Definition at line 2340 of file FlightPlan.cxx.
int flightgear::FlightPlan::indexOfFirstApproachWaypoint | ( | ) | const |
Definition at line 2328 of file FlightPlan.cxx.
int flightgear::FlightPlan::indexOfFirstArrivalWaypoint | ( | ) | const |
Definition at line 2316 of file FlightPlan.cxx.
int flightgear::FlightPlan::indexOfFirstNonDepartureWaypoint | ( | ) | const |
Definition at line 2304 of file FlightPlan.cxx.
FlightPlan::LegRef flightgear::FlightPlan::insertWayptAtIndex | ( | Waypt * | aWpt, |
int | aIndex ) |
Definition at line 198 of file FlightPlan.cxx.
void flightgear::FlightPlan::insertWayptsAtIndex | ( | const WayptVec & | wps, |
int | aIndex ) |
Definition at line 235 of file FlightPlan.cxx.
bool flightgear::FlightPlan::isActive | ( | ) | const |
Definition at line 417 of file FlightPlan.cxx.
bool flightgear::FlightPlan::isRoute | ( | ) | const |
is this flight-pan a route (for planning) or an active flight-plan (which can be flown?) Routes can contain Via, and cannot be active: FlightPlans contain Legs for procedures and airways, i.e what the GPS/FMC actally flies.
Definition at line 412 of file FlightPlan.cxx.
FlightPlan::LegRef flightgear::FlightPlan::legAtIndex | ( | int | index | ) | const |
Definition at line 517 of file FlightPlan.cxx.
bool flightgear::FlightPlan::load | ( | const SGPath & | p | ) |
Definition at line 913 of file FlightPlan.cxx.
bool flightgear::FlightPlan::load | ( | std::istream & | stream | ) |
Definition at line 971 of file FlightPlan.cxx.
double flightgear::FlightPlan::maxFlyByTurnAngle | ( | ) | const |
Definition at line 1942 of file FlightPlan.cxx.
FlightPlan::LegRef flightgear::FlightPlan::nextLeg | ( | ) | const |
Definition at line 508 of file FlightPlan.cxx.
|
inline |
Definition at line 253 of file FlightPlan.hxx.
bool flightgear::FlightPlan::parseICAORouteString | ( | const std::string & | routeData | ) |
attempt to replace the route waypoints (and potentially the SID and STAR) based on an ICAO standard route string, i.e item 15.
Returns true if the rotue was parsed successfully (and this flight plan modified accordingly) or false if the string could not be parsed.
Definition at line 1999 of file FlightPlan.cxx.
SGGeod flightgear::FlightPlan::pointAlongRoute | ( | int | aIndex, |
double | aOffsetNm ) const |
given a waypoint index, and an offset in NM, find the geodetic position on the route path.
I.e the point 10nm before or after a particular waypoint.
Definition at line 1777 of file FlightPlan.cxx.
SGGeod flightgear::FlightPlan::pointAlongRouteNorm | ( | int | aIndex, |
double | aOffsetNorm ) const |
given a waypoint index, find a point at a normalised offset, which must be [-1 .
. 1] eg an offset of -0.5 will be half-way between aIndex and the preceeding waypoint, and an offset of 0.3 will be 30% of the distance from aIndex to the next waypoint.
Definition at line 1783 of file FlightPlan.cxx.
FlightPlan::LegRef flightgear::FlightPlan::previousLeg | ( | ) | const |
Definition at line 499 of file FlightPlan.cxx.
|
static |
Definition at line 1874 of file FlightPlan.cxx.
|
inline |
Definition at line 401 of file FlightPlan.hxx.
void flightgear::FlightPlan::removeDelegate | ( | Delegate * | d | ) |
Definition at line 1904 of file FlightPlan.cxx.
bool flightgear::FlightPlan::save | ( | const SGPath & | p | ) | const |
Definition at line 802 of file FlightPlan.cxx.
bool flightgear::FlightPlan::save | ( | std::ostream & | stream | ) | const |
Definition at line 789 of file FlightPlan.cxx.
void flightgear::FlightPlan::sequence | ( | ) |
Definition at line 440 of file FlightPlan.cxx.
void flightgear::FlightPlan::setAlternate | ( | FGAirportRef | alt | ) |
Definition at line 670 of file FlightPlan.cxx.
void flightgear::FlightPlan::setApproach | ( | flightgear::Approach * | app, |
const std::string & | transition = {} ) |
note setting an approach will implicitly update the destination airport and runway to match
Definition at line 743 of file FlightPlan.cxx.
void flightgear::FlightPlan::setApproach | ( | Transition * | approachWithTrans | ) |
Definition at line 766 of file FlightPlan.cxx.
void flightgear::FlightPlan::setCallsign | ( | const std::string & | callsign | ) |
Definition at line 2188 of file FlightPlan.cxx.
void flightgear::FlightPlan::setCruiseAltitudeFt | ( | int | altFt | ) |
Definition at line 2268 of file FlightPlan.cxx.
void flightgear::FlightPlan::setCruiseAltitudeM | ( | int | altM | ) |
Definition at line 2283 of file FlightPlan.cxx.
void flightgear::FlightPlan::setCruiseFlightLevel | ( | int | flightLevel | ) |
Definition at line 2253 of file FlightPlan.cxx.
void flightgear::FlightPlan::setCruiseSpeedKnots | ( | int | kts | ) |
Definition at line 2208 of file FlightPlan.cxx.
void flightgear::FlightPlan::setCruiseSpeedKPH | ( | int | kmh | ) |
Definition at line 2238 of file FlightPlan.cxx.
void flightgear::FlightPlan::setCruiseSpeedMach | ( | double | mach | ) |
Definition at line 2223 of file FlightPlan.cxx.
void flightgear::FlightPlan::setCurrentIndex | ( | int | index | ) |
Definition at line 424 of file FlightPlan.cxx.
void flightgear::FlightPlan::setDeparture | ( | FGAirport * | apt | ) |
Definition at line 537 of file FlightPlan.cxx.
void flightgear::FlightPlan::setDeparture | ( | FGRunway * | rwy | ) |
Definition at line 551 of file FlightPlan.cxx.
void flightgear::FlightPlan::setDestination | ( | FGAirport * | apt | ) |
Definition at line 622 of file FlightPlan.cxx.
void flightgear::FlightPlan::setDestination | ( | FGRunway * | rwy | ) |
Definition at line 637 of file FlightPlan.cxx.
void flightgear::FlightPlan::setEstimatedDurationMinutes | ( | int | minutes | ) |
Definition at line 714 of file FlightPlan.cxx.
void flightgear::FlightPlan::setFlightRules | ( | ICAOFlightRules | rules | ) |
Definition at line 2178 of file FlightPlan.cxx.
void flightgear::FlightPlan::setFlightType | ( | ICAOFlightType | type | ) |
Definition at line 2198 of file FlightPlan.cxx.
void flightgear::FlightPlan::setFollowLegTrackToFixes | ( | bool | tf | ) |
Definition at line 1927 of file FlightPlan.cxx.
void flightgear::FlightPlan::setIcaoAircraftCategory | ( | const std::string & | cat | ) |
Definition at line 1954 of file FlightPlan.cxx.
void flightgear::FlightPlan::setIcaoAircraftType | ( | const std::string & | ty | ) |
Definition at line 1967 of file FlightPlan.cxx.
void flightgear::FlightPlan::setIdent | ( | const std::string & | s | ) |
Definition at line 188 of file FlightPlan.cxx.
void flightgear::FlightPlan::setMaxFlyByTurnAngle | ( | double | deg | ) |
Definition at line 1937 of file FlightPlan.cxx.
void flightgear::FlightPlan::setRemarks | ( | const std::string & | remarks | ) |
Definition at line 2193 of file FlightPlan.cxx.
void flightgear::FlightPlan::setSID | ( | SID * | sid, |
const std::string & | transition = std::string() ) |
Definition at line 578 of file FlightPlan.cxx.
void flightgear::FlightPlan::setSID | ( | Transition * | sidWithTrans | ) |
Definition at line 591 of file FlightPlan.cxx.
void flightgear::FlightPlan::setSTAR | ( | STAR * | star, |
const std::string & | transition = std::string() ) |
Definition at line 678 of file FlightPlan.cxx.
void flightgear::FlightPlan::setSTAR | ( | Transition * | starWithTrans | ) |
Definition at line 691 of file FlightPlan.cxx.
|
inline |
Definition at line 292 of file FlightPlan.hxx.
Transition * flightgear::FlightPlan::sidTransition | ( | ) | const |
Definition at line 613 of file FlightPlan.cxx.
|
inline |
Definition at line 322 of file FlightPlan.hxx.
Transition * flightgear::FlightPlan::starTransition | ( | ) | const |
Definition at line 734 of file FlightPlan.cxx.
|
inline |
Definition at line 333 of file FlightPlan.hxx.
|
static |
Definition at line 1884 of file FlightPlan.cxx.
SGGeod flightgear::FlightPlan::vicinityForInsertIndex | ( | int | aIndex | ) | const |
given an index to insert a waypoint into the plan, find the geographical vicinity.
This is used to aid disambiguration searches, etc: see the vicinity paramter to 'waypointFromString' below, for example
When aIndex is negative, the vicinity used is the end of the current flight-plan, i.e appending to the waypoints rather than appending.
Definition at line 1440 of file FlightPlan.cxx.
WayptRef flightgear::FlightPlan::waypointFromString | ( | const std::string & | target, |
const SGGeod & | vicinity = SGGeod::invalid() ) |
Create a WayPoint from a string in the following format:
Definition at line 1461 of file FlightPlan.cxx.
|
friend |
Definition at line 445 of file FlightPlan.hxx.