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:134
Converts all runway ICAO references in a flight plan leg to the runway ICAO format used by the MSFS avionics SDK.
Parameters
Parameter | Type | Description |
---|---|---|
leg | FlightPlanLeg | The flight plan leg to change. |
Returns
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:123
Creates a new FlightPlanLegIndexes object with all indexes set to -1
.
Returns
A new FlightPlanLegIndexes
object with all indexes set to -1
.
getTerminatorIcao()
static
getTerminatorIcao(leg
):undefined
|string
Defined in: src/sdk/flightplan/FlightPlanUtils.ts:102
Gets the ICAO of the facility defining the terminator of a flight plan leg.
Parameters
Parameter | Type | Description |
---|---|---|
leg | FlightPlanLeg | A flight plan leg. |
Returns
undefined
| string
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:47
Checks if a leg type is an "to altitude" leg type.
Parameters
Parameter | Type | Description |
---|---|---|
legType | LegType | The 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:92
Checks if a leg type is a discontinuity leg type.
Parameters
Parameter | Type | Description |
---|---|---|
legType | LegType | The 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:56
Checks if a leg type is a "heading to" leg type.
Parameters
Parameter | Type | Description |
---|---|---|
legType | LegType | The 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:74
Checks if a leg type is a "hold" leg type.
Parameters
Parameter | Type | Description |
---|---|---|
legType | LegType | The leg type to check. |
Returns
legType is HA | HF | HM
Whether the leg type is a "hold" leg type.
isManualDiscontinuityLeg()
static
isManualDiscontinuityLeg(legType
): legType is FM | VM
Defined in: src/sdk/flightplan/FlightPlanUtils.ts:83
Checks if a leg type is a manual termination leg type that ends in a discontinuity.
Parameters
Parameter | Type | Description |
---|---|---|
legType | LegType | The 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:38
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
Parameter | Type | Description |
---|---|---|
legType | LegType | The 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:65
Checks if a leg type is a "to radial" leg type.
Parameters
Parameter | Type | Description |
---|---|---|
legType | LegType | The 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:162
Sets an ICAO property on a FlightPlanLeg, ensuring that both the associated value and string (V1) properties stay in sync.
Parameters
Parameter | Type | Description |
---|---|---|
leg | FlightPlanLeg | The flight plan leg to change. |
prop | "fixIcaoStruct" | "originIcaoStruct" | "arcCenterFixIcaoStruct" | The property to set. |
icao | IcaoValue | The ICAO value to set on the property. |
Returns
The specified flight plan leg, after it has been changed.