Class: NearestFacilityWaypointArray<T, EntryType>
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/NearestWaypointArray.ts:16
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
Type Parameter | Default type |
---|---|
T extends NearestWaypointFacilityType | - |
EntryType extends NearestWaypointEntry <NearestFacilityWaypointTypeMap [T ]> | NearestWaypointEntry <NearestFacilityWaypointTypeMap [T ]> |
Implements
SubscribableArray
<EntryType
>
Constructors
Constructor
new NearestFacilityWaypointArray<
T
,EntryType
>(bus
,waypointEntryFactory
,isGpsDataFailed
,gpsFailClearDelay
):NearestFacilityWaypointArray
<T
,EntryType
>
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/NearestWaypointArray.ts:48
Constructor.
Parameters
Parameter | Type | Description |
---|---|---|
bus | EventBus | The event bus. |
waypointEntryFactory | (waypoint ) => 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
NearestFacilityWaypointArray
<T
, EntryType
>
Accessors
length
Get Signature
get length():
number
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/NearestWaypointArray.ts:26
Inherit Doc
Returns
number
Implementation of
SubscribableArray.length
Methods
destroy()
destroy():
void
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/NearestWaypointArray.ts:258
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
get()
get(
index
):EntryType
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/NearestWaypointArray.ts:166
Parameters
Parameter | Type |
---|---|
index | number |
Returns
EntryType
Inherit Doc
Implementation of
SubscribableArray.get
getArray()
getArray(): readonly
EntryType
[]
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/NearestWaypointArray.ts:175
Returns
readonly EntryType
[]
Inherit Doc
Implementation of
SubscribableArray.getArray
init()
init(
nearestSubscription
,paused
):void
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/NearestWaypointArray.ts:62
Initializes this array.
Parameters
Parameter | 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.
pause()
pause():
void
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/NearestWaypointArray.ts:150
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.
resume()
resume():
void
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/NearestWaypointArray.ts:132
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.
sub()
sub(
handler
,initialNotify?
,paused?
):Subscription
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/NearestWaypointArray.ts:179
Parameters
Parameter | Type |
---|---|
handler | SubscribableArrayHandler <EntryType > |
initialNotify? | boolean |
paused? | boolean |
Returns
Subscription
Inherit Doc
Implementation of
SubscribableArray.sub
tryGet()
tryGet(
index
):undefined
|EntryType
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/NearestWaypointArray.ts:171
Parameters
Parameter | Type |
---|---|
index | number |
Returns
undefined
| EntryType
Inherit Doc
Implementation of
SubscribableArray.tryGet
unsub()
unsub(
handler
):void
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Nearest/NearestWaypointArray.ts:184
Parameters
Parameter | Type |
---|---|
handler | SubscribableArrayHandler <EntryType > |
Returns
void
Inherit Doc
Implementation of
SubscribableArray.unsub