From 3f20c98ab66d0f1d686b740986089b0e654c7226 Mon Sep 17 00:00:00 2001
From: LWQ <1806950222@qq.com>
Date: 星期四, 24 七月 2025 08:46:19 +0800
Subject: [PATCH] 添加新的报警类型(产品未研磨)及未研磨报警功能
---
EdgeInspector_App/Process/InspectCamera.cpp | 23 +++++++++++++----------
EdgeInspector_App/Defect.h | 5 ++++-
EdgeInspector_App/Data/PostProcess.cpp | 2 ++
3 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/EdgeInspector_App/Data/PostProcess.cpp b/EdgeInspector_App/Data/PostProcess.cpp
index cabe072..55aebb4 100644
--- a/EdgeInspector_App/Data/PostProcess.cpp
+++ b/EdgeInspector_App/Data/PostProcess.cpp
@@ -1211,6 +1211,8 @@
bJudgeUse = (pSideParam->m_UserDefectPrm[pDefect->m_nUserDefectAreaIdx].m_nJudge_Size_Min_OR_AND == 0) ? FALSE : TRUE;
break;
case DefectLoc_Notch_Crack:
+
+ case DefectLoc_Notch_NoGrind:
nJudgeW_um = pSideParam->m_NotchPrm[pDefect->m_nNotchIdx].m_nNotch_Inspect_Defect_Judge_X_um;
nJudgeH_um = pSideParam->m_NotchPrm[pDefect->m_nNotchIdx].m_nNotch_Inspect_Defect_Judge_Y_um;
bAnd = (pSideParam->m_NotchPrm[pDefect->m_nNotchIdx].m_nNotch_Inspect_Defect_Judge_And == 2) ? TRUE : FALSE;
diff --git a/EdgeInspector_App/Defect.h b/EdgeInspector_App/Defect.h
index 067544f..7e556e3 100644
--- a/EdgeInspector_App/Defect.h
+++ b/EdgeInspector_App/Defect.h
@@ -22,6 +22,7 @@
DefectLoc_Measure_Chamfer,
DefectLoc_Notch_Crack,
+ DefectLoc_Notch_NoGrind,
DefectLoc_Notch_Dimension,
DefectLoc_Notch_Chamfer,
DefectLoc_Notch_Circle_Radius,
@@ -37,8 +38,9 @@
DefectLoc_License,
DefectLoc_Unknown,
-
+
DefectLoc_None
+
};
static CString g_strDefectType[DefectLoc_None] =
@@ -60,6 +62,7 @@
_T("Chamfer"),
_T("Notch"),
+ _T("Notch_NoGrind"),
_T("Notch_Dimension"),
_T("Notch_Chamfer"),
_T("Notch_Radius"),
diff --git a/EdgeInspector_App/Process/InspectCamera.cpp b/EdgeInspector_App/Process/InspectCamera.cpp
index dda71b4..bd15068 100644
--- a/EdgeInspector_App/Process/InspectCamera.cpp
+++ b/EdgeInspector_App/Process/InspectCamera.cpp
@@ -3826,7 +3826,7 @@
defectInfo.m_nSideIdx = (int)emDim;
defectInfo.m_ptDefectPos_pxl = rtRotateArea.CenterPoint();
defectInfo.m_rtDefectPos_pxl = rtRotateArea;
- defectInfo.m_DefectLoc = DefectLoc_Notch_Crack;
+ defectInfo.m_DefectLoc = DefectLoc_Notch_NoGrind;
m_pDefectControl->ExtractDefect(emDim, m_iCamera, stFrame.nScanIdx, defectInfo);
cvReleaseImageHeader(&pOriginImage);
@@ -4127,13 +4127,13 @@
{
if (m_pRecipe == NULL || m_pGlassData == NULL)
return FALSE;
-
+ int NotchFlag = 0;
for (int nMeasureIdx = 0; nMeasureIdx < MAX_SIDE_NOTCH_MEASURE_COUNT; nMeasureIdx++)
{
CPoint ptRef_pxl = m_pGlassData->GetSideData(emDim)->m_ptNotch_Reference[nNotchIdx][nMeasureIdx];
CPoint ptDim_pxl = m_pGlassData->GetSideData(emDim)->m_ptNotch_Dimension_Edge[nNotchIdx][nMeasureIdx];
-
- if (ptRef_pxl.x < 0 || ptRef_pxl.y < 0) {
+
+ /* if (ptRef_pxl.x < 0 || ptRef_pxl.y < 0) {
g_pLog->DisplayMessage(_T("[ERROR] Invalid Ref Point at Notch_Process_Calculate, NotchIdx: %d, MeasureIdx: %d, Point: (%d, %d)"), nNotchIdx, nMeasureIdx, ptRef_pxl.x, ptRef_pxl.y);
continue;
}
@@ -4141,7 +4141,7 @@
if (ptDim_pxl.x < 0 || ptDim_pxl.y < 0) {
g_pLog->DisplayMessage(_T("[ERROR] Invalid Dim Point at Notch_Process_Calculate, NotchIdx: %d, MeasureIdx: %d, Point: (%d, %d)"), nNotchIdx, nMeasureIdx, ptDim_pxl.x, ptDim_pxl.y);
continue;
- }
+ }*/
// Dimension
double dX_dim_um = (double)(ptRef_pxl.x - ptDim_pxl.x) * m_dPixelSizeX;
@@ -4150,22 +4150,25 @@
m_pGlassData->GetSideData(emDim)->m_dNotch_Dimension_Edge_Result_um[nNotchIdx][nMeasureIdx] = dDimension;
CPoint ptChamfer_pxl = m_pGlassData->GetSideData(emDim)->m_ptNotch_Chamfer_Edge[nNotchIdx][nMeasureIdx];
- if (ptChamfer_pxl.x < 0 || ptChamfer_pxl.y < 0) {
+ /* if (ptChamfer_pxl.x < 0 || ptChamfer_pxl.y < 0) {
g_pLog->DisplayMessage(_T("[ERROR] Invalid Chamfer Point at Notch_Process_Calculate, NotchIdx: %d, MeasureIdx: %d, Point: (%d, %d)"), nNotchIdx, nMeasureIdx, ptChamfer_pxl.x, ptChamfer_pxl.y);
continue;
- }
+ }*/
double dX_Chamfer = (double)(ptChamfer_pxl.x - ptDim_pxl.x) * m_dPixelSizeX;
double dY_Chamfer = (double)(ptChamfer_pxl.y - ptDim_pxl.y) * m_dPixelSizeY;
double dChamfer = sqrtf((dX_Chamfer * dX_Chamfer) + (dY_Chamfer * dY_Chamfer));
m_pGlassData->GetSideData(emDim)->m_dNotch_Chamfer_Edge_Result_um[nNotchIdx][nMeasureIdx] = dChamfer;
- if (dDimension > 2000.0 && dChamfer > 2000.0) {
+ if (dDimension > 5000.0 && dChamfer > 5000.0) {
g_pLog->DisplayMessage(_T("[ERROR] Abnormal Dimension & Chamfer too large at Notch_Process_Calculate, NotchIdx: %d, MeasureIdx: %d, Dimension: %.2f, Chamfer: %.2f"), nNotchIdx, nMeasureIdx, dDimension, dChamfer);
- continue;
+ NotchFlag=1;
}
}
-
+ if (NotchFlag == TRUE)
+ {
+ return FALSE;
+ }else
return TRUE;
}
--
Gitblit v1.9.3