From c220de6f70051797e9d8b371830d06def9dc9cbd Mon Sep 17 00:00:00 2001 From: LYW <leeyeanwoo@diteam.co.kr> Date: 목, 30 6월 2022 11:02:23 +0900 Subject: [PATCH] 검사기 RawMessenger 동기화 --- ReviewSystem/ReviewSystem/SequenceProcessor_CPJT.cpp | 142 ++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 121 insertions(+), 21 deletions(-) diff --git a/ReviewSystem/ReviewSystem/SequenceProcessor_CPJT.cpp b/ReviewSystem/ReviewSystem/SequenceProcessor_CPJT.cpp index de293e5..9cbdfb2 100644 --- a/ReviewSystem/ReviewSystem/SequenceProcessor_CPJT.cpp +++ b/ReviewSystem/ReviewSystem/SequenceProcessor_CPJT.cpp @@ -665,8 +665,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 +942,8 @@ SetWsiType(-1); //wsi reflow SetLastPointCheck(FALSE); + SetReviewComplete(FALSE); + bFileFind = FALSE; /*< LYW 20211109 - #3662 Delete Start >*/ @@ -1116,6 +1124,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) @@ -1691,6 +1703,10 @@ if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_ReviewEndAck_CPJT)) m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] Send Review End Ack!")); } + + CGlassResult* pGlassResult = m_pSP2P->ISP2P_GetCurrentGlassResult(); + if (pGlassResult == NULL) return; + //#3584 210817 LYW CF AOI Review �떆裕щ젅�씠�뀡 湲곕뒫 �젙�긽�솕 MOD END //original // if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_ReviewEndAck_CPJT)) @@ -1710,7 +1726,19 @@ { Sleep(1000); } - ReJudgeProcessing(m_pDitGlassRaw); + /*< LYW 20220401 - ##4006 MOD Start >*/ + if (pGlassResult->m_AlignResult.GetResultCode() == Align_Success) + { + m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] Review ReJudgeProcessing Startl!")); + ReJudgeProcessing(m_pDitGlassRaw); + } + else + { + m_pSP2P->ISP2P_DisplayMessage(_T("Align Code = %d, ReJudgeProcessing SKIPl!"), pGlassResult->m_AlignResult.GetResultCode()); + } + /*< LYW 20220401 - ##4006 MOD End >*/ + //Origin + //ReJudgeProcessing(m_pDitGlassRaw); m_pDitGlassRaw->GetGlassData()->m_tmReviewEnd = CTime::GetCurrentTime(); if (m_pDitGlassRaw->isConnect() != FALSE) { @@ -1721,7 +1749,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) @@ -1729,6 +1758,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 @@ -1736,9 +1766,6 @@ // SendSignalToSignalControl(PCControlSendSignalIndex_Seq, PCControlSend_ReviewComplete_CPJT); // m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewStart] Send Review Success Signal!")); } - - CGlassResult* pGlassResult = m_pSP2P->ISP2P_GetCurrentGlassResult(); - if (pGlassResult==NULL) return; // review camera stop ReviewCamera_CameraControl(CameraControlStop); @@ -4272,7 +4299,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 >*/ } } @@ -4570,7 +4599,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 >*/ } } @@ -4823,7 +4854,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 >*/ } } @@ -7759,6 +7792,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; @@ -8034,6 +8070,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 >*/ @@ -8041,6 +8085,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 >*/ @@ -8184,13 +8237,22 @@ 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; @@ -9244,7 +9306,7 @@ AFM_SetAFMTracking(FALSE); SetWsiType(0); - WSIAllReadySignal(0); + WSIAllReadySignal(1); // send wsi start if(!WSIUserAllStartSignal()) @@ -9475,7 +9537,8 @@ VectorDouble vectorCollisionPosX; vectorCollisionPosX.clear(); - + //WSI + pMotorControl->GantrySetTwoGantrySyncModeSend(1); // WSI result count for (int nModuleIdx=0; nModuleIdx<Module_GetModuleStatusCount(); nModuleIdx++) @@ -9519,7 +9582,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 >*/ } } @@ -9562,6 +9627,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) @@ -9921,13 +9995,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(); @@ -10426,6 +10502,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(); -- Gitblit v1.9.3