schangxiang@126.com
2024-09-09 a19d2fd7d9f52f7daa15b32d434cb86fa7ffb30b
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/Special/DataCaptureHandler_OP1003.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 System;
@@ -89,8 +90,10 @@
                            var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType));
                            stopwatch.Stop();
                            Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $" {DataCapturePointCode}工序测标记读取{DateTime.Now}*****01****{stopwatch.ElapsedMilliseconds}*****{value.ToString().ToUpper()}**");
                            WorkPieceLogMiddle wplog = null;
                            if (value.ToString().ToUpper().Equals("TRUE"))
                            var value_bool = value.ToString().ToUpper().Equals("TRUE");
                            if (value_bool)
                            {
                                threadStatusMonitor.Threadlastmodifytime = DateTime.Now;
                                wplog = new WorkPieceLogMiddle();
@@ -136,6 +139,13 @@
                                //监控上线
                                MonitorHelper.MonitorTestForLine(_dataCaptureConfig, value, colConfig, wplog.WorkPieceID);
                            }
                            //if (wplog != null)
                            //{
                            //    var isRight = SystemBussinessHelper.ValidateIsRightWorkPieceID(wplog.WorkPieceID);
                            //    if (isRight)
                            //    {
                            #region 业务处理
                            if (SystemValue.value_OP1003.ToUpper().Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE"))
                            {//当上一标记位0,当前获取标记为1时,
                             //触发操作,  并给静态变量赋值为1
@@ -161,17 +171,20 @@
                                //更新WorkPieceInfo表以及插入WorkPieceLog表和WorkPieceInfoLog表
                                WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure));
                                QualityInfoCompleteManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure));
                                threadStatusMonitor.Threadstatue = 1;
                            }
                            SystemValue.value_OP1003 = value.ToString();
                            #endregion
                            //    }
                            //}
                        }
                        SystemValue.lbl_Alert_OP1003 = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}";
                        if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10)
                        {
                            Thread.Sleep(5000);
                            Thread.Sleep(700);
                        }
                        else
                        {