林豪 左 1 年之前
父節點
當前提交
1002b9de8c

+ 15 - 2
WCS.Core/Device.cs

@@ -186,6 +186,11 @@ namespace WCS.Core
             Flags[key].Add(flag);
         }
 
+        //public void SetFlag(string flag)
+        //{
+        //    SetFlag("Globals", flag);
+        //}
+
         public void SetFlag(string key, string flag)
         {
             var list = new List<string>();
@@ -210,9 +215,17 @@ namespace WCS.Core
             if (!Flags.ContainsKey(key))
                 return false;
             return Flags[key].Contains(flag);
-        } 
+        }
+
+        public bool HasFlagKey(string key)
+        {
+            return Flags.ContainsKey(key);
+        }
+        //public bool HasFlag(string flag)
+        //{
+        //    return HasFlag("Globals", flag);
+        //}
 
-      
         public void AddFlag<T>(T flag) where T : struct, Enum
         {
             var key = typeof(T).AssemblyQualifiedName;

+ 5 - 1
WCS.Core/System.cs

@@ -28,7 +28,11 @@ namespace WCS.Core
         /// <summary>
         /// 对所有Objects并行循环执行Do
         /// </summary>
-        protected abstract bool ParallelDo { get; } 
+        protected abstract bool ParallelDo { get; }
+        /// <summary>
+        /// 保存日志到文件
+        /// </summary>
+        protected abstract bool SaveLogsToFile { get; }
 
         public SystemBase()
         {

+ 2 - 22
WcsFramework.sln

@@ -21,14 +21,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PlcSiemens", "PLC.Siemens\P
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ServiceCenter", "ServiceCenter\ServiceCenter.csproj", "{584F95DC-6D93-440A-AD69-F88F90A53DB4}"
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "分拣库", "分拣库", "{D5DB0F10-73EE-4B54-A00E-2E6A33229B95}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "时效库", "时效库", "{5C319C8D-9EC2-4C1E-9924-437DB3239AE1}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WCS.Entity.Protocol", "业务工程\时效库\WCS.Entity.Protocol\WCS.Entity.Protocol.csproj", "{A492ECC8-9874-4D75-A279-79F908803B25}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WCS.WorkEngineering", "业务工程\时效库\WCS.WorkEngineering\WCS.WorkEngineering.csproj", "{CD308645-A4F6-4AC4-891B-B7AE0547EA08}"
-EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WCS.Entity.Protocol", "业务工程\分拣库\WCS.Entity.Protocol\WCS.Entity.Protocol.csproj", "{98372FF1-0B5C-4FC1-A34A-44306F9DBD13}"
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WCS.WorkEngineering", "业务工程\分拣库\WCS.WorkEngineering\WCS.WorkEngineering.csproj", "{0AF64876-D5EA-426F-A349-0BF7593067EF}"
@@ -65,14 +57,6 @@ Global
 		{584F95DC-6D93-440A-AD69-F88F90A53DB4}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{584F95DC-6D93-440A-AD69-F88F90A53DB4}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{584F95DC-6D93-440A-AD69-F88F90A53DB4}.Release|Any CPU.Build.0 = Release|Any CPU
-		{A492ECC8-9874-4D75-A279-79F908803B25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{A492ECC8-9874-4D75-A279-79F908803B25}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{A492ECC8-9874-4D75-A279-79F908803B25}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{A492ECC8-9874-4D75-A279-79F908803B25}.Release|Any CPU.Build.0 = Release|Any CPU
-		{CD308645-A4F6-4AC4-891B-B7AE0547EA08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{CD308645-A4F6-4AC4-891B-B7AE0547EA08}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{CD308645-A4F6-4AC4-891B-B7AE0547EA08}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{CD308645-A4F6-4AC4-891B-B7AE0547EA08}.Release|Any CPU.Build.0 = Release|Any CPU
 		{98372FF1-0B5C-4FC1-A34A-44306F9DBD13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{98372FF1-0B5C-4FC1-A34A-44306F9DBD13}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{98372FF1-0B5C-4FC1-A34A-44306F9DBD13}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -96,12 +80,8 @@ Global
 		{977B3F9A-1CB4-4CF2-A0A2-B95A6011933A} = {C783651F-7EB6-40BA-8E68-525F93B8FCED}
 		{DB454F36-DE7B-4A9B-9A8B-8E2C3C4F81B7} = {C783651F-7EB6-40BA-8E68-525F93B8FCED}
 		{584F95DC-6D93-440A-AD69-F88F90A53DB4} = {C783651F-7EB6-40BA-8E68-525F93B8FCED}
-		{D5DB0F10-73EE-4B54-A00E-2E6A33229B95} = {FD3B782A-4A24-458C-B77F-6F46106AE2B4}
-		{5C319C8D-9EC2-4C1E-9924-437DB3239AE1} = {FD3B782A-4A24-458C-B77F-6F46106AE2B4}
-		{A492ECC8-9874-4D75-A279-79F908803B25} = {5C319C8D-9EC2-4C1E-9924-437DB3239AE1}
-		{CD308645-A4F6-4AC4-891B-B7AE0547EA08} = {5C319C8D-9EC2-4C1E-9924-437DB3239AE1}
-		{98372FF1-0B5C-4FC1-A34A-44306F9DBD13} = {D5DB0F10-73EE-4B54-A00E-2E6A33229B95}
-		{0AF64876-D5EA-426F-A349-0BF7593067EF} = {D5DB0F10-73EE-4B54-A00E-2E6A33229B95}
+		{98372FF1-0B5C-4FC1-A34A-44306F9DBD13} = {FD3B782A-4A24-458C-B77F-6F46106AE2B4}
+		{0AF64876-D5EA-426F-A349-0BF7593067EF} = {FD3B782A-4A24-458C-B77F-6F46106AE2B4}
 		{38A8241F-E038-449B-9B47-E3AB4B02DC10} = {C783651F-7EB6-40BA-8E68-525F93B8FCED}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution

+ 1 - 1
业务工程/分拣库/WCS.WorkEngineering/Extensions/FlagExtension.cs

@@ -16,7 +16,7 @@ namespace WCS.WorkEngineering.Extensions
         /// <returns></returns>
         public static T GetFlag<T>(this Device device, string key)
         {
-            if (!device.HasFlag(key))
+            if (!device.HasFlagKey(key))
             {
                 if (typeof(T) == typeof(int)) device.AddFlag(key, default(int).ToString());
                 else if (typeof(T) == typeof(short)) device.AddFlag(key, default(bool).ToString());

+ 2 - 2
业务工程/分拣库/WCS.WorkEngineering/Systems/AgvSystems.cs

@@ -158,14 +158,14 @@ namespace WCS.WorkEngineering.Systems
 
                                                 case "1S":
                                                     positionList.AddRange(new List<string>() { "2701", "2705", "2709", "2713"/*"2501", "2505", "2509", "2513"*/ });
-                                                    break; 
+                                                    break;
 
                                                 case "2N":
                                                     positionList.AddRange(new List<string>() { "2901", "2905", "2909", "2913" });
                                                     break;
 
                                                 case "2S":
-                                                    positionList.AddRange(new List<string>() { "3101", "3105", "3109", "3113" });
+                                                    positionList.AddRange(new List<string>() { /*"3101", "3105", "3109", "3113"*/"2501", "2505", "2509", "2513" });
                                                     break;
 
                                                 case "3N":

+ 1 - 53
业务工程/分拣库/WCS.WorkEngineering/Systems/桁架码垛/桁架码垛区补空托盘任务生成.cs

@@ -14,7 +14,7 @@ namespace WCS.WorkEngineering.Systems
     /// <summary>
     ///  桁架码垛区补空托盘任务生成
     /// </summary>
-    [BelongTo(typeof(SortingPalletizingWorld))]
+   // [BelongTo(typeof(SortingPalletizingWorld))]
     [Description("桁架码垛区补空托盘任务生成")]
     public class TrussCreateEmptyTray : DeviceSystem<Device<IStation520>>
     {
@@ -24,59 +24,7 @@ namespace WCS.WorkEngineering.Systems
 
         public override void Do(Device<IStation520> obj)
         {
-            WCS_Palletizing palletizing = null;
-            SqlSugarHelper.Do(_db =>
-            {
-                var db = _db.Default;
-                //取一个时间最靠前的,没有绑定码垛工位的码垛记录
-                var palletizingInfo = db.Queryable<WCS_Palletizing>().OrderBy(x => x.AddTime).First(x => x.PalletizingStation == null && !x.Finish);
-                if (palletizingInfo == null) throw new Exception($"没有可用码垛信息");
-                //var palleTask = db.Queryable<WCS_TaskInfo>().First(x => x.ID == palletizingInfo.TaskId && (x.Status == TaskStatus.FinishOfShunt || x.Status == TaskStatus.ConveyorExecution));
-                //if (palleTask == null) throw new Exception($"未找到任务{palleTask.ID}");
-                //获取可以使用的放货站台信息
-                var taskAddNext = Device.All.FirstOrDefault(x => x.Code == palletizingInfo.TaskAddNext)?.Targets.FirstOrDefault()?.Targets.Where(x => x.HasFlag(DeviceFlags.桁架码垛位));
-                if (taskAddNext == null) throw new Exception($"未找到{palletizingInfo.TaskAddNext}可去的码垛工位");
-                var devs = Device.All.Where(x => taskAddNext.Contains(x)).Select(x => new Device<IStation520, IStation521, IStation523>(x, World)).ToList();
 
-                //获取所有的未结束且有码垛工位的码垛记录
-                var palletizingStation = db.Queryable<WCS_Palletizing>().Where(x => !x.Finish && x.PalletizingStation != null).Select(x => x.PalletizingStation).ToList();
-
-                //取一个可用用于码垛的地方
-                var dev = devs.Where(x => !palletizingStation.Contains(x.Entity.Code)).FirstOrDefault(x => !x.Data3.Status.HasFlag(StationStatus.PH_Status));
-                if (dev == null) throw new Exception($"没有可用码垛工位");
-
-                var addrFromCode = palletizingInfo.WarehouseCode switch
-                {
-                    "1N" => "1602",
-                    "1S" => "1612",
-                    "2N" => "1622",
-                    "2S" => "1632",
-                    "3N" => "1642",
-                    "3S" => "1652",
-                    _ => "9999"
-                };
-
-                var endDev = Device.All.Where(x => x.Code == addrFromCode).Select(x => new Device<IStation520>(x, World)).FirstOrDefault();
-                if (endDev.Data.TaskNumber != 0 || endDev.Data.GoodsEnd != 0) throw new Exception($"{endDev.Entity.Code}有残留任务信息,请处理!");
-
-                palletizingInfo.PalletizingStation = dev.Entity.Code;
-                db.Updateable(palletizingInfo).ExecuteCommand();
-                palletizing = palletizingInfo;
-            });
-            if (palletizing == null) return;
-            var addrFromCode = palletizing.WarehouseCode switch
-            {
-                "1N" => "1602",
-                "1S" => "1612",
-                "2N" => "1622",
-                "2S" => "1632",
-                "3N" => "1642",
-                "3S" => "1652",
-                _ => "9999"
-            };
-            var dev = Device.All.Where(x => x.Code == addrFromCode).Select(x => new Device<IStation520>(x, World)).FirstOrDefault();
-            dev.Data.TaskNumber = palletizing.Id;
-            dev.Data.GoodsEnd = palletizing.PalletizingStation!.ToShort();
         }
 
         public override bool Select(Device dev)

+ 22 - 22
业务工程/分拣库/WCS.WorkEngineering/Systems/桁架码垛/桁架缓存放行点.cs

@@ -138,28 +138,28 @@ namespace WCS.WorkEngineering.Systems
             _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "764"), World), Device.All.Where(x => x.Code is "764" or "765" or "766" or "767" or "768").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
             _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "778"), World), Device.All.Where(x => x.Code is "778" or "779" or "780" or "781" or "782").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
             _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "791"), World), Device.All.Where(x => x.Code is "791" or "792" or "793" or "794" or "795").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            ////库二北
-            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "866"), World), Device.All.Where(x => x.Code is "866" or "867" or "868" or "869" or "870").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "880"), World), Device.All.Where(x => x.Code is "880" or "881" or "882" or "883" or "884").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "894"), World), Device.All.Where(x => x.Code is "894" or "895" or "896" or "897" or "898").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "908"), World), Device.All.Where(x => x.Code is "908" or "909" or "910" or "911" or "912").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "922"), World), Device.All.Where(x => x.Code is "922" or "923" or "924" or "925" or "926").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "936"), World), Device.All.Where(x => x.Code is "936" or "937" or "938" or "939" or "940").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "950"), World), Device.All.Where(x => x.Code is "950" or "951" or "952" or "953" or "954").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "964"), World), Device.All.Where(x => x.Code is "964" or "965" or "966" or "967" or "968").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "978"), World), Device.All.Where(x => x.Code is "978" or "979" or "980" or "981" or "982").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "991"), World), Device.All.Where(x => x.Code is "991" or "992" or "993" or "994" or "995").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            ////库二南
-            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1066"), World), Device.All.Where(x => x.Code is "1066" or "1067" or "1068" or "1069" or "1070").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1080"), World), Device.All.Where(x => x.Code is "1080" or "1081" or "1082" or "1083" or "1084").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1094"), World), Device.All.Where(x => x.Code is "1094" or "1095" or "1096" or "1097" or "1098").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1108"), World), Device.All.Where(x => x.Code is "1108" or "1109" or "1110" or "1111" or "1112").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1122"), World), Device.All.Where(x => x.Code is "1122" or "1123" or "1124" or "1125" or "1126").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1136"), World), Device.All.Where(x => x.Code is "1136" or "1137" or "1138" or "1139" or "1140").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1150"), World), Device.All.Where(x => x.Code is "1150" or "1151" or "1152" or "1153" or "1154").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1164"), World), Device.All.Where(x => x.Code is "1164" or "1165" or "1166" or "1167" or "1168").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1178"), World), Device.All.Where(x => x.Code is "1178" or "1179" or "1180" or "1181" or "1182").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
-            //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1191"), World), Device.All.Where(x => x.Code is "1191" or "1192" or "1193" or "1194" or "1195").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //库二北
+            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "866"), World), Device.All.Where(x => x.Code is "866" or "867" or "868" or "869" or "870").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "880"), World), Device.All.Where(x => x.Code is "880" or "881" or "882" or "883" or "884").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "894"), World), Device.All.Where(x => x.Code is "894" or "895" or "896" or "897" or "898").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "908"), World), Device.All.Where(x => x.Code is "908" or "909" or "910" or "911" or "912").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "922"), World), Device.All.Where(x => x.Code is "922" or "923" or "924" or "925" or "926").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "936"), World), Device.All.Where(x => x.Code is "936" or "937" or "938" or "939" or "940").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "950"), World), Device.All.Where(x => x.Code is "950" or "951" or "952" or "953" or "954").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "964"), World), Device.All.Where(x => x.Code is "964" or "965" or "966" or "967" or "968").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "978"), World), Device.All.Where(x => x.Code is "978" or "979" or "980" or "981" or "982").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "991"), World), Device.All.Where(x => x.Code is "991" or "992" or "993" or "994" or "995").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            //库二南
+            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1066"), World), Device.All.Where(x => x.Code is "1066" or "1067" or "1068" or "1069" or "1070").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1080"), World), Device.All.Where(x => x.Code is "1080" or "1081" or "1082" or "1083" or "1084").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1094"), World), Device.All.Where(x => x.Code is "1094" or "1095" or "1096" or "1097" or "1098").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1108"), World), Device.All.Where(x => x.Code is "1108" or "1109" or "1110" or "1111" or "1112").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1122"), World), Device.All.Where(x => x.Code is "1122" or "1123" or "1124" or "1125" or "1126").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1136"), World), Device.All.Where(x => x.Code is "1136" or "1137" or "1138" or "1139" or "1140").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1150"), World), Device.All.Where(x => x.Code is "1150" or "1151" or "1152" or "1153" or "1154").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1164"), World), Device.All.Where(x => x.Code is "1164" or "1165" or "1166" or "1167" or "1168").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1178"), World), Device.All.Where(x => x.Code is "1178" or "1179" or "1180" or "1181" or "1182").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
+            _cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1191"), World), Device.All.Where(x => x.Code is "1191" or "1192" or "1193" or "1194" or "1195").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
             ////库三北
             //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1266"), World), Device.All.Where(x => x.Code is "1266" or "1267" or "1268" or "1269" or "1270").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());
             //_cacheDevices.Add(new Device<IStation524, IStation523>(Device.All.First(x => x.Code == "1280"), World), Device.All.Where(x => x.Code is "1280" or "1281" or "1282" or "1283" or "1284").Select(x => new Device<IStation524, IStation523>(x, World)).ToList());

