Skip to main content

Class: FlightPlan

A flight plan managed by the flight plan system.

Constructors

constructor

new FlightPlan(planIndex, calculator, onLegNameRequested): FlightPlan

Creates an instance of a FlightPlan.

Parameters

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

Returns

FlightPlan

Defined in

src/sdk/flightplan/FlightPlan.ts:302

Properties

calculator

calculator: FlightPathCalculator

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

Defined in

src/sdk/flightplan/FlightPlan.ts:303


directToData

Readonly directToData: DirectToData

The direct to metadata for this plan.

Defined in

src/sdk/flightplan/FlightPlan.ts:258


events

events: PlanEvents = {}

Events fired when the plan is modified.

Defined in

src/sdk/flightplan/FlightPlan.ts:282


planIndex

planIndex: number

The index within the flight planner of this flight plan.

Defined in

src/sdk/flightplan/FlightPlan.ts:302


procedureDetails

Readonly procedureDetails: ProcedureDetails

The details about the selected procedures.

Defined in

src/sdk/flightplan/FlightPlan.ts:285

Accessors

activeCalculatingLeg

get activeCalculatingLeg(): number

The global index of the currently active calculating leg.

Returns

number

Defined in

src/sdk/flightplan/FlightPlan.ts:253


activeLateralLeg

get activeLateralLeg(): number

The global index of the currently active lateral navigation leg.

Returns

number

Defined in

src/sdk/flightplan/FlightPlan.ts:239


activeVerticalLeg

get activeVerticalLeg(): number

The global index of the currently active vertical navigation leg.

Returns

number

Defined in

src/sdk/flightplan/FlightPlan.ts:246


destinationAirport

get destinationAirport(): undefined | string

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

Returns

undefined | string

Defined in

src/sdk/flightplan/FlightPlan.ts:232


length

get length(): number

Gets the current number of legs in the flight plan.

Returns

number

The number of legs in the plan.

Defined in

src/sdk/flightplan/FlightPlan.ts:264


originAirport

get originAirport(): undefined | string

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

Returns

undefined | string

Defined in

src/sdk/flightplan/FlightPlan.ts:225


segmentCount

get segmentCount(): number

Gets the current number of segments in the flight plan.

Returns

number

The number of legs in the plan.

Defined in

src/sdk/flightplan/FlightPlan.ts:277

Methods

addLeg

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

Adds a leg to the flight plan.

Parameters

NameTypeDefault 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.
flagsnumber0Leg definition flags to apply to the new leg. Defaults to None (0).
notifybooleantrueWhether or not to send notifications after the operation.

Returns

LegDefinition

the leg that was added.

Defined in

src/sdk/flightplan/FlightPlan.ts:943


addSegment

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

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

Parameters

NameTypeDefault 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.
notifybooleantrueWhether or not to send notifications after the operation.

Returns

FlightPlanSegment

The new flight plan segment.

Defined in

src/sdk/flightplan/FlightPlan.ts:847


calculate

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

Calculates the flight path for the plan.

Parameters

NameTypeDefault valueDescription
globalLegIndex?numberundefinedThe global leg index to start calculating from.
notifybooleantrueWhether or not to send notifications after the operation.

Returns

Promise<void>

Defined in

src/sdk/flightplan/FlightPlan.ts:1539


closeAllBatches

closeAllBatches(): void

Closes all currently open modification batches.

Returns

void

Defined in

src/sdk/flightplan/FlightPlan.ts:797


closeBatch

closeBatch(uuid?): void

Closes a modification batch.

Parameters

NameTypeDescription
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

Defined in

src/sdk/flightplan/FlightPlan.ts:777


copy

copy(planIndex?, copyCalcs?): FlightPlan

Copies the flight plan.

Parameters

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

Returns

FlightPlan

The copied flight plan.

Defined in

src/sdk/flightplan/FlightPlan.ts:1573


copyFrom

copyFrom(sourcePlan, copyCalcs?): void

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

Parameters

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

Returns

void

Defined in

src/sdk/flightplan/FlightPlan.ts:1589


deleteLegUserData

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

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

Parameters

NameTypeDescription
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

Defined in

src/sdk/flightplan/FlightPlan.ts:1410

deleteLegUserData(globalLegIndex, key, notify?): void

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

Parameters

NameTypeDescription
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

Defined in

src/sdk/flightplan/FlightPlan.ts:1417


deleteSegment

deleteSegment(segmentIndex, notify?): void

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

Parameters

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

Returns

void

Defined in

src/sdk/flightplan/FlightPlan.ts:901


deleteUserData

deleteUserData(key, notify?): void

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

Parameters

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

Returns

void

Defined in

src/sdk/flightplan/FlightPlan.ts:1339


findLeg

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

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

Parameters

NameTypeDefault valueDescription
predicate(leg: LegDefinition, segment: FlightPlanSegment, segmentIndex: number, segmentLegIndex: number, plan: FlightPlan) => 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.

