125 lines
3.0 KiB
C#
125 lines
3.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.ComponentModel;
|
|
|
|
namespace SocketTransfer.SDK
|
|
{
|
|
public class SocketReceive : SocketBase
|
|
{
|
|
public SocketReceive(byte[] source, params int[] phases) :
|
|
base(source, (new int[] { 6, 10, 6, 6, 4, 9 }).Concat(phases).ToArray())
|
|
{
|
|
}
|
|
public SocketReceive(params int[] phases) :
|
|
this(new byte[phases.Sum() + 41], phases)
|
|
{
|
|
|
|
}
|
|
|
|
public byte[] ResetSize()
|
|
{
|
|
ExtendSource();
|
|
SetValue(0, Length(Source).ToString());
|
|
return Source;
|
|
}
|
|
|
|
[CategoryAttribute("数据段"), DescriptionAttribute("包长")]
|
|
/// <summary>
|
|
/// 包长
|
|
/// </summary>
|
|
public int Size
|
|
{
|
|
get
|
|
{
|
|
return string.IsNullOrEmpty(GetValue(0)) ? default(int) : int.Parse(GetValue(0));
|
|
}
|
|
set
|
|
{
|
|
SetValue(0, value.ToString());
|
|
}
|
|
}
|
|
|
|
[CategoryAttribute("数据段"), DescriptionAttribute("服务区码")]
|
|
/// <summary>
|
|
/// 服务区码
|
|
/// </summary>
|
|
public string SERVERPARTCODE
|
|
{
|
|
get
|
|
{
|
|
return GetValue(1);
|
|
}
|
|
set
|
|
{
|
|
SetValue(1, value);
|
|
}
|
|
}
|
|
|
|
[CategoryAttribute("数据段"), DescriptionAttribute("门店编码")]
|
|
/// <summary>
|
|
/// 门店编码
|
|
/// </summary>
|
|
public string SHOPCODE
|
|
{
|
|
get
|
|
{
|
|
return GetValue(2);
|
|
}
|
|
set
|
|
{
|
|
SetValue(2, value);
|
|
}
|
|
}
|
|
|
|
[CategoryAttribute("数据段"), DescriptionAttribute("机器号码")]
|
|
/// <summary>
|
|
/// 机器号码
|
|
/// </summary>
|
|
public string MACHINECODE
|
|
{
|
|
get
|
|
{
|
|
return GetValue(3);
|
|
}
|
|
set
|
|
{
|
|
SetValue(3, value);
|
|
}
|
|
}
|
|
|
|
[CategoryAttribute("数据段"), DescriptionAttribute("传输类型")]
|
|
/// <summary>
|
|
/// 传输类型
|
|
/// </summary>
|
|
public int ReceiveType
|
|
{
|
|
get
|
|
{
|
|
return string.IsNullOrEmpty(GetValue(4)) ? default(int) : int.Parse(GetValue(4));
|
|
}
|
|
set
|
|
{
|
|
SetValue(4, value.ToString());
|
|
}
|
|
}
|
|
|
|
[CategoryAttribute("数据段"), DescriptionAttribute("传输内码")]
|
|
/// <summary>
|
|
/// 传输类型
|
|
/// </summary>
|
|
public int TRANSFER_ID
|
|
{
|
|
get
|
|
{
|
|
return string.IsNullOrEmpty(GetValue(5)) ? default(int) : int.Parse(GetValue(5));
|
|
}
|
|
set
|
|
{
|
|
SetValue(5, value.ToString());
|
|
}
|
|
}
|
|
}
|
|
}
|