Class: TrafficInstrument
Tracks aircraft traffic. Maintains a list of contacts, periodically updates their position, altitude, and reported heading, and uses these data to compute ground speed, ground track, and vertical speed.
Implements
Constructors
constructor
• new TrafficInstrument(bus
, options
): TrafficInstrument
Constructor.
Parameters
Name | Type | Description |
---|---|---|
bus | EventBus | The event bus. |
options | TrafficInstrumentOptions | Options with which to initialize this instrument. |
Returns
Defined in
src/sdk/instruments/Traffic.ts:97
Methods
forEachContact
▸ forEachContact(visitor
): void
Iterates through all tracked traffic contacts with a visitor function.
Parameters
Name | Type | Description |
---|---|---|
visitor | (contact : TrafficContact ) => void | A visitor function. |
Returns
void
Defined in
src/sdk/instruments/Traffic.ts:114
getContact
▸ getContact(uid
): undefined
| TrafficContact
Retrieves a traffic contact by its assigned ID number.
Parameters
Name | Type | Description |
---|---|---|
uid | number | an ID number. |
Returns
undefined
| TrafficContact
the traffic contact with the assigned ID number, or undefined if no such contact exists.
Defined in
src/sdk/instruments/Traffic.ts:106
init
▸ init(): void
Initializes this instrument. Once initialized, this instrument will automatically track and update traffic contacts.
Returns
void
Implementation of
Defined in
src/sdk/instruments/Traffic.ts:122
onUpdate
▸ onUpdate(): void
This method does nothing.
Returns
void
Implementation of
Defined in
src/sdk/instruments/Traffic.ts:221