Convert voice action positions and distances through src/geo

Voice actions read degrees from ECEF positions with toLonLatH and
measure distances with src/geo, at the sites that only did maths. A
position that converts to NaN now reads as unknown, never as NaN
coordinates. The analyst test gives its subject a real ECEF position
instead of patching Cesium. Sites that keep a Cesium Cartographic, or
use the camera or picks, wait for the renderer ports.
This commit is contained in:
Sameh Khamis committed 2026-11-05 14:33:32 -08:00
1 parent e09b48c4ac
commit d2bc1e9d44
2 files changed
+23 -28

No files matched your search

+2 -8
View File
@@ -3,6 +3,7 @@ import { createStandalonePlaceSearch } from '../standalone/placeSearch.js';
import { test } from 'node:test';
import assert from 'node:assert/strict';
import * as Cesium from 'cesium';
import { fromDegrees } from '../geo/index.js';
import { CCTV_FOCUS_RESULT } from '../data/cctv.js';
import { getContextStore, registerEntityContext } from '../data/contextStore.js';
import { DataLayerManager } from '../data/manager.js';
@@ -2878,7 +2879,7 @@ test('a nested Cockpit rollback result is translated too', async () => {
* analyst's 2 000-record last-fix slice). These pin the unified engine.
*/
function awarenessSubjectHarness({ subject, flights = [], military = [] }) {
const position = subject ? { __subject: true } : null;
const position = subject ? fromDegrees(-97.9, 29.9, 9000) : null;
const snapshotFlights = flights.slice(0, 20_000);
const snapshotMilitary = military.slice(0, 20_000);
return {
@@ -2945,7 +2946,6 @@ async function withAwareness(harness, run) {
aircraftSnapshot: awareness.getAircraftQuerySnapshot,
flightsNearby: flightsLayer.getNearby,
militaryNearby: militaryLayer.getNearby,
cartoFrom: Cesium.Cartographic.fromCartesian,
};
awareness.getContextSnapshot = () => harness.snapshot;
awareness.getAircraftQuerySnapshot = () => {
@@ -2978,11 +2978,6 @@ async function withAwareness(harness, run) {
};
flightsLayer.getNearby = () => harness.flights.slice();
militaryLayer.getNearby = () => harness.military.slice();
Cesium.Cartographic.fromCartesian = (value) => (
value?.__subject
? { latitude: Cesium.Math.toRadians(29.9), longitude: Cesium.Math.toRadians(-97.9), height: 9000 }
: originals.cartoFrom(value)
);
try {
return await run(awareness);
} finally {
@@ -2990,7 +2985,6 @@ async function withAwareness(harness, run) {
awareness.getAircraftQuerySnapshot = originals.aircraftSnapshot;
flightsLayer.getNearby = originals.flightsNearby;
militaryLayer.getNearby = originals.militaryNearby;
Cesium.Cartographic.fromCartesian = originals.cartoFrom;
}
}