mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Read an ADS-B vertical rate from one shared field reader
This commit is contained in:
1 parent
780d8903ee
commit
d479c1c6f6
8 files changed
+68
-9
No files matched your search
@@ -30,6 +30,8 @@
|
||||
* This module is portable: no Cesium, DOM, network or storage access.
|
||||
*/
|
||||
|
||||
import { readAdsbVerticalRateFpm } from './adsbFields.js';
|
||||
|
||||
/** A marker is dropped once its newest position is this old. */
|
||||
export const LOCAL_ADSB_POSITION_STALE_MS = 60_000;
|
||||
/** An aircraft is forgotten once no message has arrived for this long. */
|
||||
@@ -247,9 +249,7 @@ export function normalizeDump1090Aircraft(json, nowMs, { band = '1090' } = {}) {
|
||||
altitudeFt: altitude,
|
||||
groundSpeedKt: finiteOrNull(entry.gs),
|
||||
trackDeg: normalizeTrack(entry.track),
|
||||
// A GNSS-sourced rate is sent as geom_rate instead of baro_rate.
|
||||
verticalRateFpm:
|
||||
finiteOrNull(entry.baro_rate) ?? finiteOrNull(entry.geom_rate),
|
||||
verticalRateFpm: readAdsbVerticalRateFpm(entry),
|
||||
lastPositionAt: hasPosition
|
||||
? receivedAt - Math.max(0, seenPosS) * 1000
|
||||
: null,
|
||||
|
||||
Reference in new issue
Block a user