Skip to main content

Class: FlightPlan

Defined in: src/sdk/flightplan/FlightPlan.ts:219

A flight plan managed by the flight plan system.

Constructors

Constructor

new FlightPlan(planIndex, calculator, onLegNameRequested): FlightPlan

Defined in: src/sdk/flightplan/FlightPlan.ts:327

Creates an instance of a FlightPlan.

Parameters

ParameterTypeDescription
planIndexnumberThe index within the flight planner of this flight plan.
calculatorFlightPathCalculatorThe flight path calculator to use to calculate the flight path.
onLegNameRequested(leg) => undefined | stringA callback fired when a flight plan leg is to be named.

Returns

FlightPlan

Properties

calculator

calculator: FlightPathCalculator

Defined in: src/sdk/flightplan/FlightPlan.ts:329

The flight path calculator to use to calculate the flight path.


directToData

readonly directToData: FlightPlanLegIndexes

Defined in: src/sdk/flightplan/FlightPlan.ts:281

The direct to metadata for this plan.


events

events: PlanEvents = {}

Defined in: src/sdk/flightplan/FlightPlan.ts:305

Events fired when the plan is modified.


planIndex

planIndex: number

Defined in: src/sdk/flightplan/FlightPlan.ts:328

The index within the flight planner of this flight plan.


procedureDetails

readonly procedureDetails: ProcedureDetails

Defined in: src/sdk/flightplan/FlightPlan.ts:308

The details about the selected procedures.

Accessors

activeCalculatingLeg

Get Signature

get activeCalculatingLeg(): number

Defined in: src/sdk/flightplan/FlightPlan.ts:276

The global index of the currently active calculating leg.

Returns

number


activeLateralLeg

Get Signature

get activeLateralLeg(): number

Defined in: src/sdk/flightplan/FlightPlan.ts:262

The global index of the currently active lateral navigation leg.

Returns

number


activeVerticalLeg

Get Signature

get activeVerticalLeg(): number

Defined in: src/sdk/flightplan/FlightPlan.ts:269

The global index of the currently active vertical navigation leg.

Returns

number


destinationAirport

Get Signature

get destinationAirport(): undefined | string

Defined in: src/sdk/flightplan/FlightPlan.ts:255

The ICAO string (V1) of the flight plan's destination airport, or undefined if the flight plan has no destination airport.

Deprecated

Please use destinationAirportIcao instead.

Returns

undefined | string


destinationAirportIcao

Get Signature

get destinationAirportIcao(): undefined | IcaoValue

Defined in: src/sdk/flightplan/FlightPlan.ts:234

The ICAO value of the flight plan's destination airport, or undefined if the flight plan has no destination airport.

Returns

undefined | IcaoValue


length

Get Signature

get length(): number

Defined in: src/sdk/flightplan/FlightPlan.ts:287

Gets the current number of legs in the flight plan.

Returns

number

The number of legs in the plan.


originAirport

Get Signature

get originAirport(): undefined | string

Defined in: src/sdk/flightplan/FlightPlan.ts:244

The ICAO string (V1) of the flight plan's origin airport, or undefined if the flight plan has no origin airport.

Deprecated

Please use originAirportIcao instead.

Returns

undefined | string


originAirportIcao

Get Signature

get originAirportIcao(): undefined | IcaoValue

Defined in: src/sdk/flightplan/FlightPlan.ts:224

The ICAO value of the flight plan's origin airport, or undefined if the flight plan has no origin airport.

Returns

undefined | IcaoValue


segmentCount

Get Signature

get segmentCount(): number

Defined in: src/sdk/flightplan/FlightPlan.ts:300

Gets the current number of segments in the flight plan.

Returns

number

The number of legs in the plan.

Methods

addLeg()

addLeg(segmentIndex, leg, segmentLegIndex?, flags?, notify?): LegDefinition

Defined in: src/sdk/flightplan/FlightPlan.ts:1085

Adds a leg to the flight plan.

Parameters

ParameterTypeDefault valueDescription
segmentIndexnumberundefinedThe segment to add the leg to.
legFlightPlanLegundefinedThe leg to add to the plan.
segmentLegIndex?numberundefinedThe index of the leg in the segment to insert. Will add to the end of the segment if omitted.
flags?number0Leg definition flags to apply to the new leg. Defaults to None (0).
notify?booleantrueWhether or not to send notifications after the operation.

Returns

LegDefinition

the leg that was added.


addSegment()

