Skip to main content

Class: FlightPlanRouteUtils

Defined in: src/sdk/flightplan/FlightPlanRouteUtils.ts:14

A utility class for working with flight plan routes.

Constructors

Constructor

new FlightPlanRouteUtils(): FlightPlanRouteUtils

Returns

FlightPlanRouteUtils

Methods

emptyAltitude()

static emptyAltitude(): FlightPlanRouteAltitude

Defined in: src/sdk/flightplan/FlightPlanRouteUtils.ts:108

Creates an empty flight plan altitude.

Returns

FlightPlanRouteAltitude

An empty flight plan altitude.


emptyEnrouteLeg()

static emptyEnrouteLeg(): FlightPlanRouteEnrouteLeg

Defined in: src/sdk/flightplan/FlightPlanRouteUtils.ts:65

Creates an empty flight plan enroute leg.

Returns

FlightPlanRouteEnrouteLeg

An empty flight plan enroute leg.


emptyRoute()

static emptyRoute(): FlightPlanRoute

Defined in: src/sdk/flightplan/FlightPlanRouteUtils.ts:19

Creates an empty flight plan route.

Returns

FlightPlanRoute

An empty flight plan route.


emptyVfrPatternApproach()

static emptyVfrPatternApproach(): FlightPlanRouteVfrPatternApproach

Defined in: src/sdk/flightplan/FlightPlanRouteUtils.ts:134

Creates an empty VFR traffic pattern approach procedure description.

Returns

FlightPlanRouteVfrPatternApproach

An empty VFR traffic pattern approach procedure description.


emptyVfrPatternDeparture()

static emptyVfrPatternDeparture(): FlightPlanRouteVfrPatternDeparture

Defined in: src/sdk/flightplan/FlightPlanRouteUtils.ts:120

Creates an empty VFR traffic pattern departure procedure description.

Returns

FlightPlanRouteVfrPatternDeparture

An empty VFR traffic pattern departure procedure description.


isEnrouteLegEmpty()

static isEnrouteLegEmpty(leg): boolean

Defined in: src/sdk/flightplan/FlightPlanRouteUtils.ts:224

Checks whether a flight plan route enroute leg is empty.

Parameters

ParameterTypeDescription
leg{ __Type: "JS_EnrouteLeg"; altitude: null | { __Type: "JS_FlightAltitude"; altitude: number; isFlightLevel: boolean; }; bearing: number; distance: number; fixIcao: { __Type: "JS_ICAO"; airport: string; ident: string; region: string; type: string; }; hasLatLon: boolean; hasPointBearingDistance: boolean; isPpos: boolean; lat: number; lon: number; name: string; referenceIcao: { __Type: "JS_ICAO"; airport: string; ident: string; region: string; type: string; }; via: string; }The leg to check.
leg.__Type"JS_EnrouteLeg"Coherent C++ object binding type.
leg.altitudenull | { __Type: "JS_FlightAltitude"; altitude: number; isFlightLevel: boolean; }This leg's altitude, or null if an altitude is not defined for this leg.
leg.bearingnumberThe true bearing of this leg's terminator fix from the reference facility, in degrees.
leg.distancenumberThe distance from the reference facility to this leg's terminator fix, in nautical miles.
leg.fixIcao{ __Type: "JS_ICAO"; airport: string; ident: string; region: string; type: string; }The ICAO of this leg's terminator fix.
leg.fixIcao.__Type"JS_ICAO"Coherent C++ object binding type.
leg.fixIcao.airportstringThe ident of the facility's associated airport.
leg.fixIcao.identstringThe facility's ident.
leg.fixIcao.regionstringThe facility's region code.
leg.fixIcao.typestringThe facility's type.
leg.hasLatLonbooleanWhether this leg's terminator fix is defined by a set of latitude/longitude coordinates.
leg.hasPointBearingDistancebooleanWhether this leg's terminator fix is defined by a bearing and distance from a reference facility.
leg.isPposbooleanWhether the leg should use the airplane's present position as its terminator fix.
leg.latnumberThe latitude of the leg's terminator fix, in degrees.
leg.lonnumberThe longitude of this leg's terminator fix, in degrees.
leg.namestringThis leg's name.
leg.referenceIcao{ __Type: "JS_ICAO"; airport: string; ident: string; region: string; type: string; }The ICAO of the reference facility with which this leg's terminator fix is defined.
leg.referenceIcao.__Type"JS_ICAO"Coherent C++ object binding type.
leg.referenceIcao.airportstringThe ident of the facility's associated airport.
leg.referenceIcao.identstringThe facility's ident.
leg.referenceIcao.regionstringThe facility's region code.
leg.referenceIcao.typestringThe facility's type.
leg.viastringThe airway to follow to this leg's terminator fix, or the empty string if this leg is a DIRECT leg. Must not exceed seven characters in length.

