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;
|
|
}
|
|
}
|
|
}
|