addSegment(segmentIndex, segmentType, airway?, notify?): FlightPlanSegment

Defined in: src/sdk/flightplan/FlightPlan.ts:989

Adds a segment to the flight plan at a specified index.

Parameters

ParameterTypeDefault valueDescription
segmentIndexnumberundefinedThe index of the flight plan segment.
segmentTypeFlightPlanSegmentTypeFlightPlanSegmentType.EnrouteThe type of segment this will be.
airway?stringundefinedThe airway this segment is made up of, if any.
notify?booleantrueWhether or not to send notifications after the operation.

Returns

FlightPlanSegment

The new flight plan segment.


calculate()

calculate(globalLegIndex?, notify?): Promise<void>

Defined in: src/sdk/flightplan/FlightPlan.ts:1872

Calculates the flight path for the plan.

Parameters

ParameterTypeDefault valueDescription
globalLegIndex?numberundefinedThe global leg index to start calculating from.
notify?booleantrueWhether or not to send notifications after the operation.

Returns

Promise<void>


closeAllBatches()

closeAllBatches(): void

Defined in: src/sdk/flightplan/FlightPlan.ts:939

Closes all currently open modification batches.

Returns

void


closeBatch()

closeBatch(uuid?): void

Defined in: src/sdk/flightplan/FlightPlan.ts:919

Closes a modification batch.

Parameters

ParameterTypeDescription
uuid?stringThe UUID of the batch to close. If defined, then the batch with the specified UUID and all open batches that are nested within it will be closed (with the most-nested batch closed first, followed by the next most-nested batch, and so on). If not defined, then the most recently opened batch that has not yet been closed (i.e. the most-nested open batch) will be closed.

Returns

void


copy()

copy(planIndex?, copyCalcs?): FlightPlan

Defined in: src/sdk/flightplan/FlightPlan.ts:1913

Copies the flight plan.

Parameters

ParameterTypeDefault valueDescription
planIndex?numberundefinedThe flight plan index to assign to this plan, or the same plan index if not provided.
copyCalcs?booleanfalseWhether to copy leg calculations (defaults to false).

Returns

FlightPlan

The copied flight plan.


copyFrom()

copyFrom(sourcePlan, copyCalcs): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1929

Copies a source flight plan into this one, overriding everything in this plan with everything from the source plan.

Parameters

ParameterTypeDefault valueDescription
sourcePlanFlightPlanundefinedThe plan to copy from.
copyCalcsbooleanfalseWhether to copy leg calculations (defaults to false).

Returns

void


deleteLegUserData()

Call Signature

deleteLegUserData(segmentIndex, segmentLegIndex, key, notify?): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1651

Deletes a key-value user data pair for a flight plan leg.

Parameters
ParameterTypeDescription
segmentIndexnumberThe index of the segment containing the flight plan leg for which to delete the user data.
segmentLegIndexnumberThe index of the flight plan leg for which to delete the user data in its containing segment.
keystringThe key to delete.
notify?booleanWhether to send an event for this change. Defaults to true.
Returns

void

Call Signature

deleteLegUserData(globalLegIndex, key, notify?): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1658

Deletes a key-value user data pair for a flight plan leg.

Parameters
ParameterTypeDescription
globalLegIndexnumberThe global index of the flight plan leg for which to delete the user data.
keystringThe key to delete.
notify?booleanWhether to send an event for this change. Defaults to true.
Returns

void


deleteSegment()

deleteSegment(segmentIndex, notify): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1043

Deletes a segment from the flight plan, leaving an empty segment at the specified index.

Parameters

ParameterTypeDefault valueDescription
segmentIndexnumberundefinedThe index of the segment to remove.
notifybooleantrueWhether or not to send notifications after the operation.

Returns

void


deleteUserData()

deleteUserData(key, notify): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1580

Deletes a global key-value user data pair for this flight plan.

Parameters

ParameterTypeDefault valueDescription
keystringundefinedThe key to delete.
notifybooleantrueWhether or not to notify subscribers.

Returns

void


findLeg()

findLeg(predicate, reverse, startIndex?, endIndex?): null | LegDefinition

Defined in: src/sdk/flightplan/FlightPlan.ts:772

Finds a leg in this flight plan that satisfies a given condition.

Parameters

