schangxiang@126.com
2024-09-11 b2ab77f93465d960bd59c349efc5fc69dd4a659a
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DataCaptureHandler_01.cs
@@ -1,4 +1,5 @@
using iWare_SCADA_BusinessLogical.BLL;
using iWare_SCADA_BusinessLogical.BLL.Important;
using iWare_SCADA_BusinessLogical.Utils;
using iWare_SCADA_Model;
using iWare_SCADA_Model.MiddleModel;
@@ -106,7 +107,7 @@
                    //plcService.Close();
                    //plcService.OpenService();
                }
                string value_01 = "";//注意:默认是FALSE 【Editby shaocx,2024-09-05】
                string value_01 = "FALSE";//注意:默认是FALSE 【Editby shaocx,2024-09-05】
                while (true)
                {
                    threadStatusMonitor.ErrorMsg = "";
@@ -177,36 +178,40 @@
                                //监控上线
                                MonitorHelper.MonitorTestForLine(_dataCaptureConfig, value, colConfig, wplog.WorkPieceID);
                            }
                            //if (wplog != null)
                            //{
                            //    var isRight = SystemBussinessHelper.ValidateIsRightWorkPieceID(wplog.WorkPieceID);
                            //    if (isRight)
                            //    {
                            #region 处理业务
                            if (value_01.ToUpper().Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE"))
                            {//当上一标记位0,当前获取标记为1时,
                             //触发操作,  并给静态变量赋值为1
                             //业务代码
                                threadStatusMonitor.Threadlastmodifytime = DateTime.Now;
                                //特殊处理OP50 【Editby shaocx,2024-08-16】
                                string sideValue = GetSideForOP50(plcService, wplog);
                                wplog.MonitoringPoint += sideValue;
                                //wplog.CreatedUserName = wplog.MonitoringPoint;
                                SystemBussinessHelper.SetWorkPieceLogMiddleForCreatedUserName(ref wplog, wplog.MonitoringPoint, DataCapturePointCname);
                                //读取二维码后更新数据库
                                WorkPieceInfoManager.ReadQRcode(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), plcService, _dataCaptureConfig.IsFeedback);
                                threadStatusMonitor.Threadstatue = 1;
                            else
                            {
                                value_01 = value.ToString();
                            }
                            value_01 = value.ToString();
                            if (wplog != null)
                            {
                                var isRight = SystemBussinessHelper.ValidateIsRightWorkPieceID(wplog.WorkPieceID);
                                if (isRight)
                                {
                                    #region 处理业务
                            #endregion
                            //    }
                            //}
                                    if (value_01.ToUpper().Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE"))
                                    {//当上一标记位0,当前获取标记为1时,
                                     //触发操作,  并给静态变量赋值为1
                                     //业务代码
                                        threadStatusMonitor.Threadlastmodifytime = DateTime.Now;
                                        //特殊处理OP50 【Editby shaocx,2024-08-16】
                                        string sideValue = GetSideForOP50(plcService, wplog);
                                        wplog.MonitoringPoint += sideValue;
                                        //wplog.CreatedUserName = wplog.MonitoringPoint;
                                        SystemBussinessHelper.SetWorkPieceLogMiddleForCreatedUserName(ref wplog, wplog.MonitoringPoint, DataCapturePointCname);
                                        //读取二维码后更新数据库
                                        ReadQRcodeManager.ReadQRcode(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), plcService, _dataCaptureConfig.IsFeedback);
                                        threadStatusMonitor.Threadstatue = 1;
                                    }
                                    value_01 = value.ToString();
                                    #endregion
                                }
                            }
                        }
                        threadStatusMonitor.Remarks = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}";
                        if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10)