mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 10:24:02 +00:00
fix(local-adsb): show a 359.7° track as TRK 0°, not TRK 360° (#1396)
Wrap rounded local ADS-B track labels at north. Contribution by @rudycelekli.
This commit is contained in:
4 files changed
+25
-1
No files matched your search
@@ -0,0 +1,3 @@
|
|||||||
|
- Show a locally heard aircraft tracking 359.5° or more as TRK 0°. The Local
|
||||||
|
ADS-B card rounded the track without wrapping, so 359.7° read "TRK 360°"
|
||||||
|
(Rudy Celekli, @rudycelekli, #1396).
|
||||||
@@ -5994,6 +5994,8 @@ callsign, class and category, adsbdb operator/type and a plausible route when
|
|||||||
known, altitude, ground speed, track, vertical rate, position age, message
|
known, altitude, ground speed, track, vertical rate, position age, message
|
||||||
count, "Heard by your receiver"); markers are not camera-followed. Positioned
|
count, "Heard by your receiver"); markers are not camera-followed. Positioned
|
||||||
aircraft join detection boxes, labelled only with a decoded callsign.
|
aircraft join detection boxes, labelled only with a decoded callsign.
|
||||||
|
The card's `TRK` label wraps after rounding to whole degrees, so a track of
|
||||||
|
359.5° displays as `TRK 0°` rather than `TRK 360°`.
|
||||||
|
|
||||||
Receivers publish one record shape from `src/sources/adsbRecords.js`
|
Receivers publish one record shape from `src/sources/adsbRecords.js`
|
||||||
(`icao`, `callsign`, `category`, `onGround`, `lat`, `lon`, `altitudeFt`,
|
(`icao`, `callsign`, `category`, `onGround`, `lat`, `lon`, `altitudeFt`,
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ export function localAdsbCardModel(
|
|||||||
t('ALT {altitude} FT · GS {speed} KT · TRK {track}', {
|
t('ALT {altitude} FT · GS {speed} KT · TRK {track}', {
|
||||||
altitude: grouped(altitude),
|
altitude: grouped(altitude),
|
||||||
speed: speed === null ? DASH : speed,
|
speed: speed === null ? DASH : speed,
|
||||||
track: track === null ? DASH : `${track}°`,
|
track: track === null ? DASH : `${track % 360}°`,
|
||||||
}),
|
}),
|
||||||
vertical === null
|
vertical === null
|
||||||
? t('V/S {rate}', { rate: DASH })
|
? t('V/S {rate}', { rate: DASH })
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import test from 'node:test';
|
||||||
|
import assert from 'node:assert/strict';
|
||||||
|
import { setLocale } from '../../i18n/index.js';
|
||||||
|
import { localAdsbCardModel } from './card.js';
|
||||||
|
|
||||||
|
test('a track of 359.7° reads TRK 0°, not TRK 360°', () => {
|
||||||
|
setLocale('en');
|
||||||
|
const { details } = localAdsbCardModel(
|
||||||
|
{
|
||||||
|
icao: 'abc123',
|
||||||
|
altitudeFt: 12500,
|
||||||
|
groundSpeedKt: 240,
|
||||||
|
trackDeg: 359.7,
|
||||||
|
lastPositionAt: 1000,
|
||||||
|
},
|
||||||
|
5000,
|
||||||
|
);
|
||||||
|
assert.equal(details[1], 'ALT 12,500 FT · GS 240 KT · TRK 0°');
|
||||||
|
});
|
||||||
Reference in new issue
Block a user