ParameterTypeDefault valueDescription
predicate(leg, segment, segmentIndex, segmentLegIndex, plan) => booleanundefinedA function that evaluates whether each leg satisfies the condition to be returned by this method. The function is called once for each evaluated leg and should return true if the leg satisfies the condition and false otherwise.
reversebooleanfalseWhether to evaluate the legs in reverse order. Defaults to false.
startIndex?numberundefinedThe global leg index of the first leg to evaluate, inclusive. Defaults to 0 if reverse is false or this.length - 1 if reverse is true.
endIndex?numberundefinedThe global leg index of the last leg to evaluate, exclusive. Defaults to this.length if reverse is false or -1 if reverse is true.

Returns

null | LegDefinition

The first evaluated leg in this flight plan that satisfies the condition defined by the specified predicate function, or null if no leg satisfies the condition.


getBatchStack()

getBatchStack(): undefined | readonly Readonly<FlightPlanModBatch>[]

Defined in: src/sdk/flightplan/FlightPlan.ts:874

Gets the current modification batch stack.

Returns

undefined | readonly Readonly<FlightPlanModBatch>[]

The current modification batch stack, or undefined if there are no open batches.


getLeg()

Call Signature

getLeg(indexes): LegDefinition

Defined in: src/sdk/flightplan/FlightPlan.ts:479

Gets a leg from the flight plan.

Parameters
ParameterTypeDescription
indexesReadonly<FlightPlanLegIndexes>The indexes describing the location of the leg to get.
Returns

LegDefinition

A flight plan leg.

Throws

Error if the leg could not be found.

Call Signature

getLeg(segmentIndex, segmentLegIndex): LegDefinition

Defined in: src/sdk/flightplan/FlightPlan.ts:487

Gets a leg from the flight plan.

Parameters
ParameterTypeDescription
segmentIndexnumberThe index of the segment containing the leg to get.
segmentLegIndexnumberThe index of the leg to get in its segment.
Returns

LegDefinition

A flight plan leg.

Throws

Error if the leg could not be found.

Call Signature

getLeg(globalLegIndex): LegDefinition

Defined in: src/sdk/flightplan/FlightPlan.ts:494

Gets a leg from the flight plan.

Parameters
ParameterTypeDescription
globalLegIndexnumberThe global leg index of the leg to get.
Returns

LegDefinition

A flight plan leg.

Throws

Error if the leg could not be found.


getLegIndexesFromGlobalLegIndex()

getLegIndexesFromGlobalLegIndex(globalLegIndex, out?): FlightPlanLegIndexes

Defined in: src/sdk/flightplan/FlightPlan.ts:618

Gets the indexes describing the location of a global leg index in this flight plan.

Parameters

ParameterTypeDescription
globalLegIndexnumberThe global leg index for which to get indexes.
out?FlightPlanLegIndexesThe object to which to write the result. If not defined, then a new index object will be created.

Returns

FlightPlanLegIndexes

The indexes describing the location of the specified global leg index this flight plan. If the global leg index does not point to a valid leg in this flight plan, then all indexes will be equal to -1.


getLegIndexesFromLeg()

getLegIndexesFromLeg(leg, out?): FlightPlanLegIndexes

Defined in: src/sdk/flightplan/FlightPlan.ts:588

Gets the indexes describing the location of a flight plan leg in this flight plan.

Parameters

ParameterTypeDescription
legLegDefinitionThe flight plan leg for which to get indexes.
out?FlightPlanLegIndexesThe object to which to write the result. If not defined, then a new index object will be created.

Returns

FlightPlanLegIndexes

The indexes describing the location of the specified flight plan leg in this flight plan. If the leg is not in this flight plan, then all indexes will be equal to -1.


getLegIndexFromLeg()

getLegIndexFromLeg(leg): number

Defined in: src/sdk/flightplan/FlightPlan.ts:569

Gets the global index of a flight plan leg in this flight plan.

Parameters

ParameterTypeDescription
legLegDefinitionA flight plan leg definition.

Returns

number

the global index of the leg, or -1 if the leg is not in this flight plan.


getNextLeg()

Call Signature

getNextLeg(legIndexes): null | LegDefinition

Defined in: src/sdk/flightplan/FlightPlan.ts:720

Gets the leg immediately after a position in this flight plan.

Parameters
ParameterTypeDescription
legIndexesReadonly<FlightPlanLegIndexes>The indexes describing the position for which to get the next leg.
Returns

null | LegDefinition

The leg immediately after the specified position, or null if there is no such leg.

Call Signature

getNextLeg(segmentIndex, segmentLegIndex): null | LegDefinition

Defined in: src/sdk/flightplan/FlightPlan.ts:727

Gets the leg immediately after a position in this flight plan.