+ 103 - 44
业务工程/分拣库/WCS.WorkEngineering/Systems/环形库/环形库码垛区补空托盘任务生成.cs

@@ -15,9 +15,9 @@ namespace WCS.WorkEngineering.Systems
     /// <summary>
     ///  环形库码垛区补空托盘任务生成
     /// </summary>
-    [BelongTo(typeof(RingWorld))]
-    [Description("环形库码垛区补空托盘任务生成")]
-    public class 环形库码垛区补空托盘任务生成 : DeviceSystem<Device<IStation520, IStation521, IStation523>>
+    [BelongTo(typeof(PalletizingWorld))]
+    [Description("码垛区域生成空托盘任务")]
+    public class 码垛区域生成空托盘任务 : DeviceSystem<Device<IStation520, IStation521, IStation523>>
     {
         protected override bool ParallelDo => true;
 
@@ -25,56 +25,115 @@ namespace WCS.WorkEngineering.Systems
 
         public override void Do(Device<IStation520, IStation521, IStation523> obj)
         {
-            if (obj.Data3.Status.HasFlag(StationStatus.PH_Status)) return;
-            WCS_TaskInfo deliveryTask = null;
-            SqlSugarHelper.Do(_db =>
+            if (obj.Entity.Code == nameof(TrussCreateEmptyTray))
             {
-                var db = _db.Default;
-                //检查是否有待执行状态放货点是自己的出库任务
-                var ringTask = db.Queryable<WCS_TaskInfo>().First(x => x.Type == TaskType.OutDepot && x.Status <= TaskStatus.WaitingToExecute && x.SrmStation == obj.Entity.Code);
-                if (ringTask == null)
+                WCS_Palletizing palletizing = null;
+                SqlSugarHelper.Do(_db =>
                 {
-                    //开始申请码垛任务
-                    WmsApi.ApplyPalletizingStockOut(obj.Entity.Code, obj.Entity.Sources.Single(x => x.HasFlag(DeviceFlags.Robot)).Code);
-                    return;
-                }
-                var task = db.Queryable<WCS_TaskInfo>().First(x => x.Type == TaskType.Delivery && x.AddrTo == obj.Entity.Code);
-                if (task != null) return;
-                //开始获取当前地址上个设备的上一个设备中的非零九托盘拆机
-                var addrFrom = obj.Entity.Sources.SelectMany(x => x.Sources).Single(x => x.HasFlag(DeviceFlags.拆盘机));
-                var dev = Device.All.Where(x => x.Code == addrFrom.Code).Select(x => new Device<IStation520>(x, World)).FirstOrDefault();
-                if (dev.Data.TaskNumber != 0 || dev.Data.GoodsEnd != 0) throw new Exception($"{dev.Entity.Code}有残留任务信息,请处理!");
-                //开始创建搬运任务
-                task = new WCS_TaskInfo()
+                    var db = _db.Default;
+                    //取一个时间最靠前的,没有绑定码垛工位的码垛记录
+                    var palletizingInfo = db.Queryable<WCS_Palletizing>().OrderBy(x => x.AddTime).First(x => x.PalletizingStation == null && !x.Finish);
+                    if (palletizingInfo == null) throw new Exception($"没有可用码垛信息");
+                    //var palleTask = db.Queryable<WCS_TaskInfo>().First(x => x.ID == palletizingInfo.TaskId && (x.Status == TaskStatus.FinishOfShunt || x.Status == TaskStatus.ConveyorExecution));
+                    //if (palleTask == null) throw new Exception($"未找到任务{palleTask.ID}");
+                    //获取可以使用的放货站台信息
+                    var taskAddNext = Device.All.FirstOrDefault(x => x.Code == palletizingInfo.TaskAddNext)?.Targets.FirstOrDefault()?.Targets.Where(x => x.HasFlag(DeviceFlags.桁架码垛位));
+                    if (taskAddNext == null) throw new Exception($"未找到{palletizingInfo.TaskAddNext}可去的码垛工位");
+                    var devs = Device.All.Where(x => taskAddNext.Contains(x)).Select(x => new Device<IStation520, IStation521, IStation523>(x, World)).ToList();
+
+                    //获取所有的未结束且有码垛工位的码垛记录
+                    var palletizingStation = db.Queryable<WCS_Palletizing>().Where(x => !x.Finish && x.PalletizingStation != null).Select(x => x.PalletizingStation).ToList();
+
+                    //取一个可用用于码垛的地方
+                    var dev = devs.Where(x => !palletizingStation.Contains(x.Entity.Code)).FirstOrDefault(x => !x.Data3.Status.HasFlag(StationStatus.PH_Status));
+                    if (dev == null) throw new Exception($"没有可用码垛工位");
+
+                    var addrFromCode = palletizingInfo.WarehouseCode switch
+                    {
+                        "1N" => "1602",
+                        "1S" => "1612",
+                        "2N" => "1622",
+                        "2S" => "1632",
+                        "3N" => "1642",
+                        "3S" => "1652",
+                        _ => "9999"
+                    };
+
+                    var endDev = Device.All.Where(x => x.Code == addrFromCode).Select(x => new Device<IStation520>(x, World)).FirstOrDefault();
+                    if (endDev.Data.TaskNumber != 0 || endDev.Data.GoodsEnd != 0) throw new Exception($"{endDev.Entity.Code}有残留任务信息,请处理!");
+
+                    palletizingInfo.PalletizingStation = dev.Entity.Code;
+                    db.Updateable(palletizingInfo).ExecuteCommand();
+                    palletizing = palletizingInfo;
+                });
+                if (palletizing == null) return;
+                var addrFromCode = palletizing.WarehouseCode switch
                 {
-                    AddrFrom = addrFrom.Code,
-                    AddrTo = obj.Entity.Code,
-                    BarCode = "码垛托盘搬运-" + obj.Entity.Code,
-                    Status = Entity.TaskStatus.NewBuild,
-                    PalletType = ringTask.PalletType,
-                    FullQty = ringTask.FullQty,
-                    Type = TaskType.Delivery,
-                    AddWho = "WCS",
-                    AddTime = DateTime.Now
+                    "1N" => "1602",
+                    "1S" => "1612",
+                    "2N" => "1622",
+                    "2S" => "1632",
+                    "3N" => "1642",
+                    "3S" => "1652",
+                    _ => "9999"
                 };
-                var res = db.Insertable(task).ExecuteReturnEntity();
-                var taskOld = res.Mapper<WCS_TaskOld, WCS_TaskInfo>();
-                taskOld.Id = res.ID;
-                taskOld.AddTime = DateTime.Now; ;
-                db.Insertable(taskOld).SplitTable().ExecuteCommand();
-                res.AddWCS_TASK_DTL(db, obj.Entity.Code, task.AddrTo, "初始化码垛托盘搬运任务");
-                deliveryTask = res;
-            });
+                var dev = Device.All.Where(x => x.Code == addrFromCode).Select(x => new Device<IStation520>(x, World)).FirstOrDefault();
+                dev.Data.TaskNumber = palletizing.Id;
+                dev.Data.GoodsEnd = palletizing.PalletizingStation!.ToShort();
+            }
+            else
+            {
+                if (obj.Data3.Status.HasFlag(StationStatus.PH_Status)) return;
+                WCS_TaskInfo deliveryTask = null;
+                SqlSugarHelper.Do(_db =>
+                {
+                    var db = _db.Default;
+                    //检查是否有待执行状态放货点是自己的出库任务
+                    var ringTask = db.Queryable<WCS_TaskInfo>().First(x => x.Type == TaskType.OutDepot && x.Status <= TaskStatus.WaitingToExecute && x.SrmStation == obj.Entity.Code);
+                    if (ringTask == null)
+                    {
+                        //开始申请码垛任务
+                        WmsApi.ApplyPalletizingStockOut(obj.Entity.Code, obj.Entity.Sources.Single(x => x.HasFlag(DeviceFlags.Robot)).Code);
+                        return;
+                    }
+                    var task = db.Queryable<WCS_TaskInfo>().First(x => x.Type == TaskType.Delivery && x.AddrTo == obj.Entity.Code);
+                    if (task != null) return;
+                    //开始获取当前地址上个设备的上一个设备中的非零九托盘拆机
+                    var addrFrom = obj.Entity.Sources.SelectMany(x => x.Sources).Single(x => x.HasFlag(DeviceFlags.拆盘机));
+                    var dev = Device.All.Where(x => x.Code == addrFrom.Code).Select(x => new Device<IStation520>(x, World)).FirstOrDefault();
+                    if (dev.Data.TaskNumber != 0 || dev.Data.GoodsEnd != 0) throw new Exception($"{dev.Entity.Code}有残留任务信息,请处理!");
+                    //开始创建搬运任务
+                    task = new WCS_TaskInfo()
+                    {
+                        AddrFrom = addrFrom.Code,
+                        AddrTo = obj.Entity.Code,
+                        BarCode = "码垛托盘搬运-" + obj.Entity.Code,
+                        Status = Entity.TaskStatus.NewBuild,
+                        PalletType = ringTask.PalletType,
+                        FullQty = ringTask.FullQty,
+                        Type = TaskType.Delivery,
+                        AddWho = "WCS",
+                        AddTime = DateTime.Now
+                    };
+                    var res = db.Insertable(task).ExecuteReturnEntity();
+                    var taskOld = res.Mapper<WCS_TaskOld, WCS_TaskInfo>();
+                    taskOld.Id = res.ID;
+                    taskOld.AddTime = DateTime.Now; ;
+                    db.Insertable(taskOld).SplitTable().ExecuteCommand();
+                    res.AddWCS_TASK_DTL(db, obj.Entity.Code, task.AddrTo, "初始化码垛托盘搬运任务");
+                    deliveryTask = res;
+                });
 
-            if (deliveryTask == null) return;
-            var dev = Device.All.Where(x => x.Code == deliveryTask.AddrFrom).Select(x => new Device<IStation520>(x, World)).FirstOrDefault();
-            dev.Data.TaskNumber = deliveryTask.ID;
-            dev.Data.GoodsEnd = obj.Entity.Code.ToShort();
+                if (deliveryTask == null) return;
+                var dev = Device.All.Where(x => x.Code == deliveryTask.AddrFrom).Select(x => new Device<IStation520>(x, World)).FirstOrDefault();
+                dev.Data.TaskNumber = deliveryTask.ID;
+                dev.Data.GoodsEnd = obj.Entity.Code.ToShort();
+            }
         }
 
         public override bool Select(Device dev)
         {
-            return dev.HasFlag(DeviceFlags.环形库码垛工位);
+            return dev.HasFlag(DeviceFlags.环形库码垛工位) || dev.Code == nameof(TrussCreateEmptyTray);
         }
     }
 }

