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
readonlystaticDTO_LEG_OFFSET:3=3
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:49
getBestRnavType()
staticgetBestRnavType: (query) =>RnavTypeFlags=ApproachUtils.getBestRnavType
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:401
Utility method to return a single RnavTypeFlag from multiple possible flags.
Gets the best RNAV minimum type available for a given approach.
Parameters
| Parameter | Type | Description |
|---|---|---|
query | ApproachProcedure | RnavTypeFlags | The approach to check, or its RNAV type flags. |
Returns
The best RNAV minimum type available for the specified approach.
Param
The input RnavTypeFlags.
Returns
A single RnavTypeFlag
PRIMARY_ACT_PLAN_INDEX
readonlystaticPRIMARY_ACT_PLAN_INDEX:Active=WTLineLegacyFlightPlans.Active
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:41
Deprecated
use WTLineLegacyFlightPlans instead
PRIMARY_MOD_PLAN_INDEX
readonlystaticPRIMARY_MOD_PLAN_INDEX:Mod=WTLineLegacyFlightPlans.Mod
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:44
Deprecated
use WTLineLegacyFlightPlans instead
PROC_PREVIEW_PLAN_INDEX
readonlystaticPROC_PREVIEW_PLAN_INDEX:2=2
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:47
Deprecated
not used
USER_DATA_KEY_ALTN
readonlystaticUSER_DATA_KEY_ALTN:"wt21.altn"='wt21.altn'
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:51
USER_DATA_KEY_DESTINATION_AIRPORT_DEPARTURE
readonlystaticUSER_DATA_KEY_DESTINATION_AIRPORT_DEPARTURE:"wtline.destination-airport-departure"='wtline.destination-airport-departure'
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:57
USER_DATA_KEY_FIX_INFO
readonlystaticUSER_DATA_KEY_FIX_INFO:"wt21.fix-info"='wt21.fix-info'
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:53
USER_DATA_KEY_PROCEDURE_IDENTS
readonlystaticUSER_DATA_KEY_PROCEDURE_IDENTS:"wtline.procedure-idents"='wtline.procedure-idents'
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:55
Methods
approachHasNavFrequency()
staticapproachHasNavFrequency(approach):boolean
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:706
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
| Parameter | Type | Description |
|---|---|---|
approach | ApproachProcedure | The approach to check. |
Returns
boolean
Whether the specified approach has a primary NAV frequency based on its type.
areAirwaysEqual()
staticareAirwaysEqual(a,b):boolean
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1311
Compares two airways and determines if they are equal by checking that they share evry waypoint
Parameters
| Parameter | Type | Description |
|---|---|---|
a | AirwayData | the first ariway |
b | AirwayData | the second airway |
Returns
boolean
a boolean
buildRunwayLeg()
staticbuildRunwayLeg(airport,oneWayRunway,isOriginRunway):FlightPlanLeg
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:304
Utility method to return a one-way runway leg
Parameters
| Parameter | Type | Description |
|---|---|---|
airport | AirportFacility | The runway's parent airport. |
oneWayRunway | OneWayRunway | is the one wway runway object |
isOriginRunway | boolean | is a bool whether this is the origin or destination (origin = true, dest = false) |
Returns
a leg object for the runway
buildVisualApproach()
staticbuildVisualApproach(facRepo,airport,runway,finalLegDistance,name?,finalLegIdent?):ApproachProcedure
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:325
Utility method to return a visual approach for a runway.
Parameters
| Parameter | Type | Description |
|---|---|---|
facRepo | FacilityRepository | is a facility repository in which to store the created faf leg facility |
airport | AirportFacility | is the airport facility for the visual approach. |
runway | OneWayRunway | is the runway to build the visual approach for. |
finalLegDistance | number | is the distance from the runway to place the faf leg in NM. |
name? | string | is the optional name for the approach. |
finalLegIdent? | string | is the optional name for the faf leg. |
Returns
an approach procedure.
buildWT21LegName()
staticbuildWT21LegName(leg,flags):string
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1355
Builds leg names using default nomenclature.
Parameters
| Parameter | Type | Description |
|---|---|---|
leg | FlightPlanLeg | The leg to build a name for. |
flags | number | The flags that will be assigned to the flight plan leg. |
Returns
string
The name of the leg.
canDirectTo()
staticcanDirectTo(plan,segmentIndex,segmentLegIndex):boolean
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1945
Checks whether a leg in the primary flight plan is a valid direct to target.
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | the flight plan to use. |
segmentIndex | number | The index of the segment in which the leg resides. |
segmentLegIndex | number | The index of the leg in its segment. |
Returns
boolean
Whether the leg is a valid direct to target.
Throws
Error if a leg could not be found at the specified location.
canLegBeSelectedOnDirectPage()
staticcanLegBeSelectedOnDirectPage(leg):boolean
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1328
Checks whether a leg should appear on the Direct To Page based on leg type.
Parameters
| Parameter | Type | Description |
|---|---|---|
leg | FlightPlanLeg | The FlightPlanLeg to evaluate. |
Returns
boolean
whether or not the leg should appear on the Direct To page.
distanceBetweenDiscontinuedLegs()
staticdistanceBetweenDiscontinuedLegs(prevLeg,nextLeg):number
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1638
Returns the distance between the end of a leg before a discontinuity and the start of the leg after that discontinuity
Parameters
| Parameter | Type | Description |
|---|---|---|
prevLeg | LegDefinition | the leg before the discontinuity |
nextLeg | LegDefinition | the 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()
staticemptyFlightPlan(plan,notify):void
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:220
Empties a given flight plan
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
plan | FlightPlan | undefined | the plan to empty |
notify | boolean | true | whether to send out sync events |
Returns
void
estimateDistanceForSeconds()
staticestimateDistanceForSeconds(seconds,groundSpeed):number
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1582
Calculates distance flown for a number of seconds at a ground speed
Parameters
| Parameter | Type | Description |
|---|---|---|
seconds | number | time flown in number of seconds |
groundSpeed | number | GS to predict with |
Returns
number
distance in nautical miles
estimateSecondsForDistance()
staticestimateSecondsForDistance(distance,groundSpeed):number
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1570
Calculates time in seconds to fly a certain distance at a ground speed
Parameters
| Parameter | Type | Description |
|---|---|---|
distance | number | distance to fly |
groundSpeed | number | GS to predict with |
Returns
number
time in number of seconds
findIcaoInSegment()
staticfindIcaoInSegment(segment,icao):number|undefined
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:285
Checks whether a leg exists in a segment with the specified ICAO and, if so, returns the leg index of that leg.
Parameters
| Parameter | Type | Description |
|---|---|---|
segment | FlightPlanSegment | The segment to check for the icao. |
icao | string | undefined | The ICAO to check for in the segment. |
Returns
number | undefined
The segment leg index of the leg with the matching icao, or -1.
formatFacilityFrequencyType()
staticformatFacilityFrequencyType(frequency,noneString):string
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1661
Formats a facility frequency's type for display on the FMC
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
frequency | FacilityFrequency | undefined | the frequency |
noneString | string | 'UNKNOWN' | (optional) the string to return when the type is "None" |
Returns
string
a string
getActiveSegment()
staticgetActiveSegment(plan):FlightPlanSegment|undefined
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:76
Gets the active segment in the Lateral Flight Plan.
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | The Lateral Flight Plan. |
Returns
FlightPlanSegment | undefined
The Active Flight Plan Segment or undefined.
getActiveSegmentIndex()
staticgetActiveSegmentIndex(plan):number|undefined
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:64
Gets the active segment in the Lateral Flight Plan.
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | The Lateral Flight Plan. |
Returns
number | undefined
The Active Flight Plan Segment or undefined.
getAirwayFromFacility()
staticgetAirwayFromFacility(facLoader,icao,airwayIdent):Promise<AirwayData|undefined>
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1242
Returns an airway with a given ident crossing a facility with a given ICAO
Parameters
| Parameter | Type | Description |
|---|---|---|
facLoader | FacilityClient | The facility loader. |
icao | IcaoValue | The icao of the facility to check. |
airwayIdent | string | The ident of the airway to search for. |
Returns
Promise<AirwayData | undefined>
The airway object or undefined
getApproachFromPlan()
staticgetApproachFromPlan(plan,destination):ApproachProcedure|undefined
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:440
Gets an approach procedure from a flight plan.
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | A flight plan. |
destination | AirportFacility | The 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()
staticgetApproachNameAsParts(proc,transitionIndex,includeTransition):ApproachNameParts
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:629
Utility method to analyze an approach for its name components and pack them into a custom type.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
proc | ApproachProcedure | undefined | The approach procedure. |
transitionIndex | number | undefined | The transition index. |
includeTransition | boolean | true | Whether to include the transition identifier. |
Returns
The name as an ApproachNameParts
getApproachNameAsString()
staticgetApproachNameAsString(facility,procedureIndex,transitionIndex,includeTransition,padSuffix):string
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:687
Utility method that gets an approach and returns its name as a flat string suitable for use in embedded text content.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
facility | AirportFacility | undefined | The Facility. |
procedureIndex | number | undefined | The approach index. |
transitionIndex | number | undefined | The index of the approach transition. |
includeTransition | boolean | true | Whether to include the transition identifier. |
padSuffix | boolean | false | Whether to include space for the suffix even where there isn't one. |
Returns
string
The formatted name as a string.
getApproachVtfLeg()
staticgetApproachVtfLeg(plan):LegDefinition|undefined
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:493
Gets the vectors-to-final leg of a flight plan.
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | A flight plan. |
Returns
LegDefinition | undefined
The vectors-to-final leg of the flight plan, or undefined if one could not be found.
getArrivalNameAsString()
staticgetArrivalNameAsString(facility,procedureIndex,transitionIndex):string
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:597
Gets the name of a arrival procedure as a string.
Parameters
| Parameter | Type | Description |
|---|---|---|
facility | AirportFacility | The airport to which the arrival belongs. |
procedureIndex | number | An arrival procedure index. |
transitionIndex | number | The index of the arrival enroute transition. |
Returns
string
The name of the arrival procedure.
getConstraintDisplayForDirectPage()
staticgetConstraintDisplayForDirectPage(verticalData,transitionAltitude):string
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1041
Method to get the FMS constraint display data from a verticalData object
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
verticalData | VerticalData | undefined | is the Vertical Data object for the leg |
transitionAltitude | number | 18000 | is the transition altitude that applies to the constraint |
Returns
string
A string to display on the FMC
getConstraintDisplayForLegs()
staticgetConstraintDisplayForLegs(performancePlanData,verticalData,transitionAltitude,constraintInvalid?,isRunway?):string
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:962
Method to get the FMS constraint display data from a verticalData object.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
performancePlanData | PerformancePlanData | undefined | performance plan data |
verticalData | VerticalData | undefined | The Vertical Data object for the leg. |
transitionAltitude | number | 18000 | The transition altitude that applies to the constraint. |
constraintInvalid? | boolean | undefined | If the constraint is invalid. |
isRunway? | boolean | undefined | If the constraint is a runway. |
Returns
string
A string to display on the FMC.
getDepartureNameAsString()
staticgetDepartureNameAsString(facility,procedureIndex):string
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:568
Gets the name of a departure procedure as a string.
Parameters
| Parameter | Type | Description |
|---|---|---|
facility | AirportFacility | The Facility. |
procedureIndex | number | The procedure index. |
Returns
string
The name of the departure procedure.
getDirectToCourse()
staticgetDirectToCourse(leg):number
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1215
Gets the direct to magnetic course from the leg vectors.
Parameters
| Parameter | Type | Description |
|---|---|---|
leg | LegDefinition | The Leg Definition |
Returns
number
the magnetic course.
getDistanceFromPposToLegEnd()
staticgetDistanceFromPposToLegEnd(lateralPlan,globalLegIndex,legDistanceRemaining):number|undefined
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1705
Returns the distance from PPOS to the end of a leg, given a lateral plan and a global leg index
Parameters
| Parameter | Type | Description |
|---|---|---|
lateralPlan | FlightPlan | the lateral plan |
globalLegIndex | number | the global leg index |
legDistanceRemaining | number | The remaining distance to the end of the leg currently tracked by LNAV, in nautical miles. |
Returns
number | undefined
the distance, in metres
getDistanceToDestination()
staticgetDistanceToDestination(plan,facClient,legDistanceRemaining):Promise<number|null>
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1732
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
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | the flight plan |
facClient | FacilityClient | a facility client |
legDistanceRemaining | number | the distance remaining on the active leg |
Returns
Promise<number | null>
the distance in metres, or null if it cannot be computed
getFirstDepartureSegmentIndex()
staticgetFirstDepartureSegmentIndex(plan,origin):number
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:88
Gets the index of the first departure segment in a flight plan.
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | the flight plan |
origin | boolean | whether to search for origin departure segments (true) or destination departure segments (false) |
Returns
number
the index of the first departure segment, or -1 if none is found
getFirstSegmentOfType()
staticgetFirstSegmentOfType(plan,type):number
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:169
Gets the index of the first segment of a specified type in a flight plan.
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | the flight plan |
type | FlightPlanSegmentType | the segment type |
Returns
number
the index of the first segment of the specified type, or -1 if none is found
getFlightPlanAlternate()
staticgetFlightPlanAlternate(plan):IcaoValue|undefined
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1778
Gets the alternate airport ICAO of a flight plan
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | thw flight plan |
Returns
IcaoValue | undefined
the alternate airport ICAO, or undefined
getFlightPlanArrivalData()
staticgetFlightPlanArrivalData(plan):WTLineFlightPlanArrivalData
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:2000
Gets the arrival procedure data of a flight plan
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | the flight plan |
Returns
WTLineFlightPlanArrivalData
the arrival procedure data. The returned data object passed is only guaranteed to be valid at the moment it is returned. If you need to retain the data past this moment, then it is recommended that a copy of the data be made.
getFlightPlanDepartureData()
staticgetFlightPlanDepartureData(plan,forOrigin):WTLineFlightPlanDepartureData
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1973
Gets the departure procedure data of a flight plan for either the origin or destination airport
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | the flight plan |
forOrigin | boolean | whether to get the data for the origin airport (true) or destination airport (false) |
Returns
WTLineFlightPlanDepartureData
the departure procedure data. The returned data object passed is only guaranteed to be valid at the moment it is returned. If you need to retain the data past this moment, then it is recommended that a copy of the data be made.
getFlightPlanDestinationAirportDepartureProcedure()
staticgetFlightPlanDestinationAirportDepartureProcedure(plan):WTLineFlightPlanDepartureData
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1829
Gets the destination airport departure procedure data of a flight plan
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | the flight plan |
Returns
WTLineFlightPlanDepartureData
the departure procedure data, or undefined
Throws
if an internal error occurs
getFlightPlanProcedureIdents()
staticgetFlightPlanProcedureIdents(plan):WTLineFlightPlanProcedureIdents
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1803
Gets the procedure identifiers of a flight plan
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | the flight plan |
Returns
WTLineFlightPlanProcedureIdents
the procedure idents
Throws
if an internal error occurs
getFpaDisplayForLegs()
staticgetFpaDisplayForLegs(vnavLeg,vnavConstraint?,phase?):string
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:937
Method to get the FMS FPA display data for a leg from a VNavConstraint and VNavLeg.
Parameters
| Parameter | Type | Description |
|---|---|---|
vnavLeg | VNavLeg | The VNav Leg from the vertical flight plan that cooresponds to this leg index. |
vnavConstraint? | VNavConstraint | The VNav Constraint from the Vertical Flight Plan that cooresponds to this leg index. |
phase? | VerticalFlightPhase | The vertical flight phase of this leg. |
Returns
string
A string to display on the FMC.
getLastDepartureSegmentIndex()
staticgetLastDepartureSegmentIndex(plan,origin):number
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:128
Gets the index of the last departure segment in a flight plan.
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | the flight plan |
origin | boolean | whether to search for origin departure segments (true) or destination departure segments (false) |
Returns
number
the index of the last departure segment, or -1 if none is found
getLastFixCoordinates()
staticgetLastFixCoordinates(plan,facClient,segmentIndex?,legIndex?,out?):Promise<GeoPointInterface>
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1898
Returns the coordinates of the last database fix that is the termination of a leg in the flight plan
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | the flight plan to query |
facClient | FacilityClient | a facility client instance, used to get the coordinates of leg termination facilities |
segmentIndex? | number | the segment index of the leg to start searching backwards from. If undefined, will search from the last leg |
legIndex? | number | the local leg index of the leg to start searching backwards from. If undefined, will search from the last leg |
out? | GeoPoint | the GeoPoint to write the results to. Defaults to a new GeoPoint. |
Returns
Promise<GeoPointInterface>
Throws
if segmentIndex and legIndex are not both undefined or specified
getLastNonMissedApproachLeg()
staticgetLastNonMissedApproachLeg(plan):number
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1595
Returns the index of the last non-missed approach leg in the flight plan
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | the plan to use for lookup |
Returns
number
array of index and ident, or undefined if no approach segment
Deprecated
use getMissedApproachPointIndex instead
getLastSegmentOfType()
staticgetLastSegmentOfType(plan,type):number
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:186
Gets the index of the last segment of a specified type in a flight plan.
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | the flight plan |
type | FlightPlanSegmentType | the segment type |
Returns
number
the index of the last segment of the specified type, or -1 if none is found
getMissedApproachPointIndex()
staticgetMissedApproachPointIndex(plan):number
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1614
Returns the index of the last leg in the flight plan that is marked as a missed approach point
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | the flight plan |
Returns
number
the index of the leg, or -1 if none exists
getNextLegWithDefinedTermination()
staticgetNextLegWithDefinedTermination(plan,fromIndex):number
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:809
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
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | the flight plan |
fromIndex | number | undefined | the 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
getNextNonEmptySegmentIndex()
staticgetNextNonEmptySegmentIndex(plan,fromIndex):number
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:203
Gets the index of the next non-empty segment (that is not a Destination segment) in a flight plan after a specified index.
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | the flight plan |
fromIndex | number | the index from which to start searching for the next non-empty segment |
Returns
number
the index of the next non-empty segment, or -1 if none is found
getNominalFromLeg()
staticgetNominalFromLeg(plan,segmentIndex,segmentLegIndex):LegDefinition|undefined
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:729
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
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | A flight plan. |
segmentIndex | number | The index of the segment containing the leg for which to get the from leg. |
segmentLegIndex | number | The 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()
staticgetNominalFromLegIndex(plan,segmentIndex,segmentLegIndex):number
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:753
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
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | A flight plan. |
segmentIndex | number | The index of the segment containing the leg for which to get the from leg. |
segmentLegIndex | number | The 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()
staticgetPlanHolds(plan,inMissed):LegDefinition[]
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1540
Returns hold legs in the flight plan. Used to determine and show appropriate HOLD pages.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
plan | FlightPlan | undefined | the flight plan in question |
inMissed | boolean | false | whether to only include missed approach holds |
Returns
the result
getPreviousLegWithDefinedTermination()
staticgetPreviousLegWithDefinedTermination(plan,fromIndex):number
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:779
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
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | the flight plan |
fromIndex | number | undefined | the 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()
staticgetProcedureIndexAndTransitionIndexFromSegmentType(segmentType,lateralPlan):number[]
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:512
Gets the procedure index and transition index from procedure details of the lateral plan based on segment type.
Parameters
| Parameter | Type | Description |
|---|---|---|
segmentType | FlightPlanSegmentType | The segment type. |
lateralPlan | FlightPlan | The lateral flight plan. |
Returns
number[]
an array of procedureIndex, transitionIndex.
getProcedureNameAsString()
staticgetProcedureNameAsString(segmentType,facility,procedureIndex,transitionIndex?):string
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:533
Combiner method to get a procedure name as a string for the FPLN Page.
Parameters
| Parameter | Type | Description |
|---|---|---|
segmentType | FlightPlanSegmentType | The segment type. |
facility | AirportFacility | undefined | The facility. |
procedureIndex | number | The procedure index. |
transitionIndex? | number | The transition index. |
Returns
string
the name as a string.
Deprecated
use getFlightPlanProcedureIdents instead
initFlightPlanMandatoryUserData()
staticinitFlightPlanMandatoryUserData(plan):void
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:251
Initializes mandatory user data for a flight plan.
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | The flight plan to initialize. |
Returns
void
isAirwayAtLeg()
staticisAirwayAtLeg(facLoader,icao,airwayName):Promise<AirwayData|undefined>
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1273
Checks for an airway at a leg and returns the airway or undefined
Parameters
| Parameter | Type | Description |
|---|---|---|
facLoader | FacilityLoader | The facility loader. |
icao | string | The icao of the entry to check. |
airwayName | string | The airway to search for. |
Returns
Promise<AirwayData | undefined>
The airway object or undefined
Deprecated
use getAirwayFromFacility instead
isAltitudeLeg()
staticisAltitudeLeg(legType):boolean
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1167
Checks if leg type is an "to altitude" leg type.
Parameters
| Parameter | Type | Description |
|---|---|---|
legType | LegType | The LegType. |
Returns
boolean
Whether the leg type is a "to altitude" leg type.
Deprecated
use FlightPlanUtils.isAltitudeLeg instead
isApproachLoaded()
staticisApproachLoaded(plan):boolean
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:475
Checks whether a flight plan has an approach loaded.
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | A flight plan. |
Returns
boolean
Whether the flight plan has an approach loaded.
isCourseToLeg()
staticisCourseToLeg(legType):boolean
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1176
Checks if leg type is a "course to" leg type.
Parameters
| Parameter | Type | Description |
|---|---|---|
legType | LegType | The LegType. |
Returns
boolean
Whether the leg type is a "course to" leg type.
isDiscontinuityLeg()
staticisDiscontinuityLeg(legType):boolean
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1186
Checks if leg type is a "discontinuity" leg type.
Parameters
| Parameter | Type | Description |
|---|---|---|
legType | LegType | The LegType. |
Returns
boolean
Whether the leg type is a "discontinuity" leg type.
Deprecated
use FlightPlanUtils.isDiscontinuityLeg instead
isGpsApproach()
staticisGpsApproach(approachType):boolean
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:408
Utility method to check whether an approach is authorized for GPS guidance.
Parameters
| Parameter | Type | Description |
|---|---|---|
approachType | APPROACH_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_VISUAL | The approach type. |
Returns
boolean
True if GPS guidance is authorized, false otherwise.
isHeadingToLeg()
staticisHeadingToLeg(legType):boolean
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1147
Checks if leg type is a "heading to" leg type.
Parameters
| Parameter | Type | Description |
|---|---|---|
legType | LegType | The LegType. |
Returns
boolean
Whether the leg type is a "heading to" leg type.
Deprecated
use FlightPlanUtils.isHeadingToLeg instead
isHoldAtLeg()
staticisHoldAtLeg(legType):boolean
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1157
Checks if leg type is a "hold at" leg type.
Parameters
| Parameter | Type | Description |
|---|---|---|
legType | LegType | The LegType. |
Returns
boolean
Whether the leg type is a "hold at" leg type.
Deprecated
use FlightPlanUtils.isHoldLeg instead
isLegHold()
staticisLegHold(leg):boolean
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1504
Returns true if the leg is a hold leg
Parameters
| Parameter | Type | Description |
|---|---|---|
leg | FlightPlanLeg | the leg in question |
Returns
boolean
the result
isLegValidAirwayExit()
staticisLegValidAirwayExit(airway,icao):IntersectionFacility|undefined
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1291
Checks for an airway exit at a given icao.
Parameters
| Parameter | Type | Description |
|---|---|---|
airway | AirwayData | The Airway Object. |
icao | string | The icao of the entry to check. |
Returns
IntersectionFacility | undefined
The Intersection Facility if the leg is a valid exit to the airway.
isLegVectOrDisco()
staticisLegVectOrDisco(leg):boolean
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1520
Returns true if a leg is a vector of discontinuity.
Parameters
| Parameter | Type | Description |
|---|---|---|
leg | FlightPlanLeg | The FlightPlanLeg |
Returns
boolean
Whether the leg is a vector of discontinuity
isLocalizerApproach()
staticisLocalizerApproach(approachType):boolean
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:422
Utility method to check for an approach with a a tunable localizer.
Parameters
| Parameter | Type | Description |
|---|---|---|
approachType | ExtendedApproachType | The approach procedure type |
Returns
boolean
True if a localizer needs to be tuned, otherwise false.
isVectorsLeg()
staticisVectorsLeg(legType):boolean
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1196
Checks if leg type is a "vectors" leg type.
Parameters
| Parameter | Type | Description |
|---|---|---|
legType | LegType | The LegType. |
Returns
boolean
Whether the leg type is a "vectors" leg type.
Deprecated
use FlightPlanUtils.isManualDiscontinuityLeg instead
isVtfApproachLoaded()
staticisVtfApproachLoaded(plan):boolean
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:484
Checks whether a plan has a vectors-to-final approach loaded.
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | A flight plan. |
Returns
boolean
Whether the flight plan has a vectors-to-final approach loaded.
matchIdentToAirway()
staticmatchIdentToAirway(airway,ident):IntersectionFacility|undefined
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1301
Checks for an airway exit matching an input ident
Parameters
| Parameter | Type | Description |
|---|---|---|
airway | AirwayData | The AirwayObject. |
ident | string | The Ident to search for. |
Returns
IntersectionFacility | undefined
The Intersection Facility if the leg is a valid exit to the airway.
parseAltitudeForDisplay()
staticparseAltitudeForDisplay(altitudeMeters,transitionAltitudeFeet):string
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1070
Gets an altitude for display with padding, Flight Level Handling
Parameters
| Parameter | Type | Description |
|---|---|---|
altitudeMeters | number | the altitude IN METERS to evaluate |
transitionAltitudeFeet | number | the transition altitude IN FEET to evaluate |
Returns
string
A display string
parseConstraintInput()
staticparseConstraintInput(value,verticalData):boolean|undefined
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:835
Copied from the CJ4 mod
Parameters
| Parameter | Type | Description |
|---|---|---|
value | string | The scratchpad value. |
verticalData | VerticalData | The existing leg vertical data. |
Returns
boolean | undefined
False if invalid entry.
parseDtkDistanceForDisplay()
staticparseDtkDistanceForDisplay(leg,isToLeg,ppos,distance?):string
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1087
Gets a DTK and Distance string for the FMC Legs Page Display.
Parameters
| Parameter | Type | Description |
|---|---|---|
leg | LegDefinition | The Leg Definition. |
isToLeg | boolean | Whether the leg is the TO loeg or not. |
ppos | GeoPoint | The plane's present position. |
distance? | number | A manual distance to calculate with. |
Returns
string
A Display string.
reconcileDirectToData()
staticreconcileDirectToData(plan):void
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1398
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
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | A flight plan. |
Returns
void
removeAllDirectToData()
staticremoveAllDirectToData(plan):void
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1450
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
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | A flight plan. |
Returns
void
removeDirectToExisting()
staticremoveDirectToExisting(plan,lateralLegIndex?,calculate?):void
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1424
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
| Parameter | Type | Default value | Description |
|---|---|---|---|
plan | FlightPlan | undefined | The flight plan. |
lateralLegIndex? | number | undefined | The index of the leg to set as the active lateral leg after the removal operation. Defaults |
calculate? | boolean | true | Whether to calculate the flight plan to the index of the current active primary flight plan leg. |
Returns
void
removeDisplacedActiveLegs()
staticremoveDisplacedActiveLegs(plan):void
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1471
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
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | A flight plan. |
Returns
void
removeFixTypeFlags()
staticremoveFixTypeFlags(legs):FlightPlanLeg[]
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1490
Removes fix type flags from legs being moved from an approach procedure to the enroute segment.
Parameters
| Parameter | Type | Description |
|---|---|---|
legs | FlightPlanLeg[] | The FlightPlanLegs to remove fix type flags from. |
Returns
The array of FlightPlanLegs with the flags removed.
setFlightPlanAlternate()
staticsetFlightPlanAlternate(plan,alternate):void
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1793
Sets the alternate airport of a flight plan
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | the flight plan |
alternate | IcaoValue | undefined | the ICAO of the alternate airport, or null |
Returns
void
setFlightPlanDestinationAirportDepartureProcedure()
staticsetFlightPlanDestinationAirportDepartureProcedure(plan,departureProcedure):void
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1844
Sets the destination airport departure procedure data of a flight plan
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | the flight plan |
departureProcedure | WTLineFlightPlanDepartureData | undefined | the departure procedure data |
Returns
void
setFlightPlanProcedureIdents()
staticsetFlightPlanProcedureIdents(plan,idents):void
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1819
Sets the procedure identifiers of a flight plan
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | the flight plan |
idents | WTLineFlightPlanProcedureIdents | undefined | the procedure idents |
Returns
void
shouldShowLegCourse()
staticshouldShowLegCourse(legType):boolean
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1206
Checks if leg type is a course or heading leg, which should have the leg course shown instead of the initial dtk.
Parameters
| Parameter | Type | Description |
|---|---|---|
legType | LegType | The LegType. |
Returns
boolean
Whether the leg type is a course or heading leg.
wouldFacilityBeDuplicate()
staticwouldFacilityBeDuplicate(plan,facClient,facility,segmentIndex?,legIndex?):Promise<boolean>
Defined in: wtlinesdk/fms/WTLineFmsUtils.ts:1859
Determines whether a given facility would create a duplicate waypoint if inserted at a given leg index
Parameters
| Parameter | Type | Description |
|---|---|---|
plan | FlightPlan | the flight plan to verify |
facClient | FacilityClient | a facility client, used to load the previous leg's termination fix facility |
facility | Facility | the facility to be inserted |
segmentIndex? | number | the 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? | number | the 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