From 0b4792ff8245f9eac16e6d02452eb9a091f6f72b Mon Sep 17 00:00:00 2001
From: huanghongfeng <huanghongfeng@hnkhzn.com>
Date: 星期二, 28 十月 2025 19:42:04 +0800
Subject: [PATCH] 1

---
 代码管理/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SpeStackerCraneJob/SpeStackerCraneJob.cs |  105 +++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 70 insertions(+), 35 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SpeStackerCraneJob/SpeStackerCraneJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SpeStackerCraneJob/SpeStackerCraneJob.cs"
index 6790f09..d8bac0e 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SpeStackerCraneJob/SpeStackerCraneJob.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SpeStackerCraneJob/SpeStackerCraneJob.cs"
@@ -77,6 +77,28 @@
                             CommonStackerCrane_AGVTaskCompletedEventHandler(getStackerObject, speStackerCrane);
                         }
 
+                        //鍒ゆ柇褰撳墠璁惧鏄叆搴撹繕鏄嚭搴�
+                        /*if (GetDeviceAddress.OutbounMotherChildCartbool(speStackerCrane.DeviceCode))
+                        {
+                            //鍒ゆ柇褰撳墠瀹夊叏闂ㄦ槸鍚︿负缁胯壊鐏�
+                            if (GetDeviceAddress.ReadAqmDecicStice(1))
+                            {
+                                return null;
+                            }
+                        }
+                        else
+                        {
+                            //鍒ゆ柇鍏ュ簱绔畨鍏ㄩ棬鏄惁姝e父
+                            if (GetDeviceAddress.ReadAqmDecicStice(2))
+                            {
+                                return null;
+                            }
+                        }*/
+
+                        
+                        
+
+
                         if (getStackerObject.RgvCraneAutoStatusValue == RgvCraneAutoStatus.Automatic &&
                         getStackerObject.StaclerkJobJobStatusValue == RGV_Rgvtaskstutas.Ready && getStackerObject.RgvCraneWorkStatusValue == RGVStepprocess.NoAction)
                         {
@@ -139,8 +161,12 @@
             }
             else if (getStackerObject.StaclerkJobJobStatusValue == RGV_Rgvtaskstutas.AbnormalCompletion && getStackerObject.CurrentRgvtaskid != 0 && getStackerObject.CurrentRgvtaskid != 30001)
             {
+
+                //淇敼浠诲姟鐘舵�佷负寮傚父瀹屾垚                                              
+                _taskService.HandleInAbnormal(getStackerObject.CurrentRgvtaskid);   
+
                 //鍐欏叆寮傚父瀹屾垚鎶ヨ淇℃伅
-                speStackerCrane.Communicator.Write<short>("DB101.36", 1);
+                speStackerCrane.Communicator.Write<short>("DB101.36", 1);   //鍐欏叆鎶ヨ
             }
         }
         #endregion
@@ -179,7 +205,7 @@
                     => GoodsPlacedCorridor(RGVTaskdevice),    //瀛愯溅鏀捐揣浠诲姟(宸插畬鎴�)
 
                 ((int)RGVEquipment.Mothertrailer, RgvEquipmentStatus.HasCargo)
-                    => MotherVehicleMovement(RGVTaskdevice),        //锛堝凡瀹屾垚锛�
+                    => MotherVehicleMovement(RGVTaskdevice),        //姣嶈溅绉诲姩锛堝凡瀹屾垚锛�
 
                 _ => null
             };
@@ -434,7 +460,13 @@
                     }
                     else
                     {
-                        RGVMovetask(Muche.ZicheMotherinlaw, Muche.ChildPosiDeviceCode);  //濡傛灉娌℃湁浠诲姟锛屽垯鍙互杩涜绉诲姩鍑烘潵
+                        //鍒ゆ柇姣嶈溅鏄惁鏈変换鍔�
+                        Dt_Task _Task1 = _taskService.MothermacTask(Muche.ChildPosiDeviceCode);
+                        if (task == null)
+                        {
+                            RGVMovetask(Muche.ZicheMotherinlaw, Muche.ChildPosiDeviceCode);  //濡傛灉娌℃湁浠诲姟锛屽垯鍙互杩涜绉诲姩鍑烘潵
+                        }
+                            
                     }
                 }
             }
