From 04116d765c7113cfa1a9ec04e6067487a4ba0a20 Mon Sep 17 00:00:00 2001
From: LWQ <1806950222@qq.com>
Date: 星期二, 29 七月 2025 00:20:58 +0800
Subject: [PATCH] 修复单像素精度单独分配精度测量与研磨量测量功能

---
 ENRIT/resource.h                |    0 
 ENRIT/Process/InspectCamera.cpp |   62 ++++++++++++++++++++++++++-----
 ENRIT/View/ViewScanImage.cpp    |   10 ++++-
 ENRIT/View/ViewScanImage.h      |    4 +
 ENRIT/ENRIT.rc                  |    0 
 5 files changed, 63 insertions(+), 13 deletions(-)

diff --git a/ENRIT/ENRIT.rc b/ENRIT/ENRIT.rc
index 1330237..966c2c4 100644
--- a/ENRIT/ENRIT.rc
+++ b/ENRIT/ENRIT.rc
Binary files differ
diff --git a/ENRIT/Process/InspectCamera.cpp b/ENRIT/Process/InspectCamera.cpp
index cbf22ff..85efa19 100644
--- a/ENRIT/Process/InspectCamera.cpp
+++ b/ENRIT/Process/InspectCamera.cpp
@@ -1091,7 +1091,20 @@
 	dConv = pCamera->m_dConvResolution[nStageNo];
 	dScan = pCamera->m_dScanResolution[nStageNo];
 	if(dConv <= 0 || dScan <= 0)
-		return FALSE;	
+		return FALSE;
+
+	if (m_pRecipe != nullptr) {
+		CProfileInspect_Prm& profile = m_pRecipe->m_ProfilePrm;
+		double dConvRes = profile.m_dConvResolution[eDimension][nStageNo];
+		if (dConvRes > 0.0) {
+			dConv = dConvRes;
+		}
+
+		double dScanRes = profile.m_dScanResolution[eDimension][nStageNo];
+		if (dScanRes > 0.0) {
+			dScan = dScanRes;
+		}
+	}
 
 	srand((unsigned int)time(NULL));
 
@@ -1674,7 +1687,15 @@
 
 	double dConv = pCamera->m_dConvResolution[g_pBase->m_nStageNo];
 	if(dConv <= 0)
-		return FALSE;	
+		return FALSE;
+
+	if (m_pRecipe != nullptr) {
+		CProfileInspect_Prm& profile = m_pRecipe->m_ProfilePrm;
+		double dConvRes = profile.m_dConvResolution[emDim][g_pBase->m_nStageNo];
+		if (dConvRes > 0.0) {
+			dConv = dConvRes;
+		}
+	}
 
 	double		dProfileAvg;
 	double		dChamferAvg;
@@ -1851,7 +1872,15 @@
 
 	double dConv = pCamera->m_dConvResolution[g_pBase->m_nStageNo];
 	if(dConv <= 0)
-		return FALSE;	
+		return FALSE;
+
+	if (m_pRecipe != nullptr) {
+		CProfileInspect_Prm& profile = m_pRecipe->m_ProfilePrm;
+		double dConvRes = profile.m_dConvResolution[emDim][g_pBase->m_nStageNo];
+		if (dConvRes > 0.0) {
+			dConv = dConvRes;
+		}
+	}
 
 	INS_EDGE_RESULT_INFO *pResInfo =  NULL;
 	pResInfo =  m_pGlassData->GetEdgeResultInfo(emDim);
