Skip to main content

Class: WT21FmsUtils

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:17

Utility Methods for the WT21 FMS.

Constructors

Constructor

new WT21FmsUtils(): WTLineFmsUtils

Returns

WTLineFmsUtils

Properties

DTO_LEG_OFFSET

readonly static DTO_LEG_OFFSET: 3 = 3

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:31


getBestRnavType()

static getBestRnavType: (query) => RnavTypeFlags = ApproachUtils.getBestRnavType

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:198

Utility method to return a single RnavTypeFlag from multiple possible flags.

Gets the best RNAV minimum type available for a given approach.

Parameters

ParameterTypeDescription
queryApproachProcedure | RnavTypeFlagsThe approach to check, or its RNAV type flags.

Returns

RnavTypeFlags

The best RNAV minimum type available for the specified approach.

Param

The input RnavTypeFlags.

Returns

A single RnavTypeFlag


PRIMARY_ACT_PLAN_INDEX

readonly static PRIMARY_ACT_PLAN_INDEX: Active = WTLineLegacyFlightPlans.Active

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:23

Deprecated

use WTLineLegacyFlightPlans instead


PRIMARY_MOD_PLAN_INDEX

readonly static PRIMARY_MOD_PLAN_INDEX: Mod = WTLineLegacyFlightPlans.Mod

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:26

Deprecated

use WTLineLegacyFlightPlans instead


PROC_PREVIEW_PLAN_INDEX

readonly static PROC_PREVIEW_PLAN_INDEX: 2 = 2

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:29

Deprecated

not used


USER_DATA_KEY_ALTN

readonly static USER_DATA_KEY_ALTN: "wt21.altn" = 'wt21.altn'

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:33


USER_DATA_KEY_FIX_INFO

readonly static USER_DATA_KEY_FIX_INFO: "wt21.fix-info" = 'wt21.fix-info'

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:35


USER_DATA_KEY_PROCEDURE_IDENTS

readonly static USER_DATA_KEY_PROCEDURE_IDENTS: "wtline.procedure-idents" = 'wtline.procedure-idents'

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:37

Methods

approachHasNavFrequency()

static approachHasNavFrequency(approach): boolean

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:502

Checks whether an approach has a primary NAV frequency based on its type. Only approaches of the following types have primary NAV frequencies: ILS, LOC (BC), LDA, SDF, VOR(DME).

Parameters

ParameterTypeDescription
approachApproachProcedureThe approach to check.

Returns

boolean

Whether the specified approach has a primary NAV frequency based on its type.


buildRunwayLeg()

static buildRunwayLeg(airport, oneWayRunway, isOriginRunway): FlightPlanLeg

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:101

Utility method to return a one-way runway leg

Parameters

ParameterTypeDescription
airportAirportFacilityThe runway's parent airport.
oneWayRunwayOneWayRunwayis the one wway runway object
isOriginRunwaybooleanis a bool whether this is the origin or destination (origin = true, dest = false)

Returns

FlightPlanLeg

a leg object for the runway


buildVisualApproach()

static buildVisualApproach(facRepo, airport, runway, finalLegDistance, name?, finalLegIdent?): ApproachProcedure

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:122

Utility method to return a visual approach for a runway.

Parameters

ParameterTypeDescription
facRepoFacilityRepositoryis a facility repository in which to store the created faf leg facility
airportAirportFacilityis the airport facility for the visual approach.
runwayOneWayRunwayis the runway to build the visual approach for.
finalLegDistancenumberis the distance from the runway to place the faf leg in NM.
name?stringis the optional name for the approach.
finalLegIdent?stringis the optional name for the faf leg.

Returns

ApproachProcedure

an approach procedure.


buildWT21LegName()

static buildWT21LegName(leg): string

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1132

Builds leg names using default nomenclature.

Parameters

ParameterTypeDescription
legFlightPlanLegThe leg to build a name for.

Returns

string

The name of the leg.


canLegBeSelectedOnDirectPage()

static canLegBeSelectedOnDirectPage(leg): boolean

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1106

Checks whether a leg should appear on the Direct To Page based on leg type.

Parameters

