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

📄 analysedlg.cpp

📁 运用扫描法求设计一个最佳比例的聚光腔
💻 CPP
字号:
// AnalyseDlg.cpp : implementation file
//

#include "stdafx.h"
#include "simulate.h"
#include "AnalyseDlg.h"
#include "ParamStruct.h"

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

/////////////////////////////////////////////////////////////////////////////
// CAnalyseDlg dialog


CAnalyseDlg::CAnalyseDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CAnalyseDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CAnalyseDlg)
	m_nAllPhoton = 0;
	m_nBadPhoton = 0;
	m_nDeadPhoton = 0;
	m_nIndex = 0;
	m_fLAxis = 0.0f;
	m_fLAxisAdd = 0.0f;
	m_fLAxisFrom = 0.0f;
	m_fObjRadius = 0.0f;
	m_nReflectCount = 0;
	m_fSAxis = 0.0f;
	m_fSAxisAdd = 0.0f;
	m_fSAxisFrom = 0.0f;
	m_fShineIntensity = 0.0f;
	m_strObjSort = _T("");
	m_nGoodPhoton = 0;
	m_strGoodRate = _T("");
	m_strBadRate = _T("");
	m_strDeadRate = _T("");
	//}}AFX_DATA_INIT
	//加载位图
	m_bitOk.LoadBitmap(IDB_OK);
	m_hIcon=::AfxGetApp()->LoadIcon(IDI_SET);
}


void CAnalyseDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CAnalyseDlg)
	DDX_Text(pDX, IDC_EDIT_ALLPHOTON, m_nAllPhoton);
	DDX_Text(pDX, IDC_EDIT_BADPHOTON, m_nBadPhoton);
	DDX_Text(pDX, IDC_EDIT_DEADPHOTON, m_nDeadPhoton);
	DDX_Text(pDX, IDC_EDIT_INDEX, m_nIndex);
	DDX_Text(pDX, IDC_EDIT_LAXIS, m_fLAxis);
	DDX_Text(pDX, IDC_EDIT_LAXISADD, m_fLAxisAdd);
	DDX_Text(pDX, IDC_EDIT_LAXISFORM, m_fLAxisFrom);
	DDX_Text(pDX, IDC_EDIT_OBJRADIUS, m_fObjRadius);
	DDX_Text(pDX, IDC_EDIT_REFLECTCOUNT, m_nReflectCount);
	DDX_Text(pDX, IDC_EDIT_SAXIS, m_fSAxis);
	DDX_Text(pDX, IDC_EDIT_SAXISADD, m_fSAxisAdd);
	DDX_Text(pDX, IDC_EDIT_SAXISFORM, m_fSAxisFrom);
	DDX_Text(pDX, IDC_EDIT_SHINEINTENSITY, m_fShineIntensity);
	DDX_Text(pDX, IDC_EDIT_OBJSORT, m_strObjSort);
	DDX_Text(pDX, IDC_EDIT_GOODPHOTON, m_nGoodPhoton);
	DDX_Text(pDX, IDC_EDIT_GOODRATE, m_strGoodRate);
	DDX_Text(pDX, IDC_EDIT_BADRATE, m_strBadRate);
	DDX_Text(pDX, IDC_EDIT_DEADRATE, m_strDeadRate);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CAnalyseDlg, CDialog)
	//{{AFX_MSG_MAP(CAnalyseDlg)
	ON_BN_CLICKED(IDC_LOCATE, OnLocate)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAnalyseDlg message handlers

BOOL CAnalyseDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	((CButton*)GetDlgItem(IDOK))->SetBitmap(m_bitOk);
	
	SetIcon(m_hIcon,true);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CAnalyseDlg::Display(Record r,SetParam sp)
{
	//---------------------设置-----------------------
	m_fLAxisAdd=sp.fLAxisAdd;
	m_fLAxisFrom=sp.fLAxisFrom;
	m_fObjRadius=sp.fObjRadius;
	m_fSAxisAdd=sp.fSAxisAdd;
	m_fSAxisFrom=sp.fSAxisFrom;
	m_fShineIntensity=sp.fShineIntensity;
	m_nAllPhoton=sp.nAllPhoton;
	m_nReflectCount=sp.nReflectCount;
	if(sp.nObjSort==1)
		m_strObjSort="球体";
	else
		m_strObjSort="球面";
	//------------------------------------------------


	//---------------------记录-----------------------
	this->m_strGoodRate.Format("%f",r.fGoodRate*100);
	this->m_strGoodRate=this->m_strGoodRate+"%";

	this->m_strBadRate.Format("%f",r.fBadRate*100);
	this->m_strBadRate=this->m_strBadRate+"%";

	this->m_strDeadRate.Format("%f",r.fDeadRate*100);
	this->m_strDeadRate=this->m_strDeadRate+"%";

	this->m_fLAxis=r.fLAxis;
	this->m_fSAxis=r.fSAxis;
	this->m_nBadPhoton=r.nBadPhotonCount;
	this->m_nDeadPhoton=r.nDeadPhotonCount;
	this->m_nGoodPhoton=r.nGoodPhotonCount;
	this->m_nIndex=r.nIndex;
	//------------------------------------------------
}

void CAnalyseDlg::OnLocate() 
{
	// TODO: Add your control notification handler code here
	
}

⌨️ 快捷键说明

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