📄 configfile.cpp
字号:
#include "stdafx.h"
#include "ConfigFile.h"
#include <comutil.h>
#include <stdio.h>
#include <crtdbg.h>
_CrtMemState startMemState;
_CrtMemState endMemState;
#include "tinyxml/tinyxml.h"
CConfigFile::CConfigFile(char* configfilename)
{
//init Paras
this->ImageProcessPara_Threshold=0;
//Read XML file
TiXmlDocument xmlDoc;
xmlDoc.LoadFile(configfilename);
TiXmlHandle xmlHandle(&xmlDoc);
TiXmlHandle doc_handle(xmlHandle);
//Read ImageProcessPara
TiXmlElement* cfg_ImageProcessPara = doc_handle.FirstChild("config").FirstChild("ImageProcessPara").Element();
this->ImageProcessPara_Threshold = (int)strtol(_bstr_t(cfg_ImageProcessPara->Attribute("Threshold")),NULL,10);
this->ImageProcessPara_ThresholdSmall = (int)strtol(_bstr_t(cfg_ImageProcessPara->Attribute("ThresholdSmall")),NULL,10);
this->ImageProcessPara_MinRefuse = (int)strtol(_bstr_t(cfg_ImageProcessPara->Attribute("MinRefuse")),NULL,10);
this->ImageProcessPara_MaxRefuse = (int)strtol(_bstr_t(cfg_ImageProcessPara->Attribute("MaxRefuse")),NULL,10);
TiXmlElement* cfg_ImageAnalysePara = doc_handle.FirstChild("config").FirstChild("ImageAnalysePara").Element();
this->ImageAnalysePara_LineLength = (int)strtol(_bstr_t(cfg_ImageAnalysePara->Attribute("LineLength")),NULL,10);
this->ImageAnalysePara_DistanceToLineLength= (int)strtol(_bstr_t(cfg_ImageAnalysePara->Attribute("DistanceToLineLength")),NULL,10);
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -