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()
staticemptyAltitude():FlightPlanRouteAltitude
Defined in: src/sdk/flightplan/FlightPlanRouteUtils.ts:108
Creates an empty flight plan altitude.
Returns
An empty flight plan altitude.
emptyEnrouteLeg()
staticemptyEnrouteLeg():FlightPlanRouteEnrouteLeg
Defined in: src/sdk/flightplan/FlightPlanRouteUtils.ts:65
Creates an empty flight plan enroute leg.
Returns
An empty flight plan enroute leg.
emptyRoute()
staticemptyRoute():FlightPlanRoute
Defined in: src/sdk/flightplan/FlightPlanRouteUtils.ts:19
Creates an empty flight plan route.
Returns
An empty flight plan route.
emptyVfrPatternApproach()
staticemptyVfrPatternApproach():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()
staticemptyVfrPatternDeparture():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()
staticisEnrouteLegEmpty(leg):boolean
Defined in: src/sdk/flightplan/FlightPlanRouteUtils.ts:224
Checks whether a flight plan route enroute leg is empty.
Parameters
| Parameter | Type | Description |
|---|---|---|
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.altitude | null | { __Type: "JS_FlightAltitude"; altitude: number; isFlightLevel: boolean; } | This leg's altitude, or null if an altitude is not defined for this leg. |
leg.bearing | number | The true bearing of this leg's terminator fix from the reference facility, in degrees. |
leg.distance | number | The 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.airport | string | The ident of the facility's associated airport. |
leg.fixIcao.ident | string | The facility's ident. |
leg.fixIcao.region | string | The facility's region code. |
leg.fixIcao.type | string | The facility's type. |
leg.hasLatLon | boolean | Whether this leg's terminator fix is defined by a set of latitude/longitude coordinates. |
leg.hasPointBearingDistance | boolean | Whether this leg's terminator fix is defined by a bearing and distance from a reference facility. |
leg.isPpos | boolean | Whether the leg should use the airplane's present position as its terminator fix. |
leg.lat | number | The latitude of the leg's terminator fix, in degrees. |
leg.lon | number | The longitude of this leg's terminator fix, in degrees. |
leg.name | string | This 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.airport | string | The ident of the facility's associated airport. |
leg.referenceIcao.ident | string | The facility's ident. |
leg.referenceIcao.region | string | The facility's region code. |
leg.referenceIcao.type | string | The facility's type. |
leg.via | string | The 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()
staticisRouteEmpty(route,strict):boolean
Defined in: src/sdk/flightplan/FlightPlanRouteUtils.ts:153
Checks whether a flight plan route is empty.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
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; } | undefined | The route to check. |
route.__Type | "JS_FlightPlanRoute" | undefined | Coherent C++ object binding type. |
route.approach | { __Type: "JS_ApproachIdentifier"; runway: { __Type: "JS_RunwayIdentifier"; designator: string; number: string; }; suffix: string; type: string; } | undefined | This route's approach procedure. |
route.approach.__Type | "JS_ApproachIdentifier" | undefined | Coherent C++ object binding type. |
route.approach.runway | { __Type: "JS_RunwayIdentifier"; designator: string; number: string; } | undefined | The approach's associated runway. |
route.approach.runway.__Type | "JS_RunwayIdentifier" | undefined | Coherent C++ object binding type. |
route.approach.runway.designator | string | undefined | The designator of the runway. |
route.approach.runway.number | string | undefined | The number of the runway. |
route.approach.suffix | string | undefined | The suffix of the approach. |
route.approach.type | string | undefined | The type name of the approach. |
route.approachTransition | string | undefined | The name of this route's approach procedure transition. |
route.approachVfrPattern | { __Type: "JS_VfrPatternProcedure"; altitude: number; distance: number; isLeftTraffic: boolean; type: FlightPlanRouteVfrPatternApproachType; } | undefined | This route's VFR traffic pattern approach procedure. |
route.approachVfrPattern.__Type | "JS_VfrPatternProcedure" | undefined | Coherent C++ object binding type. |
route.approachVfrPattern.altitude | number | undefined | The pattern altitude, in feet AGL. |
route.approachVfrPattern.distance | number | undefined | The pattern leg distance, in nautical miles. |
route.approachVfrPattern.isLeftTraffic | boolean | undefined | Whether the pattern uses a left-hand traffic pattern (true) instead of a right-hand traffic pattern (false). |
route.approachVfrPattern.type | FlightPlanRouteVfrPatternApproachType | undefined | The selected pattern type. |
route.arrival | string | undefined | The name of this route's arrival procedure. |
route.arrivalTransition | string | undefined | The name of this route's arrival procedure enroute transition. |
route.cruiseAltitude | null | { __Type: "JS_FlightAltitude"; altitude: number; isFlightLevel: boolean; } | undefined | This route's cruise altitude. |
route.departure | string | undefined | The name of this route's departure procedure. |
route.departureAirport | { __Type: "JS_ICAO"; airport: string; ident: string; region: string; type: string; } | undefined | The ICAO of this route's departure airport. |
route.departureAirport.__Type | "JS_ICAO" | undefined | Coherent C++ object binding type. |
route.departureAirport.airport | string | undefined | The ident of the facility's associated airport. |
route.departureAirport.ident | string | undefined | The facility's ident. |
route.departureAirport.region | string | undefined | The facility's region code. |
route.departureAirport.type | string | undefined | The facility's type. |
route.departureRunway | { __Type: "JS_RunwayIdentifier"; designator: string; number: string; } | undefined | This route's departure runway. |
route.departureRunway.__Type | "JS_RunwayIdentifier" | undefined | Coherent C++ object binding type. |
route.departureRunway.designator | string | undefined | The designator of the runway. |
route.departureRunway.number | string | undefined | The number of the runway. |
route.departureTransition | string | undefined | The name of this route's departure procedure enroute transition. |
route.departureVfrPattern | { __Type: "JS_VfrPatternProcedure"; altitude: number; distance: number; isLeftTraffic: boolean; type: FlightPlanRouteVfrPatternDepartureType; } | undefined | This route's VFR traffic pattern departure procedure. |
route.departureVfrPattern.__Type | "JS_VfrPatternProcedure" | undefined | Coherent C++ object binding type. |
route.departureVfrPattern.altitude | number | undefined | The pattern altitude, in feet AGL. |
route.departureVfrPattern.distance | number | undefined | The pattern leg distance, in nautical miles. |
route.departureVfrPattern.isLeftTraffic | boolean | undefined | Whether the pattern uses a left-hand traffic pattern (true) instead of a right-hand traffic pattern (false). |
route.departureVfrPattern.type | FlightPlanRouteVfrPatternDepartureType | undefined | The selected pattern type. |
route.destinationAirport | { __Type: "JS_ICAO"; airport: string; ident: string; region: string; type: string; } | undefined | The ICAO of this route's destination airport. |
route.destinationAirport.__Type | "JS_ICAO" | undefined | Coherent C++ object binding type. |
route.destinationAirport.airport | string | undefined | The ident of the facility's associated airport. |
route.destinationAirport.ident | string | undefined | The facility's ident. |
route.destinationAirport.region | string | undefined | The facility's region code. |
route.destinationAirport.type | string | undefined | The facility's type. |
route.destinationRunway | { __Type: "JS_RunwayIdentifier"; designator: string; number: string; } | undefined | This route's destination runway. |
route.destinationRunway.__Type | "JS_RunwayIdentifier" | undefined | Coherent C++ object binding type. |
route.destinationRunway.designator | string | undefined | The designator of the runway. |
route.destinationRunway.number | string | undefined | The number of the runway. |
route.enroute | readonly object[] | undefined | This route's enroute legs. |
route.isVfr | boolean | undefined | Whether this route is classified as VFR. |
strict | boolean | true | Whether 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()
statictoEmptyEnrouteLeg(leg):FlightPlanRouteEnrouteLeg
Defined in: src/sdk/flightplan/FlightPlanRouteUtils.ts:88
Sets a flight plan enroute leg to be empty.
Parameters
| Parameter | Type | Description |
|---|---|---|
leg | FlightPlanRouteEnrouteLeg | The leg to set. |
Returns
The specified leg, after it has been set to be empty.
toEmptyRoute()
statictoEmptyRoute(route):FlightPlanRoute
Defined in: src/sdk/flightplan/FlightPlanRouteUtils.ts:45
Sets a flight plan route to be empty.
Parameters
| Parameter | Type | Description |
|---|---|---|
route | FlightPlanRoute | The route to set. |
Returns
The specified flight plan route, after it has been set to be empty.