mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
feat(localAdsb): render on Navara
Task 12b. src/layers/localAdsb/render/navara.js implements the Local ADS-B renderer interface of 12a on Navara: - markers: the shared aircraft renderer's glyph sets in magenta #ff4fd8 (class silhouette and scale, ×3 near / ×0.5 far, always on top), drawn under every sprite layer as Cesium draws the entities; each frame writes what Cesium's CallbackProperties gave (position, screen rotation, visibility) and the 2,000 km display distance; - the 978 MHz UAT ring: its own sprite set, a white ring atlas tinted #ffb3ef, Cesium's 24 px point plus its 1.5 px outline (27 px), the same distance scale and distance, pickable as its aircraft; - models (the Flights GLBs, magenta MIX tint), trail and head: the shared aircraft renderer's; the camera never follows a local aircraft. Registered by registerNavaraLayerRenderers (import()); the Navara catalog now offers flights, military and local ADS-B. - ?qaFeed=local-adsb:fixture: the local receivers' answer in the server's format (src/bench/w1Feeds syntheticLocalReceivers: 40 aircraft near JFK, 10 on 978 MHz UAT) through the layer's own decoder-feed session (sources.localAdsbFeeds, null by default: the layer makes its own). - qa-w1-layers --layer=local-adsb: a click selects a marker and shows its card with the receiver line, the camera does not follow, Escape leaves the selection (it never answered Escape), empty map releases it. qa-w1-layers local-adsb: Cesium 12/12, Navara 13/13, --compare parity (global pose: the 2.27 px camera offset only). qa-flights-engines --layer=local-adsb: 14/14 (fills exact; UAT rings side by side in docs/migration/phase3/localAdsb).
This commit is contained in:
1 parent
65e30546dd
commit
ea1e2f9c04
10 files changed
+422
-5
No files matched your search
@@ -8,6 +8,9 @@
|
||||
// military:synthetic[:count] readsb rows, `count` aircraft (1 000); the
|
||||
// first 25 are also synthetic civil flights
|
||||
// vessels:fixture 12 000 AIS rows, or those within an area
|
||||
// local-adsb:fixture the local receivers' answer (server format,
|
||||
// /api/local-receivers/aircraft): 40 aircraft
|
||||
// near JFK, 1090 MHz and 978 MHz UAT
|
||||
|
||||
import {
|
||||
createFlightSource,
|
||||
@@ -16,14 +19,17 @@ import {
|
||||
} from '../../sources/live/standalone.js';
|
||||
import {
|
||||
syntheticFlights,
|
||||
syntheticLocalReceivers,
|
||||
syntheticMilitary,
|
||||
syntheticVessels,
|
||||
} from '../../bench/w1Feeds.js';
|
||||
import { createLocalReceiverFeeds } from '../../layers/localAdsb/feeds.js';
|
||||
|
||||
const KINDS = Object.freeze({
|
||||
flights: new Set(['synthetic']),
|
||||
military: new Set(['synthetic']),
|
||||
vessels: new Set(['fixture']),
|
||||
'local-adsb': new Set(['fixture']),
|
||||
});
|
||||
|
||||
/** The qaFeed entries of a location search, or a TypeError. */
|
||||
@@ -38,7 +44,7 @@ export function parseQaFeed(search = '') {
|
||||
(count !== null && !(Number.isInteger(count) && count > 0))
|
||||
)
|
||||
throw new TypeError(
|
||||
`qaFeed: unknown entry "${item}" (flights:synthetic[:count], military:synthetic[:count], vessels:fixture)`,
|
||||
`qaFeed: unknown entry "${item}" (flights:synthetic[:count], military:synthetic[:count], vessels:fixture, local-adsb:fixture)`,
|
||||
);
|
||||
return { layer, kind, count };
|
||||
});
|
||||
@@ -68,6 +74,11 @@ export function createQaSources(entries, { now = () => Date.now() } = {}) {
|
||||
? json({ timestamp: now() / 1000, trace: [] })
|
||||
: json(syntheticMilitary({ nowMs: now(), count: count ?? 1000 })),
|
||||
});
|
||||
if (layer === 'local-adsb')
|
||||
sources.localAdsbFeeds = createLocalReceiverFeeds({
|
||||
now,
|
||||
fetchImpl: async () => json(syntheticLocalReceivers({ nowMs: now() })),
|
||||
});
|
||||
if (layer === 'vessels')
|
||||
sources.vessels = createVesselSource({
|
||||
fetchImpl: async (url) => {
|
||||
|
||||
@@ -63,3 +63,26 @@ test('military:synthetic answers with the military source’s shape, some shared
|
||||
const track = await sources.military.getTrack('ae1100');
|
||||
assert.deepEqual(track.records, []);
|
||||
});
|
||||
|
||||
test('local-adsb:fixture answers as the local receivers do (1090 MHz and UAT)', async () => {
|
||||
const now = Date.UTC(2026, 9, 16, 12);
|
||||
assert.deepEqual(parseQaFeed('?qaFeed=local-adsb:fixture'), [
|
||||
{ layer: 'local-adsb', kind: 'fixture', count: null },
|
||||
]);
|
||||
const { localAdsbFeeds } = createQaSources(
|
||||
parseQaFeed('?qaFeed=local-adsb:fixture'),
|
||||
{ now: () => now },
|
||||
);
|
||||
const loaded = new Promise((resolve) =>
|
||||
localAdsbFeeds.subscribe((state) => {
|
||||
if (state.records?.length) resolve();
|
||||
}),
|
||||
);
|
||||
localAdsbFeeds.start();
|
||||
await loaded;
|
||||
const state = localAdsbFeeds.getState();
|
||||
localAdsbFeeds.stop();
|
||||
assert.equal(state.records.length, 40);
|
||||
assert.ok(state.records.some((record) => record.band === '978'));
|
||||
assert.ok(state.records.some((record) => record.band === '1090'));
|
||||
});
|
||||
Reference in new issue
Block a user