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

📄 chgaxisdlg.cpp

📁 一个通过USB->UART读取C8051F060的程序
💻 CPP
字号:
// ChgAxisDlg.cpp : implementation file
//

#include "stdafx.h"
#include "BattTest.h"
#include "ChgAxisDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CChgAxisDlg dialog


CChgAxisDlg::CChgAxisDlg(CCalWfmGraph *pWfmGraph, CWnd* pParent /*=NULL*/)
	: CDialog(CChgAxisDlg::IDD, pParent), m_pWfmGraph(pWfmGraph)
{
	//{{AFX_DATA_INIT(CChgAxisDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CChgAxisDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CChgAxisDlg)
	DDX_Control(pDX, IDC_AC_YMAXAXIS, m_acMax);
	DDX_Control(pDX, IDC_AC_YMINAXIS, m_acMin);
	DDX_Control(pDX, IDC_DC_YMAXAXIS, m_dcMax);
	DDX_Control(pDX, IDC_DC_YMINAXIS, m_dcMin);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CChgAxisDlg, CDialog)
	//{{AFX_MSG_MAP(CChgAxisDlg)
	ON_BN_CLICKED(IDCOMMIT, OnCommit)
	ON_WM_DESTROY()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CChgAxisDlg message handlers

void CChgAxisDlg::OnCommit() 
{
	//得到Y轴的最大/小值
	char  szWndCtx[32];
	double min, max;
	if (m_pWfmGraph != NULL)
	{		
			//1.交流通道
			m_acMax.GetWindowText(szWndCtx, 32);
			max = ::atof(szWndCtx);
			m_acMin.GetWindowText(szWndCtx, 32);
			min = ::atof(szWndCtx);
			m_pWfmGraph->SetYRange(1, min, max);

			//2.直流通道
			m_dcMax.GetWindowText(szWndCtx, 32);
			max = ::atof(szWndCtx);
			m_dcMin.GetWindowText(szWndCtx, 32);
			min = ::atof(szWndCtx);
			m_pWfmGraph->SetYRange(2, min, max);
	}
	//
	this->EndDialog(IDOK);
}

BOOL CChgAxisDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	//
	m_acMax.SetRange(-10.00f, 10.0f);
	m_acMax.SetWindowText("3.0");
	m_acMin.SetRange(-10.00f, 10.0f);
	m_acMin.SetWindowText("-3.0");	

	m_dcMax.SetRange(-10.00f, 80.0f);
	m_dcMax.SetWindowText("40.0");
	m_dcMin.SetRange(-10.00f, 80.0f);
	m_dcMin.SetWindowText("-10.0");
	
	
	
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CChgAxisDlg::OnDestroy() 
{
	CDialog::OnDestroy();
	
	// TODO: Add your message handler code here
	m_pWfmGraph = NULL;
}

⌨️ 快捷键说明

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