From 0f89dfa00bb223dc0db4960bda4c8fe5d0b762a8 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周日, 16 6月 2024 14:30:18 +0800
Subject: [PATCH] 显示 中心距

---
 DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DataCaptureHandler_02.cs |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DataCaptureHandler_02.cs b/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DataCaptureHandler_02.cs
index 591b2ca..a77f996 100644
--- a/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DataCaptureHandler_02.cs
+++ b/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DataCaptureHandler_02.cs
@@ -424,7 +424,7 @@
                                         //璁板綍鍏敤鍙橀噺锛屼繚瀛樼偣浣峂88鐨勪俊鎭� 銆怑ditby shaocx,2024-06-07銆�
                                         if (DataCapturePointCode.Contains("OP2002C"))
                                         {//浠嶰P2002C璇诲彇锛屽洜涓洪『搴忔槸 CBA锛岃�屼笉鏄疉BC
-                                            string sideValue = GetSideForOP20(plcService);
+                                            string sideValue = GetSideForOP20(plcService, wplog);
                                             SystemValue.OP20_Side_Value = sideValue;
                                         }
                                         wplog.MonitoringPoint += SystemValue.OP20_Side_Value;
@@ -575,18 +575,22 @@
         /// </summary>
         /// <param name="plcService"></param>
         /// <returns></returns>
-        private string GetSideForOP20(PLCService plcService)
+        private string GetSideForOP20(PLCService plcService, WorkPieceLogMiddle wplog)
         {
             try
             {
                 object value_M88 = plcService.ReadValuePointV2("M88", PLCManger.GetTypeForString("int"));
                 int i_value_M88 = 0;
                 var isRight = int.TryParse(value_M88.ToString(), out i_value_M88);
-                Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"璇诲彇 {DataCapturePointCode}宸ュ簭鐩戞帶娴嬮噺鏍囪鏁版嵁鏃跺紓甯�,鑾峰彇OP20鐨勫摢涓潰,i_value_M88:{i_value_M88}");
+                Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"璇诲彇 {DataCapturePointCode}宸ュ簭鐩戞帶娴嬮噺鏍囪鏁版嵁,鑾峰彇OP20鐨勫摢涓潰,i_value_M88:{i_value_M88},宸ヤ欢鍙�:{wplog.WorkPieceID}");
                 if (isRight)
                 {
                     if (i_value_M88 == 64)
                     {
+                        return "1";
+                    }
+                    else if (i_value_M88 == 16384)
+                    {//鍘熷畾涓�16384涓烘鍦ㄦ棆杞紝鐩戞帶涓嬫潵锛屽彂鐜� 16384搴旇鏄伐浣�1鐨勯棶棰� 銆怑ditby shaocx,2024-06-12銆�
                         return "1";
                     }
                     else if (i_value_M88 == 256)
@@ -602,11 +606,12 @@
                         return "4";
                     }
                 }
+                Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"璇诲彇 {DataCapturePointCode}宸ュ簭鐩戞帶娴嬮噺鏍囪鏁版嵁鏃讹紝鏃犳晥鏁板��,鑾峰彇OP20鐨勫摢涓潰,,i_value_M88:{i_value_M88}锛屽伐浠跺彿:{wplog.WorkPieceID}", null);
                 return "";
             }
             catch (Exception ex)
             {
-                Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"璇诲彇 {DataCapturePointCode}宸ュ簭鐩戞帶娴嬮噺鏍囪鏁版嵁鏃跺紓甯�,鑾峰彇OP20鐨勫摢涓潰,锛�", ex);
+                Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"璇诲彇 {DataCapturePointCode}宸ュ簭鐩戞帶娴嬮噺鏍囪鏁版嵁鏃跺紓甯�,鑾峰彇OP20鐨勫摢涓潰,宸ヤ欢鍙�:{wplog.WorkPieceID}", ex);
                 return "";
             }
         }

--
Gitblit v1.9.3