SDC C-Project CF Review 프로그램
DitGlassRawMessenger/DitGlassRawMessenger/GlassRawCPJT.cpp
@@ -58,6 +58,30 @@
      Sleep(10);
   }
}
/* < KJG 20221110 - #4373 ADD Start >*/
auto CellIDSortFunc = [](const _grmCellData* lhs, const _grmCellData* rhs) {
   // '0A' = 0, '0B' = 1, ..., '0Z' = 25, '00' = 26, ..., '09' = 35, '1A' = 36, ...
   const int nAlphaSet = 'Z' - 'A' + 1;
   const int nNumSet = '9' - '0' + 1;
   const int nAlphaNumSet = nAlphaSet + nNumSet;
   CString str = lhs->m_strCellName;
   char lhs_1st = str.Mid(str.GetLength() - 2, 1).GetAt(0);
   char lhs_2st = str.Mid(str.GetLength() - 1, 1).GetAt(0);
   str = rhs->m_strCellName;
   char rhs_1st = str.Mid(str.GetLength() - 2, 1).GetAt(0);
   char rhs_2st = str.Mid(str.GetLength() - 1, 1).GetAt(0);
   auto GetCellValueFrom2stCellID = [&](char c) -> int {
      if (c >= 'A' && c < 'Z') // 'A' 는 0부터
         return c - 'A';
      else if (c >= '0' && c <= '9') // '0' 은 26 부터
         return (c - '0') + nAlphaSet;
   };
   return (lhs_1st - '0') * nAlphaNumSet + GetCellValueFrom2stCellID(lhs_2st) < (rhs_1st - '0') * nAlphaNumSet + GetCellValueFrom2stCellID(rhs_2st);
};
/* < KJG 20221110 - #4373 ADD End >*/
CGlassRawCPJT::CGlassRawCPJT(void)
{
@@ -545,20 +569,32 @@
   
   //////////////////////////////////////////////////////////////////////////
   //CELL & DEFECT DATA
   /* < KJG 20221110 - #4373 ADD Start >*/
   vector<_grmCellData*> vtSortCellData;
   for (int iCell = 0; iCell < pData->GetGlassData()->m_nCellNum; iCell++)
      vtSortCellData.push_back(pData->GetCellData(iCell));
   sort(vtSortCellData.begin(), vtSortCellData.end(), CellIDSortFunc);
   /* < KJG 20221110 - #4373 ADD End >*/
   {
      //make
      {
         for (int iCell = 0; iCell < pData->GetGlassData()->m_nCellNum; iCell++)
         {
            _grmCellData* pCell = pData->GetCellData(iCell);
            /* < KJG 20221110 - #4373 MOD Start >*/
            //_grmCellData* pCell = pData->GetCellData(iCell);
            _grmCellData* pCell = vtSortCellData[iCell];
            /* < KJG 20221110 - #4373 MOD End >*/
            makeDataCell(strLine, pData, pCell);
            fprintf(pf, "%s\n", strLine);
            for (int iDefect = 0; iDefect < pData->GetGlassData()->m_nDefectNum; iDefect++)
            {
               _grmDefectData* pDefect = pData->GetDefectData(iDefect);
               if (pDefect->m_nCellIdx != iCell) continue;
               /* < KJG 20221110 - #4373 MOD Start >*/
               //if (pDefect->m_nCellIdx != iCell) continue;
               if (pDefect->m_nCellIdx != pCell->m_nCellID) continue;
               /* < KJG 20221110 - #4373 MOD End >*/
               //210203 CJH - CutOff 대상 결과파일 작성 제외
               if (pDefect->m_bDefectCutoff == TRUE) continue;
@@ -2047,12 +2083,13 @@
         sprintf(pServerFile, "%s", strFileName.GetBuffer(0)); 
         sprintf(pLocalFile, "%s", strFileName.GetBuffer(0)); 
         CString strTime;
         CString strServerSubRawFilePath= NULL;
         CString strServerSubRawFileName = NULL;
         {
            strServerSubRawFilePath += NETWORK_AOIRAWFILE_SUB_PATH;
            CString strTime;
            CTime CurrTime = m_tmFileCreateTime;
            strTime.Format(_T("%04d%02d%02d_%02d%02d%02d"),
               CurrTime.GetYear(), CurrTime.GetMonth(), CurrTime.GetDay(), CurrTime.GetHour(), CurrTime.GetMinute(), CurrTime.GetSecond());
@@ -2088,6 +2125,16 @@
            fprintf(pf, "SUMPATH= \n");
            fclose(pf);
         } 
         /* < KJG 20230220 - #4403 ADD Start >*/
         // BLUE 설비 D_COLL 미보고 원인 분석을 위한 Result_info.ini 파일 백업 생성
         CString strPathBackUpDir, strPathBackUpFile;
         strPathBackUpDir.Format(_T("%s%s"), LOCAL_RAWPATH_INFO_INI_PATH, _T("ResultInfoBackUpFile"));
         strPathBackUpFile.Format(_T("%s_%s.ini"), strGlassID, strTime);
         CreateDirectory(strPathBackUpDir, NULL);
         strPathBackUpFile.Format("%s\\%s", strPathBackUpDir, strPathBackUpFile);
         CopyFile(strRawFilePathName, strPathBackUpFile, FALSE);
         /* < KJG 20230220 - #4403 ADD End >*/
      }
      break;
   case FTPCMD_STACK:
@@ -2228,6 +2275,8 @@
      /* < KMH 20220311 : #3954 ADD End > */
         case Judge_Unknown:      sStr.Format("OK");//sStr.Format("Unknown");   //Unknown도 일단 OK
            break;
         case Judge_SR:         sStr.Format("SR"); /* < KJG 20221107 - #4360 ADD >*/
            break;
         default:            sStr.Format("OK");//sStr.Format("Ets");      
            break;
         }