| | |
| | | #include <fstream> |
| | | #include <afxwin.h> |
| | | |
| | | #include <sstream> /* < KJG 20230605 - #4517 ADD >*/ |
| | | #include <filesystem> /* < KJG 20230605 - #4517 ADD >*/ |
| | | |
| | | namespace fs = std::experimental::filesystem::v1; /* < KJG 20230605 - #4517 ADD >*/ |
| | | |
| | | |
| | | #define GLASS_GD_FILE_PATH _T("GD") |
| | | #define SIGNAL_SEND_RESULT_SUCCESS _T("OK") |
| | |
| | | |
| | | #define AOIRAWBIN_PATH "\\\\126.100.100.1\\d\\DIT_ResultData\\RawBin" |
| | | #define AOIRAWBIN_TEST_PATH "d:\\DIT_ResultData\\RawBin" |
| | | #define AOIRAWBIN_LOCAL_PATH "D:\\DIT_ResultData\\RawBin" |
| | | #define AOIRAWBIN_NETWORK_DRIVE_PATH "Y:\\RawBin" |
| | | |
| | | enum CPJT_MeasureMode { CPJT_ModeAuto = 0, CPJT_ModeManual }; |
| | |
| | | enum CPJT_GANTRY_TYPE { GantryType_Left, GantryType_Right }; |
| | | |
| | | enum Judgement_CPJT { |
| | | Judge_OK_CPJT = 0, Judge_RP_CPJT, Judge_NG_CPJT, Judge_TR_CPJT, Judge_PR_CPJT, Judge_PT_CPJT, Judge_Review_CPJT, Judge_RC_CPJT, Judge_Size_CPJT, Judge_VI_CPJT, Judge_Rework_CPJT, Judge_Unknown_CPJT |
| | | // Judge_OK_CPJT = 0, Judge_RP_CPJT, Judge_NG_CPJT, Judge_TR_CPJT, Judge_PR_CPJT, Judge_PT_CPJT, Judge_Review_CPJT, Judge_RC_CPJT, Judge_Size_CPJT, Judge_VI_CPJT, Judge_Rework_CPJT, Judge_Unknown_CPJT |
| | | Judge_OK_CPJT = 0, Judge_RP_CPJT, Judge_NG_CPJT, Judge_TR_CPJT, Judge_PR_CPJT, Judge_ND_CPJT, Judge_PT_CPJT, Judge_Review_CPJT, Judge_RC_CPJT, Judge_Size_CPJT, Judge_VI_CPJT, Judge_Rework_CPJT, Judge_LN_CPJT, Judge_Unknown_CPJT, Judge_SR_CPJT ////< KEJ 20231123 - #4669 MOD > |
| | | }; |
| | | enum JudgeCode_CPJT { |
| | | TRDF_CPJT = 0, BATR_CPJT, DOBB_CPJT, DOBS_CPJT, DOWW_CPJT, DOWB_CPJT, DOWS_CPJT |
| | |
| | | //SetUploadResultFailCount(0); |
| | | |
| | | bFileFind = FALSE; |
| | | |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading] FileMonitor Thread Stop Ready")); |
| | | m_pSP2P->ISP2P_GetReviewProcessor()->FileMonitorThreadStop(); /* < KJG 20230630 - #4517 ADD Start >*/ |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::GlassLoading] FileMonitor Thread Stop Complete")); |
| | | |
| | | /*< LYW 20211109 - #3662 Delete Start >*/ |
| | | //m_pSP2P->ISP2P_GetDiagnosisHistory(); |
| | |
| | | //#3584 210817 LYW CF AOI Review 시뮬레이션 기능 정상화 MOD END |
| | | // if (SendSignalToSignalControl(PCControlSendSignalIndex_Ack, PCControlSend_ReviewUnloadingAck_CPJT)) |
| | | // m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewStart] Send Review Unloading Ack!")); |
| | | |
| | | |
| | | /* < KEJ 20240621 - #4942 ADD Start > */ |
| | | STransferData* pTransferData = m_pSP2P->ISP2P_GetCurrentTransferData(); |
| | | CString strGlassStepIdTemp = pTransferData->strStepID; |
| | | CString strGlassIDTemp = pTransferData->strGlassID; |
| | | |
| | | CString strFileName; |
| | | strFileName.Format(_T("%s\\%s_%s.bin"), AOIRAWBIN_LOCAL_PATH, strGlassIDTemp, strGlassStepIdTemp); |
| | | |
| | | CFile file; |
| | | if (file.Open(strFileName, CFile::modeRead)) |
| | | { |
| | | file.Close(); |
| | | DeleteFile(strFileName); |
| | | g_pLog->DisplayMessage(_T("[SequenceProcessor] Delete RAW BIN File [%s]"), strFileName); |
| | | } |
| | | file.Close(); |
| | | /* < KEJ 20240621 - #4942 ADD End > */ |
| | | |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::IN] FileMonitor Thread Start Ready")); |
| | | m_pSP2P->ISP2P_GetReviewProcessor()->FileMonitorThreadStart(); /* < KJG 20230630 - #4517 ADD Start >*/ |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::IN] FileMonitor Thread Start Complete")); |
| | | } |
| | | |
| | | |
| | |
| | | int nCount = pRcpReviewInfo->GetRcpJudgeCellDefectCount(); |
| | | int nOK; |
| | | |
| | | int nCellTRJudge = 0, nCelllOKJuge = 0, nCelllPRJuge = 0; |
| | | int nCellTRJudge = 0, nCelllOKJuge = 0, nCelllPRJuge = 0, nCelllPTJuge = 0; |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[ReviewEnd] Start Cell Defect Rejudge")); |
| | | for (int nCellIndex = 0; nCellIndex < nCellCount; nCellIndex++) |
| | | { |
| | |
| | | { |
| | | nCelllPRJuge = nCelllPRJuge + 1; |
| | | } |
| | | /* < KEJ 20231123 - #4669 ADD Start > */ |
| | | else if (pRawData->GetCellData(nCellIndex)->m_nJudgement == Judge_PT_CPJT) |
| | | { |
| | | nCelllPTJuge = nCelllPTJuge + 1; |
| | | } |
| | | /* < KEJ 20231123 - #4669 ADD End > */ |
| | | |
| | | BOOL bReJudge = FALSE, bSubReJudge = FALSE; |
| | | |
| | |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]ELSE Cell DefectPRCount[%d] [%d]"), nCellIndex, pRawData->GetCellData(nCellIndex)->m_nDefectNumJudgePR, pRcpJudgeInfo->GetJudgeCount()); |
| | | } |
| | | break; |
| | | /* < KEJ 20231123 - #4669 ADD Start > */ |
| | | case JudgeType_T8_PT: |
| | | if (pRawData->GetCellData(nCellIndex)->m_nDefectNumJudgePT >= pRcpJudgeInfo->GetJudgeCount()) |
| | | { |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell DefectPTCount[%d] >= [%d]"), nCellIndex, pRawData->GetCellData(nCellIndex)->m_nDefectNumJudgePT, pRcpJudgeInfo->GetJudgeCount()); |
| | | bReJudge = TRUE; |
| | | } |
| | | else |
| | | { |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]ELSE Cell DefectPTCount[%d] [%d]"), nCellIndex, pRawData->GetCellData(nCellIndex)->m_nDefectNumJudgePT, pRcpJudgeInfo->GetJudgeCount()); |
| | | } |
| | | break; |
| | | /* < KEJ 20231123 - #4669 ADD End > */ |
| | | } |
| | | |
| | | // 2nd condition |
| | |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]ELSE Cell DefectPRCount[%d] [%d]"), nCellIndex, pRawData->GetCellData(nCellIndex)->m_nDefectNumJudgePR, pRcpJudgeInfo->GetSubJudgeCount()); |
| | | } |
| | | break; |
| | | /* < KEJ 20231123 - #4669 ADD Start > */ |
| | | case JudgeType_T8_PT: |
| | | if (pRawData->GetCellData(nCellIndex)->m_nDefectNumJudgePT <= pRcpJudgeInfo->GetSubJudgeCount()) |
| | | { |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell DefectPTCount[%d] <= [%d]"), nCellIndex, pRawData->GetCellData(nCellIndex)->m_nDefectNumJudgePT, pRcpJudgeInfo->GetSubJudgeCount()); |
| | | bSubReJudge = TRUE; |
| | | } |
| | | else |
| | | { |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]ELSE Cell DefectPTCount[%d] [%d]"), nCellIndex, pRawData->GetCellData(nCellIndex)->m_nDefectNumJudgePT, pRcpJudgeInfo->GetSubJudgeCount()); |
| | | } |
| | | break; |
| | | /* < KEJ 20231123 - #4669 ADD End > */ |
| | | } |
| | | |
| | | if (bReJudge & bSubReJudge) |
| | |
| | | { |
| | | nCelllOKJuge = 0; |
| | | } |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition CELL COUNT OK:[%d] TR[%d] PR[%d]") |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition CELL COUNT OK:[%d] TR[%d] PR[%d] PT[%d]") |
| | | , nCellIndex, nIdx, nCelllOKJuge, nCellTRJudge,nCelllPRJuge); |
| | | } |
| | | else if (pRawData->GetCellData(nCellIndex)->m_nJudgement==Judge_PR_CPJT) |
| | |
| | | { |
| | | nCelllPRJuge = 0; |
| | | } |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition CELL COUNT OK:[%d] TR[%d] PR[%d]") |
| | | , nCellIndex, nIdx, nCelllOKJuge, nCellTRJudge, nCelllPRJuge); |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition CELL COUNT OK:[%d] TR[%d] PR[%d] PT[%d]") |
| | | , nCellIndex, nIdx, nCelllOKJuge, nCellTRJudge, nCelllPRJuge, nCelllPTJuge); |
| | | } |
| | | /* < KEJ 20231123 - #4669 ADD Start > */ |
| | | else if (pRawData->GetCellData(nCellIndex)->m_nJudgement == Judge_PT_CPJT) |
| | | { |
| | | int nbfJudge = pRawData->GetCellData(nCellIndex)->m_nJudgement; |
| | | pRawData->GetCellData(nCellIndex)->m_nJudgement = Judge_TR_CPJT; |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition : ReJudge Cell Defect Grade! [%d]->[%s]") |
| | | , nCellIndex, nIdx, nbfJudge, pRcpJudgeInfo->GetReJudgeCode()); |
| | | |
| | | |
| | | nCelllPTJuge -= 1; |
| | | nCellTRJudge += 1; |
| | | |
| | | if (nCelllPTJuge < 0) |
| | | { |
| | | nCelllPTJuge = 0; |
| | | } |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition CELL COUNT OK:[%d] TR[%d] PR[%d] PT[%d]") |
| | | , nCellIndex, nIdx, nCelllOKJuge, nCellTRJudge, nCelllPRJuge, nCelllPTJuge); |
| | | } |
| | | /* < KEJ 20231123 - #4669 ADD End > */ |
| | | else |
| | | { |
| | | |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[TEST Process::ReviewEnd][%02d]Cell [%02d] ReJudge Cell Defect Grade! [%s]->[%s]"), nCellIndex, nIdx,_T("TR"), _T("TR")); |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition CELL COUNT OK:[%d] TR[%d] PR[%d]") |
| | | , nCellIndex, nIdx, nCelllOKJuge, nCellTRJudge, nCelllPRJuge); |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition CELL COUNT OK:[%d] TR[%d] PR[%d] PT[%d]") |
| | | , nCellIndex, nIdx, nCelllOKJuge, nCellTRJudge, nCelllPRJuge, nCelllPTJuge); |
| | | } |
| | | } |
| | | else if (pRcpJudgeInfo->GetReJudgeType() == JudgeType_T8_PR) |
| | |
| | | { |
| | | nCelllOKJuge = 0; |
| | | } |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition CELL COUNT OK:[%d] TR[%d] PR[%d]") |
| | | , nCellIndex, nIdx, nCelllOKJuge, nCellTRJudge, nCelllPRJuge); |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition CELL COUNT OK:[%d] TR[%d] PR[%d] PT[%d]") |
| | | , nCellIndex, nIdx, nCelllOKJuge, nCellTRJudge, nCelllPRJuge, nCelllPTJuge); |
| | | } |
| | | if (pRawData->GetCellData(nCellIndex)->m_nJudgement == Judge_TR_CPJT) |
| | | { |
| | |
| | | { |
| | | nCellTRJudge = 0; |
| | | } |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition CELL COUNT OK:[%d] TR[%d] PR[%d]") |
| | | , nCellIndex, nIdx, nCelllOKJuge, nCellTRJudge, nCelllPRJuge); |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition CELL COUNT OK:[%d] TR[%d] PR[%d] PT[%d]") |
| | | , nCellIndex, nIdx, nCelllOKJuge, nCellTRJudge, nCelllPRJuge, nCelllPTJuge); |
| | | } |
| | | /* < KEJ 20231123 - #4669 ADD Start > */ |
| | | if (pRawData->GetCellData(nCellIndex)->m_nJudgement == Judge_PT_CPJT) |
| | | { |
| | | int nbfJudge = pRawData->GetCellData(nCellIndex)->m_nJudgement; |
| | | pRawData->GetCellData(nCellIndex)->m_nJudgement = Judge_PR_CPJT; |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition : ReJudge Cell Defect Grade! [%d]->[%s]") |
| | | , nCellIndex, nIdx, nbfJudge, pRcpJudgeInfo->GetReJudgeCode()); |
| | | |
| | | |
| | | nCelllPTJuge -= 1; |
| | | nCelllPRJuge += 1; |
| | | |
| | | if (nCelllPTJuge < 0) |
| | | { |
| | | nCelllPTJuge = 0; |
| | | } |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition CELL COUNT OK:[%d] TR[%d] PR[%d] PT[%d]") |
| | | , nCellIndex, nIdx, nCelllOKJuge, nCellTRJudge, nCelllPRJuge, nCelllPTJuge); |
| | | } |
| | | /* < KEJ 20231123 - #4669 ADD End > */ |
| | | else |
| | | { |
| | | |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[TEST Process::ReviewEnd][%02d]Cell [%02d] ReJudge Cell Defect Grade! [%s]->[%s]"), nCellIndex, nIdx, _T("PR"), _T("PR")); |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition CELL COUNT OK:[%d] TR[%d] PR[%d]") |
| | | , nCellIndex, nIdx, nCelllOKJuge, nCellTRJudge, nCelllPRJuge); |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition CELL COUNT OK:[%d] TR[%d] PR[%d] PT[%d]") |
| | | , nCellIndex, nIdx, nCelllOKJuge, nCellTRJudge, nCelllPRJuge, nCelllPTJuge); |
| | | } |
| | | } |
| | | /* < KEJ 20231123 - #4669 ADD Start > */ |
| | | else if (pRcpJudgeInfo->GetReJudgeType() == JudgeType_T8_PT) |
| | | { |
| | | if (pRawData->GetCellData(nCellIndex)->m_nJudgement == Judge_OK_CPJT) |
| | | { |
| | | int nbfJudge = pRawData->GetCellData(nCellIndex)->m_nJudgement; |
| | | pRawData->GetCellData(nCellIndex)->m_nJudgement = Judge_PT_CPJT; |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition : ReJudge Cell Defect Grade! [%d]->[%s]") |
| | | , nCellIndex, nIdx, nbfJudge, pRcpJudgeInfo->GetReJudgeCode()); |
| | | |
| | | |
| | | nCelllOKJuge -= 1; |
| | | nCelllPTJuge += 1; |
| | | |
| | | if (nCelllOKJuge < 0) |
| | | { |
| | | nCelllOKJuge = 0; |
| | | } |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition CELL COUNT OK:[%d] TR[%d] PR[%d] PT[%d]") |
| | | , nCellIndex, nIdx, nCelllOKJuge, nCellTRJudge, nCelllPRJuge, nCelllPTJuge); |
| | | } |
| | | if (pRawData->GetCellData(nCellIndex)->m_nJudgement == Judge_TR_CPJT) |
| | | { |
| | | int nbfJudge = pRawData->GetCellData(nCellIndex)->m_nJudgement; |
| | | pRawData->GetCellData(nCellIndex)->m_nJudgement = Judge_PT_CPJT; |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition : ReJudge Cell Defect Grade! [%d]->[%s]") |
| | | , nCellIndex, nIdx, nbfJudge, pRcpJudgeInfo->GetReJudgeCode()); |
| | | |
| | | |
| | | nCellTRJudge -= 1; |
| | | nCelllPTJuge += 1; |
| | | |
| | | if (nCellTRJudge < 0) |
| | | { |
| | | nCellTRJudge = 0; |
| | | } |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition CELL COUNT OK:[%d] TR[%d] PR[%d] PT[%d]") |
| | | , nCellIndex, nIdx, nCelllOKJuge, nCellTRJudge, nCelllPRJuge, nCelllPTJuge); |
| | | } |
| | | if (pRawData->GetCellData(nCellIndex)->m_nJudgement == Judge_PR_CPJT) |
| | | { |
| | | int nbfJudge = pRawData->GetCellData(nCellIndex)->m_nJudgement; |
| | | pRawData->GetCellData(nCellIndex)->m_nJudgement = Judge_PT_CPJT; |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition : ReJudge Cell Defect Grade! [%d]->[%s]") |
| | | , nCellIndex, nIdx, nbfJudge, pRcpJudgeInfo->GetReJudgeCode()); |
| | | |
| | | |
| | | nCelllPRJuge -= 1; |
| | | nCelllPTJuge += 1; |
| | | |
| | | if (nCelllPRJuge < 0) |
| | | { |
| | | nCelllPRJuge = 0; |
| | | } |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition CELL COUNT OK:[%d] TR[%d] PR[%d] PT[%d]") |
| | | , nCellIndex, nIdx, nCelllOKJuge, nCellTRJudge, nCelllPRJuge, nCelllPTJuge); |
| | | } |
| | | else |
| | | { |
| | | |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[TEST Process::ReviewEnd][%02d]Cell [%02d] ReJudge Cell Defect Grade! [%s]->[%s]"), nCellIndex, nIdx, _T("PT"), _T("PT")); |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition CELL COUNT OK:[%d] TR[%d] PR[%d] PT[%d]") |
| | | , nCellIndex, nIdx, nCelllOKJuge, nCellTRJudge, nCelllPRJuge, nCelllPTJuge); |
| | | } |
| | | } |
| | | /* < KEJ 20231123 - #4669 ADD End > */ |
| | | else//OK |
| | | { |
| | | if (pRawData->GetCellData(nCellIndex)->m_nJudgement == Judge_OK_CPJT || pRawData->GetCellData(nCellIndex)->m_nJudgement == Judge_Unknown_CPJT) |
| | | { |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[TEST Process::ReviewEnd][%02d]Cell [%02d] ReJudge Cell Defect Grade! [%s]->[%s]"), nCellIndex, nIdx,_T("OK"), _T("OK")); |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition CELL COUNT OK:[%d] TR[%d] PR[%d]") |
| | | , nCellIndex, nIdx, nCelllOKJuge, nCellTRJudge, nCelllPRJuge); |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition CELL COUNT OK:[%d] TR[%d] PR[%d] PT[%d]") |
| | | , nCellIndex, nIdx, nCelllOKJuge, nCellTRJudge, nCelllPRJuge, nCelllPTJuge); |
| | | } |
| | | else |
| | | { |
| | |
| | | nCelllPRJuge = 0; |
| | | } |
| | | } |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition CELL COUNT OK:[%d] TR[%d] PR[%d]") |
| | | , nCellIndex, nIdx, nCelllOKJuge, nCellTRJudge, nCelllPRJuge); |
| | | /* < KEJ 20231123 - #4669 ADD Start > */ |
| | | else if (pRawData->GetCellData(nCellIndex)->m_nJudgement == Judge_PT_CPJT) |
| | | { |
| | | nCelllOKJuge += 1; |
| | | nCelllPTJuge -= 1; |
| | | |
| | | if (nCelllPTJuge < 0) |
| | | { |
| | | nCelllPTJuge = 0; |
| | | } |
| | | } |
| | | /* < KEJ 20231123 - #4669 ADD End > */ |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]Cell [%02d]Condition CELL COUNT OK:[%d] TR[%d] PR[%d] PT[%d]") |
| | | , nCellIndex, nIdx, nCelllOKJuge, nCellTRJudge, nCelllPRJuge, nCelllPTJuge); |
| | | |
| | | } |
| | | } |
| | |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]ELSE GLASS Defect PR Count[%d] [%d]"), nIdx, pRawData->GetGlassData()->m_nDefectNumJudgePR, pRcpJudgeInfo->GetJudgeCount()); |
| | | } |
| | | break; |
| | | /* < KEJ 20231123 - #4669 ADD Start > */ |
| | | case JudgeType_T8_PT: |
| | | if (pRawData->GetGlassData()->m_nDefectNumJudgePT >= pRcpJudgeInfo->GetJudgeCount()) |
| | | { |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]GLASS Defect PT Count[%d] >= [%d]"), nIdx, pRawData->GetGlassData()->m_nDefectNumJudgePT, pRcpJudgeInfo->GetJudgeCount()); |
| | | bReJudge = TRUE; |
| | | } |
| | | else |
| | | { |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]ELSE GLASS Defect PT Count[%d] [%d]"), nIdx, pRawData->GetGlassData()->m_nDefectNumJudgePT, pRcpJudgeInfo->GetJudgeCount()); |
| | | } |
| | | break; |
| | | /* < KEJ 20231123 - #4669 ADD End > */ |
| | | |
| | | } |
| | | |
| | |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]ELSE GLASS Defect PR Count[%d] [%d]"), nIdx, pRawData->GetGlassData()->m_nDefectNumJudgePR, pRcpJudgeInfo->GetSubJudgeCount()); |
| | | } |
| | | break; |
| | | /* < KEJ 20231123 - #4669 ADD Start > */ |
| | | case JudgeType_T8_PT: |
| | | if (pRawData->GetGlassData()->m_nDefectNumJudgePT <= pRcpJudgeInfo->GetSubJudgeCount()) |
| | | { |
| | | bSubReJudge = TRUE; |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]GLASS Defect PT Count[%d] <= [%d]"), nIdx, pRawData->GetGlassData()->m_nDefectNumJudgePT, pRcpJudgeInfo->GetSubJudgeCount()); |
| | | } |
| | | else { |
| | | m_pSP2P->ISP2P_DisplayMessage(_T("[SequenceProcessor::ReviewEnd] [%02d]ELSE GLASS Defect PT Count[%d] [%d]"), nIdx, pRawData->GetGlassData()->m_nDefectNumJudgePT, pRcpJudgeInfo->GetSubJudgeCount()); |
| | | } |
| | | break; |
| | | /* < KEJ 20231123 - #4669 ADD End > */ |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | BOOL CSequenceProcessor_CPJT::FindRawBinFile(CString strFileName) |
| | | { |
| | | //210128 |
| | | CString strFilePath = _T(""); |
| | | //pData->GetGlassData()->m_strFileName; |
| | | //strcpy(pData->GetGlassData()->m_strPath, AOIRAWBIN_PATH); |
| | | //strcpy(pData->GetGlassData()->m_strPath, LOCAL_AOIRAWBIN_PATH); |
| | | /* < KEJ 20240621 - #4942 MOD Start > */ |
| | | // /* < KJG 20230605 - #4517 ADD Start >*/ |
| | | // auto FuncStringSplit = [](string Sentence, char Separator, vector<string>& vec) |
| | | // { |
| | | // stringstream ss(Sentence); |
| | | // string tmp; |
| | | // |
| | | // while (getline(ss, tmp, Separator)) { |
| | | // vec.push_back(tmp); |
| | | // } |
| | | // }; |
| | | // /* < KJG 20230605 - #4517 ADD End >*/ |
| | | // |
| | | // //210128 |
| | | // CString strFilePath = _T(""); |
| | | // //pData->GetGlassData()->m_strFileName; |
| | | // //strcpy(pData->GetGlassData()->m_strPath, AOIRAWBIN_PATH); |
| | | // //strcpy(pData->GetGlassData()->m_strPath, LOCAL_AOIRAWBIN_PATH); |
| | | // |
| | | // strFilePath = AOIRAWBIN_PATH; |
| | | // |
| | | // CString strFindFile; |
| | | // int nCloseTime = 600 * 100000;//sec |
| | | // int nReTryTime = 30; |
| | | // { |
| | | // CTime tmReviewLoading = CTime::GetCurrentTime(); |
| | | // CString strWild; |
| | | // //strWild.Format("%s\\%s_*.bin", strFilePath, strFileName); |
| | | // CakFileUtil akFileFinder; |
| | | // while (nReTryTime--) |
| | | // { |
| | | // //#3359_LYW CF AOI Review REVIEW_LOADING_COMPLETE_TIMEOVER START |
| | | // if (nReTryTime%2 == 0) |
| | | // { |
| | | // strFilePath = AOIRAWBIN_NETWORK_DRIVE_PATH; |
| | | // } |
| | | // else strFilePath = AOIRAWBIN_PATH; |
| | | // |
| | | // //strWild.Format("%s\\%s_*.bin", strFilePath, strFileName); /* < KJG 20230605 - #4517 DEL >*/ |
| | | // //akFileFinder.FindFile(strWild.GetBuffer(0), FALSE); /* < KJG 20230605 - #4517 DEL >*/ |
| | | // |
| | | // /* < KJG 20230605 - #4517 ADD Start >*/ |
| | | // auto timeStart = chrono::steady_clock::now(); |
| | | // g_pLog->DisplayMessage(_T("[GlassLoading][FindRawBinFile] Start Find Path = %s, File Name = %s, TryCount = %d"), strFilePath, strFileName, 30 - nReTryTime); |
| | | // |
| | | // std::error_code err; |
| | | // vector<std::string> vtFileList; |
| | | // fs::path pathBinFile(strFilePath.GetBuffer(0)); |
| | | // int constexpr SaperatorCount = 4, DateSize = 8, TimeSize = 6; // GLASSID_STEPID_'YYYYMMDD'_'HHMMSS' 포맷 확인 |
| | | // for (auto iter = fs::directory_iterator(pathBinFile, err); iter != fs::directory_iterator(); iter++) |
| | | // { |
| | | // fs::path p = iter->path(); |
| | | // if (p.filename().stem().string().find(strFileName) != string::npos) |
| | | // { |
| | | // std::string strSearchFile = p.filename().stem().string(); |
| | | // if (p.extension().string() == _T(".bin")) |
| | | // { |
| | | // vtFileList.push_back(p.filename().stem().string()); |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // for (auto iter = vtFileList.begin(); iter != vtFileList.end(); ) |
| | | // { |
| | | // vector<string> vtSplit; |
| | | // FuncStringSplit(*iter, _T('_'), vtSplit); |
| | | // |
| | | // if (vtSplit.size() == SaperatorCount && vtSplit[2].size() == DateSize && vtSplit[3].size() == TimeSize) |
| | | // { |
| | | // iter++; |
| | | // } |
| | | // else |
| | | // { |
| | | // vtFileList.erase(iter); |
| | | // } |
| | | // } |
| | | // |
| | | // sort(vtFileList.begin(), vtFileList.end(), greater<>()); // 최신순으로 정렬 |
| | | // |
| | | // string strPickFileName = vtFileList.empty() ? _T("NULL") : vtFileList.front(); |
| | | // g_pLog->DisplayMessage(_T("[GlassLoading][FindRawBinFile] End File Count = %d, Pick File Name = %s, Tact = %d, ErrorCode = %d, ErrorMsg = %s"), vtFileList.size(), strPickFileName.c_str(), chrono::duration_cast<chrono::milliseconds>(chrono::steady_clock::now() - timeStart).count(),err.value(), err.message().c_str()); |
| | | // |
| | | // if (vtFileList.empty() == FALSE) |
| | | // { |
| | | // vector<string> vtSplit; |
| | | // FuncStringSplit(strPickFileName, _T('_'), vtSplit); |
| | | // |
| | | // CTime tmTemp(stoi(vtSplit[2].substr(0, 4)), stoi(vtSplit[2].substr(4, 2)), stoi(vtSplit[2].substr(6, 2)), stoi(vtSplit[3].substr(0, 2)), stoi(vtSplit[3].substr(2, 2)), stoi(vtSplit[3].substr(4, 2))); |
| | | // CTimeSpan tmSpan = tmReviewLoading - tmTemp; |
| | | // |
| | | // if (tmSpan < nCloseTime) |
| | | // { |
| | | // strFindFile = strPickFileName.c_str(); |
| | | // g_pLog->DisplayMessage(_T("[GlassLoading][FindRawBinFile] Find File Success")); |
| | | // break; |
| | | // } |
| | | // } |
| | | // /* < KJG 20230605 - #4517 ADD End >*/ |
| | | // |
| | | // /* < KJG 20230605 - #4517 DEL Start >*/ |
| | | // //#3359_LYW CF AOI Review REVIEW_LOADING_COMPLETE_TIMEOVER END |
| | | // //VECFINDDATA* pFindData = akFileFinder.getFindData(); |
| | | // //int nFileNamePos = strlen(akFileFinder.getProcessPath()); |
| | | // //std::map<LONGLONG, CString> mapSpanFileName; |
| | | // //for (int i = 0; i < pFindData->size(); i++) |
| | | // //{ |
| | | // // char* pFileName = &((*pFindData)[i]).name[nFileNamePos]; |
| | | // // { |
| | | // // CakParser parser; |
| | | // // parser.process(pFileName, "_."); |
| | | // // if (parser.getTokNum() < 4) continue; |
| | | // // |
| | | // // if (parser.getTokNum() >= 6) continue; // 0401 |
| | | // // |
| | | // // int nDataTime[8] = {}; |
| | | // // { |
| | | // // int nTokIndex = 0; |
| | | // // const char* pGlassId = parser.getTokStr(nTokIndex++); |
| | | // // const char* pStepId = parser.getTokStr(nTokIndex++); |
| | | // // char* pDate = &pFileName[parser.getTokPos(nTokIndex++)]; |
| | | // // char* pTime = &pFileName[parser.getTokPos(nTokIndex++)]; |
| | | // // |
| | | // // nDataTime[0] = (pDate[0] - '0') * 1000 + (pDate[1] - '0') * 100 + (pDate[2] - '0') * 10 + (pDate[3] - '0') * 1; |
| | | // // nDataTime[1] = (pDate[4] - '0') * 10 + (pDate[5] - '0') * 1; |
| | | // // nDataTime[2] = (pDate[6] - '0') * 10 + (pDate[7] - '0') * 1; |
| | | // // nDataTime[3] = (pTime[0] - '0') * 10 + (pTime[1] - '0') * 1; |
| | | // // nDataTime[4] = (pTime[2] - '0') * 10 + (pTime[3] - '0') * 1; |
| | | // // nDataTime[5] = (pTime[4] - '0') * 10 + (pTime[5] - '0') * 1; |
| | | // // } |
| | | // // |
| | | // // CTime tmTemp(nDataTime[0], nDataTime[1], nDataTime[2], nDataTime[3], nDataTime[4], nDataTime[5]); |
| | | // // CTimeSpan tmSpan = tmReviewLoading - tmTemp; |
| | | // // mapSpanFileName.insert(std::make_pair(tmSpan.GetTotalSeconds(), pFileName)); |
| | | // // } |
| | | // //} |
| | | // // |
| | | // //if (mapSpanFileName.empty() == FALSE) |
| | | // //{ |
| | | // // if (mapSpanFileName.begin()->first < nCloseTime) |
| | | // // { |
| | | // // strFindFile = mapSpanFileName.begin()->second; |
| | | // // break; |
| | | // // } |
| | | // //} |
| | | // // |
| | | // //akFileFinder.clear(); |
| | | // /* < KJG 20230605 - #4517 DEL End >*/ |
| | | // |
| | | // |
| | | // Sleep(100); |
| | | // } |
| | | // } |
| | | // if (strFindFile.IsEmpty()) return FALSE; |
| | | |
| | | strFilePath = AOIRAWBIN_PATH; |
| | | |
| | | CString strFilePath = _T(""); |
| | | |
| | | strFilePath = AOIRAWBIN_LOCAL_PATH; |
| | | CString strFindFile; |
| | | int nCloseTime = 600 * 100000;//sec |
| | | int nReTryTime = 30; |
| | | strFindFile.Format(_T("%s\\%s.bin"), strFilePath, strFileName); |
| | | |
| | | CFile file; |
| | | if (!file.Open(strFindFile, CFile::modeRead)) |
| | | { |
| | | CTime tmReviewLoading = CTime::GetCurrentTime(); |
| | | CString strWild; |
| | | //strWild.Format("%s\\%s_*.bin", strFilePath, strFileName); |
| | | CakFileUtil akFileFinder; |
| | | while (nReTryTime--) |
| | | { |
| | | //#3359_LYW CF AOI Review REVIEW_LOADING_COMPLETE_TIMEOVER START |
| | | if (nReTryTime%2 == 0) |
| | | { |
| | | strFilePath = AOIRAWBIN_PATH; |
| | | } |
| | | else strFilePath = AOIRAWBIN_NETWORK_DRIVE_PATH; |
| | | |
| | | strWild.Format("%s\\%s_*.bin", strFilePath, strFileName); |
| | | akFileFinder.FindFile(strWild.GetBuffer(0), FALSE); |
| | | //LYW LOG |
| | | g_pLog->DisplayMessage(_T("[GlassLoading][FindRawBinFile] Find Path = %s, RetryCount = %d, ResultCode = [%d]"), strFilePath, 30-nReTryTime, GetLastError()); |
| | | //#3359_LYW CF AOI Review REVIEW_LOADING_COMPLETE_TIMEOVER END |
| | | VECFINDDATA* pFindData = akFileFinder.getFindData(); |
| | | int nFileNamePos = strlen(akFileFinder.getProcessPath()); |
| | | std::map<LONGLONG, CString> mapSpanFileName; |
| | | for (int i = 0; i < pFindData->size(); i++) |
| | | { |
| | | char* pFileName = &((*pFindData)[i]).name[nFileNamePos]; |
| | | { |
| | | CakParser parser; |
| | | parser.process(pFileName, "_."); |
| | | if (parser.getTokNum() < 4) continue; |
| | | |
| | | if (parser.getTokNum() >= 6) continue; // 0401 |
| | | |
| | | int nDataTime[8] = {}; |
| | | { |
| | | int nTokIndex = 0; |
| | | const char* pGlassId = parser.getTokStr(nTokIndex++); |
| | | const char* pStepId = parser.getTokStr(nTokIndex++); |
| | | char* pDate = &pFileName[parser.getTokPos(nTokIndex++)]; |
| | | char* pTime = &pFileName[parser.getTokPos(nTokIndex++)]; |
| | | |
| | | nDataTime[0] = (pDate[0] - '0') * 1000 + (pDate[1] - '0') * 100 + (pDate[2] - '0') * 10 + (pDate[3] - '0') * 1; |
| | | nDataTime[1] = (pDate[4] - '0') * 10 + (pDate[5] - '0') * 1; |
| | | nDataTime[2] = (pDate[6] - '0') * 10 + (pDate[7] - '0') * 1; |
| | | nDataTime[3] = (pTime[0] - '0') * 10 + (pTime[1] - '0') * 1; |
| | | nDataTime[4] = (pTime[2] - '0') * 10 + (pTime[3] - '0') * 1; |
| | | nDataTime[5] = (pTime[4] - '0') * 10 + (pTime[5] - '0') * 1; |
| | | } |
| | | |
| | | CTime tmTemp(nDataTime[0], nDataTime[1], nDataTime[2], nDataTime[3], nDataTime[4], nDataTime[5]); |
| | | CTimeSpan tmSpan = tmReviewLoading - tmTemp; |
| | | mapSpanFileName.insert(std::make_pair(tmSpan.GetTotalSeconds(), pFileName)); |
| | | } |
| | | } |
| | | |
| | | if (mapSpanFileName.empty() == FALSE) |
| | | { |
| | | if (mapSpanFileName.begin()->first < nCloseTime) |
| | | { |
| | | strFindFile = mapSpanFileName.begin()->second; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | akFileFinder.clear(); |
| | | Sleep(100); |
| | | } |
| | | g_pLog->DisplayMessage(_T("[GlassLoading][FindRawBinFile] Bin File Is Not Collect [%s]"), strFindFile); |
| | | return FALSE; |
| | | } |
| | | file.Close(); |
| | | |
| | | if (strFindFile.IsEmpty()) return FALSE; |
| | | /* < KEJ 20240621 - #4942 MOD End > */ |
| | | |
| | | return TRUE; |
| | | } |