刀具日志增强与PCB钻孔数据大规模更新

本次提交包含以下主要变更:

- 增强了刀具类型、尾号类型及最小直径计算的调试日志,便于问题追踪和数据分析。
- 修正了最小槽刀直径的计算逻辑,EA型槽刀单独处理,提升了判定准确性。
- 针对特殊直径的刀具类型判定增加了专门处理和日志输出。
- 删除了 General_sort.txt 和 s40024079g0-a2-cs-jp-sort.txt 文件内容。
- n40032386g0-a2-cs-jp.drl 文件新增了大量PCB钻孔、槽孔(G85)、外形轮廓等数控加工数据,完善了刀具分组与程序控制指令,满足PCB生产自动化需求。
This commit is contained in:
2025-12-31 15:09:14 +08:00
parent 6361f17598
commit 5e8b989add
6 changed files with 19470 additions and 98 deletions

View File

@@ -1535,25 +1535,49 @@ M30";
MinSlotDiameter = double.MaxValue;
MinEADiameter = double.MaxValue;
// 添加调试日志
System.Diagnostics.Debug.WriteLine("=== 开始计算最小直径信息 ===");
foreach (var tool in Tools)
{
// 添加详细的刀具信息日志
System.Diagnostics.Debug.WriteLine($"[刀具分析] T{tool.ToolNumber:D2}: 直径={tool.Diameter:F3}, 类型={tool.ToolType}, 尾号类型={tool.ToolSuffixType}, 大类={tool.ToolCategory}");
// 根据刀具类型分类计算最小直径
if (tool.ToolType == ToolType.Regular)
{
// 普通钻咀
if (tool.Diameter < MinDrillDiameter)
MinDrillDiameter = tool.Diameter;
System.Diagnostics.Debug.WriteLine($"[钻咀] 当前最小钻咀直径: {MinDrillDiameter:F3}");
}
else if (tool.ToolType == ToolType.Slot)
{
// 槽刀
if (tool.Diameter < MinSlotDiameter)
MinSlotDiameter = tool.Diameter;
// 槽刀 - 修复只有真正的槽刀非EA型槽刀才计入最小槽刀直径
// EA型槽刀不应该计入最小槽刀直径的计算
if (tool.ToolSuffixType != ToolSuffixType.EASlot && tool.ToolSuffixType != ToolSuffixType.EASlot2)
{
if (tool.Diameter < MinSlotDiameter)
MinSlotDiameter = tool.Diameter;
System.Diagnostics.Debug.WriteLine($"[槽刀] T{tool.ToolNumber:D2}是真正的槽刀,当前最小槽刀直径: {MinSlotDiameter:F3}");
}
else
{
System.Diagnostics.Debug.WriteLine($"[EA刀] T{tool.ToolNumber:D2}是EA型槽刀不计入最小槽刀直径计算");
}
// 检查是否是EA型槽刀尾号为2或6
if ((tool.ToolSuffixType == ToolSuffixType.EASlot || tool.ToolSuffixType == ToolSuffixType.EASlot2)
&& tool.Diameter < MinEADiameter)
MinEADiameter = tool.Diameter;
// 特别标记EA型槽刀
if (tool.ToolSuffixType == ToolSuffixType.EASlot || tool.ToolSuffixType == ToolSuffixType.EASlot2)
{
System.Diagnostics.Debug.WriteLine($"[EA刀] T{tool.ToolNumber:D2}是EA型槽刀直径={tool.Diameter:F3}");
}
}
}
@@ -1566,6 +1590,12 @@ M30";
if (MinEADiameter == double.MaxValue)
MinEADiameter = 0;
System.Diagnostics.Debug.WriteLine($"=== 最终结果 ===");
System.Diagnostics.Debug.WriteLine($"最小钻咀: {MinDrillDiameter:F3}");
System.Diagnostics.Debug.WriteLine($"最小槽刀: {MinSlotDiameter:F3}");
System.Diagnostics.Debug.WriteLine($"最小EA刀: {MinEADiameter:F3}");
System.Diagnostics.Debug.WriteLine($"=== 计算完成 ===");
}
/// <summary>