| 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 TotalCounters_TransactionData
- {
- private TransactionData transactionData;
- public TotalCounters_TransactionData(TransactionData transactionData)
- {
- if (transactionData.TransactionNumber != 0x65)
- throw new ArgumentException("TotalCounters_TransactionData must have transaction number 0x65");
- if (transactionData.Length != 0x10)
- throw new ArgumentException("TotalCounters_TransactionData must have length 16");
- this.transactionData = transactionData;
- }
- /// <summary>
- /// Combine with `TotalValue`, `Meter1_TotalValue_Or_NumberOfFill` or `Meter2_TotalValue` property
- /// to know what's this proerperty for.
- /// </summary>
- public byte LogicalNozzleNumber { get { return this.transactionData.RawData.First(); } }
- /// <summary>
- /// `LogicalNozzleNumber` 01H-08H: this property is the Volume Totals for specifiec logical nozzle
- /// `LogicalNozzleNumber` 09H: this property is the sum of all logical nozzle Volume totals.
- /// `LogicalNozzleNumber` 11H-18H: this property is the Amount Totals for logical nozzle(substract 10H to get real logical nozzle number)
- /// `LogicalNozzleNumber` 19H: this property is the sum of all logical nozzle Amount totals.
- /// </summary>
- public int TotalValue { get { return this.transactionData.RawData.Skip(1).Take(5).GetBCD(); } }
- /// <summary>
- /// `LogicalNozzleNumber` 01H-08H: this property is the Primary meter Volume totals for logical nozzle.
- /// `LogicalNozzleNumber` 09H: this property is Not used shall be zero (0).
- /// `LogicalNozzleNumber` 11H-18H: this property is the Number of fillings for logical nozzle(substract 10H to get real logical nozzle number)
- /// `LogicalNozzleNumber` 19H: this property is the Total no of fillings for whole pump.
- /// </summary>
- public int Meter1_TotalValue_Or_NumberOfFill { get { return this.transactionData.RawData.Skip(6).Take(5).GetBCD(); } }
- /// <summary>
- /// `LogicalNozzleNumber` 01H-08H: this property is the Secondary meter Volume totals for logical nozzle.
- /// `LogicalNozzleNumber` 09H: this property is Not used shall be zero (0).
- /// `LogicalNozzleNumber` 11H-19H: this property is Not used shall be zero (0).
- /// </summary>
- public int Meter2_TotalValue { get { return this.transactionData.RawData.Skip(11).Take(5).GetBCD(); } }
- }
- }
|