From 9be92165bccab3bab173d41e45463fb2b67ef476 Mon Sep 17 00:00:00 2001 From: lhiven <2366881222@qq.com> Date: Tue, 26 Dec 2023 07:08:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=98=AF=E5=90=A6=E6=89=AB?= =?UTF-8?q?=E7=A0=81=E7=9A=84=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.SkyLine/Flow/Camera/VisionManager.cs | 31 ++++++++++++++----------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/Rs.SkyLine/Flow/Camera/VisionManager.cs b/Rs.SkyLine/Flow/Camera/VisionManager.cs index 95aaffa..62fdae7 100644 --- a/Rs.SkyLine/Flow/Camera/VisionManager.cs +++ b/Rs.SkyLine/Flow/Camera/VisionManager.cs @@ -198,7 +198,7 @@ namespace Rs.MotionPlat.Flow.Camera /// 检测周转盘放料是否OK /// /// - public static VisionResult TurnoverTrayDumpProductOK(HObject image,bool bNeedLocation=true) + public static VisionResult TurnoverTrayDumpProductOK(HObject image,bool bNeedLocation=true,bool bNeedScanBarcode=true) { upCameraScanBarCodeModel = new ModelParameter("周转盘产品定位"); VisionResult vr = new VisionResult(); @@ -243,23 +243,26 @@ namespace Rs.MotionPlat.Flow.Camera { vr.SearchModelOK = true; } - //只有定位成功的才去扫二维码 - if (vr.SearchModelOK && !GlobalVar.EnableScanBarCodeByDownCamera) + if(bNeedScanBarcode) { - string sn = FindCode(image, upCameraScanBarCodeModel.BarCodeRegion); - if (string.IsNullOrEmpty(sn)) + //只有定位成功的才去扫二维码 + if (vr.SearchModelOK && !GlobalVar.EnableScanBarCodeByDownCamera) { - vr.ScanBarCodeOK = false; - } - else - { - if(!Directory.Exists($"d://images/{DateTime.Now.ToString("yyyyMMdd")}")) + string sn = FindCode(image, upCameraScanBarCodeModel.BarCodeRegion); + if (string.IsNullOrEmpty(sn)) { - Directory.CreateDirectory($"d://images/{DateTime.Now.ToString("yyyyMMdd")}"); + vr.ScanBarCodeOK = false; + } + else + { + if (!Directory.Exists($"d://images/{DateTime.Now.ToString("yyyyMMdd")}")) + { + Directory.CreateDirectory($"d://images/{DateTime.Now.ToString("yyyyMMdd")}"); + } + HOperatorSet.WriteImage(image, "bmp", 0, $"d://images/{DateTime.Now.ToString("yyyyMMdd")}//{sn}"); + vr.ScanBarCodeOK = true; + vr.SN = sn; } - HOperatorSet.WriteImage(image, "bmp", 0, $"d://images/{DateTime.Now.ToString("yyyyMMdd")}//{sn}"); - vr.ScanBarCodeOK = true; - vr.SN = sn; } } return vr;