Files
dc-observatio/services/pcp-tgu-ops-ui/src/features/tgu-map-2d/tgu2DMapInterval.ts
T
Дмитрий Соловьев c3a1a8b4a1 Add PCP architecture docs and TGU ops updates
Capture current PCP architecture notes, service-map prototypes, TGU operations UI/map work, local configuration updates, database helper scripts, and request/sample JSON artifacts.
2026-05-30 14:18:19 +03:00

30 lines
839 B
TypeScript

import type { TguPlanUi, TimelineRange } from "../../model/timelineTypes";
export const MAX_TGU_2D_MAP_INTERVAL_MS = 7 * 24 * 60 * 60 * 1000;
export const TGU_2D_MAP_INTERVAL_WARNING =
"Интервал карты больше 7 суток. Для тяжёлых canvas-слоёв выберите меньший интервал или конкретный план.";
export type Tgu2DMapIntervalState = {
range: TimelineRange;
tooLarge: boolean;
};
export function getTgu2DMapIntervalState(range: TimelineRange, selectedPlan?: TguPlanUi): Tgu2DMapIntervalState {
if (selectedPlan) {
return {
range: {
fromMs: selectedPlan.startMs,
toMs: selectedPlan.endMs
},
tooLarge: false
};
}
return {
range,
tooLarge: range.toMs - range.fromMs > MAX_TGU_2D_MAP_INTERVAL_MS
};
}