瀏覽代碼

日志修改

样式分支
pry 2 年之前
父節點
當前提交
b31b96edf5
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. +4
    -4
      BPASmartClient.Device/BaseDevice.cs

+ 4
- 4
BPASmartClient.Device/BaseDevice.cs 查看文件

@@ -66,7 +66,7 @@ namespace BPASmartClient.Device
/// <summary>
/// 设备运行日志
/// </summary>
public ConcurrentDictionary<string, object> Log { get; set; }=new ConcurrentDictionary<string, object>();
public ConcurrentDictionary<string, object> Log { get; set; } = new ConcurrentDictionary<string, object>();
/// <summary>
/// 设备运行告警与错误
/// </summary>
@@ -87,7 +87,7 @@ namespace BPASmartClient.Device
/// <param name="info"></param>
public void DeviceProcessLogShow(string info)
{
DeviceProcessLog.Add(info);
Log.TryAdd(DeviceId.ToString(), new { Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Type = "流程", Text = info });
MessageLog.GetInstance.DeviceProcessLogShow(DeviceId.ToString(), info);
}

@@ -109,8 +109,8 @@ namespace BPASmartClient.Device
public virtual void StartMain()
{
#region 测试添加几个日志与告警
Log.TryAdd(Guid.NewGuid().ToString(), new {Time=DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),Type="运行",Text="正常启动" });
Log.TryAdd(Guid.NewGuid().ToString(), new { Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Type = "打料", Text = "开始打料" });
//Log.TryAdd(Guid.NewGuid().ToString(), new {Time=DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),Type="运行",Text="正常启动" });
//Log.TryAdd(Guid.NewGuid().ToString(), new { Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Type = "打料", Text = "开始打料" });

Error.TryAdd(Guid.NewGuid().ToString(), new { Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Type = "落碗", Text = "落碗异常" });
Error.TryAdd(Guid.NewGuid().ToString(), new { Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Type = "煮面机", Text = "煮面机温度异常" });


Loading…
取消
儲存