RequestTotalVolumeCountersRequest.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 RequestTotalVolumeCountersRequest : MessageBase
  10. {
  11. /// <summary>
  12. ///
  13. /// </summary>
  14. /// <param name="address"></param>
  15. /// <param name="blockSeqNumber"></param>
  16. /// <param name="physicalNozzleNumber">range from 0x01 to 0x08, 0x09 is asking for all nozzles</param>
  17. public RequestTotalVolumeCountersRequest(byte address, byte blockSeqNumber, byte physicalNozzleNumber)
  18. {
  19. if (physicalNozzleNumber < 0x01 || physicalNozzleNumber > 0x09)
  20. throw new ArgumentException("logicalNozzleNumber must range from 0x01 to 0x09, but now is: 0x" + physicalNozzleNumber.ToString("X").PadLeft(2, '0'));
  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>(){ physicalNozzleNumber }
  30. }
  31. };
  32. }
  33. }
  34. }