SDC C-Project CF Review 프로그램
ReviewSystem/ReviewSystem/SequenceProcessor_CPJT.cpp
@@ -166,6 +166,9 @@
{
   m_bUseAFMHomePosition = TRUE;
   m_nGlassCount = 0;
   m_nStackZeroReviewCondition = 0;
   m_nUploadResultFailCount = 0;
   m_nStackUploadFailGlassCount = 0;
   CDitGlassRawClient* pDitGlassRaw = CDitGlassRawClient::GetInstance();
   if(pDitGlassRaw->ConnectServer() == FALSE)
   {
@@ -547,10 +550,16 @@
      m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Fail Data!"));
   }
   AlignCamera_CameraControl(CameraControlStop);  // 210805 Align Camera Sequence 변경
   /*< SWK 20221226 - #4403 MOD Start >*/
//    AlignCamera_CameraControl(CameraControlStop);  // 210805 Align Camera Sequence 변경
//
//    SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_AlignComplete_CPJT);
//    m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Complete Signal!"));
   SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_AlignComplete_CPJT);
   m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::AlignStart] Send Align Complete Signal!"));
   AlignCamera_CameraControl(CameraControlStop);
   /*< SWK 20221226 - #4403 MOD End >*/
   // LJY-20180905
   m_pSP2P->ISP2P_UpdateAlignResultStatus(0, pGlassResult);
@@ -665,8 +674,14 @@
      //   m_pSP2P->ISP2P_GetWSIControl(1)->SendWsiAfmSafePosMove();
      //}
      //Sleep(5000);
      SendResultToSignalControl(PCControlSendData_ReviewResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
      SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_ReviewComplete_CPJT);
      //if (GetProcessStatus() != ProcessReviewEnd_CPJT && GetProcessStatus() != ProcessReviewUnloding_CPJT)
      if (GetReviewComplete() == FALSE)
      {
         SendResultToSignalControl(PCControlSendData_ReviewResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
         SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_ReviewComplete_CPJT);
         SetReviewComplete(TRUE);
      }
      m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewStart] Send Review Success Signal!"));
      //LONGREUN
      //RecvSignalToSignalControl(PCControlRecvSignalIndex_Seq, 4);
@@ -936,6 +951,9 @@
   SetWsiType(-1);    //wsi reflow
   SetLastPointCheck(FALSE);
   SetReviewComplete(FALSE);
   //SetUploadResultFailCount(0);
   bFileFind = FALSE;
   /*< LYW 20211109 - #3662 Delete Start >*/
@@ -1058,7 +1076,6 @@
         // #3381 LYW CF AOI Review FDC TackTime ADD START
         pDitRawClient->GetGlassData()->m_tmReviewLoading = CTime::GetCurrentTime();
         // #3381 LYW CF AOI Review FDC TackTime ADD END
         CString strGlassIDTemp = NULL;
         CString strGlassStepIdTemp = NULL;
@@ -1066,7 +1083,6 @@
         strGlassIDTemp = pTransferData->strGlassID;
         strGlassStepIdTemp = pTransferData->strStepID;
         strGlassIDTemp = pTransferData->strGlassID;
         strcpy(pDitRawClient->GetGlassData()->m_strGlassID, strGlassIDTemp);
@@ -1091,7 +1107,8 @@
         /*bFileFind = FindRawBinFile(strFileName);*/
         pDitRawClient->SetReviewStart();
         Sleep(1000);
         //< SWK 20221226 - #4403 DEL >
//         Sleep(1000);
          m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::Loading] Transfer Data Read Success!"));
 
@@ -1116,6 +1133,10 @@
          }
          
         m_pSP2P->ISP2P_DisplayMessage(_T("[Glass Loading] Current Apply Recipe Name : %s"), strRecipefile);
         /*< LYW 20220610 - #4185 ADD Start >*/
         CheckGantryMode();
         /*< LYW 20220610 - #4185 ADD End >*/
 
         // recipe data apply
         if(ApplyRecipeDataToGlassResult(pGlassResult)==FALSE)
@@ -1304,7 +1325,8 @@
   }
   //#3561 210908 LYW ADD End
   Sleep(300);
   //< SWK 20221226 - #4403 MOD >
   Sleep(100);
   //original
