Skip to main content

Class: FlightPlanUtils

Defined in: src/sdk/flightplan/FlightPlanUtils.ts:10

Utility class for working with flight plans.

Constructors​

Constructor​

new FlightPlanUtils(): FlightPlanUtils

Returns​

FlightPlanUtils

Methods​

convertLegRunwayIcaosToSdkFormat()​

static convertLegRunwayIcaosToSdkFormat(leg): FlightPlanLeg

Defined in: src/sdk/flightplan/FlightPlanUtils.ts:170

Converts all runway ICAO references in a flight plan leg to the runway ICAO format used by the MSFS avionics SDK.

Parameters​

ParameterTypeDescription
legFlightPlanLegThe flight plan leg to change.

Returns​

FlightPlanLeg

The specified flight plan leg, after all of its runway ICAO references have been changed to the format used by the MSFS avionics SDK.


emptyLegIndexes()​

static emptyLegIndexes(): FlightPlanLegIndexes

Defined in: src/sdk/flightplan/FlightPlanUtils.ts:159

Creates a new FlightPlanLegIndexes object with all indexes set to -1.

Returns​

FlightPlanLegIndexes

A new FlightPlanLegIndexes object with all indexes set to -1.


getTerminatorIcao()​

static getTerminatorIcao(leg): string | undefined

Defined in: src/sdk/flightplan/FlightPlanUtils.ts:115

Gets the ICAO of the facility defining the terminator of a flight plan leg.

Parameters​

ParameterTypeDescription
legFlightPlanLegA flight plan leg.

Returns​

string | undefined

The ICAO of the facility defining the terminator of the specified flight plan leg, or undefined if the leg's terminator is not defined by a facility.

Deprecated​

Use FlightPathUtils.getTerminatorIcaoValue instead.


getTerminatorIcaoValue()​

static getTerminatorIcaoValue(leg): IcaoValue | undefined

Defined in: src/sdk/flightplan/FlightPlanUtils.ts:138

Gets the ICAO of the facility defining the terminator of a flight plan leg.

Parameters​

ParameterTypeDescription
legFlightPlanLegA flight plan leg.

Returns​

IcaoValue | undefined

The ICAO of the facility defining the terminator of the specified flight plan leg, or undefined if the leg's terminator is not defined by a facility.


isAltitudeLeg()​

static isAltitudeLeg(legType): legType is CA | FA | VA

Defined in: src/sdk/flightplan/FlightPlanUtils.ts:50

Checks if a leg type is an "to altitude" leg type.

Parameters​

ParameterTypeDescription
legTypeLegTypeThe leg type to check.

Returns​

legType is CA | FA | VA

Whether the leg type is a "to altitude" leg type.


isDiscontinuityLeg()​

static isDiscontinuityLeg(legType): legType is Discontinuity | ThruDiscontinuity

Defined in: src/sdk/flightplan/FlightPlanUtils.ts:104

Checks if a leg type is a discontinuity leg type.

Parameters​

ParameterTypeDescription
legTypeLegTypeThe leg type to check.

Returns​

legType is Discontinuity | ThruDiscontinuity

Whether the leg type is a discontinuity leg type.


isHeadingToLeg()​

static isHeadingToLeg(legType): legType is VA | VD | VI | VM | VR

Defined in: src/sdk/flightplan/FlightPlanUtils.ts:59

Checks if a leg type is a "heading to" leg type.

Parameters​

ParameterTypeDescription
legTypeLegTypeThe leg type to check.

Returns​

legType is VA | VD | VI | VM | VR

Whether the leg type is a "heading to" leg type.


isHoldLeg()​

static isHoldLeg(legType): legType is HA | HF | HM

Defined in: src/sdk/flightplan/FlightPlanUtils.ts:77

Checks if a leg type is a "hold" leg type.

Parameters​

ParameterTypeDescription
legTypeLegTypeThe leg type to check.

Returns​

legType is HA | HF | HM

Whether the leg type is a "hold" leg type.


isInterceptLeg()​

static isInterceptLeg(legType): legType is CI | PI | VI

Defined in: src/sdk/flightplan/FlightPlanUtils.ts:86

Checks if a leg type is a "intercept" leg type.

Parameters​

ParameterTypeDescription
legTypeLegTypeThe leg type to check.

Returns​

legType is CI | PI | VI

Whether the leg type is a "intercept" leg type.


isManualDiscontinuityLeg()​

static isManualDiscontinuityLeg(legType): legType is FM | VM

Defined in: src/sdk/flightplan/FlightPlanUtils.ts:95

Checks if a leg type is a manual termination leg type that ends in a discontinuity.

Parameters​

ParameterTypeDescription
legTypeLegTypeThe leg type to check.

Returns​

legType is FM | VM

Whether the leg type is a manual termination leg type that ends in a discontinuity.


isToFixLeg()​

static isToFixLeg(legType): legType is AF | CF | DF | HF | IF | RF | TF

Defined in: src/sdk/flightplan/FlightPlanUtils.ts:41

Checks if a leg type is a "to fix" leg type. Note that while HM and HA legs may terminate at the hold fix, they are explicitly excluded from this check.

Parameters​

ParameterTypeDescription
legTypeLegTypeThe leg type to check.

Returns​

legType is AF | CF | DF | HF | IF | RF | TF

Whether the leg type is a "to fix" leg type.


isToRadialLeg()​

static isToRadialLeg(legType): legType is CR | VR

Defined in: src/sdk/flightplan/FlightPlanUtils.ts:68

Checks if a leg type is a "to radial" leg type.

Parameters​

ParameterTypeDescription
legTypeLegTypeThe leg type to check.

Returns​

legType is CR | VR

Whether the leg type is a "to radial" leg type.


setLegIcao()​

static setLegIcao(leg, prop, icao): FlightPlanLeg

Defined in: src/sdk/flightplan/FlightPlanUtils.ts:198

Sets an ICAO property on a FlightPlanLeg, ensuring that both the associated value and string (V1) properties stay in sync.

Parameters​

ParameterTypeDescription
legFlightPlanLegThe flight plan leg to change.
prop"fixIcaoStruct" | "originIcaoStruct" | "arcCenterFixIcaoStruct"The property to set.
icaoIcaoValueThe ICAO value to set on the property.

Returns​

FlightPlanLeg

The specified flight plan leg, after it has been changed.