ParameterTypeDescription
legFlightPlanLegThe FlightPlanLeg to evaluate.

Returns

boolean

whether or not the leg should appear on the Direct To page.


distanceBetweenDiscontinuedLegs()

static distanceBetweenDiscontinuedLegs(prevLeg, nextLeg): number

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1413

Returns the distance between the end of a leg before a discontinuity and the start of the leg after that discontinuity

Parameters

ParameterTypeDescription
prevLegLegDefinitionthe leg before the discontinuity
nextLegLegDefinitionthe leg after the discontinuity

Returns

number

the great circle distance between the end of the previous leg and the start of the next leg, in metres


emptyFlightPlan()

static emptyFlightPlan(plan, notify): void

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:56

Empties a given flight plan

Parameters

ParameterTypeDefault valueDescription
planFlightPlanundefinedthe plan to empty
notifybooleantruewhether to send out sync events

Returns

void


estimateDistanceForSeconds()

static estimateDistanceForSeconds(seconds, groundSpeed): number

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1357

Calculates distance flown for a number of seconds at a ground speed

Parameters

ParameterTypeDescription
secondsnumbertime flown in number of seconds
groundSpeednumberGS to predict with

Returns

number

distance in nautical miles


estimateSecondsForDistance()

static estimateSecondsForDistance(distance, groundSpeed): number

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1345

Calculates time in seconds to fly a certain distance at a ground speed

Parameters

ParameterTypeDescription
distancenumberdistance to fly
groundSpeednumberGS to predict with

Returns

number

time in number of seconds


findIcaoInSegment()

static findIcaoInSegment(segment, icao): number | undefined

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:82

Checks whether a leg exists in a segment with the specified ICAO and, if so, returns the leg index of that leg.

Parameters

ParameterTypeDescription
segmentFlightPlanSegmentThe segment to check for the icao.
icaostring | undefinedThe ICAO to check for in the segment.

Returns

number | undefined

The segment leg index of the leg with the matching icao, or -1.


formatFacilityFrequencyType()

static formatFacilityFrequencyType(frequency, noneString): string

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1436

Formats a facility frequency's type for display on the FMC

Parameters

ParameterTypeDefault valueDescription
frequencyFacilityFrequencyundefinedthe frequency
noneStringstring'UNKNOWN'(optional) the string to return when the type is "None"

Returns

string

a string


getActiveSegment()

static getActiveSegment(plan): FlightPlanSegment | undefined

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:44

Gets the active segment in the Lateral Flight Plan.

Parameters

ParameterTypeDescription
planFlightPlanThe Lateral Flight Plan.

Returns

FlightPlanSegment | undefined

The Active Flight Plan Segment or undefined.


getAirwayFromFacility()

static getAirwayFromFacility(facLoader, icao, airwayIdent): Promise<AirwayData | undefined>

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1038

Returns an airway with a given ident crossing a facility with a given ICAO

Parameters

ParameterTypeDescription
facLoaderFacilityClientThe facility loader.
icaoIcaoValueThe icao of the facility to check.
airwayIdentstringThe ident of the airway to search for.

Returns

Promise<AirwayData | undefined>

The airway object or undefined


getApproachFromPlan()

static getApproachFromPlan(plan, destination): ApproachProcedure | undefined

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:237

Gets an approach procedure from a flight plan.

Parameters

ParameterTypeDescription
planFlightPlanA flight plan.
destinationAirportFacilityThe detsination airport of the flight plan.

Returns

ApproachProcedure | undefined

The approach procedure from the flight plan, or undefined if the plan has no approach.


getApproachNameAsParts()

static getApproachNameAsParts(proc, transitionIndex, includeTransition): ApproachNameParts

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:425

Utility method to analyze an approach for its name components and pack them into a custom type.

Parameters

ParameterTypeDefault valueDescription
procApproachProcedureundefinedThe approach procedure.
transitionIndexnumberundefinedThe transition index.
includeTransitionbooleantrueWhether to include the transition identifier.

Returns

ApproachNameParts

The name as an ApproachNameParts


getApproachNameAsString()

