Skip to main content

Class: GPSSatComputer

Defined in: src/sdk/instruments/GPSSat.ts:756

An instrument that computes GPS satellite information.

Implements

Constructors

Constructor

new GPSSatComputer(index, bus, ephemerisFile, sbasFile, updateInterval, enabledSBASGroups, syncRole, options?): GPSSatComputer

Defined in: src/sdk/instruments/GPSSat.ts:954

Creates an instance of GPSSatComputer.

Parameters

ParameterTypeDefault valueDescription
indexnumberundefinedThe index of this computer.
busEventBusundefinedAn instance of the event bus.
ephemerisFilestringundefinedThe HTTP path to the ephemeris file to use for computations.
sbasFilestringundefinedThe HTTP path to the SBAS definitions file.
updateIntervalnumberundefinedThe interval in milliseconds to update the satellite positions.
enabledSBASGroupsSubscribableSet<string> | Iterable<string, any, any> | undefinedundefinedThe names of the SBAS satellite groups for which signal reception is enabled. If the computer's sync role is replica, then this parameter is ignored and the computer will sync enabled SBAS groups from the associated primary computer.
syncRole"none" | "primary" | "replica"'none'This computer's sync role. A primary computer will sync its state to corresponding replica computers. A computer with a sync role of none does not sync its state to or from other computers; it maintains its own independent state. Defaults to none.
options?Readonly<GPSSatComputerOptions>undefinedOptions with which to configure the computer. If the computer's sync role is replica, then these options are ignored and all configuration is instead synced with the associated primary computer.

Returns

GPSSatComputer

Properties

covarMatrix

readonly covarMatrix: Subscribable<Readonly<Omit<Float64Array<ArrayBufferLike>, "set" | "sort" | "copyWithin">>>

Defined in: src/sdk/instruments/GPSSat.ts:826

