From a6552335164ce062567b76aa7d097fd046129474 Mon Sep 17 00:00:00 2001
From: LYW <leeyeanwoo@diteam.co.kr>
Date: 금, 23 7월 2021 10:07:55 +0900
Subject: [PATCH] Ongoing90 #3517 CF AOI Review 자가진단 기능 개선

---
 ReviewSystem/M_AutoDiagnosisManager/DiagnosisProcessor.cpp |   94 +++++++++++++++++++++++++----------------------
 1 files changed, 50 insertions(+), 44 deletions(-)

diff --git a/ReviewSystem/M_AutoDiagnosisManager/DiagnosisProcessor.cpp b/ReviewSystem/M_AutoDiagnosisManager/DiagnosisProcessor.cpp
index e518d50..de5f5ca 100644
--- a/ReviewSystem/M_AutoDiagnosisManager/DiagnosisProcessor.cpp
+++ b/ReviewSystem/M_AutoDiagnosisManager/DiagnosisProcessor.cpp
@@ -77,7 +77,7 @@
 		ProcessFlatness();
 		Sleep(1000);
 
-		if (ProcessDiagnosisJudge() == FALSE) {
+		if (ProcessDiagnosisJudge(nProcessMode) == FALSE) {
 			strMessage.Format(_T("[CDiagnosisProcessor] DiagnosisJudge FAIL"));
 			m_pDP2P->IDP2P_DisplayMessage(0, strMessage);
 		}
@@ -97,7 +97,7 @@
 		ProcessWsi();
 		Sleep(1000);
 
-		if (ProcessDiagnosisJudge() == FALSE) {
+		if (ProcessDiagnosisJudge(nProcessMode) == FALSE) {
 			strMessage.Format(_T("[CDiagnosisProcessor] DiagnosisJudge FAIL"));
 			m_pDP2P->IDP2P_DisplayMessage(0, strMessage);
 		}
@@ -111,7 +111,7 @@
 		m_pManager->m_bProcessAll = false;
 		ProcessSquareness();
 		Sleep(1000);
-		if (ProcessDiagnosisJudge() == FALSE) {
+		if (ProcessDiagnosisJudge(nProcessMode) == FALSE) {
 			strMessage.Format(_T("[CDiagnosisProcessor] DiagnosisJudge FAIL"));
 			m_pDP2P->IDP2P_DisplayMessage(0, strMessage);
 		}
@@ -121,7 +121,7 @@
 		m_pManager->m_bProcessAll = false;
 		ProcessFlatness();
 		Sleep(1000);
-		if (ProcessDiagnosisJudge() == FALSE) {
+		if (ProcessDiagnosisJudge(nProcessMode) == FALSE) {
 			strMessage.Format(_T("[CDiagnosisProcessor] DiagnosisJudge FAIL"));
 			m_pDP2P->IDP2P_DisplayMessage(0, strMessage);
 		}
@@ -171,7 +171,7 @@
 	//Sleep(2000);
 	Sleep(1000);
 
-	if (ProcessDiagnosisJudge() == FALSE) {
+	if (ProcessDiagnosisJudge(DiagnosisMode_All) == FALSE) {
 		strMessage.Format(_T("[CDiagnosisProcessor] DiagnosisJudge FAIL"));
 		m_pDP2P->IDP2P_DisplayMessage(0, strMessage);
 	}
@@ -479,7 +479,7 @@
 		{
 			//#3514_LYW_CF AOI Review �옄媛�吏꾨떒 湲곕뒫 媛쒖꽑_START
 			//if (10000 <= GetTickCount() - stTime)
-			if (1000 <= GetTickCount() - stTime)
+			if (11000 <= GetTickCount() - stTime)
 			//#3514_LYW_CF AOI Review �옄媛�吏꾨떒 湲곕뒫 媛쒖꽑_END
 			{
 				break;
@@ -601,33 +601,33 @@
 			Sleep(500);
 		}
 
-		if (nIdx == 0)
-		{
-			pResultPoint[nIdx].dPosX = 657.425
-				;
-			pResultPoint[nIdx].dPosY = 540.14
-				;
-		}
-		else if (nIdx == 1)
-		{
-			pResultPoint[nIdx].dPosX = 657.425
-				;
-			pResultPoint[nIdx].dPosY = 2278.636
-				;
-		}
-		else if (nIdx == 2)
-		{
-			pResultPoint[nIdx].dPosX = 2096.944
-				;
-			pResultPoint[nIdx].dPosY = 540.141
-				;
-		}
-		else if (nIdx == 3)
-		{
-			pResultPoint[nIdx].dPosX = 2096.944
-				;
-			pResultPoint[nIdx].dPosY = 2278.636;
-		}
+// 		if (nIdx == 0)
+// 		{
+// 			pResultPoint[nIdx].dPosX = 657.425
+// 				;
+// 			pResultPoint[nIdx].dPosY = 540.14
+// 				;
+// 		}
+// 		else if (nIdx == 1)
+// 		{
+// 			pResultPoint[nIdx].dPosX = 657.425
+// 				;
+// 			pResultPoint[nIdx].dPosY = 2278.636
+// 				;
+// 		}
+// 		else if (nIdx == 2)
+// 		{
+// 			pResultPoint[nIdx].dPosX = 2096.944
+// 				;
+// 			pResultPoint[nIdx].dPosY = 540.141
+// 				;
+// 		}
+// 		else if (nIdx == 3)
+// 		{
+// 			pResultPoint[nIdx].dPosX = 2096.944
+// 				;
+// 			pResultPoint[nIdx].dPosY = 2278.636;
+// 		}
 
 
 		//1. 紐⑦꽣瑜� �씠�룞
@@ -735,7 +735,7 @@
 	return TRUE;
 }
 
-int CDiagnosisProcessor::ProcessDiagnosisJudge()
+int CDiagnosisProcessor::ProcessDiagnosisJudge(int nMode)
 {
 	for (int i = 0; i < 2; i++)
 	{
@@ -760,22 +760,28 @@
 		}
 
 		CString strMessage = _T("");
-
-		double dDate = (90 - pProcessResult->GetGantryDegree());
-		if (abs(dDate) >= abs(pSettingInfo->GetJudgeData_Degree())) // 0412 kyh 吏곴컖�룄�뿉�꽌 �굹�삩 Dgree 媛믪씠 �꽕�젙�븳 Judge 媛믩낫�떎 �겕嫄곕굹 媛숈쓣寃쎌슦
+		if (nMode == DiagnosisMode_All || nMode == DiagnosisMode_Review || nMode == DiagnosisMode_Squareness)
 		{
+			double dDate = (90 - pProcessResult->GetGantryDegree());
+			if (abs(dDate) >= abs(pSettingInfo->GetJudgeData_Degree())) // 0412 kyh 吏곴컖�룄�뿉�꽌 �굹�삩 Dgree 媛믪씠 �꽕�젙�븳 Judge 媛믩낫�떎 �겕嫄곕굹 媛숈쓣寃쎌슦
+			{
 
-			m_pDP2P->IDP2P_DiagnosisSendJudgeAlarm(); // �븣�엺 諛쒖깮
-			strMessage.Format(_T("[Judge Data] [Gantry %d]Diagnosis Error ! GantryDegree[%lf] Judge[%lf]"), i, dDate, pSettingInfo->GetJudgeData_Degree());
-			m_pDP2P->IDP2P_DisplayMessage(0, strMessage);
+				m_pDP2P->IDP2P_DiagnosisSendJudgeAlarm(); // �븣�엺 諛쒖깮
+				strMessage.Format(_T("[Judge Data] [Gantry %d]Diagnosis Error ! GantryDegree[%lf] Judge[%lf]"), i, dDate, pSettingInfo->GetJudgeData_Degree());
+				m_pDP2P->IDP2P_DisplayMessage(0, strMessage);
+			}
 		}
 
-		if (pProcessWSIResult->getWSI_RTB() >= pSettingInfo->GetJudgeData_3Sigma() || pProcessWSIResult->getWSI_RTB() <= 0) // 0412 kyh WSI �몴以��렪李� 鍮꾧탳
+		if (nMode == DiagnosisMode_All || nMode == DiagnosisMode_Wsi)
 		{
-			m_pDP2P->IDP2P_DiagnosisSendJudgeAlarm(); // �븣�엺 諛쒖깮
-			strMessage.Format(_T("[Judge Data] [WSI %d]Diagnosis Error ! WSI RTB[%lf] Judge[%lf]"), i, pProcessWSIResult->getWSI_RTB(), pSettingInfo->GetJudgeData_3Sigma());
-			m_pDP2P->IDP2P_DisplayMessage(0, strMessage);
+			if (pProcessWSIResult->getWSI_RTB() >= pSettingInfo->GetJudgeData_3Sigma() || pProcessWSIResult->getWSI_RTB() <= 0) // 0412 kyh WSI �몴以��렪李� 鍮꾧탳
+			{
+				m_pDP2P->IDP2P_DiagnosisSendJudgeAlarm(); // �븣�엺 諛쒖깮
+				strMessage.Format(_T("[Judge Data] [WSI %d]Diagnosis Error ! WSI RTB[%lf] Judge[%lf]"), i, pProcessWSIResult->getWSI_RTB(), pSettingInfo->GetJudgeData_3Sigma());
+				m_pDP2P->IDP2P_DisplayMessage(0, strMessage);
+			}
 		}
+
 	}
 	//#3407 KYH �옄媛�吏꾨떒 Judge �뙋�젙 諛� �븣�엺 諛쒖깮 湲곕뒫 ADD END
 

--
Gitblit v1.9.3