using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace IStation.DataDockingSocket
|
{
|
/// <summary>
|
/// 生成调试信息辅助类
|
/// </summary>
|
internal class DebugHelper
|
{
|
private const string _logName = "socket-kq";
|
|
/// <summary>
|
/// 生成
|
/// </summary>
|
public static void Debug(List<Model.MonitorDataDockingSrcRecord> srcList)
|
{
|
if (srcList == null || srcList.Count < 1)
|
return;
|
var debugList = new List<Model.MonitorDataDockingDebugRecord>();
|
foreach (var srcRecord in srcList)
|
{
|
var debugRecord = new Model.MonitorDataDockingDebugRecord();
|
debugRecord.SignId = srcRecord.SignId;
|
debugRecord.RecordType = srcRecord.RecordType;
|
debugRecord.SrcTime = srcRecord.SrcTime.ToString("yyyy-MM-dd HH:mm:ss");
|
debugRecord.SrcValue = srcRecord.SrcValue;
|
debugList.Add(debugRecord);
|
}
|
var json = JsonHelper.Object2Json(debugList);
|
LogHelper.Custom(_logName, json);
|
}
|
|
}
|
}
|