From d650b2172b3be3bb7ae5d3fa98d402c0523af9cb Mon Sep 17 00:00:00 2001 From: liuwf Date: Mon, 15 Apr 2024 11:21:00 +0800 Subject: [PATCH] =?UTF-8?q?add-=E6=88=90=E5=93=81=E5=88=86=E5=9E=9BB?= =?UTF-8?q?=E5=BA=93=E7=94=B5=E9=87=8F=E9=87=87=E9=9B=86=E5=8F=8A=E6=8A=A5?= =?UTF-8?q?=E8=AD=A6=E9=87=87=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/IndexPageView.xaml.cs | 5 +++++ Aucma.Core.CodeBinding/appsettings.json | 4 ++-- Aucma.Core.DataCollector/DataCollectorSetup.cs | 14 +++++++------- .../Factory/PalletizFactory.cs | 15 +++++++++------ 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/Aucma.Core.CodeBinding/Views/IndexPageView.xaml.cs b/Aucma.Core.CodeBinding/Views/IndexPageView.xaml.cs index 866a6ed4..5e48c157 100644 --- a/Aucma.Core.CodeBinding/Views/IndexPageView.xaml.cs +++ b/Aucma.Core.CodeBinding/Views/IndexPageView.xaml.cs @@ -17,6 +17,7 @@ using System.Windows.Navigation; using System.Windows.Shapes; using Aucma.Core.HwPLc; using RabbitMQ.Client; +using log4net; namespace Aucma.Core.CodeBinding.Views { @@ -25,6 +26,9 @@ namespace Aucma.Core.CodeBinding.Views /// public partial class IndexPageView : UserControl { + + private static readonly log4net.ILog log = LogManager.GetLogger(typeof(IndexPageView)); + public IndexPageView() { InitializeComponent(); @@ -44,6 +48,7 @@ namespace Aucma.Core.CodeBinding.Views if (SendPlcPass()) { MessageBox.Show("放行成功"); + log.Error("空板按钮异常启动放行"); } else { diff --git a/Aucma.Core.CodeBinding/appsettings.json b/Aucma.Core.CodeBinding/appsettings.json index 0c950315..f25547dd 100644 --- a/Aucma.Core.CodeBinding/appsettings.json +++ b/Aucma.Core.CodeBinding/appsettings.json @@ -273,8 +273,8 @@ "EquipName": "Palletiz", "PlcType": "Melsec", "Enabled": true, - "IP": "10.10.92.80", //10.10.92.80 - "Port": 2015 + "IP": "10.10.92.80", + "Port": 2013 } ], diff --git a/Aucma.Core.DataCollector/DataCollectorSetup.cs b/Aucma.Core.DataCollector/DataCollectorSetup.cs index 263dce63..11c9e8fa 100644 --- a/Aucma.Core.DataCollector/DataCollectorSetup.cs +++ b/Aucma.Core.DataCollector/DataCollectorSetup.cs @@ -31,7 +31,7 @@ namespace Aucma.Core.DataCollector { try { - if (stationCode == "1002") //箱壳、内胆,包含预装线、集存库 + if (stationCode == "1002") //暂未使用--箱壳、内胆,包含预装线、集存库 { Task.Run(() => { @@ -56,14 +56,14 @@ namespace Aucma.Core.DataCollector Parallel.Invoke(() => collector.CollectDeviceAlarmInfo(out var alarmInfos), () => collector.CollectDeviceElectricity(out var electricity)); }); } - else if (stationCode == "1010")//成品分垛 + else if (stationCode == "1010")//条码绑定工位 { - //Task.Run(() => - //{ - // DataCollectorFactory collector = new PalletizFactory(_deviceParamServices, _deviceAlarmInfoServices, _deviceElectricityServices); + Task.Run(() => + { + DataCollectorFactory collector = new PalletizFactory(_deviceParamServices, _deviceAlarmInfoServices, _deviceElectricityServices); - // Parallel.Invoke(() => collector.CollectDeviceAlarmInfo(out var alarmInfos), () => collector.CollectDeviceElectricity(out var electricity)); - //}); + Parallel.Invoke(() => collector.CollectDeviceAlarmInfo(out var alarmInfos), () => collector.CollectDeviceElectricity(out var electricity)); + }); Task.Run(() => { DataCollectorFactory collector = new ShellStoreFactory(_deviceParamServices, _deviceAlarmInfoServices, _deviceElectricityServices); diff --git a/Aucma.Core.DataCollector/Factory/PalletizFactory.cs b/Aucma.Core.DataCollector/Factory/PalletizFactory.cs index b74c1597..9fd17899 100644 --- a/Aucma.Core.DataCollector/Factory/PalletizFactory.cs +++ b/Aucma.Core.DataCollector/Factory/PalletizFactory.cs @@ -19,7 +19,7 @@ namespace Aucma.Core.DataCollector.Factory } /// - /// 采集成品分垛设备报警信息 + /// 采集成品A库分垛设备报警信息 /// /// /// @@ -29,13 +29,14 @@ namespace Aucma.Core.DataCollector.Factory { try { - + var deviceParams1 = base._deviceParamServices.Query(x => x.DeviceCode == "E00023"); + if (_plc != null) { Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}采集成品分垛设备报警信息"); var plc = _plc.plc; - var deviceParams = base._deviceParamServices.Query(x => x.DeviceCode == "E00002"); + var deviceParams = base._deviceParamServices.Query(x => x.DeviceCode == "E00023"); if (deviceParams != null) { @@ -94,7 +95,7 @@ namespace Aucma.Core.DataCollector.Factory { if (_plc != null) { - Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}采集设备用电数据"); + Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}采集成品分垛设备用电数据"); var plc = _plc.plc; deviceElectricitys = new List(); @@ -104,7 +105,8 @@ namespace Aucma.Core.DataCollector.Factory Record_DeviceElectricity _deviceElectricity_ground = new Record_DeviceElectricity() { - MonitorId = "E0003" + // A库B区域 + MonitorId = "E00023_0002" }; base.ReadDeviceElectricity(ground, plc, ref _deviceElectricity_ground); @@ -115,7 +117,8 @@ namespace Aucma.Core.DataCollector.Factory Record_DeviceElectricity _deviceElectricity_platform = new Record_DeviceElectricity() { - MonitorId = "E0004" + // A库A区域 + MonitorId = "E00023_0001" }; base.ReadDeviceElectricity(platform, plc, ref _deviceElectricity_platform);