From 5da3a276b7847187a7c155ee069d3cd4c9e58074 Mon Sep 17 00:00:00 2001
From: HuBingJie <3146306518@qq.com>
Date: 星期日, 07 十二月 2025 23:28:14 +0800
Subject: [PATCH] 1
---
代码管理/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs | 54 +++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 49 insertions(+), 5 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
index 68bc838..d3c4465 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
@@ -1,5 +1,6 @@
锘縰sing AutoMapper;
using Quartz;
+using System.Net;
using WIDESEA_Common.Log;
using WIDESEAWCS_Core;
using WIDESEAWCS_DTO.Enum;
@@ -103,8 +104,8 @@
WebResponseContent webResponse = _taskService.StkRunStatus();
if (RGVstate && webResponse.Status == true)
{
- //鍐欏叆寮�闂ㄤ俊鍙�
- GetDeviceAddress.WriteSecurityDoorpolice(aGVStation.ChildPosiDeviceCode, "OpenDoor", 1);
+ //鍐欏叆寮�闂ㄤ俊鍙�
+ GetDeviceAddress.WriteSecurityDoorpolice(aGVStation.ChildPosiDeviceCode, "OpenDoor", 1);
}
}
@@ -233,18 +234,61 @@
}
//绔欏彴淇″彿
- public bool StoticCommand(CommonConveyorLine conveyorLine, string kladder)
+ /* public bool StoticCommand(CommonConveyorLine conveyorLine, string kladder)
{
DeviceProDTO? deviceProDTO6 = conveyorLine.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == kladder
&& x.DeviceProParamName == "HCJ_GoodsStatus"
&& x.DeviceProParamType == "ReadDeviceCommand");
if(deviceProDTO6 == null) { return false; }
+ if (deviceProDTO6.DeviceChildCode == "2016"||deviceProDTO6.DeviceChildCode == "2017"|| deviceProDTO6.DeviceChildCode == "2018"|| deviceProDTO6.DeviceChildCode == "2019"
+ || deviceProDTO6.DeviceChildCode == "1001"|| deviceProDTO6.DeviceChildCode == "1002")
+ {
+ var value1 = conveyorLine.Communicator.Read<short>(deviceProDTO6.DeviceProAddress);
+ //寤舵椂5绉�
+ System.Threading.Thread.Sleep(5000);
+ var value2 = conveyorLine.Communicator.Read<short>(deviceProDTO6.DeviceProAddress);
+ if (value1 != value2 && (value1 !=0 && value2 !=0)) { return false; };
+ return true;
+ }
var value = conveyorLine.Communicator.Read<short>(deviceProDTO6.DeviceProAddress);
+
if (value == 0) { return true; }
return false;
+ }*/
+
+
+
+ //绔欏彴淇″彿
+ public bool StoticCommand(CommonConveyorLine conveyorLine, string kladder)
+ {
+ DeviceProDTO? deviceProDTO = conveyorLine.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == kladder
+ && x.DeviceProParamName == "HCJ_GoodsStatus"
+ && x.DeviceProParamType == "ReadDeviceCommand");
+ // 杩欎簺绔欏彴闇�瑕佲�滃欢鏃�5绉掑苟姣旇緝绗竴娆′笌鏈�鍚庝竴娆$粨鏋溾��
+ bool isPlatformCode =
+ kladder == "2016" || kladder == "2017" || kladder == "2018" || kladder == "2019" ||
+ kladder == "1001" || kladder == "1002";
+
+ if (isPlatformCode)
+ {
+ // 绗竴娆¤鍙�
+ short first = conveyorLine.Communicator.Read<short>(deviceProDTO.DeviceProAddress);
+
+ // 寤舵椂5绉�
+ System.Threading.Thread.Sleep(5000);
+
+ // 鏈�鍚庝竴娆¤鍙�
+ short last = conveyorLine.Communicator.Read<short>(deviceProDTO.DeviceProAddress);
+
+ // 鍗忚锛�0=鏃犱俊鍙�=鏃犺揣=绌轰綅
+ return first == 0 && last == 0;
+ }
+ else
+ {
+ short value = conveyorLine.Communicator.Read<short>(deviceProDTO.DeviceProAddress);
+ return value == 0; // 0=绌轰綅鍙斁锛�1=鏈夎揣涓嶅彲鏀�
+ }
}
-
-
}
}
--
Gitblit v1.9.3