feat(web-platform): release V0.7.1 数据模块
web-platform-ci / TypeScript, lint, unit, build (push) Has been cancelled
web-platform-ci / Playwright E2E (push) Has been cancelled
web-platform-ci / TypeScript, lint, unit, build (pull_request) Has been cancelled
web-platform-ci / Playwright E2E (pull_request) Has been cancelled

This commit is contained in:
2026-09-01 15:57:03 +08:00
parent 3b4ced6437
commit 89d1c8cb57
12 changed files with 1057 additions and 5 deletions
@@ -16,6 +16,7 @@ import {
} from './SimulationSession';
import type { ControllerCommand, ControllerStatus } from '../controller/types';
import type { RLCommand, RLPolicyStatus } from '../rl/types';
import type { DataRecorderConfig, DataRecorderStatus, TelemetryChannel } from './DataRecorder';
import { composePhysicalMap } from '../map/physicalMap';
import { composeProjectMap } from '../map/MapComposer';
import { resolveProjectMap } from '../map/MapLoader';
@@ -64,6 +65,12 @@ export interface PhysicsAdapter {
setRLPolicyEnabled(enabled: boolean): void;
setRLCommand(command: RLCommand): void;
removeRLPolicy(): void;
configureDataRecorder(config: Partial<DataRecorderConfig>): DataRecorderStatus | undefined;
startDataRecording(): DataRecorderStatus | undefined;
stopDataRecording(): DataRecorderStatus | undefined;
clearDataRecording(): DataRecorderStatus | undefined;
registerDataChannel(channel: TelemetryChannel): (() => void) | undefined;
exportDataRecording(format: 'csv' | 'json'): Uint8Array;
cachedSupportFiles(): ProjectFile[];
releaseRetired(): void;
rollbackRetired(): void;
@@ -305,6 +312,25 @@ export class MainThreadPhysicsAdapter implements PhysicsAdapter {
removeRLPolicy(): void {
this.session?.removeRLPolicy();
}
configureDataRecorder(config: Partial<DataRecorderConfig>): DataRecorderStatus | undefined {
return this.session?.configureDataRecorder(config);
}
startDataRecording(): DataRecorderStatus | undefined {
return this.session?.startDataRecording();
}
stopDataRecording(): DataRecorderStatus | undefined {
return this.session?.stopDataRecording();
}
clearDataRecording(): DataRecorderStatus | undefined {
return this.session?.clearDataRecording();
}
registerDataChannel(channel: TelemetryChannel): (() => void) | undefined {
return this.session?.registerDataChannel(channel);
}
exportDataRecording(format: 'csv' | 'json'): Uint8Array {
if (!this.session) throw new Error('请先加载模型');
return this.session.exportDataRecording(format);
}
cachedSupportFiles(): ProjectFile[] {
return this.supportFiles.map((file) => ({ ...file, data: file.data.slice() }));
}