Parameters
ParameterTypeDescription
segmentIndexnumberThe index of the segment containing the position for which to get the next leg.
segmentLegIndexnumberThe index of the position for which to get the next leg in its containing segment.
Returns

null | LegDefinition

The leg immediately after the specified position, or null if there is no such leg.


getPrevLeg()

Call Signature

getPrevLeg(legIndexes): null | LegDefinition

Defined in: src/sdk/flightplan/FlightPlan.ts:676

Gets the leg immediately previous to a position in this flight plan.

Parameters
ParameterTypeDescription
legIndexesReadonly<FlightPlanLegIndexes>The indexes describing the position for which to get the previous leg.
Returns

null | LegDefinition

The leg immediately previous to the specified position, or null if there is no such leg.

Call Signature

getPrevLeg(segmentIndex, segmentLegIndex): null | LegDefinition

Defined in: src/sdk/flightplan/FlightPlan.ts:683

Gets the leg immediately previous to a position in this flight plan.

Parameters
ParameterTypeDescription
segmentIndexnumberThe index of the segment containing the position for which to get the previous leg.
segmentLegIndexnumberThe index of the position for which to get the previous leg in its containing segment.
Returns

null | LegDefinition

The leg immediately previous to the specified position, or null if there is no such leg.


getSegment()

getSegment(segmentIndex?): FlightPlanSegment

Defined in: src/sdk/flightplan/FlightPlan.ts:432

Gets a flight plan segment from the plan.

Parameters

ParameterTypeDescription
segmentIndex?numberThe index of the segment to get; if not specified returns the active segment.

Returns

FlightPlanSegment

The requested flight plan segment.

Throws

An error if the flight plan segment could not be found.


getSegmentFromLeg()

getSegmentFromLeg(leg): null | FlightPlanSegment

Defined in: src/sdk/flightplan/FlightPlan.ts:661

Gets the flight plan segment to which a leg belongs.

Parameters

ParameterTypeDescription
legLegDefinitionA flight plan leg definition.

Returns

null | FlightPlanSegment

The segment to which the leg belongs, or null if the leg is not in this flight plan.


getSegmentIndex()

getSegmentIndex(globalLegIndex): number

Defined in: src/sdk/flightplan/FlightPlan.ts:643

Gets the segment index for a given global leg index.

Parameters

ParameterTypeDescription
globalLegIndexnumberThe global leg index to get the segment index for.

Returns

number

The segment index for the given global leg index, or -1 if not found.


getSegmentLegIndex()

getSegmentLegIndex(globalLegIndex): number

Defined in: src/sdk/flightplan/FlightPlan.ts:652

Gets the segment leg index (the index of the leg in its segment) for a given global leg index.

Parameters

ParameterTypeDescription
globalLegIndexnumberThe global leg index to get the segment leg index for.

Returns

number

The segment leg index, or -1 if not found.


getUserData()

getUserData<T>(key): undefined | T

Defined in: src/sdk/flightplan/FlightPlan.ts:866

Gets user data from the flight plan.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
keystringThe key of the user data.

Returns

undefined | T

The user data, if found.


insertSegment()

insertSegment(segmentIndex, segmentType, airway?, notify?): FlightPlanSegment

Defined in: src/sdk/flightplan/FlightPlan.ts:1009

Inserts a segment into the flight plan at the specified index and reflows the subsequent segments.

Parameters

ParameterTypeDefault valueDescription
segmentIndexnumberundefinedThe index to insert the flight plan segment.
segmentTypeFlightPlanSegmentTypeFlightPlanSegmentType.EnrouteThe type of segment this will be.
airway?stringundefinedThe airway this segment is made up of, if any
notify?booleantrueWhether or not to send notifications after the operation.

Returns

FlightPlanSegment

The new flight plan segment.


legs()

legs(reverse, startIndex?, endIndex?): Generator<LegDefinition, void>

Defined in: src/sdk/flightplan/FlightPlan.ts:342

Gets this flight plan's legs.

Parameters

ParameterTypeDefault valueDescription
reversebooleanfalseWhether to get the legs in reverse order. False by default.
startIndex?numberundefinedThe global leg index of the leg at which to start, inclusive. Defaults to 0 if reverse is false or this.length - 1 if reverse is true.
endIndex?numberundefinedThe global leg index of the leg at which to end, exclusive. Defaults to this.length if reverse is false or -1 if reverse is true.

Returns

Generator<LegDefinition, void>

A generator which yields this flight plan's legs.


openBatch()

