@@ -84,7 +84,7 @@ namespace BPASmartClient.Business | |||||
} | } | ||||
Thread.Sleep(50); | Thread.Sleep(50); | ||||
} | } | ||||
}, "MQTT 消息处理"); | |||||
}, "MQTT 消息处理", true); | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -116,7 +116,7 @@ namespace BPASmartClient.Business | |||||
} | } | ||||
Thread.Sleep(50); | Thread.Sleep(50); | ||||
} | } | ||||
}, $"MQTT 订单接收处理-设备[{deviceId}]"); | |||||
}, $"MQTT 订单接收处理-设备[{deviceId}]", true); | |||||
} | } | ||||
public void OrderStatusChangedHandle(IEvent @event, EventCallBackHandle callBack) | public void OrderStatusChangedHandle(IEvent @event, EventCallBackHandle callBack) | ||||
@@ -44,7 +44,7 @@ namespace BPASmartClient.Business | |||||
} | } | ||||
Thread.Sleep(50); | Thread.Sleep(50); | ||||
} | } | ||||
}, "设备状态收集"); | |||||
}, "设备状态收集", true); | |||||
deviceStatus.BatchingInfo = new List<BPA.Models.BatchingInfo>(); | deviceStatus.BatchingInfo = new List<BPA.Models.BatchingInfo>(); | ||||
@@ -63,7 +63,7 @@ namespace BPASmartClient.Business | |||||
} | } | ||||
Thread.Sleep(1000); | Thread.Sleep(1000); | ||||
} | } | ||||
}, "设备心跳上报"); | |||||
}, "设备心跳上报", true); | |||||
} | } | ||||
public void Dispose() | public void Dispose() | ||||
@@ -46,7 +46,17 @@ namespace BPASmartClient.Device | |||||
/// </summary> | /// </summary> | ||||
public bool IsHealth { get; protected set; } | public bool IsHealth { get; protected set; } | ||||
//外设状态 | |||||
/// <summary> | |||||
/// 设备流程日志 | |||||
/// </summary> | |||||
public ConcurrentQueue<string> Log { get; set; } = new ConcurrentQueue<string>(); | |||||
/// <summary> | |||||
/// 错误报警集合 | |||||
/// </summary> | |||||
protected ConcurrentDictionary<string, object> Error = new ConcurrentDictionary<string, object>(); | |||||
//外设状态,硬件设备数据 | |||||
protected ConcurrentDictionary<string, object> peripheralStatus = new ConcurrentDictionary<string, object>(); | protected ConcurrentDictionary<string, object> peripheralStatus = new ConcurrentDictionary<string, object>(); | ||||
private List<IPeripheral> peripherals; | private List<IPeripheral> peripherals; | ||||
@@ -44,6 +44,7 @@ namespace BPASmartClient.Helper | |||||
CancellationTokenSources.TryAdd(guid + key, new CancellationTokenSource()); | CancellationTokenSources.TryAdd(guid + key, new CancellationTokenSource()); | ||||
bool result = Threads.TryAdd(guid + key, Task.Factory.StartNew(new Action(() => | bool result = Threads.TryAdd(guid + key, Task.Factory.StartNew(new Action(() => | ||||
{ | { | ||||
Thread.CurrentThread.Name = key; | |||||
ReStart: | ReStart: | ||||
try | try | ||||
{ | { | ||||
@@ -89,6 +90,7 @@ namespace BPASmartClient.Helper | |||||
CancellationTokenSources.TryAdd(guid + key, new CancellationTokenSource()); | CancellationTokenSources.TryAdd(guid + key, new CancellationTokenSource()); | ||||
bool result = Threads.TryAdd(guid + key, Task.Factory.StartNew(new Action(() => | bool result = Threads.TryAdd(guid + key, Task.Factory.StartNew(new Action(() => | ||||
{ | { | ||||
Thread.CurrentThread.Name = key; | |||||
try | try | ||||
{ | { | ||||
if (action != null) action(); | if (action != null) action(); | ||||
@@ -178,7 +178,6 @@ namespace BPASmartClient.MorkF | |||||
{ | { | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | ThreadManage.GetInstance().StartLong(new Action(() => | ||||
{ | { | ||||
IsHealth = true; //心跳 | IsHealth = true; //心跳 | ||||
TakePlatelTask(); | TakePlatelTask(); | ||||
TakePotTask(); | TakePotTask(); | ||||