| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using Edge.Core.Parser.BinaryParser.Attributes;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ZhongSheng_NonIC_Pump
- {
- /// <summary>
- /// PC机发送数据(油价)到加油机(油机收到命令后要应答给PC同样帧号的确认命令);
- /// </summary>
- public class ChangePumpPriceRequest : MessageTemplateBase
- {
- /// <summary>
- /// block count
- /// </summary>
- [Format(1, EncodingType.BIN, 1)]
- public byte 信息计数 { get; set; }
- [EnumerableFormat("信息计数", 2, EncodingType = EncodingType.BIN)]
- public List<NozzleAndPrice> NozzleAndPrices { get; set; }
- public ChangePumpPriceRequest(IEnumerable<NozzleAndPrice> nozzleAndPrices)
- {
- base.CommandCode = 0x34;
- this.信息计数 = (byte)nozzleAndPrices.Count();
- this.NozzleAndPrices = nozzleAndPrices.ToList();
- }
- public ChangePumpPriceRequest(byte nozzleNumber, int priceWithoutDecimal)
- : this(new[] {
- new NozzleAndPrice(){ 枪号 = nozzleNumber, 油价 =priceWithoutDecimal }
- })
- {
- }
- }
- public class NozzleAndPrice
- {
- /// <summary>
- /// 枪号为以整个加油站油枪为基础的油枪顺序编号
- /// </summary>
- [Format(1, EncodingType.BIN, 1)]
- public byte 枪号 { get; set; }
- /// <summary>
- /// 油价(带2位小数)
- /// </summary>
- [Format(3, EncodingType.BIN, 2)]
- public int 油价 { get; set; }
- }
- }
|