|
|
@@ -1,16 +1,15 @@
|
|
|
-using System;
|
|
|
-using System.Collections.Generic;
|
|
|
+
|
|
|
+using System;
|
|
|
using System.Data;
|
|
|
-using System.ServiceModel.Channels;
|
|
|
using System.Text;
|
|
|
using System.Windows.Forms;
|
|
|
+
|
|
|
using Curtain.DataAccess;
|
|
|
using Curtain.Framework.Utils;
|
|
|
using Curtain.Framework.Windows;
|
|
|
-using Curtain.WCF.Proxy;
|
|
|
+
|
|
|
using HslCommunication.Core.Net;
|
|
|
using HslCommunication.Enthernet;
|
|
|
-using PLCCommunication.Proxy;
|
|
|
|
|
|
namespace PCLCommunication
|
|
|
{
|
|
|
@@ -511,6 +510,57 @@ namespace PCLCommunication
|
|
|
}
|
|
|
*/
|
|
|
|
|
|
+ // 增加自动计件,
|
|
|
+ if (ConnSetting.AutoPost)
|
|
|
+ {
|
|
|
+ // 3 3-3线上施釉
|
|
|
+ // 81 2-7线上施釉交接
|
|
|
+ // 53 2-2精坯入库
|
|
|
+ // 61 2-1二检
|
|
|
+ string mmm = null;
|
|
|
+ string scode1 = "OK";
|
|
|
+ string accountcode = "dongke";
|
|
|
+ string usercode = "091";
|
|
|
+ int pid = 61;
|
|
|
+ scode1 = ConnSetting.AddWorkPieceByStatus1(accountcode, usercode, pid, barcode, this.Text, "5001自动计件");
|
|
|
+ mmm = string.Format("工序计件1:{0},{1},{2},{3},{4}", accountcode, usercode, pid, barcode, scode1);
|
|
|
+ LogNet_BeforeSaveToFile(mmm);
|
|
|
+ lbl.AppendLine(mmm);
|
|
|
+
|
|
|
+ usercode = "SK203";
|
|
|
+ pid = 53;
|
|
|
+ scode1 = ConnSetting.AddWorkPieceByStatus1(accountcode, usercode, pid, barcode, this.Text, "5001自动计件");
|
|
|
+ mmm = string.Format("工序计件2:{0},{1},{2},{3},{4}", accountcode, usercode, pid, barcode, scode1);
|
|
|
+ LogNet_BeforeSaveToFile(mmm);
|
|
|
+ lbl.AppendLine(mmm);
|
|
|
+
|
|
|
+ /*usercode = "AAA";
|
|
|
+ pid = 81;
|
|
|
+ scode1 = ConnSetting.AddWorkPieceByStatus1(accountcode, usercode, pid, barcode, this.Text, "5001自动计件");
|
|
|
+ mmm = string.Format("工序计件3:{0},{1},{2},{3},{4}", accountcode, usercode, pid, barcode, scode1);
|
|
|
+ LogNet_BeforeSaveToFile(mmm);
|
|
|
+ lbl.AppendLine(mmm);*/
|
|
|
+
|
|
|
+ //if (string.IsNullOrEmpty(scode))
|
|
|
+ if (scode1 != "OK")
|
|
|
+ {
|
|
|
+ LogNet_BeforeSaveToFile("写入 D330 标识 2 ");
|
|
|
+ lbl.AppendLine("写入 D330 标识 2 ");
|
|
|
+ // 写入 D330 标识 1
|
|
|
+ result = m.SetData("D", 330, 1, "0002");
|
|
|
+ LogNet_BeforeSaveToFile(JsonUtil.FromObject(m));
|
|
|
+ lbl.AppendLine(JsonUtil.FromObject(m));
|
|
|
+ if (!result)
|
|
|
+ {
|
|
|
+ LogNet_BeforeSaveToFile("PLC操作失败");
|
|
|
+ lbl.AppendLine("PLC操作失败");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ simplifyServer.SendMessage(arg1, "0000");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
LogNet_BeforeSaveToFile("写入 D330 标识 1 ");
|
|
|
lbl.AppendLine("写入 D330 标识 1 ");
|
|
|
// 写入 D330 标识 1
|
|
|
@@ -526,6 +576,7 @@ namespace PCLCommunication
|
|
|
|
|
|
simplifyServer.SendMessage(arg1, "0100");
|
|
|
}
|
|
|
+ return;
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
@@ -989,6 +1040,7 @@ namespace PCLCommunication
|
|
|
}
|
|
|
simplifyServer.SendMessage(arg1, "0100");
|
|
|
}
|
|
|
+ return;
|
|
|
}
|
|
|
#endregion
|
|
|
|