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

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 MsgChaDisMacLogDecoder
{
/// <summary>
/// 解析充放电机登陆签到
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
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;
}
}
}