Defined in

src/sdk/flightplan/FlightPlan.ts:637


getBatchStack

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

Gets the current modification batch stack.

Returns

undefined | readonly Readonly<FlightPlanModBatch>[]

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

Defined in

src/sdk/flightplan/FlightPlan.ts:739


getLeg

getLeg(segmentIndex, segmentLegIndex): LegDefinition

Gets a leg from the flight plan.

Parameters

NameTypeDescription
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.

Defined in

src/sdk/flightplan/FlightPlan.ts:453

getLeg(globalLegIndex): LegDefinition

Gets a leg from the flight plan.

Parameters

NameTypeDescription
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.

Defined in

src/sdk/flightplan/FlightPlan.ts:460


getLegIndexFromLeg

getLegIndexFromLeg(leg): number

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

Parameters

NameTypeDescription
legLegDefinitionA flight plan leg definition.

Returns

number

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

Defined in

src/sdk/flightplan/FlightPlan.ts:518


getNextLeg

getNextLeg(segmentIndex, legIndex): null | LegDefinition

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

Parameters

NameTypeDescription
segmentIndexnumberA segment index.
legIndexnumberA leg index.

Returns

null | LegDefinition

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

Defined in

src/sdk/flightplan/FlightPlan.ts:604


getPrevLeg

getPrevLeg(segmentIndex, legIndex): null | LegDefinition

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

Parameters

NameTypeDescription
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.

Defined in

src/sdk/flightplan/FlightPlan.ts:578


getSegment

getSegment(segmentIndex?): FlightPlanSegment

Gets a flight plan segment from the plan.

Parameters

NameTypeDescription
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.

Defined in

src/sdk/flightplan/FlightPlan.ts:405


getSegmentFromLeg

getSegmentFromLeg(leg): null | FlightPlanSegment

Gets the flight plan segment to which a leg belongs.

Parameters

NameTypeDescription
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.

Defined in

src/sdk/flightplan/FlightPlan.ts:535


getSegmentIndex

getSegmentIndex(globalLegIndex): number

Gets the segment index for a given global leg index.

Parameters

NameTypeDescription
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.

Defined in

src/sdk/flightplan/FlightPlan.ts:550


getSegmentLegIndex

getSegmentLegIndex(globalLegIndex): number

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

Parameters

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

Returns

number

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

Defined in

src/sdk/flightplan/FlightPlan.ts:564


getUserData

getUserData<T>(key): undefined | T

Gets user data from the flight plan.

Type parameters

Name
T

Parameters

NameTypeDescription
keystringThe key of the user data.

Returns

undefined | T

The user data, if found.

Defined in

src/sdk/flightplan/FlightPlan.ts:731


insertSegment

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

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

Parameters

NameTypeDefault 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
notifybooleantrueWhether or not to send notifications after the operation.

Returns

FlightPlanSegment

The new flight plan segment.

Defined in

src/sdk/flightplan/FlightPlan.ts:867


legs

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

Gets this flight plan's legs.

Parameters

NameTypeDefault 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, unknown>

A generator which yields this flight plan's legs.

Defined in

src/sdk/flightplan/FlightPlan.ts:315


openBatch

openBatch(name?): string

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

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

Returns

string

The UUID of the new batch.

Defined in

src/sdk/flightplan/FlightPlan.ts:752


removeDestinationAirport

removeDestinationAirport(notify?): void

Removes the destination airport from the flight plan.

Parameters

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

Returns

void

Defined in

src/sdk/flightplan/FlightPlan.ts:1067


removeLeg

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

Removes a leg from the flight plan.

Parameters

NameTypeDefault 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.
notifybooleantrueWhether or not to send notifications after the operation.

Returns

null | LegDefinition

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

Defined in

src/sdk/flightplan/FlightPlan.ts:984


removeOriginAirport

removeOriginAirport(notify?): void

Removes the origin airport from the flight plan.

Parameters

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

Returns

void

Defined in

src/sdk/flightplan/FlightPlan.ts:1041


removeSegment

removeSegment(segmentIndex, notify?): void

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

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

Returns

void

Defined in

src/sdk/flightplan/FlightPlan.ts:925


segments

segments(): Generator<FlightPlanSegment, void, unknown>

Gets the segments for the flightplan.

Returns

Generator<FlightPlanSegment, void, unknown>

Yields

The flight plan segments.

Defined in

src/sdk/flightplan/FlightPlan.ts:375


segmentsOfType

segmentsOfType(segmentType): Generator<FlightPlanSegment, void, unknown>

Gets all of the segments of a given type.

Parameters

NameTypeDescription
segmentTypeFlightPlanSegmentTypeThe type of the segments to retrieve.

Returns

Generator<FlightPlanSegment, void, unknown>

Yields

The segments of the requested type.

Defined in

src/sdk/flightplan/FlightPlan.ts:391


setAirway

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

Sets the airway for a segment.

Parameters

