feat: 移除播放控制器中的调试日志,优化代码整洁性

This commit is contained in:
xudan 2025-10-09 17:07:57 +08:00
parent 3420c7cc9c
commit ab2cd0d346

View File

@ -78,7 +78,6 @@ export function usePlaybackWebSocket(editorService: ShallowRef<EditorService | u
sceneJson.value = msg.data;
latestRobotData.clear();
} else if (msg.type === 'AMR') {
console.log('[Playback] Received AMR data:', msg.data);
(msg.data as RobotRealtimeInfo[]).forEach(robot => {
latestRobotData.set(robot.id, robot);
});
@ -140,12 +139,10 @@ export function usePlaybackWebSocket(editorService: ShallowRef<EditorService | u
const batchUpdateRobots = (updates: Array<{ id: string; data: RobotRealtimeInfo }>) => {
const editor = editorService.value;
console.log('[Playback] Batch update: Editor service is', editor ? 'available' : 'NOT available', '. Updates to process:', updates);
if (!editor || updates.length === 0) return;
updates.forEach(({ id, data }) => {
const robotExists = editor.checkRobotById(id);
console.log(`[Playback] Checking robot ID: ${id}. Exists in editor: ${robotExists}`);
if (robotExists) {
const { x, y, angle, ...rest } = data;
editor.updateRobot(id, rest);
@ -162,7 +159,6 @@ export function usePlaybackWebSocket(editorService: ShallowRef<EditorService | u
const renderLoop = () => {
try {
console.log('[Playback] Render loop executing...');
const updates: Array<{ id: string; data: RobotRealtimeInfo }> = [];
for (const [id, data] of latestRobotData.entries()) {
updates.push({ id, data });
@ -170,7 +166,6 @@ export function usePlaybackWebSocket(editorService: ShallowRef<EditorService | u
latestRobotData.clear();
if (updates.length > 0) {
console.log(`[Playback] Render loop: Preparing to update ${updates.length} robots.`);
batchUpdateRobots(updates);
}