lixiaojun
2024-11-19 a5b6334ae09f2be1a5c073169458b55df68b0b2e
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
38
39
40
41
42
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);
            }
        }
 
    }
}