using BatCharging.Model; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BatCharging.Service { /// /// 解析充放电机上传电压电流SOC数据 /// public class MsgBatCycUpSocDecoder { /// /// 解析充放电机上传电压电流SOC数据 /// /// public BatteryCycleUpSoc GetMsgBatteryCycleUpSoc(byte[] data) { BatteryCycleUpSoc batteryCycleUpSoc = null; if (data.Count() >= 35) { batteryCycleUpSoc = new BatteryCycleUpSoc(); batteryCycleUpSoc.PNG1 = data[25]; batteryCycleUpSoc.PNG2 = data[26]; batteryCycleUpSoc.PNG3 = data[27]; batteryCycleUpSoc.VolMea = ByteUtils.ToUInt16(data, 28); batteryCycleUpSoc.CurrentMea = ByteUtils.ToUInt16(data, 30); batteryCycleUpSoc.nowSOC = ByteUtils.ToUInt16(data, 32); batteryCycleUpSoc.nowSOH = data[33]; batteryCycleUpSoc.retain = data[34]; } return batteryCycleUpSoc; } } }