mrDarker
2025-07-14 1c0ac1c7924efb8a2cb6962d3eda4126533a5ac8
ENRIT/Process/InspectCamera.cpp
@@ -615,12 +615,13 @@
      g_pLog->DisplayMessage(_T("%s Re Align Mark Find[%d] Fail x %.2f, y %.2f"),PANEL_SIDE[emDim],iPos,m_iSideLine[stFrame.nScanIdx] + m_dMark2MarkX[stFrame.nScanIdx][iPos], pResInfo->nGlassStartLine + m_dMark2MarkY[stFrame.nScanIdx][iPos]);   
   }
#if MARKIMG_NOTSAVE
   CString         strFile;      
   CvRect         saveRect = cvRect((int)matchResut.pt.x-rectAlign.Width()/2,(int)(matchResut.pt.y + rectAlign.top)-rectAlign.Height()/2,rectAlign.Width(),rectAlign.Height());
   strFile.Format(_T("%sIMG_MARK\\%s\\%s\\%s\\Align_%s_%s_%s.jpg"),PATH_INSPECTION_DATA,g_pBase->m_strLoadingDay,g_pBase->m_strHPanelID,g_pBase->m_strLoadingTime,strPos,PANEL_SIDE[emDim],strRes);
   SaveCvAlignImage(saveRect,strFile,stFrame.nScanIdx,nFrameWidth,nFrameHeight);      
#endif // 0
   return TRUE;
}
@@ -1362,11 +1363,12 @@
            continue;
         CopyBuffer.SetPixel((int)ptChamferEdgePos.u,v,128);
      }
#if MARKIMG_NOTSAVE
      CString      str;
      str.Format(_T("%sIMG_MARK\\%s\\%s\\%s\\ChamferRes_%s_%d.bmp"),PATH_INSPECTION_DATA,g_pBase->m_strLoadingDay,g_pBase->m_strHPanelID,g_pBase->m_strLoadingTime,PANEL_SIDE[eDimension],index);
      CBufferAttach      attach(str);
      attach.AttachToFile(CopyBuffer);
#endif // 0
   }   
   return TRUE;
@@ -2197,6 +2199,10 @@
   int   nStartLine = pEdgeInfo->nGlassStartLine - nOffset / 2;
   int   nEndLine = nSetEnd + nOffset / 2;
   int nDefectIdx = 0;
   int nChamferAlarmResultCount = 0;
   int nProAlarmResultCount_MinDiff = 0;
   CINSPECT_JUDGEMENT_PARM* pJudge = m_pRecipe->GetJudgePrm();
   for (int i = 0; i < ngNum; i++) {
      NgInfo ng = ngArray[i];    //侶쟁警속댄轎홧屈
      if (ng.eDir > 8 || ng.eDir < 0) continue;
@@ -2231,8 +2237,10 @@
         int offy = ng.y2 - ps.y;
         if (m_pDefectControl != NULL/* && nDefectIdx < 1*/)
         {
            m_pDefectControl->ExtractDefect_Hole(eDim, m_iCamera, stFrame.nScanIdx, vecList, ngNum, DefectLoc_Hole, CRect(offx, offy, 2 * offx,2 * offy));
            g_pLog->m_nHoleAlarmState = 1;
         }
      }
      if (5 == ng.ngType)
      {
@@ -2245,8 +2253,11 @@
               {
                  pProfileResult->ProfileData[59+i].bUseJudge = TRUE;
                  pProfileResult->ProfileData[59 + i].bProfileJudge = FALSE;
                  if (pJudge->nMinProfileNgCount_MinDiff[ng.eDir] < abs(ng.result))
                  {
                     nProAlarmResultCount_MinDiff = 1;
               }
               }
            }
            else if (5<ng.id&& ng.id < 11)
            {
@@ -2255,6 +2266,11 @@
               {
                  pProfileResult->ProfileData[69 + i].bUseJudge = TRUE;
                  pProfileResult->ProfileData[69+i].bProfileJudge = FALSE;
                  if (pJudge->nMinProfileNgCount_MinDiff[ng.eDir] < abs(ng.result))
                  {
                     nProAlarmResultCount_MinDiff = 1;
                  }
               }
            }
            else if (10<ng.id && ng.id < 16)
@@ -2264,6 +2280,7 @@
              {
                 pProfileResult->ResultChamfer[49 + i][1].bUseJudge = TRUE;
                 pProfileResult->ResultChamfer[49+i][1].bChamferJudge= FALSE;
                  nChamferAlarmResultCount = 1;
              }
            }
            else if (15<ng.id && ng.id < 21)
@@ -2273,9 +2290,9 @@
               {
                  pProfileResult->ResultChamfer[59 + i][1].bUseJudge = TRUE;
                  pProfileResult->ResultChamfer[59+i][1].bChamferJudge = FALSE;
                  nChamferAlarmResultCount = 1;
               }
            }
         }
         if (ng.eDir == 5)
@@ -2287,8 +2304,12 @@
               {
                  pProfileResult->ProfileData[64 + i].bUseJudge = TRUE;
                  pProfileResult->ProfileData[64 + i].bProfileJudge = FALSE;
               }
                  if (pJudge->nMinProfileNgCount_MinDiff[ng.eDir] < abs(ng.result))
                  {
                     nProAlarmResultCount_MinDiff = 1;
                  }
               }
            }
            else if (5 < ng.id && ng.id < 11)
            {
@@ -2297,10 +2318,9 @@
               {
                  pProfileResult->ResultChamfer[59 + i][1].bUseJudge = TRUE;
                  pProfileResult->ResultChamfer[59 + i][1].bChamferJudge = FALSE;
                  nChamferAlarmResultCount = 1;
               }
            }
         }
         if (ng.eDir == 7)
         {
@@ -2311,8 +2331,12 @@
               {
                  pProfileResult->ProfileData[69 + i].bUseJudge = TRUE;
                  pProfileResult->ProfileData[69 + i].bProfileJudge = FALSE;
               }
                  if (pJudge->nMinProfileNgCount_MinDiff[ng.eDir] < abs(ng.result))
                  {
                     nProAlarmResultCount_MinDiff = 1;
                  }
               }
            }
            else if (5 < ng.id && ng.id < 11)
            {
@@ -2321,6 +2345,7 @@
               {
                  pProfileResult->ResultChamfer[64 + i][1].bUseJudge = TRUE;
                  pProfileResult->ResultChamfer[64+i][1].bChamferJudge = FALSE;
                  nChamferAlarmResultCount = 1;
               }
            }
         }
@@ -4228,7 +4253,10 @@
   USES_CONVERSION;
   char str_filename[1024];
   sprintf_s(str_filename, "%s", W2A(strFile));
#if MARKIMG_NOTSAVE
   cvSaveImage(str_filename,IpImg);   
#endif // 0
   
   cvReleaseImage(&IpImg);
}