From 565a8a99d48cacf9ef1f3e749400eee78e21ce56 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周五, 16 8月 2024 16:08:17 +0800
Subject: [PATCH] 1

---
 DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DataCaptureHandler_OP0501.cs |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DataCaptureHandler_OP0501.cs b/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DataCaptureHandler_OP0501.cs
index 9e5649a..48c6346 100644
--- a/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DataCaptureHandler_OP0501.cs
+++ b/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DataCaptureHandler_OP0501.cs
@@ -91,7 +91,7 @@
                                 var path = ConfigHelper.GetConfigString("WorkPeiceIDPath");//鎵撶爜鏈烘墦鐮佷簩缁寸爜璺緞
                                 //鎵弿鍏变韩鐩綍骞跺皢鏂扮殑鏂囦欢鎵弿杩斿洖  涓�鑸妭鎷嶅湪15绉掑乏鍙筹紙鍙互纭涓�涓嬶級
                                 //鎵弿淇敼鏃堕棿鍦ㄤ笂娆℃壂鎻忔椂闂翠箣鍓�10绉掑埌褰撳墠鏃堕棿鐨勪箣闂寸殑鏂囦欢
-                                var dataTime = CommonManager.Instance.CheackPath(Environment.CurrentDirectory + "\\LastModifyTime\\OP05-LastScapTime.txt", 4,-10);
+                                var dataTime = CommonManager.Instance.CheackPath(Environment.CurrentDirectory + "\\LastModifyTime\\OP05-LastScapTime.txt", 4, -10);
                                 var scapEndTime = DateTimeHelper.GetDateTime();
                                 var newFiles = FileHelper.DetectNewFilesCSV(path, 60, Convert.ToDateTime(dataTime), scapEndTime);
 
@@ -104,7 +104,7 @@
                                     threadStatusMonitor.Threadlastmodifytime = DateTime.Now;
                                     Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure),
                                         $"{_dataCaptureConfig.WorkingProcedure}宸ュ簭璇诲彇宸ユ帶鏈轰腑浜岀淮鐮佷俊鎭�,鏂囦欢鍚�:{file.FullName}");
-                                    DataTable dt = null; 
+                                    DataTable dt = null;
                                     dt = CSVHelper.ReadCSV(file.FullName);
                                     if (dt == null)
                                     {
@@ -166,7 +166,7 @@
                                             }
 
                                             Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure),
-                                                $"{_dataCaptureConfig.WorkingProcedure}宸ュ簭璇诲彇宸ユ帶鏈轰腑浜岀淮鐮佷俊鎭�,宸ヤ欢鏈�鏂版椂闂�:{(cache==null?"鏃犵紦瀛�":cache.ToString())}");
+                                                $"{_dataCaptureConfig.WorkingProcedure}宸ュ簭璇诲彇宸ユ帶鏈轰腑浜岀淮鐮佷俊鎭�,宸ヤ欢鏈�鏂版椂闂�:{(cache == null ? "鏃犵紦瀛�" : cache.ToString())}");
                                             for (int i = dt.Rows.Count - 1; i >= 0; i--)
                                             {
                                                 string timeValue = " ";
@@ -183,7 +183,7 @@
                                                     {
                                                         if (j == 0)
                                                         {
-                                                            if(currrentTime>DateTimeHelper.GetDateTime().AddHours(-10))
+                                                            if (currrentTime > DateTimeHelper.GetDateTime().AddHours(-10))
                                                             {
                                                                 lasttime = currrentTime;
                                                             }
@@ -221,7 +221,7 @@
                                                 }
                                             }
 
-                                            filteredRows = filteredRows.Where(item=>item!=null).ToArray();
+                                            filteredRows = filteredRows.Where(item => item != null).ToArray();
                                             // 璁剧疆缂撳瓨鍊�
                                             DateTime absoluteExpiration = DateTime.Now.AddDays(30);
                                             TimeSpan slidingExpiration = TimeSpan.FromMinutes(20);
@@ -244,7 +244,7 @@
                                                 dataTime = file.LastAccessTime.ToString();
                                                 writer.Write(dataTime);
                                             }
-                                            Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"璇诲彇鍒皗filteredRows.Count()}琛屾暟鎹紝鏃堕棿鑼冨洿鏄瘂filteredRows[j-1]["鏃堕棿"]}-{filteredRows[0]["鏃堕棿"]}");
+                                            Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"璇诲彇鍒皗filteredRows.Count()}琛屾暟鎹紝鏃堕棿鑼冨洿鏄瘂filteredRows[j - 1]["鏃堕棿"]}-{filteredRows[0]["鏃堕棿"]}");
                                         }
 
                                         //// 宸ヤ欢鍙凤紙浜岀淮鐮佸�硷級
@@ -269,13 +269,15 @@
                                         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;
                                         wplog.EquipmentID = _dataCaptureConfig.EquipmentID;
 
                                         wplog.OnlineTime = DateTimeHelper.GetDateTime();//缁欎笂绾挎椂闂寸敤
 
-                                        wplog.QualityState = 1;
+                                        //wplog.QualityState = 1;
+                                        wplog.QualityState = (int)QualityState.OK;//榛樿鍚堟牸锛孫P05榛樿鍚堟牸
+
                                         wplog.ProcessingDuration = 1;
                                         wplog.MachineToolState = 1;
                                         wplog.AlertType = 1;
@@ -314,7 +316,7 @@
                                 //Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"鎵弿瀹屾垚锛屽叡鎵弿鍒帮細锛坽fileCount.Count()}锛変釜鏂囦欢");
                             }
                             //SystemValue.value_OP0501 = value.ToString();
-                        }   
+                        }
                     }
                     catch (Exception ex)
                     {
@@ -343,7 +345,7 @@
                 SystemValue.lbl_Alert_OP0501 = $"{_dataCaptureConfig.WorkingProcedure}宸ュ簭鎵撴爣瀹屾垚鏍囪锛岃鍙栧伐鎺ф満涓墦鍗颁簩缁寸爜淇℃伅锛屼笉鍋氭牎楠岋紝璇风‘璁ら厤缃俊鎭紒";
                 Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"{_dataCaptureConfig.WorkingProcedure}宸ュ簭鎵撴爣瀹屾垚鏍囪锛岃鍙栧伐鎺ф満涓墦鍗颁簩缁寸爜淇℃伅锛屼笉鍋氭牎楠岋紝璇风‘璁ら厤缃紓甯�");
             }
-            
+
         }
 
     }

--
Gitblit v1.9.3