Skip to main content

Class: Epic2FmsUtils

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:16

Utility Methods for the Epic 2 FMS.

Constructors

Constructor

new Epic2FmsUtils(): Epic2FmsUtils

Returns

Epic2FmsUtils

Properties

DTO_LEG_OFFSET

readonly static DTO_LEG_OFFSET: 3 = 3

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:46


getBestRnavType()

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

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:256

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


isApproachRnpAr()

static isApproachRnpAr: (approach) => boolean = ApproachUtils.isRnpAr

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1809

Checks whether an approach procedure is an RNP (AR) approach.

Checks whether an approach procedure is an RNP (AR) approach.

Parameters

ParameterTypeDescription
approachApproachProcedureThe approach procedure to check.

Returns

boolean

Whether the approach procedure is an RNP (AR) approach.

Param

The approach procedure to check.

Returns

Whether the approach procedure is an RNP (AR) approach.

Methods

addLegTComp()

static addLegTComp(fms, leg, destOatC, destElev): void

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1899

Applies temperature compensation to the altitude constraints in the vertical data of the provided leg

Parameters

ParameterTypeDescription
fmsEpic2FmsThe FMS
legLegDefinitionThe leg to be temperature compensated
destOatCnumberThe destination Outside Air Temperature in degrees Celcius
destElevnumberThe destination elevation in feet

Returns

void


approachHasNavFrequency()

static approachHasNavFrequency(approach): boolean

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:669

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.


buildEpic2LegName()

static buildEpic2LegName(leg): string

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1223

Builds leg names using default nomenclature.

Parameters

ParameterTypeDescription
legFlightPlanLegThe leg to build a name for.

Returns

string

The name of the leg.


buildRunwayLeg()

static buildRunwayLeg(airport, oneWayRunway, isOriginRunway): FlightPlanLeg

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:130

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, finalLegVpa): ApproachProcedure

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:185

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.
finalLegVpaundefined | numberis the vertical path angle selected for the final approach, or undefined if not applicable.

Returns

ApproachProcedure

an approach procedure.


calculateTComp()

static calculateTComp(altitude, destOatC, destElev): number

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1885

Calculates a temperature compensated altitude restriction Equation source: https://code7700.com/altimetry_temperature_correction.htm

Parameters

ParameterTypeDescription
altitudenumberAn altitude restriction in feet
destOatCnumberDestination outside air temperature in Celcius
destElevnumberDestination elevation in feet

Returns

number

A temperature compensated altitude (in feet) to fly on a non-temperature-compensated altimeter (not the actual temparture-compensated altitude of the aircraft)


canDirectTo()

static canDirectTo(lateralPlan, segmentIndex, segmentLegIndex): boolean

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1565

Checks whether a leg in the primary flight plan is a valid direct to target.

Parameters

ParameterTypeDescription
lateralPlanFlightPlanThe lateral flight plan.
segmentIndexnumberThe index of the segment in which the leg resides.
segmentLegIndexnumberThe 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.


canLegBeAutoUnsuspended()

static canLegBeAutoUnsuspended(legType): boolean

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:163

Checks whether a leg with a given type being active should cause LNAV to be auto unsuspended

Parameters

ParameterTypeDescription
legTypeLegTypethe leg type

Returns

boolean

a boolean


canLegBeSelectedOnDirectPage()

static canLegBeSelectedOnDirectPage(leg): boolean

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1197

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: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1472

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


doesApproachSupportGp()

static doesApproachSupportGp(approachDetails): boolean

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:384

Checks whether the approach details indicate that vertical guidance (GP) can be supported.

Parameters

ParameterTypeDescription
approachDetailsApproachDetailsThe current approach details

Returns

boolean

whether or not vertical guidance is supported.


estimateDistanceForSeconds()

static estimateDistanceForSeconds(seconds, groundSpeed): number

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1420

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: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1408

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): undefined | number

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:66

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.
icaoundefined | stringThe ICAO to check for in the segment.

Returns

undefined | number

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


formatFacilityFrequencyType()

static formatFacilityFrequencyType(frequency, noneString): string

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1495

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): undefined | FlightPlanSegment

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:53

Gets the active segment in the Lateral Flight Plan.

Parameters

ParameterTypeDescription
planFlightPlanThe Lateral Flight Plan.

Returns

undefined | FlightPlanSegment

The Active Flight Plan Segment or undefined.


getApproachFromPlan()

static getApproachFromPlan(plan, destination): undefined | ApproachProcedure

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:295