static getApproachNameAsString(facility, procedureIndex, transitionIndex, includeTransition, padSuffix): string

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:483

Utility method that gets an approach and returns its name as a flat string suitable for use in embedded text content.

Parameters

ParameterTypeDefault valueDescription
facilityAirportFacilityundefinedThe Facility.
procedureIndexnumberundefinedThe approach index.
transitionIndexnumberundefinedThe index of the approach transition.
includeTransitionbooleantrueWhether to include the transition identifier.
padSuffixbooleanfalseWhether to include space for the suffix even where there isn't one.

Returns

string

The formatted name as a string.


getApproachVtfLeg()

static getApproachVtfLeg(plan): LegDefinition | undefined

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:290

Gets the vectors-to-final leg of a flight plan.

Parameters

ParameterTypeDescription
planFlightPlanA flight plan.

Returns

LegDefinition | undefined

The vectors-to-final leg of the flight plan, or undefined if one could not be found.


getArrivalNameAsString()

static getArrivalNameAsString(facility, procedureIndex, transitionIndex): string

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:393

Gets the name of a arrival procedure as a string.

Parameters

ParameterTypeDescription
facilityAirportFacilityThe airport to which the arrival belongs.
procedureIndexnumberAn arrival procedure index.
transitionIndexnumberThe index of the arrival enroute transition.

Returns

string

The name of the arrival procedure.


getConstraintDisplayForDirectPage()

static getConstraintDisplayForDirectPage(verticalData, transitionAltitude): string

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:837

Method to get the FMS constraint display data from a verticalData object

Parameters

ParameterTypeDefault valueDescription
verticalDataVerticalDataundefinedis the Vertical Data object for the leg
transitionAltitudenumber18000is the transition altitude that applies to the constraint

Returns

string

A string to display on the FMC


getConstraintDisplayForLegs()

static getConstraintDisplayForLegs(performancePlanData, verticalData, transitionAltitude, constraintInvalid?, isRunway?): string

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:758

Method to get the FMS constraint display data from a verticalData object.

Parameters

ParameterTypeDefault valueDescription
performancePlanDataPerformancePlanDataundefinedperformance plan data
verticalDataVerticalDataundefinedThe Vertical Data object for the leg.
transitionAltitudenumber18000The transition altitude that applies to the constraint.
constraintInvalid?booleanundefinedIf the constraint is invalid.
isRunway?booleanundefinedIf the constraint is a runway.

Returns

string

A string to display on the FMC.


getDepartureNameAsString()

static getDepartureNameAsString(facility, procedureIndex): string

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:364

Gets the name of a departure procedure as a string.

Parameters

ParameterTypeDescription
facilityAirportFacilityThe Facility.
procedureIndexnumberThe procedure index.

Returns

string

The name of the departure procedure.


getDirectToCourse()

static getDirectToCourse(leg): number

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1011

Gets the direct to magnetic course from the leg vectors.

Parameters

ParameterTypeDescription
legLegDefinitionThe Leg Definition

Returns

number

the magnetic course.


getDistanceFromPposToLegEnd()

static getDistanceFromPposToLegEnd(lateralPlan, globalLegIndex, legDistanceRemaining): number | undefined

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1480

Returns the distance from PPOS to the end of a leg, given a lateral plan and a global leg index

Parameters

ParameterTypeDescription
lateralPlanFlightPlanthe lateral plan
globalLegIndexnumberthe global leg index
legDistanceRemainingnumberThe remaining distance to the end of the leg currently tracked by LNAV, in nautical miles.

Returns

number | undefined

the distance, in metres


getDistanceToDestination()

static getDistanceToDestination(plan, facClient, legDistanceRemaining): Promise<number | null>

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1507

Calculates the distance, from the present position along a leg, to the "destination" of the plan. If the last non-missed approach leg is a missed approach point, the distance along the plan to it is returned. Otherwise, the great-circle distance to the destination airport reference point is added.

Parameters

ParameterTypeDescription
planFlightPlanthe flight plan
facClientFacilityClienta facility client
legDistanceRemainingnumberthe distance remaining on the active leg

Returns

Promise<number | null>

the distance in metres, or null if it cannot be computed


