www.pudn.com > ISODATA.rar > dlgisodataopt.cpp


// dlgisodataopt.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "ISODATA.h" 
#include "dlgisodataopt.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CDlgISODATAOpt dialog 
 
 
CDlgISODATAOpt::CDlgISODATAOpt(CWnd* pParent /*=NULL*/) 
	: CDialog(CDlgISODATAOpt::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(CDlgISODATAOpt) 
	m_strCenThres = _T(""); 
	m_strClassMinNum = _T(""); 
	m_strDemaK = _T(""); 
	m_strIterMaxNum = _T(""); 
	m_strMergMaxNum = _T(""); 
	m_strSigInterM = _T(""); 
	m_strSigThres = _T(""); 
	m_strIterNum = _T(""); 
	m_iNoExamMidFile = -1; 
	//}}AFX_DATA_INIT 
} 
 
 
void CDlgISODATAOpt::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CDlgISODATAOpt) 
	DDX_Text(pDX, IDC_EDIT_CENTHRES, m_strCenThres); 
	DDX_Text(pDX, IDC_EDIT_CLASSMINNUM, m_strClassMinNum); 
	DDX_Text(pDX, IDC_EDIT_DEMAK, m_strDemaK); 
	DDX_Text(pDX, IDC_EDIT_ITERMAXNUM, m_strIterMaxNum); 
	DDX_Text(pDX, IDC_EDIT_MERGMAXNUM, m_strMergMaxNum); 
	DDX_Text(pDX, IDC_EDIT_SIGINTERM, m_strSigInterM); 
	DDX_Text(pDX, IDC_EDIT_SIGTHRES, m_strSigThres); 
	DDX_Text(pDX, IDC_EDIT_ITERNUM, m_strIterNum); 
	DDX_Radio(pDX, IDC_RADIO_EXAMMIDFILE, m_iNoExamMidFile); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CDlgISODATAOpt, CDialog) 
	//{{AFX_MSG_MAP(CDlgISODATAOpt) 
		// NOTE: the ClassWizard will add message map macros here 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CDlgISODATAOpt message handlers 
int CDlgISODATAOpt::SetISODATAOpt(ISODATA_OPT& ISODATAOpt, int iIterNum) 
{ 
	m_strCenThres.Format("%lf", ISODATAOpt.dCenThres); 
	m_strClassMinNum.Format("%d", ISODATAOpt.iClassMinNum); 
	m_strDemaK.Format("%d", ISODATAOpt.iDemaK); 
	m_strIterMaxNum.Format("%d", ISODATAOpt.iIterMaxNum); 
	m_strMergMaxNum.Format("%d", ISODATAOpt.iMergMaxNum); 
	m_strSigInterM.Format("%lf", ISODATAOpt.dSigInter); 
	m_strSigThres.Format("%lf", ISODATAOpt.dSigThres); 
	m_strIterNum.Format("%d", iIterNum); 
	m_iNoExamMidFile = ISODATAOpt.bNoExamMidFile; 
	return 1; 
 
} 
 
int CDlgISODATAOpt::GetISODATAOpt(ISODATA_OPT& ISODATAOpt) 
{ 
	ISODATAOpt.dCenThres = atof(m_strCenThres); 
	ISODATAOpt.iClassMinNum = atoi(m_strClassMinNum); 
	ISODATAOpt.iDemaK = atoi(m_strDemaK); 
	ISODATAOpt.iIterMaxNum = atoi(m_strIterMaxNum); 
	ISODATAOpt.iMergMaxNum = atoi(m_strMergMaxNum); 
	ISODATAOpt.dSigInter = atof(m_strSigInterM); 
	ISODATAOpt.dSigThres = atof(m_strSigThres); 
	ISODATAOpt.bNoExamMidFile = m_iNoExamMidFile; 
	return 1; 
}