From 426848306ad9233db96e4b3fc68a881c15f0b0b0 Mon Sep 17 00:00:00 2001
From: huanghongfeng <huanghongfeng@hnkhzn.com>
Date: 星期五, 22 十一月 2024 13:43:53 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/ZhiHuiQiCe/JianShanLiKu

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs |   60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 57 insertions(+), 3 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
index 52c7b45..ea508ed 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
@@ -6,6 +6,7 @@
 using System;
 using System.Collections.Generic;
 using System.Diagnostics.CodeAnalysis;
+using System.Diagnostics.Eventing.Reader;
 using System.Linq;
 using System.Reflection.Metadata;
 using System.Text;
@@ -259,6 +260,7 @@
                             int B_Event_Test = GetLine(conveyorLine, deviceProDTO.DeviceProDataBlock);        //鍒ゆ柇杈撻�佺嚎鏄惁鍏佽鏀捐揣淇″彿
                             if (B_Event_Test == 1)
                             {
+
                                 if (Releasespermitted(commonStackerCrane, task.TargetAddress,true))  //鍐欏叆鍫嗗灈鏈哄厑璁告斁璐т俊
                                 {
                                     WriteLog.GetLog("鍫嗗灈鏈轰俊鍙�").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ュ爢鍨涙満鍏佽鏀捐揣淇″彿鎴愬姛锛歵rue", $"锛堟斁璐э級鍐欏叆{task.TargetAddress}");
@@ -305,6 +307,9 @@
 
                                     if (B_TAKE == 1)
                                     {
+
+                                        
+
                                         //鍫嗗灈鏈哄啓瀹屾垚
                                         if (Releasespermitted4(commonStackerCrane, task.TargetAddress, true))
                                         {
@@ -314,6 +319,43 @@
                                         {
                                             WriteLog.GetLog("鍫嗗灈鏈轰俊鍙�").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ュ爢鍨涙満鏀句笅淇″彿澶辫触:true", $"锛堟斁璐э級鍐欏叆{task.TargetAddress}");
                                         }
+
+                                        if (task.TargetAddress == "R02-002-027-011-01" || task.TargetAddress == "R01-002-041-011-01")   //鍐欏叆杈撻�佺嚎鍘诲悜
+                                        {
+                                            byte PLCtost = (byte)task.PLCTo;
+                                            while (true)
+                                            {
+                                                if (PLCSignal2(conveyorLine, task.TargetAddress, "W_Destination", PLCtost))
+                                                {
+                                                    WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ュ幓鍚戞垚鍔燂紝鍘诲悜涓猴細{PLCtost}", $"鍑烘枡鍙e幓鍚�");
+                                                    DeviceProDTO? deviceProDTO3 = GetDeviceProDTO(conveyorLine, task.TargetAddress, "R_Destination");
+                                                    if (deviceProDTO3 != null)
+                                                    {
+                                                        int PLCwcstost = GetLine(conveyorLine, deviceProDTO3.DeviceProDataBlock);
+                                                        if (PLCwcstost == PLCtost)
+                                                        {
+                                                            if (PLCSignal2(conveyorLine, task.TargetAddress, "W_Destination", 0))
+                                                            {
+                                                                WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氭竻闄ゅ幓鍚戞垚鍔�", $"锛堟斁璐э級鍐欏叆{task.TargetAddress}");
+                                                                break;
+                                                            }
+                                                            else
+                                                            {
+                                                                WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氭竻闄ゅ幓鍚戝け璐�", $"锛堟斁璐э級鍐欏叆{task.TargetAddress}");
+                                                            }
+                                                        }
+                                                        else
+                                                        {
+                                                            WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬幓鍚戞瘮瀵逛笉涓�鑷达紝杈撻�佺嚎鍘诲悜涓猴細{PLCwcstost}锛寃cs鍐欏叆鍘诲悜涓猴細{PLCtost}", $"锛堟斁璐э級鍐欏叆{task.TargetAddress}");
+                                                        }
+                                                    }
+                                                }
+                                                else
+                                                {
+                                                    WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ュ幓鍚戝け璐ワ紝鍘诲悜涓猴細{PLCtost}", $"鍑烘枡鍙e幓鍚�");
+                                                }
+                                            }
+                                        }
                                         // 娓呴櫎杈撻�佺嚎
                                         if (PLCSignal(conveyorLine, task.TargetAddress, 0))
                                         {
@@ -322,6 +364,18 @@
                                         else
                                         {
                                             WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ヨ緭閫佺嚎娓呴櫎-鍫嗗灈鏈烘斁涓嬩俊鍙峰け璐�", $"锛堟斁璐э級璇诲彇{task.TargetAddress}");
+                                        }
+                                    }
+                                    else
+                                    {
+                                        // 娓呴櫎杈撻�佺嚎
+                                        if (PLCSignal(conveyorLine, task.TargetAddress, 0))
+                                        {
+                                            WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氭湭璇诲彇鍒拌緭閫佺嚎鍙嶉鍫嗗灈鏈哄畬鎴愬弽棣堜俊鍙凤紝閲嶇疆涓�0", $"锛堟斁璐э級璇诲彇{task.TargetAddress}");
+                                        }
+                                        else
+                                        {
+                                            WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氭湭璇诲彇鍒拌緭閫佺嚎鍙嶉鍫嗗灈鏈哄畬鎴愬弽棣堜俊鍙凤紝閲嶇疆涓�0", $"锛堟斁璐э級璇诲彇{task.TargetAddress}");
                                         }
                                     }
                                 }
@@ -546,7 +600,7 @@
                     if (SetStacker(commonStackerCrane, deviceProDTO.DeviceProAddress, SCcrane).Status) { return true; }
                 }
             }
-            if (Destinationaddress == "R01-003-041-011-01")
+            if (Destinationaddress == "R01-002-041-011-01")
             {
                 DeviceProDTO? deviceProDTO = GetDeviceProDTO2(commonStackerCrane, commonStackerCrane.DeviceCode, "DeliveryPermission_Dout");
                 if (deviceProDTO != null)
@@ -646,7 +700,7 @@
             }
             if (Destinationaddress == "R02-002-027-011-01")
             {
-                DeviceProDTO? deviceProDTO = GetDeviceProDTO2(commonStackerCrane, commonStackerCrane.DeviceCode, "DeliveryCompletion_Din");
+                DeviceProDTO? deviceProDTO = GetDeviceProDTO2(commonStackerCrane, commonStackerCrane.DeviceCode, "DeliveryCompletion_Dout");
                 if (deviceProDTO != null)
                 {
                     if (SetStacker(commonStackerCrane, deviceProDTO.DeviceProAddress, SCcrane).Status) { return true; }
@@ -669,7 +723,7 @@
                     if (SetStacker(commonStackerCrane, deviceProDTO.DeviceProAddress, SCcrane).Status) { return true; }
                 }
             }
-            if (Destinationaddress == "R01-002-043-001-01")
+            if (Destinationaddress == "R01-002-044-001-01")
             {
                 DeviceProDTO? deviceProDTO = GetDeviceProDTO2(commonStackerCrane, commonStackerCrane.DeviceCode, "DeliveryCompletion_Aout");
                 if (deviceProDTO != null)

--
Gitblit v1.9.3