openBatch(name?): string

Defined in: src/sdk/flightplan/FlightPlan.ts:887

Opens a new modification batch. The new batch will be nested within the most recently opened batch that has not yet been closed. While a batch is open, all modifications made to this flight plan will be assigned to the batch. The use of batches is informational only and will not affect the timing or execution of flight plan modifications. All modifications are carried out immediately when the corresponding method is called regardless of whether they are assigned to a batch.

Parameters

ParameterTypeDescription
name?stringThe name to assign to the new batch.

Returns

string

The UUID of the new batch.


removeDestinationAirport()

removeDestinationAirport(notify): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1246

Removes the destination airport from the flight plan.

Parameters

ParameterTypeDefault valueDescription
notifybooleantrueWhether to notify subscribers of the change. Defaults to true.

Returns

void


removeLeg()

removeLeg(segmentIndex, segmentLegIndex?, notify?): null | LegDefinition

Defined in: src/sdk/flightplan/FlightPlan.ts:1126

Removes a leg from the flight plan.

Parameters

ParameterTypeDefault valueDescription
segmentIndexnumberundefinedThe segment to add the leg to.
segmentLegIndex?numberundefinedThe index of the leg in the segment to remove. Will remove from the end of the segment if ommitted.
notify?booleantrueWhether or not to send notifications after the operation.

Returns

null | LegDefinition

the leg that was removed, or null if a leg was not removed.


removeOriginAirport()

removeOriginAirport(notify): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1200

Removes the origin airport from the flight plan.

Parameters

ParameterTypeDefault valueDescription
notifybooleantrueWhether to notify subscribers of the change. Defaults to true.

Returns

void


removeSegment()

removeSegment(segmentIndex, notify): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1067

Removes a segment from the flight plan and reflows the segments following the removed segment, not leaving an empty segment at the specified index.

Parameters

ParameterTypeDefault valueDescription
segmentIndexnumberundefinedThe index of the segment to remove.
notifybooleantrueWhether or not to send notifications after the operation.

Returns

void


segments()

segments(): Generator<FlightPlanSegment, void>

Defined in: src/sdk/flightplan/FlightPlan.ts:402

Gets the segments for the flightplan.

Returns

Generator<FlightPlanSegment, void>

Yields

The flight plan segments.


segmentsOfType()

segmentsOfType(segmentType): Generator<FlightPlanSegment, void>

Defined in: src/sdk/flightplan/FlightPlan.ts:418

Gets all of the segments of a given type.

Parameters

ParameterTypeDescription
segmentTypeFlightPlanSegmentTypeThe type of the segments to retrieve.

Returns

Generator<FlightPlanSegment, void>

Yields

The segments of the requested type.


setAirway()

setAirway(segmentIndex, airway?, notify?): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1548

Sets the airway for a segment.

Parameters

ParameterTypeDefault valueDescription
segmentIndexnumberundefinedA segment index.
airway?stringundefinedThe airway name.
notify?booleantrueis whether to send an event for this change

Returns

void


setApproach()

Call Signature

setApproach(facilityIcao?, approachIndex?, approachTransitionIndex?, notify?): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1835

Sets the approach procedure details.

Parameters
ParameterTypeDescription
facilityIcao?IcaoValueThe ICAO value of the facility containing the procedure. Defaults to undefined.
approachIndex?numberThe index of the approach procedure in the approach airport facility's approaches array. Defaults to -1.
approachTransitionIndex?numberThe index of the approach transition in the approach procedure's transitions array. Defaults to -1.
notify?booleanWhether to notify subscribers of the change. Defaults to true.
Returns

void

Call Signature

setApproach(facilityIcao?, approachIndex?, approachTransitionIndex?, notify?): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1846

Sets the approach procedure details.

Parameters
ParameterTypeDescription
facilityIcao?stringThe ICAO string (V1) of the facility containing the procedure. Defaults to undefined.
approachIndex?numberThe index of the approach procedure in the approach airport facility's approaches array. Defaults to -1.
approachTransitionIndex?numberThe index of the approach transition in the approach procedure's transitions array. Defaults to -1.
notify?booleanWhether to notify subscribers of the change. Defaults to true.
Returns

void

Deprecated

Please use the signature that takes an IcaoValue for the facilityIcao parameter.


setArrival()

Call Signature

setArrival(facilityIcao?, arrivalIndex?, arrivalTransitionIndex?, arrivalRunwayTransitionIndex?, arrivalRunway?, notify?): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1769

