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

📄 lmsview.cpp

📁 多通道IIR自适应算法仿真效果图
💻 CPP
字号:
// lmsView.cpp : implementation of the CLmsView class
//



#include "stdafx.h"
#include "lms.h"
#include "show.h"
#include "lmsView.h"
#include "math.h"
#include "MainFrm.h"
#include "lmsDoc.h"


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



/////////////////////////////////////////////////////////////////////////////
// CLmsView

IMPLEMENT_DYNCREATE(CLmsView, CFormView)

BEGIN_MESSAGE_MAP(CLmsView, CFormView)
	//{{AFX_MSG_MAP(CLmsView)
	ON_BN_CLICKED(IDC_nolms, Onnolms)
	ON_BN_CLICKED(IDC_firlms, Onfirlms)
	ON_BN_CLICKED(IDC_iirlms, Oniirlms)
	ON_BN_CLICKED(IDC_showoutput, Onshowoutput)
	ON_EN_CHANGE(IDC_UUvalue, OnChangeUUvalue)
	ON_BN_CLICKED(IDC_sininput, Onsininput)
	ON_BN_CLICKED(IDC_squareinput, Onsquareinput)
	ON_BN_CLICKED(IDC_triangleinput, Ontriangleinput)
	ON_EN_CHANGE(IDC_aaValue, OnChangeaaValue)
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CFormView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CFormView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CFormView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CLmsView construction/destruction

CLmsView::CLmsView()
	: CFormView(CLmsView::IDD)
{
	//{{AFX_DATA_INIT(CLmsView)
	m_nolms = FALSE;
	m_iirlms = FALSE;
	m_firlms = FALSE;
	m_Uvalue = 0.02f;
	m_aaValue = 0.008f;
	//}}AFX_DATA_INIT
	// TODO: add construction code here

}

CLmsView::~CLmsView()
{
}

void CLmsView::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CLmsView)
	DDX_Check(pDX, IDC_nolms, m_nolms);
	DDX_Check(pDX, IDC_iirlms, m_iirlms);
	DDX_Check(pDX, IDC_firlms, m_firlms);
	DDX_Text(pDX, IDC_UUvalue, m_Uvalue);
	DDV_MinMaxFloat(pDX, m_Uvalue, 0.f, 1.f);
	DDX_Text(pDX, IDC_aaValue, m_aaValue);
	DDV_MinMaxFloat(pDX, m_aaValue, 0.f, 1.f);
	//}}AFX_DATA_MAP
}

BOOL CLmsView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CFormView::PreCreateWindow(cs);
}

void CLmsView::OnInitialUpdate()
{
	CFormView::OnInitialUpdate();
	GetParentFrame()->RecalcLayout();
	ResizeParentToFit();
	
}

/////////////////////////////////////////////////////////////////////////////
// CLmsView printing

BOOL CLmsView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CLmsView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CLmsView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

void CLmsView::OnPrint(CDC* pDC, CPrintInfo* /*pInfo*/)
{
	// TODO: add customized printing code here
}

/////////////////////////////////////////////////////////////////////////////
// CLmsView diagnostics

#ifdef _DEBUG
void CLmsView::AssertValid() const
{
	CFormView::AssertValid();
}

void CLmsView::Dump(CDumpContext& dc) const
{
	CFormView::Dump(dc);
}

CLmsDoc* CLmsView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CLmsDoc)));
	return (CLmsDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CLmsView message handlers

void CLmsView::Onnolms() 
{
	m_nolms=!m_nolms;
}

void CLmsView::Onfirlms() 
{
	m_firlms=!m_firlms;
}

void CLmsView::Oniirlms() 
{
	m_iirlms=!m_iirlms;	
}


//显示输出按钮响应函数
void CLmsView::Onshowoutput() 
{
	CLmsApp *pApp = (CLmsApp *)AfxGetApp();
	CMainFrame *pFrame = (CMainFrame *)pApp->m_pMainWnd;
	show *pView = (show *)pFrame->diviedview.GetPane(0,1);
	pView->index=1;
	pView->Invalidate();
}	

void CLmsView::Onuvalue() 
{
	UpdateData(TRUE);
}

void CLmsView::OnChangeUUvalue() 
{
	UpdateData(TRUE);
}

void CLmsView::Onsininput() 
{
	m_sininput=true;
	m_triangleinput=false;
	m_squareinput=false;
	
}

void CLmsView::Onsquareinput() 
{
	m_squareinput=true;
	m_sininput=false;
	m_triangleinput=false;
	
}

void CLmsView::Ontriangleinput() 
{			
	m_triangleinput=true;
	m_squareinput=false;
	m_sininput=false;
	
}

void CLmsView::OnChangeaaValue() 
{
	UpdateData(TRUE);
}

⌨️ 快捷键说明

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