SDC C-Project CF Review 프로그램
LYW
2021-07-09 527c18879378e6f98d32d36308a2c55e870912b4
ReviewSystem/ReviewSystem/SequenceProcessor_CPJT.cpp
@@ -51,7 +51,7 @@
#define AOIRAWBIN_NETWORK_DRIVE_PATH   "Y:\\RawBin"
enum CPJT_MeasureMode { CPJT_ModeAuto = 0, CPJT_ModeManual };
// [2017:4:18]-[WEZASW] : WSI Module ���� ������ ��� PlanType ��ȣ ����.
// [2017:4:18]-[WEZASW] : WSI Module 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙占?PlanType 占쏙옙호 占쏙옙占쏙옙.
enum CPJT_PlanType { CPJT_PlanReview = 0, CPJT_PlanUser, CPJT_PlanWSI, CPJT_PlanMeasure, CPJT_PlanReflow, CPJT_PlanWsiReflow, CPJT_PlanWsiUser,CPJT_PlanWsiMultiShot
};
enum CPJT_InsepectionType{REVIEW_REFLOW = 0, WSI_REFLOW, REV_WSI,WSIUSER, USER,WSIMULTISHOT};
@@ -324,7 +324,7 @@
   // set last result idx
   pWsiResult->SetLastSReviewResultIndex(nCurResultIdx);
   // ������ ����Ʈ���� �԰�, WSI ����� ���� ������...
   // 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙트占쏙옙占쏙옙 占쌉곤옙, WSI 占쏙옙占쏙옙占?占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙...
   if(nCurResultIdx==nEndResultIdx && nCurResultIdx<=pWsiResult->GetSReviewResultCount())
   {
      nStartResultIdx = nCurResultIdx + 1;
@@ -336,7 +336,7 @@
      pWsiResult->SetEndSReviewResultIndex(nEndResultIdx);
      // ������ ����Ʈ ���� ��������.
      ::Sleep(3000); // ����̴� �ʼ���. ������ ���� ����.
      ::Sleep(3000); // 占쏙옙占쏙옙甄占?占십쇽옙占쏙옙. 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙.
//      Process_RemainWsiPoint(nModuleIndex);
   }
@@ -407,7 +407,7 @@
   // set last result idx
   pWsiResult->SetLastSReviewResultIndex(nCurResultIdx);
   // ������ ����Ʈ���� �԰�, WSI ����� ���� ������...
   // 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙트占쏙옙占쏙옙 占쌉곤옙, WSI 占쏙옙占쏙옙占?占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙...
   if(nCurResultIdx==nEndResultIdx && nCurResultIdx<=pWsiResult->GetSReviewResultCount())
   {
      nStartResultIdx = nCurResultIdx + 1;
@@ -419,7 +419,7 @@
      pWsiResult->SetEndSReviewResultIndex(nEndResultIdx);
      // ������ ����Ʈ ���� ��������.
      ::Sleep(3000); // ����̴� �ʼ���. ������ ���� ����.
      ::Sleep(3000); // 占쏙옙占쏙옙甄占?占십쇽옙占쏙옙. 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙.
      //      Process_RemainWsiPoint(nModuleIndex);
   }
