PumpGenericInquiryCommand.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using Edge.Core.Parser.BinaryParser.Attributes;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. namespace LanTian_Sinopec_PumpIcCardReader
  7. {
  8. /// <summary>
  9. /// 加油机对 PC 机的普通查询命令
  10. /// 功能:在加油机主动方式下,加油机定时与 PC 机进行的握手通讯;
  11. /// 在 PC 机主动方式下,此命令为油机的回复。
  12. /// </summary>
  13. public class PumpGenericInquiryCommand : KaJiLianDongV11MessageTemplateBase
  14. {
  15. public override string ToLogString()
  16. {
  17. return "PumpGenericInquiryCommand, caller: " + this.GetMessageCallerSide() + ", SeqNo.: " + this.MessageSequenceNumber + ", " + base.ToLogString();
  18. }
  19. [Format(7, EncodingType.BcdString, 1)]
  20. public long PC_TIME { get; private set; }
  21. public DateTime GetPcTime()
  22. {
  23. var dd = this.PC_TIME.ToString();
  24. var dt = Convert.ToDateTime(dd);
  25. return dt;
  26. }
  27. public void SetPcTime(DateTime dateTime)
  28. {
  29. var str = dateTime.ToString("yyyyMMddHHmmss");
  30. this.PC_TIME = long.Parse(str);
  31. }
  32. [Format(2, EncodingType.BIN, 2)]
  33. public int BL_VER { get; set; }
  34. [Format(1, EncodingType.BIN, 3)]
  35. public byte ADD_BL_VER { get; set; }
  36. [Format(1, EncodingType.BIN, 4)]
  37. public byte DEL_BL_VER { get; set; }
  38. [Format(1, EncodingType.BIN, 5)]
  39. public byte WH_VER { get; set; }
  40. [Format(1, EncodingType.BIN, 6)]
  41. public byte PRC_VER { get; set; }
  42. [Format(1, EncodingType.BIN, 7)]
  43. public byte Sta_VER { get; set; }
  44. [Format(1, EncodingType.BIN, 8)]
  45. public 更新标志 SELF_D_VER { get; set; }
  46. [Format(1, EncodingType.BIN, 9)]
  47. public 更新标志 SOFT_FLAG { get; set; }
  48. public enum 更新标志
  49. {
  50. 无数据 = 0,
  51. 有新的程序or私有数据需要下载or发送 = 1
  52. }
  53. }
  54. }