@@ -1955,6 +1984,19 @@
 	{
 		g_pLog->DisplayMessage(_T("%s MakeProfilePosition Res Null : Frame %d, %d,%.3f,%.3f"),PANEL_SIDE[emDim],stFrame.nFrameIdx,g_pBase->m_nStageNo,dConv,dScan);
 		return FALSE;
+	}
+
+	if (m_pRecipe != nullptr) {
+		CProfileInspect_Prm& profile = m_pRecipe->m_ProfilePrm;
+		double dConvRes = profile.m_dConvResolution[emDim][g_pBase->m_nStageNo];
+		if (dConvRes > 0.0) {
+			dConv = dConvRes;
+		}
+
+		double dScanRes = profile.m_dScanResolution[emDim][g_pBase->m_nStageNo];
+		if (dScanRes > 0.0) {
+			dScan = dScanRes;
+		}
 	}
 
 	ptOffset.x = (float)((double)ptOffset.x / dConv);
@@ -4011,13 +4053,13 @@
 
 	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;
-		}
-	}
+	//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());
diff --git a/ENRIT/View/ViewScanImage.cpp b/ENRIT/View/ViewScanImage.cpp
index fd009a8..b15dd60 100644
--- a/ENRIT/View/ViewScanImage.cpp
+++ b/ENRIT/View/ViewScanImage.cpp
@@ -164,6 +164,7 @@
 	ON_EVENT(CViewScanImage, IDC_SAVE_ALL, DISPID_CLICK, CViewScanImage::OnBnClickedSaveAll, VTS_NONE)
 	ON_EVENT(CViewScanImage, IDC_BTN_START_BATCH, DISPID_CLICK, CViewScanImage::OnBtnStartBatch, VTS_NONE)
 	ON_EVENT(CViewScanImage, IDC_BTN_STOP_BATCH, DISPID_CLICK, CViewScanImage::OnBtnStopBatch, VTS_NONE)
+	ON_EVENT(CViewScanImage, IDC_BTN_STOP_BATCH2, DISPID_CLICK, CViewScanImage::OnClickBtnStopBatch2, VTS_NONE)
 END_EVENTSINK_MAP()
 
 
@@ -1078,7 +1079,7 @@
 BOOL CViewScanImage::ManualThreadStart(int nCmd,int nIndex /*= -1*/)
 {
 	if (m_pManualProcess) {
-		DWORD dwWait = ::WaitForSingleObject(m_pManualProcess->m_hThread, 3000);
+		DWORD dwWait = ::WaitForSingleObject(m_pManualProcess->m_hThread, 10000);
 		if (dwWait == WAIT_TIMEOUT) {
 			DWORD dwExitCode;
 			if ((::GetExitCodeThread(m_pManualProcess->m_hThread, &dwExitCode)) && (dwExitCode == STILL_ACTIVE)) {
@@ -1532,4 +1533,9 @@
 		else
 			m_frameImg[i].ResetMode(MODE_AUTO_MEASURE); 
 	}
-}
\ No newline at end of file
+}
+
+void CViewScanImage::OnClickBtnStopBatch2()
+{
+	SendMessage(WM_BATCH_PROCESS_NEXT, NULL, NULL);
+}
diff --git a/ENRIT/View/ViewScanImage.h b/ENRIT/View/ViewScanImage.h
index 865d1a1..eb7b3b9 100644
--- a/ENRIT/View/ViewScanImage.h
+++ b/ENRIT/View/ViewScanImage.h
@@ -80,7 +80,7 @@
 	void			OnBnClickedSaveAll();
 	void			OnBtnStartBatch();
 	void			OnBtnStopBatch();
-
+	void			OnClickBtnStopBatch2();
 protected:
 	int				GetSideIdx(int nViewIndex);
 	BYTE			*GetBufferPoint(int nViewIndex,int nPos = 0);
@@ -122,4 +122,6 @@
 	int				m_nCurrentFolderIndex;
 	BOOL			m_bIsBatchProcessing;
 	CStringArray	m_arrFolderList;
+
+	
 };
diff --git a/ENRIT/resource.h b/ENRIT/resource.h
index 2460a6e..4268dc0 100644
--- a/ENRIT/resource.h
+++ b/ENRIT/resource.h
Binary files differ

--
Gitblit v1.9.3