feat:实现已完成仿真之后直接调用波形预览组件展示波形预览图
This commit is contained in:
@ -484,9 +484,30 @@ export function getWebviewContent(iconUri?: string): string {
|
||||
hideLoadingIndicator();
|
||||
break;
|
||||
|
||||
case 'vcdInfo':
|
||||
// 渲染迷你波形预览信息
|
||||
try {
|
||||
if (message.containerId && typeof renderWaveformInfo === 'function') {
|
||||
renderWaveformInfo(message.containerId, message.vcdInfo || {});
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('[WebView] 渲染波形信息失败:', e);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'vcdGenerated':
|
||||
// VCD 文件生成成功
|
||||
// VCD 文件生成成功,添加消息并附带波形预览
|
||||
addMessage(message.text, 'bot');
|
||||
try {
|
||||
if (message.vcdFilePath) {
|
||||
const lastMsg = messagesEl ? messagesEl.lastElementChild : null;
|
||||
if (lastMsg && typeof addWaveformPreviewToMessage === 'function') {
|
||||
addWaveformPreviewToMessage(lastMsg, message.vcdFilePath, message.fileName || 'waveform.vcd');
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('[WebView] 添加波形预览失败:', e);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'fileContent':
|
||||
|
||||
Reference in New Issue
Block a user