From 5f12658f37fed156e67b3318542c98f359341ffd Mon Sep 17 00:00:00 2001
From: LYW <leeyeanwoo@diteam.co.kr>
Date: 금, 05 8월 2022 17:24:00 +0900
Subject: [PATCH] 업로드 실패알람 조건 변경

---
 ReviewSystem/ReviewSystem/DlgAlignCamera.cpp |   69 ++++++++++++++++++++++++++++++++--
 1 files changed, 65 insertions(+), 4 deletions(-)

diff --git a/ReviewSystem/ReviewSystem/DlgAlignCamera.cpp b/ReviewSystem/ReviewSystem/DlgAlignCamera.cpp
index e659eee..ee55f10 100644
--- a/ReviewSystem/ReviewSystem/DlgAlignCamera.cpp
+++ b/ReviewSystem/ReviewSystem/DlgAlignCamera.cpp
@@ -34,6 +34,8 @@
 	}
 	m_vecCameraImageView.clear();
 	int nSize = (int)m_vecCameraImageView.size();
+	d_MatchingRate = 0.;
+	m_bAlignResultUpdate = FALSE;
 
 	m_pDAC2P = NULL;
 }
@@ -557,6 +559,7 @@
 		strValue = _T("Find Fail");
 		m_ctrlAlignResult.SetGradientColor(RGB(255,0,0));
 		SetImageMode(View_Camera);
+		m_bAlignResultUpdate = TRUE;
 		break;
 
 	case -1:
@@ -575,6 +578,7 @@
 		strValue = _T("Success");
 		m_ctrlAlignResult.SetGradientColor(RGB(0,255,0));
 		SetImageMode(View_Camera);
+		m_bAlignResultUpdate = TRUE;
 		break;
 
 	case 2:
@@ -608,6 +612,7 @@
 			m_AlignResult.Reset();
 			m_sPreAlignResult.Reset();
 			m_sPostAlignResult.Reset();
+			d_MatchingRate = pGlassResult->m_AlignRecipe.dMatchingRate;
 
 			CCoordCalibrator* pCal = m_pDAC2P->DAC2P_GetCoordCalibrator();
 			if (pCal)
@@ -783,12 +788,15 @@
 	if (nIDEvent==1000)
 	{
 		KillTimer(nIDEvent);
+		int TempScore0;
+		int TempScore1;
 
 		int nViewIndex = 2;
 		for (VectorCameraImageViewIt it=m_vecCameraImageView.begin(); it!=m_vecCameraImageView.end(); it++)
 		{
-			if (m_SharedImageData.GetUpdated(nViewIndex))
+			if (m_SharedImageData.GetUpdated(nViewIndex) || m_bAlignResultUpdate == TRUE)
 			{
+				if (m_bAlignResultUpdate == TRUE) m_bAlignResultUpdate = FALSE;
 				if (m_SharedImageData.LockImageData(nViewIndex))
 				{
 					const SSharedImageInfo* pImageInfo = m_SharedImageData.GetImageInfo(nViewIndex);
@@ -802,13 +810,66 @@
 							(*it)->SetRulerGab(pImageInfo->dRulerGab);		// um
 							(*it)->SetResolution(pImageInfo->dResolution);	// um
 							
-							switch(pImageInfo->nCameraIndex)
+							switch (pImageInfo->nCameraIndex)
 							{
 							case 0:
-								(*it)->SetViewName(_T("1st"));
+								(*it)->d_FindScore = m_AlignResult.dFindScore[0];
+								(*it)->d_MatchingRate = d_MatchingRate;
+								TempScore0 = m_AlignResult.dFindScore[0] * 100;
+								if ((*it)->d_FindScore != 0)
+								{
+									if ((*it)->d_FindScore > (*it)->d_MatchingRate)
+									{
+										CString TempStr;
+										TempStr.Format(_T("1st OK %d%%"), TempScore0);
+										(*it)->SetViewName(TempStr);
+									}
+
+									else if ((*it)->d_FindScore < (*it)->d_MatchingRate)
+									{
+										CString TempStr;
+										TempStr.Format(_T("1st NG %d%%"), TempScore0);
+										(*it)->SetViewName(TempStr);
+									}
+
+									else
+									{
+										(*it)->SetViewName(_T("1st"));
+									}
+								}
+								else
+								{
+									(*it)->SetViewName(_T("1st"));
+								}
 								break;
 							case 1:
-								(*it)->SetViewName(_T("2nd"));
+								(*it)->d_FindScore = m_AlignResult.dFindScore[1];
+								(*it)->d_MatchingRate = d_MatchingRate;
+								TempScore1 = m_AlignResult.dFindScore[1] * 100;
+								if ((*it)->d_FindScore != 0)
+								{
+									if ((*it)->d_FindScore > (*it)->d_MatchingRate)
+									{
+										CString TempStr;
+										TempStr.Format(_T("2nd OK %d%%"), TempScore1);
+										(*it)->SetViewName(TempStr);
+									}
+
+									else if ((*it)->d_FindScore < (*it)->d_MatchingRate)
+									{
+										CString TempStr;
+										TempStr.Format(_T("2nd NG %d%%"), TempScore1);
+										(*it)->SetViewName(TempStr);
+									}
+									else
+									{
+										(*it)->SetViewName(_T("2nd"));
+									}
+								}
+								else
+								{
+									(*it)->SetViewName(_T("2nd"));
+								}
 								break;
 							}
 

--
Gitblit v1.9.3