@@ -449,7 +449,7 @@
    CAlignResult *pAlignResult = &pGlassResult->m_AlignResult;
    CAlignRecipe *pAlignRecipe = &pGlassResult->m_AlignRecipe; 
 
    // ����� �ڵ����� ��� �����ǿ� ��������.
    // 占쏙옙占쏙옙占?占쌘듸옙占쏙옙占쏙옙 占쏙옙占?占쏙옙占쏙옙占실울옙 占쏙옙占쏙옙占쏙옙占쏙옙.
    CRsRcpAlignInfo *pRsRcpAlignInfo = m_pSP2P->ISP2P_Recipe_GetRsRcpAlignInfo();
    if (pRsRcpAlignInfo!=NULL && pRsRcpAlignInfo->m_bAutoProcess)
    {
@@ -470,18 +470,18 @@
 
    BOOL bLastAlignResult = FALSE;
    CCoordCalibrator *pCoordCalibrator = m_pSP2P->ISP2P_GetCoordCalibrator();
    // ���� ����� ���..
    // 占쏙옙占쏙옙 占쏙옙占쏙옙占?占쏙옙占?.
    if (pCoordCalibrator && pCurAlignResult->nResultCode==Align_Success)
    {
       g_pLog->DisplayMessage(_T("[AlignResult] Align Find Success!"));
 
       // ����� ��� �۶� ������ ����
       // 占쏙옙占쏙옙占?占쏙옙占?占쌜띰옙 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙
       *pAlignResult = *pCurAlignResult;
 
       pCoordCalibrator->SetFirstMarkPos(pAlignResult->dFindPositionX[0], pAlignResult->dFindPositionY[0], pAlignRecipe->dGlassPositionX[0], pAlignRecipe->dGlassPositionY[0]);
       pCoordCalibrator->SetSecondMarkPos(pAlignResult->dFindPositionX[1], pAlignResult->dFindPositionY[1], pAlignRecipe->dGlassPositionX[1], pAlignRecipe->dGlassPositionY[1]);
 
       // ���� ���
       // 占쏙옙占쏙옙 占쏙옙占?
       if(pCoordCalibrator->CalculateAlignResult() == TRUE)
       {
          sAlignResult = pCoordCalibrator->GetAlignResult();
@@ -521,7 +521,7 @@
             pMotorControl->AxisThetaManualGoEnd(dCalAngle);
             ::Sleep(100);
 
             // ����� ReProcess
             // 占쏙옙占쏙옙占?ReProcess
             if (pAlignCameraControl->AlignProcess())
             {
                g_pLog->DisplayMessage(_T("[AlignResult] Align Find Process ReStarted!"));
@@ -556,7 +556,7 @@
       //m_pView->SetAlignResult(pAlignResult->nResultCode, sAlignResult.dOriginX, sAlignResult.dOriginY, sAlignResult.dDegree);
    }
 
   // PCControl ����� ��ȣ ����.
   // PCControl 占쏙옙占쏙옙占?占쏙옙호 占쏙옙占쏙옙.
   if (bLastAlignResult) // ���� ����ΰ��...
   {   
      SendResultToSignalControl(PCControlSendData_AlignResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
@@ -690,12 +690,12 @@
      m_pSP2P->ISP2P_UpdateReviewProcessStatus(ReviewProcessStatus_None, nPlanIndex);
       
      //�����
      //占쏙옙占쏙옙占?
      AFM_SetAFMTracking(FALSE);
      return;
   }
   //190727 chm WSI ����� End üũ �� ����
   //190727 chm WSI 占쏙옙占쏙옙占?End 체크 占쏙옙 占쏙옙占쏙옙
   if(nBeforePlanIndex== CPJT_PlanWSI||nBeforePlanIndex== CPJT_PlanWsiReflow||nBeforePlanIndex== CPJT_PlanWsiUser)
   {
      if(pPlanInfo->m_nReviewType == CPJT_PlanWSI ||pPlanInfo->m_nReviewType == CPJT_PlanWsiReflow||pPlanInfo->m_nReviewType== CPJT_PlanWsiUser || pPlanInfo->m_nReviewType == CPJT_PlanWsiMultiShot)
@@ -724,13 +724,13 @@
      }
   }
   //190727 chm WSI type ������ Review �÷��� ����� ī�޶� �۶� �ۿ� ������츦 ����...
   //190727 chm WSI type 占쏙옙占쏙옙占쏙옙 Review 占시뤄옙占쏙옙 占쏙옙占쏙옙占?카占쌨띰옙 占쌜띰옙 占쌜울옙 占쏙옙占쏙옙占쏙옙痢?占쏙옙占쏙옙...
   if(nBeforePlanIndex== CPJT_PlanWSI ||nBeforePlanIndex== CPJT_PlanWsiReflow||nBeforePlanIndex== CPJT_PlanWsiUser)
   {
      if(  pPlanInfo->m_nReviewType == CPJT_PlanReview|| pPlanInfo->m_nReviewType == CPJT_PlanUser|| pPlanInfo->m_nReviewType == CPJT_PlanMeasure|| pPlanInfo->m_nReviewType == CPJT_PlanReflow)
      {
         CTotalPitchMeasure* pTotapPithMeasure = m_pSP2P->ISP2P_GetTotalPitchMeasure(); // �������! 20190730 chm ���߿� �Լ��� ����....
         CTotalPitchMeasure* pTotapPithMeasure = m_pSP2P->ISP2P_GetTotalPitchMeasure(); // 占쏙옙占쏙옙占쏙옙占? 20190730 chm 占쏙옙占쌩울옙 占쌉쇽옙占쏙옙 占쏙옙占쏙옙....
   
         const CMotorControlInfo* pSystemMotorInfo = m_pSP2P->ISP2P_System_GetMotorInfo();
         if(pSystemMotorInfo !=NULL) 
@@ -774,7 +774,7 @@
      if(pPlanInfo == NULL) continue;
      //210325
      //END �� ��ε��� �Ǿ�������� �ش� �Լ��� ������� ���ư��� �־� start �Լ��� Ÿ����
      //END 占쏙옙 占쏙옙琯占쏙옙占?占실억옙占쏙옙占쏙옙占쏙옙占?占쌔댐옙 占쌉쇽옙占쏙옙 占쏙옙占쏙옙占쏙옙占?占쏙옙占싣곤옙占쏙옙 占쌍억옙 start 占쌉쇽옙占쏙옙 타占쏙옙占쏙옙
      //�װͿ� ���� ����ó�� 
      if (GetProcessStatus() == ProcessReviewEnd_CPJT || GetProcessStatus() == ProcessReviewUnloding_CPJT)
      {
@@ -830,7 +830,7 @@
            m_pSP2P->ISP2P_DisplayMessage(_T("[Sequence Processor] WSI Plan End!"));
         }
         break;
      //�̻��
      //占싱삼옙占?
      case CPJT_PlanMeasure:
         if (( nTotalCount += pGlassResult->GetTotalSMeasureResultCount()) > 0)
         {
@@ -1061,15 +1061,12 @@
         m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading] Send Loading Success Signal!"));
         strFileName.Format(_T("%s_%s"), strGlassIDTemp, strGlassStepIdTemp);
<<<<<<< HEAD
         //업데이트시
         bFileFind = FindRawBinFile(strFileName);
         //bFileFind = TRUE;
=======
         //������Ʈ��
         //bFileFind = FindRawBinFile(strFileName);
         bFileFind = TRUE;
>>>>>>> feature/#3486_CF_AOI_Review_Review_History_프로그램_테스트_및_적용
         pDitRawClient->SetReviewStart();
         Sleep(1000);
@@ -1114,7 +1111,7 @@
       }
    }
   //// 190725 ����� ��û���� chm ASCEND �� alarm
   //// 190725 占쏙옙占쏙옙占?占쏙옙청占쏙옙占쏙옙 chm ASCEND 占쏙옙 alarm
   const CRsRcpReviewInfo* pRsRcpReviewInfo = m_pSP2P->ISP2P_Recipe_GetRsRcpReviewInfo();
   const CRcpSortingInfo *pSortingInfo = pRsRcpReviewInfo->GetRcpReviewSortInfo();
@@ -1140,7 +1137,7 @@
   }
   //�����޸� Ŀ��� ���� ��ŸƮ(�۶� �ε�)
   //占쏙옙占쏙옙占쌨몌옙 커占쏙옙占?占쏙옙占쏙옙 占쏙옙타트(占쌜띰옙 占싸듸옙)
   CDitGlassRawClient* pDitSharedGlassRaw = CDitGlassRawClient::GetInstance();
   if (pDitSharedGlassRaw->isConnect() == FALSE) {
      m_pSP2P->ISP2P_DisplayMessage(_T("[DitGlassRawClient] Shared Memory Connect Fail"));
@@ -1234,7 +1231,7 @@
   if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_AlignStartAck_CPJT))
      m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Start Ack!"));
   //Sleep(400);//������ ���� ����� �ֱ� chm190602
   //Sleep(400);//占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙占?占쌍깍옙 chm190602
    // 1. get current glass result
    CGlassResult* pGlassResult = m_pSP2P->ISP2P_GetCurrentGlassResult();
@@ -1276,7 +1273,7 @@
      {
         //�����ߵ�
         Sleep(1000);
         //TEST ���
         //TEST 占쏙옙占?
         {
            SendResultToSignalControl(PCControlSendData_AlignResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
            m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align SUCCESS Data!"));
@@ -1319,7 +1316,7 @@
    if (bFileFind == FALSE)
   {
      SendResultToSignalControl(PCControlSendData_ReviewResult_CPJT, SIGNAL_SEND_RESULT_FAIL);
      m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReadRawFile] ������� ã�� ����"));
      m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReadRawFile] 占쏙옙占쏙옙占쏙옙占?찾占쏙옙 占쏙옙占쏙옙"));
      return;
   }   
@@ -1327,7 +1324,7 @@
   CGlassResult* pGlassResult = m_pSP2P->ISP2P_GetCurrentGlassResult();
   if (pGlassResult==NULL) return;
   
   //�����޸� Ŀ��� ���� ��ŸƮ(�۶� �ε�)
   //占쏙옙占쏙옙占쌨몌옙 커占쏙옙占?占쏙옙占쏙옙 占쏙옙타트(占쌜띰옙 占싸듸옙)
   CDitGlassRawClient* pDitSharedGlassRaw = CDitGlassRawClient::GetInstance();
   if(pDitSharedGlassRaw->isConnect() == FALSE)            m_pSP2P->ISP2P_DisplayMessage(_T("[DitGlassRawClient] Shared Memory Connect Fail"));
@@ -1367,7 +1364,7 @@
      m_pSP2P->ISP2P_DisplayMessage(_T("[ReadRawFile] AOI Result File Read Fail![%.3f ms]"), processTimer.GetDurationMilliSecond());
      //�׽�Ʈ ���
      //占쌓쏙옙트 占쏙옙占?
      //{
      //         // send review ready
      //   SendResultToSignalControl(PCControlSendData_ReviewResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
@@ -1397,8 +1394,8 @@
      }
   }
   //// [2017:5:24]-[WEZASW] : Review Image Upload Dir ����.(FTPUploader���� �ڵ� ���� �Ǵ��� ���� ����� ����)
   //// '�ݺ��˻�'�� FTPUploader���� ���ε� �� ���� ������ PCControl Glass Unloading �� ��� Loading�� Review������ ���ε� ���(GlassID) ���� ���� ����
   //// [2017:5:24]-[WEZASW] : Review Image Upload Dir 占쏙옙占쏙옙.(FTPUploader占쏙옙占쏙옙 占쌘듸옙 占쏙옙占쏙옙 占실댐옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙占?占쏙옙占쏙옙)
   //// '占쌥븝옙占싯삼옙'占쏙옙 FTPUploader占쏙옙占쏙옙 占쏙옙占싸듸옙 占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 PCControl Glass Unloading 占쏙옙 占쏙옙占?Loading占쏙옙 Review占쏙옙占쏙옙占쏙옙 占쏙옙占싸듸옙 占쏙옙占?GlassID) 占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙
   const CNetworkInfo *pNetworkInfo = m_pSP2P->ISP2P_System_GetNetworkInfo();
   CString strPath = _T("");
   //if(pNetworkInfo && pNetworkInfo->m_strUploadImagePath.IsEmpty() == FALSE)