+ 174 - 167
业务工程/分拣库/WCS.WorkEngineering/WorkStart.cs

@@ -328,7 +328,7 @@ namespace WCS.WorkEngineering
             List<TrussSegmentInfo> TrussInfo = new List<TrussSegmentInfo>
             {
                 new TrussSegmentInfo( 1, "10.30.37.211"),
-                //new TrussSegmentInfo( 2, "10.30.37.217"),
+                new TrussSegmentInfo( 2, "10.30.37.217"),
                 //new TrussSegmentInfo( 3, "10.30.37.223")
             };
 
@@ -345,7 +345,7 @@ namespace WCS.WorkEngineering
             {
                 //桁架
                 new("10.30.37.211",new  List<int>(){1685,1686,1687,1688,1689,1690,1675,1674,1673,1672,1671,1670,1677,1678,1679,1680,1665,1664,1663,1662}), //分拣库一
-                //new("10.30.37.217",new  List<int>(){1715,1716,1717,1718,1719,1720,1705,1704,1703,1702,1701,1700,1707,1708,1709,1710,1695,1694,1693,1692}), //分拣库二
+                new("10.30.37.217",new  List<int>(){1715,1716,1717,1718,1719,1720,1705,1704,1703,1702,1701,1700,1707,1708,1709,1710,1695,1694,1693,1692}), //分拣库二
                 //new("10.30.37.223",new  List<int>(){1745,1746,1747,1748,1749,1750,1735,1734,1733,1732,1731,1730,1737,1738,1739,1740,1725,1724,1723,1722}), //分拣库三
             };
 
