資源簡介
相溫度數據采集系統上位機程序,也可作其他數據接收程序,十進制顯示數據、波形。分了3個大塊,左邊為參數設置,中間為實時波形顯示,右邊為實時數據值顯示以及數據發送模塊。兼顧了串口助手功能和上位機接收程序功能。接收的數字以十進制顯示,精確到小數點后面一位。波形顯示實時值并動態替換,一秒刷新一次。當有價值。

代碼片段和文件信息
//?DataReceiveDlg.cpp?:?implementation?file
//
#include?“stdafx.h“
#include?“串口通信.h“
#include?“DataReceiveDlg.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CDataReceiveDlg?dialog
CDataReceiveDlg::CDataReceiveDlg(CWnd*?pParent?/*=NULL*/)
:?CDialog(CDataReceiveDlg::IDD?pParent)
{
//{{AFX_DATA_INIT(CDataReceiveDlg)
//?NOTE:?the?ClassWizard?will?add?member?initialization?here
//}}AFX_DATA_INIT
}
void?CDataReceiveDlg::DoDataExchange(CDataExchange*?pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDataReceiveDlg)
DDX_Control(pDX?IDC_LIST1?m_List);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDataReceiveDlg?CDialog)
//{{AFX_MSG_MAP(CDataReceiveDlg)
//?NOTE:?the?ClassWizard?will?add?message?map?macros?here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CDataReceiveDlg?message?handlers
BOOL?CDataReceiveDlg::OnInitDialog()
{
CDialog::OnInitDialog();
this->m_pRS=new?CDaoRecordset(&m_db);
ListView_SetExtendedListViewstyle(?m_List.m_hWnd?
LVS_EX_FULLROWSELECT|LVS_EX_ONECLICKACTIVATE|LVS_EX_UNDERLINEHOT?);
m_List.InsertColumn(0“時間“NULL200);
m_List.InsertColumn(1“數據“NULL300);
this->OpenTable();
this->m_pRS->Close();
this->m_db.Close();
return?TRUE;
}
void?CDataReceiveDlg::OpenTable()
{
int?nItem;
COleVariant?var;
var.ChangeType(VT_BSTRNULL);
this->m_db.Open(“temp.mdb“);
this->m_pRS->Open(AFX_DAO_USE_DEFAULT_TYPE“select?*?from?Receive“NULL);
while(!this->m_pRS->IsEOF())
{
nItem=this->m_List.InsertItem(this->m_List.GetItemCount()+1NULL);
this->m_pRS->GetFieldValue(“時間“var);
this->m_List.SetItemText(nItem0(LPCSTR)var.pbstrVal);
this->m_pRS->GetFieldValue(“數據“var);
this->m_List.SetItemText(nItem1(LPCSTR)var.pbstrVal);
this->m_pRS->MoveNext();
}
}
BOOL?CDataReceiveDlg::DestroyWindow()?
{
//?TODO:?Add?your?specialized?code?here?and/or?call?the?base?class
delete?this->m_pRS;
return?CDialog::DestroyWindow();
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????2194??2006-04-23?22:20??12\09\PC串口通信程序\DataReceiveDlg.cpp
?????文件???????1420??2006-04-23?22:20??12\09\PC串口通信程序\DataReceiveDlg.h
?????文件???????2142??2006-04-23?22:26??12\09\PC串口通信程序\DataSendDlg.cpp
?????文件???????1384??2006-04-23?22:24??12\09\PC串口通信程序\DataSendDlg.h
?????文件?????962612??1998-06-17?00:00??12\09\PC串口通信程序\MFC42D.DLL
?????文件?????303157??1998-06-17?00:00??12\09\PC串口通信程序\MFCD42D.DLL
?????文件?????827445??1998-06-17?00:00??12\09\PC串口通信程序\MFCO42D.DLL
?????文件???????8569??2006-04-20?17:45??12\09\PC串口通信程序\mscomm.cpp
?????文件???????3221??2006-04-20?17:45??12\09\PC串口通信程序\mscomm.h
?????文件?????434252??1998-06-17?00:00??12\09\PC串口通信程序\MSVCRTD.DLL
?????文件???????3597??2006-04-20?17:34??12\09\PC串口通信程序\ReadMe.txt
?????文件????????223??2006-10-15?17:17??12\09\PC串口通信程序\Send.txt
?????文件????????210??2006-04-20?17:34??12\09\PC串口通信程序\StdAfx.cpp
?????文件???????1073??2006-04-23?20:09??12\09\PC串口通信程序\StdAfx.h
?????文件??????86016??2008-12-06?13:12??12\09\PC串口通信程序\temp.mdb
?????文件???????4310??2008-12-08?20:43??12\09\PC串口通信程序\串口通信.clw
?????文件???????2025??2006-04-20?17:34??12\09\PC串口通信程序\串口通信.cpp
?????文件???????5247??2006-10-15?15:07??12\09\PC串口通信程序\串口通信.dsp
?????文件????????568??2006-04-20?18:07??12\09\PC串口通信程序\串口通信.dsw
?????文件???????1292??2006-04-20?17:34??12\09\PC串口通信程序\串口通信.h
?????文件?????230400??2008-12-08?20:43??12\09\PC串口通信程序\串口通信.ncb
?????文件????????964??2008-12-08?20:43??12\09\PC串口通信程序\串口通信.plg
?????文件??????51262??2006-10-15?15:01??12\09\PC串口通信程序\res\31.ico
?????文件????????567??2006-06-21?22:53??12\09\PC串口通信程序\res\XP風格.exe.manifest
?????文件????????400??2006-04-20?17:34??12\09\PC串口通信程序\res\串口通信.rc2
?????文件???????1956??2008-12-08?18:50??12\09\PC串口通信程序\串口通信Dlg.h
?????文件??????12475??2008-12-08?20:43??12\09\PC串口通信程序\串口通信.rc
?????文件??????56832??2008-12-08?20:43??12\09\PC串口通信程序\串口通信.opt
?????文件???????2062??2008-12-08?19:54??12\09\PC串口通信程序\resource.h
?????文件??????15830??2008-12-08?20:41??12\09\PC串口通信程序\串口通信Dlg.cpp
............此處省略10個文件信息
評論
共有 條評論