schangxiang@126.com
2024-08-28 b249dbdaefbe42bc054533c9ebfbfd58fab33885
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
44
45
46
 
using iWare_SCADA_Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace iWare_SCADA_BusinessLogical.Utils
{
    /// <summary>
    /// 监控帮助类,测试用,后期要去掉
    /// </summary>
    public class MonitorHelper
    {
        /// <summary>
        /// 监控OP3501,测试用,后期要去掉
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public static void MonitorTestForOP3501(DataCaptureConfig _dataCaptureConfig, object value, List<DataCaptureColumnConfig> colConfig, WorkPieceLog wplog)
        {
            try
            {
                if (_dataCaptureConfig.DataCapturePointCode == "OP3501")
                {
                    //记录下 触发的点位和找到的二维码值
                    var str = "";
                    str = $"OP3501 触发的点位 DbNumber:{_dataCaptureConfig.DbNumber},Offset:{_dataCaptureConfig.Offset},值是{value.ToString()}";
 
                    var col = colConfig.First(o => o.DataCapturePointCode == _dataCaptureConfig.DataCapturePointCode && o.DataCapturePointCname == "二维码");
 
                    str += $",获取二维码值 DbNumber:{col.DbNumber},Offset:{col.Offset},值是{wplog.WorkPieceID.ToString()}";
                    //str += $",整体对象 wplog是{JsonConvert.SerializeObject(wplog)}";
 
                    Log4NetHelper.WriteInfoLog(LogType.MonitorTest, str);
                }
            }
            catch (Exception ex)
            {
                Log4NetHelper.WriteErrorLog(LogType.MonitorTest, "MonitorTestForOP3501异常", ex);
            }
        }
    }
}