Class: TrafficInstrument
Defined in: src/sdk/instruments/Traffic.ts:83
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
Defined in: src/sdk/instruments/Traffic.ts:102
Creates a new instance of TrafficInstrument.
Parameters
Parameter | Type | Description |
---|---|---|
bus | EventBus | The event bus. |
options | Readonly <TrafficInstrumentOptions > | Options with which to configure this instrument. |
Returns
TrafficInstrument
Methods
forEachContact()
forEachContact(
visitor
):void
Defined in: src/sdk/instruments/Traffic.ts:126
Iterates through all tracked traffic contacts with a visitor function.
Parameters
Parameter | Type | Description |
---|---|---|
visitor | (contact ) => void | A visitor function. |
Returns
void
getContact()
getContact(
uid
):undefined
|TrafficContact
Defined in: src/sdk/instruments/Traffic.ts:118
Retrieves a traffic contact by its assigned ID number.
Parameters
Parameter | 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.
init()
init():
void
Defined in: src/sdk/instruments/Traffic.ts:134
Initializes this instrument. Once initialized, this instrument will automatically track and update traffic contacts. Initialization is asynchronous and is not guaranteed to have completed by the time this method returns.
Returns
void
Implementation of
onUpdate()
onUpdate():
void
Defined in: src/sdk/instruments/Traffic.ts:251
This method does nothing.
Returns
void