屠宰场客户端
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.

36 lines
949 B

namespace BWP.WinFormControl.WeightDataFormat
{
public class IND560DataFormat : DataFormatBase {
public override int DataLength {
get { return 10; }
}
public override char Beginchar {
get { return (char)0x0A; }//这种数据没有固定的开始标志
}
public override char Endchar {
get { return (char)0x0D; }
}
public override string ParseData(string buf, out bool isStatic)
{
isStatic = false;
return string.Empty;
}
public override bool ParseAscii(string buf, out string weight, out bool isStatic) {
isStatic = true;
weight = buf.Replace("kg", "").Replace((char)0x0D, (char)0x20).Replace((char)0x0A, (char)0x20);
weight = weight.Trim();
return true;
}
public override bool ParseAscii(string buf, out string weight, out bool isStatic, out string subStr) {
weight = "";
isStatic = false;
subStr = "";
return false;
}
}
}