//    if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_AlignStartAck_CPJT))
@@ -1426,7 +1448,9 @@
   
   //pDitRawClient->SetReviewStart();
   Sleep(500);
   //< SWK 20221226 - #4403 DEL >
//   Sleep(500);
   //CString strJudgeData;
   m_pSP2P->ISP2P_GetSignalControl()->WriteData(_T("17110"), sizeof(pDitRawClient->GetGlassData()->m_strGlassJudge), pDitRawClient->GetGlassData()->m_strGlassJudge);
   m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::IN] ReadRawFile!"));
@@ -1487,7 +1511,8 @@
      int nTotalPlanCount = CalculatePlanData(pGlassResult);
      m_pSP2P->ISP2P_DisplayMessage(_T("[Read Raw File] Review All Plan Total Count : %d"), nTotalPlanCount);
      Sleep(1000);
      //< SWK 20221226 - #4403 DEL >
//      Sleep(1000);
      // send review ready
      //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD START
      if (GetSimulationMode() == FALSE)
@@ -1692,6 +1717,8 @@
         m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] Send Review End Ack!"));
   }
   SetUploadResultFailCount(0);
   CGlassResult* pGlassResult = m_pSP2P->ISP2P_GetCurrentGlassResult();
   if (pGlassResult == NULL) return;
@@ -1737,7 +1764,8 @@
   m_pDitGlassRaw->GetGlassData()->m_nReviewNum = m_pSP2P->ISP2P_GetReviewProcessor()->GetPlanReviewCount();
    //SendDVDataToSignalControl(); 
   if (GetLastPointCheck() == FALSE)
   //if (GetLastPointCheck() == FALSE)
   if (GetReviewComplete() == FALSE)
   {
      //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD START
      if (GetSimulationMode() == FALSE)
@@ -1745,6 +1773,7 @@
         SendResultToSignalControl(PCControlSendData_ReviewResult_CPJT, SIGNAL_SEND_RESULT_SUCCESS);
         SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_ReviewComplete_CPJT);
         m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewStart] Send Review Success Signal!"));
         SetReviewComplete(TRUE);
      }
      //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD END
      //original
@@ -1783,6 +1812,24 @@
      CDlgDefocusList::GetInstance()->SetDefocusData(strTime,pGlassResult->m_strGlassID,pGlassResult->m_nDeFocusCount);
   }
   if (CheckZeroReviewAlarm() == FALSE && m_pSP2P->ISP2P_System_GetNetworkInfo()->m_nZeroReviewAlarm != 0)
   {
      STransferData* pTransferData = m_pSP2P->ISP2P_GetCurrentTransferData();
      if (pTransferData->strProdType != m_pSP2P->ISP2P_System_GetNetworkInfo()->m_strZeroReviewAlarmExcept)
      {
         m_nStackZeroReviewCondition++;
         m_pSP2P->ISP2P_DisplayMessage(_T("Zero Review Condition ProdType = %s, ConditionStack = %d, AlarmExcept = %s, AlarmCondition = %d"), pTransferData->strProdType, m_nStackZeroReviewCondition, m_pSP2P->ISP2P_System_GetNetworkInfo()->m_strZeroReviewAlarmExcept, m_pSP2P->ISP2P_System_GetNetworkInfo()->m_nZeroReviewAlarm);
         if (m_nStackZeroReviewCondition >= m_pSP2P->ISP2P_System_GetNetworkInfo()->m_nZeroReviewAlarm)
         {
            m_pSP2P->ISP2P_DisplayMessage(_T("Zero Review Alarm! %d ea Glass Is Zero Review!"), m_nStackZeroReviewCondition);
            SendSignalToSignalControl(PCControlSendSignalIndex_State, PCControlSend_Review_0Count_Alarm, 1000);
            m_nStackZeroReviewCondition = 0;
         }
      }
      else m_nStackZeroReviewCondition = 0;
   }
   else m_nStackZeroReviewCondition = 0;
   /*< LYW 20211109 - #3662 Delete Start >*/
   //    g_pLog->DisplayMessage(_T("History map Start"));