Gets an approach procedure from a flight plan.

Parameters

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

Returns

undefined | ApproachProcedure

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


getApproachListItems()

static getApproachListItems(airport?, includeVisual?): ApproachListItem[]

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1770

Gets an array of approaches from an airport.

Parameters

ParameterTypeDefault valueDescription
airport?AirportFacilityundefinedAn airport.
includeVisual?booleantrueWhether to include visual approaches. Defaults to true.

Returns

ApproachListItem[]

An array of approaches.


getApproachNameAsEfisString()

Get the name of an approach in the format used on the EFIS

Param

Either an airport facility (if combined with a procedure as the second arg) or an approach procedure

Param

Index of the desired approach if the first arg is an airport facility

Call Signature

static getApproachNameAsEfisString(facility, procedureIndex): string

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:616

Get the name of an approach in the format used on the EFIS

Parameters
ParameterTypeDescription
facilityAirportFacilityAn airport facility
procedureIndexnumberIndex of the desired approach
Returns

string

formatted approach name ready for EFIS display

Call Signature

static getApproachNameAsEfisString(approach): string

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:622

Get the name of an approach in the format used on the EFIS

Parameters
ParameterTypeDescription
approachApproachProcedureThe desired approach procedure
Returns

string

formatted approach name ready for EFIS display


getApproachNameAsParts()

static getApproachNameAsParts(proc, transitionIndex): ApproachNameParts

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:531

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

Parameters

ParameterTypeDescription
procApproachProcedureThe approach procedure.
transitionIndexnumberThe transition index.

Returns

ApproachNameParts

The name as an ApproachNameParts


getApproachNameAsString()

static getApproachNameAsString(facility, procedureIndex, transitionIndex): string

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:598

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

Parameters

ParameterTypeDescription
facilityAirportFacilityThe Facility.
procedureIndexnumberThe approach index.
transitionIndexnumberThe index of the approach transition.

Returns

string

The formatted name as a string.


getApproachNameForList()

static getApproachNameForList(facilityOrApproach, procedureIndex?): string

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:649

Get the name of an approach in the format used in a list

Parameters

ParameterTypeDescription
facilityOrApproachAirportFacility | ApproachProcedureEither an airport facility (if combined with a procedure as the second arg) or an approach procedure
procedureIndex?numberIndex of the desired approach if the first arg is an airport facility

Returns

string

formatted approach name ready for a list display


getApproachSegment()

static getApproachSegment(plan): undefined | FlightPlanSegment

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:401

Gets the approach segment from a flight plan.

Parameters

ParameterTypeDescription
planFlightPlanA flight plan.

Returns

undefined | FlightPlanSegment

The approach segment in the specified flight plan, or undefined if one does not exist.


getApproachTransitionListItems()

static getApproachTransitionListItems(approachItem?): TransitionListItem[]

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1713

Gets the transitions for the approach, adding suffixes, vectors transtion, and default approach if needed.

Parameters

ParameterTypeDescription
approachItem?ApproachListItemThe approach procedure to get the transitions for.

Returns

TransitionListItem[]

The transitions for the approach.


getApproachTransitionName()

static getApproachTransitionName(approach, transitionIndex): string

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1745

Creates an TransitionListItem from an ApproachProcedure and the transition index.

Parameters

ParameterTypeDescription
approachApproachProcedureThe approach procedure.
transitionIndexnumberThe approach transition index.

Returns

string

The created TransitionListItem.


getApproachVtfLeg()

static getApproachVtfLeg(plan): undefined | LegDefinition

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:348

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

Parameters

ParameterTypeDescription
planFlightPlanA flight plan.

Returns

undefined | LegDefinition

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: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:500

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.


getBaseFacility()

static getBaseFacility(facility): Facility

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:146

Get a basic facility with only the properties of Facility from any facility.

Parameters

ParameterTypeDescription
facilityFacilityThe facility.

Returns

Facility

A facility instance with only the basic subset of properties.


getConstraintDisplayForDirectPage()

static getConstraintDisplayForDirectPage(verticalData, transitionAltitude): string

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:944

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(performancePlan, verticalData, transitionAltitude, constraintInvalid?, isRunway?): string

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:865

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

Parameters

ParameterTypeDefault valueDescription
performancePlanEpic2PerformancePlanundefinedperformance 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: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:471

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: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1133

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): undefined | number

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1539

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

undefined | number

the distance, in metres


getFpaDisplayForLegs()

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

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:840

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.


