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(