@@ -1413,7 +1410,7 @@
   if (CDitGlassRawClient::GetInstance()->GetGlassData() == NULL) return;
   
   //���ε� ������ ������ ���� ������ �ٽ� ���ε� ��� Set 20190917chm
   //占쏙옙占싸듸옙 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쌕쏙옙 占쏙옙占싸듸옙 占쏙옙占?Set 20190917chm
   if(Uploadfile.FindFile(strPath)==FALSE)
   {
      CTime tmServerLoadingTime = CDitGlassRawClient::GetInstance()->GetGlassData()->m_tmGlassLoading;
@@ -1424,7 +1421,7 @@
      
      //taek 210126 rtms ����� �̹��� ���� ����
      //taek 210126 rtms 占쏙옙占쏙옙占?占싱뱄옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙
      CreateDirectory(pReviewProcessor->GetRTMSUploadImagePath(),NULL);
   }
@@ -1481,7 +1478,7 @@
   //   {
   //      m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor] TotalPitchMeasure Result Fail!"));
   //      // 190711 SJB, TotalPitchMeasure Fail�ÿ� �ٷ� Motor�� ����� ������ ���ٴ� Motion Enable ��ȣ�� Ȯ������
   //      // 190711 SJB, TotalPitchMeasure Fail占시울옙 占쌕뤄옙 Motor占쏙옙 占쏙옙占쏙옙占?占쏙옙占쏙옙占쏙옙 占쏙옙占쌕댐옙 Motion Enable 占쏙옙호占쏙옙 확占쏙옙占쏙옙占쏙옙
   //      
   //      if(!pTotapPithMeasure->GetMotorEnable())
   //      {