@@ -3638,7 +3685,9 @@
         tmServerLoadingTime = CTime::GetCurrentTime();
         m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading] access Shared Memory Fail"));
         strPath.Format(_T("%s\\%s_%04d%02d%02d%02d%02d%02d"), pNetworkInfo->m_strUploadImagePath, strGlassID, tmServerLoadingTime.GetYear(), tmServerLoadingTime.GetMonth(), tmServerLoadingTime.GetDay(), tmServerLoadingTime.GetHour(), tmServerLoadingTime.GetMinute(), tmServerLoadingTime.GetSecond());
         strImagePath.Format(_T("%s\\%s_%04d%02d%02d%02d%02d%02d"), strGlassID, tmServerLoadingTime.GetYear(), tmServerLoadingTime.GetMonth(), tmServerLoadingTime.GetDay(), tmServerLoadingTime.GetHour(), tmServerLoadingTime.GetMinute(), tmServerLoadingTime.GetSecond());
         //< SWK 20221226 - #4403 MOD >
//         strImagePath.Format(_T("%s\\%s_%04d%02d%02d%02d%02d%02d"), strGlassID, tmServerLoadingTime.GetYear(), tmServerLoadingTime.GetMonth(), tmServerLoadingTime.GetDay(), tmServerLoadingTime.GetHour(), tmServerLoadingTime.GetMinute(), tmServerLoadingTime.GetSecond());
         strImagePath.Format(_T("%s_%04d%02d%02d%02d%02d%02d"), strGlassID, tmServerLoadingTime.GetYear(), tmServerLoadingTime.GetMonth(), tmServerLoadingTime.GetDay(), tmServerLoadingTime.GetHour(), tmServerLoadingTime.GetMinute(), tmServerLoadingTime.GetSecond());
         CreateDirectory(strPath, NULL);
         pReviewProcessor->SetUploadImagePath(strPath);
         pReviewProcessor->SetReviewImagePath(strImagePath);
@@ -4285,7 +4334,9 @@
      {
         int XAddr = pMotorControl->GetGantryCollisionXAddr(pModuleStatus->GetGantryIndex());
         g_pLog->DisplayMessage(_T("[Collision Position Set Fail] %d Module, Addr: %d, PosX: %.3lfmm"), nModuleIdx, XAddr, dCollisionPosX);
         return 0;
         /*< LYW 20220610 - #4185 Delete Start >*/
         //return 0;
         /*< LYW 20220610 - #4185 Delete End >*/
      }
      }
@@ -4325,6 +4376,7 @@
         // set offset
         ApplyMotorOffset(pReview->nModuleIdx, pReview->nZoomIdx, MotorOffsetCamera + MotorOffsetMag+MotorOffset_Glass, dDefectPosX, dDefectPosY);
      
         m_pSP2P->CalcMotorOffSetValue(pReview->nModuleIdx, dDefectPosX, dDefectPosY);      //< KEJ 20230622 - #4526 ADD >
         //xpostemp = dDefectPosX;
         //ypostemp = dDefectPosY;
@@ -4583,7 +4635,9 @@
         {
            int XAddr = pMotorControl->GetGantryCollisionXAddr(pModuleStatus->GetGantryIndex());
            g_pLog->DisplayMessage(_T("[Collision Position Set Fail] %d Module, Addr: %d, PosX: %.3lfmm"), nModuleIdx, XAddr, dCollisionPosX);
            return 0;
            /*< LYW 20220610 - #4185 Delete Start >*/
            //return 0;
            /*< LYW 20220610 - #4185 Delete End >*/
         }
      }
@@ -4623,6 +4677,7 @@
         // set offset
         ApplyMotorOffset(pReview->nModuleIdx, pReview->nZoomIdx, MotorOffsetCamera + MotorOffsetMag + MotorOffset_Glass, dDefectPosX, dDefectPosY);
         m_pSP2P->CalcMotorOffSetValue(pReview->nModuleIdx, dDefectPosX, dDefectPosY);      //< KEJ 20230622 - #4526 ADD >
         //xpostemp = dDefectPosX;
         //ypostemp = dDefectPosY;
@@ -4836,7 +4891,9 @@
         {
            int XAddr = pMotorControl->GetGantryCollisionXAddr(pModuleStatus->GetGantryIndex());
            g_pLog->DisplayMessage(_T("[Collision Position Set Fail] %d Module, Addr: %d, PosX: %.3lfmm"), nModuleIdx, XAddr, dCollisionPosX);
            return 0;
            /*< LYW 20220610 - #4185 Delete Start >*/
            //return 0;
            /*< LYW 20220610 - #4185 Delete End >*/
         }
      }
