pcp-tgu интерфейс

This commit is contained in:
Дмитрий Соловьев
2026-05-29 16:09:36 +03:00
parent 913b3d7c9b
commit 9fca4d4051
34 changed files with 3163 additions and 0 deletions
@@ -0,0 +1,56 @@
export type TguPlanStatus =
| "ACCEPTED"
| "REJECTED"
| "WAITING_DECISION"
| "PLANNED"
| "ISSUING"
| "EXPIRED"
| "SUPERSEDED"
| "START_AMBIGUOUS"
| string;
export type TguPlanDecision = "ACCEPTED" | "REJECTED";
export type TguPlan = {
planId: string;
spacecraftId: string;
startTime: string;
endTime: string;
kppId: string;
status: TguPlanStatus;
};
export type TguPlatform = {
id?: string | null;
businessKey?: string | null;
name?: string | null;
status?: string | null;
noradId?: number | string | null;
mission?: string | null;
validFrom?: string | null;
validTo?: string | null;
};
export type TguPlanDecisionMessage = {
eventId: string;
spacecraftId: string;
planId: string;
attemptId: string;
decision: TguPlanDecision;
decisionTime: string;
reason?: string | null;
};
export type TguApiErrorKind = "network" | "http";
export class TguApiError extends Error {
readonly kind: TguApiErrorKind;
readonly status?: number;
constructor(message: string, kind: TguApiErrorKind, status?: number) {
super(message);
this.name = "TguApiError";
this.kind = kind;
this.status = status;
}
}
@@ -0,0 +1,50 @@
import type { TguPlan, TguPlanStatus, TguPlatform } from "./tguTypes";
export type TguPlatformUi = {
spacecraftId: string;
name?: string;
noradId?: string;
status?: string;
mission?: string;
planCount: number;
hasProblemStatus: boolean;
platform?: TguPlatform;
};
export type TguPlanUi = TguPlan & {
startMs: number;
endMs: number;
platform?: TguPlatformUi;
};
export type TimelineRange = {
fromMs: number;
toMs: number;
};
export type TimelineRow = {
spacecraftId: string;
platform?: TguPlatformUi;
plans: TguPlanUi[];
};
export type TimelinePlanSegment = {
plan: TguPlanUi;
rowIndex: number;
x: number;
x2: number;
width: number;
};
export type TimelineLink = {
spacecraftId: string;
fromPlanId: string;
toPlanId: string;
};
export type TimelineStatusStyle = {
status: TguPlanStatus;
label: string;
color: string;
className: string;
};