Sets the arrival procedure details.

Parameters
ParameterTypeDescription
facilityIcao?IcaoValueThe ICAO value of the facility containing the procedure. Defaults to undefined.
arrivalIndex?numberThe index of the arrival procedure in the arrival airport facility's arrivals array. Defaults to -1.
arrivalTransitionIndex?numberThe index of the arrival enroute transition in the arrival procedure's enroute transitions array. Defaults to -1.
arrivalRunwayTransitionIndex?numberThe index of the arrival runway transition in the arrival procedure's runway transitions array. Defaults to -1.
arrivalRunway?OneWayRunwayThe arrival procedure runway. Defaults to undefined. @param notify Whether to notify subscribers of the change. Defaults to true`.
notify?boolean-
Returns

void

Call Signature

setArrival(facilityIcao?, arrivalIndex?, arrivalTransitionIndex?, arrivalRunwayTransitionIndex?, arrivalRunway?, notify?): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1790

Sets the arrival procedure details.

Parameters
ParameterTypeDescription
facilityIcao?stringThe ICAO string (V1) of the facility containing the procedure. Defaults to undefined.
arrivalIndex?numberThe index of the arrival procedure in the arrival airport facility's arrivals array. Defaults to -1.
arrivalTransitionIndex?numberThe index of the arrival enroute transition in the arrival procedure's enroute transitions array. Defaults to -1.
arrivalRunwayTransitionIndex?numberThe index of the arrival runway transition in the arrival procedure's runway transitions array. Defaults to -1.
arrivalRunway?OneWayRunwayThe arrival procedure runway. Defaults to undefined. @param notify Whether to notify subscribers of the change. Defaults to true. @deprecated Please use the signature that takes an IcaoValuefor thefacilityIcao` parameter.
notify?boolean-
Returns

void


setCalculatingLeg()

setCalculatingLeg(globalLegIndex, notify): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1341

Sets the active calculating leg index in the flight plan.

Parameters

ParameterTypeDefault valueDescription
globalLegIndexnumberundefinedThe global leg index to set.
notifybooleantrueWhether or not to send notifications after the operation.

Returns

void


setDeparture()

Call Signature

setDeparture(facilityIcao?, departureIndex?, departureTransitionIndex?, departureRunwayIndex?, notify?): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1723

Sets the departure procedure details.

Parameters
ParameterTypeDescription
facilityIcao?IcaoValueThe ICAO value of the facility containing the procedure. Defaults to undefined.
departureIndex?numberThe index of the departure procedure in the departure airport facility's departures array. Defaults to -1.
departureTransitionIndex?numberThe index of the departure enroute transition in the departure procedure's enroute transitions array. Defaults to -1.
departureRunwayIndex?numberThe index of the departure runway transition in the departure procedure's runway transitions array. Defaults to -1.
notify?booleanWhether to notify subscribers of the change. Defaults to true.
Returns

void

Call Signature

setDeparture(facilityIcao?, departureIndex?, departureTransitionIndex?, departureRunwayIndex?, notify?): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1736

Sets the departure procedure details.

Parameters
ParameterTypeDescription
facilityIcao?stringThe ICAO string (V1) of the facility containing the procedure. Defaults to undefined.
departureIndex?numberThe index of the departure procedure in the departure airport facility's departures array. Defaults to -1.
departureTransitionIndex?numberThe index of the departure enroute transition in the departure procedure's enroute transitions array. Defaults to -1.
departureRunwayIndex?numberThe index of the departure runway transition in the departure procedure's runway transitions array. Defaults to -1.
notify?booleanWhether to notify subscribers of the change. Defaults to true.
Returns

void

Deprecated

Please use the signature that takes an IcaoValue for the facilityIcao parameter.


setDestinationAirport()

Call Signature

setDestinationAirport(facilityIcao, notify?): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1220

Sets the destination airport in the flight plan.

Parameters
ParameterTypeDescription
facilityIcaoIcaoValueThe ICAO value of the destination airport to set.
notify?booleanWhether to notify subscribers of the change. Defaults to true.
Returns

void

Call Signature

setDestinationAirport(facilityIcao, notify?): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1227

Sets the destination airport in the flight plan.

Parameters
ParameterTypeDescription
facilityIcaostringThe ICAO string (V1) of the destination airport to set.
notify?booleanWhether to notify subscribers of the change. Defaults to true.
Returns

void

Deprecated

Please use the signature that takes an IcaoValue for the facilityIcao parameter.


setDestinationRunway()

