#include "StdAfx.h" #include "RecipeTriangle.h" #include "CHCommonClasses/MacroFile.h" CRecipeTriangle::CRecipeTriangle(void) { Reset(); } CRecipeTriangle::CRecipeTriangle(const CString& strFilename) { ReadRecipe(strFilename); } CRecipeTriangle::~CRecipeTriangle(void) { Reset(); } void CRecipeTriangle::DelRecipeModel(UINT nIndex) { if (nIndex>=m_vectorRecipeModel.size()) return; // delete recipe triangle if (nIndex < m_vectorRecipeModel.size()) { UINT nSize = (UINT)m_vectorRecipeModel.size(); for (UINT i=nIndex; i=m_vectorRecipeMarker.size()) return; // delete recipe triangle if (nIndex < m_vectorRecipeMarker.size()) { UINT nSize = (UINT)m_vectorRecipeMarker.size(); for (UINT i=nIndex; i=m_vectorRecipeFormula.size()) return; // delete recipe triangle if (nIndex < m_vectorRecipeFormula.size()) { UINT nSize = (UINT)m_vectorRecipeFormula.size(); for (UINT i=nIndex; im_nTypeBand); strItem.Format(_T("MODEL_TYPE_DATA_%02d"), nIndex); macroFile.SetItem(strItem, it->m_nTypeData); strItem.Format(_T("MODEL_TYPE_METHOD_%02d"), nIndex); macroFile.SetItem(strItem, it->m_nTypeMethod); strItem.Format(_T("MODEL_SCORE_THRES_%02d"), nIndex); macroFile.SetItem(strItem, it->m_dScoreThres); strItem.Format(_T("MODEL_SOCRE_STOP_%02d"), nIndex); macroFile.SetItem(strItem, it->m_dScoreStop); strItem.Format(_T("MODEL_LEVEL_FIRST_%02d"), nIndex); macroFile.SetItem(strItem, it->m_nLevelFirst); strItem.Format(_T("MODEL_LEVEL_SECOND_%02d"), nIndex); macroFile.SetItem(strItem, it->m_nLevelLast); strItem.Format(_T("MODEL_LEVEL_RANGE_%02d"), nIndex); macroFile.SetItem(strItem, it->m_nLevelRange); nIndex++; } nIndex = 0; for (VectorRecipeMarkerIt it=m_vectorRecipeMarker.begin(); it!=m_vectorRecipeMarker.end(); it++) { strItem.Format(_T("MARKER_TYPE_BAND_%02d"), nIndex); macroFile.SetItem(strItem, it->m_nTypeBand); strItem.Format(_T("MARKER_TYPE_SUBPIXEL_%02d"), nIndex); macroFile.SetItem(strItem, it->m_nTypeSubPixel); strItem.Format(_T("MARKER_TYPE_PREPROCESS_%02d"), nIndex); macroFile.SetItem(strItem, it->m_nTypePreProcess); strItem.Format(_T("MARKER_MEASURE_TYPE_%02d"), nIndex); macroFile.SetItem(strItem, it->m_nMeasureType); strItem.Format(_T("MARKER_EDGE_LEFT_%02d"), nIndex); macroFile.SetItem(strItem, it->m_nEdgeLeft); strItem.Format(_T("MARKER_EDGE_RIGHT_%02d"), nIndex); macroFile.SetItem(strItem, it->m_nEdgeRight); strItem.Format(_T("MARKER_EDGE_KERNEL_SIZE_%02d"), nIndex); macroFile.SetItem(strItem, it->m_nEdgeKernelSize); strItem.Format(_T("MARKER_EDGE_KERNEL_SIGMA_%02d"), nIndex); macroFile.SetItem(strItem, it->m_dEdgeKernelSigma); strItem.Format(_T("MARKER_EDGE_ANGLE_%02d"), nIndex); macroFile.SetItem(strItem, it->m_dEdgeAngle); strItem.Format(_T("MARKER_EDGE_THRESHOLD_%02d"), nIndex); macroFile.SetItem(strItem, it->m_dEdgeThreshold); strItem.Format(_T("MARKER_EDGE_POSI_THRES_%02d"), nIndex); macroFile.SetItem(strItem, it->m_dEdgePosiThres); strItem.Format(_T("MARKER_EDGE_NEGA_THRES_%02d"), nIndex); macroFile.SetItem(strItem, it->m_dEdgeNegaThres); strItem.Format(_T("MARKER_EDGE_DIRECTION_%02d"), nIndex); macroFile.SetItem(strItem, it->m_nEdgeDirection); strItem.Format(_T("MARKER_EDGE_SEARCH_TYPE_%02d"), nIndex); macroFile.SetItem(strItem, it->m_nEdgeSearchType); strItem.Format(_T("MARKER_ITERATION_%02d"), nIndex); macroFile.SetItem(strItem, it->m_nIteration); strItem.Format(_T("MARKER_LENGTH_%02d"), nIndex); macroFile.SetItem(strItem, it->m_dLength); strItem.Format(_T("MARKER_LENGTH_VARIATION_%02d"), nIndex); macroFile.SetItem(strItem, it->m_dLengthVariation); strItem.Format(_T("MARKER_CIRCLE_THRESHOLD_%02d"), nIndex); macroFile.SetItem(strItem, it->m_nCircleThreshold); strItem.Format(_T("MARKER_CIRCLE_BLOB_MARGIN_%02d"), nIndex); macroFile.SetItem(strItem, it->m_nCircleBlobMargin); strItem.Format(_T("MARKER_ROI_LEFT_%02d"), nIndex); macroFile.SetItem(strItem, it->m_nROILeft); strItem.Format(_T("MARKER_ROI_TOP_%02d"), nIndex); macroFile.SetItem(strItem, it->m_nROITop); strItem.Format(_T("MARKER_ROI_WIDTH_%02d"), nIndex); macroFile.SetItem(strItem, it->m_nROIWidth); strItem.Format(_T("MARKER_ROI_HEIGHT_%02d"), nIndex); macroFile.SetItem(strItem, it->m_nROIHeight); nIndex++; } nIndex = 0; for (VectorRecipeFormulaIt it=m_vectorRecipeFormula.begin(); it!=m_vectorRecipeFormula.end(); it++) { strItem.Format(_T("FORMULA_RESULT_NAME_%02d"), nIndex); macroFile.SetItem(strItem, it->m_strResultName); strItem.Format(_T("FORMULA_FORMULATION_%02d"), nIndex); macroFile.SetItem(strItem, it->m_strFormulation); nIndex++; } return macroFile.Write(strFilename); } CResultTriangle::CResultTriangle(void) { Reset(); } CResultTriangle::~CResultTriangle(void) { Reset(); }