| | |
| | | MyLock.Unlock(); |
| | | return m_nDefect; |
| | | } |
| | | |
| | | int CDefectControl::ExtractDefect_RipThickness(DimensionDir emDim, int iCam, int iScan, const CDefect_Info& defectInfo, double dMeasured_um, double dSpecDiff_um) |
| | | { |
| | | if (m_pGrabber == NULL) { |
| | | return m_nDefect; |
| | | } |
| | | |
| | | CSingleLock MyLock(&m_csDefect); |
| | | MyLock.Lock(); |
| | | |
| | | if (m_nDefect >= m_maxDefect) { |
| | | MyLock.Unlock(); |
| | | return m_nDefect; |
| | | } |
| | | |
| | | CDefect* pDefect = GetDefect(m_nDefect); |
| | | if (pDefect == NULL) { |
| | | MyLock.Unlock(); |
| | | return m_nDefect; |
| | | } |
| | | |
| | | pDefect->Reset(); |
| | | pDefect->m_bJudge_NG = TRUE; // RIP 厚度异常即 NG |
| | | pDefect->m_dSizeX_um = dMeasured_um; // 记录测得厚度 |
| | | pDefect->m_dSizeY_um = dSpecDiff_um; // 记录与规格差值 |
| | | pDefect->m_DefectInfo = defectInfo; |
| | | |
| | | int nXStart = defectInfo.m_ptDefectPos_pxl.x - (DEFECTIMAGE_WIDTH / 2); |
| | | int nYStart = defectInfo.m_ptDefectPos_pxl.y - (DEFECTIMAGE_HEIGHT / 2); |
| | | if (!m_pGrabber->GetSmallImage(iScan, pDefect->m_Image, nXStart, nYStart, DEFECTIMAGE_WIDTH, DEFECTIMAGE_HEIGHT, FALSE)) { |
| | | MyLock.Unlock(); |
| | | return m_nDefect; |
| | | } |
| | | |
| | | m_nDefect++; |
| | | |
| | | MyLock.Unlock(); |
| | | return m_nDefect; |
| | | } |
| | |
| | | |
| | | int ExtractDefect_Mark(DimensionDir emDim, int iCam, int iScan, CDefect_Info defect); |
| | | int ExtractDefect_CorChamfer(DimensionDir emDim, int iCam, int iScan, DefectLocation eDefect, CDefect_Info ptDefect, int nProfileIndex); //2024.6.12 |
| | | int ExtractDefect_RipThickness(DimensionDir emDim, int iCam, int iScan, const CDefect_Info& defectInfo, double dMeasured_um, double dSpecDiff_um); |
| | | void ResetDefectControl(); |
| | | int CheckDefectCount(); |
| | | int IncreaseDefectCount(){++m_nDefect; return m_nDefect;} |
| | |
| | | |
| | | DefectLoc_License, |
| | | |
| | | DefectLoc_Rip_Thickness, |
| | | |
| | | DefectLoc_Unknown, |
| | | |
| | | DefectLoc_None |
| | |
| | | _T("WS_Fail"), |
| | | |
| | | _T("Exception"), |
| | | |
| | | _T("License"), |
| | | |
| | | _T("Rip_Thickness"), |
| | | |
| | | _T("Unknown") |
| | | }; |
| | | |