getFromLegForArrowDisplay()

Call Signature

static getFromLegForArrowDisplay(plan, globalLegIndex): undefined | LegDefinition

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1635

Gets the leg from which a specified flight plan leg originates for the purpose of displaying the flight plan from-to arrow.

Parameters
ParameterTypeDescription
planFlightPlanA flight plan.
globalLegIndexnumberThe global index of the leg for which to get the from leg.
Returns

undefined | LegDefinition

The leg from which the specified flight plan leg originates for the purpose of displaying the from -to arrow.

Call Signature

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

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1645

Gets the leg from which a specified flight plan leg originates for the purpose of displaying the flight plan from-to arrow.

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

undefined | LegDefinition

The leg from which the specified flight plan leg originates for the purpose of displaying the from -to arrow.


getGlobalLegIndex()

static getGlobalLegIndex(lateralPlan, segmentIndex, segmentLegIndex): number

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1619

Gets the global leg index from a segment and segment leg index, whether or not the leg exists.

Parameters

ParameterTypeDescription
lateralPlanFlightPlanThe Lateral Flight Plan.
segmentIndexnumberThe Segment Index.
segmentLegIndexnumberThe Segment Leg Index.

Returns

number

The global leg index.


getHighestRnavMinimaFromRnavType()

static getHighestRnavMinimaFromRnavType(type): RnavMinima

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:367

Gets the highest RNAV minima that can be selected from an RNAV Type

Parameters

ParameterTypeDescription
typeRnavTypeFlagsThe Rnav Type Flags for the approach

Returns

RnavMinima

The highest RNAV minima for the approach


getLastNonMissedApproachLeg()

static getLastNonMissedApproachLeg(plan): number

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1431

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


getLegIndexes()

static getLegIndexes(lateralPlan, leg): undefined | LegIndexes

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1596

Gets the indexes for a leg.

Parameters

ParameterTypeDescription
lateralPlanFlightPlanThe Lateral Flight Plan.
legLegDefinitionThe leg definition.

Returns

undefined | LegIndexes

The leg indexes, or undefined if not found.


getMissedApproachPointIndex()

static getMissedApproachPointIndex(plan): number

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1450

Returns the index of the MAP point in a flight plan, or -1 if none is present

Parameters

ParameterTypeDescription
planFlightPlanflight plan

Returns

number

a number


getNominalFromLeg()

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

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:692

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

undefined | LegDefinition

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


getNominalFromLegIndex()

static getNominalFromLegIndex(plan, segmentIndex, segmentLegIndex): number

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:716

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: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1378

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


getProcedureIndexAndTransitionIndexFromSegmentType()

static getProcedureIndexAndTransitionIndexFromSegmentType(segmentType, lateralPlan): number[]

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:416

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: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:436

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

Parameters

ParameterTypeDescription
segmentTypeFlightPlanSegmentTypeThe segment type.
facilityundefined | AirportFacilityThe facility.
procedureIndexnumberThe procedure index.
transitionIndex?numberThe transition index.

Returns

string

the name as a string.


getPublishedSpeedDescBasedOnSegment()

static getPublishedSpeedDescBasedOnSegment(publishedSpeedRestriction, segmentType): SpeedRestrictionType

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1700

Returns the speed restriction type to use based on the published speed and what segment it's in.

Parameters

ParameterTypeDescription
publishedSpeedRestrictionnumberThe published speed.
segmentTypeFlightPlanSegmentTypeThe segment type.

Returns

SpeedRestrictionType

The speed restriction type to use.


getVisualApproaches()

static getVisualApproaches(facility): ApproachProcedure[]

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1816

Gets the visual approaches for the facility.

Parameters

ParameterTypeDescription
facilityAirportFacilityis the facility.

Returns

ApproachProcedure[]

The Approach Procedures.


isAirwayAtLeg()

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

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1160

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<undefined | AirwayData>

The airway object or undefined


isAltitudeLeg()

static isAltitudeLeg(legType): boolean

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1067

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.


isApproachLoaded()

static isApproachLoaded(plan): boolean

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:330

Checks whether a flight plan has an approach loaded.

Parameters

ParameterTypeDescription
planFlightPlanA flight plan.

Returns

boolean

Whether the flight plan has an approach loaded.


isArcLeg()

static isArcLeg(legType): boolean

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1104

Checks if leg type is an "arc" leg type.

Parameters

ParameterTypeDescription
legTypeLegTypeThe LegType.

