From 229414614637c770bad2f4021a4f66de4787eebb Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Fri, 7 Aug 2026 11:11:12 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=A4=A7=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E8=AF=84=E4=BC=B0=E6=94=B9=E4=B8=BA=E8=87=AA=E5=8A=A8=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E6=89=B9=E5=A4=84=E7=90=86=EF=BC=88=E5=AF=B9=E8=AF=9D?= =?UTF-8?q?=E6=A1=86=E4=BB=85=E9=80=9A=E7=9F=A5=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 用户反馈:超过阈值用户必然选择'是'——去掉选择框, 自动加入批处理 + 通知弹窗。 改动: - 大模型评估命中 → 自动 ExecuteAddToBatchQueue(跳过排除列表确认 弹窗——用户意图已明确;ExecuteAddToBatchQueue 加可选参数 skipExcludedListConfirmation) - 通知弹窗:说明已自动加入 + 阈值可调,请到批处理页签启动 - AddToBatchQueueCommand 绑定改 lambda(方法签名变化) 验证:集成测试 25/25 --- .../ViewModels/AnimationControlViewModel.cs | 44 +++++++------------ 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/src/UI/WPF/ViewModels/AnimationControlViewModel.cs b/src/UI/WPF/ViewModels/AnimationControlViewModel.cs index 517c0fa..aebe275 100644 --- a/src/UI/WPF/ViewModels/AnimationControlViewModel.cs +++ b/src/UI/WPF/ViewModels/AnimationControlViewModel.cs @@ -1301,7 +1301,7 @@ namespace NavisworksTransport.UI.WPF.ViewModels ClearAnimatedObjectCommand = new RelayCommand(ExecuteClearAnimatedObject, () => HasSelectedAnimatedObject); EditObjectRotationCommand = new RelayCommand(ExecuteEditObjectRotation, () => HasSelectedAnimatedObject); GenerateAnimationCommand = new RelayCommand(ExecuteGenerateAnimation, () => CanGenerateAnimation); - AddToBatchQueueCommand = new RelayCommand(ExecuteAddToBatchQueue, () => CanGenerateAnimation); + AddToBatchQueueCommand = new RelayCommand(() => ExecuteAddToBatchQueue(), () => CanGenerateAnimation); ApplyManualTargetsFromSelectionCommand = new RelayCommand(ExecuteApplyManualTargetsFromSelection); ClearManualTargetsCommand = new RelayCommand(ExecuteClearManualTargets, () => HasManualCollisionTargets); RemoveManualTargetCommand = new RelayCommand(ExecuteRemoveManualTarget, target => target != null); @@ -4880,29 +4880,19 @@ namespace NavisworksTransport.UI.WPF.ViewModels double largeModelThresholdMb = ConfigManager.Instance.Current?.Batch?.LargeModelFileSizeMb ?? 50.0; if (modelFileSizeMb >= largeModelThresholdMb) { - LogManager.Info($"[大模型评估] 模型 {modelFileSizeMb:F0} MB >= 阈值 {largeModelThresholdMb:F0} MB,引导使用批处理"); - var confirm = System.Windows.MessageBox.Show( - $"检测到大型模型({modelFileSizeMb:F0} MB)。非手工指定模式的全模型碰撞检测预计耗时很长。\n\n" + - $"• 是:加入批处理队列(推荐——使用剖面盒副实例检测,显著加速,检测结果完整落库)\n" + - $"• 否:继续在当前进程检测(耗时可能很长)\n\n" + - $"(阈值可在 config.toml [batch] large_model_file_size_mb 调整,当前 {largeModelThresholdMb:F0} MB)", - "大型模型检测建议", - System.Windows.MessageBoxButton.YesNo, - System.Windows.MessageBoxImage.Warning); - - if (confirm == System.Windows.MessageBoxResult.Yes) - { - Mouse.OverrideCursor = oldCursor; - ExecuteAddToBatchQueue(); - System.Windows.MessageBox.Show( - "已将当前配置加入批处理队列,请到批处理页签启动执行。", - "已加入批处理", - System.Windows.MessageBoxButton.OK, - System.Windows.MessageBoxImage.Information); - return; - } - - LogManager.Info("[大模型评估] 用户选择继续在当前进程检测"); + LogManager.Info($"[大模型评估] 模型 {modelFileSizeMb:F0} MB >= 阈值 {largeModelThresholdMb:F0} MB,自动加入批处理"); + Mouse.OverrideCursor = oldCursor; + ExecuteAddToBatchQueue(skipExcludedListConfirmation: true); + System.Windows.MessageBox.Show( + $"检测到大型模型({modelFileSizeMb:F0} MB,阈值 {largeModelThresholdMb:F0} MB)。\n" + + $"非手工指定模式的全模型碰撞检测耗时较长——已自动将当前配置加入批处理队列\n" + + $"(使用剖面盒副实例检测,显著加速)。\n\n" + + $"请到批处理页签启动执行。\n\n" + + $"(阈值可在 config.toml [batch] large_model_file_size_mb 调整)", + "已加入批处理(大模型自动引导)", + System.Windows.MessageBoxButton.OK, + System.Windows.MessageBoxImage.Information); + return; } } @@ -6079,7 +6069,7 @@ namespace NavisworksTransport.UI.WPF.ViewModels /// /// 添加到批处理队列 /// - private async void ExecuteAddToBatchQueue() + private async void ExecuteAddToBatchQueue(bool skipExcludedListConfirmation = false) { try { @@ -6095,9 +6085,9 @@ namespace NavisworksTransport.UI.WPF.ViewModels return; } - // 🔥 检查排除列表是否已设置 + // 🔥 检查排除列表是否已设置(自动加入场景(大模型引导)跳过确认——用户意图已明确) var excludedObjects = _pathAnimationManager?.GetExcludedObjects(); - if (excludedObjects == null || excludedObjects.Count == 0) + if (!skipExcludedListConfirmation && (excludedObjects == null || excludedObjects.Count == 0)) { LogManager.Warning("[批处理] 排除列表为空,提示用户"); var result = System.Windows.MessageBox.Show(