diff --git a/ProductionSystem/Dll/Interop.BarTender.dll b/ProductionSystem/Dll/Interop.BarTender.dll
new file mode 100644
index 0000000..a0e3918
Binary files /dev/null and b/ProductionSystem/Dll/Interop.BarTender.dll differ
diff --git a/ProductionSystem/Dll/Seagull.BarTender.Print.dll b/ProductionSystem/Dll/Seagull.BarTender.Print.dll
new file mode 100644
index 0000000..518521c
Binary files /dev/null and b/ProductionSystem/Dll/Seagull.BarTender.Print.dll differ
diff --git a/ProductionSystem/Forms/HomeForm.cs b/ProductionSystem/Forms/HomeForm.cs
index cea77d7..25f24f7 100644
--- a/ProductionSystem/Forms/HomeForm.cs
+++ b/ProductionSystem/Forms/HomeForm.cs
@@ -1777,22 +1777,30 @@ namespace ProductionSystem.Forms
}
else
{
- writeVal = step.WriteValue;
- returnVal = step.ReturnValue;
- int val1 = Convert.ToInt32(writeVal);
- int val2 = Convert.ToInt32(returnVal);
- if (returnVal == null)
+ if(paraCode != "DZPZF1_DB" && paraCode != "DZPZF2_DB")
{
- result = 2;
- }
- if (val1 == val2)
- {
- result = 1;
+ writeVal = step.WriteValue;
+ returnVal = step.ReturnValue;
+ int val1 = Convert.ToInt32(writeVal);
+ int val2 = Convert.ToInt32(returnVal);
+ if (returnVal == null)
+ {
+ result = 2;
+ }
+ if (Math.Abs(val2 - val1) <= 5)
+ {
+ result = 1;
+ }
+ else
+ {
+ result = 2;
+ }
}
else
{
- result = 2;
+ result = 1;
}
+
middleMyTestResultControls[j].TestResultText = result == 1 ? "OK" : (result == 2 ? "NG" : "");
middleMyTestResultControls[j].TestResultForeColor = Color.White;
diff --git a/ProductionSystem/Forms/MainForm.cs b/ProductionSystem/Forms/MainForm.cs
index d940647..6b85a34 100644
--- a/ProductionSystem/Forms/MainForm.cs
+++ b/ProductionSystem/Forms/MainForm.cs
@@ -229,18 +229,18 @@ namespace ProductionSystem.Forms
paraColManagerForm.Show();
}
break;
- case "DicSeeting"://数据字典配置
+ case "Printer"://数据字典配置
if (!CheckHasMdiChildForm("Form1"))
{
- DicManagerForm dicManagerForm = new DicManagerForm
+ Form1 form1 = new Form1
{
MdiParent = this,
Dock = DockStyle.Fill
};
- dicManagerForm.Show();
+ form1.Show();
}
break;
- case "Printer"://数据字典配置
+ case "DicSeeting"://数据字典配置
if (!CheckHasMdiChildForm("DicManagerForm"))
{
DicManagerForm dicManagerForm = new DicManagerForm
diff --git a/ProductionSystem/Forms/SystemSetting/Form1.cs b/ProductionSystem/Forms/SystemSetting/Form1.cs
index cafe9bc..2ee4603 100644
--- a/ProductionSystem/Forms/SystemSetting/Form1.cs
+++ b/ProductionSystem/Forms/SystemSetting/Form1.cs
@@ -1,4 +1,5 @@
using DevExpress.XtraEditors;
+using ProductionSystem_Log;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -20,7 +21,38 @@ namespace ProductionSystem.Forms.SystemSetting
private void printLabel_Click(object sender, EventArgs e)
{
+ Print2();
+ }
+
+ private bool Print2()
+ {
+ BarTender.Application btApp = new BarTender.Application();
+ BarTender.Format btFormat;
+ btFormat = btApp.Formats.Add();
+ //LogHelper.Info($"{printCode}打开模板文件......");
+ //btFormat.SetNamedSubStringValue("sn", sn);
+ ////批次号
+ //if (!string.IsNullOrEmpty(batchNo))
+ //{
+ // btFormat.SetNamedSubStringValue("sn1", batchNo);
+ //}
+ ////版本号
+ //if (!string.IsNullOrEmpty(softCode))
+ //{
+ // btFormat.SetNamedSubStringValue("sn2", softCode);
+ //}
+ //btFormat.PrintSetup.NumberSerializedLabels = 1;
+ var pintOut = btFormat.PrintOut(true, false);
+
+ //LogHelper.Info($"{printCode}PrintOut方法返回值={pintOut}");
+
+ //btFormat.Close(BarTender.BtSaveOptions.btDoNotSaveChanges); //退出时是否保存标签
+ btApp.Quit(BarTender.BtSaveOptions.btSaveChanges);//退出时同退退出BarTender进程
+ //var msg = $"[INFO]{printCode}打印机打印成功,打印条码={sn}";
+ //LogHelper.Info(msg);
+ //LogHandler(msg);
+ return true;
}
}
}
diff --git a/ProductionSystem/ProductionSystem.csproj b/ProductionSystem/ProductionSystem.csproj
index fd1f018..c8b91f4 100644
--- a/ProductionSystem/ProductionSystem.csproj
+++ b/ProductionSystem/ProductionSystem.csproj
@@ -40,8 +40,11 @@
program.ico
-
- ..\packages\Bartender.1.0.0\lib\net45\Bartender.dll
+
+ ..\packages\Portable.BouncyCastle.1.8.5.2\lib\net40\BouncyCastle.Crypto.dll
+
+
+ ..\packages\Csv.2.0.93\lib\net40\Csv.dll
False
@@ -72,6 +75,9 @@
..\packages\EPPlus.System.Drawing.6.1.1\lib\net462\EPPlus.System.Drawing.dll
+
+ ..\packages\FluentFTP.45.1.0\lib\net472\FluentFTP.dll
+
False
Dll\HslCommunication.dll
@@ -80,12 +86,20 @@
False
Dll\HslControls.dll
+
+ False
+ True
+ Dll\Interop.BarTender.dll
+
..\packages\Microsoft.Bcl.AsyncInterfaces.7.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll
..\packages\Microsoft.Bcl.HashCode.1.1.1\lib\net461\Microsoft.Bcl.HashCode.dll
+
+ ..\packages\Microsoft.Extensions.DependencyModel.7.0.0\lib\net462\Microsoft.Extensions.DependencyModel.dll
+
..\packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\lib\net461\Microsoft.Extensions.Logging.Abstractions.dll
@@ -106,6 +120,22 @@
..\packages\Rougamo.Fody.1.4.1\lib\netstandard2.0\Rougamo.dll
+
+ ..\packages\Zebra.Printer.SDK.2.16.2905\lib\net471\SdkApi.Core.dll
+
+
+ ..\packages\Zebra.Printer.SDK.2.16.2905\lib\net471\SdkApi.Desktop.dll
+
+
+ ..\packages\Zebra.Printer.SDK.2.16.2905\lib\net471\SdkApi.Desktop.Usb.dll
+
+
+ False
+ Dll\Seagull.BarTender.Print.dll
+
+
+ ..\packages\Lextm.SharpSnmpLib.10.0.9\lib\net452\SharpSnmpLib.dll
+
..\packages\SqlSugar.5.1.2.2\lib\SqlSugar.dll
@@ -116,6 +146,11 @@
..\packages\System.Collections.Immutable.7.0.0\lib\net462\System.Collections.Immutable.dll
+
+ ..\packages\System.Collections.Specialized.4.3.0\lib\net46\System.Collections.Specialized.dll
+ True
+ True
+
@@ -128,13 +163,29 @@
..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll
+
+ ..\packages\System.Net.NameResolution.4.3.0\lib\net46\System.Net.NameResolution.dll
+ True
+ True
+
+
+ ..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll
+ True
+ True
+
..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll
+
..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll
+
+ ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll
+ True
+ True
+
@@ -143,6 +194,11 @@
..\packages\System.Text.Json.7.0.0\lib\net462\System.Text.Json.dll
+
+ ..\packages\System.Text.RegularExpressions.4.3.1\lib\net463\System.Text.RegularExpressions.dll
+ True
+ True
+
..\packages\System.Threading.Channels.7.0.0\lib\net462\System.Threading.Channels.dll
diff --git a/ProductionSystem/packages.config b/ProductionSystem/packages.config
index 2e78d07..459b9a0 100644
--- a/ProductionSystem/packages.config
+++ b/ProductionSystem/packages.config
@@ -1,28 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file