Returns

boolean

Whether the leg type is an "arc" leg type.


isCourseToLeg()

static isCourseToLeg(legType): boolean

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1076

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: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1085

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

Parameters

ParameterTypeDescription
legTypeLegTypeThe LegType.

Returns

boolean

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


isFirstLegInSegment()

static isFirstLegInSegment(plan, segmentIndex, segmentLegIndex): boolean

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:85

Checks if the specified leg is the first leg in the segment (accounting for discontinuities)

Parameters

ParameterTypeDescription
planFlightPlanflight plan
segmentIndexnumberthe segment index
segmentLegIndexnumberthe segment leg index

Returns

boolean

if the specified leg is the first leg in the segment


isGpsApproach()

static isGpsApproach(approachType): boolean

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:263

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: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1049

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.


isHoldAtLeg()

static isHoldAtLeg(legType): boolean

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1058

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.


isLastLegInSegment()

static isLastLegInSegment(plan, segmentIndex, segmentLegIndex): boolean

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:108

Checks if the specified leg is the last leg in the segment (accounting for discontinuities)

Parameters

ParameterTypeDescription
planFlightPlanflight plan
segmentIndexnumberthe segment index
segmentLegIndexnumberthe segment leg index

Returns

boolean

if the specified leg is the last leg in the segment


isLegHold()

static isLegHold(leg): boolean

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1342

Returns true if the leg is a hold leg

Parameters

ParameterTypeDescription
legFlightPlanLegthe leg in question

Returns

boolean

the result


isLegValidAirwayExit()

static isLegValidAirwayExit(airway, icao): undefined | IntersectionFacility

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1178

Checks for an airway exit at a given icao.

Parameters

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

Returns

undefined | IntersectionFacility

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


isLegVectOrDisco()

static isLegVectOrDisco(leg): boolean

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1358

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: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:277

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: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1094

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

Parameters

ParameterTypeDescription
legTypeLegTypeThe LegType.

Returns

boolean

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


isVtfApproachLoaded()

static isVtfApproachLoaded(plan): boolean

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:339

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): undefined | IntersectionFacility

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1188

Checks for an airway exit matching an input ident

Parameters

ParameterTypeDescription
airwayAirwayDataThe AirwayObject.
identstringThe Ident to search for.

Returns

undefined | IntersectionFacility

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


parseAltitudeForDisplay()

static parseAltitudeForDisplay(altitudeMeters, transitionAltitudeFeet): string

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:973

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): undefined | boolean

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:738

Copied from the CJ4 mod

Parameters

ParameterTypeDescription
valuestringThe scratchpad value.
verticalDataVerticalDataThe existing leg vertical data.

Returns

undefined | boolean

False if invalid entry.


parseDtkDistanceForDisplay()

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

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:990

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.


pathVectorHasHoldFlags()

static pathVectorHasHoldFlags(flags): boolean

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1113

Checks if flight path vector has hold flags

Parameters

ParameterTypeDescription
flagsnumberThe vector's flags.

Returns

boolean

Whether the light path vector has hold flags


reconcileDirectToData()

static reconcileDirectToData(plan): void

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1265

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: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1288

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


removeDisplacedActiveLegs()

static removeDisplacedActiveLegs(plan): void

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1309

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: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1328

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.


removeLegTComp()

static removeLegTComp(fms, leg): void

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1950

Resets the vertical data of the provided leg to the data in the nav database

Parameters

ParameterTypeDescription
fmsEpic2FmsThe FMS
legLegDefinitionThe leg to be reset

Returns

void


shouldShowLegCourse()

static shouldShowLegCourse(legType): boolean

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1124

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.


sortApproach()

static sortApproach(a, b): number

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1846

Gets the sorting order of two approaches.

Parameters

ParameterTypeDescription
aApproachProcedureThe first approach to sort.
bApproachProcedureThe second approach to sort.

Returns

number

A negative number if approach a comes before approach b, a positive number if approach a comes after approach b, or zero if both orderings are equivalent.


sortApproachItem()

static sortApproachItem(a, b): number

Defined in: workingtitle-instruments-epic2/shared/Fms/Epic2FmsUtils.ts:1872

Gets the sorting order of two approach items.

Parameters

ParameterTypeDescription
aApproachListItemThe first approach item to sort.
bApproachListItemThe second approach item to sort.

Returns

number

A negative number if approach item a comes before approach item b, a positive number if approach item a comes after approach item b, or zero if both orderings are equivalent.