setDestinationRunway(runway, notify): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1705

Sets the destination runway in procedure details.

Parameters

ParameterTypeDefault valueDescription
runwayundefined | OneWayRunwayundefinedThe oneway runway to set as the destination, or undefined
notifybooleantrueWhether or not to notify subscribers.

Returns

void


setDirectToData()

Call Signature

setDirectToData(globalLegIndex, notify?): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1448

Sets the direct to data for this plan.

Parameters
ParameterTypeDescription
globalLegIndexnumberThe global leg index of the direct to target, or -1 if the direct to data is to be cleared.
notify?booleanWhether to send an event for this change. Defaults to true.
Returns

void

Call Signature

setDirectToData(segmentIndex, segmentLegIndex, notify?): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1456

Sets the direct to data for this plan.

Parameters
ParameterTypeDescription
segmentIndexnumberThe segment index of the direct to target, or -1 if the direct to data is to be cleared.
segmentLegIndexnumberThe segment leg index of the direct to target, or -1 if the direct to data is to be cleared.
notify?booleanWhether to send an event for this change. Defaults to true.
Returns

void

Call Signature

setDirectToData(leg, notify?): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1462

Sets the direct to data for this plan.

Parameters
ParameterTypeDescription
legnull | LegDefinitionThe target leg of the direct to, or null if the direct to data is to be cleared.
notify?booleanWhether to send an event for this change. Defaults to true.
Returns

void


setLateralLeg()

setLateralLeg(globalLegIndex, notify): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1269

Sets the active lateral leg index in the flight plan.

Parameters

ParameterTypeDefault valueDescription
globalLegIndexnumberundefinedThe global leg index to set.
notifybooleantrueWhether or not to send notifications after the operation.

Returns

void


setLegUserData()

Call Signature

setLegUserData<T>(segmentIndex, segmentLegIndex, key, data, notify?): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1596

Sets a key-value user data pair for a flight plan leg. Setting a key's user data to undefined will delete the key instead.

Type Parameters
Type Parameter
T
Parameters
ParameterTypeDescription
segmentIndexnumberThe index of the segment containing the flight plan leg for which to set the user data.
segmentLegIndexnumberThe index of the flight plan leg for which to set the user data in its containing segment.
keystringThe key under which to set the user data.
dataTThe user data to set under the key.
notify?booleanWhether to send an event for this change. Defaults to true.
Returns

void

Call Signature

setLegUserData<T>(globalLegIndex, key, data, notify?): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1605

Sets a key-value user data pair for a flight plan leg. Setting a key's user data to undefined will delete the key instead.

Type Parameters
Type Parameter
T
Parameters
ParameterTypeDescription
globalLegIndexnumberThe global index of the flight plan leg for which to set the user data.
keystringThe key under which to set the user data.
dataTThe user data to set under the key.
notify?booleanWhether to send an event for this change. Defaults to true.
Returns

void


setLegVerticalData()

Call Signature

setLegVerticalData(segmentIndex, segmentLegIndex, verticalData, notify?): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1503

Sets the vertical data for a flight plan leg.

Parameters
ParameterTypeDescription
segmentIndexnumberThe segment index of the leg for which to set vertical data.
segmentLegIndexnumberThe segment leg index of the leg for which to set vertical data.
verticalDataPartial<VerticalData>The vertical data to set. The values of the enumerable properties of this object will be copied to the flight plan leg. Any vertical data property that is not enumerated in this object will be left as-is in the flight plan leg.
notify?booleanWhether to send an event for this change. Defaults to true.
Returns

void

Call Signature

setLegVerticalData(globalLegIndex, verticalData, notify?): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1512

Sets the vertical data for a flight plan leg.

Parameters
ParameterTypeDescription
globalLegIndexnumberThe global leg index in the plan for the leg for which to set vertical data.
verticalDataPartial<VerticalData>The vertical data to set. The values of the enumerable properties of this object will be copied to the flight plan leg. Any vertical data property that is not enumerated in this object will be left as-is in the flight plan leg.
notify?booleanWhether to send an event for this change. Defaults to true.
Returns

void


setOriginAirport()

Call Signature

setOriginAirport(facilityIcao, notify?): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1174

Sets the origin airport in the flight plan.

Parameters
ParameterTypeDescription
facilityIcaoIcaoValueThe ICAO value of the origin airport to set.
notify?booleanWhether to notify subscribers of the change. Defaults to true.
Returns

void

Call Signature

setOriginAirport(facilityIcao, notify?): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1181

