Class: NearestWaypointArray<T, EntryType>
An array of nearest waypoints backed by a nearest facilities subscription. Supports GPS data integrity state so that the array will be empty when no GPS position is available. Also supports pausing and resuming automatic updates from the backing nearest facilities subscription.
Type parameters
Name | Type |
---|---|
T | extends NearestWaypointFacilityType |
EntryType | extends NearestWaypointEntry <NearestWaypointTypeMap [T ]> = NearestWaypointEntry <NearestWaypointTypeMap [T ]> |
Implements
SubscribableArray
<EntryType
>
Constructors
constructor
• new NearestWaypointArray<T
, EntryType
>(bus
, waypointEntryFactory
, isGpsDataFailed
, gpsFailClearDelay
): NearestWaypointArray
<T
, EntryType
>
Constructor.
Type parameters
Name | Type |
---|---|
T | extends NearestWaypointFacilityType |
EntryType | extends NearestWaypointEntry <NearestWaypointTypeMap [T ]> = NearestWaypointEntry <NearestWaypointTypeMap [T ]> |
Parameters
Name | Type | Description |
---|---|---|
bus | EventBus | The event bus. |
waypointEntryFactory | (waypoint : NearestWaypointTypeMap [T ]) => EntryType | A function which creates nearest waypoint entries for this array. |
isGpsDataFailed | Subscribable <boolean > | Whether GPS data is in a failed state. |
gpsFailClearDelay | number | The delay, in milliseconds, after GPS data enters a failed state before this array is cleared of all waypoints. |
Returns
NearestWaypointArray
<T
, EntryType
>
Defined in
src/workingtitle-instruments-g3000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG3000/Shared/Nearest/NearestWaypointArray.ts:98
Accessors
length
• get
length(): number
Returns
number
Inherit Doc
Implementation of
SubscribableArray.length
Defined in
src/workingtitle-instruments-g3000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG3000/Shared/Nearest/NearestWaypointArray.ts:76
Methods
destroy
▸ destroy(): void
Destroys this array. Once this array is destroyed, it will be emptied and will no longer automatically update its contents and cannot be paused or resumed.
Returns
void
Defined in
src/workingtitle-instruments-g3000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG3000/Shared/Nearest/NearestWaypointArray.ts:308
get
▸ get(index
): EntryType
Parameters
Name | Type |
---|---|
index | number |
Returns
EntryType
Inherit Doc
Implementation of
SubscribableArray.get
Defined in
src/workingtitle-instruments-g3000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG3000/Shared/Nearest/NearestWaypointArray.ts:216
getArray
▸ getArray(): readonly EntryType
[]
Returns
readonly EntryType
[]
Inherit Doc
Implementation of
SubscribableArray.getArray
Defined in
src/workingtitle-instruments-g3000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG3000/Shared/Nearest/NearestWaypointArray.ts:225
init
▸ init(nearestSubscription
, paused?
): void
Initializes this array.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
nearestSubscription | NearestSubscription <FacilityTypeMap [T ]> | undefined | The nearest facility subscription that will provide this array's nearest waypoint data. |
paused | boolean | false | Whether the array should be paused when initialized. |
Returns
void
Throws
Error if this array has been destroyed.
Defined in
src/workingtitle-instruments-g3000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG3000/Shared/Nearest/NearestWaypointArray.ts:112
pause
▸ pause(): void
Pauses this array. Once paused, this array's contents will no longer automatically update until it is resumed.
Returns
void
Throws
Error if this array has been destroyed.
Defined in
src/workingtitle-instruments-g3000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG3000/Shared/Nearest/NearestWaypointArray.ts:200
resume
▸ resume(): void
Resumes this array. Once resumed, this array will automatically update its contents until it is paused or destroyed.
Returns
void
Throws
Error if this array has been destroyed.
Defined in
src/workingtitle-instruments-g3000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG3000/Shared/Nearest/NearestWaypointArray.ts:182
sub
▸ sub(handler
, initialNotify?
, paused?
): Subscription
Parameters
Name | Type |
---|---|
handler | SubscribableArrayHandler <EntryType > |
initialNotify? | boolean |
paused? | boolean |
Returns
Subscription
Inherit Doc
Implementation of
SubscribableArray.sub
Defined in
src/workingtitle-instruments-g3000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG3000/Shared/Nearest/NearestWaypointArray.ts:229
tryGet
▸ tryGet(index
): undefined
| EntryType
Parameters
Name | Type |
---|---|
index | number |
Returns
undefined
| EntryType
Inherit Doc
Implementation of
SubscribableArray.tryGet
Defined in
src/workingtitle-instruments-g3000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG3000/Shared/Nearest/NearestWaypointArray.ts:221
unsub
▸ unsub(handler
): void
Parameters
Name | Type |
---|---|
handler | SubscribableArrayHandler <EntryType > |
Returns
void
Inherit Doc
Implementation of
SubscribableArray.unsub
Defined in
src/workingtitle-instruments-g3000/html_ui/Pages/VCockpit/Instruments/NavSystems/WTG3000/Shared/Nearest/NearestWaypointArray.ts:234