@@ -4877,6 +4934,8 @@
         // set offset
         ApplyMotorOffset(pWsi->nModuleIdx, -1, MotorOffsetCamera + MotorOffsetWSI + MotorOffset_Glass, dDefectPosX, dDefectPosY);
         m_pSP2P->CalcMotorOffSetValue(pWsi->nModuleIdx, dDefectPosX, dDefectPosY);      //< KEJ 20230622 - #4526 ADD >
         m_pSP2P->GetOffSetValue(nModuleIdx, pWsi->nAOICameraIdx, pWsi->nAOIScanIdx, pWsi->nUMOriginX / 1000.0, xpostemp, ypostemp);
@@ -7772,6 +7831,9 @@
   pSignalControl->WritePacketData(_T("16140"), sizeof(nWSI00Version), (short*)&nWSI00Version);
   pSignalControl->WritePacketData(_T("16144"), sizeof(nWSI01Version), (short*)&nWSI01Version);
   /*< LYW 20220415 - #4086 ADD Start >*/ //추가 필요
   /*< LYW 20220415 - #4086 ADD End >*/
   //CCHImageData pImageData;
    //CCHImageData pImageData2;
@@ -8047,6 +8109,14 @@
   int nWSI01Version = 20210422;
   int nReviewAliveCamera00 = 1000;
   int nReviewAliveCamera01 = 1000;
   /*< LYW 20220415 - #4086 ADD Start >*/
   int   nFDCGRMSWVersion = 20200101;
   int   nFDCFTPUploaderSWVersion = 20200101;
   int   nFDCSyncSWVersion = 20200101;
   int   nFDCReviewSWVersion = 20200101;
   int   nFDCWSISWVersion00 = 20200101;
   int   nFDCWSISWVersion01 = 20200101;
   /*< LYW 20220415 - #4086 ADD End >*/
   //foucs 
   /*< LYW 20211109 - #3662 MOD Start >*/
@@ -8054,6 +8124,15 @@
   {
      nRev_Cam1_Image_Contrast = m_pSP2P->ISP2P_GetReview00ImageContrast() * 1000;
      nRev_Cam2_Image_Contrast = m_pSP2P->ISP2P_GetReview01ImageContrast() * 1000;
      /*< LYW 20220415 - #4086 ADD Start >*/
      nFDCGRMSWVersion = m_pSP2P->ISP2P_GetGRMSWVersion();
      nFDCFTPUploaderSWVersion = m_pSP2P->ISP2P_GetFTPUploaderSWVersion();
      nFDCSyncSWVersion = m_pSP2P->ISP2P_GetSyncSWVersion();
      nFDCReviewSWVersion = m_pSP2P->ISP2P_GetReviewSWVersion();
      nFDCWSISWVersion00 = m_pSP2P->ISP2P_GetWSISWVersion(0);
      nFDCWSISWVersion01 = m_pSP2P->ISP2P_GetWSISWVersion(1);
      /*< LYW 20220415 - #4086 ADD End >*/
   }
   /*< LYW 20211109 - #3662 MOD End >*/
   /*< Origin Code >*/
