Skip to main content

Class: FlightPlan

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

A flight plan managed by the flight plan system.

Constructors​

Constructor​

new FlightPlan(planIndex, calculator, onLegNameRequested): FlightPlan

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

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:303

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


directToData​

readonly directToData: DirectToData

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

The direct to metadata for this plan.


events​

events: PlanEvents = {}

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

Events fired when the plan is modified.


planIndex​

planIndex: number

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

The index within the flight planner of this flight plan.


procedureDetails​

readonly procedureDetails: ProcedureDetails

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

The details about the selected procedures.

Accessors​

activeCalculatingLeg​

Get Signature​

get activeCalculatingLeg(): number

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

The global index of the currently active calculating leg.

Returns​

number


activeLateralLeg​

Get Signature​

get activeLateralLeg(): number

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

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:246

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:232

The ICAO of the destination airport in the flight plan, if any.

Returns​

undefined | string


length​

Get Signature​

get length(): number

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

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:225

The ICAO of the origin airport in the flight plan, if any.

Returns​

undefined | string


segmentCount​

Get Signature​

get segmentCount(): number

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

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:943

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:847

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:1539

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:797

Closes all currently open modification batches.

Returns​

void


closeBatch()​

closeBatch(uuid?): void

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

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:1573

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:1589

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:1410

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:1417

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:901

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:1339

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:637

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:739

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(segmentIndex, segmentLegIndex): LegDefinition

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

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​

An error if the leg could not be found.

Call Signature​

getLeg(globalLegIndex): LegDefinition

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

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​

An error if the leg could not be found.


getLegIndexFromLeg()​

getLegIndexFromLeg(leg): number

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

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()​

getNextLeg(segmentIndex, legIndex): null | LegDefinition

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

Gets the leg immediately after a position in this flight plan specified by segment index and leg index.

Parameters​

ParameterTypeDescription
segmentIndexnumberA segment index.
legIndexnumberA leg index.

Returns​

null | LegDefinition

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


getPrevLeg()​

getPrevLeg(segmentIndex, legIndex): null | LegDefinition

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

Gets the leg immediately previous to a position in this flight plan specified by segment index and leg index.

Parameters​

ParameterTypeDescription
segmentIndexnumberA segment index.
legIndexnumberA leg index.

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:405

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:535

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:550

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:564

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:731

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:867

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:315

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:752

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:1067

Removes the destination airport from the flight plan.

Parameters​

ParameterTypeDefault valueDescription
notifybooleantrueWhether or not to send notifications after the operation.

Returns​

void


removeLeg()​

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

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

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:1041

Removes the origin airport from the flight plan.

Parameters​

ParameterTypeDefault valueDescription
notifybooleantrueWhether or not to send notifications after the operation.

Returns​

void


removeSegment()​

removeSegment(segmentIndex, notify): void

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

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:375

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:391

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:1307

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()​

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

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

Sets the approach procedure details.

Parameters​

ParameterTypeDefault valueDescription
facilityIcaoundefined | stringundefinedThe facility ICAO of the facility containing the procedure
approachIndexnumber-1The index of the apporach in the destination airport information
approachTransitionIndexnumber-1The index of the approach transition in the destination airport approach information
notifybooleantrueWhether or not to notify subscribers

Returns​

void


setArrival()​

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

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

Sets the arrival procedure details.

Parameters​

ParameterTypeDefault valueDescription
facilityIcaoundefined | stringundefinedThe facility ICAO of the facility containing the procedure
arrivalIndexnumber-1The index of the arrival in the destination airport information
arrivalTransitionIndexnumber-1index of the arrival transition in the destination airport arrival information
arrivalRunwayTransitionIndexnumber-1The index of the selected runway transition at the destination airport arrival information
arrivalRunwayundefined | OneWayRunwayundefinedThe oneway runway to set as the arrival runway, or undefined
notifybooleantrueWhether or not to notify subscribers

Returns​

void


setCalculatingLeg()​

setCalculatingLeg(globalLegIndex, notify): void

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

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()​

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

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

Sets the departure procedure details.

Parameters​

ParameterTypeDefault valueDescription
facilityIcaoundefined | stringundefinedThe facility ICAO of the facility containing the procedure
departureIndexnumber-1The index of the departure in the origin airport information
departureTransitionIndexnumber-1The index of the departure transition in the origin airport departure information
departureRunwayIndexnumber-1The index of the selected runway in the original airport departure information
notifybooleantrueWhether or not to notify subscribers.

Returns​

void


setDestinationAirport()​

setDestinationAirport(facilityIcao, notify): void

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

Sets the destination airport in the flight plan.

Parameters​

ParameterTypeDefault valueDescription
facilityIcaostringundefinedThe destination airport to set.
notifybooleantrueWhether or not to send notifications after the operation.

Returns​

void


setDestinationRunway()​

setDestinationRunway(runway, notify): void

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

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:1210

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:1218

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:1224

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:1087

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:1355

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:1364

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:1264

Sets the vertical data for this plan leg.

Parameters​
ParameterTypeDescription
segmentIndexnumberThe segment index of the leg in the plan to add vertical data to.
segmentLegIndexnumberThe segment leg index of the leg in the plan to add vertical data to. cleared.
verticalDataPartial<VerticalData>The Vertical Data for this 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:1271

Sets the vertical data for this plan leg.

Parameters​
ParameterTypeDescription
globalLegIndexnumberThe global leg index in the plan for the leg to add vertical data to.
verticalDataPartial<VerticalData>The Vertical Data for this leg.
notify?booleanWhether to send an event for this change. Defaults to true.
Returns​

void


setOriginAirport()​

setOriginAirport(facilityIcao, notify): void

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

Sets the origin airport in the flight plan.

Parameters​

ParameterTypeDefault valueDescription
facilityIcaostringundefinedThe origin airport to set.
notifybooleantrueWhether or not to send notifications after the operation.

Returns​

void


setOriginRunway()​

setOriginRunway(runway, notify): void

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

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:1195

Sets the flight plan procedure details.

Parameters​

ParameterTypeDefault valueDescription
detailsPartial<ProcedureDetails>undefinedThe details of the flight plan's procedures.
notifybooleantrueWhether or not to send notifications after the operation.

Returns​

void


setUserData()​

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

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

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:1123

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(segmentIndex, segmentLegIndex): null | LegDefinition

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

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:484

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:420

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:1683

Creates a default instance of a flight plan leg.

Parameters​

ParameterTypeDescription
partialPartial<FlightPlanLeg>A portion of leg options to apply.

Returns​

FlightPlanLeg

A default instance of a flight plan leg.