| | |
| | | |
| | | HObject ihImage = null; |
| | | HObject hi = new HObject(); |
| | | string tempFileName = ""; |
| | | try |
| | | { |
| | | opc.Write(OPCOutputTag.DetectionStart2, false); |
| | |
| | | |
| | | int slotNum = (CommonUtil.mainForm.PlateID + 1) % 5 + 1; |
| | | |
| | | string tempFileName = slotNum.ToString() + "_" + productNo.Trim().Replace("/", "").Replace("\"", "'") + "_" + DateTime.Now.ToString("HHmmssff") + "_" + detectID.ToString(); |
| | | tempFileName = slotNum.ToString() + "_" + productNo.Trim().Replace("/", "").Replace("\"", "'") + "_" + DateTime.Now.ToString("HHmmssff") + "_" + detectID.ToString(); |
| | | if (productNo.Trim().Length == CommonUtil.ProductNoLength) |
| | | { |
| | | string productNoFileName = CommonUtil.ProductNoImageDir + @"\" + productNo + "_" + detectID.ToString(); |
| | |
| | | if (batteryHeight[0] != 999.999 && batteryHeight[0] != -999.999) |
| | | { |
| | | double compv = 0.0; |
| | | Type t = opcConfig.standardCompensationZ.GetType(); |
| | | Type t = opcConfig.compensationZ.GetType(); |
| | | FieldInfo fi = t.GetField(string.Format("station{0}", (CommonUtil.mainForm.PlateID + 1) % 5 + 1)); |
| | | compv = (double)fi.GetValue(opcConfig.standardCompensationZ); |
| | | compv = (double)fi.GetValue(opcConfig.compensationZ); |
| | | |
| | | batteryHeight[0] += compv; |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | if (opcConfig.IsSaveHeightOKImage) |
| | | if (opcConfig.IsSaveHeightOKImage || CommonUtil.DetectionOption == DetectionOption.doStandardBlock) |
| | | { |
| | | //DateTime dt = DateTime.Now; |
| | | |
| | |
| | | catch (Exception ex) |
| | | { |
| | | CommonUtil.WriteLog(LogType.Exc, string.Format("检测产品条码和厚度过程中出现异常:{0}", ex.Message)); |
| | | |
| | | if (string.IsNullOrWhiteSpace(tempFileName)) |
| | | { |
| | | tempFileName = DateTime.Now.ToString("HHmmssfff"); |
| | | } |
| | | VisionDetect.SaveImageAs(ihImage, $"{CommonUtil.ProductSizeImageDir}_NA\\{tempFileName}"); |
| | | } |
| | | finally |
| | | { |