SDC C-Project CF Review 프로그램
DitGlassRawMessenger/DitGlassRawMessenger/AnaResultFile.cpp
@@ -49,7 +49,11 @@
   for (int i = 0; i < MAX_ZONE_NUM; i++) fprintf(pf, ",ZoneSrcMin%02d", i);
   for (int i = 0; i < MAX_ZONE_NUM; i++) fprintf(pf, ",ZoneSrcMax%02d", i);
   for (int i = 0; i < MAX_ZONE_NUM; i++) fprintf(pf, ",ZoneSrcAvg%02d", i);
   fprintf(pf, ", m_sDefectPeak, m_nPixelSize, DefectType, UMSize, Density, ScrtRatio, MergeState, Angle, Major, Minor, Compact, Thickness");
/* < KMH 20220816 : #4271 MOD Start > */
   // R_Scale, GateLine, DataLine, Channel 항목추가
   //fprintf(pf, ", m_sDefectPeak, m_nPixelSize, DefectType, UMSize, Density, ScrtRatio, MergeState, Angle, Major, Minor, Compact, Thickness");
   fprintf(pf, ", DefectPeak, PixelSize, DefectType, UMSize, R_Scale, Density, ScrtRatio, MergeState, Angle, Major, Minor, Compact, Thickness, GateLine, DataLine, Channel");
/* < KMH 20220816 : #4271 MOD End > */
   fprintf(pf, "\n");
   for (int iDefect = 0; iDefect < pData->GetGlassData()->m_nDefectNum; iDefect++)
@@ -57,7 +61,42 @@
      _grmDefectData* pDefect = pData->GetDefectData(iDefect);
      /* < KJG 20220225 - #4000 ADD Start >*/ 
      CString strDefectCellID;
      strDefectCellID.Format("%s%c%c", pData->GetGlassData()->m_strGlassID, '0' + pDefect->m_nCellIdx / 36, pCellCode[pDefect->m_nCellIdx % 36]);
   /* < KMH 20220728 : # MOD Start > */
      //strDefectCellID.Format("%s%c%c", pData->GetGlassData()->m_strGlassID, '0' + pDefect->m_nCellIdx / 36, pCellCode[pDefect->m_nCellIdx % 36]);
      // enum DefectLocation { DefectLoc_Pattern = 0, DefectLoc_Crack, DefectLoc_BM, DefectLoc_ASG, DefectLoc_PAD, DefectLoc_C2C, DefectLoc_EdgeLine, DefectLoc_Proj, DefectLoc_Chip, DefectLoc_Corner, DefectLoc_DeepPad, DefectLoc_DeepAA, DefectLoc_CrackPT };
      // 3,4,5 : PAD Defect
      if (pDefect->m_sDefectLoc == 3 || pDefect->m_sDefectLoc == 4 || pDefect->m_sDefectLoc == 5)
      {
         _grmGlassData *pGlass = pData->GetGlassData();
         int nMinDistance = max(pGlass->m_nGlassSizeWidth, pGlass->m_nGlassSizeHeight);
         for (int iCell = 0; iCell < pGlass->m_nCellNum; iCell++)
         {
            _grmCellData* pCell = pData->GetCellData(iCell);
            int nCellCenterX = (pCell->m_rectCellLeft + pCell->m_rectCellRight) / 2;
            int nCellCenterY = (pCell->m_rectCellTop + pCell->m_rectCellBottom) / 2;
            //int nTempDistance = sqrt(pow(ptCellCenter.x - pDefect->m_nUMCenterAlignX,2) + pow(ptCellCenter.y - pDefect->m_nUMCenterAlignY,2));
            if (pDefect->m_nModelIdx == pCell->m_nModelIdx)      // 디펙의 모델과 셀의 모델이 같을 때만 비교
            {
               int nTempDistance = abs(nCellCenterX - pDefect->m_nUMCenterAlignX) + abs(nCellCenterY - pDefect->m_nUMCenterAlignY);   // x,y 편차 합계
               if (nMinDistance > nTempDistance)
               {
                  nMinDistance = nTempDistance;
                  strDefectCellID.Format("%s%s", pData->GetGlassData()->m_strGlassID, pCell->m_strCellName);
               }
            }
         }
      }
      // PAD영역 외 결함처리
      else
      {
         if (pDefect->m_nCellIdx >= 0) { strDefectCellID.Format("%s%s", pData->GetGlassData()->m_strGlassID, pData->GetCellData(pDefect->m_nCellIdx)->m_strCellName); }
      }
   /* < KMH 20220728 : # MOD End > */
      /* < KJG 20220225 - #4000 ADD End >*/
      if (pData->GetGlassData()->m_nScanCoordinateY == 1) //분판설비의 경우 XY반전
      {
@@ -146,12 +185,18 @@
         {
            fprintf(pf, ",%d", pDefect->m_sZoneValueSrcAvg[iz]);
         }
         fprintf(pf, ",%d, %d, %d, %d, %d, %d, %d",
            pDefect->m_sDefectPeak, pDefect->m_nPixelSize, pDefect->m_DefectType, (int)pDefect->m_nUMSize, pDefect->m_nDensity, pDefect->m_nScratchRatio, pDefect->m_bMergeState);
      /* < KMH 20220816 : #4271 MOD Start > */
         //fprintf(pf, ",%d, %d, %d, %d, %d, %d, %d",
         //   pDefect->m_sDefectPeak, pDefect->m_nPixelSize, pDefect->m_DefectType, (int)pDefect->m_nUMSize, pDefect->m_nDensity, pDefect->m_nScratchRatio, pDefect->m_bMergeState);
         //fprintf(pf, ", %d, %d, %d, %d, %d", pDefect->m_nAngle, pDefect->m_nMajor, pDefect->m_nMinor, pDefect->m_nCompact, pDefect->m_nThickness);
         fprintf(pf, ", %d, %d, %d, %d, %d", pDefect->m_nAngle, pDefect->m_nMajor, pDefect->m_nMinor, pDefect->m_nCompact, pDefect->m_nThickness);
         //fprintf(pf, "\n");
         fprintf(pf, ",%d, %d, %d, %d, %d, %d, %d, %d",
            pDefect->m_sDefectPeak, pDefect->m_nPixelSize, pDefect->m_DefectType, (int)pDefect->m_nUMSize, pDefect->m_nDefectRScale, pDefect->m_nDensity, pDefect->m_nScratchRatio, pDefect->m_bMergeState);
         fprintf(pf, ", %d, %d, %d, %d, %d, %d, %d, %d", pDefect->m_nAngle, pDefect->m_nMajor, pDefect->m_nMinor, pDefect->m_nCompact, pDefect->m_nThickness, pDefect->m_nCellGate, pDefect->m_nCellData, pDefect->m_nHliLevelIdx);
         fprintf(pf, "\n");
      /* < KMH 20220816 : #4271 MOD End > */
      }
   }
   AKLOG("MakeAnaFile Complete %s", strFilePathName);