lss
2025-05-29 cb58fdbdc4391136e7176210e3f1969606f11903
HH.WCS.Mobox3/HH.WCS.Mobox3.JiaTong/process/DeviceProcess.cs
@@ -7,6 +7,7 @@
using S7.Net;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using static HH.WCS.JiaTong.LISTA.process.HttpModel;
@@ -155,6 +156,8 @@
            }
        }
        public static Dictionary<string, DpjErrorInfo> DpjInfoDirectory = new Dictionary<string, DpjErrorInfo>();
        /// <summary>
        /// 井松叠盘机叠盘回库
        /// </summary>
@@ -171,7 +174,28 @@
                    {
                        var IsDp = S7Helper.ReadDpj(device.address,2001, S7.Net.VarType.Byte);
                        var value = S7Helper.ReadDpj(device.address,2014, S7.Net.VarType.Int);
                        var ErrorCode = S7Helper.ReadDpj(device.address, 2016, S7.Net.VarType.Int);
                        //记录叠盘机报错信息
                        if (DpjInfoDirectory.ContainsKey(device.address))
                        {
                            DpjInfoDirectory[device.address].Address = device.address;
                            DpjInfoDirectory[device.address].DeviceName = device.deviceName;
                            var ErrorInfo = Settings.dpjErrorInfos.Where(a => a.ErrorCode == ErrorCode).First();
                            if (ErrorInfo != null)
                            {
                                DpjInfoDirectory[device.address].ErrorInfo = ErrorInfo.ErrorInfo;
                            }
                        }
                        else
                        {
                            string errorinfo = "";
                            var ErrorInfo = Settings.dpjErrorInfos.Where(a => a.ErrorCode == ErrorCode).First();
                            if (ErrorInfo != null)
                            {
                                errorinfo = ErrorInfo.ErrorInfo;
                            }
                            DpjInfoDirectory.Add(device.address, new DpjErrorInfo() { Address = device.address, DeviceName = device.deviceName, ErrorInfo = errorinfo });
                        }
                        if (value >= 1 && IsDp == 1)
                        {
                            //var cntr = db.Queryable<LocCntrRel>().Where(a => a.S_LOC_CODE.Trim() == item.S_CODE).ToList();
@@ -245,5 +269,13 @@
                LogHelper.Info($"空托返回  Error=>{ex.ToString()}");
            }
        }
        public class DpjErrorInfo
        {
            public string Address { get; set; }
            public string DeviceName { get; set; }
            public string ErrorInfo { get; set; }
        }
    }
}