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
Name | Type | Description |
---|---|---|
planIndex | number | The index within the flight planner of this flight plan. |
calculator | FlightPathCalculator | The flight path calculator to use to calculate the flight path. |
onLegNameRequested | (leg : FlightPlanLeg ) => undefined | string | A callback fired when a flight plan leg is to be named. |
Returns
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
Name | Type | Default value | Description |
---|---|---|---|
segmentIndex | number | undefined | The segment to add the leg to. |
leg | FlightPlanLeg | undefined | The leg to add to the plan. |
segmentLegIndex? | number | undefined | The index of the leg in the segment to insert. Will add to the end of the segment if omitted. |
flags | number | 0 | Leg definition flags to apply to the new leg. Defaults to None (0). |
notify | boolean | true | Whether or not to send notifications after the operation. |
Returns
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
Name | Type | Default value | Description |
---|---|---|---|
segmentIndex | number | undefined | The index of the flight plan segment. |
segmentType | FlightPlanSegmentType | FlightPlanSegmentType.Enroute | The type of segment this will be. |
airway? | string | undefined | The airway this segment is made up of, if any. |
notify | boolean | true | Whether or not to send notifications after the operation. |
Returns
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
Name | Type | Default value | Description |
---|---|---|---|
globalLegIndex? | number | undefined | The global leg index to start calculating from. |
notify | boolean | true | Whether 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
Name | Type | Description |
---|---|---|
uuid? | string | The 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
Name | Type | Default value | Description |
---|---|---|---|
planIndex? | number | undefined | The flight plan index to assign to this plan, or the same plan index if not provided. |
copyCalcs | boolean | false | Whether to copy leg calculations (defaults to false). |
Returns
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
Name | Type | Default value | Description |
---|---|---|---|
sourcePlan | FlightPlan | undefined | The plan to copy from. |
copyCalcs | boolean | false | Whether 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
Name | Type | Description |
---|---|---|
segmentIndex | number | The index of the segment containing the flight plan leg for which to delete the user data. |
segmentLegIndex | number | The index of the flight plan leg for which to delete the user data in its containing segment. |
key | string | The key to delete. |
notify? | boolean | Whether 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
Name | Type | Description |
---|---|---|
globalLegIndex | number | The global index of the flight plan leg for which to delete the user data. |
key | string | The key to delete. |
notify? | boolean | Whether 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
Name | Type | Default value | Description |
---|---|---|---|
segmentIndex | number | undefined | The index of the segment to remove. |
notify | boolean | true | Whether 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
Name | Type | Default value | Description |
---|---|---|---|
key | string | undefined | The key to delete. |
notify | boolean | true | Whether 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
Name | Type | Default value | Description |
---|---|---|---|
predicate | (leg : LegDefinition , segment : FlightPlanSegment , segmentIndex : number , segmentLegIndex : number , plan : FlightPlan ) => boolean | undefined | A 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. |
reverse | boolean | false | Whether to evaluate the legs in reverse order. Defaults to false . |
startIndex? | number | undefined | The 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? | number | undefined | The 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
Name | Type | Description |
---|---|---|
segmentIndex | number | The index of the segment containing the leg to get. |
segmentLegIndex | number | The index of the leg to get in its segment. |
Returns
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
Name | Type | Description |
---|---|---|
globalLegIndex | number | The global leg index of the leg to get. |
Returns
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
Name | Type | Description |
---|---|---|
leg | LegDefinition | A 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
Name | Type | Description |
---|---|---|
segmentIndex | number | A segment index. |
legIndex | number | A 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
Name | Type | Description |
---|---|---|
segmentIndex | number | A segment index. |
legIndex | number | A 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
Name | Type | Description |
---|---|---|
segmentIndex? | number | The index of the segment to get; if not specified returns the active segment. |
Returns
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
Name | Type | Description |
---|---|---|
leg | LegDefinition | A 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
Name | Type | Description |
---|---|---|
globalLegIndex | number | The 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
Name | Type | Description |
---|---|---|
globalLegIndex | number | The 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
Name | Type | Description |
---|---|---|
key | string | The 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
Name | Type | Default value | Description |
---|---|---|---|
segmentIndex | number | undefined | The index to insert the flight plan segment. |
segmentType | FlightPlanSegmentType | FlightPlanSegmentType.Enroute | The type of segment this will be. |
airway? | string | undefined | The airway this segment is made up of, if any |
notify | boolean | true | Whether or not to send notifications after the operation. |
Returns
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
Name | Type | Default value | Description |
---|---|---|---|
reverse | boolean | false | Whether to get the legs in reverse order. False by default. |
startIndex? | number | undefined | The 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? | number | undefined | The 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
Name | Type | Description |
---|---|---|
name? | string | The 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
Name | Type | Default value | Description |
---|---|---|---|
notify | boolean | true | Whether 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
Name | Type | Default value | Description |
---|---|---|---|
segmentIndex | number | undefined | The segment to add the leg to. |
segmentLegIndex? | number | undefined | The index of the leg in the segment to remove. Will remove from the end of the segment if ommitted. |
notify | boolean | true | Whether 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
Name | Type | Default value | Description |
---|---|---|---|
notify | boolean | true | Whether 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
Name | Type | Default value | Description |
---|---|---|---|
segmentIndex | number | undefined | The index of the segment to remove. |
notify | boolean | true | Whether 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
Name | Type | Description |
---|---|---|
segmentType | FlightPlanSegmentType | The 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
Name | Type | Default value | Description |
---|---|---|---|
segmentIndex | number | undefined | A segment index. |
airway? | string | undefined | The airway name. |
notify | boolean | true | is 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
Name | Type | Default value | Description |
---|---|---|---|
facilityIcao | undefined | string | undefined | The facility ICAO of the facility containing the procedure |
approachIndex | number | -1 | The index of the apporach in the destination airport information |
approachTransitionIndex | number | -1 | The index of the approach transition in the destination airport approach information |
notify | boolean | true | Whether 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
Name | Type | Default value | Description |
---|---|---|---|
facilityIcao | undefined | string | undefined | The facility ICAO of the facility containing the procedure |
arrivalIndex | number | -1 | The index of the arrival in the destination airport information |
arrivalTransitionIndex | number | -1 | index of the arrival transition in the destination airport arrival information |
arrivalRunwayTransitionIndex | number | -1 | The index of the selected runway transition at the destination airport arrival information |
arrivalRunway | undefined | OneWayRunway | undefined | The oneway runway to set as the arrival runway, or undefined |
notify | boolean | true | Whether 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
Name | Type | Default value | Description |
---|---|---|---|
globalLegIndex | number | undefined | The global leg index to set. |
notify | boolean | true | Whether 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
Name | Type | Default value | Description |
---|---|---|---|
facilityIcao | undefined | string | undefined | The facility ICAO of the facility containing the procedure |
departureIndex | number | -1 | The index of the departure in the origin airport information |
departureTransitionIndex | number | -1 | The index of the departure transition in the origin airport departure information |
departureRunwayIndex | number | -1 | The index of the selected runway in the original airport departure information |
notify | boolean | true | Whether 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
Name | Type | Default value | Description |
---|---|---|---|
facilityIcao | string | undefined | The destination airport to set. |
notify | boolean | true | Whether 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
Name | Type | Default value | Description |
---|---|---|---|
runway | undefined | OneWayRunway | undefined | The oneway runway to set as the destination, or undefined |
notify | boolean | true | Whether 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
Name | Type | Description |
---|---|---|
globalLegIndex | number | The global leg index of the direct to target, or -1 if the direct to data is to be cleared. |
notify? | boolean | Whether 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
Name | Type | Description |
---|---|---|
segmentIndex | number | The segment index of the direct to target, or -1 if the direct to data is to be cleared. |
segmentLegIndex | number | The segment leg index of the direct to target, or -1 if the direct to data is to be cleared. |
notify? | boolean | Whether 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
Name | Type | Description |
---|---|---|
leg | null | LegDefinition | The target leg of the direct to, or null if the direct to data is to be cleared. |
notify? | boolean | Whether 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
Name | Type | Default value | Description |
---|---|---|---|
globalLegIndex | number | undefined | The global leg index to set. |
notify | boolean | true | Whether 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
Name | Type | Description |
---|---|---|
segmentIndex | number | The index of the segment containing the flight plan leg for which to set the user data. |
segmentLegIndex | number | The index of the flight plan leg for which to set the user data in its containing segment. |
key | string | The key under which to set the user data. |
data | T | The user data to set under the key. |
notify? | boolean | Whether 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
Name | Type | Description |
---|---|---|
globalLegIndex | number | The global index of the flight plan leg for which to set the user data. |
key | string | The key under which to set the user data. |
data | T | The user data to set under the key. |
notify? | boolean | Whether 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
Name | Type | Description |
---|---|---|
segmentIndex | number | The segment index of the leg in the plan to add vertical data to. |
segmentLegIndex | number | The segment leg index of the leg in the plan to add vertical data to. cleared. |
verticalData | Partial <VerticalData > | The Vertical Data for this leg. |
notify? | boolean | Whether 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
Name | Type | Description |
---|---|---|
globalLegIndex | number | The global leg index in the plan for the leg to add vertical data to. |
verticalData | Partial <VerticalData > | The Vertical Data for this leg. |
notify? | boolean | Whether 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
Name | Type | Default value | Description |
---|---|---|---|
facilityIcao | string | undefined | The origin airport to set. |
notify | boolean | true | Whether 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
Name | Type | Default value | Description |
---|---|---|---|
runway | undefined | OneWayRunway | undefined | The oneway runway to set as the origin, or undefined |
notify | boolean | true | Whether 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
Name | Type | Default value | Description |
---|---|---|---|
details | Partial <ProcedureDetails > | undefined | The details of the flight plan's procedures. |
notify | boolean | true | Whether 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
Name | Type | Default value | Description |
---|---|---|---|
key | string | undefined | The key of the user data. |
data | T | undefined | The data to set. |
notify | boolean | true | Whether 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
Name | Type | Default value | Description |
---|---|---|---|
globalLegIndex | number | undefined | The global leg index to set. |
notify | boolean | true | Whether 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
Name | Type | Description |
---|---|---|
segmentIndex | number | The index of the segment containing the leg to get. |
segmentLegIndex | number | The 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
Name | Type | Description |
---|---|---|
globalLegIndex | number | The 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
Name | Type | Description |
---|---|---|
segmentIndex? | number | The 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
Name | Type | Description |
---|---|---|
partial | Partial <FlightPlanLeg > | A portion of leg options to apply. |
Returns
A default instance of a flight plan leg.
Defined in
src/sdk/flightplan/FlightPlan.ts:1683