diff --git a/halftoneproject-master/BanBoShi/SysCtrl/SysMgr.cs b/halftoneproject-master/BanBoShi/SysCtrl/SysMgr.cs index f60d5538..8a98612a 100644 --- a/halftoneproject-master/BanBoShi/SysCtrl/SysMgr.cs +++ b/halftoneproject-master/BanBoShi/SysCtrl/SysMgr.cs @@ -3148,6 +3148,8 @@ namespace MaiMuAOI.SysCtrl double HeightLower = model.HeightBaseValue - model.HeightDownFloatValue; if (HeightUpper + HeightLower > 0 && (HeightValue > HeightUpper || HeightValue < HeightLower)) order.Qualified = false; + else + order.Qualified = true; if (limitThresholdVal > 0 && heightValue2 >= limitThresholdVal) { Log($"{stepIndex + 1}-{processName}", $"读取数据:{heightValue2},达到上限阀值:{limitThresholdVal},请进行下料...", WarningEnum.High); @@ -3768,6 +3770,8 @@ namespace MaiMuAOI.SysCtrl double PtLower = model.PTBaseValue - model.PTDownFloatValue; if (PtUpper + PtLower > 0 && (PtValue > PtUpper || PtValue < PtLower)) order.Qualified = false; + else + order.Qualified = true; } } //------ @@ -3811,6 +3815,8 @@ namespace MaiMuAOI.SysCtrl double LwLower = model.LineWidthBaseValue - model.LineWidthDownFloatValue; if (LwUpper + LwLower > 0 && (LwValue > LwUpper || LwValue < LwLower)) order.Qualified = false; + else + order.Qualified = true; } } } @@ -4363,6 +4369,13 @@ namespace MaiMuAOI.SysCtrl CurrStepResult = 2; order.Qualified = false; } + else if ((judgmentData == DataJudgment.均值) + && (upLimit + loLimit > 0 && !(tensionJudgValue > upLimit || tensionJudgValue < loLimit))) + { + order.Qualified = true; + CurrStepResult = 0; + } + order.TensionValue = Math.Round(lstTension.Average(),2); if (order.SizeDefectInfoList == null) order.SizeDefectInfoList = new List(); @@ -4595,6 +4608,13 @@ namespace MaiMuAOI.SysCtrl CurrStepResult = 2; order.Qualified = false; } + else if ((judgmentData == DataJudgment.均值) + && (upLimit + loLimit > 0 && !(JudgValue > upLimit || JudgValue < loLimit))) + { + order.Qualified = true; + CurrStepResult = 0; + } + order.HeightValue = Math.Round(lstHeight.Average(),2); if (order.SizeDefectInfoList == null) order.SizeDefectInfoList = new List(); @@ -7775,13 +7795,21 @@ namespace MaiMuAOI.SysCtrl if (testParam.JudgmentData == DataJudgment.单点) judgData = Math.Round(res.PT1 + testParam.OffsetValue, 4); else - judgData = Math.Round(lstTestData.Average(), 4); - + judgData = Math.Round(lstTestData.Average(), 4); + + //存在上下限,判断是否为不合格 if (PtUpper + PtLower > 0 && (judgData > PtUpper || judgData < PtLower)) { order.Qualified = false; CurrStepResult = 2; } + else if ((testParam.JudgmentData == DataJudgment.均值) + && (PtUpper + PtLower > 0 && !(judgData > PtUpper || judgData < PtLower))) + { + order.Qualified = true; + CurrStepResult = 0; + } + //添加均值数据 AddAverageData(processName, testName, PtValue, PtUpper, PtLower); @@ -7879,12 +7907,18 @@ namespace MaiMuAOI.SysCtrl judgData = lineWidthValue; else judgData = LwValue; - + //存在上下限,判断是否为不合格 if (LwUpper + LwLower > 0 && (judgData > LwUpper || judgData < LwLower)) { order.Qualified = false; CurrStepResult = 2; } + else if ((testParam.JudgmentData == DataJudgment.均值) + &&(LwUpper + LwLower > 0 && !(judgData > LwUpper || judgData < LwLower))) + { + order.Qualified = true; + CurrStepResult = 0; + } //添加均值数据 AddAverageData(processName, testName, LwValue, LwUpper, LwLower); @@ -8447,7 +8481,8 @@ namespace MaiMuAOI.SysCtrl path += $"Defect_SN{order.SN}_I{res.index}_X{res.Xmm}_Y{res.Ymm}_C{res.defectCount}_{picName}"; lock (ImageSaveObj) { - OpenCvSharp.Extensions.BitmapConverter.ToBitmap(res.bmp).Save(path + ".bmp", ImageFormat.Bmp); + res.bmp.ImWrite(path + ".bmp"); + //OpenCvSharp.Extensions.BitmapConverter.ToBitmap(res.bmp).Save(path + ".bmp", ImageFormat.Bmp); File.WriteAllText(path + ".json", JsonConvert.SerializeObject(res.informationList)); } } @@ -8491,7 +8526,8 @@ namespace MaiMuAOI.SysCtrl path += $"Defect_SN{order.SN}_I{res.index}_X{res.Xmm}_Y{res.Ymm}_C{res.defectCount}_{picName}"; lock (ImageSaveObj) { - OpenCvSharp.Extensions.BitmapConverter.ToBitmap(res.bmpCompress).Save(path + ".bmp", ImageFormat.Bmp); + res.bmpCompress.ImWrite(path + ".bmp"); + //OpenCvSharp.Extensions.BitmapConverter.ToBitmap(res.bmpCompress).Save(path + ".bmp", ImageFormat.Bmp); File.WriteAllText(path + ".json", JsonConvert.SerializeObject(res.defectInfor2RestorationDesk)); } } @@ -8504,7 +8540,8 @@ namespace MaiMuAOI.SysCtrl path += $"Defect_SN{order.SN}_I{res.index}_X{res.Xmm}_Y{res.Ymm}_C{res.defectCount}_{picName}"; lock (ImageSaveObj) { - OpenCvSharp.Extensions.BitmapConverter.ToBitmap(res.bmp).Save(path + ".bmp", ImageFormat.Bmp); + res.bmp.ImWrite(path + ".bmp"); + //OpenCvSharp.Extensions.BitmapConverter.ToBitmap(res.bmp).Save(path + ".bmp", ImageFormat.Bmp); } } diff --git a/halftoneproject-master/BanBoShi/SysUI/ProcessStep/Prop/SizeDefectProp.cs b/halftoneproject-master/BanBoShi/SysUI/ProcessStep/Prop/SizeDefectProp.cs index ffde217d..e59a7368 100644 --- a/halftoneproject-master/BanBoShi/SysUI/ProcessStep/Prop/SizeDefectProp.cs +++ b/halftoneproject-master/BanBoShi/SysUI/ProcessStep/Prop/SizeDefectProp.cs @@ -28,9 +28,9 @@ namespace MaiMuAOI.SysUI.ProcessStep.Prop public Size Resize { get; set; } [PropertyOrder(14), Browsable(true), Category("2 缺陷检测"), DisplayName("2.4 阀值"), Description("阀值")] public float Thresholds { get; set; } - [PropertyOrder(15), Browsable(true), Category("2 缺陷检测"), DisplayName("2.5 种类阀值"), Description("多个用半号逗号(,)或分号(;)分隔")] + [PropertyOrder(15), Browsable(true), Category("2 缺陷检测"), DisplayName("2.5 种类阀值"), Description("多个用半号逗号(,)或分号(;)分隔")]//,PI分类[堵孔,脏污,钢丝异常,缺口,纤维丝,针孔,泡泡,压线,划伤,斜边,格栅,钢丝断裂,残胶堵孔,断栅], 乳剂分类[堵孔,脏污,钢丝异常,缺口,纤维丝,针孔,泡泡,压线,划伤,斜边,格栅,正常] public string ThresholdsClass { get; set; } - [PropertyOrder(16), Browsable(true), Category("2 缺陷检测"), DisplayName("2.6 种类个数"), Description("种类阀值的数量")] + [PropertyOrder(16), Browsable(true), Category("2 缺陷检测"), DisplayName("2.6 种类个数"), Description("种类阀值的数量, PI:14,乳剂:12")] public int ThresholdsClassCount { get; set; } [PropertyOrder(17), Browsable(true), Category("2 缺陷检测"), DisplayName("2.7 异步运行"), Description("非阻塞后续流程运行(True-是;False-否)")] public bool AsynDefectRun { get; set; } = true; diff --git a/halftoneproject-master/BanBoShi/SysUI/ProductAndStep/ProductInfoFrm.cs b/halftoneproject-master/BanBoShi/SysUI/ProductAndStep/ProductInfoFrm.cs index 938b88c6..9d4005bf 100644 --- a/halftoneproject-master/BanBoShi/SysUI/ProductAndStep/ProductInfoFrm.cs +++ b/halftoneproject-master/BanBoShi/SysUI/ProductAndStep/ProductInfoFrm.cs @@ -293,8 +293,9 @@ namespace MaiMuAOI.SysUI.ProductAndStep Classes tClasses = svcClasses.GetById(model.ClassesId); if(tClasses.Name == "乳剂") { - lstDefect.RemoveAt(12); - lstDefect.RemoveAt(12); + lstDefect.RemoveAt(11); + lstDefect.RemoveAt(11); + lstDefect.RemoveAt(11); } else lstDefect.RemoveAt(14);