namespace IStation.DataDockingSocket
|
{
|
/// <summary>
|
/// 生成调试信息辅助类
|
/// </summary>
|
internal class DebugHelper
|
{
|
private const string _logName = "socket-szjt-szy1-debug";
|
|
/// <summary>
|
/// 生成
|
/// </summary>
|
public static void Debug(List<MiddleRecord> list)
|
{
|
if (list == null || list.Count < 1)
|
{
|
return;
|
}
|
var debug_list = new List<Yw.Model.MonitorDataDockingDebugRecord>();
|
foreach (var record in list)
|
{
|
var debug_item = new Yw.Model.MonitorDataDockingDebugRecord();
|
debug_item.TransferId = record.SignId;
|
debug_item.SrcTime = record.DataTime.ToString("yyyy-MM-dd HH:mm:ss");
|
debug_item.SubList.Add(new Yw.Model.MonitorDataDockingDebugSubRecord()
|
{
|
TransferId = "",
|
SrcValue = record.DataValue
|
});
|
|
debug_list.Add(debug_item);
|
}
|
|
if (debug_list != null && debug_list.Count > 0)
|
{
|
var json = JsonHelper.Object2Json(debug_list);
|
LogHelper.Custom(_logName, json);
|
}
|
}
|
|
}
|
}
|