@@ -480,7 +512,12 @@
                 Dt_Task task = _taskService.MothermachinemovementTask2(Muche2.ChildPosiDeviceCode);   //鑾峰彇鍒版瘝杞︾Щ鍔ㄤ换鍔�
                 if (task == null)
                 {
-                    RGVMovetask(Muche2.ZicheMotherinlaw, Muche2.ChildPosiDeviceCode);  //濡傛灉娌℃湁浠诲姟锛屽垯鍙互杩涜绉诲姩鍑烘潵
+                    Dt_Task _Task1 = _taskService.MothermacTask(Muche.ChildPosiDeviceCode);
+                    if (task == null)
+                    {
+                        RGVMovetask(Muche2.ZicheMotherinlaw, Muche2.ChildPosiDeviceCode);  //濡傛灉娌℃湁浠诲姟锛屽垯鍙互杩涜绉诲姩鍑烘潵
+                    }
+                        
                 }
             }
             return null;
@@ -511,7 +548,7 @@
                 AGVStation Muche2 = _agvStationService.GetMothervehicle(aGVStation.MotherCardeputy);    //鍐呬晶姣嶈溅
                 int mucheaddre2 = GetDeviceAddress.GetEquipmentlocation(Muche2.ChildPosiDeviceCode);
 
-                if ((neizichecurraddres == neiziche.WaitmomentOne || neizichecurraddres == neiziche.WaitmomentTwo) && task == null && mucheaddre1 == Muche.Motherinlaw && mucheaddre2 == Muche2.Motherinlaw)
+                if ((neizichecurraddres == neiziche.WaitmomentOne || neizichecurraddres == neiziche.WaitmomentTwo) && task == null && neizichecurraddres != neiziche.HCJStorageaddress && mucheaddre1 == Muche.Motherinlaw && mucheaddre2 == Muche2.Motherinlaw)
                 {
                     return _Task;
                 }
@@ -624,8 +661,14 @@
             Dt_Task Muche2Task = _taskService.ObtainMuChetask(ZicheinnerSide.MotherCardeputy.ToString());
             if (Muche2Task == null) return null;
 
+            //鑾峰彇瀛愯溅鏄惁鏈変换鍔�
             Dt_Task zicheTASK = _taskService.GetChariotTaskBool(ZicheinnerSide.ChildPosiDeviceCode);
             if (zicheTASK != null) return null;
+
+            //鑾峰彇2宸烽亾瀛愯溅鏄惁鏈変换鍔�
+            var muche1 = _agvStationService.GetMothervehicle(ZicheinnerSide.MotherCarDeviceCode);
+            Dt_Task Muche1 = _taskService.GetChariotTaskBool(muche1.ChildPosiDeviceCode.ToString());
+            if(Muche1!=null) return null;
 
             return Muche2Task;
         }
@@ -635,15 +678,11 @@
             Dt_Task Muche3Task = _taskService.ObtainMuChetask(ZicheinnerSide.MotherCarDeviceCode.ToString());
             if (Muche3Task == null) return null;
 
-            //鍒ゆ柇瀛愯溅鏄惁鏈夋湁闇�瑕佸彇璐х殑浠诲姟
-            Dt_Task zicheTASK = _taskService.GetChariotTaskBool(ZicheinnerSide.ChildPosiDeviceCode);
+            //鍒ゆ柇瀛愯溅鏄惁鏈夎鍙朒CJ浠诲姟
+            Dt_Task zicheTASK = _taskService.GetHCJTaskBool(ZicheinnerSide.ChildPosiDeviceCode, ZicheinnerSide.HCJStorageaddress);
             if (zicheTASK != null) return null;
 
