fix: 注释掉调试日志以清理控制台输出
This commit is contained in:
parent
dc64a65702
commit
a865cfc950
|
@ -615,7 +615,7 @@ function onComponentDrag(e: MouseEvent) {
|
||||||
function stopComponentDrag() {
|
function stopComponentDrag() {
|
||||||
// 如果有组件被拖拽,保存当前状态
|
// 如果有组件被拖拽,保存当前状态
|
||||||
if (draggingComponentId.value) {
|
if (draggingComponentId.value) {
|
||||||
console.log(`组件拖拽结束: ${draggingComponentId.value}`);
|
// console.log(`组件拖拽结束: ${draggingComponentId.value}`);
|
||||||
|
|
||||||
// 保存图表数据
|
// 保存图表数据
|
||||||
saveDiagramData(diagramData.value);
|
saveDiagramData(diagramData.value);
|
||||||
|
|
|
@ -385,6 +385,7 @@ const currentWaveformPath = computed(() => {
|
||||||
function selectWaveform(index: number) {
|
function selectWaveform(index: number) {
|
||||||
currentWaveformIndex.value = index;
|
currentWaveformIndex.value = index;
|
||||||
updateModelValue();
|
updateModelValue();
|
||||||
|
applyOutputWave();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function applyOutputWave() {
|
async function applyOutputWave() {
|
||||||
|
@ -424,7 +425,7 @@ async function applyOutputWave() {
|
||||||
toInteger((phase.value * 4096) / 360),
|
toInteger((phase.value * 4096) / 360),
|
||||||
);
|
);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dialog.info("应用成功");
|
// dialog.info("应用成功");
|
||||||
} else {
|
} else {
|
||||||
dialog.error("应用失败");
|
dialog.error("应用失败");
|
||||||
}
|
}
|
||||||
|
@ -455,6 +456,7 @@ function increaseFrequency() {
|
||||||
frequency.value = parseFloat(frequency.value.toFixed(1)); // 修复浮点数精度问题
|
frequency.value = parseFloat(frequency.value.toFixed(1)); // 修复浮点数精度问题
|
||||||
frequencyInput.value = formatFrequency(frequency.value);
|
frequencyInput.value = formatFrequency(frequency.value);
|
||||||
updateModelValue();
|
updateModelValue();
|
||||||
|
applyOutputWave();
|
||||||
}
|
}
|
||||||
|
|
||||||
function decreaseFrequency() {
|
function decreaseFrequency() {
|
||||||
|
@ -475,6 +477,7 @@ function decreaseFrequency() {
|
||||||
frequency.value = parseFloat(frequency.value.toFixed(1)); // 修复浮点数精度问题
|
frequency.value = parseFloat(frequency.value.toFixed(1)); // 修复浮点数精度问题
|
||||||
frequencyInput.value = formatFrequency(frequency.value);
|
frequencyInput.value = formatFrequency(frequency.value);
|
||||||
updateModelValue();
|
updateModelValue();
|
||||||
|
applyOutputWave();
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyFrequencyInput() {
|
function applyFrequencyInput() {
|
||||||
|
@ -505,6 +508,7 @@ function increasePhase() {
|
||||||
}
|
}
|
||||||
phaseInput.value = phase.value.toString();
|
phaseInput.value = phase.value.toString();
|
||||||
updateModelValue();
|
updateModelValue();
|
||||||
|
applyOutputWave();
|
||||||
}
|
}
|
||||||
|
|
||||||
function decreasePhase() {
|
function decreasePhase() {
|
||||||
|
@ -514,6 +518,7 @@ function decreasePhase() {
|
||||||
}
|
}
|
||||||
phaseInput.value = phase.value.toString();
|
phaseInput.value = phase.value.toString();
|
||||||
updateModelValue();
|
updateModelValue();
|
||||||
|
applyOutputWave();
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyPhaseInput() {
|
function applyPhaseInput() {
|
||||||
|
|
|
@ -177,26 +177,26 @@ defineExpose({
|
||||||
getPinPosition: (pinId: string) => {
|
getPinPosition: (pinId: string) => {
|
||||||
// 如果是自定义的引脚ID
|
// 如果是自定义的引脚ID
|
||||||
if (props.pins && props.pins.length > 0) {
|
if (props.pins && props.pins.length > 0) {
|
||||||
console.log('SMT_LED查找Pin ID:', pinId);
|
// console.log('SMT_LED查找Pin ID:', pinId);
|
||||||
console.log('SMT_LED组件尺寸:', props.size, '宽高:', width.value, 'x', height.value);
|
// console.log('SMT_LED组件尺寸:', props.size, '宽高:', width.value, 'x', height.value);
|
||||||
const customPin = props.pins.find(p => p.pinId === pinId);
|
const customPin = props.pins.find(p => p.pinId === pinId);
|
||||||
console.log('找到的引脚配置:', customPin);
|
// console.log('找到的引脚配置:', customPin);
|
||||||
|
|
||||||
if (customPin) {
|
if (customPin) {
|
||||||
// 考虑组件尺寸的缩放
|
// 考虑组件尺寸的缩放
|
||||||
const scaledX = customPin.x * props.size;
|
const scaledX = customPin.x * props.size;
|
||||||
const scaledY = customPin.y * props.size;
|
const scaledY = customPin.y * props.size;
|
||||||
|
|
||||||
console.log('使用Pin缩放后的坐标:', scaledX, scaledY);
|
// console.log('使用Pin缩放后的坐标:', scaledX, scaledY);
|
||||||
return {
|
return {
|
||||||
x: scaledX,
|
x: scaledX,
|
||||||
y: scaledY
|
y: scaledY
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
console.log('未找到匹配的引脚');
|
// console.log('未找到匹配的引脚');
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
console.log('没有引脚配置');
|
// console.log('没有引脚配置');
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -153,7 +153,7 @@ async function loadComponentModule(type: string) {
|
||||||
[type]: module,
|
[type]: module,
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log(`Loaded module for ${type}:`, module);
|
// console.log(`Loaded module for ${type}:`, module);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`Failed to load component module ${type}:`, error);
|
console.error(`Failed to load component module ${type}:`, error);
|
||||||
return null;
|
return null;
|
||||||
|
@ -164,7 +164,7 @@ async function loadComponentModule(type: string) {
|
||||||
|
|
||||||
// 处理组件模块加载请求
|
// 处理组件模块加载请求
|
||||||
async function handleLoadComponentModule(type: string) {
|
async function handleLoadComponentModule(type: string) {
|
||||||
console.log("Handling load component module request for:", type);
|
// console.log("Handling load component module request for:", type);
|
||||||
await loadComponentModule(type);
|
await loadComponentModule(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,9 +267,9 @@ async function handleAddComponent(componentData: {
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
capsPage = componentModule.default.getCapabilities();
|
capsPage = componentModule.default.getCapabilities();
|
||||||
console.log(`获取到${componentData.type}组件的能力页面`);
|
// console.log(`获取到${componentData.type}组件的能力页面`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`获取${componentData.type}组件能力页面失败:`, error);
|
// console.error(`获取${componentData.type}组件能力页面失败:`, error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -349,16 +349,16 @@ async function handleAddTemplate(templateData: {
|
||||||
// 计算视口中心点的坐标 (与handleAddComponent函数中的方法相同)
|
// 计算视口中心点的坐标 (与handleAddComponent函数中的方法相同)
|
||||||
viewportCenter.x = (viewportWidth / 2 - position.x) / scale;
|
viewportCenter.x = (viewportWidth / 2 - position.x) / scale;
|
||||||
viewportCenter.y = (viewportHeight / 2 - position.y) / scale;
|
viewportCenter.y = (viewportHeight / 2 - position.y) / scale;
|
||||||
console.log(
|
// console.log(
|
||||||
`=== 计算的视口中心: x=${viewportCenter.x}, y=${viewportCenter.y}, scale=${scale}`,
|
// `=== 计算的视口中心: x=${viewportCenter.x}, y=${viewportCenter.y}, scale=${scale}`,
|
||||||
);
|
// );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("获取视口中心位置时出错:", error);
|
console.error("获取视口中心位置时出错:", error);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("=== 使用视口中心添加模板组件:", viewportCenter);
|
// console.log("=== 使用视口中心添加模板组件:", viewportCenter);
|
||||||
|
|
||||||
// 找到模板中的主要组件(假设是第一个组件)
|
// 找到模板中的主要组件(假设是第一个组件)
|
||||||
const mainPart = templateData.template.parts[0];
|
const mainPart = templateData.template.parts[0];
|
||||||
|
@ -398,9 +398,9 @@ async function handleAddTemplate(templateData: {
|
||||||
newPart.x = viewportCenter.x + relativeX;
|
newPart.x = viewportCenter.x + relativeX;
|
||||||
newPart.y = viewportCenter.y + relativeY;
|
newPart.y = viewportCenter.y + relativeY;
|
||||||
|
|
||||||
console.log(
|
// console.log(
|
||||||
`=== 组件[${newPart.id}]位置调整: (${oldX},${oldY}) -> (${newPart.x},${newPart.y})`,
|
// `=== 组件[${newPart.id}]位置调整: (${oldX},${oldY}) -> (${newPart.x},${newPart.y})`,
|
||||||
);
|
// );
|
||||||
}
|
}
|
||||||
|
|
||||||
return newPart;
|
return newPart;
|
||||||
|
@ -541,7 +541,6 @@ async function handleComponentSelected(componentData: DiagramPart | null) {
|
||||||
// 处理图表数据更新事件
|
// 处理图表数据更新事件
|
||||||
function handleDiagramUpdated(data: DiagramData) {
|
function handleDiagramUpdated(data: DiagramData) {
|
||||||
diagramData.value = data;
|
diagramData.value = data;
|
||||||
console.log("Diagram data updated:", data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理组件移动事件
|
// 处理组件移动事件
|
||||||
|
|
Loading…
Reference in New Issue