From 320422d67d050d4cf3d33380148acb727fabcc81 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周四, 13 6月 2024 14:35:14 +0800 Subject: [PATCH] 提示 --- DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DataCaptureHandler_05.cs | 44 ++++++++++++++++++++++---------------------- 1 files changed, 22 insertions(+), 22 deletions(-) diff --git a/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DataCaptureHandler_05.cs b/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DataCaptureHandler_05.cs index 891f868..96e2b29 100644 --- a/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DataCaptureHandler_05.cs +++ b/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DataCaptureHandler_05.cs @@ -17,7 +17,7 @@ /// <summary> /// 宸ュ簭瀹屾垚 /// </summary> - public class DataCaptureHandler_05: DataCaptureHandler + public class DataCaptureHandler_05 : DataCaptureHandler { public static readonly DataCaptureHandler_05 Instance = new DataCaptureHandler_05(); @@ -132,7 +132,7 @@ wplog.CreatedTime = DateTimeHelper.GetDateTime(); wplog.CreatedUserName = DataCapturePointCode; wplog.UpdatedTime = DateTimeHelper.GetDateTime(); - wplog.UpdatedUserName = Environment.MachineName+"鑷姩" + Thread.CurrentThread.ManagedThreadId.ToString(); + wplog.UpdatedUserName = Environment.MachineName + "鑷姩" + Thread.CurrentThread.ManagedThreadId.ToString(); wplog.IsDeleted = false; foreach (var col in colConfig.Where(o => o.DataCapturePointCode == DataCapturePointCode)) { @@ -148,7 +148,7 @@ } set.SetValue(wplog, valuecol);//缁欏姩鎬佸瓧娈佃祴鍊� } - catch(Exception setex) + catch (Exception setex) { Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(_dataCaptureConfig.WorkingProcedure), $" {DataCapturePointCode}宸ュ簭鐩戞帶璇荤爜鏍囪 璇诲彇宸ヤ欢鐮佸姩鎬佽祴鍊笺�恵_dataCaptureConfig.WorkingProcedure ?? "绌哄瓧绗︿覆"}銆戝紓甯竰wplog.Id},璧嬪�煎垪鍚峓{col.DataCaptureColumnTabelName ?? "绌哄瓧绗︿覆"}]", setex); } @@ -172,14 +172,14 @@ { files.Add((FileInfo)file); } - files = files.OrderByDescending(o => o.LastWriteTime).ToList(); + files = files.OrderByDescending(o => o.LastWriteTime).ToList(); Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"OP80涓嬬嚎瀹屾垚璇诲彇鍒版枃浠秢files.Count()}涓伐浠秢wplog.WorkPieceID} 鏃堕棿{fileFindTime.Value.ToString()}"); foreach (var file in files) {//鍙栧�掑簭鍖归厤鐨勬枃浠跺悕涓哄伐浠跺彿鐨勬枃浠� if (file.Name.Contains(wplog.WorkPieceID)) { - Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"OP80涓嬬嚎瀹屾垚璇诲彇鍒版枃浠秢file.Name}锛屾槸鎸囧畾鐨勫伐浠�"); + Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"OP80涓嬬嚎瀹屾垚璇诲彇鍒版枃浠秢file.Name}锛屾槸鎸囧畾鐨勫伐浠秢wplog.WorkPieceID}"); var datatable = CSVHelper.ReadCSVList(file.FullName); List<string> rowFirst = new List<string>(); @@ -188,7 +188,7 @@ { rowFirst = datatable[0].Split(',').ToList(); rowSecond = datatable[1].Split(',').ToList(); - if(rowSecond.Count<11) + if (rowSecond.Count < 11) { continue; } @@ -213,33 +213,33 @@ } //鍚嶇О 鐩稿鍊� 鐩稿鍊煎崟浣� 缁濆鍊� 缁濆鍊煎崟浣� 鍚嶄箟鍊� 涓婇檺 涓嬮檺 鐘舵��/绛夌骇 鍒嗛殧绗� OP80ItemInfo item = new OP80ItemInfo(); - item.鍒嗛殧绗� = rowSecond[1 + i * 10]; - item.鍚嶇О = rowSecond[2 + i * 10]; - item.鐩稿鍊� = rowSecond[3 + i * 10]; - item.鐩稿鍊煎崟浣� = rowSecond[4 + i * 10]; - item.缁濆鍊� = rowSecond[5 + i * 10]; - item.缁濆鍊煎崟浣� = rowSecond[6 + i * 10]; - item.鍚嶄箟鍊� = rowSecond[7 + i * 10]; - item.涓婇檺 = rowSecond[8 + i * 10]; - item.涓嬮檺 = rowSecond[9 + i * 10]; - item.鐘舵�� = rowSecond[10 + i * 10]; + item.鍒嗛殧绗� = rowSecond[1 + i * 10];//渚嬪锛�* 琛ㄥご锛氱姸鎬� + item.鍚嶇О = rowSecond[2 + i * 10];//渚嬪锛歐eight Big End 琛ㄥご锛�* + item.鐩稿鍊� = rowSecond[3 + i * 10];//渚嬪锛�-2.8 琛ㄥご锛氱畝杩� + item.鐩稿鍊煎崟浣� = rowSecond[4 + i * 10];//渚嬪锛歡r 琛ㄥご锛歐eight Big End + item.缁濆鍊� = rowSecond[5 + i * 10];//渚嬪锛�371.66 琛ㄥご锛氭祴閲忓崟浣� + item.缁濆鍊煎崟浣� = rowSecond[6 + i * 10];//渚嬪锛歡r 琛ㄥご锛氱粷瀵瑰�� + item.鍚嶄箟鍊� = rowSecond[7 + i * 10];//渚嬪锛�374.5 琛ㄥご锛氱粷瀵瑰�兼祴閲忓崟浣嶏紙UoM锛� + item.涓婇檺 = rowSecond[8 + i * 10];//渚嬪锛�10.5 琛ㄥご锛氬悕涔夊�� + item.涓嬮檺 = rowSecond[9 + i * 10];//渚嬪锛�-10.5 琛ㄥご锛歎SL鍊� + item.鐘舵�� = rowSecond[10 + i * 10];//渚嬪锛�3 琛ㄥご锛歀SL鍊� oP80Info.OP80ItemInfolist.Add(item); - if(item.鍚嶇О.Equals("Weight Class") || item.鍚嶇О.Equals("Weight Small End") - || item.鍚嶇О.Equals("Weight Big End") || item.鍚嶇О.Equals("Dime Small_End Class") + if (item.鍚嶇О.Equals("Weight Class") || item.鍚嶇О.Equals("Weight Small End") + || item.鍚嶇О.Equals("Weight Big End") || item.鍚嶇О.Equals("Dime Small_End Class") || item.鍚嶇О.Equals("Dime Big_End Class")) { } else { - if(!string.IsNullOrEmpty(item.鐘舵��)) + if (!string.IsNullOrEmpty(item.鐘舵��)) { oP80Info.OP80ItemStatusInfolist.Add(item); } } } - if(oP80Info.OP80ItemStatusInfolist.Count>0) + if (oP80Info.OP80ItemStatusInfolist.Count > 0) { - if(oP80Info.OP80ItemStatusInfolist.Any(o=>!o.鐘舵��.Equals("OK"))) + if (oP80Info.OP80ItemStatusInfolist.Any(o => !o.鐘舵��.Equals("OK"))) { wplog.QualityStateStr = "NG"; } @@ -293,7 +293,7 @@ } } - catch(Exception ex) + catch (Exception ex) { threadStatusMonitor.ErrorMsg = $" {RandomHelper.GenerateRandomCode(4)} 璇诲彇{DataCapturePointCode}涓嬬嚎鏍囪 瀹屾垚璇诲彇鏂囦欢鏁版嵁鏃跺紓甯革紝璇锋煡鐪嬫棩蹇楋紒"; Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"OP80涓嬬嚎瀹屾垚璇诲彇鏂囦欢鏁版嵁鏃跺紓甯�,閬垮厤宸ュ簭瀹屾垚寮傚父锛�", ex); -- Gitblit v1.9.3