Skip to main content

Interface: FlightPlanPredictionsProvider

Defined in: src/sdk/utils/predictions/FlightPlanPredictionProvider.ts:130

Interface for a system providing performance predictions for a flight plan and optional arbitrary facility entries

Properties

onPredictionsUpdated

readonly onPredictionsUpdated: SubEventInterface<FlightPlanPredictionsProvider, void>

Defined in: src/sdk/utils/predictions/FlightPlanPredictionProvider.ts:239

Fires when any predictions have been updated.

Methods

getDestinationPredictions()

getDestinationPredictions(): undefined | Readonly<Predictions<GeoPoint>>

Defined in: src/sdk/utils/predictions/FlightPlanPredictionProvider.ts:164

Returns predictions for the MAP leg, or the last leg of the flight plan (with great circle distance to the destination added) if one does not exist

Note: The object reference returned by this method is not safe to keep around or mutate.

Returns

undefined | Readonly<Predictions<GeoPoint>>

a Predictions object


getPredictionsForAltitude()

getPredictionsForAltitude(altitude, predictActiveLeg?): undefined | Readonly<Predictions<GeoPoint>>

Defined in: src/sdk/utils/predictions/FlightPlanPredictionProvider.ts:220

Returns a prediction at the point at which the given altitude will be reached

Note: The object reference returned by this method is not safe to keep around or mutate.

Parameters

ParameterTypeDescription
altitudenumberthe altitude used to predict the time, in metres
predictActiveLeg?booleanWhether to use the current aircraft state to predict the active leg. Defaults to false.

Returns

undefined | Readonly<Predictions<GeoPoint>>

a Predictions object, or undefined if no prediction is available (for example, if the altitude will never be reached)


getPredictionsForDistance()

getPredictionsForDistance(distance, predictActiveLeg?): undefined | Readonly<Predictions<GeoPoint>>

Defined in: src/sdk/utils/predictions/FlightPlanPredictionProvider.ts:234

Returns a prediction at the point at which the given distance (along track from aircraft present position) will be reached

Note: The object reference returned by this method is not safe to keep around or mutate.

Parameters

ParameterTypeDescription
distancenumberthe distance used to predict the time, in metres
predictActiveLeg?booleanWhether to use the current aircraft state to predict the active leg. Defaults to false.

Returns

undefined | Readonly<Predictions<GeoPoint>>

a Predictions object, or undefined if no prediction is available (for example, if the distance will never be reached)


getPredictionsForLeg()

getPredictionsForLeg(globalLegIndex): undefined | Readonly<Predictions<GeoPoint>>

Defined in: src/sdk/utils/predictions/FlightPlanPredictionProvider.ts:154

Returns predictions for a leg located at a given global index

Note: The object reference returned by this method is not safe to keep around or mutate.

Parameters

ParameterTypeDescription
globalLegIndexnumberthe global leg index

Returns

undefined | Readonly<Predictions<GeoPoint>>

a Predictions object


getPredictionsForTime()

getPredictionsForTime(time, predictActiveLeg?): undefined | Readonly<Predictions<GeoPoint>>

Defined in: src/sdk/utils/predictions/FlightPlanPredictionProvider.ts:206

Returns a prediction at the point at which the given time will be reached

Note: The object reference returned by this method is not safe to keep around or mutate.

Parameters

ParameterTypeDescription
timenumberthe time used to predict the distance, in UNIX timestamp seconds.
predictActiveLeg?booleanWhether to use the current aircraft state to predict the active leg. Defaults to false.

Returns

undefined | Readonly<Predictions<GeoPoint>>

a Predictions object, or undefined if no prediction is available (for example, if the time will never be reached)


getPredictionsForTrackedFacility()

getPredictionsForTrackedFacility(id): undefined | Readonly<Predictions<GeoPoint>>

Defined in: src/sdk/utils/predictions/FlightPlanPredictionProvider.ts:175

Returns predictions for an already tracked arbitrary facility

Note: The object reference returned by this method is not safe to keep around or mutate.

Parameters

ParameterTypeDescription
idstringthe tracking entry's unique ID

Returns

undefined | Readonly<Predictions<GeoPoint>>

a Predictions object


iteratePredictions()

iteratePredictions(startGlobalLegIndex?): Generator<undefined | Predictions<GeoPoint>, void, unknown>

Defined in: src/sdk/utils/predictions/FlightPlanPredictionProvider.ts:136

Returns a predictions generator starting at the provided leg index

Parameters

ParameterTypeDescription
startGlobalLegIndex?numberthe leg index at which to start producing predictions at (defaults to 0)

Returns

Generator<undefined | Predictions<GeoPoint>, void, unknown>


iteratePredictionsReverse()

iteratePredictionsReverse(startGlobalLegIndex?): Generator<undefined | Predictions<GeoPoint>, void, unknown>

Defined in: src/sdk/utils/predictions/FlightPlanPredictionProvider.ts:143

Returns a predictions generator starting at the provided leg index, going backwards

Parameters

ParameterTypeDescription
startGlobalLegIndex?numberthe leg index at which to start producing predictions at (defaults to plan.length - 1)

Returns

Generator<undefined | Predictions<GeoPoint>, void, unknown>


startTrackingFacility()

startTrackingFacility(id, entry): void

Defined in: src/sdk/utils/predictions/FlightPlanPredictionProvider.ts:183

Starts tracking an arbitrary facility

Parameters

ParameterTypeDescription
idstringa unique ID to retrieve predictions with
entryFacilityPredictionsTrackingEntrythe facility tracking entry object

Returns

void


stopTrackingFacility()

stopTrackingFacility(id): boolean

Defined in: src/sdk/utils/predictions/FlightPlanPredictionProvider.ts:192

Stops tracking an arbitrary facility

Parameters

ParameterTypeDescription
idstringthe tracking entry's unique ID

Returns

boolean

whether any tracking entry was removed