NameTypeDefault valueDescription
segmentIndexnumberundefinedA segment index.
airway?stringundefinedThe airway name.
notifybooleantrueis whether to send an event for this change

Returns

void

Defined in

src/sdk/flightplan/FlightPlan.ts:1307


setApproach

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

Sets the approach procedure details.

Parameters

NameTypeDefault 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

Defined in

src/sdk/flightplan/FlightPlan.ts:1523


setArrival

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

Sets the arrival procedure details.

Parameters

NameTypeDefault 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

Defined in

src/sdk/flightplan/FlightPlan.ts:1501


setCalculatingLeg

setCalculatingLeg(globalLegIndex, notify?): void

Sets the active calculating leg index in the flight plan.

Parameters

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

Returns

void

Defined in

src/sdk/flightplan/FlightPlan.ts:1159


setDeparture

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

Sets the departure procedure details.

Parameters

NameTypeDefault 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

Defined in

src/sdk/flightplan/FlightPlan.ts:1481


setDestinationAirport

setDestinationAirport(facilityIcao, notify?): void

Sets the destination airport in the flight plan.

Parameters

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

Returns

void

Defined in

src/sdk/flightplan/FlightPlan.ts:1058


setDestinationRunway

setDestinationRunway(runway?, notify?): void

Sets the destination runway in procedure details.

Parameters

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

Returns

void

Defined in

src/sdk/flightplan/FlightPlan.ts:1465


setDirectToData

setDirectToData(globalLegIndex, notify?): void

Sets the direct to data for this plan.

Parameters

NameTypeDescription
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

Defined in

src/sdk/flightplan/FlightPlan.ts:1210

setDirectToData(segmentIndex, segmentLegIndex, notify?): void

Sets the direct to data for this plan.

Parameters

NameTypeDescription
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

Defined in

src/sdk/flightplan/FlightPlan.ts:1218

setDirectToData(leg, notify?): void

Sets the direct to data for this plan.

Parameters

NameTypeDescription
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

Defined in

src/sdk/flightplan/FlightPlan.ts:1224


setLateralLeg

setLateralLeg(globalLegIndex, notify?): void

Sets the active lateral leg index in the flight plan.

Parameters

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

Returns

void

Defined in

src/sdk/flightplan/FlightPlan.ts:1087


setLegUserData

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

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

Name
T

Parameters

NameTypeDescription
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

Defined in

src/sdk/flightplan/FlightPlan.ts:1355

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

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

Name
T

Parameters

NameTypeDescription
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

Defined in

src/sdk/flightplan/FlightPlan.ts:1364


setLegVerticalData

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

Sets the vertical data for this plan leg.

Parameters

NameTypeDescription
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

Defined in

src/sdk/flightplan/FlightPlan.ts:1264

setLegVerticalData(globalLegIndex, verticalData, notify?): void

Sets the vertical data for this plan leg.

Parameters

NameTypeDescription
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

Defined in

src/sdk/flightplan/FlightPlan.ts:1271


setOriginAirport

setOriginAirport(facilityIcao, notify?): void

Sets the origin airport in the flight plan.

Parameters

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

Returns

void

Defined in

src/sdk/flightplan/FlightPlan.ts:1032


setOriginRunway

setOriginRunway(runway?, notify?): void

Sets the origin runway in procedure details.

Parameters

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

Returns

void

Defined in

src/sdk/flightplan/FlightPlan.ts:1452


setProcedureDetails

setProcedureDetails(details, notify?): void

Sets the flight plan procedure details.

Parameters

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

Returns

void

Defined in

src/sdk/flightplan/FlightPlan.ts:1195


setUserData

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

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

Name
T

Parameters

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

Returns

void

Defined in

src/sdk/flightplan/FlightPlan.ts:1324


setVerticalLeg

setVerticalLeg(globalLegIndex, notify?): void

Sets the active lateral leg index in the flight plan.

Parameters

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

Returns

void

Defined in

src/sdk/flightplan/FlightPlan.ts:1123


tryGetLeg

tryGetLeg(segmentIndex, segmentLegIndex): null | LegDefinition

Attempts to get a leg from the flight plan.

Parameters

NameTypeDescription
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.

Defined in

src/sdk/flightplan/FlightPlan.ts:478

tryGetLeg(globalLegIndex): null | LegDefinition

Attempts to get a leg from the flight plan.

Parameters

NameTypeDescription
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.

Defined in

src/sdk/flightplan/FlightPlan.ts:484


tryGetSegment

tryGetSegment(segmentIndex?): null | FlightPlanSegment

Attempts to get a flight plan segment from the plan.

Parameters

NameTypeDescription
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.

Defined in

src/sdk/flightplan/FlightPlan.ts:420


createLeg

createLeg(partial): FlightPlanLeg

Creates a default instance of a flight plan leg.

Parameters

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

Returns

FlightPlanLeg

A default instance of a flight plan leg.

Defined in

src/sdk/flightplan/FlightPlan.ts:1683