SDC C-Project CF Review 프로그램
LYW
2021-07-23 55615eba335d4cbc1f83330dc5078fe073034b7d
ReviewSystem/ReviewSystem/ReviewProcessor_CPJT.cpp
@@ -88,7 +88,7 @@
   int nEndResultIdx   = pReviewResult->GetEndSReviewResultIndex();
                  
   
   // 인덱스가 현재 마지막 인덱스 보다 클시..
   // �ε����� ���� ������ �ε��� ���� Ŭ��..
   if (nCurResultIdx > nEndResultIdx)  
   {
      LeaveCriticalSection(&m_csUserCriticalSection);
@@ -97,7 +97,7 @@
   }
   // 현재 결과데이터 저장
   // 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙
   wsiResult.nWsi_ResultIndex = measureResut.nResultIndex;
   wsiResult.nResultCode = measureResut.nResultCode;
@@ -138,8 +138,8 @@
//       g_pLog->DisplayMessage(_T("[ReviewProcessor]JugementR [%d] JugementG [%d] JugementB [%d]"), wsiResult.nJugementR, wsiResult.nJugementG, wsiResult.nJugementB);
//       g_pLog->DisplayMessage(_T("[ReviewProcessor]RZoneHeight [%.03lf] GZoneHeight [%.03lf] BZoneHeight [%.03lf]"), wsiResult.dRZoneHeight, wsiResult.dGZoneHeight, wsiResult.dBZoneHeight);
//       wsiResult.추가 하세요= measureResut.nMultiShot;
//       wsiResult.추가 하세요= measureResut.nCurrentShotNumber;
//       wsiResult.�߰� �ϼ���= measureResut.nMultiShot;
//       wsiResult.�߰� �ϼ���= measureResut.nCurrentShotNumber;
      break;
   case 3: //BANK
      wsiResult.dRZoneHeight = measureResut.dRZoneHeight;
@@ -147,14 +147,14 @@
      wsiResult.dBZoneHeight = measureResut.dBZoneHeight;
      wsiResult.dDefectHeight = measureResut.dDefectHeight;
      wsiResult.nWsi_DefectType = measureResut.nDefectType;
//       wsiResult.추가 하세요= measureResut.nMultiShot;
//       wsiResult.추가 하세요= measureResut.nCurrentShotNumber;
//       wsiResult.�߰� �ϼ���= measureResut.nMultiShot;
//       wsiResult.�߰� �ϼ���= measureResut.nCurrentShotNumber;
      break;
   case 4: //CS
      wsiResult.dCSHeight = measureResut.dCSHeight;
      wsiResult.dDefectHeight = measureResut.dDefectHeight;
      wsiResult.nWsi_DefectType = measureResut.nDefectType;
//       wsiResult.추가 하세요= measureResut.nMultiShot;
//       wsiResult.�߰� �ϼ���= measureResut.nMultiShot;
      break;
   }
