fix(flights): panels show the reported ground speed while a placement waits

A host-supplied placement's speed is how fast the marker is drawn. While it
waits for its fixes to catch up it stands still at 0, so tracked-aircraft
panels and the cockpit readout showed 0 m/s for an aircraft in flight.

displayedKinematics now takes derivedFromPlacement: when the drawn speed is a
placement's, the reported ground speed is shown, and the placement's only when
nothing is reported. The placement speed still drives motion and dead
reckoning. Civil and military tracked descriptors pass it from the new
_drSpeedPlaced scratch, which placeLiveAircraft sets.
This commit is contained in:
Sameh Khamis committed 2026-11-17 16:31:03 -08:00
1 parent 953af60e1d
commit d79494ac89
8 files changed
+98 -6

No files matched your search

+7
View File
@@ -43,6 +43,13 @@ test('displayedKinematics preserves a derived stop and falls back when unavailab
}), { speedMps: 80, trackDeg: 180 });
});
test('displayedKinematics shows the reported speed over a placement standing still', () => {
const placed = { derivedSpeedMps: 0, derivedTrackDeg: 90, derivedFromPlacement: true };
assert.deepEqual(displayedKinematics({ ...placed, reportedSpeedMps: 230, reportedTrackDeg: 88 }),
{ speedMps: 230, trackDeg: 90 });
assert.deepEqual(displayedKinematics(placed), { speedMps: 0, trackDeg: 90 });
});
test('stale coasting follows last source contact without allowing indefinite drift', () => {
const fix = 1_000_000;
assert.equal(staleCoastLimitSeconds({ fixEpochMs: fix }), 60);