| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using Edge.Core.Parser.BinaryParser.Util;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Wayne_Pump_Dart.MessageEntity.Incoming
- {
- /// <summary>
- /// The pump sends this transaction if Request Total Counters is received.
- /// </summary>
- public class PumpParameters_TransactionData
- {
- private TransactionData transactionData;
- public PumpParameters_TransactionData(TransactionData transactionData)
- {
- if (transactionData.TransactionNumber != 0x07)
- throw new ArgumentException("PumpParameters_TransactionData must have transaction number 0x07");
- if (transactionData.Length != 51)
- throw new ArgumentException("TotalCounters_TransactionData must have length 51");
- this.transactionData = transactionData;
- }
- /// <summary>
- /// Number of decimals in volume (0-8)
- /// </summary>
- public byte VolumeDecimalPoint { get { return this.transactionData.RawData.Skip(22).First(); } }
- /// <summary>
- /// Number of decimals in amount (0-8)
- /// </summary>
- public byte AmountDecimalPoint { get { return this.transactionData.RawData.Skip(23).First(); } }
- /// <summary>
- /// Number of decimals in unit price (0-4)
- /// </summary>
- public byte UnitPriceDecimalPoint { get { return this.transactionData.RawData.Skip(24).First(); } }
- /// <summary>
- /// Maximum amount
- /// </summary>
- public int MaxAmount { get { return this.transactionData.RawData.Skip(30).Take(4).GetBCD(); } }
- /// <summary>
- /// Existing grade per nozzle number
- /// </summary>
- public string Grade
- {
- get { return this.transactionData.RawData.Skip(36).Take(15).ToArray().GetBCDString(); }
- }
- }
- }
|