fix: 碰撞报告/分析窗口自动模式处理 + 预选排除清除
CollisionAnalysisDialog(预计算结果分析): - 自动关闭时清除所有预选排除(智能预选可能选中唯一候选项, 导致排除全部 → 无检测对象);默认动作 = 去掉选择 + 继续生成动画 - 日志记录清除数量 CollisionReportDialog(碰撞检测报告): - ShowReport 自动模式下跳过窗口(数据已落库/日志),返回 null; 调用方区分自动模式 null(正常)与非自动模式 null(错误) 验证:F1 批处理跑完 NW 零残留窗口(EnumWindows 确认仅主窗口); 日志确认'自动模式下已清除 1 个预选排除';集成测试 25/25
This commit is contained in:
parent
0d43cda5d7
commit
5f15eeeb26
@ -1492,7 +1492,7 @@ namespace NavisworksTransport.UI.WPF.ViewModels
|
|||||||
UpdateMainStatus("碰撞报告已显示");
|
UpdateMainStatus("碰撞报告已显示");
|
||||||
LogManager.Info("成功显示缓存的碰撞报告");
|
LogManager.Info("成功显示缓存的碰撞报告");
|
||||||
}
|
}
|
||||||
else
|
else if (!AutomationModeContext.IsAutomaticMode)
|
||||||
{
|
{
|
||||||
UpdateMainStatus("显示报告对话框失败");
|
UpdateMainStatus("显示报告对话框失败");
|
||||||
LogManager.Error("CollisionReportDialog.ShowReport返回null");
|
LogManager.Error("CollisionReportDialog.ShowReport返回null");
|
||||||
|
|||||||
@ -81,6 +81,28 @@ namespace NavisworksTransport.UI.WPF.Views
|
|||||||
}
|
}
|
||||||
|
|
||||||
LogManager.Info("[碰撞分析] 测试自动化已接管分析窗口,自动选择继续生成");
|
LogManager.Info("[碰撞分析] 测试自动化已接管分析窗口,自动选择继续生成");
|
||||||
|
|
||||||
|
// 🔥 自动模式下清除所有预选排除:
|
||||||
|
// 智能预选(碰撞>100次或>50%)可能排除全部候选项(如唯一候选被选中),
|
||||||
|
// 导致后续检测无任何对象。默认动作 = 去掉选择 + 继续生成动画(检测所有物体)。
|
||||||
|
int clearedCount = 0;
|
||||||
|
if (HotspotsDataGrid.ItemsSource is System.Collections.IEnumerable items)
|
||||||
|
{
|
||||||
|
foreach (var vm in items.OfType<HotspotViewModel>())
|
||||||
|
{
|
||||||
|
if (vm.IsExcluded)
|
||||||
|
{
|
||||||
|
vm.IsExcluded = false;
|
||||||
|
clearedCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (clearedCount > 0)
|
||||||
|
{
|
||||||
|
LogManager.Info($"[碰撞分析] 自动模式下已清除 {clearedCount} 个预选排除(避免排除全部候选项导致无检测对象)");
|
||||||
|
}
|
||||||
|
|
||||||
ModelHighlightHelper.ClearCategory(PrecomputedHighlightCategory);
|
ModelHighlightHelper.ClearCategory(PrecomputedHighlightCategory);
|
||||||
SelectedAction = CollisionAnalysisAction.Continue;
|
SelectedAction = CollisionAnalysisAction.Continue;
|
||||||
Close();
|
Close();
|
||||||
|
|||||||
@ -3,6 +3,7 @@ using System.Linq;
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
using NavisworksTransport.Utils;
|
||||||
using NavisworksTransport.UI.WPF.ViewModels;
|
using NavisworksTransport.UI.WPF.ViewModels;
|
||||||
using NavisworksTransport.Commands;
|
using NavisworksTransport.Commands;
|
||||||
using CollisionReportScreenshot = NavisworksTransport.Commands.CollisionReportScreenshot;
|
using CollisionReportScreenshot = NavisworksTransport.Commands.CollisionReportScreenshot;
|
||||||
@ -368,6 +369,14 @@ namespace NavisworksTransport.UI.WPF.Views
|
|||||||
/// <returns>对话框实例</returns>
|
/// <returns>对话框实例</returns>
|
||||||
public static CollisionReportDialog ShowReport(CollisionReportResult reportResult, Window owner = null)
|
public static CollisionReportDialog ShowReport(CollisionReportResult reportResult, Window owner = null)
|
||||||
{
|
{
|
||||||
|
// 自动模式(批处理/自动测试)下跳过碰撞报告窗口:
|
||||||
|
// 报告数据已落库/日志,避免残留窗口阻塞自动化流程
|
||||||
|
if (AutomationModeContext.IsAutomaticMode)
|
||||||
|
{
|
||||||
|
LogManager.Info("[碰撞报告] 自动模式下跳过碰撞报告窗口(数据已保存至检测记录)");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
lock (_lock)
|
lock (_lock)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user