From b9f8212946fde1af1216b972996c32b8c8ed6363 Mon Sep 17 00:00:00 2001 From: hutongqing <hutongqing@hnkhzn.com> Date: 星期三, 27 十一月 2024 10:07:34 +0800 Subject: [PATCH] Revert "Stop tracking D:\widesea\尖山立库\JianShanLiKu\代码管理\WCS\WIDESEAWCS_Server\WIDESEAWCS_BasicInfoRepository\bin" --- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs | 121 ++++++++++++++++++++++++--------------- 1 files changed, 74 insertions(+), 47 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 ea508ed..e536cc1 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" @@ -146,7 +146,10 @@ task = OutTaskMovelibrary(task); if (task != null) { - return task; + if (OutTaskStationIsOccupied(task) != null) + { + return task; + } } } if (OutTaskStationIsOccupied(task) != null) @@ -296,7 +299,20 @@ if (device != null) { CommonConveyorLine conveyorLine = (CommonConveyorLine)device; - if (PLCSignal(conveyorLine, task.TargetAddress, 1)) //鍐欏叆杈撻�佺嚎 鍫嗗灈鏈烘斁璐� 淇″彿 + if (task.TargetAddress == "R02-002-027-011-01" || task.TargetAddress == "R01-002-041-011-01") //鍐欏叆杈撻�佺嚎鍘诲悜 + { + byte PLCtost = (byte)task.PLCTo; + if (PLCSignal2(conveyorLine, task.TargetAddress, "W_Destination", PLCtost)) + { + WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ュ幓鍚戞垚鍔燂紝鍘诲悜涓猴細{PLCtost}", $"鍑烘枡鍙e幓鍚�"); + } + else + { + WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ュ幓鍚戝け璐ワ紝鍘诲悜涓猴細{PLCtost}", $"鍑烘枡鍙e幓鍚�"); + } + } + + if (PLCSignal(conveyorLine, task.TargetAddress, (byte)1)) //鍐欏叆杈撻�佺嚎 鍫嗗灈鏈烘斁璐� 淇″彿 { //璇诲彇杈撻�佺嚎鍙嶉 鍫嗗灈鏈烘斁涓嬩俊鍙� DeviceProDTO? deviceProDTO2 = GetDeviceProDTO(conveyorLine, task.TargetAddress, "R_StackerCraneLowered"); //杈撻�佺嚎鍗忚鎵捐鍙栦俊鍙� @@ -307,64 +323,75 @@ if (B_TAKE == 1) { - - - - //鍫嗗灈鏈哄啓瀹屾垚 - if (Releasespermitted4(commonStackerCrane, task.TargetAddress, true)) + if (task.TargetAddress == "R02-002-027-011-01" || task.TargetAddress == "R01-002-041-011-01") { - WriteLog.GetLog("鍫嗗灈鏈轰俊鍙�").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ュ爢鍨涙満鏀句笅淇″彿鎴愬姛锛歵rue", $"锛堟斁璐э級鍐欏叆{task.TargetAddress}"); - } - else - { - 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) + DeviceProDTO? deviceProDTO3 = GetDeviceProDTO(conveyorLine, task.TargetAddress, "R_Destination"); + if (deviceProDTO3 != null) { - if (PLCSignal2(conveyorLine, task.TargetAddress, "W_Destination", PLCtost)) + int PLCwcstost = GetLine(conveyorLine, deviceProDTO3.DeviceProDataBlock); + if (PLCwcstost == task.PLCTo) { - WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ュ幓鍚戞垚鍔燂紝鍘诲悜涓猴細{PLCtost}", $"鍑烘枡鍙e幓鍚�"); - DeviceProDTO? deviceProDTO3 = GetDeviceProDTO(conveyorLine, task.TargetAddress, "R_Destination"); - if (deviceProDTO3 != null) + byte PLCtost2 = 0; + if (PLCSignal2(conveyorLine, task.TargetAddress, "W_Destination", PLCtost2)) { - 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}"); - } + WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氭竻闄ゅ幓鍚戞垚鍔�", $"鍑烘枡鍙e幓鍚�"); + } + else + { + WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氭竻闄ゅ幓鍚戝け璐�", $"鍑烘枡鍙e幓鍚�"); + } + // 娓呴櫎杈撻�佺嚎 + if (PLCSignal(conveyorLine, task.TargetAddress, (byte)0)) + { + WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ヨ緭閫佺嚎娓呴櫎-鍫嗗灈鏈烘斁涓嬩俊鍙锋垚鍔�", $"鍑烘枡鍙e幓鍚�"); + } + else + { + WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ヨ緭閫佺嚎娓呴櫎-鍫嗗灈鏈烘斁涓嬩俊鍙峰け璐�", $"鍑烘枡鍙e幓鍚�"); + } + //鍫嗗灈鏈哄啓瀹屾垚 + if (Releasespermitted4(commonStackerCrane, task.TargetAddress, true)) + { + WriteLog.GetLog("鍫嗗灈鏈轰俊鍙�").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ュ爢鍨涙満鏀句笅淇″彿鎴愬姛锛歵rue", $"鍑烘枡鍙e幓鍚�"); + } + else + { + WriteLog.GetLog("鍫嗗灈鏈轰俊鍙�").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ュ爢鍨涙満鏀句笅淇″彿澶辫触:true", $"鍑烘枡鍙e幓鍚�"); + } + } else { - WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ュ幓鍚戝け璐ワ紝鍘诲悜涓猴細{PLCtost}", $"鍑烘枡鍙e幓鍚�"); + WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬幓鍚戞瘮瀵逛笉涓�鑷达紝杈撻�佺嚎鍘诲悜涓猴細{PLCwcstost}锛寃cs鍐欏叆鍘诲悜涓猴細{task.PLCTo}", $"鍑烘枡鍙e幓鍚�"); } } } - // 娓呴櫎杈撻�佺嚎 - if (PLCSignal(conveyorLine, task.TargetAddress, 0)) + + if (task.TargetAddress != "R02-002-027-011-01" && task.TargetAddress != "R01-002-041-011-01") { - WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ヨ緭閫佺嚎娓呴櫎-鍫嗗灈鏈烘斁涓嬩俊鍙锋垚鍔�", $"锛堟斁璐э級璇诲彇{task.TargetAddress}"); + // 娓呴櫎杈撻�佺嚎 + if (PLCSignal(conveyorLine, task.TargetAddress, 0)) + { + WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ヨ緭閫佺嚎娓呴櫎-鍫嗗灈鏈烘斁涓嬩俊鍙锋垚鍔�", $"锛堟斁璐э級璇诲彇{task.TargetAddress}"); + } + else + { + WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ヨ緭閫佺嚎娓呴櫎-鍫嗗灈鏈烘斁涓嬩俊鍙峰け璐�", $"锛堟斁璐э級璇诲彇{task.TargetAddress}"); + } + + //鍫嗗灈鏈哄啓瀹屾垚 + if (Releasespermitted4(commonStackerCrane, task.TargetAddress, true)) + { + WriteLog.GetLog("鍫嗗灈鏈轰俊鍙�").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ュ爢鍨涙満鏀句笅淇″彿鎴愬姛锛歵rue", $"锛堟斁璐э級鍐欏叆{task.TargetAddress}"); + } + else + { + WriteLog.GetLog("鍫嗗灈鏈轰俊鍙�").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ュ爢鍨涙満鏀句笅淇″彿澶辫触:true", $"锛堟斁璐э級鍐欏叆{task.TargetAddress}"); + } } - else - { - WriteLog.GetLog("杈撻�佺嚎").Write($"绔欏彴缂栧彿锛歿task.TargetAddress},浠诲姟鍙凤細{task.TaskNum},淇℃伅锛氬啓鍏ヨ緭閫佺嚎娓呴櫎-鍫嗗灈鏈烘斁涓嬩俊鍙峰け璐�", $"锛堟斁璐э級璇诲彇{task.TargetAddress}"); - } + + } else { -- Gitblit v1.9.3