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.标准块存图路径修改 --- SizeDetection.cs | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/SizeDetection.cs b/SizeDetection.cs index df03200..8bd934c 100644 --- a/SizeDetection.cs +++ b/SizeDetection.cs @@ -232,6 +232,7 @@ timeStr, CommonUtil.StepControl.ToString())); HObject hImage = null; + string tempFileName = ""; try { Thread.Sleep(50); @@ -242,7 +243,7 @@ { return; } - string tempFileName = GetCurrentProductSN(detectID); + tempFileName = GetCurrentProductSN(detectID); string productNo = GetProductNo(detectID); int times = 3; @@ -394,13 +395,13 @@ } else { - Type t = opcConfig.standardCompensationL.GetType(); + Type t = opcConfig.compensationL.GetType(); FieldInfo fi = t.GetField(string.Format("station{0}", CommonUtil.mainForm.PlateID)); - compL = (double)fi.GetValue(opcConfig.standardCompensationL); + compL = (double)fi.GetValue(opcConfig.compensationL); - t = opcConfig.standardCompensationW.GetType(); + t = opcConfig.compensationW.GetType(); fi = t.GetField(string.Format("station{0}", CommonUtil.mainForm.PlateID)); - compW = (double)fi.GetValue(opcConfig.standardCompensationW); + compW = (double)fi.GetValue(opcConfig.compensationW); btyLength += compL; btyWidth += compW; @@ -411,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); } } @@ -466,6 +469,7 @@ catch (Exception ex) { CommonUtil.WriteLog(LogType.Exc, string.Format("浜у搧灏哄妫�娴嬪嚭鐜板紓甯革細{0}", ex.Message)); + fileName = VisionDetect.SaveImageAs(hImage, $"{CommonUtil.ProductSizeImageDir}_NA\\{tempFileName}"); } finally { -- Gitblit v1.8.0