From 0bc51843405b703c9fbabc81365625f393ff7d86 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期日, 10 八月 2025 14:27:19 +0800
Subject: [PATCH] 1. 添加Rip Thickness报警

---
 EdgeInspector_App/Data/DefectStorage.cpp |   45 +++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 43 insertions(+), 2 deletions(-)

diff --git a/EdgeInspector_App/Data/DefectStorage.cpp b/EdgeInspector_App/Data/DefectStorage.cpp
index 65fa59d..9959728 100644
--- a/EdgeInspector_App/Data/DefectStorage.cpp
+++ b/EdgeInspector_App/Data/DefectStorage.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+锘�#include "StdAfx.h"
 #include "DefectStorage.h"
 #include "SISBuffer.h"
 #include "BlobStorage.h"
@@ -46,7 +46,7 @@
 		delete[] m_pDefect;
 	}
 
-	// 16俺狼 咯盒阑 敌促..恐? 郴干..
+	// 16淇虹嫾 鍜洅闃� 鏁屼績..鎭�? 閮村共..
 	int	DefectSapce= maxDefect+ 16;
 	m_pDefect= new CDefect[DefectSapce];
 
@@ -309,6 +309,8 @@
 	pDefect->m_bJudge_NG = TRUE;
 	pDefect->m_dSizeX_um = dMeasureResult_um;
 	pDefect->m_dSizeY_um = dMeasureDiff_um;
+	pDefect->m_dChamfer_um = dMeasureResult_um;
+	pDefect->m_dChamferOff_um = dMeasureDiff_um;
 	pDefect->m_DefectInfo = defect;
 
 	if(m_pGrabber->GetSmallImage(iScan,pDefect->m_Image
@@ -408,3 +410,42 @@
 	MyLock.Unlock();
 	return m_nDefect;
 }
+
+int CDefectControl::ExtractDefect_RipThickness(DimensionDir emDim, int iCam, int iScan, const CDefect_Info& defectInfo, double dMeasured_um, double dSpecDiff_um)
+{
+	if (m_pGrabber == NULL) {
+		return m_nDefect;
+	}
+
+	CSingleLock MyLock(&m_csDefect);
+	MyLock.Lock();
+
+	if (m_nDefect >= m_maxDefect) {
+		MyLock.Unlock();
+		return m_nDefect;
+	}
+
+	CDefect* pDefect = GetDefect(m_nDefect);
+	if (pDefect == NULL) {
+		MyLock.Unlock();
+		return m_nDefect;
+	}
+
+	pDefect->Reset();
+	pDefect->m_bJudge_NG = TRUE;			// RIP 鍘氬害寮傚父鍗� NG
+	pDefect->m_dSizeX_um = dMeasured_um;    // 璁板綍娴嬪緱鍘氬害
+	pDefect->m_dSizeY_um = dSpecDiff_um;    // 璁板綍涓庤鏍煎樊鍊�
+	pDefect->m_DefectInfo = defectInfo;
+
+	int nXStart = defectInfo.m_ptDefectPos_pxl.x - (DEFECTIMAGE_WIDTH / 2);
+	int nYStart = defectInfo.m_ptDefectPos_pxl.y - (DEFECTIMAGE_HEIGHT / 2);
+	if (!m_pGrabber->GetSmallImage(iScan, pDefect->m_Image, nXStart, nYStart, DEFECTIMAGE_WIDTH, DEFECTIMAGE_HEIGHT, FALSE)) {
+		MyLock.Unlock();
+		return m_nDefect;
+	}
+
+	m_nDefect++;
+
+	MyLock.Unlock();
+	return m_nDefect;
+}
\ No newline at end of file

--
Gitblit v1.9.3