diff --git a/AGENTS.md b/AGENTS.md index fde719a..7f21017 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -19,8 +19,13 @@ ### 构建流水线(必须串行,不可并行) ```bash -./compile.bat # 1. 编译 -./deploy-plugin.bat # 2. 等待编译确认成功后部署 +./build-and-deploy.bat # 编译+部署(推荐) +``` + +如需单独操作: +```bash +./compile.bat # 仅编译 +./deploy-plugin.bat # 仅部署(编译通过后) ``` **严禁**:加 `cmd.exe /c` 前缀、直接调 MSBuild、拆 PowerShell 逻辑、改 `powershell` 为 `pwsh`。 @@ -29,9 +34,9 @@ | 允许并行(纯读取) | 禁止并行(产出/锁文件) | |---|---| -| rg, ls, Get-Content, 读日志 | compile, deploy, run-unit-tests, 启动 NW | +| rg, ls, Get-Content, 读日志 | build-and-deploy, compile, deploy, run-unit-tests, 启动 NW | -`run-unit-tests → compile → deploy` 是单通道流水线,不可拆分并行。 +`run-unit-tests → build-and-deploy` 是单通道流水线,不可拆分并行。 ### 路径 diff --git a/src/Commands/GenerateCollisionReportCommand.cs b/src/Commands/GenerateCollisionReportCommand.cs index 6b737a8..4b4ee1b 100644 --- a/src/Commands/GenerateCollisionReportCommand.cs +++ b/src/Commands/GenerateCollisionReportCommand.cs @@ -8,6 +8,7 @@ using Autodesk.Navisworks.Api; using Autodesk.Navisworks.Api.Clash; using NavisworksTransport.Core; using NavisworksTransport.Core.Animation; +using NavisworksTransport.Core.Config; using NavisworksTransport.Utils; using NavisworksTransport.Utils.CoordinateSystem; using NavisworksTransport.UI.WPF.Views; @@ -223,7 +224,7 @@ namespace NavisworksTransport.Commands { result.FrameRate = animationManager.AnimationFrameRate; result.Duration = animationManager.AnimationDuration; - result.DetectionTolerance = animationManager.DetectionTolerance; + result.DetectionTolerance = ConfigManager.Instance.Current.Animation.DetectionToleranceMeters; } // 从数据库记录填充路径信息 diff --git a/src/UI/WPF/ViewModels/PathEditingViewModel.cs b/src/UI/WPF/ViewModels/PathEditingViewModel.cs index 8e7fe0d..020a466 100644 --- a/src/UI/WPF/ViewModels/PathEditingViewModel.cs +++ b/src/UI/WPF/ViewModels/PathEditingViewModel.cs @@ -5744,7 +5744,21 @@ namespace NavisworksTransport.UI.WPF.ViewModels } } - RefreshPathRoutes(); + var existingIds = new HashSet(PathRoutes.Select(r => r.Route.Id)); + foreach (var coreRoute in _pathPlanningManager.Routes) + { + if (!existingIds.Add(coreRoute.Id)) continue; + + var pathViewModel = new PathRouteViewModel(isFromDatabase: true) + { + Route = coreRoute, + IsActive = false + }; + pathViewModel.SetTimeInfo(coreRoute.CreatedTime, coreRoute.LastModified); + foreach (var pt in CreatePathPointViewModelsFromCoreRoute(coreRoute)) + pathViewModel.Points.Add(pt); + PathRoutes.Add(pathViewModel); + } // 自动选择第一个路径 if (PathRoutes.Count > 0) @@ -6031,58 +6045,6 @@ namespace NavisworksTransport.UI.WPF.ViewModels } } - - /// - /// 刷新路径集合显示 - /// - private void RefreshPathRoutes() - { - try - { - if (_pathPlanningManager?.Routes != null) - { - // 清除现有的UI路径 - PathRoutes.Clear(); - - // 重新加载所有路径 - foreach (var coreRoute in _pathPlanningManager.Routes) - { - var pathViewModel = new PathRouteViewModel(isFromDatabase: true) - { - Route = coreRoute, - IsActive = false - }; - - // 设置时间信息 - pathViewModel.SetTimeInfo(coreRoute.CreatedTime, coreRoute.LastModified); - - // 使用统一的辅助方法创建路径点 - var pathPoints = CreatePathPointViewModelsFromCoreRoute(coreRoute); - foreach (var point in pathPoints) - { - pathViewModel.Points.Add(point); - } - - PathRoutes.Add(pathViewModel); - LogManager.Info($"RefreshPathRoutes: 添加路径ViewModel {coreRoute.Name} (Hash: {pathViewModel.GetHashCode()})"); - } - - LogManager.Info($"已刷新路径集合显示,共 {PathRoutes.Count} 个路径"); - - // 调试:列出所有PathRoutes中的路径名称和哈希码 - for (int i = 0; i < PathRoutes.Count; i++) - { - var route = PathRoutes[i]; - LogManager.Info($" PathRoutes[{i}]: {route.Name} (Hash: {route.GetHashCode()}, Points: {route.Points.Count})"); - } - } - } - catch (Exception ex) - { - LogManager.Error($"刷新路径集合失败: {ex.Message}", ex); - } - } - #endregion #endregion