|
|
@@ -153,36 +153,37 @@ namespace BPASmartClient.Device |
|
|
|
Status.Update($"{TypeName}.{key}", peripheral.GetAllStatus()[key]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
foreach (var item in Status.GetStatusT()) |
|
|
|
if (AddErrorAction != null && DeleteErrorAction != null) |
|
|
|
{ |
|
|
|
if (item.Name == "Warning" || item.Name == "Fault") |
|
|
|
foreach (var item in Status.GetStatusT()) |
|
|
|
{ |
|
|
|
if (item.Status != "无故障" && item.Status != "无警告" && item.Status != "未发生故障") |
|
|
|
if (item.Name == "Warning" || item.Name == "Fault") |
|
|
|
{ |
|
|
|
var res = Error?.FirstOrDefault(p => p.GetType().GetProperty("Text").GetValue(p).ToString() == item.Ms); |
|
|
|
if (res == null) |
|
|
|
if (item.Status != "无故障" && item.Status != "无警告" && item.Status != "未发生故障") |
|
|
|
{ |
|
|
|
object obj = new |
|
|
|
var res = Error?.FirstOrDefault(p => p.GetType().GetProperty("Text").GetValue(p).ToString() == item.Ms); |
|
|
|
if (res == null) |
|
|
|
{ |
|
|
|
Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
|
|
|
Type = item.Name == "Warning" ? "警告" : "故障", |
|
|
|
Text = item.Ms |
|
|
|
}; |
|
|
|
Error.Add(obj); |
|
|
|
AddErrorAction?.Invoke(obj); |
|
|
|
object obj = new |
|
|
|
{ |
|
|
|
Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
|
|
|
Type = item.Name == "Warning" ? "警告" : "故障", |
|
|
|
Text = item.Ms |
|
|
|
}; |
|
|
|
Error.Add(obj); |
|
|
|
AddErrorAction?.Invoke(obj); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var res = Error?.FirstOrDefault(p => p.GetType().GetProperty("Text").GetValue(p).ToString().Contains(item.id)); |
|
|
|
if (res != null) |
|
|
|
else |
|
|
|
{ |
|
|
|
Error.Remove(res); |
|
|
|
DeleteErrorAction?.Invoke(res); |
|
|
|
var res = Error?.FirstOrDefault(p => p.GetType().GetProperty("Text").GetValue(p).ToString().Contains(item.id)); |
|
|
|
if (res != null) |
|
|
|
{ |
|
|
|
Error.Remove(res); |
|
|
|
DeleteErrorAction?.Invoke(res); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|