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/Process/InspectCamera.cpp | 119 +++++++++++++++++++++++++++++++----------------------------
1 files changed, 62 insertions(+), 57 deletions(-)
diff --git a/EdgeInspector_App/Process/InspectCamera.cpp b/EdgeInspector_App/Process/InspectCamera.cpp
index 885b18b..51633bc 100644
--- a/EdgeInspector_App/Process/InspectCamera.cpp
+++ b/EdgeInspector_App/Process/InspectCamera.cpp
@@ -182,38 +182,24 @@
iScan = m_iScan;
stFrameIndex stFrame;
-
stFrame.nScanIdx = m_iScan;
- if (m_bFindGlassStart[stFrame.nScanIdx] == TRUE)
+ if (m_bFindGlassStart[stFrame.nScanIdx] == TRUE) {
return ERR_FINDGLASSSTART_SUCCESS;
+ }
- // 鞛愲彊鞚茧晫 頂勲爤鞛� 靾橂ゼ 於╇秳頌� 鞛§溂氅� 氍胳牅臧� 鞎堧悩電旉卑 臧欕嫟毵�... 頂勲爤鞛� 靾橁皜 攵�臁表晿氅� 鞐赴靹� 氍错暅鞙茧 瓯鸽.. 攴鸽Μ瓿� 鞁滌瀾靹� 彀眷晿鞙茧┐ 攴鸽儱 雱橃柎臧�氅� 霅橃 鞎婋倶?
- if (m_pGrabber->GetGrabFrameCount() < 1)
- {
+ if (m_pGrabber->GetGrabFrameCount() < 1 || iThread != 0) {
Sleep(0);
return ERR_FINDGLASSSTART_FAIL;
}
- /*
- stFrameIndex stFrame;
-
- stFrame.nScanIdx = m_iScan;
-
- if(m_bFindGlassStart[stFrame.nScanIdx] == TRUE)
- return ERR_FINDGLASSSTART_SUCCESS;
- */
-
- if (iThread != 0)
- return ERR_FINDGLASSSTART_FAIL;
-
DimensionDir emDim = GetDimension(stFrame.nScanIdx);
-
iScan = stFrame.nScanIdx;
- if (FindGlassStartLine(emDim, stFrame) == TRUE)
- {
- g_pLog->DisplayMessage(_T("Find Start Line Success!"));
+ g_pLog->DisplayMessage(_T("%s Is Glass Start Line!"), PANEL_SIDE[emDim]);
+
+ if (FindGlassStartLine(emDim, stFrame) == TRUE) {
+ g_pLog->DisplayMessage(_T("%s Find Start Line Success!"), PANEL_SIDE[emDim]);
ScanRegionSet(stFrame);
m_bFindGlassStart[stFrame.nScanIdx] = TRUE;
@@ -222,15 +208,15 @@
m_MsgJob.nDispLine = 0;
m_MsgJob.nSide = (int)emDim;
CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- if (pSideData != NULL)
+ if (pSideData != NULL) {
m_MsgJob.nDispLine = pSideData->m_nGlassStartLine;
+ }
::SendMessage(m_hWndViewScan, WM_POCESS_STATUS, (WPARAM)&m_MsgJob, (int)emDim);
return ERR_FINDGLASSSTART_SUCCESS;
}
- else
- {
+ else {
return ERR_FINDGLASSSTART_FIND_FAIL;
}
@@ -570,6 +556,40 @@
double dDiff = SpecDiff(right_dist_Gass_array[i], rip.m_nRightRipSizeMin_um, rip.m_nRightRipSizeMax_um);
m_pDefectControl->ExtractDefect_RipThickness(eDim, m_iCamera, stFrame.nScanIdx, defect, right_dist_Gass_array[i], dDiff);
}
+
+ if (i < MAX_RIP_SAMPLE_COUNT) {
+ pSideData->m_ptSideRip_Glass_pxl[i][0] = CPoint((int)xMinEdge_array_px[i], (int)yMinEdge_array_px[i]); // start
+ pSideData->m_ptSideRip_Glass_pxl[i][1] = CPoint((int)xMaxEdge_array_px[i], (int)yMaxEdge_array_px[i]); // end
+ pSideData->m_ptSideRip_Left_pxl[i][0] = CPoint((int)xMinEdge_array_px[i], (int)yMinEdge_array_px[i]); // start
+ pSideData->m_ptSideRip_Left_pxl[i][1] = CPoint((int)xMinGas_array_px[i], (int)yMinGas_array_px[i]); // end
+ pSideData->m_ptSideRip_Right_pxl[i][0] = CPoint((int)xMaxGas_array_px[i], (int)yMaxGas_array_px[i]); // start
+ pSideData->m_ptSideRip_Right_pxl[i][1] = CPoint((int)xMaxEdge_array_px[i], (int)yMaxEdge_array_px[i]); // end
+
+ pSideData->m_dSideRip_Glass_um[i] = dist_array[i];
+ pSideData->m_dSideRip_Left_um[i] = left_dist_Gass_array[i];
+ pSideData->m_dSideRip_Right_um[i] = right_dist_Gass_array[i];
+
+ if (dist_array[i] > 0) {
+ pSideData->m_nSideRip_Glass_Status[i] = ngGlass ? 2 : 1;
+ }
+ else {
+ pSideData->m_nSideRip_Glass_Status[i] = 0;
+ }
+
+ if (left_dist_Gass_array[i] > 0) {
+ pSideData->m_nSideRip_Left_Status[i] = ngLeft ? 2 : 1;
+ }
+ else {
+ pSideData->m_nSideRip_Left_Status[i] = 0;
+ }
+
+ if (right_dist_Gass_array[i] > 0) {
+ pSideData->m_nSideRip_Right_Status[i] = ngRight ? 2 : 1;
+ }
+ else {
+ pSideData->m_nSideRip_Right_Status[i] = 0;
+ }
+ }
}
return TRUE;
@@ -883,7 +903,7 @@
CSingleLock myLoc(&m_csThreadEnd);
myLoc.Lock();
- int iScan = stFrame.nScanIdx;
+ int iScan = stFrame.nScanIdx;
if (m_iThreadEnd[iScan][iThread] == 1) {
myLoc.Unlock();
return FALSE;
@@ -913,6 +933,11 @@
if (m_pII2S != NULL) {
m_pII2S->II2S_InspectionEnd(m_iCamera, iScan);
}
+
+ // Save the image as one image
+ //CString strFileName;
+ //strFileName.Format(_T("D:\\Dump\\%s.tif"), PANEL_SIDE[emDim]);
+ //m_pGrabber->DumpBufferAsOneImage(iScan, strFileName);
}
}
@@ -1292,7 +1317,7 @@
if (pSideData == NULL)
return FALSE;
- if (g_pStatus->GetGrabFrameCount(stFrame.nScanIdx) - 1 <= stFrame.nFrameIdx)
+ if (g_pStatus->GetGrabFrameCount(m_iCamera, stFrame.nScanIdx) - 1 <= stFrame.nFrameIdx)
return TRUE;
if (pSideData->m_nPreGlassEndFrame + MAX_THREAD <= stFrame.nFrameIdx)
@@ -1307,8 +1332,6 @@
void CInspectCamera::ScanRegionSet(stFrameIndex stFrame)
{
- g_pLog->DisplayMessage(_T("Scan Region Set"));
-
SetGrabEnd(stFrame.nScanIdx);
}
@@ -1798,12 +1821,6 @@
if (pSideData->m_bTopCorner_Find == TRUE) {
localLock.Unlock();
return TRUE;
- }
-
- BOOL bTopCornerUse = (BOOL)(m_pRecipe->m_SideParam[emDim].m_nTopCornerShape == 0) ? FALSE : TRUE;
- if (bTopCornerUse == FALSE) {
- localLock.Unlock();
- return FALSE;
}
double dCornerSizeY_Um = (double)m_pRecipe->m_SideParam[emDim].m_nTopCornerSizeY_um;
@@ -2415,12 +2432,6 @@
if (pSideData->m_bBotCorner_Find == TRUE) {
localLock.Unlock();
return TRUE;
- }
-
- BOOL bBotCornerUse = (BOOL)(m_pRecipe->m_SideParam[emDim].m_nBottomCornerShape == 0) ? FALSE : TRUE;
- if (bBotCornerUse == FALSE) {
- localLock.Unlock();
- return FALSE;
}
double dCornerSizeY_Um = (double)m_pRecipe->m_SideParam[emDim].m_nBottomCornerSizeY_um;
@@ -6446,14 +6457,11 @@
m_pRecipe = pRecipe;
m_pHardparm = pHW;
- if (m_pGrabber != NULL)
- {
+ if (m_pGrabber != NULL) {
m_pGrabber->ClearGrabIdx();
- //m_pGrabber->ClearBuffer();
}
- if (m_pDefectControl != NULL)
- {
+ if (m_pDefectControl != NULL) {
m_pDefectControl->SetHWRecipe(pHW);
m_pDefectControl->ResetDefectControl();
}
@@ -6496,33 +6504,30 @@
void CInspectCamera::SetGrabEnd(int iScan)
{
- g_pLog->DisplayMessage(_T("Set Grab End"));
-
CCameraSettings* pCamera = m_pHardparm->GetCameraSettings(m_iCamera, iScan);
-
- if (pCamera == NULL)
- {
+ if (pCamera == NULL) {
g_pLog->DisplayMessage(_T("Camera Setting NULL"));
return;
}
- DimensionDir emDim = pCamera->m_eDimension;
+ DimensionDir emDim = pCamera->m_eDimension;
CSide_Data* pSideData = m_pGlassData->GetSideData(emDim);
- if (pSideData == NULL)
+ if (pSideData == NULL) {
return;
+ }
- int nStageNo = g_pBase->m_nStageNo;
+ g_pLog->DisplayMessage(_T("%s Set Grab End"), PANEL_SIDE[emDim]);
- if (nStageNo < 0 || nStageNo > 1)
+ int nStageNo = g_pBase->m_nStageNo;
+ if (nStageNo < 0 || nStageNo > 1) {
nStageNo = 0;
+ }
int nGlassSize = (int)(((double)m_pRecipe->m_SideParam[(int)emDim].m_nSidePanelSize_um) / pCamera->m_dScanResolution[nStageNo]);
-
pSideData->m_nPreGlassEndLine = pSideData->m_nGlassStartLine + nGlassSize;
pSideData->m_nPreGlassEndFrame = pSideData->m_nPreGlassEndLine / pCamera->m_FrameSize.cy;
- g_pStatus->SetGrabFrametoScan(iScan, pSideData->m_nPreGlassEndFrame + 5);
-
+ g_pStatus->SetGrabFrametoScan(m_iCamera, iScan, pSideData->m_nPreGlassEndFrame + 5);
g_pLog->DisplayMessage(_T("%s Scan %d : Set Grab EndFrame - GlassEnd %d, Frame %d, GrabBuf %d"), PANEL_SIDE[emDim], iScan, pSideData->m_nPreGlassEndLine, pSideData->m_nPreGlassEndFrame, pSideData->m_nPreGlassEndFrame + 5);
}
--
Gitblit v1.9.3