⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dlginputpara.cpp

📁 火力分配的应用
💻 CPP
字号:
// DlgInputPara.cpp : implementation file
//

#include "stdafx.h"
#include "genetest.h"
#include "DlgInputPara.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDlgInputPara dialog


CDlgInputPara::CDlgInputPara(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgInputPara::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlgInputPara)
	m_fcrossover = 0.0f;
	m_ngenerations = 0;
	m_fmutation = 0.0f;
	m_npopulationsize = 0;
	m_ntarget = 0;
	m_nweapon = 0;
	
	//}}AFX_DATA_INIT
}


void CDlgInputPara::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgInputPara)
	DDX_Text(pDX, IDC_EDIT_Crossover, m_fcrossover);
	DDX_Text(pDX, IDC_EDIT_Generations, m_ngenerations);
	DDX_Text(pDX, IDC_EDIT_Mutation, m_fmutation);
	DDX_Text(pDX, IDC_EDIT_Populationsize, m_npopulationsize);
	DDX_Text(pDX, IDC_EDIT_Target, m_ntarget);
	DDX_Text(pDX, IDC_EDIT_Weapon, m_nweapon);
	
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDlgInputPara, CDialog)
	//{{AFX_MSG_MAP(CDlgInputPara)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDlgInputPara message handlers

void CDlgInputPara::OnOK() 
{
	// TODO: Add extra validation here
	UpdateData(TRUE);
	if((m_npopulationsize%2)!=0)
	{
		MessageBox("群体规模必须为偶数!");
		return;
	}

	CDialog::OnOK();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -