Class: FlightPlannerFlightPlanDataArray
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:46
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.
Extends
AbstractSubscribableArray
<Readonly
<FlightPlanDataItem
>>
Implements
Constructors
Constructor
new FlightPlannerFlightPlanDataArray(
dataFieldFactory
,dataFieldCalculatorRepo
,options?
):FlightPlannerFlightPlanDataArray
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:109
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
Parameter | Type | Description |
---|---|---|
dataFieldFactory | FlightPlanDataFieldFactory | The factory used to create flight plan data fields for this array. |
dataFieldCalculatorRepo | FlightPlanDataFieldCalculatorRepo | The 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
Properties
cumulativeDataFields
readonly
cumulativeDataFields: readonlySubscribable
<null
|FlightPlanDataField
<FlightPlanDataFieldType
>>[]
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:96
The data fields representing cumulative total values over this array's entire flight plan.
Implementation of
FlightPlanDataArray
.cumulativeDataFields
fromLegIndex
readonly
fromLegIndex:Subscribable
<number
>
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:88
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
initialNotifyFunc()
protected
readonly
initialNotifyFunc: (sub
) =>void
Defined in: src/sdk/sub/AbstractSubscribableArray.ts:20
A function which sends initial notifications to subscriptions.
Notifies a subscription of this array's current state.
Parameters
Parameter | Type | Description |
---|---|---|
sub | HandlerSubscription <SubscribableArrayHandler <Readonly <FlightPlanDataItem >>> | The subscription to notify. |
Returns
void
Inherited from
AbstractSubscribableArray.initialNotifyFunc
notifyDepth
protected
notifyDepth:number
=0
Defined in: src/sdk/sub/AbstractSubscribableArray.ts:17
Inherited from
AbstractSubscribableArray.notifyDepth
onSubDestroyedFunc()
protected
readonly
onSubDestroyedFunc: (sub
) =>void
Defined in: src/sdk/sub/AbstractSubscribableArray.ts:23
A function which responds to when a subscription to this subscribable is destroyed.
Responds to when a subscription to this array is destroyed.
Parameters
Parameter | Type | Description |
---|---|---|
sub | HandlerSubscription <SubscribableArrayHandler <Readonly <FlightPlanDataItem >>> | The destroyed subscription. |
Returns
void
Inherited from
AbstractSubscribableArray.onSubDestroyedFunc
singletonSub?
protected
optional
singletonSub:HandlerSubscription
<SubscribableArrayHandler
<Readonly
<FlightPlanDataItem
>>>
Defined in: src/sdk/sub/AbstractSubscribableArray.ts:14
Inherited from
AbstractSubscribableArray.singletonSub
subs?
protected
optional
subs:HandlerSubscription
<SubscribableArrayHandler
<Readonly
<FlightPlanDataItem
>>>[]
Defined in: src/sdk/sub/AbstractSubscribableArray.ts:16
Inherited from
AbstractSubscribableArray.subs
toLegIndex
readonly
toLegIndex:Subscribable
<number
>
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:92
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
Accessors
length
Get Signature
get length():
number
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:82
The length of this array.
Returns
number
The length of this array.
Implementation of
Overrides
AbstractSubscribableArray.length
Methods
addSubscription()
protected
addSubscription(sub
):void
Defined in: src/sdk/sub/AbstractSubscribableArray.ts:29
Adds a subscription to this array.
Parameters
Parameter | Type | Description |
---|---|---|
sub | HandlerSubscription <SubscribableArrayHandler <Readonly <FlightPlanDataItem >>> | The subscription to add. |
Returns
void
Inherited from
AbstractSubscribableArray.addSubscription
calculateDataFields()
calculateDataFields():
void
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:262
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.
destroy()
destroy():
void
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:811
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
get()
get(
index
):Readonly
Defined in: src/sdk/sub/AbstractSubscribableArray.ts:77
Gets an item from the array.
Parameters
Parameter | Type | Description |
---|---|---|
index | number | Thex index of the item to get. |
Returns
Readonly
An item.
Throws
Implementation of
Inherited from
AbstractSubscribableArray.get
getArray()
getArray(): readonly
Readonly
<FlightPlanDataItem
>[]
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:126
Gets a read-only version of this array.
Returns
readonly Readonly
<FlightPlanDataItem
>[]
a read-only version of this array.
Implementation of
Overrides
AbstractSubscribableArray.getArray
initialNotify()
protected
initialNotify(sub
):void
Defined in: src/sdk/sub/AbstractSubscribableArray.ts:176
Notifies a subscription of this array's current state.
Parameters
Parameter | Type | Description |
---|---|---|
sub | HandlerSubscription <SubscribableArrayHandler <Readonly <FlightPlanDataItem >>> | The subscription to notify. |
Returns
void
Inherited from
AbstractSubscribableArray.initialNotify
notify()
protected
notify(index
,type
,modifiedItem?
):void
Defined in: src/sdk/sub/AbstractSubscribableArray.ts:100
Notifies subscriptions of a change in the array.
Parameters
Parameter | Type | Description |
---|---|---|
index | number | The index that was changed. |
type | SubscribableArrayEventType | The type of subject event. |
modifiedItem? | Readonly <FlightPlanDataItem > | readonly Readonly <FlightPlanDataItem >[] | The item modified by the operation. |
Returns
void
Inherited from
AbstractSubscribableArray.notify
onSubDestroyed()
protected
onSubDestroyed(sub
):void
Defined in: src/sdk/sub/AbstractSubscribableArray.ts:185
Responds to when a subscription to this array is destroyed.
Parameters
Parameter | Type | Description |
---|---|---|
sub | HandlerSubscription <SubscribableArrayHandler <Readonly <FlightPlanDataItem >>> | The destroyed subscription. |
Returns
void
Inherited from
AbstractSubscribableArray.onSubDestroyed
pause()
pause():
void
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:152
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.
resume()
resume():
void
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:135
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.
setAddWaypointItemVisible()
setAddWaypointItemVisible(
visible
):void
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:208
Sets whether the 'Add Waypoint' data item at the end of this array should be flagged as visible.
Parameters
Parameter | Type | Description |
---|---|---|
visible | boolean | Whether the 'Add Waypoint' data item should be flagged as visible. |
Returns
void
Throws
Error if this array has been destroyed.
setDataFieldType()
setDataFieldType(
index
,type
):void
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:222
Sets the type of one of this array's flight plan data fields.
Parameters
Parameter | Type | Description |
---|---|---|
index | number | The index of the data field to change. |
type | null | FlightPlanDataFieldType | The data field type to set, or null to clear the data field. |
Returns
void
Throws
Error if this array has been destroyed.
setFlightPlan()
setFlightPlan(
isExternal
,flightPlanner
,index
):void
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/FlightPlan/FlightPlannerFlightPlanDataArray.ts:174
Sets the flight plan from which this array sources data.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
isExternal | boolean | undefined | Whether the new source flight plan is an external flight plan. |
flightPlanner | null | FlightPlanner <any > | undefined | The 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. |
index | number | 0 | The 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.
sub()
sub(
handler
,initialNotify
,paused
):Subscription
Defined in: src/sdk/sub/AbstractSubscribableArray.ts:41
Subscribes to changes in this array's state.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
handler | SubscribableArrayHandler <Readonly <FlightPlanDataItem >> | undefined | A function which is called when this array's state changes. |
initialNotify | boolean | false | Whether 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. |
paused | boolean | false | Whether the new subscription should be initialized as paused. Defaults to false . |
Returns
Subscription
The new subscription.
Implementation of
Inherited from
AbstractSubscribableArray.sub
tryGet()
tryGet(
index
):undefined
|Readonly
<FlightPlanDataItem
>
Defined in: src/sdk/sub/AbstractSubscribableArray.ts:90
Tries to get the value from the array.
Parameters
Parameter | Type | Description |
---|---|---|
index | number | The index of the item to get. |
Returns
undefined
| Readonly
<FlightPlanDataItem
>
The value or undefined if not found.
Implementation of
Inherited from
AbstractSubscribableArray.tryGet
unsub()
unsub(
handler
):void
Defined in: src/sdk/sub/AbstractSubscribableArray.ts:56
Unsubscribes a callback function from this array.
Parameters
Parameter | Type | Description |
---|---|---|
handler | SubscribableArrayHandler <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
Inherited from
AbstractSubscribableArray.unsub