diff --git a/src/UI/WPF/Views/CornerTurnCheckDialog.xaml.cs b/src/UI/WPF/Views/CornerTurnCheckDialog.xaml.cs index 055437d..de7b436 100644 --- a/src/UI/WPF/Views/CornerTurnCheckDialog.xaml.cs +++ b/src/UI/WPF/Views/CornerTurnCheckDialog.xaml.cs @@ -28,7 +28,7 @@ namespace NavisworksTransport.UI.WPF.Views ResultBorder.BorderBrush = new SolidColorBrush(Color.FromRgb(76, 175, 80)); ResultTitle.Text = "✅ 可通过"; ResultTitle.Foreground = new SolidColorBrush(Color.FromRgb(46, 125, 50)); - ResultDetail.Text = $"余量: {margin:F2} 米\n最大可通过长度: {maxLength:F2} 米"; + ResultDetail.Text = $"余量: {margin:F2} 米\n临界长度: {maxLength:F2} 米"; } else { @@ -36,7 +36,7 @@ namespace NavisworksTransport.UI.WPF.Views ResultBorder.BorderBrush = new SolidColorBrush(Color.FromRgb(244, 67, 54)); ResultTitle.Text = "❌ 不可通过"; ResultTitle.Foreground = new SolidColorBrush(Color.FromRgb(183, 28, 28)); - ResultDetail.Text = $"超出: {-margin:F2} 米\n当前条件下最大可通过长度: {maxLength:F2} 米"; + ResultDetail.Text = $"不足: {-margin:F2} 米\n临界长度: {maxLength:F2} 米"; } } diff --git a/src/Utils/CornerTurnCheckHelper.cs b/src/Utils/CornerTurnCheckHelper.cs index ceab30f..906e2d9 100644 --- a/src/Utils/CornerTurnCheckHelper.cs +++ b/src/Utils/CornerTurnCheckHelper.cs @@ -21,11 +21,11 @@ namespace NavisworksTransport.Utils return false; maxLength = FindRequiredLength(width, entryWidth, exitWidth); - margin = length - maxLength; - return length >= maxLength; + margin = maxLength - length; + return length <= maxLength; } - /// 给定角度 θ,计算最大可通过长度 + /// 给定角度 θ,计算该角度下能通过的最大模块长度 private static double L(double theta, double width, double c1, double c2) { var sin = Math.Sin(theta); @@ -33,7 +33,7 @@ namespace NavisworksTransport.Utils return (c1 - width * cos) / sin + (c2 - width * sin) / cos; } - /// 三分法搜索 θ ∈ (0, π/2) 上 L(θ) 的最小值 + /// 三分法搜索 θ ∈ (0, π/2) 上 L(θ) 的最小值(即最大可通过长度) private static double FindRequiredLength(double width, double c1, double c2) { double lo = 1e-6;