Skip to main content

Class: FlightPlannerFlightPlanDataArray

An implementation of FlightPlanDataArray that sources flight plan data from a flight planner. The flight planner and flight plan from which data is sourced can be changed freely.

Hierarchy

  • AbstractSubscribableArray<Readonly<FlightPlanDataItem>>

    FlightPlannerFlightPlanDataArray

Implements

Constructors

constructor

new FlightPlannerFlightPlanDataArray(dataFieldFactory, dataFieldCalculatorRepo, options?): FlightPlannerFlightPlanDataArray

Creates a new instance of FlightPlannerFlightPlanDataArray. Upon creation, the array is paused and has a null flight plan source, the 'Add Waypoint' data item is flagged as hidden, and all data fields are cleared.

Parameters

NameTypeDescription
dataFieldFactoryFlightPlanDataFieldFactoryThe factory used to create flight plan data fields for this array.
dataFieldCalculatorRepoFlightPlanDataFieldCalculatorRepoThe repository used by this array to retrieve calculators for flight plan data fields.
options?Readonly<FlightPlannerFlightPlanDataArrayOptions>Options with which to configure this array.

Returns

FlightPlannerFlightPlanDataArray

Overrides

AbstractSubscribableArray\<Readonly\<FlightPlanDataItem\>\>.constructor

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:109

Properties

cumulativeDataFields

Readonly cumulativeDataFields: readonly Subscribable<null | FlightPlanDataField<FlightPlanDataFieldType>>[]

The data fields representing cumulative total values over this array's entire flight plan.

Implementation of

FlightPlanDataArray.cumulativeDataFields

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:96


fromLegIndex

Readonly fromLegIndex: Subscribable<number>

The index of the data item associated with the FROM flight plan leg, or -1 if there is no such leg.

Implementation of

FlightPlanDataArray.fromLegIndex

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:88


initialNotifyFunc

Protected Readonly initialNotifyFunc: (sub: HandlerSubscription<SubscribableArrayHandler<Readonly<FlightPlanDataItem>>>) => void

A function which sends initial notifications to subscriptions.

Type declaration

▸ (sub): void

A function which sends initial notifications to subscriptions.

Parameters
NameType
subHandlerSubscription<SubscribableArrayHandler<Readonly<FlightPlanDataItem>>>
Returns

void

Inherited from

AbstractSubscribableArray.initialNotifyFunc

Defined in

src/sdk/sub/AbstractSubscribableArray.ts:20


notifyDepth

Protected notifyDepth: number = 0

Inherited from

AbstractSubscribableArray.notifyDepth

Defined in

src/sdk/sub/AbstractSubscribableArray.ts:17


onSubDestroyedFunc

Protected Readonly onSubDestroyedFunc: (sub: HandlerSubscription<SubscribableArrayHandler<Readonly<FlightPlanDataItem>>>) => void

A function which responds to when a subscription to this subscribable is destroyed.

Type declaration

▸ (sub): void

A function which responds to when a subscription to this subscribable is destroyed.

Parameters
NameType
subHandlerSubscription<SubscribableArrayHandler<Readonly<FlightPlanDataItem>>>
Returns

void

Inherited from

AbstractSubscribableArray.onSubDestroyedFunc

Defined in

src/sdk/sub/AbstractSubscribableArray.ts:23


singletonSub

Protected Optional singletonSub: HandlerSubscription<SubscribableArrayHandler<Readonly<FlightPlanDataItem>>>

Inherited from

AbstractSubscribableArray.singletonSub

Defined in

src/sdk/sub/AbstractSubscribableArray.ts:14


subs

Protected Optional subs: HandlerSubscription<SubscribableArrayHandler<Readonly<FlightPlanDataItem>>>[]

Inherited from

AbstractSubscribableArray.subs

Defined in

src/sdk/sub/AbstractSubscribableArray.ts:16


toLegIndex

Readonly toLegIndex: Subscribable<number>

The index of the data item associated with the TO flight plan leg, or -1 if there is no such leg.

Implementation of

FlightPlanDataArray.toLegIndex

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:92

Accessors

length

get length(): number

The length of this array.

Returns

number

Implementation of

FlightPlanDataArray.length

Overrides

AbstractSubscribableArray.length

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:82

Methods

addSubscription

addSubscription(sub): void

Adds a subscription to this array.

Parameters

NameTypeDescription
subHandlerSubscription<SubscribableArrayHandler<Readonly<FlightPlanDataItem>>>The subscription to add.

Returns

void

Inherited from

AbstractSubscribableArray.addSubscription

Defined in

src/sdk/sub/AbstractSubscribableArray.ts:29


calculateDataFields

calculateDataFields(): void

Calculates this array's flight plan data fields. This method does nothing if this array is paused.

Returns

void

Throws

Error if this array has been destroyed.

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:260


destroy

destroy(): void

Destroys this array. Once destroyed, this array can no longer be manipulated and any further changes in the source flight plan will not be reflected in the array.

Returns

void

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:807


get

get(index): Readonly<FlightPlanDataItem>

Gets an item from the array.

Parameters

NameTypeDescription
indexnumberThex index of the item to get.

Returns

Readonly<FlightPlanDataItem>

An item.

Throws

Implementation of

FlightPlanDataArray.get

