SDC C-Project CF Review 프로그램
KEJ
2023-11-24 9020bfb6f86ff853d5d5b3cee882132a244232da
ReviewSystem/ReviewSystem/DefectMap.cpp
@@ -77,11 +77,14 @@
   m_RowColor[2]      = RGB(220,20,220);
   m_RowColor[3]      = RGB(20,220,220);
   m_RowColor[4]       = RGB(220, 20, 80);
   for (int i=0; i<5; i++)
   m_RowColor[5]      = RGB(255, 128, 0);
   for (int i=0; i<6; i++)
   {
      m_pDefectPen[i].CreatePen(PS_SOLID, 1, m_RowColor[i]); 
      m_pDefectBrush[i].CreateSolidBrush(m_RowColor[i]); 
   }
//    m_pOffsetPen.CreatePen(PS_SOLID, 1, RGB(100, 200, 80));
//    m_pOffsetBrush.CreateSolidBrush(RGB(100, 200, 80));
   m_nPlanIndex      = 0;
   m_bHistoryEnable = TRUE;
@@ -491,6 +494,28 @@
    nCamSacnIndex = nScanidx;
    nGlassMax = nXpos;
    nGlassMin = nYpos;
}
void CDefectMap::SetOffsetparm(int nCamidx, int nScanidx, BOOL bUse)
{
   CDC *MemDC = GetDC();
   nOffSetMode = bUse;
   nCamIndex = nCamidx;
   nCamSacnIndex = nScanidx;
   if (bUse == TRUE)
   {
      DrawDefect(MemDC);
      DrawReviewDefect(MemDC);
      //DrawWsiDefect(&MemDC);
   }
   nOffSetMode = FALSE;
   nCamIndex = -1;
   nCamSacnIndex = -1;
   //Invalidate(TRUE);
}
void CDefectMap::OnPaint()
@@ -1585,7 +1610,7 @@
         return 3;
      }
      break;
      //변경 필요
   case DefectType_Judge:
      if (defectFilter.bJudgeOK && (pDefectResult->nJudgeType == DEFECT_JUDGE_CPJT_OK))
      {
@@ -1600,6 +1625,11 @@
      if (defectFilter.bJudgePR && (pDefectResult->nJudgeType == DEFECT_JUDGE_CPJT_PR))
      {
         return 2;
      }
      if (defectFilter.bJudgeND && (pDefectResult->nJudgeType == DEFECT_JUDGE_CPJT_ND))
      {
         return 3;
      }
      break;
@@ -1737,6 +1767,11 @@
      {
         return 2;
      }
      if (defectFilter.bJudgeND)
      {
         return 3;
      }
      break;
   case DefectType_Process:
@@ -1818,13 +1853,36 @@
         continue;
      }
      pOldPen = pDC->SelectObject(&m_pDefectPen[nColorIdx]);
      pDC->SelectStockObject(BLACK_PEN);
      pOldBrush = pDC->SelectObject(&m_pDefectBrush[nColorIdx]);
      if (nOffSetMode == TRUE)
      {
         if (pDefectResult->nAOICameraIdx == nCamIndex && pDefectResult->nAOIScanIdx == nCamSacnIndex)
         {
            pOldPen = pDC->SelectObject(&m_pDefectPen[5]);
            //pDC->SelectStockObject(BLACK_PEN);
            pOldBrush = pDC->SelectObject(&m_pDefectBrush[5]);
         }
         else
         {
            pOldPen = pDC->SelectObject(&m_pDefectPen[5]);
            pDC->SelectStockObject(BLACK_PEN);
            pOldBrush = pDC->SelectObject(&m_pDefectBrush[5]);
            pDC->SelectStockObject(BLACK_BRUSH);
         }
      }
      else
      {
         pOldPen = pDC->SelectObject(&m_pDefectPen[nColorIdx]);
         pDC->SelectStockObject(BLACK_PEN);
         pOldBrush = pDC->SelectObject(&m_pDefectBrush[nColorIdx]);
      }
      nPosX = pDefectResult->nUMOriginX;
      nPosY = pDefectResult->nUMOriginY;
      TransformGlass2Map(nPosX, nPosY);
      pDC->Rectangle(nPosX - m_nDefectSize, nPosY - m_nDefectSize, nPosX + m_nDefectSize, nPosY + m_nDefectSize);
   }
@@ -2226,7 +2284,25 @@
      for(constVectorSReviewResultIt its=pReviewResult->m_vecSReviewResult.begin(); its!=pReviewResult->m_vecSReviewResult.end();its++)
      {
         if(its->nResultCode > ReviewResult_Process_Fail)
         if (nOffSetMode == TRUE)
         {
            if (its->nAOICameraIdx == nCamIndex && its->nAOIScanIdx == nCamSacnIndex)
            {
               pOldPen = pDC->SelectObject(&m_pDefectPen[5]);
               //pDC->SelectStockObject(BLACK_PEN);
               pOldBrush = pDC->SelectObject(&m_pDefectBrush[5]);
               //pDC->SelectStockObject(BLACK_BRUSH);
            }
            else
            {
               pOldPen = pDC->SelectObject(&m_pDefectPen[5]);
               pDC->SelectStockObject(BLACK_PEN);
               pOldBrush = pDC->SelectObject(&m_pDefectBrush[5]);
               pDC->SelectStockObject(BLACK_BRUSH);
            }
         }
         else if(its->nResultCode > ReviewResult_Process_Fail)
         {
            pOldPen = pDC->SelectObject(&reviewedPen);
            pOldBrush = pDC->SelectObject(&reviewedBrush);