Commit 475ba646 LN

西安料仓扫码尺寸修改。

1 个父辈 316aad3f
...@@ -84,7 +84,8 @@ ...@@ -84,7 +84,8 @@
<!--解码方式,0=halcon 解码,1=使用zxing解码--> <!--解码方式,0=halcon 解码,1=使用zxing解码-->
<add key="DeCodeType" value="1"/> <add key="DeCodeType" value="1"/>
西安料仓,有两种料盒,二维码定义如下:
XA 开头的二维码,默认为 13*48
XB 开头的二维码,默认为 13*
\ No newline at end of file \ No newline at end of file
...@@ -1513,7 +1513,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -1513,7 +1513,17 @@ namespace OnlineStore.DeviceLibrary
string code = str; string code = str;
if (CodeManager.DeCodeType.Equals(1)) if (CodeManager.DeCodeType.Equals(1))
{ {
code = "=1+0x0-" + GetSize() + "x" + height + "=" + CodeManager.GetBarcode(str); if (str.ToUpper().StartsWith("XA"))
{
code = "=1+0x0-13x48" + "=" + code;
}else if (str.ToUpper().StartsWith("XB"))
{
code = "=1+0x0-13x32" + "=" + code;
}
else
{
code = "=1+0x0-" + GetSize() + "x" + height + "=" + CodeManager.GetBarcode(str);
}
} }
else else
{ {
...@@ -1592,7 +1602,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -1592,7 +1602,18 @@ namespace OnlineStore.DeviceLibrary
double ai1Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, Config.AIDI1_Addr), Config.AIDI1_DefaultPosition); double ai1Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, Config.AIDI1_Addr), Config.AIDI1_DefaultPosition);
double ai2Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, Config.AIDI2_Addr), Config.AIDI2_DefaultPosition); double ai2Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, Config.AIDI2_Addr), Config.AIDI2_DefaultPosition);
double Value = Math.Round((ai1Value + ai2Value) / 2, 1); double Value = Math.Round((ai1Value + ai2Value) / 2, 1);
if (Value > 14) if (Value > 18)
{
if ((Value % 4).Equals(0))
{
result = (int)Value;
}
else
{
result = ((int)Value / 4 * 4) + 4;
}
}
else if (Value > 14)
{ {
result = 16; result = 16;
} }
...@@ -1602,7 +1623,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1602,7 +1623,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (Value >= 4) else if (Value >= 4)
{ {
if (ai1Value >= 9 || ai2Value >= 9) if (ai1Value >= 10 || ai2Value >= 10)
{ {
result = 12; result = 12;
} }
...@@ -1656,7 +1677,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -1656,7 +1677,18 @@ namespace OnlineStore.DeviceLibrary
double ai1Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, Config.AIDI3_Addr), Config.AIDI3_DefaultPosition); double ai1Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, Config.AIDI3_Addr), Config.AIDI3_DefaultPosition);
double ai2Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, Config.AIDI4_Addr), Config.AIDI4_DefaultPosition); double ai2Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, Config.AIDI4_Addr), Config.AIDI4_DefaultPosition);
double Value = Math.Round((ai1Value + ai2Value) / 2, 1); double Value = Math.Round((ai1Value + ai2Value) / 2, 1);
if (Value > 14) if (Value > 18)
{
if ((Value % 4).Equals(0))
{
result = (int)Value;
}
else
{
result = ((int)Value / 4 * 4) + 4;
}
}
else if (Value > 14)
{ {
result = 16; result = 16;
} }
...@@ -1666,7 +1698,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1666,7 +1698,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (Value >= 4) else if (Value >= 4)
{ {
if (ai1Value >= 9 || ai2Value >= 9) if (ai1Value >= 10 || ai2Value >= 10)
{ {
result = 12; result = 12;
} }
...@@ -1679,7 +1711,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -1679,7 +1711,6 @@ namespace OnlineStore.DeviceLibrary
{ {
result = 0; result = 0;
} }
return result; return result;
} }
......
...@@ -228,7 +228,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -228,7 +228,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
public static string GetBarcode(string codeStr) public static string GetBarcode(string codeStr)
{ {
if (!string.IsNullOrEmpty(codeStr)) if (!string.IsNullOrEmpty(codeStr))
{ {
string[] codeInfos = codeStr.Replace("\r", "").Split('\n'); string[] codeInfos = codeStr.Replace("\r", "").Split('\n');
...@@ -237,15 +237,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -237,15 +237,15 @@ namespace OnlineStore.DeviceLibrary
string youxiao = ""; string youxiao = "";
foreach (string codeInfo in codeInfos) foreach (string codeInfo in codeInfos)
{ {
if (codeInfo.StartsWith("物料编码:")) if (codeInfo.StartsWith("物料编码:")||codeInfo.StartsWith("物料编码:"))
{ {
ri = codeInfo.Substring(5); ri = codeInfo.Substring(5);
} }
else if (codeInfo.StartsWith("入库数量:")) else if (codeInfo.StartsWith("入库数量:")|| codeInfo.StartsWith("入库数量:"))
{ {
qty = codeInfo.Substring(5); qty = codeInfo.Substring(5);
} }
else if (codeInfo.StartsWith("有效期限:")) else if (codeInfo.StartsWith("有效期限:")|| codeInfo.StartsWith("有效期限:"))
{ {
youxiao = codeInfo.Substring(5); youxiao = codeInfo.Substring(5);
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!