@@ -372,8 +372,8 @@ namespace WCS.WorkEngineering
                 //机械臂
                 new("10.30.37.230",new  List<int>(){ 1666, 1661}), //库一北
                 new("10.30.37.232",new  List<int>(){ 1681, 1676}), //库一南
-                //new("10.30.37.234",new  List<int>(){ 1696, 1691}), //库二北
-                //new("10.30.37.236",new  List<int>(){ 1711, 1706}), //库二南
+                new("10.30.37.234",new  List<int>(){ 1696, 1691}), //库二北
+                new("10.30.37.236",new  List<int>(){ 1711, 1706}), //库二南
                 //new("10.30.37.238",new  List<int>(){ 1726, 1721}), //库三北
                 //new("10.30.37.240",new  List<int>(){ 1736, 1741}), //库三南
             };
@@ -399,8 +399,8 @@ namespace WCS.WorkEngineering
             {
                 new( 1, "10.30.37.230"),
                 new( 2, "10.30.37.232"),
-                //new( 3, "10.30.37.234"),
-                //new( 4, "10.30.37.236"),
+                new( 3, "10.30.37.234"),
+                new( 4, "10.30.37.236"),
                 //new( 5, "10.30.37.238"),
                 //new( 6, "10.30.37.240"),
             };
@@ -420,7 +420,7 @@ namespace WCS.WorkEngineering
 
             int ip = 41;
 
