Browse Source

需求单No.183901 万福更换新称,客户端调整与称对接

master
yibo 6 months ago
parent
commit
95b80dcb6e
4 changed files with 68 additions and 3 deletions
  1. +3
    -2
      ButcherFactory.Form/ButcherFactory.Form.csproj
  2. +61
    -0
      ButcherFactory.Form/Controls/Utils/CombineWeightDataFormat.cs
  3. +3
    -0
      ButcherFactory.Form/Controls/WeightControl.cs
  4. +1
    -1
      ButcherFactory.Form/Controls/WeightSettingFrom.cs

+ 3
- 2
ButcherFactory.Form/ButcherFactory.Form.csproj View File

@ -34,9 +34,9 @@
</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="BwpClientPrint, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="BwpClientPrint, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3a973053c7ebf11c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ButcherFactory.Login\bin\Debug\BwpClientPrint.dll</HintPath>
<HintPath>..\..\..\tsref\Debug\BwpClientPrint.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
@ -117,6 +117,7 @@
<Compile Include="Controls\Utils\IND560DataFormat.cs" />
<Compile Include="Controls\Utils\JST2018SDataFormat.cs" />
<Compile Include="Controls\Utils\Xk3124DataFormat.cs" />
<Compile Include="Controls\Utils\CombineWeightDataFormat.cs" />
<Compile Include="Controls\Utils\Xk3190A9DataFormat.cs" />
<Compile Include="Controls\Utils\Xk3190D10DataFormat.cs" />
<Compile Include="Controls\WeightConfig.cs" />


+ 61
- 0
ButcherFactory.Form/Controls/Utils/CombineWeightDataFormat.cs View File

@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ButcherFactory.Controls
{
internal class CombineWeightDataFormat : DataFormatBase
{
public override int DataLength
{
get { return 17; }
}
public override char Beginchar
{
get { return (char)0x02; }
}
public override char Endchar
{
get { return (char)0x6B; }
}
public override short Bufsize
{
get { return 17; }
}
public override string ParseData(string buf, out bool isStatic)
{
isStatic = true; // 默认 为 稳定
return buf.Substring(9, 7).Trim();
}
public override bool ParseAscii(string buf, out string weight, out bool isStatic)
{
isStatic = false;
weight = FindDataFrame(buf, DataLength);
if (string.IsNullOrEmpty(weight))
{
return false;
}
weight = ParseData(weight, out isStatic);
return true;
}
public override bool ParseAscii(string buf, out string weight, out bool isStatic, out string subStr)
{
isStatic = false;
weight = "0";
subStr = "";
return true;
}
}
}

+ 3
- 0
ButcherFactory.Form/Controls/WeightControl.cs View File

@ -144,6 +144,9 @@ namespace ButcherFactory.Controls
break;
case "JST2018S":
_dataFormat = new JST2018SDataFormat();
break;
case "一体称"://02 10 53 54 2C 47 53 3A 20 30 30 30 31 2E 37 31 6B 67 A8 FE 00 49 01 00 AC 99 A8 FE 00
_dataFormat = new CombineWeightDataFormat();
break;
default:
_dataFormat = new Xk3190D10DataFormat();


+ 1
- 1
ButcherFactory.Form/Controls/WeightSettingFrom.cs View File

@ -12,7 +12,7 @@ namespace ButcherFactory.Controls
{
public partial class WeightSettingFrom : Form
{
List<string> weight = new List<string> { "IND560", "Xk3124", "Xk3190A9", "Xk3190D10", "IND231", "AHS3000", "JST2018S" };
List<string> weight = new List<string> { "IND560", "Xk3124", "Xk3190A9", "Xk3190D10", "IND231", "AHS3000", "JST2018S", "一体称" };
List<string> com = new List<string> { "COM1", "COM2", "COM3", "COM4", "COM5" };
List<string> rate = new List<string> { "1200", "2400", "4800", "7200", "9600" };
List<string> bit = new List<string> { "5", "6", "7", "8" };


Loading…
Cancel
Save