refactor: 大模型评估改为自动加入批处理(对话框仅通知)

用户反馈:超过阈值用户必然选择'是'——去掉选择框,
自动加入批处理 + 通知弹窗。

改动:
- 大模型评估命中 → 自动 ExecuteAddToBatchQueue(跳过排除列表确认
  弹窗——用户意图已明确;ExecuteAddToBatchQueue 加可选参数
  skipExcludedListConfirmation)
- 通知弹窗:说明已自动加入 + 阈值可调,请到批处理页签启动
- AddToBatchQueueCommand 绑定改 lambda(方法签名变化)

验证:集成测试 25/25
This commit is contained in:
tian 2026-08-07 11:11:12 +08:00
parent 3884d05717
commit 2294146146

View File

@ -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<ManualCollisionTargetViewModel>(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
/// <summary>
/// 添加到批处理队列
/// </summary>
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(