using BatCharging.Model; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BatCharging.Service { /// /// 解析充放电机登陆签到 /// public class MsgChaDisMacLogDecoder { /// /// 解析充放电机登陆签到 /// /// /// public ChaDisMacLoginsign GetMsgChaDisMacLoginsign(byte[] data) { ChaDisMacLoginsign chaDisMacLoginsign = null; if (data.Count() >= 43) { chaDisMacLoginsign = new ChaDisMacLoginsign(); chaDisMacLoginsign.MonGatNumber = ByteUtils.ToUInt16(data,25); chaDisMacLoginsign.envAtt = data[27]; chaDisMacLoginsign.ComProVersion = data[28] + "." + data[29] + "." + data[30]; chaDisMacLoginsign.HardVersion = data[31] + "." + data[32] + "." + data[33]; chaDisMacLoginsign.SoftVersion = data[34] + "." + data[35] + "." + data[36]; chaDisMacLoginsign.NumChaMuzzle = data[37]; chaDisMacLoginsign.NumChaModules = data[38]; chaDisMacLoginsign.ratedPower = data[39]; chaDisMacLoginsign.CurrentPower = data[40]; chaDisMacLoginsign.CurrentRate = data[41]; chaDisMacLoginsign.ShuntRange = ByteUtils.ToUInt16(data, 42); } return chaDisMacLoginsign; } } }