InquiryResult.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. using System;
  2. using Edge.Core.Parser.BinaryParser.Attributes;
  3. namespace HengshanPaymentTerminal.MessageEntity.Outgoing
  4. {
  5. /// <summary>
  6. /// System's response for the inquiry request from pump.
  7. /// 后台对查询命令Check_cmd的回复
  8. /// </summary>
  9. public class InquiryResult : CardMessageBase
  10. {
  11. #region Constructor
  12. public InquiryResult() : base(Command.Ver_info)
  13. {
  14. }
  15. #endregion
  16. #region Properties
  17. /// <summary>
  18. /// PC_TIME, System time.
  19. /// 后台时间,7字节压缩BCD。
  20. /// </summary>
  21. [Format(7, EncodingType.BcdString, -90)]
  22. public long Time { get; private set; }
  23. /// <summary>
  24. /// BL_VER, Base black list version.
  25. /// 基础黑名单版本。
  26. /// </summary>
  27. [Format(2, EncodingType.BIN, -89)]
  28. public ushort BaseBlacklistVersion { get; set; }
  29. /// <summary>
  30. /// ADD_BL_VER, Newly added black list version.
  31. /// 新增黑名单版本。
  32. /// </summary>
  33. [Format(1, EncodingType.BIN, -88)]
  34. public byte NewlyAddedBlacklistVersion { get; set; }
  35. /// <summary>
  36. /// DEL_BL_VER, Newly deleted black list version.
  37. /// 新删黑名单版本。
  38. /// </summary>
  39. [Format(1, EncodingType.BIN, -87)]
  40. public byte NewlyDeletedBlacklistVersion { get; set; }
  41. /// <summary>
  42. /// WH_VER, Whitelist version.
  43. /// 白名单版本号。
  44. /// </summary>
  45. [Format(1, EncodingType.BIN, -86)]
  46. public byte WhitelistVersion { get; set; }
  47. /// <summary>
  48. /// PRC_VER, Fuel price version.
  49. /// 油品油价版本。
  50. /// </summary>
  51. [Format(1, EncodingType.BIN, -85)]
  52. public byte FuelPriceVersion { get; set; }
  53. /// <summary>
  54. /// Sta_VER, Station general information version.
  55. /// 油站通用信息版本。
  56. /// </summary>
  57. [Format(1, EncodingType.BIN, -84)]
  58. public byte StationGeneralInfoVersion { get; set; }
  59. /// <summary>
  60. /// SELF_D_VER, Reecipt info version for printers.
  61. /// 打印机凭条信息版本。
  62. /// </summary>
  63. [Format(1, EncodingType.BIN, -83)]
  64. public byte PrinterReceiptInfoVersion { get; set; }
  65. /// <summary>
  66. /// SOFT_FLAG, Flag indicating whether pump SW update is available or not, 0: No update, 1: Update required.
  67. /// 加油机程序下载更新标志,0:无数据,1:有新的程序需要下载。
  68. /// </summary>
  69. [Format(1, EncodingType.BIN, -82)]
  70. public byte SoftwareDownloadFlag { get; set; }
  71. [Format(1, EncodingType.BIN, -81)]
  72. public byte UnspecifiedField1 { get; set; }
  73. #endregion
  74. #region Methods
  75. /// <summary>
  76. /// Set the PC time
  77. /// </summary>
  78. /// <param name="timeStamp">Current time on PC/Fusion/后台.</param>
  79. public void SetTime(DateTime timeStamp)
  80. {
  81. var formattedTime = timeStamp.ToString("yyyyMMddHHmmss");
  82. Time = long.Parse(formattedTime);
  83. }
  84. #endregion
  85. }
  86. }