PresetAmountRequest.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using Edge.Core.Parser.BinaryParser.Attributes;
  2. using Edge.Core.Parser.BinaryParser.Util;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Text;
  6. namespace Censtar_31064V105OrV106_Pump.MessageEntity.Outgoing
  7. {
  8. public class PresetAmountRequest : MessageBase
  9. {
  10. /// <summary>
  11. ///
  12. /// </summary>
  13. /// <param name="volume">without decimal points, should >=0 and <=999999</param>
  14. /// <param name="amount">without decimal points, should >=0 and <=999999</param>
  15. /// <param name="gongJin">without decimal points, should >=0 and <=999999</param>
  16. /// <param name="price">without decimal points, should >=0 and <=999999</param>
  17. /// <param name="sequence">should >=0 and <=9999</param>
  18. public PresetAmountRequest(int volume, int amount, int gongJin, int price, int sequence)
  19. {
  20. base.Cmd = 0x02;
  21. this.Volume = volume;
  22. this.Amount = amount;
  23. this.GongJin = gongJin;
  24. this.Price = price;
  25. this.单价倒数 = 0;
  26. this.Flag = 0;
  27. this.SequenceNumber = sequence;
  28. }
  29. [Format(3, EncodingType.BCD, 0)]
  30. public int Volume { get; set; }
  31. [Format(3, EncodingType.BCD, 1)]
  32. public int Amount { get; set; }
  33. [Format(3, EncodingType.BCD, 2)]
  34. public int GongJin { get; set; }
  35. [Format(3, EncodingType.BCD, 3)]
  36. public int Price { get; set; }
  37. [Format(4, EncodingType.BCD, 4)]
  38. public int 单价倒数 { get; set; }
  39. [Format(1, EncodingType.BCD, 5)]
  40. public byte Flag { get; set; }
  41. [Format(2, EncodingType.BCD, 6)]
  42. public int SequenceNumber { get; set; }
  43. }
  44. }