修改密码 固化锁线程 加oldplctrigger,避免重复调用
This commit is contained in:
1 parent
60cafc4f8c
commit
d20b935213
9 files changed
+303
-195
No files matched your search
@@ -36,7 +36,6 @@ namespace WindowsFormsApp1.server
|
||||
private readonly string _fixsn;
|
||||
private readonly string _logBasePath;
|
||||
|
||||
|
||||
public ApiClient()
|
||||
{
|
||||
_httpClient = new HttpClient();
|
||||
@@ -125,7 +124,18 @@ namespace WindowsFormsApp1.server
|
||||
// 创建 StringContent 对象,将 JSON 字符串作为请求体,指定编码和媒体类型
|
||||
var httpContent = new StringContent(jsonPayload, Encoding.UTF8, "application/json");
|
||||
|
||||
// 调用接口
|
||||
#region test
|
||||
// 回写对应PLC
|
||||
if (statusCode > 0)
|
||||
PlcData.Write_Status = (short)statusCode;
|
||||
if (eventName == "SN_Release" || eventName == "SN_CheckIN")
|
||||
PlcData.Write_stSN = "testsn";
|
||||
LogExecute.logNet.WriteDebug($"{eventName} 测ui接口请求成功\n请求:{jsonPayload}\n");
|
||||
return ApiFormResult.Sucess(mesresult.PASS, true, "PASS", PlcData, DateTime.Now);
|
||||
#endregion test
|
||||
|
||||
/*
|
||||
#region 正式调用接口
|
||||
try
|
||||
{
|
||||
#region MES交互
|
||||
@@ -155,7 +165,7 @@ namespace WindowsFormsApp1.server
|
||||
// 回写对应PLC
|
||||
if (statusCode > 0)
|
||||
PlcData.Write_Status = (short)statusCode;
|
||||
if (eventName == "SN_Release" || eventName == "SN_CheckIn")
|
||||
if (eventName == "SN_Release" || eventName == "SN_CheckIN")
|
||||
PlcData.Write_stSN = res.SN.Value;
|
||||
if (eventName == "SN_FeedingCheck")
|
||||
{
|
||||
@@ -212,7 +222,10 @@ namespace WindowsFormsApp1.server
|
||||
|
||||
throw new Exception(ex.Message);
|
||||
}
|
||||
|
||||
return ApiFormResult.Sucess(mesresult.PASS, false, "", PlcData, DateTime.Now);
|
||||
#endregion 正式调用接口
|
||||
*/
|
||||
}
|
||||
|
||||
public ApiFormResult SN_CheckIN(string url, plcdata PlcData, otherdata OtherData)
|
||||
@@ -222,7 +235,7 @@ namespace WindowsFormsApp1.server
|
||||
var stationid = Init.t_Line.lineremark2.ToLower();
|
||||
if ("loadaging,exchange2,exchange1".Contains(stationid))
|
||||
{
|
||||
sn = Init.SN;
|
||||
sn = PlcData.Read_MaterialCode0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -353,7 +366,7 @@ namespace WindowsFormsApp1.server
|
||||
Qty = "1"
|
||||
}
|
||||
},
|
||||
SN = Init.SN,
|
||||
SN = PlcData.Read_MaterialCode0,
|
||||
SendTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")
|
||||
};
|
||||
|
||||
@@ -771,9 +784,6 @@ namespace WindowsFormsApp1.server
|
||||
//气密
|
||||
if ("WAT,Leakage".Contains(stationid))
|
||||
{
|
||||
var customHeaders = new List<string> { "SN", { OutItem.充气压力 }, { OutItem.泄漏量 }, "时间" };
|
||||
CsvLogger.SetHeaders(customHeaders);
|
||||
|
||||
sninfo.DC_INFO.Add(new DCInfoItem
|
||||
{
|
||||
Item = OutItem.充气压力,
|
||||
@@ -796,7 +806,7 @@ namespace WindowsFormsApp1.server
|
||||
{
|
||||
if ("Assy2,Assy3".Contains(stationid))
|
||||
{
|
||||
CsvLogger.Log($"{PlcData.Read_MaterialCode0},{OtherData.FinalAngleValue[i]},{OtherData.FinalTorqueValue[i]},{PlcData.Read_UploadData0.ToString()}");
|
||||
CsvLogger.Log($"{PlcData.Read_MaterialCode0},{OtherData.FinalAngleValue[i]},{OtherData.FinalTorqueValue[i]},{logresult}");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -838,9 +848,9 @@ namespace WindowsFormsApp1.server
|
||||
dcInfo.Value = logresult;
|
||||
dcInfo.Result = result;
|
||||
sninfo.DC_INFO.Add(dcInfo);
|
||||
if (!"Assy2,Assy3".Contains(stationid))
|
||||
if (!"Assy2,Assy3,Sealant".Contains(stationid))
|
||||
{
|
||||
CsvLogger.Log($"{PlcData.Read_MaterialCode0},{PlcData.Read_UploadData0.ToString()}");
|
||||
CsvLogger.Log($"{PlcData.Read_MaterialCode0},{logresult}");
|
||||
}
|
||||
//LogExecute.SNlogNet.WriteDebug($"追溯码:{PlcData.Read_MaterialCode0},检测结果:{logresult}");
|
||||
}
|
||||
@@ -909,7 +919,7 @@ namespace WindowsFormsApp1.server
|
||||
|
||||
sninfo.DC_INFO.Add(dcInfo);
|
||||
}
|
||||
//胶重 胶宽
|
||||
//胶重 胶宽 CCD
|
||||
if ("Sealant".Contains(stationid))
|
||||
{
|
||||
dcInfo = new DCInfoItem();
|
||||
@@ -923,7 +933,7 @@ namespace WindowsFormsApp1.server
|
||||
dcInfo.Item = $"{stationid}_Width";
|
||||
dcInfo.Value = PlcData.Read_UploadData1.ToString();
|
||||
dcInfo.Result = result;
|
||||
CsvLogger.Log($"{PlcData.Read_MaterialCode0},{PlcData.Read_UploadData0.ToString()},{PlcData.Read_UploadData1.ToString()}");
|
||||
CsvLogger.Log($"{PlcData.Read_MaterialCode0},{PlcData.Read_UploadData0.ToString()},{PlcData.Read_UploadData1.ToString()},{logresult}");
|
||||
|
||||
sninfo.DC_INFO.Add(dcInfo);
|
||||
}
|
||||
@@ -1131,8 +1141,6 @@ namespace WindowsFormsApp1.server
|
||||
public const int Fail = 1001;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region checkout class
|
||||
// 根对象类
|
||||
public class CheckOutObject
|
||||
|
||||
Reference in new issue
Block a user