Skip to main content

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:97

Constructor.

Parameters​

ParameterTypeDescription
busEventBusThe event bus.
optionsTrafficInstrumentOptionsOptions with which to initialize this instrument.

Returns​

TrafficInstrument

Methods​

forEachContact()​

forEachContact(visitor): void

Defined in: src/sdk/instruments/Traffic.ts:114

Iterates through all tracked traffic contacts with a visitor function.

Parameters​

ParameterTypeDescription
visitor(contact) => voidA visitor function.

Returns​

void


getContact()​

getContact(uid): undefined | TrafficContact

Defined in: src/sdk/instruments/Traffic.ts:106

Retrieves a traffic contact by its assigned ID number.

Parameters​

ParameterTypeDescription
uidnumberan 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:122

Initializes this instrument. Once initialized, this instrument will automatically track and update traffic contacts.

Returns​

void

Implementation of​

Instrument.init


onUpdate()​

onUpdate(): void

Defined in: src/sdk/instruments/Traffic.ts:221

This method does nothing.

Returns​

void

Implementation of​

Instrument.onUpdate