LWQ
2025-08-13 be72a344954f46a40c96848071a10996fc4bf030
1.添加侧面检缺陷检测参数到配方
已修改4个文件
120 ■■■■■ 文件已修改
EdgeInspector_App/BICommon.h 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
EdgeInspector_App/Recipe/GlassRecipe.cpp 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
EdgeInspector_App/Recipe/GlassRecipe.h 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
EdgeInspector_App/ViewMain_Recipe.cpp 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
EdgeInspector_App/BICommon.h
@@ -11,7 +11,7 @@
#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检测
EdgeInspector_App/Recipe/GlassRecipe.cpp
@@ -1714,15 +1714,21 @@
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)
@@ -1754,6 +1760,16 @@
    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");
@@ -1766,6 +1782,13 @@
    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;
}
@@ -1799,6 +1822,16 @@
    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");
@@ -1811,6 +1844,12 @@
    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;
}
EdgeInspector_App/Recipe/GlassRecipe.h
@@ -322,6 +322,7 @@
struct CRIP_THICKNESS_PARM
{
    // Inspect
    //RIP measure of precision
    BOOL m_bUseInspect = FALSE;
    int  m_nLeftThres = 0;
    int  m_nRightThres = 0;
@@ -331,6 +332,13 @@
    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;
@@ -339,6 +347,9 @@
    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);
EdgeInspector_App/ViewMain_Recipe.cpp
@@ -2607,6 +2607,31 @@
                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);
            }
        }
@@ -2815,6 +2840,26 @@
                // 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);
            }
        }
    }
@@ -3000,6 +3045,18 @@
                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);
            }
        }
@@ -3144,6 +3201,15 @@
                // 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);
            }
        }
    }