first commit

This commit is contained in:
lennlouisgeek
2026-03-30 02:59:56 +08:00
commit eec9927ae6
60 changed files with 15953 additions and 0 deletions

144
src/lib/types/hud.ts Normal file
View File

@@ -0,0 +1,144 @@
export type LocaleCode = "zh-CN" | "en-US";
export type WindowControlAction = "minimize" | "toggle-maximize" | "close";
export type ConnectionState = "online" | "connecting" | "offline";
export type StageStatusTone = "ok" | "warn" | "idle";
export type HudNoticeTone = "ok" | "warn" | "info";
export type SignalTone = "cyan" | "lime" | "orange" | "violet" | "gold" | "rose";
export type PressureColorMapPreset = "emerald" | "arctic" | "ember";
export type SignalPanelSide = "left" | "right";
export type HudConfigTone = "neutral" | "cyan" | "lime" | "orange";
export interface HudSignalSeries {
id: string;
tone: SignalTone;
points: number[];
}
export interface HudSignalIcon {
id: string;
label: string;
tone: SignalTone;
}
export interface HudSignalPanel {
id: string;
code: string;
title: string;
side: SignalPanelSide;
active: boolean;
series: HudSignalSeries[];
icons: HudSignalIcon[];
latest: number | null;
min: number | null;
max: number | null;
}
export interface HudPacket {
ts: number;
panels: HudSignalPanel[];
summary: HudSummary;
pressureMatrix: number[] | null;
}
export interface HudSummary {
label: string;
points: number[];
latest: number | null;
min: number | null;
max: number | null;
}
export interface HudConfigLink {
id: string;
label: string;
tone?: HudConfigTone;
active?: boolean;
}
export interface HudColorMapOption {
id: PressureColorMapPreset;
label: string;
previewStops: [string, string, string];
}
export interface HudCopy {
appName: string;
suiteName: string;
stageTitle: string;
stageHint: string;
configPanelTitle: string;
configPanelHint: string;
matrixSizeLabel: string;
matrixRowsLabel: string;
matrixColsLabel: string;
rangeLabel: string;
rangeMinLabel: string;
rangeMaxLabel: string;
colorMapLabel: string;
resetConfigLabel: string;
applyLiveHint: string;
runtimeReady: string;
runtimeFallback: string;
controlArea: string;
serialPortLabel: string;
connectionLabel: string;
deviceLabel: string;
sampleRateLabel: string;
channelsLabel: string;
configLinksLabel: string;
refreshPortsLabel: string;
connectActionLabel: string;
disconnectActionLabel: string;
exportActionLabel: string;
exportingActionLabel: string;
importActionLabel: string;
replaySectionLabel: string;
replayPlayLabel: string;
replayPauseLabel: string;
replayStopLabel: string;
replaySpeedLabel: string;
replayProgressLabel: string;
replayEmptyHint: string;
connectedLabel: string;
connectingLabel: string;
disconnectedLabel: string;
}
export interface HudMatrixConfig {
rows: number;
cols: number;
rangeMin: number;
rangeMax: number;
colorMapPreset: PressureColorMapPreset;
}
export interface SerialConnectResult {
port: string;
connected: boolean;
message: string;
}
export interface SerialExportResult {
path: string;
frameCount: number;
message: string;
}
export interface SerialImportFrameResult {
data: number[];
dtsMs: number;
}
export interface SerialImportResult {
fileName: string;
frameCount: number;
channelCount: number;
frames: SerialImportFrameResult[];
message: string;
}