修复显示两个检测报告窗口的bug
This commit is contained in:
parent
810f874a50
commit
30d89b8ad7
@ -407,39 +407,9 @@ namespace NavisworksTransport.UI.WPF.ViewModels
|
||||
|
||||
#region 构造函数
|
||||
|
||||
public AnimationControlViewModel() : base()
|
||||
public AnimationControlViewModel() : this(null)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 初始化管理器
|
||||
_pathAnimationManager = new NavisworksTransport.Core.Animation.PathAnimationManager();
|
||||
_logisticsAnimationManager = new NavisworksTransport.Core.Animation.LogisticsAnimationManager();
|
||||
_clashIntegration = ClashDetectiveIntegration.Instance;
|
||||
_uiStateManager = UIStateManager.Instance;
|
||||
|
||||
// 订阅PathAnimationManager事件
|
||||
_pathAnimationManager.ProgressChanged += OnAnimationProgressChanged;
|
||||
_pathAnimationManager.StateChanged += OnAnimationStateChanged;
|
||||
|
||||
// 初始化集合
|
||||
AvailableFrameRates = new ThreadSafeObservableCollection<int>();
|
||||
|
||||
// 初始化设置
|
||||
InitializeAnimationSettings();
|
||||
|
||||
// 初始化命令
|
||||
InitializeCommands();
|
||||
|
||||
// 移除重复的碰撞检测事件订阅,只在带参构造函数中保留
|
||||
// _clashIntegration.CollisionDetected += OnCollisionDetected;
|
||||
|
||||
LogManager.Info("AnimationControlViewModel初始化完成(含缓存管理)");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogManager.Error($"AnimationControlViewModel初始化失败: {ex.Message}", ex);
|
||||
throw;
|
||||
}
|
||||
// 调用带参数的构造函数,传入null
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -16,10 +16,9 @@ namespace NavisworksTransport.UI.WPF.Views
|
||||
/// </summary>
|
||||
public AnimationControlViewModel ViewModel { get; private set; }
|
||||
|
||||
public AnimationControlView()
|
||||
public AnimationControlView() : this(null)
|
||||
{
|
||||
InitializeComponent();
|
||||
InitializeViewModel();
|
||||
// 调用带参数的构造函数,传入null
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -62,7 +62,7 @@ NavisworksTransport 主控制面板 - 采用与其他视图一致的Navisworks 2
|
||||
|
||||
<TabItem Header="检测动画" Name="AnimationControlTab" Style="{StaticResource NavisworksTabItemStyle}">
|
||||
<Border Background="White" CornerRadius="0">
|
||||
<views:AnimationControlView x:Name="AnimationControlView" Margin="0"/>
|
||||
<ContentControl x:Name="AnimationControlContent" Margin="0"/>
|
||||
</Border>
|
||||
</TabItem>
|
||||
|
||||
|
||||
@ -23,6 +23,9 @@ namespace NavisworksTransport.UI.WPF
|
||||
// 类别设置视图
|
||||
private ModelSettingsView _modelSettingsView;
|
||||
|
||||
// 动画控制视图
|
||||
public AnimationControlView AnimationControlView { get; private set; }
|
||||
|
||||
// 管理器实例
|
||||
private PathPlanningManager _pathPlanningManager;
|
||||
private static bool _isSessionInitialized = false;
|
||||
@ -155,23 +158,23 @@ namespace NavisworksTransport.UI.WPF
|
||||
{
|
||||
try
|
||||
{
|
||||
// 重新创建AnimationControlView,传入主ViewModel引用
|
||||
// 创建AnimationControlView,传入主ViewModel引用
|
||||
var newAnimationControlView = new AnimationControlView(ViewModel);
|
||||
|
||||
// 替换XAML中的AnimationControlView
|
||||
if (AnimationControlTab?.Content is Border animationControlBorder)
|
||||
// 设置到ContentControl中
|
||||
if (AnimationControlContent != null)
|
||||
{
|
||||
animationControlBorder.Child = newAnimationControlView;
|
||||
AnimationControlContent.Content = newAnimationControlView;
|
||||
|
||||
// 更新引用
|
||||
AnimationControlView = newAnimationControlView;
|
||||
}
|
||||
|
||||
if (AnimationControlView?.ViewModel != null)
|
||||
{
|
||||
// 动画控制视图现在通过PathEditingView获取路径信息
|
||||
LogManager.Info("AnimationControlView初始化完成 - 支持统一状态栏");
|
||||
}
|
||||
else
|
||||
{
|
||||
LogManager.Error("AnimationControlContent占位符未找到");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user