using Edge.Core.Parser.BinaryParser.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ZhongSheng_NonIC_Pump
{
///
/// PC 发送参数信息字符串给油机
///
public class SetPumpConfigRequest : MessageTemplateBase
{
public enum ParameterTableTypeEnum
{
TableA = 0x01,
TableB = 0x02,
TableC = 0x03,
}
[Format(1, EncodingType.BIN, 1)]
public byte Parameter => 0x01;
[Format(1, EncodingType.BIN, 2)]
public ParameterTableTypeEnum 参数列表类型 { get; set; }
[EnumerableFormat("%cascade", 3)]
public List NozzleConfigs { get; set; }
public SetPumpConfigRequest(ParameterTableTypeEnum paramTable, IEnumerable nozzleConfigs)
{
base.CommandCode = 0x52;
this.参数列表类型 = paramTable;
this.NozzleConfigs = nozzleConfigs.ToList();
}
}
public class NozzleConfig
{
///
/// 枪号为以整个加油站油枪为基础的油枪顺序编号
///
[Format(1, EncodingType.BCD, 1)]
public byte 枪号 { get; set; }
///
/// 参数列表(5BCD)
///
[Format(5, EncodingType.ASCII, 2)]
public string 参数列表 { get; set; }
}
}