From 791c89883f26956304b9435d4fc4205c1b9bea1c Mon Sep 17 00:00:00 2001 From: liuwf Date: Wed, 25 Sep 2024 16:21:50 +0800 Subject: [PATCH] =?UTF-8?q?change-=E6=8F=90=E5=8D=87=E6=9C=BA=E8=8A=82?= =?UTF-8?q?=E6=8B=8D=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Khd.Core.Wcs/Wcs/SystemTimer.cs | 40 +++++++++++++++++------- src/Khd.Core.Wpf/Form/FormBoardT.xaml.cs | 13 +++++++- 2 files changed, 40 insertions(+), 13 deletions(-) diff --git a/src/Khd.Core.Wcs/Wcs/SystemTimer.cs b/src/Khd.Core.Wcs/Wcs/SystemTimer.cs index 0f186b3..89ba597 100644 --- a/src/Khd.Core.Wcs/Wcs/SystemTimer.cs +++ b/src/Khd.Core.Wcs/Wcs/SystemTimer.cs @@ -739,14 +739,22 @@ namespace Khd.Core.Wcs.Wcs 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)) + var Agv3FLED = StaticData.BasePlcpointList.First(t => t.id == 76); + if(Agv3FLED != null) { - Console.WriteLine("=======>3F走廊区域预警"); - } - else - { - // Console.WriteLine("3F走廊区域正常"); + if (int.Parse(cardStatus.PosX) >= 53040 && int.Parse(cardStatus.PosX) <= 58090 && (int.Parse(cardStatus.PosY) >= 53520 && int.Parse(cardStatus.PosY) <= 64590)) + { + // Console.WriteLine("=======>3F走廊区域预警"); + + StaticData.PlcDic[0].WriteToPoint(Agv3FLED.plcpointAddress, true, Agv3FLED.plcpointLength.ToString()); + } + else + { + // Console.WriteLine("3F走廊区域正常"); + StaticData.PlcDic[0].WriteToPoint(Agv3FLED.plcpointAddress, false, Agv3FLED.plcpointLength.ToString()); + } } + #endregion } } @@ -789,14 +797,22 @@ namespace Khd.Core.Wcs.Wcs 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)) + var Agv2FLED = StaticData.BasePlcpointList.First(t => t.id == 75); + if (Agv2FLED != null) { - Console.WriteLine("=======>2F走廊区域预警"); - } - else - { - // Console.WriteLine("2F走廊区域正常"); + if (int.Parse(cardStatus.PosX) >= 119000 && int.Parse(cardStatus.PosX) <= 122800 && (int.Parse(cardStatus.PosY) >= 124100 && int.Parse(cardStatus.PosY) <= 134435)) + { + // Console.WriteLine("=======>2F走廊区域预警"); + + StaticData.PlcDic[0].WriteToPoint(Agv2FLED.plcpointAddress, true, Agv2FLED.plcpointLength.ToString()); + } + else + { + // Console.WriteLine("2F走廊区域正常"); + StaticData.PlcDic[0].WriteToPoint(Agv2FLED.plcpointAddress, false, Agv2FLED.plcpointLength.ToString()); + } } + #endregion } diff --git a/src/Khd.Core.Wpf/Form/FormBoardT.xaml.cs b/src/Khd.Core.Wpf/Form/FormBoardT.xaml.cs index df1db73..4171ff5 100644 --- a/src/Khd.Core.Wpf/Form/FormBoardT.xaml.cs +++ b/src/Khd.Core.Wpf/Form/FormBoardT.xaml.cs @@ -124,6 +124,7 @@ namespace Khd.Core.Wpf.Form private void FormBoard_Loaded(object sender, RoutedEventArgs e) { InitializeData(1); + QueryPositionCombox.SelectedIndex = 0; // 设置默认选择为 "南侧" try { @@ -253,6 +254,16 @@ namespace Khd.Core.Wpf.Form Thread.Sleep(3000); } }); + + + try + { + GetPersonCallMaterialData(); + }catch(Exception ex) + { + Console.WriteLine(ex.Message); + } + //加载dategrid信息 //LoadMaterial_GetMessage(""); //连接PLC判断 @@ -1554,7 +1565,7 @@ namespace Khd.Core.Wpf.Form if (selectedTabItem != null && selectedTabItem.Name == "CallPersonManager") { //人工叫料界面 CallSelectedItem.Clear(); - await GetPersonCallMaterialData(); + //await GetPersonCallMaterialData(); } else if (selectedTabItem != null && selectedTabItem.Name == "InventoryManager") { //盘库界面