五丰称屠宰重客户端
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.
 

42 lines
1.0 KiB

using System.Text;
namespace B3ButcherWeightClient.Data
{
public class IND560DataFormat : DataFormatBase {
public override int DataLength {
get { return 10; }
}
public override char Beginchar {
get { return (char)0x80; }//这种数据没有固定的开始标志
}
public override char Endchar {
get { return (char)0x0A; ; }
}
public override short Bufsize {
get { return 10; }
}
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;
}
}
}