The covariance matrix calculated from the satellite constellation used to produce this computer's current position solution, represented as a 16-element vector. The matrix is organized such that:

  • Row/column 1 represents spatial axis x (parallel to Earth's surface, positive points toward true north).
  • Row/column 2 represents spatial axis y (parallel to Earth's surface, positive points toward the east).
  • Row/column 3 represents spatial axis z (perpendicular to Earth's surface, positive points upward).
  • Row/column 4 represents the temporal axis.

The element at row i, column j of the covariance matrix is represented by the element at index i * 4 + j in the vector (i.e. the vector is filled from the matrix in row-major order). If this computer has not acquired a position solution, then all elements of the vector will be NaN.


hdopValue

readonly hdopValue: Subscribable<number>

Defined in: src/sdk/instruments/GPSSat.ts:840

This computer's current horizontal dilution of precision value (HDOP), or -1 if this computer has not acquired a position solution.


index

readonly index: number

Defined in: src/sdk/instruments/GPSSat.ts:955

The index of this computer.


inhibitedSatellitePrnCodes

readonly inhibitedSatellitePrnCodes: SubscribableSet<number> & Subscribable<ReadonlySet<number>>

Defined in: src/sdk/instruments/GPSSat.ts:785

The PRN (pseudo-random noise) codes of all satellites that are currently manually inhibited. This set does not include SBAS satellites that are inhibited solely because their associated SBAS group is not enabled (unless the satellite has also been manually inhibited).

Inhibited satellites cannot be tracked, and therefore cannot be used for position determination, almanac download, or (in the case of SBAS satellites) differential correction download.


nominalChannelCount

readonly nominalChannelCount: number | null

Defined in: src/sdk/instruments/GPSSat.ts:870

The nominal total number of receiver channels supported by this computer, or null if this computer supports an unlimited number of channels.


nominalSbasChannelCount

readonly nominalSbasChannelCount: number | null

Defined in: src/sdk/instruments/GPSSat.ts:876

The nominal number of SBAS-only receiver channels supported by the GPS system, or null if all channels can track both non-SBAS and SBAS satellites.


pdopValue

readonly pdopValue: Subscribable<number>

Defined in: src/sdk/instruments/GPSSat.ts:833

This computer's current position dilution of precision value (PDOP), or -1 if this computer has not acquired a position solution.


syncRole

readonly syncRole: "none" | "primary" | "replica" = 'none'

Defined in: src/sdk/instruments/GPSSat.ts:961

This computer's sync role. A primary computer will sync its state to corresponding replica computers. A computer with a sync role of none does not sync its state to or from other computers; it maintains its own independent state. Defaults to none.


systemSbasState

readonly systemSbasState: Subscribable<GPSSystemSBASState>

Defined in: src/sdk/instruments/GPSSat.ts:810

The current system SBAS state of this computer.


systemState

readonly systemState: Subscribable<GPSSystemState>

Defined in: src/sdk/instruments/GPSSat.ts:806

The current system state of this computer.


vdopValue

readonly vdopValue: Subscribable<number>

Defined in: src/sdk/instruments/GPSSat.ts:847

This computer's current vertical dilution of precision value (VDOP), or -1 if this computer has not acquired a position solution.

Accessors

hdop

Get Signature

get hdop(): number

Defined in: src/sdk/instruments/GPSSat.ts:923

Gets this system's current horizontal dilution of precision value (HDOP), or -1 if this system has not acquired a position solution.

Deprecated

Please use hdopValue instead.

Returns

number

This system's current horizontal dilution of precision value (HDOP), or -1 if this system has not acquired a position solution.


pdop

Get Signature

get pdop(): number

Defined in: src/sdk/instruments/GPSSat.ts:912

Gets this system's current position dilution of precision value (PDOP), or -1 if this system has not acquired a position solution.

Deprecated

Please use pdopValue instead.

Returns

number

This system's current position dilution of precision value (PDOP), or -1 if this system has not acquired a position solution.


sats

Get Signature

get sats(): readonly GPSSatellite[]

Defined in: src/sdk/instruments/GPSSat.ts:883

Gets the current satellites that are being tracked by this computer.

Deprecated

Please use getSatellites() instead.

Returns

readonly GPSSatellite[]

The collection of current satellites.


sbasState

Get Signature

get sbasState(): GPSSystemSBASState

Defined in: src/sdk/instruments/GPSSat.ts:901

Gets the current GPS system SBAS state.

Deprecated

Please use systemSbasState instead.

Returns

GPSSystemSBASState

The current GPS system SBAS state.


state

Get Signature

get state(): GPSSystemState

Defined in: src/sdk/instruments/GPSSat.ts:892

Gets the current GPS system state.

Deprecated

Please use systemState instead.

Returns

GPSSystemState

The current GPS system state.


vdop

Get Signature

get vdop(): number

Defined in: src/sdk/instruments/GPSSat.ts:934

Gets this system's current vertical dilution of precision value (VDOP), or -1 if this system has not acquired a position solution.

Deprecated

Please use vdopValue instead.

Returns

number

This system's current vertical dilution of precision value (VDOP), or -1 if this system has not acquired a position solution.

Methods

acquireAndUseSatellites()

acquireAndUseSatellites(): void

Defined in: src/sdk/instruments/GPSSat.ts:1626

Instantly chooses the optimal satellites to track for all receiver channels, then acquires and downloads all data (ephemeris, almanac, and differential corrections) from tracked satellites with sufficient signal strength. If this system is not initialized, the operation will be delayed until just after initialization, unless reset() is called in the interim.

Has no effect if this system is a replica.

Returns

void


awaitInit()

awaitInit(): Promise<void>

Defined in: src/sdk/instruments/GPSSat.ts:1055

Waits for this computer to complete initialization.

Returns

Promise<void>

A Promise which is fulfilled when this computer has completed initialization.


calcHorizonAngle()

calcHorizonAngle(): number

Defined in: src/sdk/instruments/GPSSat.ts:1507

Calculates the horizon zenith angle.

Returns

number

The calculated horizon zenith angle based on the current altitude.


createPredictionContext()

createPredictionContext(): GPSPredictionContext

Defined in: src/sdk/instruments/GPSSat.ts:1392

Creates a new prediction context from this computer.

Returns

GPSPredictionContext

A new prediction context whose parent is this computer.


downloadAlamanac()

downloadAlamanac(simTime): void

Defined in: src/sdk/instruments/GPSSat.ts:1555

Forces this computer to immediately download a complete alamanac.

Has no effect if this system is a replica.

Parameters

ParameterTypeDescription
simTimenumberThe simulation time at which the almanac is considered to have been downloaded, as a Javascript timestamp. Defaults to the current simulation time.

Returns

void


eraseAlamanac()

eraseAlamanac(): void

Defined in: src/sdk/instruments/GPSSat.ts:1573

Erases this computer's downloaded almanac and any partial download progress.

Has no effect if this system is a replica.

Returns

void


eraseCachedEphemeris()

eraseCachedEphemeris(): void

Defined in: src/sdk/instruments/GPSSat.ts:1591

Erases this computer's cached ephemeris data for all satellites.

Has no effect if this system is a replica.

Returns

void


eraseLastKnownPosition()

eraseLastKnownPosition(): void

Defined in: src/sdk/instruments/GPSSat.ts:1530

Erases this computer's last known position.

Has no effect if this system is a replica.

Returns

void


getSatellites()

getSatellites(): readonly GPSSatellite[]

Defined in: src/sdk/instruments/GPSSat.ts:1384

Gets an array containing all satellites that can potentially be tracked by this computer.

Returns

readonly GPSSatellite[]

An array containing all satellites that can potentially be tracked by this computer.


init()

init(): void

Defined in: src/sdk/instruments/GPSSat.ts:1042

Initializes this instrument.

Returns

void

Implementation of

Instrument.init


isAlmanacValid()

isAlmanacValid(simTime): boolean

Defined in: src/sdk/instruments/GPSSat.ts:1544

Checks whether this computer's downloaded almanac data is valid at a given simulation time.

Parameters

ParameterTypeDescription
simTimenumberThe simulation time at which to check for almanac validity, as a Javascript timestamp. Defaults to the current simulation time.

Returns

boolean

Whether this computer's downloaded almanac data is valid at the specified simulation time.


onUpdate()

onUpdate(): void

Defined in: src/sdk/instruments/GPSSat.ts:1662

Updates this instrument.

Returns

void

Implementation of

Instrument.onUpdate


reset()

reset(): void

Defined in: src/sdk/instruments/GPSSat.ts:1647

Resets the GPSSatComputer system. This will unassign all receiver channels, set the state of every satellite to GPSSatelliteState.None, and set the state of the system to GPSSystemState.Searching.

If this system is not initialized, this method has no effect other than to cancel any pending operations triggered by previous calls to acquireAndUseSatellites().

Has no effect if this system is a replica.

Returns

void


setSatelliteInhibit()

setSatelliteInhibit(prn, inhibit): void

Defined in: src/sdk/instruments/GPSSat.ts:1610

Sets whether a satellite is manually inhibited. Inhibited satellites cannot be tracked, and therefore cannot be used for position determination, almanac download, or (in the case of SBAS satellites) differential correction download.

Has no effect if this system is a replica.

Parameters

ParameterTypeDescription
prnnumberThe PRN (pseudo-random noise) code of the satellite to change.
inhibitbooleanWhether the satellite should be inhibited.

Returns

void


syncLastKnownPosition()

syncLastKnownPosition(pos): void

Defined in: src/sdk/instruments/GPSSat.ts:1517

Syncs this computer's last known position with a given value.

Has no effect if this system is a replica.

Parameters

ParameterTypeDescription
posLatLonInterfaceThe position with which to sync the last known position. Defaults to the airplane's current position.

Returns

void