feat(tgu-ops-ui): display real ground track and swath from ballistics service

Replace synthetic orbit calculation (Kepler + spacecraft ID hash) with real
data from pcp-ballistics-service via a new proxy endpoint in pcp-ui-service.

Backend:
- TguPlanningController: add GET /api/tgu-planning/spacecraft/{noradId}/flight-line
  that proxies FlightLineDTO[] from BallisticsService for a given time interval

Frontend:
- Fetch FlightLineDTO[] (revolution, time, lat/long, swath boundaries) using
  the spacecraft's noradId for the current 24h map window
- Group points by real revolution number to build OrbitPassInfo[] with actual
  orbit numbers and UTC times instead of synthetic Kepler-based estimates
- Build ground track MapLines and swath MapPolygons from real coordinates;
  swath polygon = outer-left edge forward + outer-right edge reversed
- Enable swath layer in the editor map; draw with teal fill/stroke matching
  the track colour
- MapPassSelector now shows real revolution numbers in header and handle labels

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Дмитрий Соловьев
2026-05-31 16:05:41 +03:00
parent 637a5e8848
commit 4ab765b0ee
7 changed files with 339 additions and 36 deletions
+31
View File
@@ -6,6 +6,37 @@ import {
type TguPlatform
} from "../model/tguTypes";
export type FlightLinePoint = {
time: string;
revolution: number;
lat: number;
long: number;
latLeft: number;
longLeft: number;
latInnerLeft: number;
longInnerLeft: number;
latInnerRight: number;
longInnerRight: number;
latRight: number;
longRight: number;
revSign: "ASC" | "DESC";
};
export async function fetchFlightLine(
noradId: string,
fromMs: number,
toMs: number
): Promise<FlightLinePoint[]> {
const toLocalDT = (ms: number) => new Date(ms).toISOString().slice(0, 19);
const query = new URLSearchParams({
time_start: toLocalDT(fromMs),
time_stop: toLocalDT(toMs)
});
return fetchJson<FlightLinePoint[]>(
`/api/tgu-planning/spacecraft/${encodeURIComponent(noradId)}/flight-line?${query}`
);
}
export async function fetchPlatforms(): Promise<TguPlatform[]> {
return fetchJson<TguPlatform[]>("/api/tgu-planning/platforms");
}