设备数量不对等适配

This commit is contained in:
hsc
2026-06-22 17:22:21 +08:00
parent cba9af2892
commit 1faae12822
2 changed files with 55 additions and 8 deletions

View File

@@ -1,4 +1,6 @@
using System;
using DeviceCommand.Base;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -13,6 +15,10 @@ namespace UIShare.GlobalVariable
public Dictionary<string,StepRunning> StepRunningDic { get; set; }
public Dictionary<string, SystemConfig> ConfigDic { get; set; }
public Dictionary<string, IScopedProvider> ScopeDic { get; set; }
/// <summary>硬件指纹 → 设备实例的并发池,确保同一物理硬件全局只创建一个驱动实例。</summary>
public ConcurrentDictionary<string, Lazy<IBaseInterface>> HardwarePool { get; set; }
public String UserName { get; set; } = "Not Logged in";
public bool IsAdmin { get; set; } = true;
public string CurrentOpeningScope;
@@ -35,6 +41,7 @@ namespace UIShare.GlobalVariable
StepRunningDic = new();
ConfigDic = new();
ScopeDic = new();
HardwarePool = new ConcurrentDictionary<string, Lazy<IBaseInterface>>(StringComparer.OrdinalIgnoreCase);
CurrentScope = "default";
}