filterfusedlg.cpp

来自「基于小波的SAR斑点处理」· C++ 代码 · 共 125 行

CPP
125
字号
// FilterFuseDlg.cpp : implementation file
//

#include "stdafx.h"
#include "RSIP.h"
#include "FilterFuseDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CFilterFuseDlg dialog

CFilterFuseDlg::CFilterFuseDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CFilterFuseDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CFilterFuseDlg)
	m_nMode = 3;
	m_dA = 0.64;
	m_dB = 0.70;
	m_bShowTime = FALSE;
	m_nType = 1;
	m_strFilteredFile = _T("");
	m_strOrginalFile = _T("");
	//}}AFX_DATA_INIT
}


void CFilterFuseDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CFilterFuseDlg)
	DDX_Text(pDX, IDC_MODE, m_nMode);
	DDV_MinMaxInt(pDX, m_nMode, 3, 10);
	DDX_Text(pDX, IDC_A, m_dA);
	DDX_Text(pDX, IDC_B, m_dB);
	DDX_Check(pDX, IDC_CHECK1, m_bShowTime);
	DDX_Radio(pDX, IDC_RADIO1, m_nType);
	DDX_Text(pDX, IDC_FILTERED_FILE, m_strFilteredFile);
	DDX_Text(pDX, IDC_ORGINAL_FILE, m_strOrginalFile);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CFilterFuseDlg, CDialog)
	//{{AFX_MSG_MAP(CFilterFuseDlg)
	ON_BN_CLICKED(IDC_OPEN_FILE, OnOpenFile)
	ON_BN_CLICKED(IDC_OPEN_FILE1, OnOpenFile1)
	ON_EN_CHANGE(IDC_A, OnChangeA)
	ON_EN_CHANGE(IDC_B, OnChangeB)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFilterFuseDlg message handlers

void CFilterFuseDlg::OnOpenFile() 
{
    //打开文件对话框
	CFileDialog dlg(TRUE,"dat",NULL,
		OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,
		"Image Files(*.dat,*.raw)|*.dat;*.raw||",NULL);
	if(dlg.DoModal()==IDOK)
		m_strOrginalFile = dlg.GetPathName();
	else
	{
		AfxMessageBox("打开文件失败!");
		return;
	}
	UpdateData(FALSE);
}

void CFilterFuseDlg::OnOpenFile1() 
{
    //打开文件对话框
	CFileDialog dlg(TRUE,"dat",NULL,
		OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,
		"Image Files(*.dat,*.raw)|*.dat;*.raw||",NULL);
	if(dlg.DoModal()==IDOK)
		m_strFilteredFile = dlg.GetPathName();
	else
	{
		AfxMessageBox("打开文件失败!");
		return;
	}
	UpdateData(FALSE);
}

void CFilterFuseDlg::OnOK() 
{
	// TODO: Add extra validation here
	if(m_strFilteredFile == "" && m_strFilteredFile == "")
	{
		AfxMessageBox("请选择所需的文件!");
		CDialog::OnCancel();
	}
	UpdateData(TRUE);
	CDialog::OnOK();
}

void CFilterFuseDlg::OnChangeA() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function and call CRichEditCtrl().SetEventMask()
	// with the ENM_CHANGE flag ORed into the mask.
	
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
}

void CFilterFuseDlg::OnChangeB() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function and call CRichEditCtrl().SetEventMask()
	// with the ENM_CHANGE flag ORed into the mask.
	
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
}

⌨️ 快捷键说明

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