getFlightPlanAlternate()

static getFlightPlanAlternate(plan): IcaoValue | undefined

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1551

Gets the alternate airport ICAO of a flight plan

Parameters

ParameterTypeDescription
planFlightPlanthw flight plan

Returns

IcaoValue | undefined

the alternate airport ICAO, or undefined


getFlightPlanProcedureIdents()

static getFlightPlanProcedureIdents(plan): WTLineFlightPlanProcedureIdents

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1579

Gets the procedure identifiers of a flight plan

Parameters

ParameterTypeDescription
planFlightPlanthe flight plan

Returns

WTLineFlightPlanProcedureIdents

the procedure idents

Throws

if an internal error occurs


getFpaDisplayForLegs()

static getFpaDisplayForLegs(vnavLeg, vnavConstraint?, phase?): string

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:733

Method to get the FMS FPA display data for a leg from a VNavConstraint and VNavLeg.

Parameters

ParameterTypeDescription
vnavLegVNavLegThe VNav Leg from the vertical flight plan that cooresponds to this leg index.
vnavConstraint?VNavConstraintThe VNav Constraint from the Vertical Flight Plan that cooresponds to this leg index.
phase?VerticalFlightPhaseThe vertical flight phase of this leg.

Returns

string

A string to display on the FMC.


getLastFixCoordinates()

static getLastFixCoordinates(plan, facClient, segmentIndex?, legIndex?, out?): Promise<GeoPointInterface>

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1651

Returns the coordinates of the last database fix that is the termination of a leg in the flight plan

Parameters

ParameterTypeDescription
planFlightPlanthe flight plan to query
facClientFacilityClienta facility client instance, used to get the coordinates of leg termination facilities
segmentIndex?numberthe segment index of the leg to start searching backwards from. If undefined, will search from the last leg
legIndex?numberthe local leg index of the leg to start searching backwards from. If undefined, will search from the last leg
out?GeoPointthe GeoPoint to write the results to. Defaults to a new GeoPoint.

Returns

Promise<GeoPointInterface>

a GeoPointInterface

Throws

if segmentIndex and legIndex are not both undefined or specified


getLastNonMissedApproachLeg()

static getLastNonMissedApproachLeg(plan): number

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1370

Returns the index of the last non-missed approach leg in the flight plan

Parameters

ParameterTypeDescription
planFlightPlanthe plan to use for lookup

Returns

number

array of index and ident, or undefined if no approach segment

Deprecated

use getMissedApproachPointIndex instead


getMissedApproachPointIndex()

static getMissedApproachPointIndex(plan): number

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1389

Returns the index of the last leg in the flight plan that is marked as a missed approach point

Parameters

ParameterTypeDescription
planFlightPlanthe flight plan

Returns

number

the index of the leg, or -1 if none exists


getNextLegWithDefinedTermination()

static getNextLegWithDefinedTermination(plan, fromIndex): number

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:605

Returns the index of the next leg starting from a given index whose termination is defined (i.e. not a (VECT) or a discontinuity), wrapping around to the start of the plan if necessary

Parameters

ParameterTypeDescription
planFlightPlanthe flight plan
fromIndexnumber | undefinedthe index from which to start searching for the next leg with a defined termination. If the value is undefined, the search starts from the start of the flight plan (inclusively).

Returns

number

a number, -1 if no such leg is found


getNominalFromLeg()

static getNominalFromLeg(plan, segmentIndex, segmentLegIndex): LegDefinition | undefined

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:525

Gets the nominal leg from which a specified flight plan leg originates. The nominal from leg excludes any legs which are part of a direct to or vectors-to-final sequence.

Parameters

ParameterTypeDescription
planFlightPlanA flight plan.
segmentIndexnumberThe index of the segment containing the leg for which to get the from leg.
segmentLegIndexnumberThe index of the leg for which to get the from leg in its segment.

Returns

LegDefinition | undefined

The nominal leg from which the specified flight plan leg originates.


getNominalFromLegIndex()

static getNominalFromLegIndex(plan, segmentIndex, segmentLegIndex): number

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:549

