From f3eb86b73c4262cb0cecb3a4de3dc0af75a1240e Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周三, 04 9月 2024 15:41:42 +0800
Subject: [PATCH] 1
---
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DataCaptureHandler_OP0501.cs | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 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..1f0516a 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]["鏃堕棿"]}");
}
//// 宸ヤ欢鍙凤紙浜岀淮鐮佸�硷級
@@ -266,16 +266,19 @@
//wplog.EquipmentID = WorkingProcedure;
wplog.Remarks = "cs";
wplog.MonitoringPoint = DataCapturePointCode;
+ //wplog.CreatedUserName = DataCapturePointCode;
+ SystemBussinessHelper.SetWorkPieceLogMiddleForCreatedUserName(ref wplog, DataCapturePointCode, DataCapturePointCname);
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 +317,7 @@
//Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"鎵弿瀹屾垚锛屽叡鎵弿鍒帮細锛坽fileCount.Count()}锛変釜鏂囦欢");
}
//SystemValue.value_OP0501 = value.ToString();
- }
+ }
}
catch (Exception ex)
{
@@ -343,7 +346,7 @@
SystemValue.lbl_Alert_OP0501 = $"{_dataCaptureConfig.WorkingProcedure}宸ュ簭鎵撴爣瀹屾垚鏍囪锛岃鍙栧伐鎺ф満涓墦鍗颁簩缁寸爜淇℃伅锛屼笉鍋氭牎楠岋紝璇风‘璁ら厤缃俊鎭紒";
Log4NetHelper.WriteInfoLog(LogType.PLCOP05, $"{_dataCaptureConfig.WorkingProcedure}宸ュ簭鎵撴爣瀹屾垚鏍囪锛岃鍙栧伐鎺ф満涓墦鍗颁簩缁寸爜淇℃伅锛屼笉鍋氭牎楠岋紝璇风‘璁ら厤缃紓甯�");
}
-
+
}
}
--
Gitblit v1.9.3