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

📄 historydata.cpp

📁 这是一个水箱的液位控制程序
💻 CPP
字号:
// historydata.cpp : implementation file//#include "stdafx.h"#include "水箱实验.h"#include "historydata.h"#include "conio.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// Chistorydata dialogChistorydata::Chistorydata(CWnd* pParent /*=NULL*/)	: CDialog(Chistorydata::IDD, pParent){	//{{AFX_DATA_INIT(Chistorydata)	m_historytimeget1 = 0;	m_historytimeget2 = 0;	m_historyshowmv1 = _T("");	m_historyshowmv2 = _T("");	m_historyshowpv1 = _T("");	m_historyshowpv2 = _T("");	m_historyshowsv1 = _T("");	m_historyshowsv2 = _T("");	//}}AFX_DATA_INIT}void Chistorydata::DoDataExchange(CDataExchange* pDX){	CDialog::DoDataExchange(pDX);	//{{AFX_DATA_MAP(Chistorydata)	DDX_Control(pDX, IDC_HISTORYTIMEGET2, m_historytimegetedit2);	DDX_Control(pDX, IDC_HISTORYTIMEGET1, m_historytimegetedit1);	DDX_Text(pDX, IDC_HISTORYTIMEGET1, m_historytimeget1);	DDX_Text(pDX, IDC_HISTORYTIMEGET2, m_historytimeget2);	DDX_Text(pDX, IDC_HISTORYSHOWMV1, m_historyshowmv1);	DDX_Text(pDX, IDC_HISTORYSHOWMV2, m_historyshowmv2);	DDX_Text(pDX, IDC_HISTORYSHOWPV1, m_historyshowpv1);	DDX_Text(pDX, IDC_HISTORYSHOWPV2, m_historyshowpv2);	DDX_Text(pDX, IDC_HISTORYSHOWSV1, m_historyshowsv1);	DDX_Text(pDX, IDC_HISTORYSHOWSV2, m_historyshowsv2);	//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(Chistorydata, CDialog)	//{{AFX_MSG_MAP(Chistorydata)	ON_EN_CHANGE(IDC_HISTORYTIMEGET1, OnChangeHistorytimeget1)	ON_EN_CHANGE(IDC_HISTORYTIMEGET2, OnChangeHistorytimeget2)	ON_WM_PAINT()	//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// Chistorydata message handlersBOOL Chistorydata::OnInitDialog() {	CDialog::OnInitDialog();		// TODO: Add extra initialization here	m_historytimegetedit1.LimitText(5);	m_historytimegetedit2.LimitText(5);	m_historytimeget1=GetDlgItemInt(IDC_HISTORYTIMEGET1);	m_historytimeget2=GetDlgItemInt(IDC_HISTORYTIMEGET2);//	m_peroutput1+="%";	m_historyshowmv1.Format("%4.2f",historymv1);	m_historyshowmv1+="mA";	SetDlgItemText(IDC_HISTORYSHOWMV1,m_historyshowmv1);	m_historyshowmv2.Format("%4.2f",historymv2);	m_historyshowmv2+="mA";	SetDlgItemText(IDC_HISTORYSHOWMV2,m_historyshowmv2);	m_historyshowsv1.Format("%4.3f",historysv1);	m_historyshowsv1+="v";	SetDlgItemText(IDC_HISTORYSHOWSV1,m_historyshowsv1);	m_historyshowsv2.Format("%4.3f",historysv2);	m_historyshowsv2+="v";	SetDlgItemText(IDC_HISTORYSHOWSV2,m_historyshowsv2);		m_historyshowpv1.Format("%4.3f",historypv1);	m_historyshowpv1+="v";	SetDlgItemText(IDC_HISTORYSHOWPV1,m_historyshowpv1);	m_historyshowpv2.Format("%4.3f",historypv2);	m_historyshowpv2+="v";	SetDlgItemText(IDC_HISTORYSHOWPV2,m_historyshowpv2);		return TRUE;  // return TRUE unless you set the focus to a control	              // EXCEPTION: OCX Property Pages should return FALSE}void Chistorydata::OnChangeHistorytimeget1() {	// 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	m_historytimeget1=GetDlgItemInt(IDC_HISTORYTIMEGET1);	}void Chistorydata::OnChangeHistorytimeget2() {	// 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	m_historytimeget2=GetDlgItemInt(IDC_HISTORYTIMEGET2);}void Chistorydata::OnPaint() {	CPaintDC dc(this); // device context for painting		// TODO: Add your message handler code here	HWND edit;	GetDlgItem(IDC_HISTORYTIMEGET1,&edit);	::SetFocus(edit);		// Do not call CDialog::OnPaint() for painting messages}

⌨️ 快捷键说明

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