RequestTotalAmountCountersRequest.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using Edge.Core.Parser.BinaryParser.Util;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace Wayne_Pump_Dart.MessageEntity.Outgoing
  8. {
  9. public class RequestTotalAmountCountersRequest : MessageBase
  10. {
  11. /// <summary>
  12. ///
  13. /// </summary>
  14. /// <param name="address"></param>
  15. /// <param name="blockSeqNumber"></param>
  16. /// <param name="logicalNozzleNumber">range from 0x01 to 0x08, 0x09 is asking for all nozzles</param>
  17. public RequestTotalAmountCountersRequest(byte address, byte blockSeqNumber, byte logicalNozzleNumber)
  18. {
  19. if (logicalNozzleNumber < 0x01 || logicalNozzleNumber > 0x09)
  20. throw new ArgumentException("logicalNozzleNumber must range from 0x01 to 0x09");
  21. base.Adrs = address;
  22. base.BlockSeqNumber = blockSeqNumber;
  23. base.ControlCharacter = ControlCharacter.DATA;
  24. base.TransactionDatas = new List<TransactionData>()
  25. {
  26. new TransactionData()
  27. {
  28. TransactionNumber = 0x65,
  29. RawData = new List<byte>(){ (byte)(logicalNozzleNumber+0x10) }
  30. }
  31. };
  32. }
  33. }
  34. }