using Edge.Core.Parser.BinaryParser.MessageEntity; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace HengshanPaymentTerminal.MessageEntity.Incoming { /// /// 油枪状态数据对象 /// public class NozzleState : CommonMessage { public enum NozzleStateEnum { /// /// 离线 /// OFF_LINE = 0x01, /// /// 锁枪 /// LOCK = 0x02, /// /// 空闲 /// IDLE = 0x03, /// /// 提枪 /// LIFT = 0x04, /// /// 开始加油 /// START = 0x05, /// /// 加油中 /// FUELING = 0x06 } /// /// 枪号 /// public int nozzleNum { get; set; } /// /// 状态 /// public NozzleStateEnum stateEnum { get; set; } public override byte[] ToCommonByteArray() { byte[] content = new byte[] { 0x55, this.Handle, 0x00, ((byte)RESULT.OVER) }; return content2data(content); } public override CommonMessage ToObject(byte[] datas) { getBaseData(datas); this.nozzleNum = datas[7]; this.stateEnum = (NozzleStateEnum)datas[8]; return this; } } }