Gets the global leg index of the nominal leg from which a specified flight plan leg originates. The nominal from leg excludes any legs which are part of a direct to or vectors-to-final sequence.

Parameters

ParameterTypeDescription
planFlightPlanA flight plan.
segmentIndexnumberThe index of the segment containing the leg for which to get the from leg.
segmentLegIndexnumberThe index of the leg for which to get the from leg in its segment.

Returns

number

The nominal leg from which the specified flight plan leg originates.


getPlanHolds()

static getPlanHolds(plan, inMissed): LegDefinition[]

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1315

Returns hold legs in the flight plan. Used to determine and show appropriate HOLD pages.

Parameters

ParameterTypeDefault valueDescription
planFlightPlanundefinedthe flight plan in question
inMissedbooleanfalsewhether to only include missed approach holds

Returns

LegDefinition[]

the result


getPreviousLegWithDefinedTermination()

static getPreviousLegWithDefinedTermination(plan, fromIndex): number

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:575

Returns the index of the first previous leg starting from a given index whose termination is defined (i.e. not a (VECT) or a discontinuity), wrapping around to the end of the plan if necessary

Parameters

ParameterTypeDescription
planFlightPlanthe flight plan
fromIndexnumber | undefinedthe index from which to start searching for the previous leg with a defined termination. If the value is undefined, the search starts from the end of the flight plan (inclusively).

Returns

number

a number, -1 if no such leg is found


getProcedureIndexAndTransitionIndexFromSegmentType()

static getProcedureIndexAndTransitionIndexFromSegmentType(segmentType, lateralPlan): number[]

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:309

Gets the procedure index and transition index from procedure details of the lateral plan based on segment type.

Parameters

ParameterTypeDescription
segmentTypeFlightPlanSegmentTypeThe segment type.
lateralPlanFlightPlanThe lateral flight plan.

Returns

number[]

an array of procedureIndex, transitionIndex.


getProcedureNameAsString()

static getProcedureNameAsString(segmentType, facility, procedureIndex, transitionIndex?): string

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:329

Combiner method to get a procedure name as a string for the FPLN Page.

Parameters

ParameterTypeDescription
segmentTypeFlightPlanSegmentTypeThe segment type.
facilityAirportFacility | undefinedThe facility.
procedureIndexnumberThe procedure index.
transitionIndex?numberThe transition index.

Returns

string

the name as a string.


isAirwayAtLeg()

static isAirwayAtLeg(facLoader, icao, airwayName): Promise<AirwayData | undefined>

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1069

Checks for an airway at a leg and returns the airway or undefined

Parameters

ParameterTypeDescription
facLoaderFacilityLoaderThe facility loader.
icaostringThe icao of the entry to check.
airwayNamestringThe airway to search for.

Returns

Promise<AirwayData | undefined>

The airway object or undefined

Deprecated

use getAirwayFromFacility instead


isAltitudeLeg()

static isAltitudeLeg(legType): boolean

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:963

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

Parameters

ParameterTypeDescription
legTypeLegTypeThe LegType.

Returns

boolean

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

Deprecated

use FlightPlanUtils.isAltitudeLeg instead


isApproachLoaded()

static isApproachLoaded(plan): boolean

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:272

Checks whether a flight plan has an approach loaded.

Parameters

ParameterTypeDescription
planFlightPlanA flight plan.

Returns

boolean

Whether the flight plan has an approach loaded.


isCourseToLeg()

static isCourseToLeg(legType): boolean

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:972

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

Parameters

ParameterTypeDescription
legTypeLegTypeThe LegType.

Returns

boolean

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


isDiscontinuityLeg()

static isDiscontinuityLeg(legType): boolean

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:982

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

Parameters

ParameterTypeDescription
legTypeLegTypeThe LegType.

Returns

boolean

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

Deprecated

use FlightPlanUtils.isDiscontinuityLeg instead


isGpsApproach()

static isGpsApproach(approachType): boolean

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:205

Utility method to check whether an approach is authorized for GPS guidance.

Parameters

