Skip to content

A spy satellite simulator in your browser, except the data is real. Live open source spatial intelligence on a photorealistic 3D globe.

Merge remote-tracking branch 'upstream/main' into fix/tracked-info-vertical-rate

daikaginzae9fb6c15c65e
diff --cc docs/CURRENT-STATE.md
index 742f8185d,0af075a6d..cd5ad4bf1
--- a/docs/CURRENT-STATE.md
+++ b/docs/CURRENT-STATE.md
@@@ -567,13 -842,30 +842,37 @@@ use the supplied asset resolver, includ
an abort signal and cannot update a later lifecycle after destruction. Existing
camera, terrain floor, trail, selection and measured model-size policies remain.
+The tracked-aircraft descriptor both flight layers hand to the cockpit carries
+`verticalRateMps` beside `velocityMps` and `track`. Civil records store the rate as
+`verticalRate` and military records as `verticalRateMps`; the query seam maps both to
+one name, so `resolveTrackedAircraftInfo` returns a single shape for either layer. The
+rate is reported, never derived: a blank poll keeps the last transmitted value and an
+absent rate stays null rather than reading as level flight.
+
+ ## Transponder emergency highlighting
+
+ `src/data/aircraftEmergency.js` derives one status per poll from the Mode A
+ squawk (7500 unlawful interference, 7600 radio failure, 7700 general emergency)
+ and the readsb ADS-B emergency/priority field where present. Higher severity
+ wins, with ADS-B taking a tie. GEV treats `minfuel` and `lifeguard` as priorities;
+ `general`, `unlawful`, `nordo` and `downed` are emergency statuses.
+
+ Civil and military fleet billboards, 3D models and Cockpit dots turn red for
+ emergencies and repaint when the broadcast changes. Priorities retain normal
+ colors; tracked map colors keep their existing selection treatment. The Cockpit
+ meta line names the squawk or ADS-B status (only emergencies are red), replacing
+ COURSE ALIGNED while a status is present.
+
+ Analyst and tracked voice results describe broadcasts, not confirmed incidents.
+ Fields include `squawk`, `emergency`, `emergencyKind`, `emergencySource` and
+ `emergencyBroadcast`. `lastContactAtMs` is the last known transponder contact,
+ not the arrival time of this status; missing contact times retain known contact.
+ Civil fallback preserves status alongside unchanged OpenSky vectors. One poll
+ omitting ADS-B status may retain the previous status when the squawk is unchanged;
+ explicit clears and changed squawks take effect immediately. The next omitted
+ poll expires that retention. `scripts/qa-emergency-squawk.mjs` checks billboard
+ and model transitions, Cockpit HUD, clearing and tracking release.
+
## Browser live-source observations
Flights, Military Flights and AIS Vessels obtain snapshots and optional history
diff --cc src/data/militaryFlights.test.mjs
index faf9722fc,0c518eb5f..d04061793
--- a/src/data/militaryFlights.test.mjs
+++ b/src/data/militaryFlights.test.mjs
@@@ -600,51 -823,14 +823,59 @@@ test('two contacts matching at the sam
const first = militaryFlightsLayer.findByQuery('QQ7')?.icao24;
const second = militaryFlightsLayer.findByQuery('qq7')?.icao24;
- assert.equal(first, 'aef001', 'the stable key (lowest hex) wins, not the feed order');
- assert.equal(second, first, 'and the same query resolves the same way every time');
+ assert.equal(
+ first,
+ 'aef001',
+ 'the stable key (lowest hex) wins, not the feed order',
+ );
+ assert.equal(
+ second,
+ first,
+ 'and the same query resolves the same way every time',
+ );
});
+
+test('the military tracked descriptor publishes the reported vertical rate', () => {
+ // Shape parity with the civil layer's getTrackedInfo(). The two layers store
+ // the rate under different record keys (`verticalRateMps` here,
+ // `verticalRate` there), so `resolveTrackedAircraftInfo` only hands back one
+ // shape if BOTH descriptors map it — a consumer that reads the field off the
+ // civil seam and finds it missing on the military one would silently treat
+ // every military contact as level flight.
+ const seedRate = (verticalRateMps) =>
+ _setTrackedMilitaryRefreshStateForTest({
+ icao24: 'ae7f01',
+ entity: { gevLabelModel: { title: 'TEST', details: [] } },
+ billboard: {
+ position: Cesium.Cartesian3.fromDegrees(-97.0, 31.0, 8_000),
+ color: Cesium.Color.WHITE,
+ show: true,
+ },
+ billboardCollection: { show: true, remove() {} },
+ viewer: { camera: { positionCartographic: null }, scene: {} },
+ meta: {
+ callsign: 'RCH512',
+ rawLat: 31,
+ rawLon: -97,
+ altitudeFt: 26_000,
+ speedMps: 220,
+ track: 95,
+ onGround: false,
+ verticalRateMps,
+ },
+ });
+
+ seedRate(12.7);
+ assert.equal(militaryFlightsLayer.getTrackedInfo()?.verticalRateMps, 12.7);
+
+ // Absent is not level: a contact that has never transmitted a rate must read
+ // as null, not as a 0 m/s a phase classifier would call cruise.
+ for (const missing of [undefined, null, Number.NaN]) {
+ seedRate(missing);
+ assert.equal(
+ militaryFlightsLayer.getTrackedInfo()?.verticalRateMps,
+ null,
+ `vertical rate ${String(missing)} must publish as null`,
+ );
+ }
+});