|
|
|
@ -8,18 +8,18 @@ using System.Globalization;
|
|
|
|
|
namespace Aucma.Core.DataCollector.Factory
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 二线打包线数据采集
|
|
|
|
|
/// 物料输送平台数据采集
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class TransPlatformFactory : DataCollectorFactory
|
|
|
|
|
public class TransPlatformCX02Factory : DataCollectorFactory
|
|
|
|
|
{
|
|
|
|
|
private PlcModel _plc = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("条码绑定Plc"));
|
|
|
|
|
private PlcModel _plc = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("TransPlatform"));
|
|
|
|
|
|
|
|
|
|
public TransPlatformFactory(IBaseDeviceParamServices deviceParamServices, IRecordDeviceAlarmInfoServices deviceAlarmInfoServices, IRecordDeviceElectricityServices deviceElectricityServices) : base(deviceParamServices, deviceAlarmInfoServices, deviceElectricityServices)
|
|
|
|
|
public TransPlatformCX02Factory(IBaseDeviceParamServices deviceParamServices, IRecordDeviceAlarmInfoServices deviceAlarmInfoServices, IRecordDeviceElectricityServices deviceElectricityServices) : base(deviceParamServices, deviceAlarmInfoServices, deviceElectricityServices)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 采集二线打包线设备报警信息
|
|
|
|
|
/// 采集物料输送平台设备报警信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="deviceAlarmInfos"></param>
|
|
|
|
|
/// <exception cref="NotImplementedException"></exception>
|
|
|
|
@ -29,14 +29,14 @@ namespace Aucma.Core.DataCollector.Factory
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var deviceParams1 = base._deviceParamServices.Query(x => x.DeviceCode == "E00011");
|
|
|
|
|
var deviceParams1 = base._deviceParamServices.Query(x => x.DeviceCode == "E00034");
|
|
|
|
|
|
|
|
|
|
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 deviceParams = base._deviceParamServices.Query(x => x.DeviceCode == "E00011");
|
|
|
|
|
var deviceParams = base._deviceParamServices.Query(x => x.DeviceCode == "E00034");
|
|
|
|
|
|
|
|
|
|
if (deviceParams != null)
|
|
|
|
|
{
|
|
|
|
@ -77,13 +77,13 @@ namespace Aucma.Core.DataCollector.Factory
|
|
|
|
|
}
|
|
|
|
|
catch(Exception ex)
|
|
|
|
|
{
|
|
|
|
|
base._logger.Error($"采集二线打包线设备报警信息:{ex.Message}");
|
|
|
|
|
base._logger.Error($"采集物料输送平台设备报警信息:{ex.Message}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 采集二线打包线设备用电信息
|
|
|
|
|
/// 采集物料输送平台设备用电信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="deviceElectricity"></param>
|
|
|
|
|
/// <exception cref="NotImplementedException"></exception>
|
|
|
|
@ -95,30 +95,30 @@ 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<Record_DeviceElectricity>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 20机柜
|
|
|
|
|
string[] ground = new string[] { "D7602", "D7604", "D7606", "D7608", "D7610", "D7612", "D7630", "D7634", "D7638", "D7642" };
|
|
|
|
|
|
|
|
|
|
Record_DeviceElectricity _deviceElectricity_ground = new Record_DeviceElectricity()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
MonitorId = "E00011_0001"
|
|
|
|
|
MonitorId = "E00034_0001"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
base.ReadDeviceElectricity(ground, plc, ref _deviceElectricity_ground);
|
|
|
|
|
|
|
|
|
|
deviceElectricitys.Add(_deviceElectricity_ground);
|
|
|
|
|
|
|
|
|
|
// 21机柜
|
|
|
|
|
string[] platform = new string[] { "D7652", "D7664", "D7666", "D7668", "D7660", "D7662", "D7680", "D7684", "D7688", "D7692" };
|
|
|
|
|
|
|
|
|
|
Record_DeviceElectricity _deviceElectricity_platform = new Record_DeviceElectricity()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
MonitorId = "E00011_0002"
|
|
|
|
|
MonitorId = "E00034_0002"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
base.ReadDeviceElectricity(platform, plc, ref _deviceElectricity_platform);
|
|
|
|
@ -138,7 +138,7 @@ namespace Aucma.Core.DataCollector.Factory
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
base._logger.Error($"采集二线打包线设备用电信息:{ex.Message}");
|
|
|
|
|
base._logger.Error($"采集物料输送平台设备用电信息:{ex.Message}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|