using System;
using Edge.Core.Parser.BinaryParser.Attributes;
namespace HengshanPaymentTerminal.MessageEntity.Outgoing
{
///
/// System's response for the inquiry request from pump.
/// 后台对查询命令Check_cmd的回复
///
public class InquiryResult : CardMessageBase
{
#region Constructor
public InquiryResult() : base(Command.Ver_info)
{
}
#endregion
#region Properties
///
/// PC_TIME, System time.
/// 后台时间,7字节压缩BCD。
///
[Format(7, EncodingType.BcdString, -90)]
public long Time { get; private set; }
///
/// BL_VER, Base black list version.
/// 基础黑名单版本。
///
[Format(2, EncodingType.BIN, -89)]
public ushort BaseBlacklistVersion { get; set; }
///
/// ADD_BL_VER, Newly added black list version.
/// 新增黑名单版本。
///
[Format(1, EncodingType.BIN, -88)]
public byte NewlyAddedBlacklistVersion { get; set; }
///
/// DEL_BL_VER, Newly deleted black list version.
/// 新删黑名单版本。
///
[Format(1, EncodingType.BIN, -87)]
public byte NewlyDeletedBlacklistVersion { get; set; }
///
/// WH_VER, Whitelist version.
/// 白名单版本号。
///
[Format(1, EncodingType.BIN, -86)]
public byte WhitelistVersion { get; set; }
///
/// PRC_VER, Fuel price version.
/// 油品油价版本。
///
[Format(1, EncodingType.BIN, -85)]
public byte FuelPriceVersion { get; set; }
///
/// Sta_VER, Station general information version.
/// 油站通用信息版本。
///
[Format(1, EncodingType.BIN, -84)]
public byte StationGeneralInfoVersion { get; set; }
///
/// SELF_D_VER, Reecipt info version for printers.
/// 打印机凭条信息版本。
///
[Format(1, EncodingType.BIN, -83)]
public byte PrinterReceiptInfoVersion { get; set; }
///
/// SOFT_FLAG, Flag indicating whether pump SW update is available or not, 0: No update, 1: Update required.
/// 加油机程序下载更新标志,0:无数据,1:有新的程序需要下载。
///
[Format(1, EncodingType.BIN, -82)]
public byte SoftwareDownloadFlag { get; set; }
[Format(1, EncodingType.BIN, -81)]
public byte UnspecifiedField1 { get; set; }
#endregion
#region Methods
///
/// Set the PC time
///
/// Current time on PC/Fusion/后台.
public void SetTime(DateTime timeStamp)
{
var formattedTime = timeStamp.ToString("yyyyMMddHHmmss");
Time = long.Parse(formattedTime);
}
#endregion
}
}