-            if (curraddZiChe == ZicheinnerSide.WaitmomentTwo || curraddZiChe == ZicheinnerSide.WaitmomentOne)
-            {
-                return Muche3Task;
-            }
-            return null;
+            return Muche3Task;
         }
         public Dt_Task? OutboundSideAisle4(int curraddZiChe, AGVStation ZicheinnerSide)
         {
@@ -651,25 +690,16 @@
             Dt_Task Muche4Task = _taskService.ObtainMuChetask(ZicheinnerSide.MotherCardeputy.ToString());
             if (Muche4Task == null) return null;
 
+            //鍒ゆ柇鏄惁鏈夐渶瑕佸彇HCJ鐨勪换鍔�
             Dt_Task zicheTASK = _taskService.GetChariotTaskBool(ZicheinnerSide.ChildPosiDeviceCode);
             if (zicheTASK != null) return null;
 
-            if (curraddZiChe == ZicheinnerSide.WaitmomentOne)
-            {
+            //鍒ゆ柇3宸烽亾鏄惁鏈夊嚭搴撶殑浠诲姟
+            var muche3 = _agvStationService.GetMothervehicle(ZicheinnerSide.MotherCarDeviceCode);
+            Dt_Task muchetask = _taskService.OutMothermaTask(muche3.ChildPosiDeviceCode);
+            if (muchetask != null) return null;
 
-            }
-
-            
-
-            
-
-
-
-            if ( || curraddZiChe == ZicheinnerSide.WaitmomentTwo)
-            {
-                return Muche4Task;
-            }
-            return null;
+            return Muche4Task;
         }
 
         #endregion
@@ -876,7 +906,7 @@
                 GetStackerObject getStackerObject = GetDeviceAddress.GetChildDeviceCode(zichestation.ChildPosiDeviceCode);
 
                 if (getStackerObject.StaclerkJobJobStatusValue != RGV_Rgvtaskstutas.Executing && getStackerObject.RgvCraneAutoStatusValue == RgvCraneAutoStatus.Automatic
-                     && (getStackerObject.RGVCurrentlocation == zichestation.WaitmomentOne || getStackerObject.RGVCurrentlocation == zichestation.WaitmomentTwo) && getStackerObject.RGVCurrentlocation != zichestation.ZicheMotherinlaw)
+                     && (getStackerObject.RGVCurrentlocation == zichestation.WaitmomentOne || getStackerObject.RGVCurrentlocation == zichestation.WaitmomentTwo || getStackerObject.RGVCurrentlocation==1171) && getStackerObject.RGVCurrentlocation != zichestation.ZicheMotherinlaw)
                 {
                     RGVMovetask(GdZiche.Motherinlaw, GdZiche.ChildPosiDeviceCode);
                 }
@@ -901,7 +931,7 @@
                     {
                         RGVMovetask(GdZiche.WaitmomentOne, GdZiche.ChildPosiDeviceCode);
                     }
-                    else if (GdZiche.MotherCardeputy == RGVCurrentlocation && RGVCurrentlocation == 1171)
+                    else if (GdZiche.MotherCardeputy == RGVCurrentlocation || RGVCurrentlocation == 1171)
                     {
                         RGVMovetask(GdZiche.WaitmomentTwo, GdZiche.ChildPosiDeviceCode);
                     }
@@ -918,14 +948,19 @@
             {
                 if (GdZiche.Station_Area == 5)
                 {
-                    if (GdZiche.MotherCarDeviceCode == RGVCurrentlocation || GdZiche.HCJStorageaddress == RGVCurrentlocation)
+                    Dt_Task task = _taskService.GetChariotTaskBool(GdZiche.ChildPosiDeviceCode);
+                    if (task == null && RgvCraneStatusValue == (int)RgvEquipmentStatus.NoCargo)
                     {
-                        RGVMovetask(GdZiche.WaitmomentOne, GdZiche.ChildPosiDeviceCode);
+                        if (GdZiche.MotherCarDeviceCode == RGVCurrentlocation || GdZiche.HCJStorageaddress == RGVCurrentlocation)
+                        {
+                            RGVMovetask(GdZiche.WaitmomentOne, GdZiche.ChildPosiDeviceCode);
+                        }
+                        else if (GdZiche.MotherCardeputy == RGVCurrentlocation)
+                        {
+                            RGVMovetask(GdZiche.WaitmomentTwo, GdZiche.ChildPosiDeviceCode);
+                        }
                     }
-                    else if (GdZiche.MotherCardeputy == RGVCurrentlocation)
-                    {
-                        RGVMovetask(GdZiche.WaitmomentTwo, GdZiche.ChildPosiDeviceCode);
-                    }
+                        
                 }
                 else
                 {

--
Gitblit v1.9.3