|
|
@@ -5,6 +5,7 @@ using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Text; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using System.Collections.Concurrent; |
|
|
|
|
|
|
|
namespace BPASmartClient.Business |
|
|
|
{ |
|
|
@@ -22,7 +23,7 @@ namespace BPASmartClient.Business |
|
|
|
private bool wholeDeviceHealth; |
|
|
|
|
|
|
|
|
|
|
|
private Dictionary<int, Dictionary<string, object>> wholeDeviceStatus = new Dictionary<int, Dictionary<string, object>>(); |
|
|
|
private ConcurrentDictionary<int, ConcurrentDictionary<string, object>> wholeDeviceStatus = new ConcurrentDictionary<int, ConcurrentDictionary<string, object>>(); |
|
|
|
|
|
|
|
public void Initialize() |
|
|
|
{ |
|
|
@@ -41,7 +42,7 @@ namespace BPASmartClient.Business |
|
|
|
wholeDeviceHealth = true; |
|
|
|
foreach (var device in deviceMgr.GetDevices()) |
|
|
|
{ |
|
|
|
wholeDeviceStatus[device.DeviceId] = device.Status.GetStatus(); |
|
|
|
wholeDeviceStatus[device.DeviceId] = device.Status.GetStatus(); |
|
|
|
} |
|
|
|
Thread.Sleep(50); |
|
|
|
} |
|
|
@@ -56,7 +57,8 @@ namespace BPASmartClient.Business |
|
|
|
wholeDeviceHealth = true; |
|
|
|
foreach (var device in deviceMgr.GetDevices()) |
|
|
|
{ |
|
|
|
wholeDeviceStatus[device.DeviceId] = device.Status.GetStatus(); |
|
|
|
var s = device.Status.GetStatus(); |
|
|
|
wholeDeviceStatus[device.DeviceId] = s; |
|
|
|
|
|
|
|
deviceStatus.Healthy = device.IsHealth ? BPA.Message.Enum.DeviceHealthy.Health : BPA.Message.Enum.DeviceHealthy.UnHealth; |
|
|
|
deviceStatus.DeviceType = device.DeviceType; |
|
|
|