@@ -8197,17 +8276,167 @@
   pSignalControl->WritePacketData(_T("16116"), sizeof(nRev_Cam1_Image_Contrast), (short*)&nRev_Cam1_Image_Contrast);
   pSignalControl->WritePacketData(_T("16120"), sizeof(nRev_Cam2_Image_Contrast), (short*)&nRev_Cam2_Image_Contrast);
   pSignalControl->WritePacketData(_T("16124"), sizeof(nRev_PC_HDD_CHECK), (short*)&nRev_PC_HDD_CHECK);
   pSignalControl->WritePacketData(_T("16128"), sizeof(nWSI1_PC_HDD_CHECK), (short*)&nWSI1_PC_HDD_CHECK);
   pSignalControl->WritePacketData(_T("16132"), sizeof(nWSI2_PC_HDD_CHECK), (short*)&nWSI2_PC_HDD_CHECK);
   /*< LYW 20220415 - #4086 ADD Start >*/
   pSignalControl->WritePacketData(_T("16124"), sizeof(nFDCSyncSWVersion), (short*)&nFDCSyncSWVersion);
   pSignalControl->WritePacketData(_T("16128"), sizeof(nFDCReviewSWVersion), (short*)&nFDCReviewSWVersion);
   pSignalControl->WritePacketData(_T("16132"), sizeof(nFDCFTPUploaderSWVersion), (short*)&nFDCFTPUploaderSWVersion);
   pSignalControl->WritePacketData(_T("16136"), sizeof(nFDCGRMSWVersion), (short*)&nFDCGRMSWVersion);
   pSignalControl->WritePacketData(_T("16140"), sizeof(nFDCWSISWVersion00), (short*)&nFDCWSISWVersion00);
   pSignalControl->WritePacketData(_T("16144"), sizeof(nFDCWSISWVersion01), (short*)&nFDCWSISWVersion01);
   /*< LYW 20220415 - #4086 ADD End >*/
   pSignalControl->WritePacketData(_T("16136"), sizeof(nReviewVersion), (short*)&nReviewVersion);
   pSignalControl->WritePacketData(_T("16140"), sizeof(nWSI00Version), (short*)&nWSI00Version);
   pSignalControl->WritePacketData(_T("16144"), sizeof(nWSI01Version), (short*)&nWSI01Version);
