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
Parameter | 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 ) => undefined | string | A 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
Parameter | 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.
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
Parameter | 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.
calculate()
calculate(
globalLegIndex?
,notify?
):Promise
<void
>
Defined in: src/sdk/flightplan/FlightPlan.ts:1539
Calculates the flight path for the plan.
Parameters
Parameter | 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
>
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
Parameter | 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
copy()
copy(
planIndex?
,copyCalcs?
):FlightPlan
Defined in: src/sdk/flightplan/FlightPlan.ts:1573
Copies the flight plan.
Parameters
Parameter | 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
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
Parameter | 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
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
Parameter | 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
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
Parameter | 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
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
Parameter | 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
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
Parameter | Type | Default value | Description |
---|---|---|---|
key | string | undefined | The key to delete. |
notify | boolean | true | Whether 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
Parameter | Type | Default value | Description |
---|---|---|---|
predicate | (leg , segment , segmentIndex , segmentLegIndex , plan ) => 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.
getBatchStack()
getBatchStack():
undefined
| readonlyReadonly
<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
Parameter | 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.
Call Signature
getLeg(
globalLegIndex
):LegDefinition
Defined in: src/sdk/flightplan/FlightPlan.ts:460
Gets a leg from the flight plan.
Parameters
Parameter | 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.
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
Parameter | 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.
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
Parameter | 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.
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
Parameter | 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.
getSegment()
getSegment(
segmentIndex?
):FlightPlanSegment
Defined in: src/sdk/flightplan/FlightPlan.ts:405
Gets a flight plan segment from the plan.
Parameters
Parameter | 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.
getSegmentFromLeg()
getSegmentFromLeg(
leg
):null
|FlightPlanSegment
Defined in: src/sdk/flightplan/FlightPlan.ts:535
Gets the flight plan segment to which a leg belongs.
Parameters
Parameter | 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.
getSegmentIndex()
getSegmentIndex(
globalLegIndex
):number
Defined in: src/sdk/flightplan/FlightPlan.ts:550
Gets the segment index for a given global leg index.
Parameters
Parameter | 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.
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
Parameter | 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.
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
Parameter | Type | Description |
---|---|---|
key | string | The 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
Parameter | 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.
legs()
legs(
reverse
,startIndex?
,endIndex?
):Generator
<LegDefinition
,void
>
Defined in: src/sdk/flightplan/FlightPlan.ts:315
Gets this flight plan's legs.
Parameters
Parameter | 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
>
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
Parameter | Type | Description |
---|---|---|
name? | string | The 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
Parameter | Type | Default value | Description |
---|---|---|---|
notify | boolean | true | Whether 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
Parameter | 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.
removeOriginAirport()
removeOriginAirport(
notify
):void
Defined in: src/sdk/flightplan/FlightPlan.ts:1041
Removes the origin airport from the flight plan.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
notify | boolean | true | Whether 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
Parameter | 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
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
Parameter | Type | Description |
---|---|---|
segmentType | FlightPlanSegmentType | The 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
Parameter | 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
setApproach()
setApproach(
facilityIcao
,approachIndex
,approachTransitionIndex
,notify
):void
Defined in: src/sdk/flightplan/FlightPlan.ts:1523
Sets the approach procedure details.
Parameters
Parameter | 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
setArrival()
setArrival(
facilityIcao
,arrivalIndex
,arrivalTransitionIndex
,arrivalRunwayTransitionIndex
,arrivalRunway
,notify
):void
Defined in: src/sdk/flightplan/FlightPlan.ts:1501
Sets the arrival procedure details.
Parameters
Parameter | 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
setCalculatingLeg()
setCalculatingLeg(
globalLegIndex
,notify
):void
Defined in: src/sdk/flightplan/FlightPlan.ts:1159
Sets the active calculating leg index in the flight plan.
Parameters
Parameter | 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
setDeparture()
setDeparture(
facilityIcao
,departureIndex
,departureTransitionIndex
,departureRunwayIndex
,notify
):void
Defined in: src/sdk/flightplan/FlightPlan.ts:1481
Sets the departure procedure details.
Parameters
Parameter | 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
setDestinationAirport()
setDestinationAirport(
facilityIcao
,notify
):void
Defined in: src/sdk/flightplan/FlightPlan.ts:1058
Sets the destination airport in the flight plan.
Parameters
Parameter | 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
setDestinationRunway()
setDestinationRunway(
runway
,notify
):void
Defined in: src/sdk/flightplan/FlightPlan.ts:1465
Sets the destination runway in procedure details.
Parameters
Parameter | 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
setDirectToData()
Call Signature
setDirectToData(
globalLegIndex
,notify?
):void
Defined in: src/sdk/flightplan/FlightPlan.ts:1210
Sets the direct to data for this plan.
Parameters
Parameter | 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
Call Signature
setDirectToData(
segmentIndex
,segmentLegIndex
,notify?
):void
Defined in: src/sdk/flightplan/FlightPlan.ts:1218
Sets the direct to data for this plan.
Parameters
Parameter | 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
Call Signature
setDirectToData(
leg
,notify?
):void
Defined in: src/sdk/flightplan/FlightPlan.ts:1224
Sets the direct to data for this plan.
Parameters
Parameter | 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
setLateralLeg()
setLateralLeg(
globalLegIndex
,notify
):void
Defined in: src/sdk/flightplan/FlightPlan.ts:1087
Sets the active lateral leg index in the flight plan.
Parameters
Parameter | 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
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
Parameter | 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
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
Parameter | 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
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
Parameter | 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
Call Signature
setLegVerticalData(
globalLegIndex
,verticalData
,notify?
):void
Defined in: src/sdk/flightplan/FlightPlan.ts:1271
Sets the vertical data for this plan leg.
Parameters
Parameter | 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
setOriginAirport()
setOriginAirport(
facilityIcao
,notify
):void
Defined in: src/sdk/flightplan/FlightPlan.ts:1032
Sets the origin airport in the flight plan.
Parameters
Parameter | 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
setOriginRunway()
setOriginRunway(
runway
,notify
):void
Defined in: src/sdk/flightplan/FlightPlan.ts:1452
Sets the origin runway in procedure details.
Parameters
Parameter | 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
setProcedureDetails()
setProcedureDetails(
details
,notify
):void
Defined in: src/sdk/flightplan/FlightPlan.ts:1195
Sets the flight plan procedure details.
Parameters
Parameter | 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
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
Parameter | 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
setVerticalLeg()
setVerticalLeg(
globalLegIndex
,notify
):void
Defined in: src/sdk/flightplan/FlightPlan.ts:1123
Sets the active lateral leg index in the flight plan.
Parameters
Parameter | 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
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
Parameter | 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.
Call Signature
tryGetLeg(
globalLegIndex
):null
|LegDefinition
Defined in: src/sdk/flightplan/FlightPlan.ts:484
Attempts to get a leg from the flight plan.
Parameters
Parameter | 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.
tryGetSegment()
tryGetSegment(
segmentIndex?
):null
|FlightPlanSegment
Defined in: src/sdk/flightplan/FlightPlan.ts:420
Attempts to get a flight plan segment from the plan.
Parameters
Parameter | 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.
createLeg()
static
createLeg(partial
):FlightPlanLeg
Defined in: src/sdk/flightplan/FlightPlan.ts:1683
Creates a default instance of a flight plan leg.
Parameters
Parameter | Type | Description |
---|---|---|
partial | Partial <FlightPlanLeg > | A portion of leg options to apply. |
Returns
A default instance of a flight plan leg.