Administrator 3 年之前
父节点
当前提交
a3cfe4ce5b

二进制
DLL/PLC.Siemens.dll


+ 20 - 7
Projects/永冠OPP/WCS.Service/Extensions/DeviceExtension.cs

@@ -633,17 +633,30 @@ namespace WCS.Service.Extensions
         {
             try
             {
-                if (ExDevice.Any(v => v == Entity.CODE)) return;
-                if (Entity.CODE == "SRM3" || Entity.CODE == "SRM4") AddExDevice("SRM3-SRM4-Out");
-                if (Entity.CODE == "SRM5" || Entity.CODE == "SRM6") AddExDevice("SRM5-SRM6-Out");
-                if (Entity.CODE == "SRM7" || Entity.CODE == "SRM8") AddExDevice("SRM7-SRM8-Out");
+                if (Entity.CODE == "SRM3" || Entity.CODE == "SRM4")
+                {
+                    if (ExDevice.Any(v => v == "SRM3-SRM4-Out")) return;
+                    AddExDevice("SRM3-SRM4-Out");
+                }
+                if (Entity.CODE == "SRM5" || Entity.CODE == "SRM6")
+                {
+                    if (ExDevice.Any(v => v == "SRM5-SRM6-Out")) return;
+                    AddExDevice("SRM5-SRM6-Out");
+                }
+
+                if (Entity.CODE == "SRM7" || Entity.CODE == "SRM8")
+                {
+                    if (ExDevice.Any(v => v == "SRM7-SRM8-Out")) return;
+                    AddExDevice("SRM7-SRM8-Out");
+                }
+
                 act(this);
             }
             finally
             {
-                if (Entity.CODE == "SRM3" || Entity.CODE == "SRM4") AddExDevice("SRM3-SRM4-Out");
-                if (Entity.CODE == "SRM5" || Entity.CODE == "SRM6") AddExDevice("SRM5-SRM6-Out");
-                if (Entity.CODE == "SRM7" || Entity.CODE == "SRM8") AddExDevice("SRM7-SRM8-Out");
+                if (Entity.CODE == "SRM3" || Entity.CODE == "SRM4") RemoveExDevice("SRM3-SRM4-Out");
+                if (Entity.CODE == "SRM5" || Entity.CODE == "SRM6") RemoveExDevice("SRM5-SRM6-Out");
+                if (Entity.CODE == "SRM7" || Entity.CODE == "SRM8") RemoveExDevice("SRM7-SRM8-Out");
             }
         }
 

+ 2 - 2
Projects/永冠OPP/WCS.Service/Works/SRM/SRMWork.cs

@@ -134,7 +134,7 @@ namespace WCS.Service.Works.SRM
                 {
                     #region 入库
 
-                    if (outPriority?.Priority > enterPriority?.Priority) return;
+                    if (enterPriority != null && outPriority != null && outPriority.Priority > enterPriority.Priority) return;
                     //获取所有取货点
                     var arrIn = obj.GetPickPoint()
                                    .Where(v => Device.Where(d => d.IsConv())
@@ -230,7 +230,7 @@ namespace WCS.Service.Works.SRM
                     var floor = obj.Entity.Get<int>("LastFloor");
                     floor = floor % 2 + 1;
                     obj.Entity.Set("LastFloor", floor);
-                    if (enterPriority?.Priority > outPriority?.Priority) return;
+                    if (enterPriority != null && outPriority != null && enterPriority.Priority > outPriority.Priority) return;
                     obj.EXOutStock(obj =>
                     {
                         //获取当前堆垛机所有的放货点