From 6388ded0d17080ba4691d212e9e3933107fcbfc5 Mon Sep 17 00:00:00 2001 From: liuwf Date: Sat, 21 Sep 2024 18:53:33 +0800 Subject: [PATCH] =?UTF-8?q?add-AGV=E9=80=9A=E8=BF=87=E8=B5=B0=E5=BB=8A?= =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E9=A2=84=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Khd.Core.Wcs/MainCentralControl.cs | 1 + src/Khd.Core.Wcs/Wcs/SystemTimer.cs | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/Khd.Core.Wcs/MainCentralControl.cs b/src/Khd.Core.Wcs/MainCentralControl.cs index cd7e666..f83e674 100644 --- a/src/Khd.Core.Wcs/MainCentralControl.cs +++ b/src/Khd.Core.Wcs/MainCentralControl.cs @@ -35,6 +35,7 @@ namespace Khd.Core.Wcs /// public void Start() { + LoggerUtils logger = new LoggerUtils(); using var scope = _host.Services.CreateScope(); using var dbContext = scope.ServiceProvider.GetRequiredService(); diff --git a/src/Khd.Core.Wcs/Wcs/SystemTimer.cs b/src/Khd.Core.Wcs/Wcs/SystemTimer.cs index 3b36c73..0f186b3 100644 --- a/src/Khd.Core.Wcs/Wcs/SystemTimer.cs +++ b/src/Khd.Core.Wcs/Wcs/SystemTimer.cs @@ -737,6 +737,17 @@ namespace Khd.Core.Wcs.Wcs var Ylc = basePlcs.First(t => t.Name.Contains('Y')); StaticData.PlcDic[2].WriteToPoint(XPlc.Address, cardStatus.PosX.ToString(), XPlc.type); StaticData.PlcDic[2].WriteToPoint(Ylc.Address, cardStatus.PosY.ToString(), Ylc.type); + + #region 经过走廊区域报警 + if (int.Parse(cardStatus.PosX) >= 53040 && int.Parse(cardStatus.PosX) <= 58090 && (int.Parse(cardStatus.PosY) >= 53520 && int.Parse(cardStatus.PosY) <= 64590)) + { + Console.WriteLine("=======>3F走廊区域预警"); + } + else + { + // Console.WriteLine("3F走廊区域正常"); + } + #endregion } } catch @@ -776,7 +787,22 @@ namespace Khd.Core.Wcs.Wcs var Ylc = basePlcs.First(t => t.Name.Contains('Y')); StaticData.PlcDic[2].WriteToPoint(XPlc.Address, cardStatus.PosX.ToString(), XPlc.type); StaticData.PlcDic[2].WriteToPoint(Ylc.Address, cardStatus.PosY.ToString(), Ylc.type); + + #region 经过走廊区域报警 + if (int.Parse(cardStatus.PosX) >= 119000 && int.Parse(cardStatus.PosX) <= 122800 && (int.Parse(cardStatus.PosY) >= 124100 && int.Parse(cardStatus.PosY) <= 134435)) + { + Console.WriteLine("=======>2F走廊区域预警"); + } + else + { + // Console.WriteLine("2F走廊区域正常"); + } + #endregion } + + + + } catch {