Inherited from

AbstractSubscribableArray.get

Defined in

src/sdk/sub/AbstractSubscribableArray.ts:77


getArray

getArray(): readonly Readonly<FlightPlanDataItem>[]

Gets a read-only version of this array.

Returns

readonly Readonly<FlightPlanDataItem>[]

a read-only version of this array.

Implementation of

FlightPlanDataArray.getArray

Overrides

AbstractSubscribableArray.getArray

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:126


initialNotify

initialNotify(sub): void

Notifies a subscription of this array's current state.

Parameters

NameTypeDescription
subHandlerSubscription<SubscribableArrayHandler<Readonly<FlightPlanDataItem>>>The subscription to notify.

Returns

void

Inherited from

AbstractSubscribableArray.initialNotify

Defined in

src/sdk/sub/AbstractSubscribableArray.ts:176


notify

notify(index, type, modifiedItem?): void

Notifies subscriptions of a change in the array.

Parameters

NameTypeDescription
indexnumberThe index that was changed.
typeSubscribableArrayEventTypeThe type of subject event.
modifiedItem?Readonly<FlightPlanDataItem> | readonly Readonly<FlightPlanDataItem>[]The item modified by the operation.

Returns

void

Inherited from

AbstractSubscribableArray.notify

Defined in

src/sdk/sub/AbstractSubscribableArray.ts:100


onSubDestroyed

onSubDestroyed(sub): void

Responds to when a subscription to this array is destroyed.

Parameters

NameTypeDescription
subHandlerSubscription<SubscribableArrayHandler<Readonly<FlightPlanDataItem>>>The destroyed subscription.

Returns

void

Inherited from

AbstractSubscribableArray.onSubDestroyed

Defined in

src/sdk/sub/AbstractSubscribableArray.ts:185


pause

pause(): void

Pauses this array. When this array is paused, it will not re-calculate its data fields when its source flight plan is changed or calculated. In addition, calling calculateDataFields() has no effect when the array is paused.

Returns

void

Throws

Error if this array has been destroyed.

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:152


resume

resume(): void

Resumes this array. When this array is resumed, it will automatically re-calculate its data fields when its source flight plan is changed or calculated.

Returns

void

Throws

Error if this array has been destroyed.

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:135


setAddWaypointItemVisible

setAddWaypointItemVisible(visible): void

Sets whether the 'Add Waypoint' data item at the end of this array should be flagged as visible.

Parameters

NameTypeDescription
visiblebooleanWhether the 'Add Waypoint' data item should be flagged as visible.

Returns

void

Throws

Error if this array has been destroyed.

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:206


setDataFieldType

setDataFieldType(index, type): void

Sets the type of one of this array's flight plan data fields.

Parameters

NameTypeDescription
indexnumberThe index of the data field to change.
typenull | FlightPlanDataFieldTypeThe data field type to set, or null to clear the data field.

Returns

void

Throws

Error if this array has been destroyed.

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:220


setFlightPlan

setFlightPlan(isExternal, flightPlanner, index?): void

Sets the flight plan from which this array sources data.

Parameters

NameTypeDefault valueDescription
isExternalbooleanundefinedWhether the new source flight plan is an external flight plan.
flightPlannernull | FlightPlanner<any>undefinedThe flight planner containing the source flight plan. If null is specified instead, then the array will behave as if it were sourcing data from an empty flight plan.
indexnumber0The index of the source flight plan in its flight planner. Ignored if flightPlanner is null.

Returns

void

Throws

Error if this array has been destroyed.

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:174


sub

sub(handler, initialNotify?, paused?): Subscription

Subscribes to changes in this array's state.

Parameters

NameTypeDefault valueDescription
handlerSubscribableArrayHandler<Readonly<FlightPlanDataItem>>undefinedA function which is called when this array's state changes.
initialNotifybooleanfalseWhether to immediately invoke the callback function with this array's current state. Defaults to false. This argument is ignored if the subscription is initialized as paused.
pausedbooleanfalseWhether the new subscription should be initialized as paused. Defaults to false.

Returns

Subscription

The new subscription.

Implementation of

FlightPlanDataArray.sub

Inherited from

AbstractSubscribableArray.sub

Defined in

src/sdk/sub/AbstractSubscribableArray.ts:41


tryGet

tryGet(index): undefined | Readonly<FlightPlanDataItem>

Tries to get the value from the array.

Parameters

NameTypeDescription
indexnumberThe index of the item to get.

Returns

undefined | Readonly<FlightPlanDataItem>

The value or undefined if not found.

Implementation of

FlightPlanDataArray.tryGet

Inherited from

AbstractSubscribableArray.tryGet

Defined in

src/sdk/sub/AbstractSubscribableArray.ts:90


unsub

unsub(handler): void

Unsubscribes a callback function from this array.

Parameters

NameTypeDescription
handlerSubscribableArrayHandler<Readonly<FlightPlanDataItem>>The function to unsubscribe.

Returns

void

Deprecated

This method has been deprecated in favor of using the Subscription object returned by .sub() to manage subscriptions.

Implementation of

FlightPlanDataArray.unsub

Inherited from

AbstractSubscribableArray.unsub

Defined in

src/sdk/sub/AbstractSubscribableArray.ts:56