lixiaojun
2022-08-02 66b07025421f9a1c68c9298b3cc8345280bfc0c7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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> src_list)
        {
            if (src_list == null || src_list.Count < 1)
                return;
            var debug_list = new List<Model.MonitorDataDockingDebugRecord>();
            foreach (var record in src_list)
            {
                var debugRecord = new Model.MonitorDataDockingDebugRecord();
                debugRecord.SignId = record.SignId;
                debugRecord.RecordType = record.RecordType;
                debugRecord.SrcTime = record.SrcTime?.ToString("yyyy-MM-dd HH:mm:ss");
                debugRecord.SrcValue = record.SrcValue;
                debug_list.Add(debugRecord);
            }
            var json = JsonHelper.Object2Json(debug_list);
            LogHelper.Custom(_logName, json);
        }
    }
}