»õ ÆÄÀÏ |
| | |
| | | #include "StdAfx.h" |
| | | #include "GlassRawRTMS.h" |
| | | #include "akLoggerExt.h" |
| | | #include "GlassRawCSOT.h" |
| | | #include "MacroResultFile.h" |
| | | |
| | | #define RTMSTEMPPATH _T("D:\\DitRtms\\Data\\TempFile\\") |
| | | #define RTMSRAWPATH _T("D:\\DitRtms\\Data\\RawFile\\") |
| | | #define DEFECTPATH _T("D:\\Image\\Defect") |
| | | #define RTMSIMAGEPATH _T("D:\\DitRtms\\Data\\ReviewImage\\") |
| | | |
| | | char* g_pCellCode2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; |
| | | |
| | | //enum Judgement { Judge_OK = 0, Judge_RP, Judge_NG, Judge_TR, Judge_PR, Judge_PT, Judge_Review, Judge_RC, Judge_Size, Judge_VI, Judge_Rework, Judge_Unknown };//2016.07.13 LHS Judge_Size ì¶ê° |
| | | //enum DefectLocation { DefectLoc_Pattern = 0, DefectLoc_Crack, DefectLoc_BM, DefectLoc_ASG, DefectLoc_PAD, DefectLoc_C2C, DefectLoc_EdgeLine, DefectLoc_Proj, DefectLoc_Chip, DefectLoc_Corner }; |
| | | //enum SERVER_DefectType { DefectType_TBlack = 0, DefectType_TWhite, DefectType_RBlack, DefectType_RWhite, DefectType_BBlack, DefectType_BWhite, DefectType_Unknown }; |
| | | //enum SERVER_DefectSubType { DefectSubType_Normal = 0, DefectSubType_MC, DefectSubType_Mask, DefectSubType_Common, DefectSubType_NoDefect }; |
| | | |
| | | CGlassRawRTMS::CGlassRawRTMS(void) |
| | | { |
| | | } |
| | | |
| | | CGlassRawRTMS::~CGlassRawRTMS(void) |
| | | { |
| | | } |
| | | |
| | | BOOL CGlassRawRTMS::SequenceGlassLoading( CgrmGlassRawData* pData ) |
| | | { |
| | | return TRUE; |
| | | } |
| | | |
| | | BOOL CGlassRawRTMS::SequenceInspectEnd( CgrmGlassRawData* pData ) |
| | | { |
| | | WriteAOIFile(pData); |
| | | |
| | | return TRUE; |
| | | } |
| | | |
| | | BOOL CGlassRawRTMS::SequenceReviewStart( CgrmGlassRawData* pData ) |
| | | { |
| | | return TRUE; |
| | | } |
| | | |
| | | BOOL CGlassRawRTMS::SequenceReviewEnd( CgrmGlassRawData* pData ) |
| | | { |
| | | WriteAOIFile(pData); |
| | | |
| | | return TRUE; |
| | | } |
| | | |
| | | |
| | | BOOL CGlassRawRTMS::WriteAOIFile( CgrmGlassRawData* pData ) |
| | | { |
| | | BOOL bResult = TRUE; |
| | | |
| | | bResult &= MakeAOIPreProcessing(pData); |
| | | bResult &= MakeAOIFile(pData); |
| | | bResult &= CopyRTMSFiles(pData); |
| | | |
| | | if(bResult)AKLOG("Write RTMS File Complete"); |
| | | else AKLOG("Write RTMS File Fail"); |
| | | return TRUE; |
| | | } |
| | | |
| | | BOOL CGlassRawRTMS::MakeAOIFile( CgrmGlassRawData* pData ) |
| | | { |
| | | _grmGlassData* pGlass = pData->GetGlassData(); |
| | | |
| | | CString strFilePathName = m_strRTMSRAWFile; |
| | | |
| | | FILE* pf = fopen(strFilePathName.GetBuffer(0), "w"); |
| | | if(pf == NULL) return FALSE; |
| | | |
| | | |
| | | |
| | | CString strLine; |
| | | //Glass |
| | | { |
| | | CString strItems = "ITEM,GLASSITEM,LOTITEM,LOT_ID,LOT_TYPE,STEP_ID,EQUIPMENT_ID,EQUIPMENT_UNIT,GLS_ID,SLOT_ID,GLS_JUDGE,GLS_GRADE,PRODUCT_ID,CASSETTE_ID,OPERATOR_ID,RECIPE_NAME,AUTO_MODE,PNL_ORIGIN,PROCESSING_TIME,START_TIME,END_TIME,CAMERA_CNT,SCAN_CNT,INSP_TACT, REVIEW_TACT, CIM_ONOFF,PROCESS_ID,PROD_TYPE,BATCHID,H_PANELID,E_PANELID,P_PANELID,COMP_COUNT,PPID"; |
| | | fprintf(pf, "%s\n", strItems.GetBuffer(0)); |
| | | |
| | | makeDataGlass(strLine, pGlass); |
| | | |
| | | fprintf(pf, "%s\n", strLine); |
| | | } |
| | | |
| | | //Cell |
| | | { |
| | | CString strItems = "ITEM,CELLITEM,PANEL_ID,PANEL_GRADE,COORD_X,COORD_Y,CELL_SIZE_X,CELL_SIZE_Y,GATE_LINE,DATA_LINE,LAMP_GRAY_01,LAMP_GRAY_02,LAMP_GRAY_03,LAMP_GRAY_04"; |
| | | fprintf(pf, "%s\n", strItems.GetBuffer(0)); |
| | | |
| | | for(int iCell = 0; iCell < pData->GetGlassData()->m_nCellNum; iCell++) |
| | | { |
| | | _grmCellData* pCell = pData->GetCellData(iCell); |
| | | makeDataCell(strLine, pGlass, pCell); |
| | | fprintf(pf, "%s\n", strLine); |
| | | } |
| | | |
| | | } |
| | | |
| | | //Defect |
| | | { // DEFECT_TYPE_3 ë¹ ì§ // RTMS Defect ì ë³´ ì¶ê° [ 21-03-08 KJG ] |
| | | CString strItems = "ITEM,DEFITEM,POINT_NO,PANEL_ID,PR_X,PR_Y,PR_DATA,PR_GATE,SE_X,SE_Y,SE_DATA,SE_GATE,DEFECT_LAYER,DETECTED_AREA,DEFECT_SIZE_TYPE,DEFECT_SIZE_X,DEFECT_SIZE_Y,DEFECT_LENGTH,DEFECT_AREA,DEFECT_TYPE_1,DEFECT_TYPE_2,REPEAT_DEFECT,MASK_DEFECT,IMAGE_FILE1,IMAGE_FILE2,SCAN_NO,CAMERA_NO,RSCALE,SIZE_AREA,PEAK,REV_RESOLUTION,REV_CAMNUM,REV_MAG,DEFECT_CODE,DEFECT_GRADE,STACK_FLAG,STACK_COUNT,STACK_STEP,ZONE_NO,GRAY_MIN,GRAY_MAX,GRAY_AVG,R_GRAY_MIN,R_GRAY_MAX,R_GRAY_AVG"; |
| | | fprintf(pf, "%s\n", strItems.GetBuffer(0)); |
| | | |
| | | for(int iDefect = 0; iDefect < pData->GetGlassData()->m_nDefectNum; iDefect++) |
| | | { |
| | | _grmDefectData* pDefect = pData->GetDefectData(iDefect); |
| | | //210203 CJH - CutOff ëì ê²°ê³¼íì¼ ìì± ì ì¸ |
| | | if (pDefect->m_bDefectCutoff == TRUE) continue; |
| | | |
| | | makeDataDefect(strLine, pData->GetGlassData(), pData->GetCellData(pDefect->m_nCellIdx), pDefect); |
| | | fprintf(pf, "%s\n", strLine); |
| | | } |
| | | } |
| | | |
| | | //Camera |
| | | { |
| | | CString strItems = "ITEM,CAMERAITEM,SCAN_NO,CAMERA_NO,LAMP,MAX,AVG,MIN"; |
| | | fprintf(pf, "%s\n", strItems.GetBuffer(0)); |
| | | |
| | | for(int iScan=0; iScan < pGlass->m_nScanNum; iScan++) |
| | | { |
| | | for(int iCam=0; iCam < pGlass->m_nCameraNum; iCam++) |
| | | { |
| | | makeDataCamera(strLine, pGlass, iCam, iScan); |
| | | fprintf(pf, "%s\n", strLine); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //WSI |
| | | { |
| | | CString strItems = "ITEM,WSIITEM,WSI_NO,TYPE,NAME,JUDGE,CELLID,COORD_X,COORD_Y,COORD_X2,COORD_Y2,IMG_FILE_2D,IMAGE_FILE_3D,WSI_RESOLUTION"; |
| | | fprintf(pf, "%s\n", strItems.GetBuffer(0)); |
| | | |
| | | for(int iDefect = 0; iDefect < pGlass->m_nDefectNum; iDefect++) |
| | | { |
| | | _grmDefectData* pDefect = pData->GetDefectData(iDefect); |
| | | if(pDefect->m_ReviewDefect.m_nWsi_Type == 2) |
| | | { |
| | | makeDataWSI(strLine, &pDefect->m_ReviewDefect); |
| | | fprintf(pf, "%s\n", strLine); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //Mura |
| | | if(m_pMuraResultFile && m_pMuraResultFile->IsRead()) |
| | | { |
| | | CString strItems = "ITEM,MURAITEM,DATE,TIME,DEFECTNO,RECIPE,GLASSID,CELLID,COORD_X1,COORD_Y1,COORD_PX1,COORD_PY1,NOMURA,SIZE_W,SIZE_L,SIZE_S,MAIN_TYPE,SUB_TYPE,PEAK,G_MIN,G_MAX,G_AVG,CAM,SCAN,PIXEL_PEAK,REGION,SIZE_T,PEAK_T,IMG_FILE_NAME"; |
| | | fprintf(pf, "%s\n", strItems.GetBuffer(0)); |
| | | |
| | | _MacroDefect* pMuraDefect; |
| | | int nSize = (int)m_pMuraResultFile->GetDefectNum(); |
| | | |
| | | for(int iMuraDefect=0; iMuraDefect < nSize; iMuraDefect++) |
| | | { |
| | | pMuraDefect = m_pMuraResultFile->GetDefect(iMuraDefect); |
| | | makeMuraDefect(strLine, pMuraDefect); |
| | | fprintf(pf, "%s\n", strLine); |
| | | } |
| | | |
| | | } |
| | | |
| | | // Measure |
| | | if(0) |
| | | { |
| | | CString strItems = "ITEM,LOCITEM,MEASURE_NO,MEASURE_TYPE,MEASURE_NAME,CELL_ID,X_COORDINATE_1,Y_COORDINATE_1,X_COORDINATE_2,Y_COORDINATE_2,X_SHIFT,Y_SHIFT,IMAGENAME,SHIFTDIST,ACTIVETOSEALANT,SEALSIZE"; |
| | | fprintf(pf, "%s\n", strItems.GetBuffer(0)); |
| | | |
| | | // ì¬ì© ìí¨ |
| | | } |
| | | |
| | | // User Review |
| | | { |
| | | CString strItems = "ITEM,USERREVITEM,USER_NO,PR_X,PR_Y,IMAGE_FILE_NAME,REV_RESOLUTION"; |
| | | fprintf(pf, "%s\n", strItems.GetBuffer(0)); |
| | | |
| | | for(int iDefect = 0; iDefect < pGlass->m_nDefectNum; iDefect++) |
| | | { |
| | | _grmDefectData* pDefect = pData->GetDefectData(iDefect); |
| | | if(pDefect->m_ReviewDefect.m_nPlanType == ditRaw::RPT_User) |
| | | { |
| | | makeUserReview(strLine, &pDefect->m_ReviewDefect); |
| | | fprintf(pf, "%s\n", strLine); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | fclose(pf); |
| | | return TRUE; |
| | | } |
| | | |
| | | |
| | | void CGlassRawRTMS::makeDataGlass( CString& strLine, _grmGlassData* pGlassData ) |
| | | { |
| | | strLine.Empty(); |
| | | |
| | | CString strValue; |
| | | CString strDiv = ","; |
| | | |
| | | strValue.Format("DATA"); // ITEM |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("GLASSDATA"); // GLASSITEM |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("LOTDATA"); // LOTITEM |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", pGlassData->m_strLotID); // LOT_ID |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("LOTTYPE"); // LOT_TYPE |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", pGlassData->m_strStepID); // STEP_ID |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", pGlassData->m_strOperID); // EQUIPMENT_ID //210127 CJH - Equip ID <-> Oper ID |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", pGlassData->m_strEquipID); // EQUIPMENT_UNIT |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", pGlassData->m_strGlassID); // GLS_ID |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", pGlassData->m_strSLotID); // SLOT_ID |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", pGlassData->m_strGlassJudge); // GLAS_JUDGE |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", pGlassData->m_strGlassCode); // GLS_GRADE or Glass Code //**GRADEê° ì½ë? |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", pGlassData->m_strProductID); // PRODUCDT_ID |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", pGlassData->m_strCSTID); // CASSETTE_ID |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", pGlassData->m_strEPPID); // OPERATOR_ID |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", pGlassData->m_strRecipeName); // RECIPE_NAME |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", "AUTO_MODE"); // AUTOMODE |
| | | strLine += strValue+strDiv; |
| | | |
| | | if(pGlassData->m_nOriginDirection == 0) strValue.Format("Left Top"); // PNL_ORIGIN |
| | | else if(pGlassData->m_nOriginDirection == 1) strValue.Format("Right Top"); |
| | | else if(pGlassData->m_nOriginDirection == 10) strValue.Format("Left Bottom"); |
| | | else strValue.Format("Right Bottom"); |
| | | strLine += strValue+strDiv; |
| | | |
| | | strValue.Format("%s", "PROCESSING_TIME"); // PROCESSING_TIME |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%04d%02d%02d_%02d%02d%02d" // START_TIME |
| | | ,pGlassData->m_tmGlassLoading.GetYear() |
| | | ,pGlassData->m_tmGlassLoading.GetMonth() |
| | | ,pGlassData->m_tmGlassLoading.GetDay() |
| | | ,pGlassData->m_tmGlassLoading.GetHour() |
| | | ,pGlassData->m_tmGlassLoading.GetMinute() |
| | | ,pGlassData->m_tmGlassLoading.GetSecond() ); |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%04d%02d%02d_%02d%02d%02d" // END_TIME |
| | | ,pGlassData->m_tmInspectionEND.GetYear() |
| | | ,pGlassData->m_tmInspectionEND.GetMonth() |
| | | ,pGlassData->m_tmInspectionEND.GetDay() |
| | | ,pGlassData->m_tmInspectionEND.GetHour() |
| | | ,pGlassData->m_tmInspectionEND.GetMinute() |
| | | ,pGlassData->m_tmInspectionEND.GetSecond() ); |
| | | strLine += strValue+strDiv; |
| | | |
| | | strValue.Format("%d", pGlassData->m_nCameraNum); // CAMERA_CNT |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pGlassData->m_nScanNum); // SCAN_CNT |
| | | strLine += strValue+strDiv; |
| | | |
| | | strValue.Format("%d", pGlassData->m_tmInspectionEND-pGlassData->m_tmGlassLoading); // INSP_TACT |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pGlassData->m_tmReviewEnd - pGlassData->m_tmReviewLoading); // REVIEW_TACT |
| | | strLine += strValue + strDiv; |
| | | |
| | | strValue.Format("%s", "CIM_ONOFF"); |
| | | strLine += strValue + strDiv; // CIM_ONOFF -SM |
| | | //210128 CJH - RTMS SDC 물ë¥ë°ì´í° ì¶ê° |
| | | strValue.Format("%s", pGlassData->m_strProcessID); |
| | | strLine += strValue + strDiv; |
| | | strValue.Format("%s", pGlassData->m_strProdType); |
| | | strLine += strValue + strDiv; |
| | | CString strTemp; |
| | | strTemp = pGlassData->m_strGlassID; |
| | | strValue.Format("%s", strTemp.Left(6)); |
| | | strLine += strValue + strDiv; |
| | | strValue.Format("%s", pGlassData->m_strGlassID); |
| | | strLine += strValue + strDiv; |
| | | strValue.Format("%s", pGlassData->m_strEPPID); |
| | | strLine += strValue + strDiv; |
| | | strValue.Format("%s", pGlassData->m_strPairHPanelID); |
| | | strLine += strValue + strDiv; |
| | | strValue.Format("%d", pGlassData->m_nCellNum); |
| | | strLine += strValue + strDiv; |
| | | strValue.Format("%s", pGlassData->m_strPPID); |
| | | strLine += strValue; |
| | | |
| | | } |
| | | |
| | | |
| | | void CGlassRawRTMS::makeDataCell( CString& strLine, _grmGlassData* pGlassData, _grmCellData* pCellData ) |
| | | { |
| | | strLine.Empty(); |
| | | |
| | | CString strValue; |
| | | CString strDiv = ","; |
| | | |
| | | strValue.Format("DATA"); // ITEM |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("CELLDATA"); // CELLITEM |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s",pCellData->m_strCellName); // PANEL_ID |
| | | strLine += strValue+strDiv; |
| | | { |
| | | if(pCellData->m_nJudgement == Judge_OK) strValue = "Judge_OK"; // PANEL_GRADE // PNL_GRADE |
| | | else if(pCellData->m_nJudgement == Judge_NG) strValue = "Judge_NG"; |
| | | else if(pCellData->m_nJudgement == Judge_Rework) strValue = "Judge_Rework"; |
| | | else if(pCellData->m_nJudgement == Judge_RP) strValue = "Judge_RP"; |
| | | else if(pCellData->m_nJudgement == Judge_Review) strValue = "Judge_Review"; |
| | | else if(pCellData->m_nJudgement == Judge_RC) strValue = "Judge_RC"; // 미ì²ë¦¬ |
| | | else if(pCellData->m_nJudgement == Judge_Size) strValue = "Judge_Size"; //skip |
| | | else if (pCellData->m_nJudgement == Judge_TR) strValue = "Judge_TR"; |
| | | else if (pCellData->m_nJudgement == Judge_PR) strValue = "Judge_PR"; |
| | | else strValue = "Judge_OK"; |
| | | } |
| | | strLine += strValue+strDiv; |
| | | |
| | | strValue.Format("%d", pCellData->m_rectCellLeft); // COORD_X |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pCellData->m_rectCellTop); // COORD_Y |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pCellData->m_rectCellRight - pCellData->m_rectCellLeft); // CELL_SIZE_X |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pCellData->m_rectCellBottom - pCellData->m_rectCellTop); // CELL_SIZE_Y |
| | | strLine += strValue+strDiv; |
| | | |
| | | strValue.Format("%d", pCellData->m_nGateNum); // LN_GATE : Gate line ê°¯ì |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pCellData->m_nDataNum); // LN_DATA : Data line ê°¯ì |
| | | strLine += strValue+strDiv; |
| | | |
| | | strValue.Format("LAMP_GRAY_01"); // LAMP_GRAY_01 |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("LAMP_GRAY_02"); // LAMP_GRAY_02 |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("LAMP_GRAY_03"); // LAMP_GRAY_03 |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("LAMP_GRAY_04"); // LAMP_GRAY_04 |
| | | strLine += strValue+strDiv; |
| | | |
| | | } |
| | | |
| | | void CGlassRawRTMS::makeDataDefect( CString& strLine, _grmGlassData* pGlassData, _grmCellData* pCellData, _grmDefectData* pDefectData ) |
| | | { |
| | | strLine.Empty(); |
| | | |
| | | CString strValue; |
| | | CString strDiv = ","; |
| | | |
| | | strValue.Format("DATA"); // ITEM |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("DEFDATA"); // DEFITEM |
| | | strLine += strValue+strDiv; |
| | | |
| | | strValue.Format("%d", pDefectData->m_nDefectID); // POINT_NO |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%c%c", '0' + pDefectData->m_nCellIdx / 36, g_pCellCode2[pDefectData->m_nCellIdx % 36]); // PANEL_ID |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pDefectData->m_nUMOriginX); // PR_X |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pDefectData->m_nUMOriginY); // PR_Y |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pDefectData->m_nCellData); // PR_DATA |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pDefectData->m_nCellGate); // PR_GATE |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pDefectData->m_nUMCenterAlignX); // SE_X |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pDefectData->m_nUMCenterAlignY); // SE_Y |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pDefectData->m_nCellData); // SE_DATA |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pDefectData->m_nCellGate); // SE_GATE |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", "DEFECT_LAYER"); // DEFECT_LAYER |
| | | strLine += strValue+strDiv; |
| | | { |
| | | int m_nDefectedArea = pDefectData->m_sDefectLoc; // DEFECTED_AREA // DETECTED_AREA |
| | | if(m_nDefectedArea == DefectLoc_Pattern) strValue = "PATTERN"; |
| | | else if(m_nDefectedArea == DefectLoc_Crack) strValue = "CRACK"; |
| | | else if(m_nDefectedArea == DefectLoc_BM) strValue = "BM"; |
| | | else if(m_nDefectedArea == DefectLoc_ASG) strValue = "ASG"; |
| | | else if(m_nDefectedArea == DefectLoc_PAD) strValue = "PAD"; |
| | | else if(m_nDefectedArea == DefectLoc_C2C) strValue = "C2C"; |
| | | else if(m_nDefectedArea == DefectLoc_EdgeLine) strValue = "EdgeLine"; |
| | | else if(m_nDefectedArea == DefectLoc_Proj) strValue = "Proj"; |
| | | else if(m_nDefectedArea == DefectLoc_Chip) strValue = "Chip"; |
| | | else if(m_nDefectedArea == DefectLoc_Corner) strValue = "Corner"; |
| | | else strValue = ""; |
| | | } |
| | | strLine += strValue+strDiv; |
| | | { |
| | | int m_nDefectSizeType = pDefectData->m_DefectSizeType; // DEFECT_SIZE_TYPE // DEFECT_SIZE_TYPE |
| | | if(m_nDefectSizeType == 0) strValue = "S"; |
| | | else if(m_nDefectSizeType == 1) strValue = "M"; |
| | | else if(m_nDefectSizeType == 2) strValue = "L"; |
| | | else if(m_nDefectSizeType == 3) strValue = "H"; |
| | | else if(m_nDefectSizeType == 4) strValue = "U"; |
| | | else strValue = "S"; |
| | | } |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pDefectData->m_nUMSizeX); // DEFECT_SZE_X |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pDefectData->m_nUMSizeY); // DEFECT_SIZE_Y |
| | | strLine += strValue+strDiv; |
| | | |
| | | //strValue.Format("%s", "DEFECT_LENGTH"); // DEFECT_LENGTH |
| | | double dUmRscale = pDefectData->m_nDefectRScale * pDefectData->m_dScanResolution; |
| | | strValue.Format("%.2lf", dUmRscale); // DEFECT_LENGTH |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pDefectData->m_nPixelSize); // DEFECT_AREA |
| | | strLine += strValue+strDiv; |
| | | { |
| | | int m_nDefectType1 = pDefectData->m_DefectBDType; // DEFECT_TYPE_1 (B, W, Unknown) |
| | | if(m_nDefectType1==DefectType_TBlack || m_nDefectType1==DefectType_RBlack) strValue = "B"; |
| | | else if(m_nDefectType1==DefectType_TWhite || m_nDefectType1==DefectType_RWhite) strValue = "W"; |
| | | else strValue = "Unknown"; |
| | | } |
| | | strLine += strValue+strDiv; |
| | | { |
| | | // DEFECT_TYPE_2 (Normal / MC / Mask / Common / NoDefect) |
| | | int m_nDefectType2 = pDefectData->m_DefectSubType; |
| | | |
| | | if(m_nDefectType2 == DefectSubType_Normal) strValue = "Normal"; |
| | | else if(m_nDefectType2 == DefectSubType_MC) strValue = "MC"; |
| | | else if(m_nDefectType2 == DefectSubType_Mask) strValue = "Mask"; |
| | | else if(m_nDefectType2 == DefectSubType_Common) strValue = "Common"; |
| | | else if(m_nDefectType2 == DefectSubType_NoDefect) strValue = "NoDefect"; |
| | | else strValue = "UN"; |
| | | |
| | | } |
| | | strLine += strValue+strDiv; |
| | | |
| | | { |
| | | if(pDefectData->m_DefectSubType == DefectSubType_Common) strValue = "Y"; // REPEAT_DEFECT |
| | | else strValue = "N"; |
| | | } |
| | | strLine += strValue+strDiv; |
| | | { |
| | | if(pDefectData->m_DefectSubType == DefectSubType_Mask) strValue = "Y"; // MASK_DEFECT |
| | | else strValue = "N"; |
| | | } |
| | | strLine += strValue+strDiv; |
| | | |
| | | strValue.Format("%s", pDefectData->m_strAoiImageName); // IMAGE_FILE1 |
| | | strLine += strValue+strDiv; |
| | | |
| | | strValue.Format("%s", pDefectData->m_ReviewDefect.m_strRevImageName); // IMAGE_FILE2 |
| | | strLine += strValue+strDiv; |
| | | |
| | | strValue.Format("%d", pDefectData->m_nScanIdx); // SCAN_NO |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pDefectData->m_nCameraID); // CAMERA_NO |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pDefectData->m_nDefectRScale); // RSCALE |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pDefectData->m_nUMSize); // SIZE_AREA |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pDefectData->m_sDefectPeak); // PEAK |
| | | strLine += strValue+strDiv; |
| | | |
| | | float fReviewResol = 0.1725; //20ë°° ë¨ë°°ì¨ // 3.45/20 |
| | | strValue.Format("%.4lf", fReviewResol); // REV_RESOLUTION |
| | | strLine += strValue+strDiv; |
| | | |
| | | //210128 CJH - RTMS Review ì ë³´ ì¶ê° |
| | | if (strlen(pDefectData->m_ReviewDefect.m_strRevImageName)) |
| | | { |
| | | strValue.Format("%d", pDefectData->m_ReviewDefect.m_nModuleIndex); // REV_Cam Number |
| | | strLine += strValue + strDiv; |
| | | } |
| | | else |
| | | { |
| | | strValue.Format("-1"); |
| | | strLine += strValue + strDiv; |
| | | } |
| | | |
| | | strValue.Format("%d", 20); // REV_Magnification |
| | | strLine += strValue + strDiv; |
| | | |
| | | strValue.Format("%s", pDefectData->m_strDefectCode); // DEFECT_CODE, DEFECT_GRADE, STACK_FLAG, STACK_COUNT, STACK_STEP, ZONE_NO, GRAY_MIN, ...,R_SRC_AVG ì¶ê° [ 21-03-08 KJG ] |
| | | strLine += strValue + strDiv; // DEFECT_CODE |
| | | |
| | | strValue.Format("%s", GetDefectInfoToString(DMT_DefectJudge, pDefectData->m_DefectJudgement)); |
| | | strLine += strValue + strDiv; // DEFECT_GRADE |
| | | |
| | | int nStackFlag = pDefectData->m_StackInfo; // STACK_FLAG |
| | | if (nStackFlag == Stack_Unknown) strValue = "UK"; |
| | | else if (nStackFlag == Stack_TD) strValue = "TD"; |
| | | else if (nStackFlag == Stack_SD) strValue = "SD"; |
| | | else if (nStackFlag == Stack_PD) strValue = "PD"; |
| | | else if (nStackFlag == Stack_SP) strValue = "SP"; |
| | | else strValue = "UK"; |
| | | |
| | | strLine += strValue + strDiv; |
| | | |
| | | strValue.Format("%2d", pDefectData->m_nStackStepCount); // STACK_COUNT |
| | | strLine += strValue + strDiv; |
| | | |
| | | if (strlen(pDefectData->m_strStackFirst)) // STACK_STEP |
| | | { |
| | | strValue.Format("%s", pDefectData->m_strStackFirst); |
| | | strValue.Replace(',', '_'); // ì´ êµ¬ë¶ìê° ',' ì´ë¯ë¡ '_'ë¡ ë³ê²½ [ 21-03-15 KJG ] |
| | | strLine += strValue + strDiv; |
| | | } |
| | | else |
| | | { |
| | | strValue.Format(" "); |
| | | strLine += strValue + strDiv; |
| | | } |
| | | |
| | | int nValue = 0; // ZONE_NO |
| | | for (int i = 15; i >= 0; i--) |
| | | { |
| | | if (pDefectData->m_sZonePixelCount[i] > 0) |
| | | nValue += 1; |
| | | if (i > 0) |
| | | nValue = nValue << 1; |
| | | } |
| | | strValue.Format("%04X", nValue); |
| | | strLine += strValue + strDiv; |
| | | |
| | | strValue.Format("%d", pDefectData->m_nLevelSrcMin); // GRAY_MIN |
| | | strLine += strValue + strDiv; |
| | | |
| | | strValue.Format("%d", pDefectData->m_nLevelSrcMax); // GRAY_MAX |
| | | strLine += strValue + strDiv; |
| | | |
| | | strValue.Format("%d", pDefectData->m_nLevelSrcAvg); // GRAY_AVG |
| | | strLine += strValue + strDiv; |
| | | |
| | | strValue.Format("%d", pDefectData->m_nLevelRefMin); // R_SRC_MIN |
| | | strLine += strValue + strDiv; |
| | | |
| | | strValue.Format("%d", pDefectData->m_nLevelRefMax); // R_SRC_MAX |
| | | strLine += strValue + strDiv; |
| | | |
| | | strValue.Format("%d", pDefectData->m_nLevelRefAvg); // R_SRC_AVG |
| | | strLine += strValue + strDiv; |
| | | |
| | | } |
| | | |
| | | void CGlassRawRTMS::makeDataCamera( CString& strLine, _grmGlassData* pGlassData, int nCamIdx, int nScanIdx ) |
| | | { |
| | | strLine.Empty(); |
| | | |
| | | CString strValue; |
| | | CString strDiv = ","; |
| | | |
| | | strValue.Format("DATA"); |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("CAMERADATA"); |
| | | strLine += strValue+strDiv; |
| | | |
| | | strValue.Format("%d", nScanIdx); |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", nCamIdx); |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("LAMP"); |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pGlassData->m_nGrayLevelMax[pGlassData->m_nCameraNum*nScanIdx + nCamIdx]); |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pGlassData->m_nGrayLevelAvg[pGlassData->m_nCameraNum*nScanIdx + nCamIdx]); |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pGlassData->m_nGrayLevelMin[pGlassData->m_nCameraNum*nScanIdx + nCamIdx]); |
| | | strLine += strValue+strDiv; |
| | | } |
| | | |
| | | void CGlassRawRTMS::makeDataWSI( CString& strLine, _grmDefectReviewData* pWSIData ) |
| | | { |
| | | strLine.Empty(); |
| | | |
| | | CString strValue; |
| | | CString strDiv = ","; |
| | | |
| | | strValue.Format("DATA"); // ITEM |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("WSIDATA"); // USERREVITEM |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s","USER_NO"); // USER_NO |
| | | strLine += strValue+strDiv; |
| | | |
| | | // 주ì ì²ë¦¬ ë¶ë¶ ë°ì´í° ë¤ì´ì¤ë©´ ì¸ ê² |
| | | //CString strWSIType; |
| | | //if (pWSIData->m_fWsi_ResultData[0] == 1) |
| | | // strWSIType.Format("%s", "Positive"); // ë기 |
| | | //else if (pWSIData->m_fWsi_ResultData[0] == 0) |
| | | // strWSIType.Format("%s", "Negative"); // í¨ëª° |
| | | //else |
| | | // strWSIType.Format("%s", "Flat"); |
| | | //strValue.Format("%s",strWSIType); // TYPE |
| | | |
| | | strValue.Format("%s","TYPE"); // TYPE |
| | | |
| | | strLine += strValue+strDiv; |
| | | //strValue.Format("%d", pWSIData->m_nWsi_Type); // WSI_NAME |
| | | strValue.Format("%s", "WSI_NAME"); // WSI_NAME |
| | | |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", "JUDGE"); // JUDGE |
| | | strLine += strValue+strDiv; |
| | | //strValue.Format("%d", pWSIData->m_fWsi_ResultData[2]); // COORD_X?? |
| | | strValue.Format("%s", "COORD_X"); // COORD_X?? |
| | | strLine += strValue+strDiv; |
| | | //strValue.Format("%d", pWSIData->m_fWsi_ResultData[1]); // COORD_Y?? |
| | | strValue.Format("%s", "COORD_Y"); // COORD_Y?? |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", "COORD_X2"); // COORD_X2 |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", "COORD_Y2"); // COORD_Y2 |
| | | strLine += strValue+strDiv; |
| | | //strValue.Format("%s", pWSIData->m_strWsi_2DImageFilename); // IMAGE_FILE_2D |
| | | strValue.Format("%s", "IMAGE_FILE_2D"); // IMAGE_FILE_2D |
| | | strLine += strValue+strDiv; |
| | | //strValue.Format("%s", pWSIData->m_strWsi_3DImageFilename); // IMAGE_FILE_3D |
| | | strValue.Format("%s", "IMAGE_FILE_3D"); // IMAGE_FILE_3D |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", "WSI_RESOLUTION"); // WSI_RESOLUTION |
| | | strLine += strValue+strDiv; |
| | | |
| | | } |
| | | |
| | | void CGlassRawRTMS::makeMuraDefect( CString& strLine, _MacroDefect* pMuraData ) |
| | | { |
| | | strLine.Empty(); |
| | | |
| | | CString strValue; |
| | | CString strDiv = ","; |
| | | |
| | | strValue.Format("DATA"); // ITEM |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("MURADATA"); // DEFITEM |
| | | strLine += strValue+strDiv; |
| | | |
| | | CTime time = CTime::GetCurrentTime(); |
| | | strValue.Format("%04d%02d%02d", time.GetYear(), time.GetMonth(), time.GetDay()); // DATE |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%02d%02d%02d", time.GetHour(), time.GetMinute(), time.GetSecond()); // TIME |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pMuraData->DEFECTNO); // DEFECTNO |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", "RECIPE"); // RECIPE |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", "GLASSID"); // GLASSID |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", pMuraData->CELLID); // CELLID |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pMuraData->COORD_X1); // COORD_X1 |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pMuraData->COORD_Y1); // COORD_Y1 |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pMuraData->COORD_PX1);// COORD_PX1 |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pMuraData->COORD_PY1); // COORD_PY1 |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pMuraData->NOMURA); // NOMURA |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pMuraData->SIZE_W); // SIZE_W |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pMuraData->SIZE_L); // SIZE_L |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pMuraData->SIZE_S); // SIZE_S |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", pMuraData->MAIN_TYPE); // MAIN_TYPE |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", pMuraData->SUB_TYPE); // SUB_TYPE |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pMuraData->PEAK); // PEAK |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pMuraData->G_MIN); // G_MIN |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pMuraData->G_MAX); // G_MAX |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pMuraData->G_AVG); // G_AVG |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pMuraData->CAM); // CAM |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pMuraData->SCAN); // SCAN |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%d", pMuraData->PIXEL_PEAK); // PIXEL_PEAK |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", pMuraData->REGION); //REGION |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", pMuraData->SIZE_T); // SIZE_T |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", pMuraData->PEAK_T); // PEAK_T |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", pMuraData->IMG_FILE_NAME); // IMG_FILE_NAME |
| | | strLine += strValue+strDiv; |
| | | } |
| | | |
| | | void CGlassRawRTMS::makeUserReview( CString& strLine, _grmDefectReviewData* pUserReview ) |
| | | { |
| | | strLine.Empty(); |
| | | |
| | | CString strValue; |
| | | CString strDiv = ","; |
| | | |
| | | strValue.Format("DATA"); // ITEM |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("USERREVDATA"); // USERREVITEM |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", "USER_NO"); // USER_NO |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", "PR_X"); // PR_X |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", "PR_Y"); // PR_Y |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", "IMAGE_FILE_NAME"); // IMAGE_FILE_NAME |
| | | strLine += strValue+strDiv; |
| | | strValue.Format("%s", "REV_RESOLUTION"); // REV_RESOLUTION |
| | | strLine += strValue+strDiv; |
| | | |
| | | } |
| | | |
| | | BOOL CGlassRawRTMS::MakeAOIPreProcessing(CgrmGlassRawData* pData) |
| | | { |
| | | _grmGlassData* pGlass = pData->GetGlassData(); |
| | | |
| | | // File Path |
| | | CTime CurrTime = CTime::GetCurrentTime(); |
| | | CString strTime=_T(""), strRTMSRAWFile=_T("");; |
| | | strTime.Format(_T("%04d%02d%02d%02d%02d%02d"), CurrTime.GetYear(), CurrTime.GetMonth(), CurrTime.GetDay(), CurrTime.GetHour(), CurrTime.GetMinute(), CurrTime.GetSecond()); |
| | | char strTempPath2[100] = {0, }, strTempPath3[100] = {0, }; |
| | | |
| | | CString strLotID = pGlass->m_strGlassID; |
| | | CString strRtmsOperID = pGlass->m_strOperID; |
| | | CString strRtmsEqID = pGlass->m_strEquipID; |
| | | CString strHGlassid = pGlass->m_strGlassID; |
| | | CString strStepID = pGlass->m_strStepID; |
| | | strHGlassid.MakeUpper(); |
| | | strTime.MakeUpper(); |
| | | |
| | | strRTMSRAWFile.Format(_T("%s_%s.csv"), strHGlassid, strTime); |
| | | |
| | | //íì¼ ìì±ë ê³³ í´ë ìì± [ê¹íí 2018/12/5] |
| | | //210126 CJH - RTMS ê²½ë¡ ë³ê²½ (126.100.100.5\\RawFile/ReviewImage).RawFileì 루í¸ì ê²°ê³¼íì¼ì ì¬ë¦¬ê³ ReviewImageìë StepID\\GlassID ìì ë°ì´í° ì
ë¡ë |
| | | { |
| | | //210126 CJH - ê²½ë¡ í´ëìì± ìì¹ ë³ê²½ |
| | | CreateDirectory("D:\\DitRtms", NULL); |
| | | CreateDirectory("D:\\DitRtms\\Data", NULL); |
| | | |
| | | BOOL bCreateOK = TRUE; |
| | | sprintf(strTempPath2, "\\\\126.100.100.5\\RawFile"); |
| | | bCreateOK &= CreateDirectory(strTempPath2, NULL); |
| | | |
| | | sprintf(strTempPath2, "\\\\126.100.100.5\\RawFile\\%s", strRTMSRAWFile); |
| | | |
| | | |
| | | sprintf(strTempPath3, "\\\\126.100.100.5\\ReviewImage"); |
| | | bCreateOK &= CreateDirectory(strTempPath3, NULL); |
| | | |
| | | sprintf(strTempPath3, "\\\\126.100.100.5\\ReviewImage\\%s", strStepID); |
| | | bCreateOK &= CreateDirectory(strTempPath3, NULL); |
| | | |
| | | sprintf(strTempPath3, "\\\\126.100.100.5\\ReviewImage\\%s\\%s", strStepID,strHGlassid); |
| | | bCreateOK &= CreateDirectory(strTempPath3, NULL); |
| | | |
| | | AKLOG("RTMS Folder Raw File Path Make : %s", strTempPath2); |
| | | AKLOG("RTMS Folder Img Path Make : %s", strTempPath3); |
| | | //if(bCreateOK) AKLOG("RTMS Folder Create Success"); |
| | | //else AKLOG("RTMS Folder Create Fail"); |
| | | } |
| | | |
| | | DeleteFile((LPCTSTR)strTempPath2); |
| | | |
| | | m_strRTMSRAWFile = strTempPath2; |
| | | m_strRTMSImageFile = strTempPath3; |
| | | |
| | | return TRUE; |
| | | } |
| | | |
| | | BOOL CGlassRawRTMS::CopyRTMSFiles( CgrmGlassRawData* pData ) |
| | | { |
| | | return TRUE; |
| | | } |
| | | |
| | | CString CGlassRawRTMS::GetDefectInfoToString(emDefectMemberType nDefectInfoType, int nParam) |
| | | { |
| | | CString sStr; |
| | | switch (nDefectInfoType) |
| | | { |
| | | case DMT_DefectJudge:// Judge |
| | | { |
| | | switch (nParam) |
| | | { |
| | | case Judge_OK: sStr.Format("OK"); |
| | | break; |
| | | case Judge_RP: sStr.Format("RP"); |
| | | break; |
| | | case Judge_NG: sStr.Format("NG"); |
| | | break; |
| | | case Judge_TR: sStr.Format("TR"); |
| | | break; |
| | | case Judge_PR: sStr.Format("PR"); |
| | | break; |
| | | case Judge_PT: sStr.Format("PT"); |
| | | break; |
| | | case Judge_Review: sStr.Format("RV"); |
| | | break; |
| | | case Judge_RC: sStr.Format("RC"); |
| | | break; |
| | | case Judge_Size: sStr.Format("SZ"); |
| | | break; |
| | | case Judge_VI: sStr.Format("VI"); |
| | | break; |
| | | case Judge_Rework: sStr.Format("RW"); |
| | | break; |
| | | case Judge_Unknown: sStr.Format("OK");//sStr.Format("Unknown"); //Unknownë ì¼ë¨ OK |
| | | break; |
| | | default: sStr.Format("OK");//sStr.Format("Ets"); |
| | | break; |
| | | } |
| | | } |
| | | break; |
| | | |
| | | case DMT_DefectSizeType: |
| | | { |
| | | sStr = "S"; |
| | | switch (nParam) |
| | | { |
| | | //case SizeType_Unknown: sStr.Format("U"); break; |
| | | case 1/*SizeType_Small*/: sStr.Format("S"); |
| | | break; |
| | | case 2/*SizeType_Mid*/: sStr.Format("M"); |
| | | break; |
| | | case 3/*SizeType_Large*/: sStr.Format("L"); |
| | | break; |
| | | case 4/*SizeType_Huge*/: sStr.Format("O"); |
| | | break; |
| | | //case SizeType_Ultra: sStr.Format("Ultra"); break; |
| | | //default: sStr.Format("Ets"); break; |
| | | } |
| | | } |
| | | break; |
| | | |
| | | |
| | | } |
| | | return sStr; |
| | | } |