@@ -1515,7 +1512,7 @@
   {
      //�����ߵ�
      //Sleep(1000);
      //Test���
      //Test占쏙옙占?
      //SendResultToSignalControl(PCControlSendData_ReviewComplete_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
      //SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_ReviewComplete_CPJT);
      //m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewStart] Send Review Success Signal!"));
@@ -1557,7 +1554,7 @@
   m_pDitGlassRaw->GetGlassData()->m_nReviewNum = m_pSP2P->ISP2P_GetReviewProcessor()->GetPlanReviewCount();
    //SendDVDataToSignalControl();// �Ⱦ���
   //OverTime �߻��� ����� END ACK�� ��ٸ��°� �ƴ϶� �� Conplete�� ��ٸ���.
   //OverTime 占쌩삼옙占쏙옙 占쏙옙占쏘에占쏙옙 END ACK占쏙옙 占쏙옙摸占쏙옙째占?占싣니띰옙 占쏙옙 Conplete占쏙옙 占쏙옙摸占쏙옙占?
   //�� ... ����  �����ε��ϴ� �߰� 
   if (GetLastPointCheck() == FALSE)
@@ -1585,7 +1582,7 @@
      m_pSP2P->ISP2P_GetWSIControl(0)->SendWsiAfmSafePosMove();
      m_pSP2P->ISP2P_GetWSIControl(1)->SendWsiAfmSafePosMove();
   }
   // ������� ������ Review���� ���� ����
   // 占쏙옙占쏙옙占쏙옙占?占쏙옙占쏙옙占쏙옙 Review占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙
   if(m_pDitGlassRaw->isConnect()==FALSE)      WriteRawData(pGlassResult);
   
   //����Ŀ�� �˶� send 20190819chm
