| | |
| | | #include "StdAfx.h" |
| | | #include "StdAfx.h" |
| | | #include "GlassRecipe.h" |
| | | |
| | | ////////////////////////////////////////////////////////////////////////// |
| | |
| | | m_nUserDefectAreaCount = 0; |
| | | for(int i=0; i<MAX_SIDE_USER_DEFECT_AREA_COUNT; i++) |
| | | m_UserDefectPrm[i].Reset(); |
| | | |
| | | m_RipThk.Reset(); |
| | | } |
| | | |
| | | BOOL CSIDE_PARM::ReadRecipe(CConfig *pFile, int nSideIdx) |
| | |
| | | for(int nUserDefectAreaIdx=0; nUserDefectAreaIdx<m_nUserDefectAreaCount; nUserDefectAreaIdx++) |
| | | m_UserDefectPrm[nUserDefectAreaIdx].ReadRecipe(pFile, nSideIdx, nUserDefectAreaIdx); |
| | | |
| | | m_RipThk.ReadRecipe(pFile, nSideIdx); |
| | | |
| | | return TRUE; |
| | | } |
| | | |
| | |
| | | |
| | | for(int nUserDefectAreaIdx=0; nUserDefectAreaIdx<m_nUserDefectAreaCount; nUserDefectAreaIdx++) |
| | | m_UserDefectPrm[nUserDefectAreaIdx].WriteRecipe(pFile, nSideIdx, nUserDefectAreaIdx); |
| | | |
| | | m_RipThk.WriteRecipe(pFile, nSideIdx); |
| | | |
| | | return TRUE; |
| | | } |
| | |
| | | |
| | | return TRUE; |
| | | } |
| | | |
| | | void CRIP_THICKNESS_PARM::Reset() |
| | | { |
| | | 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) |
| | | { |
| | | if (!pFile) { |
| | | return FALSE; |
| | | } |
| | | |
| | | if (nSideIdx < 0 || nSideIdx >= MAX_SIDE_COUNT) { |
| | | return FALSE; |
| | | } |
| | | |
| | | CString k; |
| | | k = _T("RipThk_m_bUseInspect"); |
| | | pFile->GetItemValue(nSideIdx, k, m_bUseInspect, 0); |
| | | k = _T("RipThk_m_nLeftThres"); |
| | | pFile->GetItemValue(nSideIdx, k, m_nLeftThres, 0); |
| | | k = _T("RipThk_m_nRightThres"); |
| | | pFile->GetItemValue(nSideIdx, k, m_nRightThres, 0); |
| | | k = _T("RipThk_m_nGlassThres"); |
| | | pFile->GetItemValue(nSideIdx, k, m_nGlassThres, 0); |
| | | k = _T("RipThk_m_nRipDir"); |
| | | pFile->GetItemValue(nSideIdx, k, m_nRipDir, 2); |
| | | k = _T("RipThk_m_nRectLeft"); |
| | | pFile->GetItemValue(nSideIdx, k, m_nRectLeft, 0); |
| | | k = _T("RipThk_m_nTopOffset"); |
| | | pFile->GetItemValue(nSideIdx, k, m_nTopOffset, 0); |
| | | k = _T("RipThk_m_nRectRight"); |
| | | 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_nGlassSizeMax_um, 0); |
| | | k = _T("RipThk_m_nLeftRipSizeMin_um"); |
| | | pFile->GetItemValue(nSideIdx, k, m_nLeftRipSizeMin_um, 0); |
| | | k = _T("RipThk_m_nLeftRipSizeMax_um"); |
| | | pFile->GetItemValue(nSideIdx, k, m_nLeftRipSizeMax_um, 0); |
| | | k = _T("RipThk_m_nRightRipSizeMin_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; |
| | | } |
| | | |
| | | BOOL CRIP_THICKNESS_PARM::WriteRecipe(CConfig* pFile, int nSideIdx) |
| | | { |
| | | if (!pFile) { |
| | | return FALSE; |
| | | } |
| | | |
| | | if (nSideIdx < 0 || nSideIdx >= MAX_SIDE_COUNT) { |
| | | return FALSE; |
| | | } |
| | | |
| | | CString k; |
| | | k = _T("RipThk_m_bUseInspect"); |
| | | pFile->SetItemValue(nSideIdx, k, m_bUseInspect); |
| | | k = _T("RipThk_m_nLeftThres"); |
| | | pFile->SetItemValue(nSideIdx, k, m_nLeftThres); |
| | | k = _T("RipThk_m_nRightThres"); |
| | | pFile->SetItemValue(nSideIdx, k, m_nRightThres); |
| | | k = _T("RipThk_m_nGlassThres"); |
| | | pFile->SetItemValue(nSideIdx, k, m_nGlassThres); |
| | | k = _T("RipThk_m_nRipDir"); |
| | | pFile->SetItemValue(nSideIdx, k, m_nRipDir); |
| | | k = _T("RipThk_m_nRectLeft"); |
| | | pFile->SetItemValue(nSideIdx, k, m_nRectLeft); |
| | | k = _T("RipThk_m_nTopOffset"); |
| | | pFile->SetItemValue(nSideIdx, k, m_nTopOffset); |
| | | k = _T("RipThk_m_nRectRight"); |
| | | 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_nGlassSizeMax_um); |
| | | k = _T("RipThk_m_nLeftRipSizeMin_um"); |
| | | pFile->SetItemValue(nSideIdx, k, m_nLeftRipSizeMin_um); |
| | | k = _T("RipThk_m_nLeftRipSizeMax_um"); |
| | | pFile->SetItemValue(nSideIdx, k, m_nLeftRipSizeMax_um); |
| | | k = _T("RipThk_m_nRightRipSizeMin_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; |
| | | } |