fix: 排除3.203等特殊孔径参与叠板计算,槽刀统计对齐真实槽孔

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-30 17:00:56 +08:00
parent 8d6efa9e86
commit c20a2c62b8
3 changed files with 34 additions and 20 deletions

View File

@@ -218,6 +218,18 @@ namespace DrillTools
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
/// <summary>
/// PP定位孔(3.203)、外围参考孔(3.175)、Mark孔(1.049)、机台码(0.499)等特殊孔径。
/// 不按尾号归类,且不参与叠板块数计算。
/// </summary>
public static bool IsSpecialFixedDiameter(double diameter)
{
return Math.Abs(diameter - 1.049) < 0.001
|| Math.Abs(diameter - 3.175) < 0.001
|| Math.Abs(diameter - 3.203) < 0.001
|| Math.Abs(diameter - 0.499) < 0.001;
}
/// <summary>
/// 根据孔径尾号判断刀具尾号类型
/// </summary>
@@ -226,9 +238,7 @@ namespace DrillTools
public static ToolSuffixType GetToolSuffixType(double diameter)
{
// 特殊孔径优先判断
if (Math.Abs(diameter - 1.049) < 0.001 ||
Math.Abs(diameter - 3.175) < 0.001 ||
Math.Abs(diameter - 0.499) < 0.001)
if (IsSpecialFixedDiameter(diameter))
{
System.Diagnostics.Debug.WriteLine($"[尾号类型判断] 直径={diameter:F3}: 特殊孔径,尾号类型=钻针");
return ToolSuffixType.Drill; // 固定为圆孔