From 2c79e797a723a59c2afc4b05069618ae48df587d Mon Sep 17 00:00:00 2001 From: jace.tang <1536884497@qq.com> Date: 星期二, 14 六月 2022 14:11:50 +0800 Subject: [PATCH] 1.标准块存图路径修改 --- HeightDetection.cs | 20 +++++++++++++++++--- SizeDetection.cs | 6 ++++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/HeightDetection.cs b/HeightDetection.cs index 4342ac2..415b929 100644 --- a/HeightDetection.cs +++ b/HeightDetection.cs @@ -229,18 +229,32 @@ if (heightResult != MeasureState.OK) { - heightFileName = VisionDetect.SaveImageAs(hi, CommonUtil.ProductHeightImageDir + $"_{heightResult.ToString()}\\{ tempFileName}"); + + if (CommonUtil.DetectionOption == DetectionOption.doStandardBlock) + { + VisionDetect.SaveImageAs(hi, CommonUtil.ProductHeightImageDir + @"\" + tempFileName); + } + else + { + heightFileName = VisionDetect.SaveImageAs(hi, CommonUtil.ProductHeightImageDir + $"_{heightResult.ToString()}\\{ tempFileName}"); + } + } else { - if (opcConfig.IsSaveHeightOKImage || CommonUtil.DetectionOption == DetectionOption.doStandardBlock) + if (opcConfig.IsSaveHeightOKImage||CommonUtil.DetectionOption == DetectionOption.doStandardBlock) { //DateTime dt = DateTime.Now; - //if (dt.Second >= 10 && dt.Second <= 15) + if (CommonUtil.DetectionOption == DetectionOption.doStandardBlock) + { + VisionDetect.SaveImageAs(hi, CommonUtil.ProductHeightImageDir + @"\" + tempFileName); + } + else { VisionDetect.SaveImageAs(hi, CommonUtil.ProductHeightImageDir + @"_OK\" + tempFileName); } + } } diff --git a/SizeDetection.cs b/SizeDetection.cs index d883a81..8bd934c 100644 --- a/SizeDetection.cs +++ b/SizeDetection.cs @@ -347,7 +347,7 @@ { ms = MeasureState.OK; - if (opcConfig.IsSaveSizeOKImage || CommonUtil.DetectionOption == DetectionOption.doStandardBlock) + if (opcConfig.IsSaveSizeOKImage) { DateTime dt = DateTime.Now; @@ -412,12 +412,14 @@ if (lengthMeasureState == MeasureState.OK && widthMeasureState == MeasureState.OK) { ms = MeasureState.OK; - //VisionDetect.SaveImageAs(hImage, CommonUtil.ScreenshotsDir + @"\" + tempFileName); + VisionDetect.SaveImageAs(hImage, CommonUtil.ScreenshotsDir + @"\" + tempFileName); + VisionDetect.SaveImageAs(hImage, CommonUtil.ProductSizeImageDir + @"\" + tempFileName); } else { ms = MeasureState.NG; fileName = VisionDetect.SaveImageAs(hImage, CommonUtil.ScreenshotsDir + @"_NG\" + tempFileName); + VisionDetect.SaveImageAs(hImage, CommonUtil.ProductSizeImageDir + @"\" + tempFileName); } } -- Gitblit v1.8.0