123
ningshuxia
2023-04-13 eb32b4263f6901bb7ac1915b400e4fe28db20ef0
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
43
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace IStation.DataDockingApi
{
    /// <summary>
    /// 生成调试信息辅助类
    /// </summary>
    internal class DebugHelper
    {
        private const string _logName = "API_YS";
 
        /// <summary>
        /// 调试
        /// </summary>
        public static void Debug(List<Record> record_list)
        {
            var debug_list = new List<Model.MonitorDataDockingDebugRecord>();
            foreach (var debug_record in record_list)
            {
                var debug_recordContent = JsonHelper.Json2Object<RecordContent>(debug_record.vals);
                if (debug_recordContent != null)
                {
                    var debug_item = new Model.MonitorDataDockingDebugRecord();
                    debug_item.SignId = debug_record.key;
                    debug_item.RecordType = Model.eMonitorType.General;
                    debug_item.SrcTime = debug_recordContent.time;
                    debug_item.SrcValue = debug_recordContent.value;
                    debug_list.Add(debug_item);
                }
            }
            if (debug_list != null && debug_list.Count > 0)
            {
                var json = JsonHelper.Object2Json(debug_list);
                LogHelper.Custom(_logName,json);
            }
        }
 
    }
}