using BatCharging.Model; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BatCharging.Service { /// /// 解析BMS监控、维护、诊断数据(自定义格式) /// public class MsgAnaBmsDecoder { public BatCycUpVolExtSta mBatCycUpVolExtSta(byte[] data) { BatCycUpVolExtSta mBatCycUpVolExtSta = null; if (data.Count() >= 36) { mBatCycUpVolExtSta = new BatCycUpVolExtSta(); mBatCycUpVolExtSta.PNG1 = data[25]; mBatCycUpVolExtSta.PNG2 = data[26]; mBatCycUpVolExtSta.PNG3 = data[27]; mBatCycUpVolExtSta.maxVol = ByteUtils.ToUInt16(data, 28); mBatCycUpVolExtSta.maxValNo = data[30]; mBatCycUpVolExtSta.minVol = ByteUtils.ToUInt16(data, 31); mBatCycUpVolExtSta.minValNo = data[33]; mBatCycUpVolExtSta.averageVol = ByteUtils.ToUInt16(data, 34); } return mBatCycUpVolExtSta; } } }