Skip to main content

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

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

Returns

TrafficInstrument

Defined in

src/sdk/instruments/Traffic.ts:97

Methods

forEachContact

forEachContact(visitor): void

Iterates through all tracked traffic contacts with a visitor function.

Parameters

NameTypeDescription
visitor(contact: TrafficContact) => voidA 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

NameTypeDescription
uidnumberan 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

Instrument.init

Defined in

src/sdk/instruments/Traffic.ts:122


onUpdate

onUpdate(): void

This method does nothing.

Returns

void

Implementation of

Instrument.onUpdate

Defined in

src/sdk/instruments/Traffic.ts:221