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.
 
 

52 lines
1.2 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ButcherFactory.Controls
{
internal class AoHaoSi3000DataFormat : DataFormatBase
{
public override int DataLength
{
get { return 10; }
}
public override char Beginchar
{
get { return (char)0x80; }//这种数据没有固定的开始标志
}
public override char Endchar
{
get { return (char)0x67; }
}
public override short Bufsize
{
get { return 36; }
}
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).Replace((char)0x3F, (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;
}
}
}