From 5cc675212e96d87ebbf00f4fd7a8106b06a490ff Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期三, 13 八月 2025 14:00:50 +0800
Subject: [PATCH] 1. 侧面检功能添加优化(主要是现场获取图像问题)

---
 EdgeInspector_App/View/ViewMain_ScanImage.cpp |   50 ++++++++++++++++----------------------------------
 1 files changed, 16 insertions(+), 34 deletions(-)

diff --git a/EdgeInspector_App/View/ViewMain_ScanImage.cpp b/EdgeInspector_App/View/ViewMain_ScanImage.cpp
index 1e953b6..cebf8b4 100644
--- a/EdgeInspector_App/View/ViewMain_ScanImage.cpp
+++ b/EdgeInspector_App/View/ViewMain_ScanImage.cpp
@@ -316,12 +316,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 +331,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 +355,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 +369,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 +379,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 +945,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 +1013,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 +1082,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 +1349,7 @@
 CCameraSettings* CViewMain_ScanImage::GetCameraSettingsByViewIndex(int nViewIndex)
 {
 	CCameraSettings* pCamera = NULL;
-	if (nullptr != m_pHardware) {
+	if (nullptr == m_pHardware) {
 		return pCamera;
 	}
 

--
Gitblit v1.9.3