| | |
| | | using File = System.IO.File; |
| | | using Spire.Additions.Xps.Schema; |
| | | using log4net; |
| | | using static Org.BouncyCastle.Math.EC.ECCurve; |
| | | |
| | | namespace iWare_SCADA_BusinessLogical |
| | | { |
| | |
| | | |
| | | public override void DataCaptureStart() |
| | | { |
| | | if (SystemValue.isStartedModel) |
| | | if (SystemValue.isStartedImitateModel) |
| | | { |
| | | //模拟代码注释 |
| | | /* |
| | | var plcService = PLCManger.GetSinglePLCService(_dataCaptureConfig); |
| | | WorkPieceLogMiddle wplog = new WorkPieceLogMiddle(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | |
| | | //更新WorkPieceInfo表以及插入WorkPieceLog表和WorkPieceInfoLog表 |
| | | WorkPieceInfoManager.QualityInfoComplete(wplog, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | |
| | | //*/ |
| | | |
| | | return; |
| | | } |
| | |
| | | logMiddle.EquipmentID = _dataCaptureConfig.EquipmentID; ; |
| | | logMiddle.Remarks = WorkingProcedure; |
| | | logMiddle.MonitoringPoint = DataCapturePointCode; |
| | | //logMiddle.CreatedUserName = DataCapturePointCode; |
| | | SystemBussinessHelper.SetWorkPieceLogMiddleForCreatedUserName(ref logMiddle, DataCapturePointCode, DataCapturePointCname); |
| | | logMiddle.CreatedTime = DateTimeHelper.GetDateTime(); |
| | | logMiddle.CreatedUserName = DataCapturePointCode; |
| | | logMiddle.UpdatedUserName = Environment.MachineName + "自动" + Thread.CurrentThread.ManagedThreadId.ToString(); |
| | | logMiddle.UpdatedTime = DateTimeHelper.GetDateTime(); |
| | | logMiddle.IsDeleted = false; |
| | |
| | | |
| | | try |
| | | { |
| | | switch (DataCapturePointCode) |
| | | { |
| | | case "OP2002A": |
| | | case "OP2002B": |
| | | case "OP2002C": |
| | | //监控上线 |
| | | MonitorHelper.MonitorTestForLine(_dataCaptureConfig, value, colConfig, logMiddle.WorkPieceID); |
| | | break; |
| | | } |
| | | |
| | | if (WorkingProcedure.Equals("OP30")) |
| | | { |
| | | var time = DateTimeHelper.GetDateTime(); |
| | |
| | | logMiddle.QualityOP30To1 = FileHelper.ReadPdfFileForSpire(files[0].FullName, "Y-Maximum");//涨断力矩 |
| | | break; |
| | | case "OP3002CH4": |
| | | logMiddle = GetCH4Info(files[0].FullName, logMiddle); |
| | | logMiddle = GetCH4InfoForOP30(files[0].FullName, logMiddle); |
| | | logMiddle.OP30QualityFilePathCH4 = files[0].FullName; |
| | | break; |
| | | case "OP3002CH5": |
| | | logMiddle = GetCH5Info(files[0].FullName, logMiddle); |
| | | logMiddle = GetCH5InfoForOP30(files[0].FullName, logMiddle); |
| | | logMiddle.OP30QualityFilePathCH5 = files[0].FullName; |
| | | break; |
| | | case "OP3002CH6": |
| | |
| | | if (logMiddle.OP35OK) |
| | | { |
| | | logMiddle.QualityStateStr = "OK"; |
| | | logMiddle.QualityState = (int)QualityState.OK; |
| | | } |
| | | else |
| | | { |
| | | logMiddle.QualityStateStr = "NG"; |
| | | logMiddle.QualityState = (int)QualityState.NG; |
| | | } |
| | | } |
| | | else if (WorkingProcedure.Equals("OP60")) |
| | |
| | | SystemValue.OP20_Side_Value = sideValue; |
| | | } |
| | | logMiddle.MonitoringPoint += SystemValue.OP20_Side_Value; |
| | | logMiddle.CreatedUserName = logMiddle.MonitoringPoint; |
| | | //logMiddle.CreatedUserName = logMiddle.MonitoringPoint; |
| | | SystemBussinessHelper.SetWorkPieceLogMiddleForCreatedUserName(ref logMiddle, logMiddle.MonitoringPoint, DataCapturePointCname); |
| | | |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}下线完成,是指定的工件{logMiddle.WorkPieceID},工位{gongweiStr},校验通过,读取Op60_Place_Flag:true"); |
| | | |
| | |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}测量完成读取文件数据时异常,避免工序完成异常:", ex); |
| | | } |
| | | |
| | | //根据质量数据判断是否合格/不合格 【Editby shaocx,2024-06-25】 |
| | | WorkPieceInfoManager.SetLogMiddleForQuality(ref logMiddle); |
| | | |
| | | |
| | | //更新WorkPieceInfo表以及插入WorkPieceLog表和WorkPieceInfoLog表 |
| | | WorkPieceInfoManager.QualityInfoComplete(logMiddle, PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure)); |
| | | threadStatusMonitor.Threadstatue = 1; |
| | |
| | | } |
| | | } |
| | | |
| | | public WorkPieceLogMiddle GetCH4Info(string FullName, WorkPieceLogMiddle wplog) |
| | | public WorkPieceLogMiddle GetCH4InfoForOP30(string FullName, WorkPieceLogMiddle wplog) |
| | | { |
| | | try |
| | | { |
| | |
| | | |
| | | } |
| | | |
| | | public WorkPieceLogMiddle GetCH5Info(string FullName, WorkPieceLogMiddle wplog) |
| | | public WorkPieceLogMiddle GetCH5InfoForOP30(string FullName, WorkPieceLogMiddle wplog) |
| | | { |
| | | try |
| | | { |