using BatCharging.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BatCharging.Service
{
///
/// 解析充电机上传报警状态
///
public class MsgBatCycUpaDecoder
{
///
/// 解析充电机上传报警状态
///
///
///
public BatteryCycleUpalarm mBatteryCycleUpalarm(byte[] data)
{
BatteryCycleUpalarm mBatteryCycleUpalarm = null;
if (data.Count() >= 78)
{
mBatteryCycleUpalarm = new BatteryCycleUpalarm();
mBatteryCycleUpalarm.PNG1 = data[25];
mBatteryCycleUpalarm.PNG2 = data[26];
mBatteryCycleUpalarm.PNG3 = data[27];
mBatteryCycleUpalarm.batModVolExcThr = ByteUtils.ToUInt16(data, 28);
mBatteryCycleUpalarm.VolDevExcLimit = ByteUtils.ToUInt16(data, 30);
mBatteryCycleUpalarm.TemOvershoot = ByteUtils.ToUInt16(data, 32);
mBatteryCycleUpalarm.TemDevExcLimit = ByteUtils.ToUInt16(data, 34);
mBatteryCycleUpalarm.LowSOC = ByteUtils.ToUInt16(data, 36);
mBatteryCycleUpalarm.disCurExcLimit = ByteUtils.ToUInt16(data, 38);
mBatteryCycleUpalarm.ChaCurLimit = ByteUtils.ToUInt16(data, 40);
mBatteryCycleUpalarm.TotTemExcLimit = ByteUtils.ToUInt16(data, 42);
mBatteryCycleUpalarm.BatSysFaultCode = ByteUtils.ToUInt16(data, 44);
mBatteryCycleUpalarm.HighVolLowIns = ByteUtils.ToUInt16(data, 46);
mBatteryCycleUpalarm.VolBatModExcLimit = ByteUtils.ToUInt16(data, 48);
mBatteryCycleUpalarm.VolDevExcOveLimit = ByteUtils.ToUInt16(data, 50);
mBatteryCycleUpalarm.TemOveLimit = ByteUtils.ToUInt16(data, 52);
mBatteryCycleUpalarm.TemDevExcOveLimit = ByteUtils.ToUInt16(data, 54);
mBatteryCycleUpalarm.VeryLowSOC = ByteUtils.ToUInt16(data, 56);
mBatteryCycleUpalarm.DisCurExcLimit = ByteUtils.ToUInt16(data, 58);
mBatteryCycleUpalarm.ChaCurExcLimit = ByteUtils.ToUInt16(data, 60);
mBatteryCycleUpalarm.TotPosNegColTemOveLimit = ByteUtils.ToUInt16(data, 62);
mBatteryCycleUpalarm.HighVolInsExtLow = ByteUtils.ToUInt16(data, 64);
mBatteryCycleUpalarm.hardwareFailure = ByteUtils.ToUInt16(data, 66);
mBatteryCycleUpalarm.retain1 = data[68];
mBatteryCycleUpalarm.retain2 = data[69];
mBatteryCycleUpalarm.retain3 = data[70];
mBatteryCycleUpalarm.retain4 = data[71];
mBatteryCycleUpalarm.retain5 = data[72];
mBatteryCycleUpalarm.retain6 = data[73];
mBatteryCycleUpalarm.retain7 = data[74];
mBatteryCycleUpalarm.retain8 = data[75];
mBatteryCycleUpalarm.retain9 = data[76];
mBatteryCycleUpalarm.retain10 = data[77];
}
return mBatteryCycleUpalarm;
}
}
}