Class: ActiveFlightPlanDataArray
An implementation of FlightPlanDataArray
that sources flight plan data from a flight planner's active flight plan.
The flight planner from which data is sourced can be changed freely.
Implements
Constructors
constructor
• new ActiveFlightPlanDataArray(dataFieldFactory
, dataFieldCalculatorRepo
, options?
): ActiveFlightPlanDataArray
Creates a new instance of ActiveFlightPlanDataArray. Upon creation, the array is paused and has a null flight planner source, the 'Add Waypoint' data item is flagged as hidden, and all data fields are cleared.
Parameters
Name | 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
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/FlightPlan/ActiveFlightPlanDataArray.ts:46
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/ActiveFlightPlanDataArray.ts:28
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/ActiveFlightPlanDataArray.ts:22
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/ActiveFlightPlanDataArray.ts:25
Accessors
length
• get
length(): number
The length of this array.
Returns
number
Implementation of
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/FlightPlan/ActiveFlightPlanDataArray.ts:31
Methods
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/ActiveFlightPlanDataArray.ts:183
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/ActiveFlightPlanDataArray.ts:207
get
▸ get(index
): FlightPlanDataItem
Retrieves an element from this array.
Parameters
Name | Type | Description |
---|---|---|
index | number | The index of the element. |
Returns
the element at the specified index.
Throws
Error if index is out of bounds.
Implementation of
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/FlightPlan/ActiveFlightPlanDataArray.ts:59
getArray
▸ getArray(): readonly FlightPlanDataItem
[]
Gets a read-only version of this array.
Returns
readonly FlightPlanDataItem
[]
a read-only version of this array.
Implementation of
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/FlightPlan/ActiveFlightPlanDataArray.ts:69
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/ActiveFlightPlanDataArray.ts:107
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/ActiveFlightPlanDataArray.ts:88
setAddWaypointItemVisible
▸ setAddWaypointItemVisible(visible
): void
Sets whether the 'Add Waypoint' data item at the end of this array should be flagged as visible.
Parameters
Name | 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.
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/FlightPlan/ActiveFlightPlanDataArray.ts:157
setDataFieldType
▸ setDataFieldType(index
, type
): void
Sets the type of one of this array's flight plan data fields.
Parameters
Name | 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.
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/FlightPlan/ActiveFlightPlanDataArray.ts:171
setFlightPlanner
▸ setFlightPlanner(isExternal
, flightPlanner
): void
Sets the flight plan from which this array sources data.
Parameters
Name | Type | Description |
---|---|---|
isExternal | boolean | Whether the new source flight plan is an external flight plan. |
flightPlanner | null | FlightPlanner <any > | 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. |
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/ActiveFlightPlanDataArray.ts:128
sub
▸ sub(handler
, initialNotify?
, paused?
): Subscription
Subscribes to changes in this array's state.
Parameters
Name | Type | Description |
---|---|---|
handler | SubscribableArrayHandler <FlightPlanDataItem > | A function which is called when this array's state changes. |
initialNotify? | boolean | 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 | Whether the new subscription should be initialized as paused. Defaults to false . |
Returns
Subscription
The new subscription.
Implementation of
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/FlightPlan/ActiveFlightPlanDataArray.ts:74
tryGet
▸ tryGet(index
): undefined
| FlightPlanDataItem
Attempts to retrieve an element from this array.
Parameters
Name | Type | Description |
---|---|---|
index | number | The index of the element. |
Returns
undefined
| FlightPlanDataItem
the element at the specified index, or undefined if index is out of bounds.
Implementation of
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/FlightPlan/ActiveFlightPlanDataArray.ts:64
unsub
▸ unsub(handler
): void
Unsubscribes a callback function from this array.
Parameters
Name | Type | Description |
---|---|---|
handler | SubscribableArrayHandler <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
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/FlightPlan/ActiveFlightPlanDataArray.ts:79