From 6087507f5c9445055a38f7b861e40a22e82d3316 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期五, 25 七月 2025 16:09:29 +0800
Subject: [PATCH] 1. ProfileInspect单独使用坐标转换参数,与全局的区分开。如果ProfileInspect没有设置,那么默认使用全局的

---
 ENRIT/Process/InspectCamera.cpp |   22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/ENRIT/Process/InspectCamera.cpp b/ENRIT/Process/InspectCamera.cpp
index f6df629..cbf22ff 100644
--- a/ENRIT/Process/InspectCamera.cpp
+++ b/ENRIT/Process/InspectCamera.cpp
@@ -4009,12 +4009,22 @@
 	if(nStageNo < 0 || nStageNo > 1)
 		nStageNo = 0;
 
-	int			nChipInsArea = (int)((double)pChipPrm->m_nChippingInsArea/pCamera->m_dConvResolution[nStageNo]);
-	CRect		rectChip = CRect(rectChamfer.CenterPoint().x,0,rectChamfer.CenterPoint().x,rectChamfer.Height());
-	int			nCrackInsArea = (int)((double)pChipPrm->m_nCrackINsArea/pCamera->m_dConvResolution[nStageNo]);
-	CRect		rectCrack = CRect(rectChamfer.CenterPoint().x,0,rectChamfer.CenterPoint().x,rectChamfer.Height());
-	int			nBrokenInsArea = (int)((double)pChipPrm->m_nBrokenInsArea/pCamera->m_dConvResolution[nStageNo]);
-	CRect		rectBroken = CRect(rectChamfer.CenterPoint().x,0,rectChamfer.CenterPoint().x,rectChamfer.Height());
+	double dConvRes = pCamera->m_dConvResolution[nStageNo];
+
+	if (m_pRecipe != nullptr) {
+		CProfileInspect_Prm& profile = m_pRecipe->m_ProfilePrm;
+		double dProfileRes = profile.m_dConvResolution[eDim][nStageNo];
+		if (dProfileRes > 0.0) {
+			dConvRes = dProfileRes;
+		}
+	}
+
+	int		nChipInsArea = (int)((double)pChipPrm->m_nChippingInsArea / dConvRes);
+	CRect	rectChip = CRect(rectChamfer.CenterPoint().x, 0, rectChamfer.CenterPoint().x, rectChamfer.Height());
+	int		nCrackInsArea = (int)((double)pChipPrm->m_nCrackINsArea / dConvRes);
+	CRect	rectCrack = CRect(rectChamfer.CenterPoint().x, 0, rectChamfer.CenterPoint().x, rectChamfer.Height());
+	int		nBrokenInsArea = (int)((double)pChipPrm->m_nBrokenInsArea / dConvRes);
+	CRect	rectBroken = CRect(rectChamfer.CenterPoint().x, 0, rectChamfer.CenterPoint().x, rectChamfer.Height());
 
 	rectChip.InflateRect(align_4byte(nChipInsArea)/2,0);	
 	rectCrack.InflateRect(align_4byte(nCrackInsArea)/2,0);	

--
Gitblit v1.9.3