add-成品分垛B库电量采集及报警采集

main
liuwf 10 months ago
parent 7ea7b66090
commit d650b2172b

@ -17,6 +17,7 @@ using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using Aucma.Core.HwPLc; using Aucma.Core.HwPLc;
using RabbitMQ.Client; using RabbitMQ.Client;
using log4net;
namespace Aucma.Core.CodeBinding.Views namespace Aucma.Core.CodeBinding.Views
{ {
@ -25,6 +26,9 @@ namespace Aucma.Core.CodeBinding.Views
/// </summary> /// </summary>
public partial class IndexPageView : UserControl public partial class IndexPageView : UserControl
{ {
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(IndexPageView));
public IndexPageView() public IndexPageView()
{ {
InitializeComponent(); InitializeComponent();
@ -44,6 +48,7 @@ namespace Aucma.Core.CodeBinding.Views
if (SendPlcPass()) if (SendPlcPass())
{ {
MessageBox.Show("放行成功"); MessageBox.Show("放行成功");
log.Error("空板按钮异常启动放行");
} }
else else
{ {

@ -273,8 +273,8 @@
"EquipName": "Palletiz", "EquipName": "Palletiz",
"PlcType": "Melsec", "PlcType": "Melsec",
"Enabled": true, "Enabled": true,
"IP": "10.10.92.80", //10.10.92.80 "IP": "10.10.92.80",
"Port": 2015 "Port": 2013
} }
], ],

@ -31,7 +31,7 @@ namespace Aucma.Core.DataCollector
{ {
try try
{ {
if (stationCode == "1002") //箱壳、内胆,包含预装线、集存库 if (stationCode == "1002") //暂未使用--箱壳、内胆,包含预装线、集存库
{ {
Task.Run(() => Task.Run(() =>
{ {
@ -56,14 +56,14 @@ namespace Aucma.Core.DataCollector
Parallel.Invoke(() => collector.CollectDeviceAlarmInfo(out var alarmInfos), () => collector.CollectDeviceElectricity(out var electricity)); Parallel.Invoke(() => collector.CollectDeviceAlarmInfo(out var alarmInfos), () => collector.CollectDeviceElectricity(out var electricity));
}); });
} }
else if (stationCode == "1010")//成品分垛 else if (stationCode == "1010")//条码绑定工位
{ {
//Task.Run(() => Task.Run(() =>
//{ {
// DataCollectorFactory collector = new PalletizFactory(_deviceParamServices, _deviceAlarmInfoServices, _deviceElectricityServices); 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(() => Task.Run(() =>
{ {
DataCollectorFactory collector = new ShellStoreFactory(_deviceParamServices, _deviceAlarmInfoServices, _deviceElectricityServices); DataCollectorFactory collector = new ShellStoreFactory(_deviceParamServices, _deviceAlarmInfoServices, _deviceElectricityServices);

@ -19,7 +19,7 @@ namespace Aucma.Core.DataCollector.Factory
} }
/// <summary> /// <summary>
/// 采集成品分垛设备报警信息 /// 采集成品A库分垛设备报警信息
/// </summary> /// </summary>
/// <param name="deviceAlarmInfos"></param> /// <param name="deviceAlarmInfos"></param>
/// <exception cref="NotImplementedException"></exception> /// <exception cref="NotImplementedException"></exception>
@ -29,13 +29,14 @@ namespace Aucma.Core.DataCollector.Factory
{ {
try try
{ {
var deviceParams1 = base._deviceParamServices.Query(x => x.DeviceCode == "E00023");
if (_plc != null) 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; 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) if (deviceParams != null)
{ {
@ -94,7 +95,7 @@ namespace Aucma.Core.DataCollector.Factory
{ {
if (_plc != null) 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; var plc = _plc.plc;
deviceElectricitys = new List<Record_DeviceElectricity>(); deviceElectricitys = new List<Record_DeviceElectricity>();
@ -104,7 +105,8 @@ namespace Aucma.Core.DataCollector.Factory
Record_DeviceElectricity _deviceElectricity_ground = new Record_DeviceElectricity() Record_DeviceElectricity _deviceElectricity_ground = new Record_DeviceElectricity()
{ {
MonitorId = "E0003" // A库B区域
MonitorId = "E00023_0002"
}; };
base.ReadDeviceElectricity(ground, plc, ref _deviceElectricity_ground); base.ReadDeviceElectricity(ground, plc, ref _deviceElectricity_ground);
@ -115,7 +117,8 @@ namespace Aucma.Core.DataCollector.Factory
Record_DeviceElectricity _deviceElectricity_platform = new Record_DeviceElectricity() Record_DeviceElectricity _deviceElectricity_platform = new Record_DeviceElectricity()
{ {
MonitorId = "E0004" // A库A区域
MonitorId = "E00023_0001"
}; };
base.ReadDeviceElectricity(platform, plc, ref _deviceElectricity_platform); base.ReadDeviceElectricity(platform, plc, ref _deviceElectricity_platform);

Loading…
Cancel
Save