@@ -163,7 +163,7 @@
   memcpy(wsiResult.pWsi_ResultData, measureResut.pResultData, sizeof(wsiResult.pWsi_ResultData));
   // 결과 데이터 추가
   // 占쏙옙占?占쏙옙占쏙옙占쏙옙 占쌩곤옙
   SReviewResult *pProcessResult = NULL;
   if (pGlassResult->SetWsiResultData(nModuleIndex, nCurResultIdx, wsiResult, nGlassPosX, nGlassPosY, nMotorPosX, nMotorPosY, dTime))
   {
@@ -173,10 +173,10 @@
      pProcessResult = pReviewResult->GetSReviewResult(nCurResultIdx);
   }
   // 저장 성공시, 리뷰 프로세서에 포인터 전달
   // ���� ������, ���� ���μ����� ������ ����
   if (pProcessResult)
   {
      // 처리 쓰레드 수행
      // ó�� ������ ����
      if (AddReviewProcessData(pProcessResult)==1)
      {
         g_pLog->DisplayMessage(_T("[ReviewProcessor]Add Process Data module[%d] result[%d]"), nModuleIndex, nCurResultIdx);
@@ -192,7 +192,7 @@
   
   LeaveCriticalSection(&m_csUserCriticalSection);
   // 결과 갱신.
   // 占쏙옙占?占쏙옙占쏙옙.
   m_pRP2P->IRP2P_UpdateReviewResult(nModuleIndex, pGlassResult);
   return;
@@ -238,7 +238,7 @@
   int nEndResultIdx   = pReviewResult->GetEndSReviewResultIndex();
   // 인덱스가 현재 마지막 인덱스 보다 클시..
   // �ε����� ���� ������ �ε��� ���� Ŭ��..
   if (nCurResultIdx > nEndResultIdx)  
   {
      LeaveCriticalSection(&m_csUserCriticalSection);
@@ -246,14 +246,14 @@
      g_pLog->DisplayMessage(_T("[ReviewProcessor]SetWsiResultData module[%d] point[%d] result[%d]"), nModuleIndex, measureResut.nResultIndex, nCurResultIdx);
   }
   // 현재 결과데이터 저장
   // 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙
   wsiUserResult.nWsi_ResultCode      = measureResut.nResultCode;
   wsiUserResult.nWsi_Type            = measureResut.nResultType;
   wsiUserResult.nWsi_SlopeWarn      = measureResut.nXSlopeWarn;
   memcpy(wsiUserResult.pWsi_ResultData, measureResut.pResultData, sizeof(wsiUserResult.pWsi_ResultData));
   // 결과 데이터 추가
   // 占쏙옙占?占쏙옙占쏙옙占쏙옙 占쌩곤옙
   SReviewResult *pProcessResult = NULL;
   if (pGlassResult->SetUserWsiResultData(nModuleIndex, nCurResultIdx, wsiUserResult, nGlassPosX, nGlassPosY, nMotorPosX, nMotorPosY, dTime))
   {
@@ -263,10 +263,10 @@
      pProcessResult = pReviewResult->GetSReviewResult(nCurResultIdx);
   }
   // 저장 성공시, 리뷰 프로세서에 포인터 전달
   // ���� ������, ���� ���μ����� ������ ����
   if (pProcessResult)
   {
      // 처리 쓰레드 수행
      // ó�� ������ ����
      if (AddReviewProcessData(pProcessResult)==1)
      {
         g_pLog->DisplayMessage(_T("[ReviewProcessor]Add Process Data module[%d] result[%d]"), nModuleIndex, nCurResultIdx); 
@@ -282,7 +282,7 @@
   LeaveCriticalSection(&m_csUserCriticalSection);
   // 결과 갱신.
   // 占쏙옙占?占쏙옙占쏙옙.
   m_pRP2P->IRP2P_UpdateReviewResult(nModuleIndex, pGlassResult);
   return;
@@ -337,7 +337,7 @@
   int nEndResultIdx = pReviewResult->GetEndSReviewResultIndex();
   // 인덱스가 현재 마지막 인덱스 보다 클시..
   // �ε����� ���� ������ �ε��� ���� Ŭ��..
   if (nCurResultIdx > nEndResultIdx)
   {
      LeaveCriticalSection(&m_csUserCriticalSection);
@@ -345,7 +345,7 @@
      g_pLog->DisplayMessage(_T("[ReviewProcessor]SetWsiMultiShotResultData module[%d] point[%d] result[%d]"), nModuleIndex, measureResut.nResultIndex, nCurResultIdx);
   }
   // 현재 결과데이터 저장
   // 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙
   wsiResult.nWsi_ResultCode = measureResut.nResultCode;
   wsiResult.nWsi_Type = measureResut.nResultType;
   wsiResult.nWsi_SlopeWarn = measureResut.nXSlopeWarn;
@@ -353,7 +353,7 @@
   memcpy(wsiResult.pWsi_ResultData, measureResut.pResultData, sizeof(wsiResult.pWsi_ResultData));
   // 결과 데이터 추가
   // 占쏙옙占?占쏙옙占쏙옙占쏙옙 占쌩곤옙
   SReviewResult *pProcessResult = NULL;
   if (pGlassResult->SetWsiResultData(nModuleIndex, nCurResultIdx, wsiResult, nGlassPosX, nGlassPosY, nMotorPosX, nMotorPosY, dTime))
   {
@@ -363,10 +363,10 @@
      pProcessResult = pReviewResult->GetSReviewResult(nCurResultIdx);
   }
   // 저장 성공시, 리뷰 프로세서에 포인터 전달
   // ���� ������, ���� ���μ����� ������ ����
   if (pProcessResult)
   {
      // 처리 쓰레드 수행
      // ó�� ������ ����
      if (AddReviewProcessData(pProcessResult) == 1)
      {
         g_pLog->DisplayMessage(_T("[ReviewProcessor]Add Process Data module[%d] result[%d]"), nModuleIndex, nCurResultIdx); 
@@ -382,7 +382,7 @@
   LeaveCriticalSection(&m_csUserCriticalSection);
   // 결과 갱신.
   // 占쏙옙占?占쏙옙占쏙옙.
   m_pRP2P->IRP2P_UpdateReviewResult(nModuleIndex, pGlassResult);
   return;
@@ -457,7 +457,7 @@
   int nStartResultIdx   = pReviewResult->GetStartSReviewResultIndex();
   int nEndResultIdx   = pReviewResult->GetEndSReviewResultIndex();
   
   // 인덱스가 현재 마지막 인덱스 보다 클시..
   // �ε����� ���� ������ �ε��� ���� Ŭ��..
   if (nCurResultIdx > nEndResultIdx)  
   {
      LeaveCriticalSection(&m_csUserCriticalSection);
@@ -465,7 +465,7 @@
      g_pLog->DisplayMessage(_T("[ReviewProcessor]SetReviewResultData module[%d] point[%d] result[%d]"), nModuleIndex, nResultIndex, nCurResultIdx);
   }
   // 현재 결과이미지 저장
   // 占쏙옙占쏙옙 占쏙옙占쏙옙譴占쏙옙占?占쏙옙占쏙옙
   SReviewResult *pProcessResult = NULL;
   switch(GetReviewProcessStatus())
   {
@@ -509,10 +509,10 @@
      break;
   }
   // 저장 성공시, 리뷰 프로세서에 포인터 전달
   // ���� ������, ���� ���μ����� ������ ����
   if (pProcessResult)
   {
      // 처리 쓰레드 수행
      // ó�� ������ ����
      if (AddReviewProcessData(pProcessResult)==1)
      {
         g_pLog->DisplayMessage(_T("[ReviewProcessor]Add Process Data module[%d] result[%d]"), nModuleIndex, nCurResultIdx); 
@@ -527,8 +527,8 @@
   }
      LeaveCriticalSection(&m_csUserCriticalSection);
      //만약 어느 한쪽이포인트 진행을 다해버리면 아래 구문을 안타서 다시 모터좌표 안쏴줌
      // 신호처리 필요함 이거 ㄱㄱ
      //占쏙옙占쏙옙 占쏙옙占?占쏙옙占쏙옙占쏙옙占쏙옙占쏙옙트 占쏙옙占쏙옙占쏙옙 占쏙옙占쌔뱄옙占쏙옙占쏙옙 占싣뤄옙 占쏙옙占쏙옙占쏙옙 占쏙옙타占쏙옙 占쌕쏙옙 占쏙옙占쏙옙占쏙옙표 占싫쏙옙占쏙옙
      // ��ȣó�� �ʿ��� �̰� ����
      if (nCurResultIdx + 1== pReviewResult->GetSReviewResultCount())
      {
         if (nModuleIndex == 0)
@@ -542,7 +542,7 @@
         if (bLeftGantryReviewDone&&bRightGantryReviewDone)
         {
            ::Sleep(3000); // 딜레이는 필수임. 없으면 동작 안함.
            ::Sleep(3000); // 占쏙옙占쏙옙甄占?占십쇽옙占쏙옙. 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙.
            g_pLog->DisplayMessage(_T("[ReviewProcessor]RemainReview Started module[%d]"), nModuleIndex);
            CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
            switch (GetReviewProcessStatus())
@@ -567,13 +567,13 @@
         }
         else if(m_pRP2P->IRP2P_Recipe_GetRsRcpReviewInfo()->GetRcpSchedulingInfo()->GetSingleGantryPath()>0)
         {
            //20210302 싱글 겐트리 사용시 모터 로직상 두개의 겐트리가 완료된 상태에서
            //시작을 해야됨으로 Review 에서 Count 체크 하는 기능으로 한겐트리 사용시 200개에서 멈추는 현상 발생
            //그래서 싱글 겐트리 사용시 예외처리 하여 동작하도록 바꿔야됨 CHM
            //20210302 占싱깍옙 占쏙옙트占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占싸곤옙占쏙옙 占쏙옙트占쏙옙占쏙옙 占싹뤄옙占?占쏙옙占승울옙占쏙옙
            //占쏙옙占쏙옙占쏙옙 占쌔야듸옙占쏙옙占쏙옙 Review 占쏙옙占쏙옙 Count 체크 占싹댐옙 占쏙옙占쏙옙占쏙옙占?占싼곤옙트占쏙옙 占쏙옙占쏙옙 200占쏙옙占쏙옙占쏙옙 占쏙옙占쌩댐옙 占쏙옙占쏙옙 占쌩삼옙
            //占쌓뤄옙占쏙옙 占싱깍옙 占쏙옙트占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙처占쏙옙 占싹울옙 占쏙옙占쏙옙占싹듸옙占쏙옙 占쌕뀐옙森占?CHM
            g_pLog->DisplayMessage(_T("[ReviewProcessor]Single GantryPath Use"), nModuleIndex);
            if (bLeftGantryReviewDone || bRightGantryReviewDone)
            {
               ::Sleep(3000); // 딜레이는 필수임. 없으면 동작 안함.
               ::Sleep(3000); // 占쏙옙占쏙옙甄占?占십쇽옙占쏙옙. 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙.
               g_pLog->DisplayMessage(_T("[ReviewProcessor]RemainReview Started module[%d]"), nModuleIndex);
               CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
               switch (GetReviewProcessStatus())
@@ -601,7 +601,7 @@
      }
      
      // 마지막 포인트까지 왔고, 리뷰할 결과가 남아 있으면...
      // 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙트占쏙옙占쏙옙 占쌉곤옙, 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙占?占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙...
      if(nCurResultIdx==nEndResultIdx && nCurResultIdx+1 < pReviewResult->GetSReviewResultCount())
       {
@@ -624,8 +624,8 @@
      pReviewResult->SetStartSReviewResultIndex(nStartResultIdx);
      pReviewResult->SetEndSReviewResultIndex(nEndResultIdx);
      // 나머지 포인트 리뷰 수행하자.
      ::Sleep(3000); // 딜레이는 필수임. 없으면 동작 안함.
      // ������ ����Ʈ ���� ��������.
      ::Sleep(3000); // 占쏙옙占쏙옙甄占?占십쇽옙占쏙옙. 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙.
         if (bLeftGantryReviewDone&&bRightGantryReviewDone)
         {
         
@@ -685,7 +685,7 @@
      }
   }
   // 결과 갱신.
   // 占쏙옙占?占쏙옙占쏙옙.
   m_pRP2P->IRP2P_UpdateReviewResult(nModuleIndex, pGlassResult, m_nReviewPlanIndex);
   return;
@@ -729,7 +729,7 @@
{
   if (m_pRP2P==NULL) return 0;
   // 마지막 포인트인지 확인 후 PCControl ReviewEnd 전송
   // ������ ����Ʈ���� Ȯ�� �� PCControl ReviewEnd ����
   CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
   CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
   if (pGlassResult==NULL || pSequenceProcessor==NULL) 
@@ -737,7 +737,7 @@
      return 1;
   }
   // 조건확인
   // ����Ȯ��
   if (pGlassResult->CheckReviewComplete())
   {
      // check motor ready!
@@ -763,7 +763,7 @@
{
   if (m_pRP2P==NULL) return 0;
   // 마지막 포인트인지 확인 후 PCControl ReviewEnd 전송
   // ������ ����Ʈ���� Ȯ�� �� PCControl ReviewEnd ����
   CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
   CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
   if (pGlassResult==NULL || pSequenceProcessor==NULL) 
@@ -771,7 +771,7 @@
      return 1;
   }
   // 조건확인
   // ����Ȯ��
   if (pGlassResult->CheckUserComplete())
   {
      m_pRP2P->IRP2P_DisplayMessage(_T("User Last Point Complete! "));
@@ -796,7 +796,7 @@
{
   if (m_pRP2P==NULL) return 0;
   // 마지막 포인트인지 확인 후 PLC ReviewEnd 전송
   // ������ ����Ʈ���� Ȯ�� �� PLC ReviewEnd ����
   CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
   CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
   if (pGlassResult==NULL || pSequenceProcessor==NULL) 
@@ -804,7 +804,7 @@
      return 1;
   }
   // 조건확인
   // ����Ȯ��
   if (pGlassResult->CheckReflowComplete())
   {
      m_pRP2P->IRP2P_DisplayMessage(_T("Reflow Last Point Complete! "));
@@ -829,7 +829,7 @@
{
   if (m_pRP2P==NULL) return 0;
   // 마지막 포인트인지 확인 후 PCControl ReviewEnd 전송
   // ������ ����Ʈ���� Ȯ�� �� PCControl ReviewEnd ����
   CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
   CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
   if (pGlassResult==NULL || pSequenceProcessor==NULL) 
@@ -837,7 +837,7 @@
      return 1;
   }
   // 조건확인
   // ����Ȯ��
   if (pGlassResult->CheckWsiComplete())
   {
      m_pRP2P->IRP2P_DisplayMessage(_T("Wsi Last Point Complete! "));
@@ -863,7 +863,7 @@
   g_pLog->DisplayMessage(_T("PostProcessMeasureResult[%d]"),nThreadIdx);
   if (m_pRP2P==NULL) return 0;
   // 마지막 포인트인지 확인 후 PCControl ReviewEnd 전송
   // ������ ����Ʈ���� Ȯ�� �� PCControl ReviewEnd ����
   CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
   CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
   if (pGlassResult==NULL || pSequenceProcessor==NULL) 
@@ -871,7 +871,7 @@
      return 1;
   }
   // 조건확인
   // ����Ȯ��
   if (pGlassResult->CheckMeasureComplete())
   {
      m_pRP2P->IRP2P_DisplayMessage(_T("Measure Last Point Complete! "));
@@ -900,7 +900,7 @@
{
   if (m_pRP2P==NULL) return 0;
   // 마지막 포인트인지 확인 후 PCControl ReviewEnd 전송
   // ������ ����Ʈ���� Ȯ�� �� PCControl ReviewEnd ����
   CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
   CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
   if (pGlassResult==NULL || pSequenceProcessor==NULL) 
@@ -908,7 +908,7 @@
      return 1;
   }
   // 조건확인
   // ����Ȯ��
   if (pGlassResult->CheckWsiReflowComplete())
   {
      m_pRP2P->IRP2P_DisplayMessage(_T("Wsi Reflow Last Point Complete! "));
@@ -932,7 +932,7 @@
{
   if (m_pRP2P==NULL) return 0;
   // 마지막 포인트인지 확인 후 PCControl ReviewEnd 전송
   // ������ ����Ʈ���� Ȯ�� �� PCControl ReviewEnd ����
   CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
   CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
   if (pGlassResult==NULL || pSequenceProcessor==NULL) 
@@ -940,7 +940,7 @@
      return 1;
   }
   // 조건확인
   // ����Ȯ��
   if (pGlassResult->CheckWsiUserComplete())
   {
      m_pRP2P->IRP2P_DisplayMessage(_T("Wsi Last Point Complete! "));
@@ -965,7 +965,7 @@
{
   if (m_pRP2P == NULL) return 0;
   // 마지막 포인트인지 확인 후 PCControl ReviewEnd 전송
   // ������ ����Ʈ���� Ȯ�� �� PCControl ReviewEnd ����
   CGlassResult *pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
   CSequenceProcessor* pSequenceProcessor = m_pRP2P->IRP2P_GetSequenceProcessor();
   if (pGlassResult == NULL || pSequenceProcessor == NULL)
@@ -973,7 +973,7 @@
      return 1;
   }
   // 조건확인
   // ����Ȯ��
   if (pGlassResult->CheckWsiMultiShotComplete())
   {
      m_pRP2P->IRP2P_DisplayMessage(_T("WsiMultiShot Last Point Complete! "));
@@ -1138,23 +1138,23 @@
      return ReviewResult_Process_Fail;
   }
   
   // Snap 시간 저장.
   // Snap �ð� ����.
   CTime snapTime = CTime::GetCurrentTime();
   pReviewResult->strSnapTime.Format(_T("%04d%02d%02d%02d%02d%02d"), snapTime.GetYear(), snapTime.GetMonth(), snapTime.GetDay(), 
      snapTime.GetHour(), snapTime.GetMinute(), snapTime.GetSecond());   // snap_time
   // 리뷰 업로드 이미지 파일 이름 만들기
   // 占쏙옙占쏙옙 占쏙옙占싸듸옙 占싱뱄옙占쏙옙 占쏙옙占쏙옙 占싱몌옙 占쏙옙占쏙옙占?
   CString strImageFileName = _T("");
   if (MakeReviewImageFileName(pReviewResult)==FALSE)
   {
      
   }
   //결과파일 공유 메모리 리뷰 이미지 이름 및 좌표 채워주기
   //占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙 占쌨몌옙 占쏙옙占쏙옙 占싱뱄옙占쏙옙 占싱몌옙 占쏙옙 占쏙옙표 채占쏙옙占쌍깍옙
   if(!UpdateMemoryReviewPlan(pReviewResult))
      m_pRP2P->IRP2P_DisplayMessage(_T("[ReviewPlan] Memory Update Fail!! DefectIdx : %d"), pReviewResult->nDefectidx2);
   
   // 로컬 이미지 저장 파일 이름
   // ���� �̹��� ���� ���� �̸�
   pReviewResult->strImgFileName = m_strSaveImageBasePath + _T("\\") +pReviewResult->strImgFileName;
   pReviewResult->nOpticType = 1;
@@ -1178,28 +1178,30 @@
      //   UINT64 nSize = SaveReviewImage(&uploadImage, strPath, m_nReviewImageSize, m_nReviewImageQuality, m_nReviewImageStep);
         //if (nSize > 0)
         //   m_pRP2P->IRP2P_DisplayMessage(_T("Backup Review Image Save Success! Size: %d byte [%s]"), nSize, pReviewResult->strUploadImgFileName);
         // 업로드 이미지 경로 수정 20190917 chm
         // 占쏙옙占싸듸옙 占싱뱄옙占쏙옙 占쏙옙占?占쏙옙占쏙옙 20190917 chm
         strPath.Format(_T("%s\\%s"), m_strSaveImageUploadPath, pReviewResult->strUploadImgFileName);
         nSize = SaveReviewImage(&uploadImage, strPath, m_nReviewImageSize, m_nReviewImageQuality, m_nReviewImageStep);
         m_pRP2P->IRP2P_DisplayMessage(_T("Backup Review Image Save Success! Size: %d byte [%s]"), nSize, strPath);
         if (pGlassResult != NULL)
         {
         {
            pGlassResult->m_strUploadImgFileName = m_strSaveImageUploadPath;
            //taek 210203
            strRTMSPath.Format(_T("\\\\126.100.100.5\\Reviewimage\\%s\\%s\\%s"), pGlassResult->m_strRTMSStepID, pGlassResult->m_strGlassID, pReviewResult->strUploadImgFileName);
            int bRet = SaveReviewImage(&uploadImage, strRTMSPath, m_nReviewImageSize, m_nReviewImageQuality, m_nReviewImageStep); //Taek Rtms 210126
            if (bRet == 0)
            {
               m_pRP2P->IRP2P_DisplayMessage(_T("RTMS Review Image Save Fail [%s] index[%d]"), strRTMSPath, pReviewResult->nDefectIdx);
               m_pRP2P->IRP2P_DisplayMessage(_T("RTMS Review Image Save Fail!!"));
            }
            else m_pRP2P->IRP2P_DisplayMessage(_T("RTMS Review Image Save Success! Size: %d byte [%s] index[%d]"), nSize, strRTMSPath, pReviewResult->nDefectIdx); //taek 210128 속도 문제로 임시로 로그 남기지 않음
         }
            else m_pRP2P->IRP2P_DisplayMessage(_T("RTMS Review Image Save Success! Size: %d byte [%s] index[%d]"), nSize, strRTMSPath, pReviewResult->nDefectIdx); //taek 210128 �ӵ� ������ �ӽ÷� �α� ������ ����
         }
         if (nSize > 0)
         {
             int aoiindex = CDitGlassRawClient::GetInstance()->GetDefectData(pReviewResult->nDefectidx2)->m_nDefectIdx;
            m_pRP2P->IRP2P_DisplayMessage(_T("Upload Review Image Save Success! Size: %d byte [%s] index[%d] AOI NO[%d]"), nSize, strRTMSPath, pReviewResult->nDefectIdx, aoiindex); //taek 210128 속도 문제로 임시로 로그 남기지 않음
            m_pRP2P->IRP2P_DisplayMessage(_T("Upload Review Image Save Success! Size: %d byte [%s] index[%d] AOI NO[%d]"), nSize, pReviewResult->strUploadImgFileName, pReviewResult->nDefectIdx, aoiindex); //taek 210128 속도 문제로 임시로 로그 남기지 않음
            //m_pRP2P->IRP2P_DisplayMessage(_T("Upload Review Image Save Success! Size: %d byte [%s]"), nSize, pReviewResult->strUploadImgFileName);
         }
         else
@@ -1235,7 +1237,7 @@
   const CRsRcpReviewInfo*  psRcpReviewInfo = m_pRP2P->IRP2P_Recipe_GetRsRcpReviewInfo();
   if(psRcpReviewInfo== NULL) m_pRP2P->IRP2P_DisplayMessage(_T("RcpReviewInfo is NULL"));
   
   if(psRcpReviewInfo->m_bDefocusUse) //190819chm 디포커스 알람 사용
   if(psRcpReviewInfo->m_bDefocusUse) //190819chm 占쏙옙占쏙옙커占쏙옙 占싯띰옙 占쏙옙占?
   {
     if(pReviewResult->nLocation == DefectLoc_ASG || pReviewResult->nLocation == DefectLoc_PAD || pReviewResult->nLocation == DefectLoc_C2C)
     {
@@ -1276,22 +1278,21 @@
           }
        }
        if (pReviewResult->nModuleIdx == 0)
        if (pReviewResult->nModuleIdx == 0 && m_pRP2P->IRP2P_GetFirstReviewLeft())
        {
           m_pRP2P->IRP2P_GetCurrentGlassResult()->nReview00ImageContrast = dFocusValue;
           /* double dAverageGray = 0.0;
            if (CCHImageProcess::ImageAverage(pImageData, dAverageGray) == 1)
            {
               m_pRP2P->IRP2P_GetCurrentGlassResult()->nReview00ImageContrast = dAverageGray;
            }*/
     }
        else
           m_pRP2P->IRP2P_SetFirstReviewLeft(FALSE);
           m_pRP2P->IRP2P_DisplayMessage(_T("FirstReviewLeft FDC FocusValue = %.2f "), dFocusValue);
        }
        else if(pReviewResult->nModuleIdx == 1 && m_pRP2P->IRP2P_GetFirstReviewRight())
        {
           m_pRP2P->IRP2P_GetCurrentGlassResult()->nReview01ImageContrast = dFocusValue;
           m_pRP2P->IRP2P_SetFirstReviewRight(FALSE);
           m_pRP2P->IRP2P_DisplayMessage(_T("FirstReviewRight FDC FocusValue = %.2f "), dFocusValue);
        }
     }
   }
   //#3524_210723_LYW_CF AOI Review 디포커스 알람 추가 및 FDC 보고 방식 개선 MOD Start
   else
   {
      double dFocusValue = 0.;
@@ -1309,15 +1310,21 @@
         dFocusValue = CalcFocusValue(imageConvert.GetImageBuffer(), imageConvert.GetWidth(), imageConvert.GetHeight());
      }
      if (pReviewResult->nModuleIdx == 0)
      if (pReviewResult->nModuleIdx == 0 && m_pRP2P->IRP2P_GetFirstReviewLeft())
      {
         m_pRP2P->IRP2P_GetCurrentGlassResult()->nReview00ImageContrast = dFocusValue;
         m_pRP2P->IRP2P_SetFirstReviewLeft(FALSE);
         m_pRP2P->IRP2P_DisplayMessage(_T("FirstReviewLeft FDC FocusValue = %.2f "), dFocusValue);
      }
      else
      else if (pReviewResult->nModuleIdx == 1 && m_pRP2P->IRP2P_GetFirstReviewRight())
      {
         m_pRP2P->IRP2P_GetCurrentGlassResult()->nReview01ImageContrast = dFocusValue;
         m_pRP2P->IRP2P_SetFirstReviewRight(FALSE);
         m_pRP2P->IRP2P_DisplayMessage(_T("FirstReviewRight FDC FocusValue = %.2f "), dFocusValue);
      }
   }
   //#3524_210723_LYW_CF AOI Review 디포커스 알람 추가 및 FDC 보고 방식 개선 MOD End
   
   
@@ -1337,12 +1344,12 @@
      return ReviewResult_Process_Fail;
   }
   // Snap 시간 저장.
   // Snap �ð� ����.
   CTime snapTime = CTime::GetCurrentTime();
   pReviewResult->strSnapTime.Format(_T("%04d%02d%02d%02d%02d%02d"), snapTime.GetYear(), snapTime.GetMonth(), snapTime.GetDay(), 
      snapTime.GetHour(), snapTime.GetMinute(), snapTime.GetSecond());   // snap_time
   // 리뷰 업로드 이미지 파일 이름 만들기
   // 占쏙옙占쏙옙 占쏙옙占싸듸옙 占싱뱄옙占쏙옙 占쏙옙占쏙옙 占싱몌옙 占쏙옙占쏙옙占?
   CString strImageFileName = _T("");
   if (MakeUserImageFileName(pReviewResult)==FALSE)
   {
@@ -1355,7 +1362,7 @@
      m_pRP2P->IRP2P_DisplayMessage(_T("[UserPlan] Memory Update Fail!! DefectIdx : %d"), pReviewResult->nDefectidx2);
   //// 로컬 이미지 저장 파일 이름
   //// ���� �̹��� ���� ���� �̸�
   //strImageFileName.Format(_T("ModuleIdx[%d]_PointIdx[%d]_Zoom[%d]"), pReviewResult->nModuleIdx, pReviewResult->nResultIdx, pReviewResult->nZoomIdx);
   //pReviewResult->strImgFileName = strImageFileName;
@@ -1374,10 +1381,10 @@
         UINT64 nSize = SaveReviewImage(&uploadImage, strPath, m_nReviewImageSize, m_nReviewImageQuality, m_nReviewImageStep);
         m_pRP2P->IRP2P_DisplayMessage(_T("Upload Review Image Save Success! Size: %d byte"), nSize);
         //uploadImage.SaveImage(strPath, 40);  // 화질 60% 150k
         //uploadImage.SaveImage(strPath, 40);  // ȭ�� 60% 150k
         if(GetReviewProcessStatus() == ReviewProcessStatus_UserStart)
         {
            // 업로드 이미지 경로 수정 20190917 chm
            // 占쏙옙占싸듸옙 占싱뱄옙占쏙옙 占쏙옙占?占쏙옙占쏙옙 20190917 chm
            //strPath.Format(_T("%s\\%s\\%s"), m_strSaveImageUploadPath, m_strGlassID, pReviewResult->strUploadImgFileName);
            strPath.Format(_T("%s\\%s"), m_strSaveImageUploadPath, pReviewResult->strUploadImgFileName);
            nSize = SaveReviewImage(&uploadImage, strPath, m_nReviewImageSize, m_nReviewImageQuality, m_nReviewImageStep);
@@ -1399,7 +1406,7 @@
   const CRsRcpReviewInfo*  psRcpReviewInfo = m_pRP2P->IRP2P_Recipe_GetRsRcpReviewInfo();
   if(psRcpReviewInfo== NULL) m_pRP2P->IRP2P_DisplayMessage(_T("RcpReviewInfo is NULL"));
   if(psRcpReviewInfo->m_bDefocusUse) //190819chm 디포커스 알람 사용
   if(psRcpReviewInfo->m_bDefocusUse) //190819chm 占쏙옙占쏙옙커占쏙옙 占싯띰옙 占쏙옙占?
   {
      if(pReviewResult->nLocation == DefectLoc_ASG || pReviewResult->nLocation == DefectLoc_PAD || pReviewResult->nLocation == DefectLoc_C2C)
      {
@@ -1422,9 +1429,23 @@
         if (imageConvert.GetImageExist())
         {
            dFocusValue = CalcFocusValue(imageConvert.GetImageBuffer(), imageConvert.GetWidth(), imageConvert.GetHeight());
            if (pReviewResult->nModuleIdx == 0 && m_pRP2P->IRP2P_GetFirstReviewLeft())
            {
               m_pRP2P->IRP2P_GetCurrentGlassResult()->nReview00ImageContrast = dFocusValue;
               m_pRP2P->IRP2P_SetFirstReviewLeft(FALSE);
               m_pRP2P->IRP2P_DisplayMessage(_T("FirstReviewLeft FDC FocusValue = %.2f "), dFocusValue);
            }
            else if (pReviewResult->nModuleIdx == 1 && m_pRP2P->IRP2P_GetFirstReviewRight())
            {
               m_pRP2P->IRP2P_GetCurrentGlassResult()->nReview01ImageContrast = dFocusValue;
               m_pRP2P->IRP2P_SetFirstReviewRight(FALSE);
               m_pRP2P->IRP2P_DisplayMessage(_T("FirstReviewRight FDC FocusValue = %.2f "), dFocusValue);
            }
         }
      
         // count defocus
         CGlassResult* pGlassResult = m_pRP2P->IRP2P_GetCurrentGlassResult();
         if (pGlassResult)
@@ -1444,6 +1465,39 @@
      }
   }
   //#3524_210723_LYW_CF AOI Review 디포커스 알람 추가 및 FDC 보고 방식 개선 ADD Start
   else
   {
      double dFocusValue = 0.;
      CCHImageData imageConvert;
      if (pImageData->GetChannels() != 1)
      {
         CCHImageProcess::ImageConvert(pImageData, &imageConvert, ConvertTypeRGB2Gray);
      }
      else
      {
         pImageData->CopyImageTo(&imageConvert);
      }
      if (imageConvert.GetImageExist())
      {
         dFocusValue = CalcFocusValue(imageConvert.GetImageBuffer(), imageConvert.GetWidth(), imageConvert.GetHeight());
      }
      if (pReviewResult->nModuleIdx == 0 && m_pRP2P->IRP2P_GetFirstReviewLeft())
      {
         m_pRP2P->IRP2P_GetCurrentGlassResult()->nReview00ImageContrast = dFocusValue;
         m_pRP2P->IRP2P_SetFirstReviewLeft(FALSE);
         m_pRP2P->IRP2P_DisplayMessage(_T("FirstReviewLeft FDC FocusValue = %.2f "), dFocusValue);
      }
      else if (pReviewResult->nModuleIdx == 1 && m_pRP2P->IRP2P_GetFirstReviewRight())
      {
         m_pRP2P->IRP2P_GetCurrentGlassResult()->nReview01ImageContrast = dFocusValue;
         m_pRP2P->IRP2P_SetFirstReviewRight(FALSE);
         m_pRP2P->IRP2P_DisplayMessage(_T("FirstReviewRight FDC FocusValue = %.2f "), dFocusValue);
      }
   }
   //#3524_210723_LYW_CF AOI Review 디포커스 알람 추가 및 FDC 보고 방식 개선 ADD End
   return ReviewResult_Process_Complete;
}
@@ -1457,7 +1511,7 @@
   int nTestMode = FALSE;
   
   //시뮬 돌릴려는 이미지 파일 선택 20190827 chm
   //�ù� �������� �̹��� ���� ���� 20190827 chm
   if(nTestMode){
      Sleep(500);
      CString strPathName;
@@ -1479,12 +1533,12 @@
      return ReviewResult_Process_Fail;
   }
   // Snap 시간 저장.
   // Snap �ð� ����.
   CTime snapTime = CTime::GetCurrentTime();
   pReviewResult->strSnapTime.Format(_T("%04d%02d%02d%02d%02d%02d"), snapTime.GetYear(), snapTime.GetMonth(), snapTime.GetDay(), 
      snapTime.GetHour(), snapTime.GetMinute(), snapTime.GetSecond());   // snap_time
   // 리뷰 업로드 이미지 파일 이름 만들기
   // 占쏙옙占쏙옙 占쏙옙占싸듸옙 占싱뱄옙占쏙옙 占쏙옙占쏙옙 占싱몌옙 占쏙옙占쏙옙占?
   CString strImageFileName = _T("");
   if (MakeReflowImageFileName(pReviewResult)==FALSE)
   {
@@ -1500,8 +1554,8 @@
   }
   reflowParam reParam; //Reflow 연산 정보
   reflowResult reResult;//Reflow 결과 정보
   reflowParam reParam; //Reflow ���� ����
   reflowResult reResult;//Reflow 占쏙옙占?占쏙옙占쏙옙
   //////////////////////////////////////////////////////////////////////////////////////////////
   BOOL btFlag =0;
@@ -1513,10 +1567,10 @@
   CCHImageData tempImage;
   tempImageOrigin.CopyImageFrom(pImageData);
   if(pReviewResult->nReflow_Side==7) // 바텀 연산
   if(pReviewResult->nReflow_Side==7) // ���� ����
   {
      btFlag=1;
      CCHImageProcess::ImageRotate(pImageData,&tempImage,135);//바텀 이미지를 Right 회전 시켜 Right 연산 실행
      CCHImageProcess::ImageRotate(pImageData,&tempImage,135);//���� �̹����� Right ȸ�� ���� Right ���� ����
      pImageData = &tempImage;
      //reParam.nImageWidth = 2048;
      //reParam.nImageHeight = 2432;
@@ -1626,9 +1680,9 @@
   CCHImageData tmepData2;
   if(btFlag==1){
      CCHImageProcess::ImageRotate(pImageData,&tmepData2,135);//Right 연산후 다시 이미지 돌리기
      CCHImageProcess::ImageRotate(pImageData,&tmepData2,135);//Right ������ �ٽ� �̹��� ������
      pImageData= &tmepData2;
      //pImageData->SaveImage(_T("D:\\Testafter.bmp"));//Test 를 위한 bmp 저장
      //pImageData->SaveImage(_T("D:\\Testafter.bmp"));//Test �� ���� bmp ����
   }
@@ -1653,17 +1707,17 @@
         UINT64 nSize = SaveReviewImage(&uploadImage, strPath, m_nReviewImageSize, m_nReviewImageQuality, m_nReviewImageStep);
         m_pRP2P->IRP2P_DisplayMessage(_T("Upload Review Image Save Success! Size: %d byte"), nSize);
         //uploadImage.SaveImage(strPath, 40);  // 화질 60% 150k
         //uploadImage.SaveImage(strPath, 40);  // ȭ�� 60% 150k
         if(GetReviewProcessStatus() == ReviewProcessStatus_ReflowStart)
         {
            // 업로드 이미지 경로 수정 20190917 chm
            // 占쏙옙占싸듸옙 占싱뱄옙占쏙옙 占쏙옙占?占쏙옙占쏙옙 20190917 chm
            //strPath.Format(_T("%s\\%s\\%s"), m_strSaveImageUploadPath, m_strGlassID, pReviewResult->strUploadImgFileName);
            strPath.Format(_T("%s\\%s"), m_strSaveImageUploadPath, pReviewResult->strUploadImgFileName);
            nSize = SaveReviewImage(&uploadImage, strPath, m_nReviewImageSize, m_nReviewImageQuality, m_nReviewImageStep);
            m_pRP2P->IRP2P_DisplayMessage(_T("Upload Reflow Image Save Success! Size: %d byte"), nSize);
            
            //시뮬돌리고 이미지 자동으로 열어줌 20190927chm
            //�ùĵ����� �̹��� �ڵ����� ������ 20190927chm
            if(nTestMode)
            {
               CString csParam;
@@ -1683,7 +1737,7 @@
      m_pRP2P->IRP2P_DisplayMessage(_T("Upload Reflow Image Save Fail![%s]"), pReviewResult->strUploadImgFileName);
   }
   //공유메모리 업데이트
   //�����޸� ������Ʈ
   if(!UpdateMemoryReflowPlan(pReviewResult))
      m_pRP2P->IRP2P_DisplayMessage(_T("[ReflowPlan] Memory Update Fail!! DefectIdx : %d"), pReviewResult->nDefectidx2);
@@ -1896,7 +1950,7 @@
//파일명 181227 cmark
//���ϸ� 181227 cmark
BOOL CReviewProcessor_CPJT::MakeReviewImageFileName(SReviewResult* pReviewResult)
{
   if (m_pRP2P==NULL || pReviewResult==NULL) return FALSE;
@@ -1909,7 +1963,7 @@
   if(GetReviewProcessStatus() == ReviewProcessStatus_ReviewStart)
   {
      // [2017:6:5]-[WEZASW] : Review Image 파일명에 '*' 사용 금지.(예외처리)
      // [2017:6:5]-[WEZASW] : Review Image 占쏙옙占싹몌옙占?'*' 占쏙옙占?占쏙옙占쏙옙.(占쏙옙占쏙옙처占쏙옙)
      if (pReviewResult->strDefectCode.Compare(_T("***")) == 0)
         strDefectCodeTemp = _T("DC");   
      else 
@@ -2000,23 +2054,24 @@
      snapTime.GetHour(), snapTime.GetMinute(), snapTime.GetSecond());   // snap_time
   // [2017:4:10]-[WEZASW] : 고객사 요청에 의한 bmp 파일 추가 저장. (임시사용)
   // [2017:4:10]-[WEZASW] : 占쏙옙占쏙옙占?占쏙옙청占쏙옙 占쏙옙占쏙옙 bmp 占쏙옙占쏙옙 占쌩곤옙 占쏙옙占쏙옙. (占쌈시삼옙占?
   pReviewResult->strOrignalImgFileName = strFileName + _T(".bmp");
   strFileName += _T(".jpg");
   pReviewResult->strUploadImgFileName = strFileName;
   pReviewResult->strImgFileName = strFileName;
   pReviewResult->strImgFilePath = GetReviewUploadImagePath();
   return TRUE;
}
int   CReviewProcessor_CPJT::ProcessWSIReflow(int nThreadIdx, SReviewResult* pReviewResult)
{
   // [2016:11:15]-[WEZASW] : 점검 필요
   // [2016:11:15]-[WEZASW] : ���� �ʿ�
   if(!UpdateMemoryWsiReflowPlan(pReviewResult))
      m_pRP2P->IRP2P_DisplayMessage(_T("[WsiReflowPlan] Memory Update Fail!! DefectIdx : %d"), pReviewResult->nDefectidx2);
   // wsi용 return 값으로 수정 [6/20/2017 bhs]
   // wsi�� return ������ ���� [6/20/2017 bhs]
   return WsiResultSuccess;
}
@@ -2060,7 +2115,7 @@
   
   if(GetReviewProcessStatus() == ReviewProcessStatus_UserStart)
   {
      // [2017:6:5]-[WEZASW] : Review Image 파일명에 '*' 사용 금지.(예외처리)
      // [2017:6:5]-[WEZASW] : Review Image 占쏙옙占싹몌옙占?'*' 占쏙옙占?占쏙옙占쏙옙.(占쏙옙占쏙옙처占쏙옙)
      if (pReviewResult->strDefectCode.Compare(_T("***")) == 0)
         strDefectCodeTemp = _T("DC");   
      else 
@@ -2154,12 +2209,13 @@
   //       strFileName += pReviewResult->strSnapTime;
   //    }
   // [2017:4:10]-[WEZASW] : 고객사 요청에 의한 bmp 파일 추가 저장. (임시사용)
   // [2017:4:10]-[WEZASW] : 占쏙옙占쏙옙占?占쏙옙청占쏙옙 占쏙옙占쏙옙 bmp 占쏙옙占쏙옙 占쌩곤옙 占쏙옙占쏙옙. (占쌈시삼옙占?
   pReviewResult->strOrignalImgFileName = strFileName + _T(".bmp");
   strFileName += _T(".jpg");
   pReviewResult->strUploadImgFileName = strFileName;
   pReviewResult->strImgFileName = strFileName;
   pReviewResult->strImgFilePath = GetReviewUploadImagePath();
   return TRUE;
}
@@ -2230,13 +2286,13 @@
void CReviewProcessor_CPJT::LoadAoiImage(const CString& strGlassID, int nOpticType, int nPosX, int nPosY, CCHImageData* pAoiDark, CCHImageData *pAoiBright)
{
   // 3. 검사 결함 이미지 찾기
   // 3. �˻� ���� �̹��� ã��
   CString strAoiDarkPath = _T("");
   CString strAoiBrightPath = _T("");
   FindAoiDefectImagePath(strGlassID, nOpticType, nPosX, nPosY, strAoiDarkPath, strAoiBrightPath);
   // Dark, Bright 모두 찾기 위해 주석처리 [2017.7.1 bhs]
   // Dark, Bright 占쏙옙占?찾占쏙옙 占쏙옙占쏙옙 占쌍쇽옙처占쏙옙 [2017.7.1 bhs]
   // Dark image
   //if(nOpticType & DEFECT_OPTIC_DARK)
   {
@@ -2281,7 +2337,7 @@
   CFileFind finder;
   CString strSearchPath = _T("");
   // Dark, Bright 모두 찾기 위해 주석처리 [2017.7.1 bhs]
   // Dark, Bright 占쏙옙占?찾占쏙옙 占쏙옙占쏙옙 占쌍쇽옙처占쏙옙 [2017.7.1 bhs]
   //if (nOpticType & DEFECT_OPTIC_DARK)
   {
      // Dark field
@@ -2355,7 +2411,7 @@
         processTimer.End();
      }
      // 4-3. 리뷰평균 밝기
      // 4-3. 占쏙옙占쏙옙占쏙옙占?占쏙옙占?
      double dAverageGray = 0.0;
      if (CCHImageProcess::ImageAverage(&bandImage, dAverageGray)==1)
      {
@@ -2392,14 +2448,14 @@
   CCHImageData pReviewCam;
   CCHImageData tempImage1;
   
   // 설정값 이미지 회전
   // ������ �̹��� ȸ��
   if (m_nImageRotate > 0)
   {
      tempImage1.CopyImageFrom(pReviewCamSource);
      CCHImageProcess::ImageRotate(pReviewCamSource, &tempImage1, (90.0*m_nImageRotate));
   }
   // 설정값 이미지 반전
   // ������ �̹��� ����
   if (m_nimageFlip > 0)
   {
      if(m_nImageRotate > 0)
@@ -2436,7 +2492,7 @@
   // set total size * scale
   int nTotalWidth      = int(m_nReviewResizeWidth * m_dReviewImageScale + 0.5);
   // 20170817 smok Dark, Bright 이미지가 리뷰 이미지 아래에 붙도록 수정
   // 20170817 smok Dark, Bright �̹����� ���� �̹��� �Ʒ��� �ٵ��� ����
   int nTotalHeight   = int(m_nReviewResizeHeight * m_dReviewImageScale + 0.5 + max(pAoiDark2.GetHeight(), pAoiBright2.GetHeight()));
   int nTotalHeight2   = int(m_nReviewResizeHeight * m_dReviewImageScale + 0.5);
@@ -2462,14 +2518,14 @@
   double dRulerGab = 20.0 / m_dReviewImageScale;
   double dScaleResolution = pReviewResult->dMeasureResolution / m_dReviewImageScale;
   //DrawRuler(&memDC, nTotalWidth, nTotalHeight2, dScaleResolution, dRulerGab); // resolution, ruler gab //taek 210127 사용 X
   //DrawRuler(&memDC, nTotalWidth, nTotalHeight2, dScaleResolution, dRulerGab); // resolution, ruler gab //taek 210127 占쏙옙占?X
   // draw text string
   DrawDefectInfo(&memDC, findResult, pReviewResult);
   
   //DrawAoiImage(&memDC, &pAoiDark2, &pAoiBright2, &pAoiDark2, &pAoiBright2, nAoiWidth, nAoiHeight);
   // draw line 히팅 검증용
   // draw line ���� ������
   //DrawCenterLine(&memDC, nTotalWidth, nTotalHeight);
   // DrawCenterRect(&memDC, nTotalWidth, nTotalHeight, 100, 100, pReviewResult->dMeasureResolution);
@@ -2497,7 +2553,7 @@
   nWidthDark = nHeightDark = nWidthBright = nHeightBright = 0;
   // 20170817 smok Dark, Bright 이미지가 리뷰 이미지 아래에 붙도록 수정
   // 20170817 smok Dark, Bright �̹����� ���� �̹��� �Ʒ��� �ٵ��� ����
   // dark
   CCHImageData subImage;
   if(pAoiDark!=NULL && pAoiDark->GetImageExist())
@@ -2578,11 +2634,11 @@
   int nTotalWidth      = int(m_nReviewResizeWidth * m_dReviewImageScale + 0.5);
   int nTotalHeight   = int(m_nReviewResizeHeight * m_dReviewImageScale + 0.5);
   // Dark, Bright 이미지가 나란히 붙도록 수정, Dark 위, Bright 아래 - 고객사 요청[2017.6.30 bhs]
   // Dark, Bright 占싱뱄옙占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쌕듸옙占쏙옙 占쏙옙占쏙옙, Dark 占쏙옙, Bright 占싣뤄옙 - 占쏙옙占쏙옙占?占쏙옙청[2017.6.30 bhs]
   //int nX = nTotalWidth - nWidth;
   //int nY = nTotalHeight - (nHeight * 2);
   // 20170817 smok Dark, Bright 이미지가 리뷰 이미지 아래에 붙도록 수정
   // 20170817 smok Dark, Bright �̹����� ���� �̹��� �Ʒ��� �ٵ��� ����
   int nX = 0;
   int nY = nTotalHeight;
   pAoiDark1->ShowImage(pDC->m_hDC, nX, nY, pAoiDark1->GetWidth(), pAoiDark1->GetHeight(), 0, 0);
@@ -2590,7 +2646,7 @@
   //pAoiDark1->ShowImage(pDC->m_hDC,   nTotalWidth - nWidth,   nTotalHei4ght-nHeight,   pAoiDark1->GetWidth(), pAoiDark1->GetHeight(), 0, 0);
   //pAoiBright1->ShowImage(pDC->m_hDC,   nTotalWidth - nWidth,   nTotalHeight-nHeight,   pAoiBright1->GetWidth(), pAoiBright1->GetHeight(), 0, 0);
   // 검사 이미지 중앙에 화살표 표시 - 고객사 요청 [2017.6.30 bhs]
   // 占싯삼옙 占싱뱄옙占쏙옙 占쌩앙울옙 화占쏙옙표 표占쏙옙 - 占쏙옙占쏙옙占?占쏙옙청 [2017.6.30 bhs]
   CFont Font;
   VERIFY(Font.CreateFont(
      50,                        // nHeight
@@ -2611,7 +2667,7 @@
   CFont *pOldFont = pDC->SelectObject(&Font);
   pDC->SetTextColor(RGB(255,0,0));
   CString strArrow = _T("↗");
   CString strArrow = _T("��");
   CSize size = pDC->GetTextExtent(strArrow);
   int nCenterX = nX + (nWidth / 2) - size.cx;
   int nCenterY = nY + (nHeight / 2)/* + (size.cy / 2)*/;
@@ -2814,7 +2870,7 @@
   else {
      wchar_t  pstrPrefix[128] ={};
      //Zone 넘버 210127
      //Zone �ѹ� 210127
      int nValue = 0;
      for (int i = 15; i >= 0; i--)
      {
@@ -2825,8 +2881,8 @@
      }
      //taek 210127
      //결과파일 좌표값 y 는 *-1을 하자
      //설비 ID, 검사 카메라 정보, 검사 Camera 정보 : (? ) 캠 ?, Cell ID,   Review Cam 정보 : Gantry 정보,   검출 Size,   검출 Zone 정보,   Stak Flag, CODE 정보, 좌표 정보
      //占쏙옙占쏙옙占쏙옙占?占쏙옙표占쏙옙 y 占쏙옙 *-1占쏙옙 占쏙옙占쏙옙
      //���� ID, �˻� ī�޶� ����, �˻� Camera ���� : (? ) ķ ?, Cell ID,   Review Cam ���� : Gantry ����,   ���� Size,   ���� Zone ����,   Stak Flag, CODE ����, ��ǥ ����
      
      // PPID
//       strValue.Format(_T("Tool[%s].Recipe[%s].ScanNo[%d/%d].Time[%4d/%2d/%2d_%d:%d:%d].MaxGray[%d].RefGray[%d].REVCnt[%d]"),pReviewResult->strEquipID,pGlassResult->m_strPPID,pReviewResult->nAOIScanIdx,0,snapTime.GetYear(), snapTime.GetMonth(), snapTime.GetDay(),
@@ -3041,7 +3097,7 @@
   if(GetReviewProcessStatus() == ReviewProcessStatus_ReflowStart)
   {
      // [2017:6:5]-[WEZASW] : Review Image 파일명에 '*' 사용 금지.(예외처리)
      // [2017:6:5]-[WEZASW] : Review Image 占쏙옙占싹몌옙占?'*' 占쏙옙占?占쏙옙占쏙옙.(占쏙옙占쏙옙처占쏙옙)
      if (pReviewResult->strDefectCode.Compare(_T("***")) == 0)
         strDefectCodeTemp = _T("DC");   
      else 
@@ -3118,7 +3174,7 @@
   //       strFileName += pReviewResult->strSnapTime;
   //    }
   // [2017:4:10]-[WEZASW] : 고객사 요청에 의한 bmp 파일 추가 저장. (임시사용)
   // [2017:4:10]-[WEZASW] : 占쏙옙占쏙옙占?占쏙옙청占쏙옙 占쏙옙占쏙옙 bmp 占쏙옙占쏙옙 占쌩곤옙 占쏙옙占쏙옙. (占쌈시삼옙占?
   pReviewResult->strOrignalImgFileName = strFileName + _T(".bmp");
   strFileName += _T(".jpg");
@@ -3164,7 +3220,7 @@
   int nStartResultIdx   = pReviewResult->GetStartSReviewResultIndex();
   int nEndResultIdx   = pReviewResult->GetEndSReviewResultIndex();
   // 인덱스가 현재 마지막 인덱스 보다 클시..
   // �ε����� ���� ������ �ε��� ���� Ŭ��..
   if (nCurResultIdx > nEndResultIdx)  
   {
      LeaveCriticalSection(&m_csUserCriticalSection);
@@ -3172,7 +3228,7 @@
      g_pLog->DisplayMessage(_T("[ReviewProcessor]SetWsiResultData module[%d] point[%d] result[%d]"), nModuleIndex, measureResut.nResultIndex, nCurResultIdx);
   }
   // 현재 결과데이터 저장
   // 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙
   wsiResult.nWsi_ResultCode      = measureResut.nResultCode;
   wsiResult.dWsi_DamDistance      = measureResut.dDamDistance;
@@ -3182,7 +3238,7 @@
   }
   //memcpy(wsiResult.nWsi_pReflowResultData, measureResut.pReflowResultData, sizeof(wsiResult.nWsi_pReflowResultData));
   
   // 결과 데이터 추가
   // 占쏙옙占?占쏙옙占쏙옙占쏙옙 占쌩곤옙
   SReviewResult *pProcessResult = NULL;
   if (pGlassResult->SetWsiReflowResultData(nModuleIndex, nCurResultIdx, wsiResult, nGlassPosX, nGlassPosY, nMotorPosX, nMotorPosY, dTime))
   {
@@ -3191,10 +3247,10 @@
      pProcessResult = pReviewResult->GetSReviewResult(nCurResultIdx);
   }
   // 저장 성공시, 리뷰 프로세서에 포인터 전달
   // ���� ������, ���� ���μ����� ������ ����
   if (pProcessResult)
   {
      // 처리 쓰레드 수행
      // ó�� ������ ����
      if (AddReviewProcessData(pProcessResult)==1)
      {
         g_pLog->DisplayMessage(_T("[ReviewProcessor]Add Wsi Reflow Process Data module[%d] result[%d]"), nModuleIndex, nCurResultIdx);
@@ -3210,7 +3266,7 @@
   LeaveCriticalSection(&m_csUserCriticalSection);
   // 결과 갱신.
   // 占쏙옙占?占쏙옙占쏙옙.
   m_pRP2P->IRP2P_UpdateReviewResult(nModuleIndex, pGlassResult, 5);
   return;
@@ -3219,7 +3275,7 @@
   return;
}
//0129cmark 원점 위치별 센터 좌표를 원점 좌표로 변형
//0129cmark ���� ��ġ�� ���� ��ǥ�� ���� ��ǥ�� ����
double CReviewProcessor_CPJT::GetCentertoOrginCoordinate(double dPosX,double dPosY,int nCornercut,int nOriginDirection){
   double nResultPosX=0.0;
@@ -3228,60 +3284,60 @@
   // CornerCutDirection   { CLeftTop=0, CRightTop, CLeftBottom,   CRightBottom };
   // OriginDirection   { OLeftTop=0, ORightTop, OLeftBottom,   ORightBottom };
   if(nOriginDirection==RPOLeftTop){//오리진좌상
   if(nOriginDirection==RPOLeftTop){//�������»�
      if(nCornercut == RPCLeftTop)//좌상
      if(nCornercut == RPCLeftTop)//�»�
      { 
         nResultPosX = double(GLASS_SIZE_WIDTH)/2. - dPosX;
         nResultPosY = double(GLASS_SIZE_HEIGHT)/2. - dPosY;
      }
      else if(nCornercut == RPCRightTop)//우상
      else if(nCornercut == RPCRightTop)//占쏙옙占?
      {
         nResultPosX = double(GLASS_SIZE_WIDTH)/2. - dPosX;
         nResultPosY = double(GLASS_SIZE_HEIGHT)/2. + dPosY;
      }
      else if(nCornercut == RPCLeftBottom)//좌하
      else if(nCornercut == RPCLeftBottom)//����
      {
         nResultPosX = double(GLASS_SIZE_WIDTH)/2. + dPosX;
         nResultPosY = double(GLASS_SIZE_HEIGHT)/2. - dPosY;
      }
      else if(nCornercut == RPCRightBottom)//우하
      else if(nCornercut == RPCRightBottom)//����
      {
         nResultPosX = double(GLASS_SIZE_WIDTH)/2 + dPosX;
         nResultPosY = double(GLASS_SIZE_HEIGHT)/2 + dPosY;
      }
   }
   else if(nOriginDirection==RPORightTop){//오리진우상
   else if(nOriginDirection==RPORightTop){//占쏙옙占쏙옙占쏙옙占쏙옙占?
      if(nCornercut == RPCLeftTop)//좌상
      if(nCornercut == RPCLeftTop)//�»�
      { 
         nResultPosX = double(GLASS_SIZE_WIDTH)/2. - dPosX;
         nResultPosY = double(GLASS_SIZE_HEIGHT)/2. + dPosY;
      }
      else if(nCornercut == RPCRightTop)//우상
      else if(nCornercut == RPCRightTop)//占쏙옙占?
      {
         nResultPosX = double(GLASS_SIZE_WIDTH)/2. - dPosX;
         nResultPosY = double(GLASS_SIZE_HEIGHT)/2. - dPosY;
      }
      else if(nCornercut == RPCLeftBottom)//좌하
      else if(nCornercut == RPCLeftBottom)//����
      {
         nResultPosX = double(GLASS_SIZE_WIDTH)/2. + dPosX;
         nResultPosY = double(GLASS_SIZE_HEIGHT)/2. + dPosY;
      }
      else if(nCornercut == RPCRightBottom)//우하
      else if(nCornercut == RPCRightBottom)//����
      {
         nResultPosX = double(GLASS_SIZE_WIDTH)/2. + dPosX;
         nResultPosY = double(GLASS_SIZE_HEIGHT)/2. - dPosY;
      }
   }
   else if(nOriginDirection==RPOLeftBottom){//오리진좌하
   else if(nOriginDirection==RPOLeftBottom){//����������
      if(nCornercut == RPCLeftTop)//좌상
      if(nCornercut == RPCLeftTop)//�»�
      { 
         //210402
      /*   nResultPosX = double(GLASS_SIZE_WIDTH)/2. + dPosX;
@@ -3290,13 +3346,13 @@
         nResultPosX = double(GLASS_SIZE_WIDTH) / 2. + dPosX;
         nResultPosY = double(GLASS_SIZE_HEIGHT) / 2. + dPosY;
      }
      else if(nCornercut == RPCRightTop)//우상
      else if(nCornercut == RPCRightTop)//占쏙옙占?
      {
         nResultPosX = double(GLASS_SIZE_WIDTH)/2. + dPosX;
         nResultPosY = double(GLASS_SIZE_HEIGHT)/2. + dPosY;
      }
      else if(nCornercut == RPCLeftBottom)//좌하
      else if(nCornercut == RPCLeftBottom)//����
      {
         //210402
         /*nResultPosX = double(GLASS_SIZE_WIDTH)/2. - dPosX;
@@ -3304,33 +3360,33 @@
         nResultPosX = double(GLASS_SIZE_WIDTH) / 2. + dPosX;
         nResultPosY = double(GLASS_SIZE_HEIGHT) / 2. + dPosY;
      }
      else if(nCornercut == RPCRightBottom)//우하
      else if(nCornercut == RPCRightBottom)//����
      {
         nResultPosX = double(GLASS_SIZE_WIDTH) / 2. - dPosX;
         nResultPosY = double(GLASS_SIZE_HEIGHT) / 2. + dPosY;
      }
   }
   else if (nOriginDirection==RPORightBottom)
   {//오리진우하
   {//����������
      if(nCornercut == RPCLeftTop)//좌상
      if(nCornercut == RPCLeftTop)//�»�
      { 
         nResultPosX = double(GLASS_SIZE_WIDTH)/2. + dPosX;
         nResultPosY = double(GLASS_SIZE_HEIGHT)/2. + dPosY;
      }
      else if(nCornercut == RPCRightTop)//우상
      else if(nCornercut == RPCRightTop)//占쏙옙占?
      {
         nResultPosX = double(GLASS_SIZE_WIDTH)/2. + dPosX;
         nResultPosY = double(GLASS_SIZE_HEIGHT)/2. - dPosY;
      }
      else if(nCornercut == RPCLeftBottom)//좌하
      else if(nCornercut == RPCLeftBottom)//����
      {
         nResultPosX = double(GLASS_SIZE_WIDTH)/2. - dPosX;
         nResultPosY = double(GLASS_SIZE_HEIGHT)/2. + dPosY;
      }
      else if(nCornercut == RPCRightBottom)//우하
      else if(nCornercut == RPCRightBottom)//����
      {
         nResultPosX = double(GLASS_SIZE_WIDTH)/2. - dPosX;
         nResultPosY = double(GLASS_SIZE_HEIGHT)/2. - dPosY;
@@ -3355,7 +3411,7 @@
   CString strFileName = _T("");
   CString strDefectCodeTemp = _T("");
   // [2017:6:5]-[WEZASW] : Review Image 파일명에 '*' 사용 금지.(예외처리)
   // [2017:6:5]-[WEZASW] : Review Image 占쏙옙占싹몌옙占?'*' 占쏙옙占?占쏙옙占쏙옙.(占쏙옙占쏙옙처占쏙옙)
   if (pReviewResult->strDefectCode.Compare(_T("***")) == 0)
      strDefectCodeTemp = _T("DC");   
   else 
@@ -3419,24 +3475,31 @@
{
   if(pReviewResult == NULL)   return FALSE;
   //결과파일 공유 메모리 리뷰 이미지 이름 및 좌표 채워주기
   //占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙 占쌨몌옙 占쏙옙占쏙옙 占싱뱄옙占쏙옙 占싱몌옙 占쏙옙 占쏙옙표 채占쏙옙占쌍깍옙
   CDitGlassRawClient *pDitGlassRawCleint = CDitGlassRawClient::GetInstance();
   if(pDitGlassRawCleint->isConnect() == TRUE)
   {
      
      _grmDefectData* pSharedDefect = pDitGlassRawCleint->GetDefectData(pReviewResult->nDefectidx2);
      _grmDefectReviewData * pSharedDefectReview = &pSharedDefect->m_ReviewDefect;
      _grmGlassData* pSharedGlassData = pDitGlassRawCleint->GetGlassData();
      
      //size_t CharactersConverted;
      //wcstombs_s(&CharactersConverted, pSharedDefectReview->m_strRevImageName, pReviewResult->strImgFileName, _TRUNCATE);
      strcpy(pSharedDefectReview->m_strRevImageName,pReviewResult->strImgFileName.MakeLower());
      
      //taek 210624 ���� ���� �� ���ش�.
      pSharedDefectReview->m_nPlanType =  ditRaw::RPT_Review;   //0:None, 1:Location(User, Fiexed) Review, 4:reflower, ??:Wsi, 1000:AOI(외부 로컬 리뷰 명령)
      strcpy(pSharedDefectReview->m_strRevImagePath,pReviewResult->strImgFilePath.MakeLower());
      strcpy(pSharedGlassData->m_strAlignFirst, m_strReviewFirst.MakeLower());
      strcpy(pSharedGlassData->m_strAlignSecond, m_strReviewSecned.MakeLower());
      pSharedDefectReview->m_nPlanType =  ditRaw::RPT_Review;   //0:None, 1:Location(User, Fiexed) Review, 4:reflower, ??:Wsi, 1000:AOI(占쌤븝옙 占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占?
      pSharedDefectReview->m_nResultCode = 1;  //0:None, 1:Success
      pSharedDefectReview->m_nShotIndex = pReviewResult->nResultIdx; 
      //pSharedDefectReview->m_nShotIndex = GetPlanReviewCount(); //RTMS 기준에 따라 통합 관리면 요거 아니면 나눠서 하는 걸로 taek 210128
      //pSharedDefectReview->m_nShotIndex = GetPlanReviewCount(); //RTMS 占쏙옙占쌔울옙 占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙占?占싣니몌옙 占쏙옙占쏙옙占쏙옙 占싹댐옙 占심뤄옙 taek 210128
      pSharedDefectReview->m_nModuleIndex = pReviewResult->nModuleIdx;
      pSharedDefectReview->m_nMagnificIndex = 20;
      pSharedDefectReview->m_fManification =pReviewResult->dMagnification;
@@ -3450,11 +3513,11 @@
BOOL CReviewProcessor_CPJT::UpdateMemoryUserPlan( SReviewResult* pReviewResult )
{
   //결과파일 공유 메모리 리뷰 이미지 이름 및 좌표 채워주기
   //占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙 占쌨몌옙 占쏙옙占쏙옙 占싱뱄옙占쏙옙 占싱몌옙 占쏙옙 占쏙옙표 채占쏙옙占쌍깍옙
   CDitGlassRawClient *pDitRawClient = CDitGlassRawClient::GetInstance();
   if(pDitRawClient->isConnect() == TRUE)
   {
      int nDefectCount = pDitRawClient->GetGlassData()->m_nDefectNum; // user,reflow 는 검사 디펙 이후 생성되기에 디펙 카운트보다 같거나 큰값을 가지고 있다
      int nDefectCount = pDitRawClient->GetGlassData()->m_nDefectNum; // user,reflow �� �˻� ���� ���� �����DZ⿡ ���� ī��Ʈ���� ���ų� ū���� ������ �ִ�
      if(pReviewResult->nDefectIdx <nDefectCount)
      {   
         return FALSE;
@@ -3467,14 +3530,16 @@
      
      strcpy(pSharedDefectReview->m_strRevImageName,pReviewResult->strImgFileName);
   
      pSharedDefectReview->m_nPlanType = ditRaw::RPT_User;   //0:None, 1:Location(User, Fiexed) Review, 4:reflower, ??:Wsi, 1000:AOI(외부 로컬 리뷰 명령)
      pSharedDefectReview->m_nPlanType = ditRaw::RPT_User;   //0:None, 1:Location(User, Fiexed) Review, 4:reflower, ??:Wsi, 1000:AOI(占쌤븝옙 占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占?
      pSharedDefectReview->m_nResultCode = 1;  //0:None, 1:Success
      pSharedDefectReview->m_nShotIndex = pReviewResult->nResultIdx; 
      pSharedDefect->m_nShotIdx = pReviewResult->nResultIdx;
      pSharedDefectReview->m_nModuleIndex;
      pSharedDefect->m_nModelIdx = pReviewResult->nModuleIdx;
      pSharedDefectReview->m_nMagnificIndex = pReviewResult->dMagnification;
      pSharedDefectReview->m_fManification = pReviewResult->dMagnification;
      pSharedDefectReview->m_fManificResoultion = pReviewResult->dMagnification;
         m_pRP2P->IRP2P_DisplayMessage(_T("[공유메모리접근]인덱스[%d]파일명[%s]"),pReviewResult->nDefectidx2, pReviewResult->strUploadImgFileName);
         m_pRP2P->IRP2P_DisplayMessage(_T("[�����޸�����]�ε���[%d]���ϸ�[%s]"),pReviewResult->nDefectidx2, pReviewResult->strUploadImgFileName);
   }
@@ -3484,7 +3549,7 @@
BOOL CReviewProcessor_CPJT::UpdateMemoryReflowPlan( SReviewResult* pReviewResult )
{
   if(pReviewResult == NULL)   return FALSE;
   //결과파일 공유 메모리에 결과 채워 넣기
   //占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙 占쌨모리울옙 占쏙옙占?채占쏙옙 占쌍깍옙
   CDitGlassRawClient *pDitRawClient = CDitGlassRawClient::GetInstance();
   //int nEqpID = m_pSP2P->ISP2P_System_GetSystemInfo()->m_nMachineType;
   CString strCellID = _T("");
@@ -3506,7 +3571,7 @@
            nReflowjuge=1;
         }
         // 고객사 요청으로 수정함. 0,1 Position은 Pass
         // 占쏙옙占쏙옙占?占쏙옙청占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙. 0,1 Position占쏙옙 Pass
         else if(nReflowjuge == 3 || nReflowjuge == 2)
         {
            m_pRP2P->IRP2P_DisplayMessage(_T("[ReflowResult] Reflow Judge Is No OverFlow %d"),nReflowjuge);
@@ -3525,7 +3590,7 @@
            nReflowjuge=0;
         }
         
         //0:None, // 검출한 Line의 개수. 3 미만 : DAM2 Reflow 판정, 4~5 : DAM1 Reflow 판정, 6 : no Reflow 판정 / -1 : image not loaded, -2 : roi setting error, -3 : roi length error, -5 : select wrong side
         //0:None, // ������ Line�� ����. 3 �̸� : DAM2 Reflow ����, 4~5 : DAM1 Reflow ����, 6 : no Reflow ���� / -1 : image not loaded, -2 : roi setting error, -3 : roi length error, -5 : select wrong side
         if(pReviewResult->nReflow_CellIndex > 7)
         {
            pReviewResult->nReflow_CellIndex = 0;
@@ -3542,7 +3607,7 @@
   if(pDitRawClient->isConnect() == TRUE)
   {
      int nDefectCount = pDitRawClient->GetGlassData()->m_nDefectNum; // user,reflow 는 검사 디펙 이후 생성되기에 디펙 카운트보다 같거나 큰값을 가지고 있다
      int nDefectCount = pDitRawClient->GetGlassData()->m_nDefectNum; // user,reflow �� �˻� ���� ���� �����DZ⿡ ���� ī��Ʈ���� ���ų� ū���� ������ �ִ�
      if(pReviewResult->nDefectidx2 <nDefectCount)
      {
         return FALSE;
@@ -3557,11 +3622,11 @@
      pSharedDefectReview->m_nPlanType =  ditRaw::RTP_Reflow;         
      pSharedDefectReview->m_nReflow_ResultCode = pReviewResult->nReflow_Result;// pReviewResult->nReflow_Result;  
      //0:None, // 검출한 Line의 개수. 3 미만 : DAM2 Reflow 판정, 4~5 : DAM1 Reflow 판정, 6 : no Reflow 판정 / -1 : image not loaded, -2 : roi setting error, -3 : roi length error, -5 : select wrong side
      //0:None, // ������ Line�� ����. 3 �̸� : DAM2 Reflow ����, 4~5 : DAM1 Reflow ����, 6 : no Reflow ���� / -1 : image not loaded, -2 : roi setting error, -3 : roi length error, -5 : select wrong side
      //pSharedDefectReview->m_fReflow_LinePosData;   
      pSharedDefectReview->m_nReflow_Side = pReviewResult->nReflow_Side;
      pSharedDefectReview->m_nReflow_InspectionMode = 0;
      m_pRP2P->IRP2P_DisplayMessage(_T("[공유메모리접근]인덱스[%d]파일명[%s]"),pReviewResult->nDefectidx2, pReviewResult->strUploadImgFileName);
      m_pRP2P->IRP2P_DisplayMessage(_T("[�����޸�����]�ε���[%d]���ϸ�[%s]"),pReviewResult->nDefectidx2, pReviewResult->strUploadImgFileName);
   }
   
   return TRUE;
@@ -3571,7 +3636,7 @@
{
   if(pReviewResult == NULL)   return FALSE;
   //결과파일 공유 메모리에 결과 채워 넣기
   //占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙 占쌨모리울옙 占쏙옙占?채占쏙옙 占쌍깍옙
   CDitGlassRawClient *pDitGlassRawClient = CDitGlassRawClient::GetInstance();
   if(pDitGlassRawClient->isConnect() == TRUE)
@@ -3588,7 +3653,7 @@
      pSharedDefectReview->m_nPlanType =  ditRaw::RTP_WSI;         
      pSharedDefectReview->m_nWsi_ResultCode=pReviewResult->nWsi_ResultCode; //0:None, 1:Success
      pSharedDefectReview->m_nWsi_Type = 2;/* nWSIType;                           // 함몰 / 돌기 //wsi 진행 */
      pSharedDefectReview->m_nWsi_Type = 2;/* nWSIType;                           // �Ը� / ���� //wsi ���� */
      pSharedDefectReview->m_fWsi_ResultData[0]= pReviewResult->nWsi_DefectType; // 0:normal 1:metal 2:huge 3:diffuse 4:trashy
      pSharedDefectReview->m_fWsi_ResultData[1]=(float)(nWSIheight/1000.0); 
      pSharedDefectReview->m_fWsi_ResultData[2]=(float)(nWSIWidth/1000.0);         // 0:Type, 1:Height, 2:Width
@@ -3598,7 +3663,7 @@
      pSharedDefectReview->m_fWsi_ResultData[6] = pReviewResult->dBZoneHeight;
      pSharedDefectReview->m_strWsi_2DImageFilename;
      pSharedDefectReview->m_strWsi_3DImageFilename;
      pSharedDefectReview->m_fWsiManification = 20;//20배 고정
      pSharedDefectReview->m_fWsiManification = 20;//20�� ����
      pSharedDefectReview->m_dWsiMmMotorX=pReviewResult->dTargetMotorX;
      pSharedDefectReview->m_dWsiMmMotorY=pReviewResult->dTargetMotorY;
      
@@ -3613,7 +3678,7 @@
BOOL CReviewProcessor_CPJT::UpdateMemoryWsiReflowPlan( SReviewResult* pReviewResult )
{
   if(pReviewResult == NULL)   return FALSE;
   //결과파일 공유 메모리에 결과 채워 넣기
   //占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙 占쌨모리울옙 占쏙옙占?채占쏙옙 占쌍깍옙
   CDitGlassRawClient *pDitRawClient = CDitGlassRawClient::GetInstance();
   
@@ -3627,13 +3692,13 @@
   /*
   pPacket->GetInt(0)         = Index
   pPacket->GetInt(1)         = Wsi 측정 결과
   pPacket->GetInt(2)         = A존 판정 결과 (1 성공 0 실패)
   pPacket->GetInt(3)          = B존 판정 결과
   pPacket->GetInt(4)          = C존 판정 결과
   pPacket->GetInt(5)          = D존 판정 결과
   pPacket->GetInt(6)          = Review에서 보내줬던 PointIndex
   pPacket->GetDouble(0)       = 댐에서 Monomo까지의 거리
   pPacket->GetInt(1)         = Wsi 占쏙옙占쏙옙 占쏙옙占?
   pPacket->GetInt(2)         = A占쏙옙 占쏙옙占쏙옙 占쏙옙占?(1 占쏙옙占쏙옙 0 占쏙옙占쏙옙)
   pPacket->GetInt(3)          = B占쏙옙 占쏙옙占쏙옙 占쏙옙占?
   pPacket->GetInt(4)          = C占쏙옙 占쏙옙占쏙옙 占쏙옙占?
   pPacket->GetInt(5)          = D占쏙옙 占쏙옙占쏙옙 占쏙옙占?
   pPacket->GetInt(6)          = Review占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占?PointIndex
   pPacket->GetDouble(0)       = �£�� Monomo������ �Ÿ�
   */
   
//    int nReflowjuge=0;
@@ -3644,7 +3709,7 @@
   
   nWsiReflowJudge  = pReviewResult->nWsi_ResultCode;
   //nWsiReflowResult += pReviewResult->nWsi_pReflowResultData[0] //A 1차 신경안씀
   //nWsiReflowResult += pReviewResult->nWsi_pReflowResultData[0] //A 1占쏙옙 占신곤옙횡占?
   nWsiReflowResult += pReviewResult->nWsi_pReflowResultData[1];//B
   nWsiReflowResult += pReviewResult->nWsi_pReflowResultData[2];//C
   //nWsiReflowResult += pReviewResult->nWsi_pReflowResultData[3];//D
@@ -3704,7 +3769,7 @@
{
   if(pReviewResult == NULL)   return FALSE;
   //결과파일 공유 메모리에 결과 채워 넣기
   //占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙 占쌨모리울옙 占쏙옙占?채占쏙옙 占쌍깍옙
   CDitGlassRawClient *pDitGlassRawClient = CDitGlassRawClient::GetInstance();
   if(pDitGlassRawClient->isConnect() == TRUE)
@@ -3721,13 +3786,13 @@
      pSharedDefectReview->m_nPlanType =  ditRaw::RTP_UserWsi;         
      pSharedDefectReview->m_nWsi_ResultCode=pReviewResult->nWsi_ResultCode; //0:None, 1:Success
      pSharedDefectReview->m_nWsi_Type=nWSIType;                           // 함몰 / 돌기
      pSharedDefectReview->m_nWsi_Type=nWSIType;                           // �Ը� / ����
      pSharedDefectReview->m_fWsi_ResultData[0]= nWSIType;
      pSharedDefectReview->m_fWsi_ResultData[1]=(float)(nWSIheight/100.0);
      pSharedDefectReview->m_fWsi_ResultData[2]=(float)(nWSIWidth/100.0);         // 0:Type, 1:Height, 2:Width
      pSharedDefectReview->m_strWsi_2DImageFilename;
      pSharedDefectReview->m_strWsi_3DImageFilename;
      pSharedDefectReview->m_fWsiManification = 20;//20배 고정
      pSharedDefectReview->m_fWsiManification = 20;//20�� ����
      pSharedDefectReview->m_dWsiMmMotorX=pReviewResult->dTargetMotorX;
      pSharedDefectReview->m_dWsiMmMotorY=pReviewResult->dTargetMotorY;
   }
@@ -3739,7 +3804,7 @@
{
   if (pReviewResult == NULL)   return FALSE;
   //결과파일 공유 메모리에 결과 채워 넣기
   //占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙 占쌨모리울옙 占쏙옙占?채占쏙옙 占쌍깍옙
   CDitGlassRawClient *pDitGlassRawClient = CDitGlassRawClient::GetInstance();
   if (pDitGlassRawClient->isConnect() == TRUE)
@@ -3756,13 +3821,13 @@
      pSharedDefectReview->m_nPlanType = ditRaw::RTP_WSI;
      pSharedDefectReview->m_nWsi_ResultCode = pReviewResult->nWsi_ResultCode; //0:None, 1:Success
      pSharedDefectReview->m_nWsi_Type = nWSIType;                           // 함몰 / 돌기
      pSharedDefectReview->m_nWsi_Type = nWSIType;                           // �Ը� / ����
      pSharedDefectReview->m_fWsi_ResultData[0] = nWSIType;
      pSharedDefectReview->m_fWsi_ResultData[1] = (float)(nWSIheight / 100.0);
      pSharedDefectReview->m_fWsi_ResultData[2] = (float)(nWSIWidth / 100.0);         // 0:Type, 1:Height, 2:Width
      pSharedDefectReview->m_strWsi_2DImageFilename;
      pSharedDefectReview->m_strWsi_3DImageFilename;
      pSharedDefectReview->m_fWsiManification = 20;//20배 고정
      pSharedDefectReview->m_fWsiManification = 20;//20�� ����
      pSharedDefectReview->m_dWsiMmMotorX = pReviewResult->dTargetMotorX;
      pSharedDefectReview->m_dWsiMmMotorY = pReviewResult->dTargetMotorY;
@@ -3793,7 +3858,7 @@
   double TempValue = 0;
   double m_nResultFocusValue = 0;
   // 원점 XY 기준 X+1, Y+1에 대한 차영상
   // ���� XY ���� X+1, Y+1�� ���� ������
   for (int y = 0; y < nHeight - 1; y++)
   {
      for (int x = 0; x < nWidth - 1; x++)