//    pSignalControl->WritePacketData(_T("16124"), sizeof(nRev_PC_HDD_CHECK), (short*)&nRev_PC_HDD_CHECK);
//    pSignalControl->WritePacketData(_T("16128"), sizeof(nWSI1_PC_HDD_CHECK), (short*)&nWSI1_PC_HDD_CHECK);
//    pSignalControl->WritePacketData(_T("16132"), sizeof(nWSI2_PC_HDD_CHECK), (short*)&nWSI2_PC_HDD_CHECK);
//
//    pSignalControl->WritePacketData(_T("16136"), sizeof(nReviewVersion), (short*)&nReviewVersion);
//    pSignalControl->WritePacketData(_T("16140"), sizeof(nWSI00Version), (short*)&nWSI00Version);
//    pSignalControl->WritePacketData(_T("16144"), sizeof(nWSI01Version), (short*)&nWSI01Version);
   return;
}
BOOL CSequenceProcessor_CPJT::CheckZeroReviewAlarm()
{
   CGlassResult* pGlassResult = m_pSP2P->ISP2P_GetCurrentGlassResult();
   if (pGlassResult == NULL) return FALSE;
   int TotalCount = 0;
   //Defect
   const VectorReviewResult *pVecReviewResult = pGlassResult->GetVectorReviewResult();
   if (pVecReviewResult != NULL)
   {
      for (constVectorReviewResultIt it = pVecReviewResult->begin(); it != pVecReviewResult->end(); it++)
      {
         const CReviewResult *pReviewResult = static_cast<const CReviewResult*>(&(*it));
         TotalCount += pReviewResult->m_vecSReviewResult.size();
         for (constVectorSReviewResultIt its = pReviewResult->m_vecSReviewResult.begin(); its != pReviewResult->m_vecSReviewResult.end(); its++)
         {
            if (its->nResultCode > ReviewResult_None)
            {
               return TRUE;
            }
            else
            {
               continue;
            }
         }
      }
   }
   //DefectWSI
   const VectorReviewResult *pVecWsiResult = pGlassResult->GetVectorWsiResult();
   if (pVecWsiResult != NULL)
   {
      for (constVectorReviewResultIt it = pVecWsiResult->begin(); it != pVecWsiResult->end(); it++)
      {
         const CReviewResult *pWsiResult = static_cast<const CReviewResult*>(&(*it));
         TotalCount += pWsiResult->m_vecSReviewResult.size();
         for (constVectorSReviewResultIt its = pWsiResult->m_vecSReviewResult.begin(); its != pWsiResult->m_vecSReviewResult.end(); its++)
         {
            if (its->nResultCode > WsiResult_None)
            {
               return TRUE;
            }
            else
            {
               continue;
            }
         }
      }
   }
   //User Review
   const VectorReviewResult *pVecUserReviewResult = pGlassResult->GetVectorUserResult();
   if (pVecUserReviewResult != NULL)
   {
      for (constVectorReviewResultIt it = pVecUserReviewResult->begin(); it != pVecUserReviewResult->end(); it++)
      {
         const CReviewResult *pUserReviewResult = static_cast<const CReviewResult*>(&(*it));
         TotalCount += pUserReviewResult->m_vecSReviewResult.size();
         for (constVectorSReviewResultIt its = pUserReviewResult->m_vecSReviewResult.begin(); its != pUserReviewResult->m_vecSReviewResult.end(); its++)
         {
            if (its->nResultCode > ReviewResult_None)
            {
               return TRUE;
            }
            else
            {
               continue;
            }
         }
      }
   }
   //User WSI
   const VectorReviewResult *pVecUserWsiResult = pGlassResult->GetVectorUserWsiResult();
   if (pVecUserWsiResult != NULL)
   {
      for (constVectorReviewResultIt it = pVecUserWsiResult->begin(); it != pVecUserWsiResult->end(); it++)
      {
         const CReviewResult *pUserWsiResult = static_cast<const CReviewResult*>(&(*it));
         TotalCount += pUserWsiResult->m_vecSReviewResult.size();
         for (constVectorSReviewResultIt its = pUserWsiResult->m_vecSReviewResult.begin(); its != pUserWsiResult->m_vecSReviewResult.end(); its++)
         {
            if (its->nResultCode > WsiResult_None)
            {
               return TRUE;
            }
            else
            {
               continue;
            }
         }
      }
   }
   if (TotalCount == 0) return TRUE;
   return FALSE;
}
void CSequenceProcessor_CPJT::sendUploadResult2SequenceProcessor(int UploadResult)
{
   int UploadResultFailCount = GetUploadResultFailCount();
   if (UploadResult == FALSE)
   {
      UploadResultFailCount++;
      m_pSP2P->ISP2P_DisplayMessage(_T("Upload Ack is False"));
      if (UploadResultFailCount >= 3)
      {
         //SendSignalToSignalControl(PCControlSendSignalIndex_State, PCControlSend_ResultData_Upload_Fail, 1000);
         m_nStackUploadFailGlassCount++;
         m_pSP2P->ISP2P_DisplayMessage(_T("ResultFile Upload Fail Glass Count = %d"),m_nStackUploadFailGlassCount);
         if (m_nStackUploadFailGlassCount >= m_pSP2P->ISP2P_System_GetNetworkInfo()->m_nResultFileUploadFailAlarmCondition)
         {
            SendSignalToSignalControl(PCControlSendSignalIndex_State, PCControlSend_ResultData_Upload_Fail, 1000);
            m_nStackUploadFailGlassCount = 0;
            m_pSP2P->ISP2P_DisplayMessage(_T("ResultFile Upload Fail Alarm!"));
         }
         SetUploadResultFailCount(-1);
      }
      else
      {
         SetUploadResultFailCount(UploadResultFailCount);
      }
   }
   else
   {
      m_pSP2P->ISP2P_DisplayMessage(_T("Upload Ack is True"));
      m_nStackUploadFailGlassCount = 0;
   }
}
//#3358 KYH FDC  ADD END
DWORD CSequenceProcessor_CPJT::GetDiskUsage()
@@ -9257,7 +9486,7 @@
   AFM_SetAFMTracking(FALSE);
   SetWsiType(0);
   WSIAllReadySignal(0);
   WSIAllReadySignal(1);
   
   // send wsi start
   if(!WSIUserAllStartSignal())
@@ -9488,7 +9717,8 @@
   VectorDouble vectorCollisionPosX;
   vectorCollisionPosX.clear();
   //WSI
   pMotorControl->GantrySetTwoGantrySyncModeSend(1);
   // WSI result count
   for (int nModuleIdx=0; nModuleIdx<Module_GetModuleStatusCount(); nModuleIdx++)
@@ -9532,7 +9762,9 @@
         {
            int XAddr = pMotorControl->GetGantryCollisionXAddr(pModuleStatus->GetGantryIndex());
            g_pLog->DisplayMessage(_T("[Collision Position Set Fail] %d Module, Addr: %d, PosX: %.3lfmm"), nModuleIdx, XAddr, dCollisionPosX);
            return 0;
            /*< LYW 20220610 - #4185 Delete Start >*/
            //return 0;
            /*< LYW 20220610 - #4185 Delete End >*/
         }
      }
