杨前锦
2025-05-26 d0a265713fd18162f3a82bdcd22e267df7298c7b
HH.WCS.Mobox3/HH.WCS.Mobox3.YNJT_PT/util/Settings.cs
@@ -15,15 +15,13 @@
        public static string HASeverUrl { get; set; }
        public static string SqlServer { get; set; }
        public static string SqlServer1 { get; set; }
        public static List<deviceInfo> deviceInfos { get; set; }
        public static List<ConnectLoc> connectLocList { get; set; }
        public static int port { get; set; }
        public static string WHCode { get; set; }
        public static string FacCode { get; set; }
        public static string listenAddress { get; set; }
        public static int WaitTime { get; set; }
        public static string BufferArea { get; set; }
        public static List<AgvAlarmNo> agvAlarmNoList { get; set; }
        public static List<AlertorDeviceInfo> alertorLightInfos { get; set; }
        public static string abnormalArea { get; set; }
        public static string stockArea { get; set; }
        public static void Init() {
            LogHelper.Info("加载配置文件信息 开始");
@@ -55,29 +53,18 @@
                            if (keyValue.Name == "ApiPort") {
                                port = int.Parse(keyValue.Value.ToString());
                            }
                            if (keyValue.Name == "DeviceInfo") {
                                deviceInfos = JsonConvert.DeserializeObject<List<deviceInfo>>(keyValue.Value.ToString());
                            if (keyValue.Name == "ConnectLoc") {
                                connectLocList = JsonConvert.DeserializeObject<List<ConnectLoc>>(keyValue.Value.ToString());
                            }
                            if (keyValue.Name == "ListenAddress")
                            if (keyValue.Name == "AbnormalArea")
                            {
                                listenAddress = keyValue.Value.ToString();
                                abnormalArea = keyValue.Value.ToString();
                            }
                            if (keyValue.Name == "WaitTime")
                            if (keyValue.Name == "StockArea")
                            {
                                WaitTime = JsonConvert.DeserializeObject<int>(keyValue.Value.ToString());
                                stockArea = keyValue.Value.ToString();
                            }
                            if (keyValue.Name == "BufferArea")
                            {
                                BufferArea = keyValue.Value.ToString();
                            }
                            if (keyValue.Name == "AlertorLightDevice")
                            {
                                alertorLightInfos = JsonConvert.DeserializeObject<List<AlertorDeviceInfo>>(keyValue.Value.ToString());
                            }
                            if (keyValue.Name == "AgvAlarmNo")
                            {
                                agvAlarmNoList = JsonConvert.DeserializeObject<List<AgvAlarmNo>>(keyValue.Value.ToString());
                            }
                        }
                    }
                }
@@ -89,43 +76,13 @@
        }
        /*  public static AlertorDeviceInfo getAlertorAdress(int deviceNo)
          {
              var alertorDeviceInfo = alertorLightInfos.Where(a => a.deviceNo == deviceNo).FirstOrDefault();
              return alertorDeviceInfo;
          }*/
        public class AgvAlarmNo
        public class ConnectLoc
        {
            public string locCode { get; set; }
            public int roadway { get; set; }
            public int type { get; set; }
            public int dex { get; set; }
            public string code { get; set; }
            public string name { get; set; }
        }
        public class AlertorDeviceInfo
        {
            public int deviceNo { get; set; }
            public string address { get; set; }
            public string turnLight { get; set; }
            public string offLight { get; set; }
        }
        public class deviceInfo
        {
            public string address { get; set; }
            public string deviceName { get; set; }
            public string[] deviceNo { get; set; }
            public string[] location { get; set; }
            public int deviceType { get; set; }
            public int enable { get; set; }
        }
        public class TableName
        {
            public string name { get; set; }
            public string code { get; set; }
        }
    }
}