设备加载页

This commit is contained in:
“hsc”
2026-08-31 15:30:53 +08:00
parent 3b7a41d7f8
commit d35e451c40
5 changed files with 72 additions and 6 deletions
@@ -234,11 +234,23 @@ namespace MainModule.ViewModels
#region
private async Task OnLoad()
{
if (!IsInitialized)
// 设备初始化期间仅对当前台架显示灰度遮罩层,初始化完成后关闭(finally 保证异常时也能关闭)
_eventAggregator.GetEvent<ScopeOverlayEvent>().Publish(new ScopeOverlayArgs { Scope = TestStatus, Show = true });
// 让遮罩层先完成渲染,再进入同步阻塞的设备初始化(泵送 Dispatcher 至 Render 优先级)
System.Windows.Application.Current?.Dispatcher.Invoke(() => { }, System.Windows.Threading.DispatcherPriority.Render);
try
{
await _deviceManager.ConnectAllDevices();
IsInitialized = true;
if (!IsInitialized)
{
await _deviceManager.ConnectAllDevices();
IsInitialized = true;
}
}
finally
{
_eventAggregator.GetEvent<ScopeOverlayEvent>().Publish(new ScopeOverlayArgs { Scope = TestStatus, Show = false });
}
}
private void OnRefresh()