| | |
| | | #define OFFLINE_KEY 1 //OFFLINE_KEY:1是离线模式;0是在线模式 |
| | | #define MINI_LED 0 //Mini车间 |
| | | #define MINI_NOTCH 0 //Mini车间, 是否使用刻槽功能 |
| | | #define HALCON_VISION_KEY 0 //是否启用HALCON |
| | | #define HALCON_VISION_KEY 1 //是否启用HALCON |
| | | #define USE_WEBSOCKET 0 //是否启用websocket(AI) |
| | | #define USE_AI_DETECT 0 //是否启用AI检测 |
| | | |
| | |
| | | |
| | | void CRIP_THICKNESS_PARM::Reset() |
| | | { |
| | | m_bUseInspect = FALSE; |
| | | m_bUseInspect = m_bRipUseInspect= FALSE; |
| | | m_nLeftThres = m_nRightThres = m_nGlassThres = 0; |
| | | m_nRipDir = 0; |
| | | m_nRectLeft = m_nRectRight = 0; |
| | | m_nTopOffset = m_nBottomOffset = 0; |
| | | m_nRipInspect_Range_um = m_nRipInspect_SideLine_Offset_um=0; |
| | | m_nRipMin_Threshold = 0; |
| | | m_nRipMax_Threshold= 0; |
| | | |
| | | m_nGlassSizeMin_um = 0; m_nGlassSizeMax_um = 0; |
| | | m_nLeftRipSizeMin_um = 0; m_nLeftRipSizeMax_um = 0; |
| | | m_nRightRipSizeMin_um = 0; m_nRightRipSizeMax_um = 0; |
| | | m_nRipJudge_Size_Min_X_um = 0; m_nRipJudge_Size_Min_Y_um = 0; |
| | | m_nRipJudge_Size_Min_OR_AND = 0; |
| | | |
| | | } |
| | | |
| | | BOOL CRIP_THICKNESS_PARM::ReadRecipe(CConfig* pFile, int nSideIdx) |
| | |
| | | pFile->GetItemValue(nSideIdx, k, m_nRectRight, 0); |
| | | k = _T("RipThk_m_nBottomOffset"); |
| | | pFile->GetItemValue(nSideIdx, k, m_nBottomOffset, 0); |
| | | k = _T("RipThk_m_bRipUseInspect"); |
| | | pFile->GetItemValue(nSideIdx, k, m_bRipUseInspect, 0); |
| | | k = _T("RipThk_m_nRipInspect_Range_um"); |
| | | pFile->GetItemValue(nSideIdx, k, m_nRipInspect_Range_um, 0); |
| | | k = _T("RipThk_m_nRipInspect_SideLine_Offset_um"); |
| | | pFile->GetItemValue(nSideIdx, k, m_nRipInspect_SideLine_Offset_um, 0); |
| | | k = _T("RipThk_m_nRipMin_Threshold"); |
| | | pFile->GetItemValue(nSideIdx, k, m_nRipMin_Threshold, 20); |
| | | k = _T("RipThk_m_nRipMax_Threshold"); |
| | | pFile->GetItemValue(nSideIdx, k, m_nRipMax_Threshold, 255); |
| | | k = _T("RipThk_m_nGlassSizeMin_um"); |
| | | pFile->GetItemValue(nSideIdx, k, m_nGlassSizeMin_um, 0); |
| | | k = _T("RipThk_m_nGlassSizeMax_um"); |
| | |
| | | pFile->GetItemValue(nSideIdx, k, m_nRightRipSizeMin_um, 0); |
| | | k = _T("RipThk_m_nRightRipSizeMax_um"); |
| | | pFile->GetItemValue(nSideIdx, k, m_nRightRipSizeMax_um, 0); |
| | | k = _T("RipThk_m_nRipJudge_Size_Min_X_um"); |
| | | pFile->GetItemValue(nSideIdx, k, m_nRipJudge_Size_Min_X_um, 0); |
| | | k = _T("RipThk_m_nRipJudge_Size_Min_Y_um"); |
| | | pFile->GetItemValue(nSideIdx, k, m_nRipJudge_Size_Min_Y_um, 0); |
| | | k = _T("RipThk_m_nRipJudge_Size_Min_OR_AND"); |
| | | pFile->GetItemValue(nSideIdx, k, m_nRipJudge_Size_Min_OR_AND, 0); |
| | | |
| | | |
| | | return TRUE; |
| | | } |
| | |
| | | pFile->SetItemValue(nSideIdx, k, m_nRectRight); |
| | | k = _T("RipThk_m_nBottomOffset"); |
| | | pFile->SetItemValue(nSideIdx, k, m_nBottomOffset); |
| | | k = _T("RipThk_m_bRipUseInspect"); |
| | | pFile->SetItemValue(nSideIdx, k, m_bRipUseInspect); |
| | | k = _T("RipThk_m_nRipInspect_Range_um"); |
| | | pFile->SetItemValue(nSideIdx, k, m_nRipInspect_Range_um); |
| | | k = _T("RipThk_m_nRipInspect_SideLine_Offset_um"); |
| | | pFile->SetItemValue(nSideIdx, k, m_nRipInspect_SideLine_Offset_um); |
| | | k = _T("RipThk_m_nRipMin_Threshold"); |
| | | pFile->SetItemValue(nSideIdx, k, m_nRipMin_Threshold); |
| | | k = _T("RipThk_m_m_nRipMax_Threshold"); |
| | | pFile->SetItemValue(nSideIdx, k, m_nRipMax_Threshold); |
| | | k = _T("RipThk_m_nGlassSizeMin_um"); |
| | | pFile->SetItemValue(nSideIdx, k, m_nGlassSizeMin_um); |
| | | k = _T("RipThk_m_nGlassSizeMax_um"); |
| | |
| | | pFile->SetItemValue(nSideIdx, k, m_nRightRipSizeMin_um); |
| | | k = _T("RipThk_m_nRightRipSizeMax_um"); |
| | | pFile->SetItemValue(nSideIdx, k, m_nRightRipSizeMax_um); |
| | | k = _T("RipThk_m_nRipJudge_Size_Min_X_um"); |
| | | pFile->SetItemValue(nSideIdx, k, m_nRipJudge_Size_Min_X_um); |
| | | k = _T("RipThk_m_nRipJudge_Size_Min_Y_um"); |
| | | pFile->SetItemValue(nSideIdx, k, m_nRipJudge_Size_Min_Y_um); |
| | | k = _T("RipThk_m_nRipJudge_Size_Min_OR_AND"); |
| | | pFile->SetItemValue(nSideIdx, k, m_nRipJudge_Size_Min_OR_AND); |
| | | |
| | | return TRUE; |
| | | } |
| | |
| | | struct CRIP_THICKNESS_PARM |
| | | { |
| | | // Inspect |
| | | //RIP measure of precision |
| | | BOOL m_bUseInspect = FALSE; |
| | | int m_nLeftThres = 0; |
| | | int m_nRightThres = 0; |
| | |
| | | int m_nTopOffset = 0; // Inspect Top Offset |
| | | int m_nRectRight = 0; // Inspect Rect R |
| | | int m_nBottomOffset = 0; // Inspect Bottom Offset |
| | | |
| | | // RIP chip detection |
| | | BOOL m_bRipUseInspect = FALSE; |
| | | int m_nRipInspect_Range_um=0; |
| | | int m_nRipInspect_SideLine_Offset_um=0; |
| | | int m_nRipMin_Threshold = 0; |
| | | int m_nRipMax_Threshold = 0; |
| | | |
| | | |
| | | // Judgement |
| | | int m_nGlassSizeMin_um = 0; |
| | | int m_nGlassSizeMax_um = 0; |
| | |
| | | int m_nLeftRipSizeMax_um = 0; |
| | | int m_nRightRipSizeMin_um = 0; |
| | | int m_nRightRipSizeMax_um = 0; |
| | | int m_nRipJudge_Size_Min_X_um = 0; |
| | | int m_nRipJudge_Size_Min_Y_um = 0; |
| | | int m_nRipJudge_Size_Min_OR_AND = 0;// 0 : No Use, 1 : OR, 2 : AND |
| | | |
| | | void Reset(); |
| | | BOOL ReadRecipe(CConfig* pFile, int nSideIdx); |
| | |
| | | m_SideInspectInfo.GetCell(nRowIdx, nColIdx)->SetBackClr(uCellColor); |
| | | strTemp.Format(_T("%d"), rip.m_nBottomOffset); |
| | | m_SideInspectInfo.SetItemText(nRowIdx++, nColIdx, strTemp); |
| | | |
| | | // 10. RIP Inspect Use |
| | | m_SideInspectInfo.GetCell(nRowIdx, nColIdx)->SetBackClr(uCellColor); |
| | | strTemp.Format(_T("%d"), rip.m_bRipUseInspect); |
| | | m_SideInspectInfo.SetItemText(nRowIdx++, nColIdx, strTemp); |
| | | |
| | | // 11. RIP Inspect Range |
| | | m_SideInspectInfo.GetCell(nRowIdx, nColIdx)->SetBackClr(uCellColor); |
| | | strTemp.Format(_T("%d"), rip.m_nRipInspect_Range_um); |
| | | m_SideInspectInfo.SetItemText(nRowIdx++, nColIdx, strTemp); |
| | | |
| | | // 12. RIP Inspect SideLine Offset |
| | | m_SideInspectInfo.GetCell(nRowIdx, nColIdx)->SetBackClr(uCellColor); |
| | | strTemp.Format(_T("%d"), rip.m_nRipInspect_SideLine_Offset_um); |
| | | m_SideInspectInfo.SetItemText(nRowIdx++, nColIdx, strTemp); |
| | | |
| | | // 13. RIP Min Threshold |
| | | m_SideInspectInfo.GetCell(nRowIdx, nColIdx)->SetBackClr(uCellColor); |
| | | strTemp.Format(_T("%d"), rip.m_nRipMin_Threshold); |
| | | m_SideInspectInfo.SetItemText(nRowIdx++, nColIdx, strTemp); |
| | | |
| | | // 14. RIP Min Threshold |
| | | m_SideInspectInfo.GetCell(nRowIdx, nColIdx)->SetBackClr(uCellColor); |
| | | strTemp.Format(_T("%d"), rip.m_nRipMax_Threshold); |
| | | m_SideInspectInfo.SetItemText(nRowIdx++, nColIdx, strTemp); |
| | | } |
| | | } |
| | | |
| | |
| | | // 9. B Offset |
| | | strTemp = m_SideInspectInfo.GetItemText(nRowIdx++, nColIdx); |
| | | rip.m_nBottomOffset = _wtoi(strTemp); |
| | | |
| | | // 10. RIP Inspect Use |
| | | strTemp = m_SideInspectInfo.GetItemText(nRowIdx++, nColIdx); |
| | | rip.m_bRipUseInspect = _wtoi(strTemp); |
| | | |
| | | // 11. RIP Inspect Range |
| | | strTemp = m_SideInspectInfo.GetItemText(nRowIdx++, nColIdx); |
| | | rip.m_nRipInspect_Range_um = _wtoi(strTemp); |
| | | |
| | | // 12. RIP Inspect SideLine Offset |
| | | strTemp = m_SideInspectInfo.GetItemText(nRowIdx++, nColIdx); |
| | | rip.m_nRipInspect_SideLine_Offset_um = _wtoi(strTemp); |
| | | |
| | | // 13. RIP Min Threshold |
| | | strTemp = m_SideInspectInfo.GetItemText(nRowIdx++, nColIdx); |
| | | rip.m_nRipMin_Threshold = _wtoi(strTemp); |
| | | |
| | | // 14. RIP Min Threshold |
| | | strTemp = m_SideInspectInfo.GetItemText(nRowIdx++, nColIdx); |
| | | rip.m_nRipMax_Threshold = _wtoi(strTemp); |
| | | } |
| | | } |
| | | } |
| | |
| | | m_JudgementInfo.GetCell(nRowIdx, nColIdx)->SetBackClr(uCellColor); |
| | | strTemp.Format(_T("%d"), rip.m_nRightRipSizeMax_um); |
| | | m_JudgementInfo.SetItemText(nRowIdx++, nColIdx, strTemp); |
| | | // 7. Rip chip Size Min um |
| | | m_JudgementInfo.GetCell(nRowIdx, nColIdx)->SetBackClr(uCellColor); |
| | | strTemp.Format(_T("%d"), rip.m_nRipJudge_Size_Min_X_um); |
| | | m_JudgementInfo.SetItemText(nRowIdx++, nColIdx, strTemp); |
| | | // 8. Rip chip Size Max um |
| | | m_JudgementInfo.GetCell(nRowIdx, nColIdx)->SetBackClr(uCellColor); |
| | | strTemp.Format(_T("%d"), rip.m_nRipJudge_Size_Min_Y_um); |
| | | m_JudgementInfo.SetItemText(nRowIdx++, nColIdx, strTemp); |
| | | // 9. Rip chip OR/AND |
| | | m_JudgementInfo.GetCell(nRowIdx, nColIdx)->SetBackClr(uCellColor); |
| | | strTemp.Format(_T("%d"), rip.m_nRipJudge_Size_Min_OR_AND); |
| | | m_JudgementInfo.SetItemText(nRowIdx++, nColIdx, strTemp); |
| | | } |
| | | } |
| | | |
| | |
| | | // 6. Right Rip Size Max um |
| | | strTemp = m_JudgementInfo.GetItemText(nRowIdx++, nColIdx); |
| | | rip.m_nRightRipSizeMax_um = _wtoi(strTemp); |
| | | // 7. Rip chip Size Min um |
| | | strTemp = m_JudgementInfo.GetItemText(nRowIdx++, nColIdx); |
| | | rip.m_nRipJudge_Size_Min_X_um = _wtoi(strTemp); |
| | | // 8. Rip chip Size Max um |
| | | strTemp = m_JudgementInfo.GetItemText(nRowIdx++, nColIdx); |
| | | rip.m_nRipJudge_Size_Min_Y_um = _wtoi(strTemp); |
| | | // 9. Rip chip OR/AND |
| | | strTemp = m_JudgementInfo.GetItemText(nRowIdx++, nColIdx); |
| | | rip.m_nRipJudge_Size_Min_OR_AND = _wtoi(strTemp); |
| | | } |
| | | } |
| | | } |