You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
1.2 KiB

3 years ago
namespace EC.AutoWeightServer.IfManager.FingerPrint
{
/// <summary>
/// 基础连接参数
/// </summary>
public class FingerPrintParam
{
/// <summary>
/// 协议号(USB=0,COM=2)
/// </summary>
public int NPort { get; set; }
/// <summary>
/// 端口号 通讯端口号(USB=0,COM=[1, 255])
/// </summary>
public int Port { get; set; }
/// <summary>
/// 波特率索引号(波特率级别,默认给 3,即 9600,如表 1 所示)
/// </summary>
public int NRidx { get; set; }
/// <summary>
/// 串口是否提速(USB=0,COM=2)
/// </summary>
public int NSped { get; set; }
public bool IsUsb()
{
return NPort.Equals(0);
}
public bool IsCom()
{
return NPort.Equals(2);
}
public int GetPortType()
{
return NPort.Equals(0) ? 0 : 1;
}
}
/// <summary>
/// USB 连接参数
/// </summary>
public class FpUsbParam : FingerPrintParam
{
public FpUsbParam()
{
NPort = 0;
Port = 0;
NRidx = 3;
NSped = 0;
}
}
/// <summary>
/// Com 连接参数
/// </summary>
public class FpComParam : FingerPrintParam
{
public FpComParam()
{
NPort = 2;
Port = 1;
NRidx = 3;
NSped = 2;
}
}
}