From 47873f48d17bb8f7602fda73d29b19adcf43fdd0 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期四, 14 八月 2025 15:50:27 +0800
Subject: [PATCH] 1. 修复执行界面没有显示侧面检数据的问题

---
 EdgeInspector_App/View/ViewMain_ScanImage.cpp |   56 +++++++++++++++++++++-----------------------------------
 1 files changed, 21 insertions(+), 35 deletions(-)

diff --git a/EdgeInspector_App/View/ViewMain_ScanImage.cpp b/EdgeInspector_App/View/ViewMain_ScanImage.cpp
index 1e953b6..2e50ca6 100644
--- a/EdgeInspector_App/View/ViewMain_ScanImage.cpp
+++ b/EdgeInspector_App/View/ViewMain_ScanImage.cpp
@@ -286,7 +286,11 @@
 					strTitle.Format(_T("BORD[%d]  CHANNEL[%d]"), pCamera->m_iCamera, 0);
 					m_staticCamInfo[i].SetWindowText(strTitle);
 				}
-			}			
+			}
+
+			if (m_pGlassData != nullptr) {
+				m_frameImg[i].SetRecipe(m_pGlassData->GetGlassRecipe());
+			}
 		}
 
 		m_bInitDlg = TRUE;
@@ -316,12 +320,13 @@
 BYTE* CViewMain_ScanImage::GetBufferPoint(int nViewIndex,int nPos /*= 0*/)
 {
 	BYTE *add = NULL;
-	int nIdx_Side	 = GetSideIdx(nViewIndex);
+	int nIdx_Side = GetSideIdx(nViewIndex);
 
 	LPBYTE plpBuf = NULL;
-	if(m_IV2M != NULL)
-		plpBuf = m_IV2M->IV2M_GetGrabBufferByDimension((DimensionDir)nIdx_Side,nPos);
-	
+	if (m_IV2M != NULL) {
+		plpBuf = m_IV2M->IV2M_GetGrabBufferByDimension((DimensionDir)nIdx_Side, nPos);
+	}
+
 	return plpBuf;
 }
 
@@ -330,8 +335,7 @@
 	PROG_MSG MsgJob = *((PROG_MSG*)wParam);	
 
 	int nIndex = GetViewIndex(MsgJob.nSide);
-	if(MsgJob.nState == 2)
-	{
+	if(MsgJob.nState == 2) {
 		InitScrollInfo(MsgJob.nSide,1);
 
 		m_ctrlScrollV[nIndex].EnableWindow(TRUE);
@@ -355,23 +359,7 @@
 		m_frameImg[nIndex].SetGlassData(m_pGlassData);
 		m_frameImg[nIndex].Invalidate();
 	}
-	else
-	{
-		/*
-		if(fabs(m_dZoom - 1.) > 0.01)
-		{
-			m_dZoom = 0.2;		
-			m_sliderZoom.SetPos(0);
-
-			CString strTmp;
-			strTmp.Format(_T("X %.2f"),m_dZoom);
-			GetDlgItem(IDC_ST_ZOOM)->SetWindowText(strTmp);
-
-			UpdateZoom();
-		}
-		*/
-
-		//g_pLog->DisplayMessage(_T("Frame Display %d"),nIndex);
+	else {
 		CPoint ptOrg = m_frameImg[nIndex].GetDisplayPos();
 		ptOrg.y = MsgJob.nDispLine;
 
@@ -385,7 +373,7 @@
 
 void CViewMain_ScanImage::SetupImageSave()
 {
-	ManualThreadStart(M_CMD_IMG_SAVE_ALL,-1);
+	ManualThreadStart(M_CMD_IMG_SAVE_ALL, -1);
 }
 
 void CViewMain_ScanImage::SetRecipe(CHardwareSettings *pHW)
@@ -395,10 +383,9 @@
 
 void CViewMain_ScanImage::ResetView()
 {
-	for(int i = 0; i < MAX_PANEL_SIDE * UPDN_TYPE; i++)
-	{
+	for(int i = 0; i < MAX_PANEL_SIDE * UPDN_TYPE; i++) {
 		m_ctrlScrollV[i].EnableWindow(FALSE);
-	}	
+	}
 }
 
 void CViewMain_ScanImage::ViewRefresh(PROG_MSG ProcMsg)
@@ -962,7 +949,7 @@
 BOOL CViewMain_ScanImage::ManualThreadStart(int nCmd,int nIndex /*= -1*/)
 {
 	if(m_pManualProcess) {
-		DWORD dwWait = ::WaitForSingleObject(m_pManualProcess->m_hThread, 1000);
+		DWORD dwWait = ::WaitForSingleObject(m_pManualProcess->m_hThread, 3000);
 		if (dwWait == WAIT_TIMEOUT) {
 			DWORD dwExitCode;
 			if ((::GetExitCodeThread(m_pManualProcess->m_hThread, &dwExitCode)) && (dwExitCode == STILL_ACTIVE)) {
@@ -1030,8 +1017,8 @@
 	if (NULL == pGlassRcp) return;
 #endif
 
-	CString			strRcpName = pGlassRcp->GetRecipeName();
-	CString			strGlassID = g_pBase->m_strHPanelID;
+	CString	strRcpName = pGlassRcp->GetRecipeName();
+	CString	strGlassID = g_pBase->m_strHPanelID;
 
 	if(strGlassID.IsEmpty() == TRUE) {
 		strGlassID = _T("Manual_ID");
@@ -1099,11 +1086,10 @@
 		if(nLength > 10) {		
 			if(ptStart.y+nLength < nMaxSize) {
 				strPath.Format(_T("%s\\DebugFullImage\\%s\\%s\\%s\\%s\\%s__%s_%d"),PATH_INSPECTION_DATA,strDate,strRcpName,strGlassID,strTime,strGlassID,PANEL_SIDE[iSide],nFrame);		
-				m_IV2M->IV2M_SaveFullImage(strPath,iSide,ptStart,nLength);		
+				m_IV2M->IV2M_SaveFullImage(strPath,iSide,ptStart,nLength);
+				g_pLog->DisplayMessage(_T("%s %d Save Completed : %s"), PANEL_SIDE[iSide], nFrame, strPath);
 			}			
 		}
-
-		g_pLog->DisplayMessage(_T("%s %d Save Completed : %s"),PANEL_SIDE[iSide],nFrame,strPath);
 	}
 }
 
@@ -1367,7 +1353,7 @@
 CCameraSettings* CViewMain_ScanImage::GetCameraSettingsByViewIndex(int nViewIndex)
 {
 	CCameraSettings* pCamera = NULL;
-	if (nullptr != m_pHardware) {
+	if (nullptr == m_pHardware) {
 		return pCamera;
 	}
 

--
Gitblit v1.9.3