ParameterTypeDescription
approachTypeAPPROACH_TYPE_UNKNOWN | APPROACH_TYPE_GPS | APPROACH_TYPE_VOR | APPROACH_TYPE_NDB | APPROACH_TYPE_ILS | APPROACH_TYPE_LOCALIZER | APPROACH_TYPE_SDF | APPROACH_TYPE_LDA | APPROACH_TYPE_VORDME | APPROACH_TYPE_NDBDME | APPROACH_TYPE_RNAV | APPROACH_TYPE_LOCALIZER_BACK_COURSE | APPROACH_TYPE_VISUALThe approach type.

Returns

boolean

True if GPS guidance is authorized, false otherwise.


isHeadingToLeg()

static isHeadingToLeg(legType): boolean

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:943

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

Parameters

ParameterTypeDescription
legTypeLegTypeThe LegType.

Returns

boolean

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

Deprecated

use FlightPlanUtils.isHeadingToLeg instead


isHoldAtLeg()

static isHoldAtLeg(legType): boolean

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:953

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

Parameters

ParameterTypeDescription
legTypeLegTypeThe LegType.

Returns

boolean

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

Deprecated

use FlightPlanUtils.isHoldLeg instead


isLegHold()

static isLegHold(leg): boolean

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1279

Returns true if the leg is a hold leg

Parameters

ParameterTypeDescription
legFlightPlanLegthe leg in question

Returns

boolean

the result


isLegValidAirwayExit()

static isLegValidAirwayExit(airway, icao): IntersectionFacility | undefined

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1087

Checks for an airway exit at a given icao.

Parameters

ParameterTypeDescription
airwayAirwayDataThe Airway Object.
icaostringThe icao of the entry to check.

Returns

IntersectionFacility | undefined

The Intersection Facility if the leg is a valid exit to the airway.


isLegVectOrDisco()

static isLegVectOrDisco(leg): boolean

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1295

Returns true if a leg is a vector of discontinuity.

Parameters

ParameterTypeDescription
legFlightPlanLegThe FlightPlanLeg

Returns

boolean

Whether the leg is a vector of discontinuity


isLocalizerApproach()

static isLocalizerApproach(approachType): boolean

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:219

Utility method to check for an approach with a a tunable localizer.

Parameters

ParameterTypeDescription
approachTypeExtendedApproachTypeThe approach procedure type

Returns

boolean

True if a localizer needs to be tuned, otherwise false.


isVectorsLeg()

static isVectorsLeg(legType): boolean

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:992

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

Parameters

ParameterTypeDescription
legTypeLegTypeThe LegType.

Returns

boolean

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

Deprecated

use FlightPlanUtils.isManualDiscontinuityLeg instead


isVtfApproachLoaded()

static isVtfApproachLoaded(plan): boolean

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:281

Checks whether a plan has a vectors-to-final approach loaded.

Parameters

ParameterTypeDescription
planFlightPlanA flight plan.

Returns

boolean

Whether the flight plan has a vectors-to-final approach loaded.


matchIdentToAirway()

static matchIdentToAirway(airway, ident): IntersectionFacility | undefined

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1097

Checks for an airway exit matching an input ident

Parameters

ParameterTypeDescription
airwayAirwayDataThe AirwayObject.
identstringThe Ident to search for.

Returns

IntersectionFacility | undefined

The Intersection Facility if the leg is a valid exit to the airway.


parseAltitudeForDisplay()

static parseAltitudeForDisplay(altitudeMeters, transitionAltitudeFeet): string

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:866

Gets an altitude for display with padding, Flight Level Handling

Parameters

ParameterTypeDescription
altitudeMetersnumberthe altitude IN METERS to evaluate
transitionAltitudeFeetnumberthe transition altitude IN FEET to evaluate

Returns

string

A display string


parseConstraintInput()

static parseConstraintInput(value, verticalData): boolean | undefined

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:631

Copied from the CJ4 mod

Parameters

ParameterTypeDescription
valuestringThe scratchpad value.
verticalDataVerticalDataThe existing leg vertical data.

Returns

boolean | undefined

False if invalid entry.


parseDtkDistanceForDisplay()

static parseDtkDistanceForDisplay(leg, isToLeg, ppos, distance?): string

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:883