@@ -9575,6 +9807,15 @@
            vectorPosX.push_back(dDefectPosX);
            vectorPosY.push_back(dDefectPosY);            
         }
      }
      if (vectorPosX.empty() == TRUE)
      {
         //3360 LYW_ CF AOI QD Review WSI XY MotorMoving Error START
         g_pLog->DisplayMessage(_T("[GantryAutoGo] No Exist Send Point,TwoGantrySyncMode OFF!"), vectorPosX.size());
         g_pLog->DisplayMessage(_T("[GantryAutoGo] (%d)Gantry Path Send Fail"), pModuleStatus->GetGantryIndex()); //taek 210128
         pMotorControl->GantrySetTwoGantrySyncModeSend(0);
         //3360 LYW_ CF AOI QD Review WSI XY MotorMoving Error END
      }
      if (m_pSP2P->ISP2P_GetReviewProcessor()->CheckMotionComplete() == FALSE)
@@ -9934,13 +10175,15 @@
            int XAddr = pMotorControl->GetGantryCollisionXAddr(pModuleStatus->GetGantryIndex());
            g_pLog->DisplayMessage(_T("[Review_CollisionPos] %d Module, Addr: %d, PosX: %.3lf mm"), nModuleIdx, XAddr, dCollisionPosX);
            ///pGlassResult->SetCollisionXPos(nModuleIdx, dCollisionPosX);
            //pGlassResult->SetCollisionXPos(nModuleIdx, dCollisionPosX);
         }
         else
         {
            int XAddr = pMotorControl->GetGantryCollisionXAddr(pModuleStatus->GetGantryIndex());
            g_pLog->DisplayMessage(_T("[Collision Position Set Fail] %d Module, Addr: %d, PosX: %.3lfmm"), nModuleIdx, XAddr, dCollisionPosX);
            return 0;
            /*< LYW 20220610 - #4185 Delete Start >*/
            //return 0;
            /*< LYW 20220610 - #4185 Delete End >*/
         }
         // get result index
         int nStartIdx = pWsiMultiShotResult->GetStartSReviewResultIndex();
@@ -10439,6 +10682,30 @@
   }   
}
/*< LYW 20220610 - #4185 ADD Start >*/
void CSequenceProcessor_CPJT::CheckGantryMode()
{
   CSignalControl* pSignalControl = m_pSP2P->ISP2P_GetSignalControl();
   if (pSignalControl == NULL) m_pSP2P->ISP2P_DisplayMessage(_T("[CheckGantryMode] SignalControl is NULL"));
   if (pSignalControl->IsConnected() == FALSE) m_pSP2P->ISP2P_DisplayMessage(_T("[CheckGantryMode] SignalControl is Not Connect"));
   int LeftGantryUse = 0;
   int RightGantryUse = 0;
   pSignalControl->ReadData(_T("10003"), 1, 1, LeftGantryUse);
   pSignalControl->ReadData(_T("10003"), 2, 1, RightGantryUse);
   if (LeftGantryUse == 1 && RightGantryUse == 0)
      m_pSP2P->ISP2P_Recipe_GetRsRcpReviewInfo()->GetRcpSchedulingInfo()->SetSingleGantryPath(1);
   else if (LeftGantryUse == 0 && RightGantryUse == 1)
      m_pSP2P->ISP2P_Recipe_GetRsRcpReviewInfo()->GetRcpSchedulingInfo()->SetSingleGantryPath(2);
   else
      m_pSP2P->ISP2P_Recipe_GetRsRcpReviewInfo()->GetRcpSchedulingInfo()->SetSingleGantryPath(0);
   m_pSP2P->ISP2P_DisplayMessage(_T("[CheckGantryMode] GantryMode LeftBit = %d, RightBit = %d"), LeftGantryUse, RightGantryUse);
}
/*< LYW 20220610 - #4185 ADD End >*/
BOOL CSequenceProcessor_CPJT::UpdateMemoryUserReflowPlanInfo(CDitGlassRawClient* pDitSharedGlassRaw)
{
   CRsRcpReviewInfo* pRecipeinfo = m_pSP2P->ISP2P_Recipe_GetRsRcpReviewInfo();