-            for (int i = 0; i <= 1; i++)
+            for (int i = 0; i <= 3; i++)
             {
                 var srm = new Device($"SRM{i + 1}");
                 srm.AddFlag(DeviceFlags.堆垛机);
@@ -449,8 +449,8 @@ namespace WCS.WorkEngineering
 
                 new RouteInfo("SRM1", new string[] { "TY1" }),
                 new RouteInfo("SRM2", new string[] { "TY2" }),
-                //new RouteInfo("SRM3", new string[] { "TY3" }),
-                //new RouteInfo("SRM4", new string[] { "TY4" }),
+                new RouteInfo("SRM3", new string[] { "TY3" }),
+                new RouteInfo("SRM4", new string[] { "TY4" }),
                 //new RouteInfo("SRM5", new string[] { "TY5" }),
                 //new RouteInfo("SRM6", new string[] { "TY6" }),
 
@@ -460,8 +460,8 @@ namespace WCS.WorkEngineering
 
                 new RouteInfo("TY1", new string[] { "2532","2534","2533" }), //人工取货口
                 new RouteInfo("TY2", new string[] { "2732","2734","2733" }),
-                //new RouteInfo("TY3", new string[] { "2932","2934","2933" }), //人工取货口
-                //new RouteInfo("TY4", new string[] { "3132","3134","3133" }),
+                new RouteInfo("TY3", new string[] { "2932","2934","2933" }), //人工取货口
+                new RouteInfo("TY4", new string[] { "3132","3134","3133" }),
                 //new RouteInfo("TY5", new string[] { "3332","3334","3333" }), //人工取货口
                 //new RouteInfo("TY6", new string[]{ "3532","3534","3533" }),
 
@@ -471,8 +471,8 @@ namespace WCS.WorkEngineering
 
                 new RouteInfo("TY1", new string[] { "1601","1605" }),
                 new RouteInfo("TY2", new string[] { "1611","1615" }),
-                //new RouteInfo("TY3", new string[] { "1621","1625" }),
-                //new RouteInfo("TY4", new string[] { "1631","1635" }),
+                new RouteInfo("TY3", new string[] { "1621","1625" }),
+                new RouteInfo("TY4", new string[] { "1631","1635" }),
                 //new RouteInfo("TY5", new string[] { "1641","1645" }),
                 //new RouteInfo("TY6", new string[] { "1651","1655" }),
 
@@ -486,10 +486,10 @@ namespace WCS.WorkEngineering
                 new RouteInfo("1605", new string[] { "1606" }),//09拆盘机
                 new RouteInfo("1615", new string[] { "1616" }),
                 ////库二
-                //new RouteInfo("1621", new string[] { "1622" }),//非09拆盘机
-                //new RouteInfo("1631", new string[] { "1632"}),
-                //new RouteInfo("1625", new string[] { "1626" }),//09拆盘机
-                //new RouteInfo("1635", new string[] { "1636" }),
+                new RouteInfo("1621", new string[] { "1622" }),//非09拆盘机
+                new RouteInfo("1631", new string[] { "1632"}),
+                new RouteInfo("1625", new string[] { "1626" }),//09拆盘机
+                new RouteInfo("1635", new string[] { "1636" }),
                 //////库三
                 //new RouteInfo("1641", new string[] { "1642" }),//非09拆盘机
                 //new RouteInfo("1651", new string[] { "1652"}),
@@ -506,10 +506,10 @@ namespace WCS.WorkEngineering
                 new RouteInfo("1606", new string[] { "RGV1" }),//09拆盘机
                 new RouteInfo("1616", new string[] { "RGV2" }),
                 ////库二
-                //new RouteInfo("1622", new string[] { "RGV3" }),//非09拆盘机
-                //new RouteInfo("1632", new string[] { "RGV4"}),
-                //new RouteInfo("1626", new string[] { "RGV3" }),//09拆盘机
-                //new RouteInfo("1636", new string[] { "RGV4" }),
+                new RouteInfo("1622", new string[] { "RGV3" }),//非09拆盘机
+                new RouteInfo("1632", new string[] { "RGV4"}),
+                new RouteInfo("1626", new string[] { "RGV3" }),//09拆盘机
+                new RouteInfo("1636", new string[] { "RGV4" }),
                 //////库三
                 //new RouteInfo("1642", new string[] { "RGV5" }),//非09拆盘机
                 //new RouteInfo("1652", new string[] { "RGV6"}),
@@ -526,10 +526,10 @@ namespace WCS.WorkEngineering
                 new RouteInfo("RGV2", new string[] { "1676","1681" }),
                 new RouteInfo("RGV2", new string[] { "1677","1678","1679","1680", "1685","1686","1687","1688","1689","1690" }),
                 ////库二
-                //new RouteInfo("RGV3", new string[] { "1691","1696" }),//北区机械臂码垛区
-                //new RouteInfo("RGV3", new string[] { "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705"}),//桁架北区码垛站台
-                //new RouteInfo("RGV4", new string[] { "1706","1711" }),
-                //new RouteInfo("RGV4", new string[] { "1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),
+                new RouteInfo("RGV3", new string[] { "1691","1696" }),//北区机械臂码垛区
+                new RouteInfo("RGV3", new string[] { "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705"}),//桁架北区码垛站台
+                new RouteInfo("RGV4", new string[] { "1706","1711" }),
+                new RouteInfo("RGV4", new string[] { "1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),
                 //////库三
                 //new RouteInfo("RGV5", new string[] { "1721","1726" }),//北区机械臂码垛区
                 //new RouteInfo("RGV5", new string[] { "1722","1723","1724","1725", "1730","1731","1732","1733","1734","1735"}),//桁架北区码垛站台
@@ -546,10 +546,10 @@ namespace WCS.WorkEngineering
                 new RouteInfo("Robot2", new string[] { "1676" }),
                 new RouteInfo("Robot2", new string[] { "1681" }),
                 ////库二
-                //new RouteInfo("Robot3", new string[] { "1691" }),
-                //new RouteInfo("Robot3", new string[] { "1696" }),
-                //new RouteInfo("Robot4", new string[] { "1706" }),
-                //new RouteInfo("Robot4", new string[] { "1711" }),
+                new RouteInfo("Robot3", new string[] { "1691" }),
+                new RouteInfo("Robot3", new string[] { "1696" }),
+                new RouteInfo("Robot4", new string[] { "1706" }),
+                new RouteInfo("Robot4", new string[] { "1711" }),
                 ////库三
                 //new RouteInfo("Robot5", new string[] { "1721" }),
                 //new RouteInfo("Robot5", new string[] { "1726" }),
@@ -566,8 +566,8 @@ namespace WCS.WorkEngineering
 
                 new RouteInfo("2532", new string[] { "TY1" }), //分拣库一
                 new RouteInfo("2732", new string[] { "TY2" }),
-                //new RouteInfo("2932", new string[] { "TY3" }), //分拣库二
-                //new RouteInfo("3132", new string[] { "TY4" }),
+                new RouteInfo("2932", new string[] { "TY3" }), //分拣库二
+                new RouteInfo("3132", new string[] { "TY4" }),
                 //new RouteInfo("3332", new string[] { "TY5" }), //分拣库三
                 //new RouteInfo("3532", new string[] { "TY6" }),
 
@@ -579,10 +579,10 @@ namespace WCS.WorkEngineering
                 new RouteInfo("2528", new string[] { "TY1" }),
                 new RouteInfo("2727", new string[] { "TY2" }),
                 new RouteInfo("2728", new string[] { "TY2" }),
-                //new RouteInfo("2927", new string[] { "TY3" }), //分拣库二
-                //new RouteInfo("2928", new string[] { "TY3" }),
-                //new RouteInfo("3127", new string[] { "TY4" }),
-                //new RouteInfo("3128", new string[] { "TY4" }),
+                new RouteInfo("2927", new string[] { "TY3" }), //分拣库二
+                new RouteInfo("2928", new string[] { "TY3" }),
+                new RouteInfo("3127", new string[] { "TY4" }),
+                new RouteInfo("3128", new string[] { "TY4" }),
                 //new RouteInfo("3327", new string[] { "TY5" }), //分拣库三
                 //new RouteInfo("3328", new string[] { "TY5" }),
                 //new RouteInfo("3527", new string[] { "TY6" }),
@@ -616,8 +616,8 @@ namespace WCS.WorkEngineering
 
                 new RouteInfo("22", new string[] { "418" }), //分拣库一北
                 new RouteInfo("122", new string[] { "618" }), //分拣库一南
-                //new RouteInfo("41", new string[] { "818" }), //分拣库一北
-                //new RouteInfo("141", new string[] { "1018" }), //分拣库一南
+                new RouteInfo("41", new string[] { "818" }), //分拣库一北
+                new RouteInfo("141", new string[] { "1018" }), //分拣库一南
                 //new RouteInfo("61", new string[] { "1218" }), //分拣库一北
                 //new RouteInfo("161", new string[] { "1418" }), //分拣库一南
 
@@ -627,8 +627,8 @@ namespace WCS.WorkEngineering
 
                 new RouteInfo("418", new string[] { "424","433","442" }),
                 new RouteInfo("618", new string[] { "624", "633", "642" }),
-                //new RouteInfo("818", new string[] { "824","833","842" }),
-                //new RouteInfo("1018", new string[] { "1024","1033","1042" }),
+                new RouteInfo("818", new string[] { "824","833","842" }),
+                new RouteInfo("1018", new string[] { "1024","1033","1042" }),
                 //new RouteInfo("1218", new string[] { "1224","1233","1242" }),
                 //new RouteInfo("1418", new string[] { "1424","1433","1442" }),
 
@@ -638,8 +638,8 @@ namespace WCS.WorkEngineering
 
                 new RouteInfo("418", new string[] { "455" }), //分拣库一北
                 new RouteInfo("618", new string[] { "655" }), //分拣库一南
-                //new RouteInfo("818", new string[] { "855" }), //分拣库二北
-                //new RouteInfo("1018", new string[] { "1055" }), //分拣库二南
+                new RouteInfo("818", new string[] { "855" }), //分拣库二北
+                new RouteInfo("1018", new string[] { "1055" }), //分拣库二南
                 //new RouteInfo("1218", new string[] { "1255" }), //分拣库三北
                 //new RouteInfo("1418", new string[] { "1455" }), //分拣库三南
 
@@ -649,8 +649,8 @@ namespace WCS.WorkEngineering
 
                 new RouteInfo("455", new string[] { "466","480","494","508", "522","536","550","564","578","591"}), //分拣库一北
                 new RouteInfo("655", new string[] { "666","680","694","708", "722","736","750","764","778","791"}), //分拣库一南
-                //new RouteInfo("855", new string[] { "866","880","894","908", "922","936","950","964","978","991"}), //分拣库二北
-                //new RouteInfo("1055", new string[] { "1066","1080","1094","1108", "1122","1136","1150","1164","1178","1191"}), //分拣库二南
+                new RouteInfo("855", new string[] { "866","880","894","908", "922","936","950","964","978","991"}), //分拣库二北
+                new RouteInfo("1055", new string[] { "1066","1080","1094","1108", "1122","1136","1150","1164","1178","1191"}), //分拣库二南
                 //new RouteInfo("1255", new string[] { "1266","1280","1294","1308", "1322","1336","1350","1364","1378", "1391"}), //分拣库三北
                 //new RouteInfo("1455", new string[] { "1466","1480","1494","1408", "1422","1436","1450","1464","1478","1591"}), //分拣库三南
 
@@ -678,26 +678,26 @@ namespace WCS.WorkEngineering
                 new("764", new[] { "759" }),
                 new("778", new[] { "773" }),
                 new("791", new[] { "786" }),
-                //new("866", new[] { "861" }), //分拣二北侧
-                //new("880", new[] { "875" }),
-                //new("894", new[] { "889" }),
-                //new("908", new[] { "903" }),
-                //new("922", new[] { "917" }),
-                //new("936", new[] { "931" }),
-                //new("950", new[] { "945" }),
-                //new("964", new[] { "959" }),
-                //new("978", new[] { "973" }),
-                //new("991", new[] { "986" }),
-                //new("1066", new[] { "1061" }),//分拣二南侧
-                //new("1080", new[] { "1075" }),
-                //new("1094", new[] { "1089" }),
-                //new("1108", new[] { "1103" }),
-                //new("1122", new[] { "1117" }),
-                //new("1136", new[] { "1131" }),
-                //new("1150", new[] { "1145" }),
-                //new("1164", new[] { "1159" }),
-                //new("1178", new[] { "1173" }),
-                //new("1191", new[] { "1186" }),
+                new("866", new[] { "861" }), //分拣二北侧
+                new("880", new[] { "875" }),
+                new("894", new[] { "889" }),
+                new("908", new[] { "903" }),
+                new("922", new[] { "917" }),
+                new("936", new[] { "931" }),
+                new("950", new[] { "945" }),
+                new("964", new[] { "959" }),
+                new("978", new[] { "973" }),
+                new("991", new[] { "986" }),
+                new("1066", new[] { "1061" }),//分拣二南侧
+                new("1080", new[] { "1075" }),
+                new("1094", new[] { "1089" }),
+                new("1108", new[] { "1103" }),
+                new("1122", new[] { "1117" }),
+                new("1136", new[] { "1131" }),
+                new("1150", new[] { "1145" }),
+                new("1164", new[] { "1159" }),
+                new("1178", new[] { "1173" }),
+                new("1191", new[] { "1186" }),
                 //new("1266", new[] { "1261" }), //分拣三北侧
                 //new("1280", new[] { "1275" }),
                 //new("1294", new[] { "1289" }),
@@ -743,26 +743,26 @@ namespace WCS.WorkEngineering
                 new("759", new[] { "Truss1" }),
                 new("773", new[] { "Truss1" }),
                 new("786", new[] { "Truss1" }),
-                //new("861", new[] { "Truss2" }), //分拣二北侧
-                //new("875", new[] { "Truss2" }),
-                //new("889", new[] { "Truss2" }),
-                //new("903", new[] { "Truss2" }),
-                //new("917", new[] { "Truss2" }),
-                //new("931", new[] { "Truss2" }),
-                //new("945", new[] { "Truss2" }),
-                //new("959", new[] { "Truss2" }),
-                //new("973", new[] { "Truss2" }),
-                //new("986", new[] { "Truss2" }),
-                //new("1061", new[] { "Truss2" }),//分拣二南侧
-                //new("1075", new[] { "Truss2" }),
-                //new("1089", new[] { "Truss2" }),
-                //new("1103", new[] { "Truss2" }),
-                //new("1117", new[] { "Truss2" }),
-                //new("1131", new[] { "Truss2" }),
-                //new("1145", new[] { "Truss2" }),
-                //new("1159", new[] { "Truss2" }),
-                //new("1173", new[] { "Truss2" }),
-                //new("1186", new[] { "Truss2" }),
+                new("861", new[] { "Truss2" }), //分拣二北侧
+                new("875", new[] { "Truss2" }),
+                new("889", new[] { "Truss2" }),
+                new("903", new[] { "Truss2" }),
+                new("917", new[] { "Truss2" }),
+                new("931", new[] { "Truss2" }),
+                new("945", new[] { "Truss2" }),
+                new("959", new[] { "Truss2" }),
+                new("973", new[] { "Truss2" }),
+                new("986", new[] { "Truss2" }),
+                new("1061", new[] { "Truss2" }),//分拣二南侧
+                new("1075", new[] { "Truss2" }),
+                new("1089", new[] { "Truss2" }),
+                new("1103", new[] { "Truss2" }),
+                new("1117", new[] { "Truss2" }),
+                new("1131", new[] { "Truss2" }),
+                new("1145", new[] { "Truss2" }),
+                new("1159", new[] { "Truss2" }),
+                new("1173", new[] { "Truss2" }),
+                new("1186", new[] { "Truss2" }),
                 //new("1261", new[] { "Truss3" }), //分拣三北侧
                 //new("1275", new[] { "Truss3" }),
                 //new("1289", new[] { "Truss3" }),
@@ -808,26 +808,26 @@ namespace WCS.WorkEngineering
                 new("759", new[] { "1677","1678","1679","1680", "1685","1686","1687","1688","1689","1690" }),
                 new("773", new[] { "1677","1678","1679","1680", "1685","1686","1687","1688","1689","1690" }),
                 new("786", new[] { "1677","1678","1679","1680", "1685","1686","1687","1688","1689","1690" }),
-                //new("861", new[] { "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705" }), //分拣二北侧
-                //new("875", new[] { "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705"  }),
-                //new("889", new[] { "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705"  }),
-                //new("903", new[] { "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705"  }),
-                //new("917", new[] { "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705"  }),
-                //new("931", new[] { "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705"  }),
-                //new("945", new[] { "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705"  }),
-                //new("959", new[] { "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705"  }),
-                //new("973", new[] { "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705"  }),
-                //new("986", new[] { "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705"  }),
-                //new("1061", new[] { "1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),//分拣二南侧
-                //new("1075", new[] { "1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),
-                //new("1089", new[] { "1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),
-                //new("1103", new[] { "1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),
-                //new("1117", new[] { "1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),
-                //new("1131", new[] { "1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),
-                //new("1145", new[] { "1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),
-                //new("1159", new[] { "1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),
-                //new("1173", new[] { "1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),
-                //new("1186", new[] { "1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),
+                new("861", new[] { "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705" }), //分拣二北侧
+                new("875", new[] { "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705"  }),
+                new("889", new[] { "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705"  }),
+                new("903", new[] { "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705"  }),
+                new("917", new[] { "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705"  }),
+                new("931", new[] { "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705"  }),
+                new("945", new[] { "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705"  }),
+                new("959", new[] { "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705"  }),
+                new("973", new[] { "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705"  }),
+                new("986", new[] { "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705"  }),
+                new("1061", new[] { "1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),//分拣二南侧
+                new("1075", new[] { "1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),
+                new("1089", new[] { "1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),
+                new("1103", new[] { "1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),
+                new("1117", new[] { "1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),
+                new("1131", new[] { "1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),
+                new("1145", new[] { "1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),
+                new("1159", new[] { "1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),
+                new("1173", new[] { "1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),
+                new("1186", new[] { "1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),
                 //new("1261", new[] { "1722","1723","1724","1725", "1730","1731","1732","1733","1734","1735" }), //分拣三北侧
                 //new("1275", new[] {"1722","1723","1724","1725", "1730","1731","1732","1733","1734","1735"  }),
                 //new("1289", new[] {"1722","1723","1724","1725", "1730","1731","1732","1733","1734","1735"  }),
@@ -854,7 +854,7 @@ namespace WCS.WorkEngineering
                 #region 桁架--码垛工位
 
                 new("Truss1", new[] { "1662","1663","1664","1665","1670","1671","1672","1673", "1674","1675","1677","1678","1679","1680", "1685","1686","1687","1688","1689","1690" }),
-                //new("Truss2", new[] {  "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705","1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),
+                new("Truss2", new[] { "1692","1693","1694","1695", "1700","1701","1702","1703","1704","1705","1707","1708","1709","1710", "1715","1716","1717","1718","1719","1720" }),
                 //new("Truss3", new[] { "1722","1723","1724","1725", "1730","1731","1732","1733","1734","1735","1737","1738","1739","1740", "1745","1746","1747","1748","1749","1750"}),
 
                 #endregion 桁架--码垛工位
@@ -888,32 +888,32 @@ namespace WCS.WorkEngineering
                 new RouteInfo("1689", new string[] { "RGV2" }),
                 new RouteInfo("1690", new string[] { "RGV2" }),
 
-                ////分拣库二北
-                //new RouteInfo("1691", new string[] { "RGV3" }),//机械手码垛工位
-                //new RouteInfo("1696", new string[] { "RGV3" }),
-                //new RouteInfo("1692", new string[] { "RGV3" }),//绗架码垛工位
-                //new RouteInfo("1693", new string[] { "RGV3" }),
-                //new RouteInfo("1694", new string[] { "RGV3" }),
-                //new RouteInfo("1695", new string[] { "RGV3" }),
-                //new RouteInfo("1700", new string[] { "RGV3" }),
-                //new RouteInfo("1701", new string[] { "RGV3" }),
-                //new RouteInfo("1702", new string[] { "RGV3" }),
-                //new RouteInfo("1703", new string[] { "RGV3" }),
-                //new RouteInfo("1704", new string[] { "RGV3" }),
-                //new RouteInfo("1705", new string[] { "RGV3" }),
-                ////分拣库二南
-                //new RouteInfo("1706", new string[] { "RGV4" }),//机械手码垛工位
-                //new RouteInfo("1711", new string[] { "RGV4" }),
-                //new RouteInfo("1707", new string[] { "RGV4" }),//绗架码垛工位
-                //new RouteInfo("1708", new string[] { "RGV4" }),
-                //new RouteInfo("1709", new string[] { "RGV4" }),
-                //new RouteInfo("1710", new string[] { "RGV4" }),
-                //new RouteInfo("1715", new string[] { "RGV4" }),
-                //new RouteInfo("1716", new string[] { "RGV4" }),
-                //new RouteInfo("1717", new string[] { "RGV4" }),
-                //new RouteInfo("1718", new string[] { "RGV4" }),
-                //new RouteInfo("1719", new string[] { "RGV4" }),
-                //new RouteInfo("1720", new string[] { "RGV4" }),
+                //分拣库二北
+                new RouteInfo("1691", new string[] { "RGV3" }),//机械手码垛工位
+                new RouteInfo("1696", new string[] { "RGV3" }),
+                new RouteInfo("1692", new string[] { "RGV3" }),//绗架码垛工位
+                new RouteInfo("1693", new string[] { "RGV3" }),
+                new RouteInfo("1694", new string[] { "RGV3" }),
+                new RouteInfo("1695", new string[] { "RGV3" }),
+                new RouteInfo("1700", new string[] { "RGV3" }),
+                new RouteInfo("1701", new string[] { "RGV3" }),
+                new RouteInfo("1702", new string[] { "RGV3" }),
+                new RouteInfo("1703", new string[] { "RGV3" }),
+                new RouteInfo("1704", new string[] { "RGV3" }),
+                new RouteInfo("1705", new string[] { "RGV3" }),
+                //分拣库二南
+                new RouteInfo("1706", new string[] { "RGV4" }),//机械手码垛工位
+                new RouteInfo("1711", new string[] { "RGV4" }),
+                new RouteInfo("1707", new string[] { "RGV4" }),//绗架码垛工位
+                new RouteInfo("1708", new string[] { "RGV4" }),
+                new RouteInfo("1709", new string[] { "RGV4" }),
+                new RouteInfo("1710", new string[] { "RGV4" }),
+                new RouteInfo("1715", new string[] { "RGV4" }),
+                new RouteInfo("1716", new string[] { "RGV4" }),
+                new RouteInfo("1717", new string[] { "RGV4" }),
+                new RouteInfo("1718", new string[] { "RGV4" }),
+                new RouteInfo("1719", new string[] { "RGV4" }),
+                new RouteInfo("1720", new string[] { "RGV4" }),
                 ////分拣库三北
                 //new RouteInfo("1721", new string[] { "RGV5" }),//机械手码垛工位
                 //new RouteInfo("1726", new string[] { "RGV5" }),
@@ -947,8 +947,8 @@ namespace WCS.WorkEngineering
 
                 new RouteInfo("RGV1", new string[] { "1604" }),
                 new RouteInfo("RGV2", new string[] { "1614" }),
-                //new RouteInfo("RGV3", new string[] { "1624" }),
-                //new RouteInfo("RGV4", new string[] { "1634" }),
+                new RouteInfo("RGV3", new string[] { "1624" }),
+                new RouteInfo("RGV4", new string[] { "1634" }),
                 //new RouteInfo("RGV5", new string[] { "1644" }),
                 //new RouteInfo("RGV6", new string[] { "1654" }),
 
@@ -958,8 +958,8 @@ namespace WCS.WorkEngineering
 
                 new RouteInfo("1604", new string[] { "1603" }),//北侧
                 new RouteInfo("1614", new string[] { "1613" }),//南侧
-                //new RouteInfo("1624", new string[] { "1623" }),//北侧
-                //new RouteInfo("1634", new string[] { "1633" }),//南侧
+                new RouteInfo("1624", new string[] { "1623" }),//北侧
+                new RouteInfo("1634", new string[] { "1633" }),//南侧
                 //new RouteInfo("1644", new string[] { "1643" }),//北侧
                 //new RouteInfo("1654", new string[] { "1653" }),//南侧
 
@@ -969,8 +969,8 @@ namespace WCS.WorkEngineering
 
                 new RouteInfo("1603", new string[] { "TY1" }),//北侧
                 new RouteInfo("1613", new string[] { "TY2" }),//南侧
-                //new RouteInfo("1623", new string[] { "TY3" }),//北侧
-                //new RouteInfo("1633", new string[] { "TY4" }),//南侧
+                new RouteInfo("1623", new string[] { "TY3" }),//北侧
+                new RouteInfo("1633", new string[] { "TY4" }),//南侧
                 //new RouteInfo("1643", new string[] { "TY5" }),//北侧
                 //new RouteInfo("1653", new string[] { "TY6" }),//南侧
 
@@ -980,8 +980,8 @@ namespace WCS.WorkEngineering
 
                 new RouteInfo("TY1", new string[] { "SRM1" }),
                 new RouteInfo("TY2", new string[] { "SRM2" }),
-                //new RouteInfo("TY3", new string[] { "SRM3" }),
-                //new RouteInfo("TY4", new string[] { "SRM4" }),
+                new RouteInfo("TY3", new string[] { "SRM3" }),
+                new RouteInfo("TY4", new string[] { "SRM4" }),
                 //new RouteInfo("TY5", new string[] { "SRM5" }),
                 //new RouteInfo("TY6", new string[] { "SRM6" }),
 
@@ -995,12 +995,12 @@ namespace WCS.WorkEngineering
                 new RouteInfo("624", new string[] { "Robot2" }),
                 new RouteInfo("633", new string[] { "Robot2" }),
                 new RouteInfo("642", new string[] { "Robot2" }),
-                //new RouteInfo("824", new string[] { "Robot3" }),
-                //new RouteInfo("833", new string[] { "Robot3" }),
-                //new RouteInfo("842", new string[] { "Robot3" }),
-                //new RouteInfo("1024", new string[] { "Robot4" }),
-                //new RouteInfo("1033", new string[] { "Robot4" }),
-                //new RouteInfo("1042", new string[] { "Robot4" }),
+                new RouteInfo("824", new string[] { "Robot3" }),
+                new RouteInfo("833", new string[] { "Robot3" }),
+                new RouteInfo("842", new string[] { "Robot3" }),
+                new RouteInfo("1024", new string[] { "Robot4" }),
+                new RouteInfo("1033", new string[] { "Robot4" }),
+                new RouteInfo("1042", new string[] { "Robot4" }),
                 //new RouteInfo("1224", new string[] { "Robot5" }),
                 //new RouteInfo("1233", new string[] { "Robot5" }),
                 //new RouteInfo("1242", new string[] { "Robot5" }),
@@ -1045,14 +1045,14 @@ namespace WCS.WorkEngineering
                 new("642",new List<string> {"642","643"}),
                 new("633",new List<string> {"633","634"}),
                 new("624",new List<string> {"624","625"}),
-                ////环形库二北侧机械手取货位
-                //new("824",new List<string> {"824","825"}),
-                //new("833",new List<string> {"833","834"}),
-                //new("842",new List<string> {"842","843"}),
-                ////环形库二南侧侧机械手取货位
-                //new("1042",new List<string> {"1042","1043"}),
-                //new("1033",new List<string> {"1033","1034"}),
-                //new("1024",new List<string> {"1024","1025"}),
+                //环形库二北侧机械手取货位
+                new("824",new List<string> {"824","825"}),
+                new("833",new List<string> {"833","834"}),
+                new("842",new List<string> {"842","843"}),
+                //环形库二南侧侧机械手取货位
+                new("1042",new List<string> {"1042","1043"}),
+                new("1033",new List<string> {"1033","1034"}),
+                new("1024",new List<string> {"1024","1025"}),
                 ////环形库三北侧机械手取货位
                 //new("1224",new List<string> {"1224","1225"}),
                 //new("1233",new List<string> {"1233","1234"}),
@@ -1077,24 +1077,31 @@ namespace WCS.WorkEngineering
                 { DeviceFlags.入库, new List<string>() { "2532", "2533", "2534", "2732", "2733", "2734"/*,"1603"*/ } },
                 { DeviceFlags.出库, new List<string>() { "2532", "2533", "2534", "2732", "2733", "2734" } },
                 { DeviceFlags.扫码, new List<string>() { "2532", "2732" } },
-                { DeviceFlags.一楼扫码,new List<string>(){ "2532","2732"/*, "2932", "3132" , "3332", "3532"*/  } },
-                { DeviceFlags.一楼叠盘机,new List<string>() { "2527", "2528", "2727", "2728"/*, "2927", "2928", "3127", "3128" , "3327", "3328", "3527", "3528"*/ } },
+                { DeviceFlags.一楼扫码,new List<string>(){ "2532","2732", "2932", "3132"/*, "3332", "3532"*/ } },
+                { DeviceFlags.一楼叠盘机,new List<string>() { "2527", "2528", "2727", "2728", "2927", "2928", "3127", "3128"/*, "3327", "3328", "3527", "3528"*/ } },
                 { DeviceFlags.主线分流点,new List<string>() { "22","41","61"} },
                 { DeviceFlags.满轮主线第一次扫码,new List<string>() { "1"} },
-                { DeviceFlags.环形库分流点,new List<string>(){ "418", "618"/*, "818","1018","1218","1418"*/ } },
-                { DeviceFlags.桁架分流点,new List<string>() { "455", "655"/*, "855","1055","1255","1455"*/ } },
-                { DeviceFlags.桁架缓存放行点, new List<string>(){ "466", "480", "494", "508", "522", "536", "550", "564", "578", "591", "666", "680", "694", "708", "722", "736", "750", "764", "778", "791"/*, "866", "880", "894", "908", "922", "936", "950", "964", "978", "991" , "1066", "1080", "1094", "1108", "1122", "1136", "1150", "1164", "1178", "1191" , "1266", "1280", "1294", "1308", "1322", "1336", "1350", "1364", "1378", "1391" , "1466", "1480", "1494", "1408", "1422", "1436", "1450", "1464", "1478", "1591"*/ } },
-                { DeviceFlags.桁架09缓存放行点, new List<string>(){ "466", "480", "494", "508", "522", "536", "666", "680", "694", "708", "722", "736"/*, "866", "880", "894", "908", "922", "936", "1066", "1080", "1094", "1108", "1122", "1136",  "1266", "1280", "1294", "1308", "1322", "1336",  "1466", "1480", "1494", "1408", "1422", "1436"*/ } },
-                { DeviceFlags.桁架09异常缓存放行点, new List<string>(){ "591", "791"/*, "991" , "1191" , "1391" , "1591"*/ } },
-                { DeviceFlags.桁架18缓存放行点, new List<string>(){ "550", "564", "578", "750", "764", "778"/*, "950", "964", "978" , "1150", "1164", "1178" , "1350", "1364", "1378" , "1450", "1464", "1478"*/ } },
-                { DeviceFlags.桁架取货点, new List<string>(){ "461", "475", "489", "503", "517", "531", "545", "559", "573", "586", "661", "675", "689", "703", "717", "731", "745", "759", "773", "786"/*, "861", "875", "889", "903", "917", "931", "945", "959", "973", "986", "1061", "1075", "1089", "1103", "1117", "1131", "1145", "1159", "1173", "1186", "1261", "1275", "1289", "1303", "1317", "1331", "1345", "1359", "1373", "1386" , "1461", "1475", "1489", "1503", "1517", "1531", "1545", "1559", "1573", "1586"*/ } },
+                { DeviceFlags.环形库分流点,new List<string>(){ "418", "618", "818", "1018"/*, "1218", "1418"*/ } },
+                { DeviceFlags.桁架分流点,new List<string>() { "455", "655", "855", "1055"/*, "1255", "1455"*/ } },
+                { DeviceFlags.桁架缓存放行点, new List<string>(){ "466", "480", "494", "508", "522", "536", "550", "564", "578", "591", "666", "680", "694", "708", "722", "736", "750", "764", "778", "791",
+                    "866", "880", "894", "908", "922", "936", "950", "964", "978", "991", "1066", "1080", "1094", "1108", "1122", "1136", "1150", "1164", "1178", "1191"/*,
+                    "1266", "1280", "1294", "1308", "1322", "1336", "1350", "1364", "1378", "1391", "1466", "1480", "1494", "1408", "1422", "1436", "1450", "1464", "1478", "1591" */} },
+                { DeviceFlags.桁架09缓存放行点, new List<string>(){ "466", "480", "494", "508", "522", "536", "666", "680", "694", "708", "722", "736"
+                    , "866", "880", "894", "908", "922", "936", "1066", "1080", "1094", "1108", "1122", "1136"/*,
+                     "1266", "1280", "1294", "1308", "1322", "1336",  "1466", "1480", "1494", "1408", "1422", "1436"*/ } },
+                { DeviceFlags.桁架09异常缓存放行点, new List<string>(){ "591", "791", "991" , "1191"/* , "1391" , "1591"*/ } },
+                { DeviceFlags.桁架18缓存放行点, new List<string>(){ "550", "564", "578", "750", "764", "778", "950", "964", "978" , "1150", "1164", "1178" /*, "1350", "1364", "1378" , "1450", "1464", "1478"*/ } },
+                { DeviceFlags.桁架取货点, new List<string>(){ "461", "475", "489", "503", "517", "531", "545", "559", "573", "586", "661", "675", "689", "703", "717", "731", "745", "759", "773", "786",
+                     "861", "875", "889", "903", "917", "931", "945", "959", "973", "986", "1061", "1075", "1089", "1103", "1117", "1131", "1145", "1159", "1173", "1186"/*,
+                     "1261", "1275", "1289", "1303", "1317", "1331", "1345", "1359", "1373", "1386" , "1461", "1475", "1489", "1503", "1517", "1531", "1545", "1559", "1573", "1586"*/ } },
                 //{ DeviceFlags.拆盘机09, new List<string>(){ /*"1606", "1616",*/"1626","1636","1646","1656" } },
-                { DeviceFlags.拆盘机, new List<string>(){ "1602", "1612"/*, "1622","1632","1642","1652"*/ } },
-                { DeviceFlags.桁架码垛位, new List<string>(){ /*"1670", "1671",*/ "1672", "1673", "1674", "1675", "1664","1662","1663","1665","1677","1678","1679","1680","1685","1686","1687","1688","1689"/*,"1690", "1692", "1693", "1694", "1695", "1700", "1701", "1702", "1703", "1704", "1705", "1707", "1708", "1709", "1710", "1715", "1716", "1717", "1718", "1719", "1720", "1722", "1723", "1724", "1725", "1730", "1731", "1732", "1733", "1734", "1735", "1737", "1738", "1739", "1740", "1745", "1746", "1747", "1748", "1749", "1750"*/ } },
-                { DeviceFlags.环形库码垛工位, new List<string>(){ "1666", "1661", "1676", "1681"/*, "1691", "1696", "1706", "1711", "1721", "1726", "1736", "1741"*/ } },
-                { DeviceFlags.AGV取货站台口, new List<string>(){ "2533", "2534", "2734", "2733"/*,"2934","2933","3133","3134","3333","3334","3533","3534" */} },
-                { DeviceFlags.Robot, new List<string>(){ "Robot1", "Robot2"/*, "Robot3","Robot4" , "Robot5", "Robot6"*/ } },
-                {DeviceFlags.二次码垛RGV取货口, new List<string>(){ "1606", "1616"/*, "1626","1636","1646","1656"*/}}
+                { DeviceFlags.拆盘机, new List<string>(){ "1602", "1612", "1622", "1632"/*,"1642","1652"*/ } },
+                { DeviceFlags.桁架码垛位, new List<string>(){ /*"1670", "1671",*/ "1672", "1673", "1674", "1675", "1664","1662","1663","1665","1677","1678","1679","1680","1685","1686","1687","1688","1689",
+                    /*"1690", "1692", "1693", "1694", "1695", "1700", "1701", "1702", "1703", "1704", "1705", "1707", "1708", "1709", "1710", "1715", "1716", "1717", "1718", "1719", "1720", "1722", "1723", "1724", "1725", "1730", "1731", "1732", "1733", "1734", "1735", "1737", "1738", "1739", "1740", "1745", "1746", "1747", "1748", "1749", "1750"*/ } },
+                { DeviceFlags.环形库码垛工位, new List<string>(){ "1666", "1661", "1676", "1681", "1691", "1696", "1706", "1711"/*, "1721", "1726", "1736", "1741"*/ } },
+                { DeviceFlags.AGV取货站台口, new List<string>(){ "2533", "2534", "2734", "2733","2934","2933","3133", "3134"/*,"3333","3334","3533","3534" */} },
+                { DeviceFlags.Robot, new List<string>(){ "Robot1", "Robot2", "Robot3", "Robot4"/* , "Robot5", "Robot6"*/ } },
+                {DeviceFlags.二次码垛RGV取货口, new List<string>(){ "1606", "1616", "1626","1636"/*,"1646","1656"*/}}
         };
 
             Parallel.ForEach(devices, device =>

+ 2 - 2
业务工程/分拣库/WCS.WorkEngineering/Worlds/MainWorld.cs

@@ -36,7 +36,7 @@ namespace WCS.WorkEngineering.Worlds
         ///  更新前执行,重写改方法后请自行添加执行内容
         ///  执行内容:清空日志队列
         /// </summary>
-        protected override void BeforeUpdate()
+        protected override void BeforeUpdate(List<WorkTimes> list)
         {
             // 清空日志队列,确保日志队列中只会有当前周期日志
             Logs.Clear();
@@ -46,7 +46,7 @@ namespace WCS.WorkEngineering.Worlds
         /// 更新后执行,重写改方法后请自行添加执行内容
         /// 执行内容:清空日志队列
         /// </summary>
-        protected override void AfterUpdate()
+        protected override void AfterUpdate(List<WorkTimes> list)
         {
             LogHub.WorldPublish(Logs, this.GetType().Name);
         }

+ 20 - 0
业务工程/分拣库/WCS.WorkEngineering/Worlds/PalletizingWorld.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WCS.WorkEngineering.Worlds
+{
+    /// <summary>
+    /// 码垛主世界
+    /// </summary>
+    [Description("码垛主世界")]
+    public class PalletizingWorld : MainWorld
+    {
+        public PalletizingWorld()
+        {
+        }
+    }
+}

+ 2 - 2
业务工程/时效库/WCS.WorkEngineering/Extensions/FlagExtension.cs

@@ -16,7 +16,7 @@ namespace WCS.WorkEngineering.Extensions
         /// <returns></returns>
         public static T GetFlag<T>(this Device device, string key)
         {
-            if (!device.HasFlag(key))
+            if (!device.HasFlagKey(key))
             {
                 if (typeof(T) == typeof(int)) device.AddFlag(key, default(int).ToString());
                 else if (typeof(T) == typeof(short)) device.AddFlag(key, default(bool).ToString());
@@ -37,7 +37,7 @@ namespace WCS.WorkEngineering.Extensions
         /// <returns></returns>
         public static void SetFlag<T>(this Device device, string key, T value)
         {
-            device.SetFlag(key, value.ToString());
+            device.SetFlag(key, value.ToString()!);
         }
     }
 }

+ 2 - 2
业务工程/时效库/WCS.WorkEngineering/Worlds/MainWorld.cs

@@ -36,7 +36,7 @@ namespace WCS.WorkEngineering.Worlds
         ///  更新前执行,重写改方法后请自行添加执行内容
         ///  执行内容:清空日志队列
         /// </summary>
-        protected override void BeforeUpdate()
+        protected override void BeforeUpdate(List<WorkTimes> list)
         {
             // 清空日志队列,确保日志队列中只会有当前周期日志
             Logs.Clear();
@@ -46,7 +46,7 @@ namespace WCS.WorkEngineering.Worlds
         /// 更新后执行,重写改方法后请自行添加执行内容
         /// 执行内容:清空日志队列
         /// </summary>
-        protected override void AfterUpdate()
+        protected override void AfterUpdate(List<WorkTimes> list)
         {
             LogHub.WorldPublish(Logs, this.GetType().Name);
         }