Gets a DTK and Distance string for the FMC Legs Page Display.

Parameters

ParameterTypeDescription
legLegDefinitionThe Leg Definition.
isToLegbooleanWhether the leg is the TO loeg or not.
pposGeoPointThe plane's present position.
distance?numberA manual distance to calculate with.

Returns

string

A Display string.


reconcileDirectToData()

static reconcileDirectToData(plan): void

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1173

Reconciles a flight plan's Direct-To data with its internal leg structure. Scans the legs of the flight plan for Direct-To legs and sets the segment index and segment leg index of the plan's Direct-To data to point to the leg immediately preceding the first Direct-To leg found, or to -1 for both if the plan contains no Direct-To legs.

Parameters

ParameterTypeDescription
planFlightPlanA flight plan.

Returns

void


removeAllDirectToData()

static removeAllDirectToData(plan): void

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1225

Removes all of a flight plan's Direct-To data, but from the DirectToData object and from any legs in the plan. Scans the legs of the flight plan for Direct-To legs and removes them.

Parameters

ParameterTypeDescription
planFlightPlanA flight plan.

Returns

void


removeDirectToExisting()

static removeDirectToExisting(plan, lateralLegIndex?, calculate?): void

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1199

Removes the direct to existing legs from the primary flight plan. If a direct to existing is currently active, this will effectively cancel it.

Parameters

ParameterTypeDefault valueDescription
planFlightPlanundefinedThe flight plan.
lateralLegIndex?numberundefinedThe index of the leg to set as the active lateral leg after the removal operation. Defaults
calculate?booleantrueWhether to calculate the flight plan to the index of the current active primary flight plan leg.

Returns

void


removeDisplacedActiveLegs()

static removeDisplacedActiveLegs(plan): void

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1246

Removes all of a flight plan's Displaced Active Legs, which are flagged when a procedure is added and the active leg array is moved to enroute.

Parameters

ParameterTypeDescription
planFlightPlanA flight plan.

Returns

void


removeFixTypeFlags()

static removeFixTypeFlags(legs): FlightPlanLeg[]

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1265

Removes fix type flags from legs being moved from an approach procedure to the enroute segment.

Parameters

ParameterTypeDescription
legsFlightPlanLeg[]The FlightPlanLegs to remove fix type flags from.

Returns

FlightPlanLeg[]

The array of FlightPlanLegs with the flags removed.


setFlightPlanAlternate()

static setFlightPlanAlternate(plan, alternate): void

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1566

Sets the alternate airport of a flight plan

Parameters

ParameterTypeDescription
planFlightPlanthe flight plan
alternateIcaoValue | undefinedthe ICAO of the alternate airport, or null

Returns

void


setFlightPlanProcedureIdents()

static setFlightPlanProcedureIdents(plan, idents): void

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1597

Sets the procedure identifiers of a flight plan

Parameters

ParameterTypeDescription
planFlightPlanthe flight plan
identsWTLineFlightPlanProcedureIdents | undefinedthe procedure idents

Returns

void

Throws

if an internal error occurs


shouldShowLegCourse()

static shouldShowLegCourse(legType): boolean

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1002

Checks if leg type is a course or heading leg, which should have the leg course shown instead of the initial dtk.

Parameters

ParameterTypeDescription
legTypeLegTypeThe LegType.

Returns

boolean

Whether the leg type is a course or heading leg.


wouldFacilityBeDuplicate()

static wouldFacilityBeDuplicate(plan, facClient, facility, segmentIndex?, legIndex?): Promise<boolean>

Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1612

Determines whether a given facility would create a duplicate waypoint if inserted at a given leg index

Parameters

ParameterTypeDescription
planFlightPlanthe flight plan to verify
facClientFacilityClienta facility client, used to load the previous leg's termination fix facility
facilityFacilitythe facility to be inserted
segmentIndex?numberthe segment index where the facility would be inserted as a waypoint - if undefined, leg is assumed to be appended to the end of the plan
legIndex?numberthe local leg index where the facility would be inserted as a waypoint - if undefined, leg is assumed to be appended to the end of the plan

Returns

Promise<boolean>

a boolean