From 785725de6f33118f29fbf4affd524267b7c4d5b6 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期五, 22 八月 2025 15:40:29 +0800
Subject: [PATCH] 1. 添加NotchBroken报警

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

diff --git a/EdgeInspector_App/Data/DefectStorage.cpp b/EdgeInspector_App/Data/DefectStorage.cpp
index 20497cd..352809c 100644
--- a/EdgeInspector_App/Data/DefectStorage.cpp
+++ b/EdgeInspector_App/Data/DefectStorage.cpp
@@ -231,6 +231,49 @@
 	return m_nDefect;
 }
 
+int	CDefectControl::ExtractDefect_NotchBroken(DimensionDir emDim, int iCam, int iScan, CDefect_Info defect)
+{
+	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;
+	pDefect->m_DefectInfo = defect;
+
+	int nXStart = pDefect->m_DefectInfo.m_ptDefectPos_pxl.x - (DEFECTIMAGE_WIDTH / 2);
+	int nYStart = pDefect->m_DefectInfo.m_ptDefectPos_pxl.y - (DEFECTIMAGE_HEIGHT / 2);
+	int nXSize = DEFECTIMAGE_WIDTH;
+	int nYSize = DEFECTIMAGE_HEIGHT;
+	//int nXStart = pDefect->m_DefectInfo.m_rtDefectPos_pxl.left;
+	//int nYStart = pDefect->m_DefectInfo.m_rtDefectPos_pxl.top;
+	//int nXSize = pDefect->m_DefectInfo.m_rtDefectPos_pxl.Width();
+	//int nYSize = pDefect->m_DefectInfo.m_rtDefectPos_pxl.Height();
+	if (m_pGrabber->GetSmallImage(iScan, pDefect->m_Image, nXStart, nYStart, nXSize, nYSize, FALSE) == FALSE) {
+		MyLock.Unlock();
+		return m_nDefect;
+	}
+
+	m_nDefect++;
+
+	MyLock.Unlock();
+	return m_nDefect;
+}
+
 int CDefectControl::ExtractDefect_UserDefect(DimensionDir emDim, int iCam, int iScan, int nUserDefectAreaIdx, std::vector<CDefect_Info>* vecPreDefectList)
 {
 	if(m_pGrabber == NULL)

--
Gitblit v1.9.3