|
|
|
@ -198,7 +198,7 @@ namespace Rs.MotionPlat.Flow.Camera
|
|
|
|
|
/// 检测周转盘放料是否OK
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
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;
|
|
|
|
|