@@ -1613,7 +1610,7 @@
   g_pLog->DisplayMessage(_T("History Button Enable"));
   m_pSP2P->ISP2P_GetDiagnosisHistory2();
   /*int nModuleCount = m_pSP2P->ISP2P_GetModuleStatusCount(); //0503 ���� End�� ����� 0���� �ʱ�ȭ
   /*int nModuleCount = m_pSP2P->ISP2P_GetModuleStatusCount(); //0503 占쏙옙占쏙옙 End占쏙옙 占쏙옙占쏙옙占?0占쏙옙占쏙옙 占십깍옙화
   for (int nModuleIdx = 0; nModuleIdx < nModuleCount; nModuleIdx++)
   {
      {
@@ -1694,10 +1691,10 @@
      {
#pragma region ����� fail
#pragma region 占쏙옙占쏙옙占?fail
         if (m_pSP2P->ISP2P_GetCurrentGlassResult()->GetAlignResult()->nResultCode != Align_Success)
         {
            m_pSP2P->ISP2P_DisplayMessage(_T("[TEST Process::ReviewEnd] ����� ���� WSI ���� ������ ���� ����"));
            m_pSP2P->ISP2P_DisplayMessage(_T("[TEST Process::ReviewEnd] 占쏙옙占쏙옙占?占쏙옙占쏙옙 WSI 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙"));
            break;
         }
#pragma endregion
@@ -1829,7 +1826,7 @@
               }
               else
               {
                  //20210419 TR �������� Judge ���� ������� OK ����
                  //20210419 TR 占쏙옙占쏙옙占쏙옙占쏙옙 Judge 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占?OK 占쏙옙占쏙옙
                  //if (nJudge == 1)//TR -> OK
                  //{
                     if (pRawData->GetDefectData(nDefectIdx)->m_DefectJudgement == DEFECT_JUDGE_CPJT_OK || pRawData->GetDefectData(nDefectIdx)->m_DefectJudgement == DEFECT_JUDGE_CPJT_Unknown)
@@ -1976,7 +1973,7 @@
               }
               else
               {
                  //20210419 TR �������� Judge ���� ������� OK ����
                  //20210419 TR 占쏙옙占쏙옙占쏙옙占쏙옙 Judge 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占?OK 占쏙옙占쏙옙
                  //if (nJudge == 1)//TR -> OK
                  //{
                  if (pRawData->GetDefectData(nDefectIdx)->m_DefectJudgement == DEFECT_JUDGE_CPJT_OK || pRawData->GetDefectData(nDefectIdx)->m_DefectJudgement == DEFECT_JUDGE_CPJT_Unknown)
@@ -2721,7 +2718,7 @@
         {
            if (mapSpanFileName.begin()->first < nCloseTime)
            {
               //���� �ֱ� ������� ã�� ���� [������ 2019/7/17]
               //占쏙옙占쏙옙 占쌍깍옙 占쏙옙占쏙옙占쏙옙占?찾占쏙옙 占쏙옙占쏙옙 [占쏙옙占쏙옙占쏙옙 2019/7/17]
               strFindFile = mapSpanFileName.begin()->second;
               break;
            }
@@ -3306,7 +3303,7 @@
void CSequenceProcessor_CPJT::CreateResultDirectory(const CString& strGlassID, const CString& strDate)
{
   m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] ���丮 ����� ����"));
   m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] 占쏙옙占썰리 占쏙옙占쏙옙占?占쏙옙占쏙옙"));
   if (m_pSP2P==NULL) return;
   const CNetworkInfo *pNetworkInfo = m_pSP2P->ISP2P_System_GetNetworkInfo();
@@ -3352,7 +3349,7 @@
      strPath.Format(_T("%s\\%s"),pNetworkInfo->m_strAlignImagePath, strGlassID);
      CreateDirectory(strPath, NULL);
   }
   m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] ���丮 ����� ��"));
   m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] 占쏙옙占썰리 占쏙옙占쏙옙占?占쏙옙"));
}
@@ -3360,7 +3357,7 @@
void CSequenceProcessor_CPJT::SetSaveImageBasePathToReviewProcessor(const CString& strGlassID, const CString& strResultDate)
{
   m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] �̹��� �н� ����� ����"));
   m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] 占싱뱄옙占쏙옙 占싻쏙옙 占쏙옙占쏙옙占?占쏙옙占쏙옙"));
   const CNetworkInfo *pNetworkInfo = m_pSP2P->ISP2P_System_GetNetworkInfo();
   if(pNetworkInfo == NULL) return;
@@ -3441,12 +3438,12 @@
      }
   }
   m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] �̹��� �н� ����� ��"));
   m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] 占싱뱄옙占쏙옙 占싻쏙옙 占쏙옙占쏙옙占?占쏙옙"));
}
void CSequenceProcessor_CPJT::SetSaveImageBasePathToAlignCameraControl(const CString& strGlassID)
{
   m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] ����� �̹��� �н� ���� "));
   m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] 占쏙옙占쏙옙占?占싱뱄옙占쏙옙 占싻쏙옙 占쏙옙占쏙옙 "));
   const CNetworkInfo *pNetworkInfo = m_pSP2P->ISP2P_System_GetNetworkInfo();
   if(pNetworkInfo == NULL) return;
@@ -3459,7 +3456,7 @@
      strPath.Format(_T("%s\\%s"), pNetworkInfo->m_strAlignImagePath, strGlassID);
      pAlignCameraControl->SetSaveImageBasePath(strPath);
   }
   m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] ����� �̹��� �н� �� "));
   m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] 占쏙옙占쏙옙占?占싱뱄옙占쏙옙 占싻쏙옙 占쏙옙 "));
}
BOOL CSequenceProcessor_CPJT::ReadRecipeDataFromRecipeFile(const CString& strPPID_RC, CString& strRecipeName)// const CString& strPPID, CString& strRecipeName
@@ -3607,7 +3604,7 @@
      pGlassResult->m_AlignRecipe.dGlassPositionX[1]      = pGlassTypeInfo->m_dSecondAlignGlassX;
      pGlassResult->m_AlignRecipe.dGlassPositionY[1]      = pGlassTypeInfo->m_dSecondAlignGlassY;
      // Align Recipe ���� ���� �ڵ����� ã�� �Ķ����
      // Align Recipe 占쏙옙占쏙옙 占쏙옙占쏙옙 占쌘듸옙占쏙옙占쏙옙 찾占쏙옙 占식띰옙占쏙옙占?
      // Align Skip Mode
      pGlassResult->m_AlignRecipe.bAlignSkipMode      = pRsRcpAlignInfo->m_bAlignSkipMode;
      pGlassResult->m_AlignRecipe.bUseTotalPitchMeasure = pRsRcpAlignInfo->m_bTotalPitchMeasure;
@@ -3627,7 +3624,7 @@
      pGlassResult->m_AlignRecipe.nMergeRange         = pRsRcpAlignInfo->m_nMergeRange;
      pGlassResult->m_AlignRecipe.dEdgeRate         = pRsRcpAlignInfo->m_dEdgeRate;
      
      // ����ð�
      // 占쏙옙占쏙옙챨占?
      pGlassResult->m_AlignRecipe.bManualProcess         = pRsRcpAlignInfo->m_bManualProcess;
      pGlassResult->m_AlignRecipe.dFirstCamExposure      = pRsRcpAlignInfo->m_dFirstCamExposure;
      pGlassResult->m_AlignRecipe.dSecondCamExposure      = pRsRcpAlignInfo->m_dSecondCamExposure;
@@ -3657,10 +3654,10 @@
         {
            nLightValue = (nAlignCameraIdx==0) ? (int)pRsRcpAlignInfo->m_dFirstCamExposure: (int)pRsRcpAlignInfo->m_dSecondCamExposure;
            // ����� ī�޶� ���� ��������
            // 占쏙옙占쏙옙占?카占쌨띰옙 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占쏙옙
            const CAlignCameraInfo *pCameraInfo = m_pSP2P->ISP2P_System_GetAlignCameraInfo(nAlignCameraIdx);
             //����� ����.
             //占쏙옙占쏙옙占?占쏙옙占쏙옙.
            CLightControl *pLightControl = NULL;
            const CLightControlInfo *AlignLightinfo = pCameraInfo->GetLightContorlInfo();
@@ -3669,7 +3666,7 @@
            {
               if (AlignLightinfo->GetMaster()==1&& nAlignCameraIdx==1)
               {
                  //����� ��Ʋ�ѷ��� �ϳ��� ����Ǿ� ������ ������ ���η� Ȯ��
                  //占쏙옙占쏙옙占?占쏙옙틀占싼뤄옙占쏙옙 占싹놂옙占쏙옙 占쏙옙占쏙옙퓸占?占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙占싸뤄옙 확占쏙옙
                  //������ �̰� �´��� �𸣰ٴ� �ƹ��� �Ⱦ˷���
                  pLightControl = m_pSP2P->ISP2P_GetAlignLightControl(0);
@@ -3705,7 +3702,7 @@
         }
         
         // ����� ī�޶� ���� ��������
         // 占쏙옙占쏙옙占?카占쌨띰옙 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占쏙옙
         const CAlignCameraInfo *pCameraInfo   = m_pSP2P->ISP2P_System_GetAlignCameraInfo(nAlignCameraIdx);
         if (pCameraInfo)
         {
@@ -3733,7 +3730,7 @@
            }
         }
         // ����� ���ø� ���� ��������
         // 占쏙옙占쏙옙占?占쏙옙占시몌옙 占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙占쏙옙
         if((int)pGlassTypeInfo->m_vecTemplateImagePath.size() == nAlignCameraInfoCount)
         {
            pGlassResult->m_AlignRecipe.strTemplateName[nAlignCameraIdx] = pGlassTypeInfo->m_vecTemplateImagePath[nAlignCameraIdx];
@@ -3764,7 +3761,7 @@
            int nRealAFMIndex = pRcpReviewAFMInfo->m_nRecipeIndex;
            if(nRealAFMIndex == -1)// �����ǿ� ���õ� ������ ���� MagnificInfo Index�� �˾ƿ�
            {
               //-1�� ��� ���� �ε��� ������ ��.
               //-1占쏙옙 占쏙옙占?占쏙옙占쏙옙 占싸듸옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙.
               nRealAFMIndex = GetRealMagnification(nModuleIdx, pRcpReviewAFMInfo->m_nZoomIndex);
            }
            AFM_SetAFMRecipeName(nModuleIdx, strRecipeName, nRealAFMIndex);
@@ -3832,7 +3829,7 @@
   CString strRawTDPath=_T(""), strRawCDPath=_T(""), strRawSDPath=_T("");
   // ������� �̸� ã��
   // 占쏙옙占쏙옙占쏙옙占?占싱몌옙 찾占쏙옙
   FindAOIRawFilePath(pGlassResult, &strRawTDPath, &strRawCDPath, &strRawSDPath);
   bRet = m_pSP2P->ISP2P_ReadAOIRawFileToGlassResult(strRawTDPath);
@@ -3886,7 +3883,7 @@
      if(finder.IsDots()) continue;
      if(finder.IsDirectory()) continue;
      // [2017:5:16]-[WEZASW] : AOI Server�� ���� ���� ��ġ�� ���Ը� �̹��� ���� ����� ���� ���ϸ� ����
      // [2017:5:16]-[WEZASW] : AOI Server占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙치占쏙옙 占쏙옙占쌉몌옙 占싱뱄옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙占?占쏙옙占쏙옙 占쏙옙占싹몌옙 占쏙옙占쏙옙
      sRawFile.strFileName = finder.GetFileName();
      strExtTemp = sRawFile.strFileName;
      int nIdx = strExtTemp.Remove('.');      
@@ -4121,7 +4118,7 @@
         SReviewResult* pReview = pReviewResult->GetSReviewResult(nResultIdx);
         if (pReview==NULL) continue;
         //200�� ��巹���� ������ �Ϸ�������� �ߺ�üũ
         //200占쏙옙 占쏙옙藥뱄옙占쏙옙占?占쏙옙占쏙옙占쏙옙 占싹뤄옙占쏙옙占쏙옙占쏙옙占?占쌩븝옙체크
         if (pReview->bCheckSendToMotor == FALSE)
         {
            pReview->bCheckSendToMotor = TRUE;
@@ -4206,7 +4203,7 @@
               bOverTime = TRUE;
               break;
            }
            //���� ��� End üũ
            //占쏙옙占쏙옙 占쏙옙占?End 체크
            if (pMotorControl->IsGantryMotionEnd(pModuleStatus->GetGantryIndex()) == TRUE)
            {
               if (pMotorControl->GantryAutoGo(pModuleStatus->GetGantryIndex(), vectorPosX, vectorPosY, TRUE))
@@ -4225,7 +4222,7 @@
         }
         //5���Ŀ��� �ȿ����δ�? �׷� 3�� ��õ� ����
         //5占쏙옙占식울옙占쏙옙 占싫울옙占쏙옙占싸댐옙? 占쌓뤄옙 3占쏙옙 占쏙옙천占?占쏙옙占쏙옙
         //���End �� �߸� ���ü��� ������
         if (bOverTime == TRUE)
         {
@@ -4426,7 +4423,7 @@
         SReviewResult* pReview = pReviewResult->GetSReviewResult(nResultIdx);
         if (pReview == NULL) continue;
         //200�� ��巹���� ������ �Ϸ�������� �ߺ�üũ
         //200占쏙옙 占쏙옙藥뱄옙占쏙옙占?占쏙옙占쏙옙占쏙옙 占싹뤄옙占쏙옙占쏙옙占쏙옙占?占쌩븝옙체크
         if (pReview->bCheckSendToMotor == FALSE)
         {
            pReview->bCheckSendToMotor = TRUE;
@@ -4672,7 +4669,7 @@
         SReviewResult* pWsi = pWsiResult->GetSReviewResult(nResultIdx);
         if (pWsi == NULL) continue;
         //200�� ��巹���� ������ �Ϸ�������� �ߺ�üũ
         //200占쏙옙 占쏙옙藥뱄옙占쏙옙占?占쏙옙占쏙옙占쏙옙 占싹뤄옙占쏙옙占쏙옙占쏙옙占?占쌩븝옙체크
         if (pWsi->bCheckWSISendToMotor == FALSE)
         {
            pWsi->bCheckWSISendToMotor = TRUE;
@@ -4756,7 +4753,7 @@
                  bOverTime = TRUE;
                  break;
               }
               //���� ��� End üũ
               //占쏙옙占쏙옙 占쏙옙占?End 체크
               if (pMotorControl->IsGantryMotionEnd(pModuleStatus->GetGantryIndex()) == TRUE)
               {
                  if (pMotorControl->GantryAutoGo(pModuleStatus->GetGantryIndex(), vectorPosX, vectorPosY, TRUE))
@@ -4775,7 +4772,7 @@
            }
            //5���Ŀ��� �ȿ����δ�? �׷� 3�� ��õ� ����
            //5占쏙옙占식울옙占쏙옙 占싫울옙占쏙옙占싸댐옙? 占쌓뤄옙 3占쏙옙 占쏙옙천占?占쏙옙占쏙옙
            //���End �� �߸� ���ü��� ������
            if (bOverTime == TRUE)
            {
@@ -6546,7 +6543,7 @@
         // add user schedule result
         
         
         //�����޸𸮿� ä���� ������ ������ ���� ��ǥ�� ����ü�� ä���ִ� ���
         //占쏙옙占쏙옙占쌨모리울옙 채占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙표占쏙옙 占쏙옙占쏙옙체占쏙옙 채占쏙옙占쌍댐옙 占쏙옙占?
         {
@@ -7261,7 +7258,7 @@
            break;
         }
         break;
      // �̻��
      // 占싱삼옙占?
      case CPJT_PlanMeasure:
         {
            const CRcpMeasureInfo *pRcpMeasureInfo = pRsRcpMeasureInfo->GetRcpMeasureInfo(0);
@@ -7548,7 +7545,7 @@
      wsprintf(DriveText, TEXT("%C:"), Drive);
      UINT type = GetDriveType(DriveText);
      if ((dwDrive & dwDriveCh) && (type == DRIVE_REMOVABLE || type == DRIVE_FIXED || type == DRIVE_RAMDISK)) {
         // �ϵ�뷮
         // 占싹듸옙酉?
         ULARGE_INTEGER i64FreeBytesToCaller = { 0 }, i64TotalBytes = { 0 }, i64FreeBytes = { 0 };
         BOOL bRsult = GetDiskFreeSpaceEx(DriveText, (PULARGE_INTEGER)&i64FreeBytesToCaller, (PULARGE_INTEGER)&i64TotalBytes, (PULARGE_INTEGER)&i64FreeBytes);
         if (bRsult) {
@@ -7977,7 +7974,7 @@
      wsprintf(DriveText, TEXT("%C:"), Drive);
      UINT type = GetDriveType(DriveText);
      if ((dwDrive & dwDriveCh) && (type == DRIVE_REMOVABLE || type == DRIVE_FIXED || type == DRIVE_RAMDISK)) {
         // �ϵ�뷮
         // 占싹듸옙酉?
         ULARGE_INTEGER i64FreeBytesToCaller = { 0 }, i64TotalBytes = { 0 }, i64FreeBytes = { 0 };
         BOOL bRsult = GetDiskFreeSpaceEx(DriveText, (PULARGE_INTEGER)&i64FreeBytesToCaller, (PULARGE_INTEGER)&i64TotalBytes, (PULARGE_INTEGER)&i64FreeBytes);
         if (bRsult) {
@@ -8967,7 +8964,7 @@
   // set last result idx
   pWsiMultiShotResult->SetLastSReviewResultIndex(nCurResultIdx);
   // ������ ����Ʈ���� �԰�, WSI ����� ���� ������...
   // 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙트占쏙옙占쏙옙 占쌉곤옙, WSI 占쏙옙占쏙옙占?占쏙옙占쏙옙 占쏙옙占쏙옙占쏙옙...
   if (nCurResultIdx == nEndResultIdx && nCurResultIdx <= pWsiMultiShotResult->GetSReviewResultCount())
   {
      nStartResultIdx = nCurResultIdx + 1;
@@ -8979,7 +8976,7 @@
      pWsiMultiShotResult->SetEndSReviewResultIndex(nEndResultIdx);
      // ������ ����Ʈ ���� ��������.
      ::Sleep(3000); // ����̴� �ʼ���. ������ ���� ����.
      ::Sleep(3000); // 占쏙옙占쏙옙甄占?占십쇽옙占쏙옙. 占쏙옙占쏙옙占쏙옙 占쏙옙占쏙옙 占쏙옙占쏙옙.
   //   Process_RemainWsiPoint(nModuleIndex);
   }
@@ -9464,7 +9461,7 @@
      int nResultCount = 0;
      if (m_vecSReviewResult.size()>0)
      {   
         //�����ٸ� ���� ��� ��������Ŷ� �� ����ֱ� ����
         //占쏙옙占쏙옙占쌕몌옙 占쏙옙占쏙옙 占쏙옙占?占쏙옙占쏙옙占쏙옙占쏙옙킷占?占쏙옙 占쏙옙占쏙옙殮占?占쏙옙占쏙옙
         for(int i=0; i< m_vecSReviewResult.size(); i++)
         {
            //������ ���ÿ� ���� ���� �Է��ؾߵ� �װ͸�ŭ ������!
@@ -10399,7 +10396,7 @@
   CString strMessage, strResultFilePath, strUploadResultFilePath, strLocalRawPath;
   CString   strUploadRawPath, strUploadImagePath, strAOIRawFileName, strAOIRawFilePath;
   //3-1. ���� ��� ���� ����
   //3-1. 占쏙옙占쏙옙 占쏙옙占?占쏙옙占쏙옙 占쏙옙占쏙옙
   m_pSP2P->ISP2P_SetReviewResultData(pGlassResult);
   strLocalRawPath      = pNetworkInfo->m_strLocalRawPath;
@@ -10469,7 +10466,7 @@
BOOL CSequenceProcessor_CPJT::MoveReviewStartMotorPosition(CGlassResult* pGlassResult,int nReviewType)
{
   //Ȥ�ó� ���ϱ�� ���ܵ�
   //혹占시놂옙 占쏙옙占싹깍옙占?占쏙옙占쌤듸옙
   //���� �÷��� ù��° ��ġ�� �̵�
   
   double dDefectPosX,dDefectPosY = 0;