Sets the origin airport in the flight plan.

Parameters
ParameterTypeDescription
facilityIcaostringThe ICAO string (V1) of the origin airport to set.
notify?booleanWhether to notify subscribers of the change. Defaults to true.
Returns

void

Deprecated

Please use the signature that takes an IcaoValue for the facilityIcao parameter.


setOriginRunway()

setOriginRunway(runway, notify): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1693

Sets the origin runway in procedure details.

Parameters

ParameterTypeDefault valueDescription
runwayundefined | OneWayRunwayundefinedThe oneway runway to set as the origin, or undefined
notifybooleantrueWhether or not to notify subscribers.

Returns

void


setProcedureDetails()

setProcedureDetails(details, notify): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1380

Sets this flight plan's procedure details.

Parameters

ParameterTypeDefault valueDescription
detailsPartial<Readonly<ProcedureDetails>>undefinedAn object containing the procedure details properties to set. Properties omitted from the object (i.e. that are not enumerable) will not be set. Properties that are present in the object (including those whose values are equal to undefined) will set the corresponding properties in the flight plan procedure details with the same values.
notifybooleantrueWhether to notify subscribers of the change. Defaults to true.

Returns

void


setUserData()

setUserData<T>(key, data, notify): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1565

Sets a global key-value user data pair for this flight plan. Setting a key's user data to undefined will delete the key instead.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDefault valueDescription
keystringundefinedThe key of the user data.
dataTundefinedThe data to set.
notifybooleantrueWhether or not to notify subscribers. Defaults to true.

Returns

void


setVerticalLeg()

setVerticalLeg(globalLegIndex, notify): void

Defined in: src/sdk/flightplan/FlightPlan.ts:1305

Sets the active lateral leg index in the flight plan.

Parameters

ParameterTypeDefault valueDescription
globalLegIndexnumberundefinedThe global leg index to set.
notifybooleantrueWhether or not to send notifications after the operation.

Returns

void


tryGetLeg()

Call Signature

tryGetLeg(indexes): null | LegDefinition

Defined in: src/sdk/flightplan/FlightPlan.ts:516

Attempts to get a leg from the flight plan.

Parameters
ParameterTypeDescription
indexesReadonly<FlightPlanLegIndexes>The indexes describing the location of the leg to get.
Returns

null | LegDefinition

A flight plan leg, or null if one could not be found at the specified location.

Call Signature

tryGetLeg(segmentIndex, segmentLegIndex): null | LegDefinition

Defined in: src/sdk/flightplan/FlightPlan.ts:523

Attempts to get a leg from the flight plan.

Parameters
ParameterTypeDescription
segmentIndexnumberThe index of the segment containing the leg to get.
segmentLegIndexnumberThe index of the leg to get in its segment.
Returns

null | LegDefinition

A flight plan leg, or null if one could not be found at the specified index.

Call Signature

tryGetLeg(globalLegIndex): null | LegDefinition

Defined in: src/sdk/flightplan/FlightPlan.ts:529

Attempts to get a leg from the flight plan.

Parameters
ParameterTypeDescription
globalLegIndexnumberThe global leg index of the leg to get.
Returns

null | LegDefinition

A flight plan leg, or null if one could not be found at the specified index.


tryGetSegment()

tryGetSegment(segmentIndex?): null | FlightPlanSegment

Defined in: src/sdk/flightplan/FlightPlan.ts:447

Attempts to get a flight plan segment from the plan.

Parameters

ParameterTypeDescription
segmentIndex?numberThe index of the segment to get; if not specified returns the active segment.

Returns

null | FlightPlanSegment

The requested flight plan segment, or null if it could not be found.


createLeg()

static createLeg(partial): FlightPlanLeg

Defined in: src/sdk/flightplan/FlightPlan.ts:2037

Creates a new flight plan leg.

Parameters

ParameterTypeDescription
partialPartial<FlightPlanLeg>The properties to initialize on the new leg. Any undefined properties will be initialized to default values. For ICAO property pairs - struct and string (V1) - only one of each pair needs to be defined; the other property in the pair will be set from the property that is defined. If paired ICAO properties are not consistent with each other, then the struct property will take precedence.

Returns

FlightPlanLeg

A new flight plan leg.


createProcedureDetails()

static createProcedureDetails(): ProcedureDetails

Defined in: src/sdk/flightplan/FlightPlan.ts:2109

Creates an empty procedure details object.

Returns

ProcedureDetails

An empty procedure details object.