Returns

boolean

Whether the specified enroute leg is empty.


isRouteEmpty()

static isRouteEmpty(route, strict): boolean

Defined in: src/sdk/flightplan/FlightPlanRouteUtils.ts:153

Checks whether a flight plan route is empty.

Parameters

ParameterTypeDefault valueDescription
route{ __Type: "JS_FlightPlanRoute"; approach: { __Type: "JS_ApproachIdentifier"; runway: { __Type: "JS_RunwayIdentifier"; designator: string; number: string; }; suffix: string; type: string; }; approachTransition: string; approachVfrPattern: { __Type: "JS_VfrPatternProcedure"; altitude: number; distance: number; isLeftTraffic: boolean; type: FlightPlanRouteVfrPatternApproachType; }; arrival: string; arrivalTransition: string; cruiseAltitude: null | { __Type: "JS_FlightAltitude"; altitude: number; isFlightLevel: boolean; }; departure: string; departureAirport: { __Type: "JS_ICAO"; airport: string; ident: string; region: string; type: string; }; departureRunway: { __Type: "JS_RunwayIdentifier"; designator: string; number: string; }; departureTransition: string; departureVfrPattern: { __Type: "JS_VfrPatternProcedure"; altitude: number; distance: number; isLeftTraffic: boolean; type: FlightPlanRouteVfrPatternDepartureType; }; destinationAirport: { __Type: "JS_ICAO"; airport: string; ident: string; region: string; type: string; }; destinationRunway: { __Type: "JS_RunwayIdentifier"; designator: string; number: string; }; enroute: readonly object[]; isVfr: boolean; }undefinedThe route to check.
route.__Type"JS_FlightPlanRoute"undefinedCoherent C++ object binding type.
route.approach{ __Type: "JS_ApproachIdentifier"; runway: { __Type: "JS_RunwayIdentifier"; designator: string; number: string; }; suffix: string; type: string; }undefinedThis route's approach procedure.
route.approach.__Type"JS_ApproachIdentifier"undefinedCoherent C++ object binding type.
route.approach.runway{ __Type: "JS_RunwayIdentifier"; designator: string; number: string; }undefinedThe approach's associated runway.
route.approach.runway.__Type"JS_RunwayIdentifier"undefinedCoherent C++ object binding type.
route.approach.runway.designatorstringundefinedThe designator of the runway.
route.approach.runway.numberstringundefinedThe number of the runway.
route.approach.suffixstringundefinedThe suffix of the approach.
route.approach.typestringundefinedThe type name of the approach.
route.approachTransitionstringundefinedThe name of this route's approach procedure transition.
route.approachVfrPattern{ __Type: "JS_VfrPatternProcedure"; altitude: number; distance: number; isLeftTraffic: boolean; type: FlightPlanRouteVfrPatternApproachType; }undefinedThis route's VFR traffic pattern approach procedure.
route.approachVfrPattern.__Type"JS_VfrPatternProcedure"undefinedCoherent C++ object binding type.
route.approachVfrPattern.altitudenumberundefinedThe pattern altitude, in feet AGL.
route.approachVfrPattern.distancenumberundefinedThe pattern leg distance, in nautical miles.
route.approachVfrPattern.isLeftTrafficbooleanundefinedWhether the pattern uses a left-hand traffic pattern (true) instead of a right-hand traffic pattern (false).
route.approachVfrPattern.typeFlightPlanRouteVfrPatternApproachTypeundefinedThe selected pattern type.
route.arrivalstringundefinedThe name of this route's arrival procedure.
route.arrivalTransitionstringundefinedThe name of this route's arrival procedure enroute transition.
route.cruiseAltitudenull | { __Type: "JS_FlightAltitude"; altitude: number; isFlightLevel: boolean; }undefinedThis route's cruise altitude.
route.departurestringundefinedThe name of this route's departure procedure.
route.departureAirport{ __Type: "JS_ICAO"; airport: string; ident: string; region: string; type: string; }undefinedThe ICAO of this route's departure airport.
route.departureAirport.__Type"JS_ICAO"undefinedCoherent C++ object binding type.
route.departureAirport.airportstringundefinedThe ident of the facility's associated airport.
route.departureAirport.identstringundefinedThe facility's ident.
route.departureAirport.regionstringundefinedThe facility's region code.
route.departureAirport.typestringundefinedThe facility's type.
route.departureRunway{ __Type: "JS_RunwayIdentifier"; designator: string; number: string; }undefinedThis route's departure runway.
route.departureRunway.__Type"JS_RunwayIdentifier"undefinedCoherent C++ object binding type.
route.departureRunway.designatorstringundefinedThe designator of the runway.
route.departureRunway.numberstringundefinedThe number of the runway.
route.departureTransitionstringundefinedThe name of this route's departure procedure enroute transition.
route.departureVfrPattern{ __Type: "JS_VfrPatternProcedure"; altitude: number; distance: number; isLeftTraffic: boolean; type: FlightPlanRouteVfrPatternDepartureType; }undefinedThis route's VFR traffic pattern departure procedure.
route.departureVfrPattern.__Type"JS_VfrPatternProcedure"undefinedCoherent C++ object binding type.
route.departureVfrPattern.altitudenumberundefinedThe pattern altitude, in feet AGL.
route.departureVfrPattern.distancenumberundefinedThe pattern leg distance, in nautical miles.
route.departureVfrPattern.isLeftTrafficbooleanundefinedWhether the pattern uses a left-hand traffic pattern (true) instead of a right-hand traffic pattern (false).
route.departureVfrPattern.typeFlightPlanRouteVfrPatternDepartureTypeundefinedThe selected pattern type.
route.destinationAirport{ __Type: "JS_ICAO"; airport: string; ident: string; region: string; type: string; }undefinedThe ICAO of this route's destination airport.
route.destinationAirport.__Type"JS_ICAO"undefinedCoherent C++ object binding type.
route.destinationAirport.airportstringundefinedThe ident of the facility's associated airport.
route.destinationAirport.identstringundefinedThe facility's ident.
route.destinationAirport.regionstringundefinedThe facility's region code.
route.destinationAirport.typestringundefinedThe facility's type.
route.destinationRunway{ __Type: "JS_RunwayIdentifier"; designator: string; number: string; }undefinedThis route's destination runway.
route.destinationRunway.__Type"JS_RunwayIdentifier"undefinedCoherent C++ object binding type.
route.destinationRunway.designatorstringundefinedThe designator of the runway.
route.destinationRunway.numberstringundefinedThe number of the runway.
route.enroutereadonly object[]undefinedThis route's enroute legs.
route.isVfrbooleanundefinedWhether this route is classified as VFR.
strictbooleantrueWhether to apply a strict check. A strict check considers a route empty if and only if all its fields are themselves empty (except for isVfr, which can take any value). A non-strict check considers a route empty if and only if it does not define a departure airport, does not define a destination airport, and defines no enroute legs.

Returns

boolean

Whether the specified flight plan route is empty.


toEmptyEnrouteLeg()

static toEmptyEnrouteLeg(leg): FlightPlanRouteEnrouteLeg

Defined in: src/sdk/flightplan/FlightPlanRouteUtils.ts:88

Sets a flight plan enroute leg to be empty.

Parameters

ParameterTypeDescription
legFlightPlanRouteEnrouteLegThe leg to set.

Returns

FlightPlanRouteEnrouteLeg

The specified leg, after it has been set to be empty.


toEmptyRoute()

static toEmptyRoute(route): FlightPlanRoute

Defined in: src/sdk/flightplan/FlightPlanRouteUtils.ts:45

Sets a flight plan route to be empty.

Parameters

ParameterTypeDescription
routeFlightPlanRouteThe route to set.

Returns

FlightPlanRoute

The specified flight plan route, after it has been set to be empty.