You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.5 KiB
43 lines
1.5 KiB
using BatCharging.Model;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BatCharging.Service
|
|
{
|
|
/// <summary>
|
|
/// 解析充放电机上传基本状态
|
|
/// </summary>
|
|
public class MsgBatCycUpDecoder
|
|
{
|
|
/// <summary>
|
|
/// 解析充放电机上传基本状态
|
|
/// </summary>
|
|
/// <param name="data"></param>
|
|
/// <returns></returns>
|
|
public BatteryCycleUpBasic GetMsgbatteryCycleUp(byte[] data)
|
|
{
|
|
BatteryCycleUpBasic batteryCycleUp = null;
|
|
if (data.Count() >= 43)
|
|
{
|
|
batteryCycleUp = new BatteryCycleUpBasic();
|
|
batteryCycleUp.PNG1 = data[25];
|
|
batteryCycleUp.PNG1 = data[26];
|
|
batteryCycleUp.PNG1 = data[27];
|
|
batteryCycleUp.AlarmLevel = data[28];
|
|
batteryCycleUp.batteryBoxNo = data[29];
|
|
batteryCycleUp.maxCurOutBatBox = ByteUtils.ToUInt16(data, 30);
|
|
batteryCycleUp.maxCanCurOutBatBox = ByteUtils.ToUInt16(data, 32);
|
|
batteryCycleUp.BatBoxFanStatus = ByteUtils.ToUInt16(data, 34);
|
|
batteryCycleUp.HeaterCondition = ByteUtils.ToUInt16(data, 36);
|
|
batteryCycleUp.stateEqu = ByteUtils.ToUInt16(data, 38);
|
|
batteryCycleUp.HighVolIntlockState = ByteUtils.ToUInt16(data, 40);
|
|
batteryCycleUp.retain = data[42];
|
|
}
|
|
return batteryCycleUp;
|
|
}
|
|
}
|
|
}
|