资源简介
简易PC虚拟串口示波器,包含VC++整个工程源码,信号由串口输入,可有proteus仿真输入信号来测试。
代码片段和文件信息
// Scope1.cpp : implementation file
//
#include “stdafx.h“
#include “resource.h“
#include “Scope.h“
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CScope
CScope::CScope()
{
m_strtitle = _T(“示波器“);
m_strValueName = _T(“数值“);
m_strUnitName = _T(“度“);
m_BkBrush.CreateSolidBrush(RGB(0x000x000x33));
m_PanelBrush.CreateSolidBrush(RGB(0x220x220x44));
m_CurveBrush.CreateSolidBrush(RGB(0x000x000x00));
m_PenCurve.CreatePen(PS_SOLID2RGB(02550));
m_PenGrid.CreatePen(PS_SOLID0RGB(192192192));
m_PenBrightLine.CreatePen(PS_SOLID0RGB(0xff0xff0xff));
m_PenDarkLine.CreatePen(PS_SOLID0RGB(0x550x550x55));
m_Fonttitle.CreateFont(18000FW_BOLDFALSEFALSEFALSEDEFAULT_CHARSET
OUT_DEFAULT_PRECISCLIP_DEFAULT_PRECISDEFAULT_QUALITYDEFAULT_PITCH“宋体“);
m_FontAxis.CreateFont(15000FW_THINFALSEFALSEFALSEDEFAULT_CHARSET
OUT_DEFAULT_PRECISCLIP_DEFAULT_PRECISDEFAULT_QUALITYDEFAULT_PITCH“Arial“);
m_FontValue.CreatePointFont(120“FixedSys“);
m_FontLabel.CreatePointFont(120“Times New Roman“);
m_bitmaptitle.LoadBitmap(IDB_title);
m_bitmapTrack.LoadBitmap(IDB_TRACK);
m_dDimT = 1.0;
m_dDimY = 2.5;
m_nbase = 5;
m_nRange = 10;
m_dValue= 0.0;
m_nArrowIndex =-1;
m_bPressed = FALSE;
}
CScope::~CScope()
{
if(!m_TimeList.empty())
m_TimeList.clear();
if(!m_ValueList.empty())
m_ValueList.clear();
}
BEGIN_MESSAGE_MAP(CScope CStatic)
//{{AFX_MSG_MAP(CScope)
ON_WM_ERASEBKGND()
ON_WM_PAINT()
ON_WM_LBUTTONUP()
ON_WM_LBUTTONDOWN()
ON_WM_MOUSEMOVE()
ON_WM_NCHITTEST()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CScope message handlers
BOOL CScope::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
CRect rect;
GetClientRect(&rect);
pDC->FillRect(&rect&m_BkBrush);//Draw background
rect.InflateRect(-3-25-4-60);//curve panel
m_rectCurvePanel = rect;
m_rectCurve = rect;
m_rectCurve.InflateRect(-30-5-23-25);//curve area
m_rectScroll = m_rectCurve;
m_rectScroll.left = m_rectCurve.right+8;
m_rectScroll.right = m_rectScroll.left+10;//rect scroll created
m_rectValuePanel = rect;
m_rectValuePanel.top = rect.bottom+5;
m_rectValuePanel.bottom= m_rectValuePanel.top+51;//rectValuePanel created
CFont *pOldFont;
pOldFont = pDC->Selectobject(&m_FontLabel);
CSize size = pDC->GetTextExtent(m_strValueName);
m_rectValue.left = m_rectValuePanel.left+20+size.cx;
m_rectValue.top = m_rectValuePanel.top+(m_rectValuePanel.Height()-size.cy)/2-2;
m_rectValue.bottom = m_rectValue.top+size.cy+4;
size = pDC->GetTextExtent(m_strUnitName);
m_rectValue.right = m_rectValuePanel.right - 20 - size.cx;
pDC->Selectobject(pOldFont);
if(m_rgnCurve.m_hobject==NULL)
m_rgnCurve.C
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 28672 2011-09-19 13:59 SerialPortTest\C++.IAB
文件 608 2011-09-19 13:59 SerialPortTest\C++.IAD
文件 8192 2011-09-19 13:59 SerialPortTest\C++.IMB
文件 408 2011-09-19 13:59 SerialPortTest\C++.IMD
文件 64 2011-09-21 10:24 SerialPortTest\C++.PFI
文件 776 2011-09-21 10:24 SerialPortTest\C++.PO
文件 5504 2011-09-19 13:59 SerialPortTest\C++.PR
文件 32896 2011-09-19 13:59 SerialPortTest\C++.PRI
文件 53316 2011-09-21 10:24 SerialPortTest\C++.PS
文件 256 2011-09-19 20:35 SerialPortTest\C++.SearchResults
文件 18460 2012-05-31 10:25 SerialPortTest\C++.WK3
文件 11114 2011-03-24 12:58 SerialPortTest\Debug\BuildLog.htm
文件 98840 2011-04-08 19:57 SerialPortTest\Debug\Scope.obj
文件 26555 2011-05-28 15:05 SerialPortTest\Debug\SerialPort.obj
文件 0 2011-05-28 15:05 SerialPortTest\Debug\SerialPort.sbr
文件 5366784 2011-09-19 15:26 SerialPortTest\Debug\SerialPortTest.bsc
文件 135233 2011-09-19 15:26 SerialPortTest\Debug\SerialPortTest.exe
文件 2048 2011-03-24 12:58 SerialPortTest\Debug\SerialPortTest.exe.em
文件 333952 2011-09-19 15:26 SerialPortTest\Debug\SerialPortTest.ilk
文件 33306 2011-05-28 15:05 SerialPortTest\Debug\SerialPortTest.obj
文件 3800 2011-05-28 15:05 SerialPortTest\Debug\SerialPortTest.res
文件 0 2011-05-28 15:05 SerialPortTest\Debug\SerialPortTest.sbr
文件 84156 2011-09-19 15:26 SerialPortTest\Debug\SerialPortTestDlg.obj
文件 0 2011-09-19 15:26 SerialPortTest\Debug\SerialPortTestDlg.sbr
文件 105532 2011-05-28 15:05 SerialPortTest\Debug\StdAfx.obj
文件 1373432 2011-05-28 15:05 SerialPortTest\Debug\StdAfx.sbr
文件 13368 2011-09-19 15:26 SerialPortTest\Debug\TestBtn.obj
文件 0 2011-09-19 15:26 SerialPortTest\Debug\TestBtn.sbr
文件 238592 2011-09-19 15:26 SerialPortTest\Debug\vc60.idb
文件 397312 2011-09-19 15:26 SerialPortTest\Debug\vc60.pdb
............此处省略46个文件信息
- 上一篇:小型CAD系统MFC实现
- 下一篇:MFC绘图程序,实现绘图中的各种形式。
相关资源
- VC++ 多线程文件读写操作
- 移木块游戏,可以自编自玩,vc6.0编写
- VC++MFC小游戏实例教程(实例)+MFC类库
- VC++实现CMD命令执行与获得返回信息
- VC++基于OpenGL模拟的一个3维空间模型
- 基于VC++的SolidWorks二次开发SolidWorks
- 派克变换VC++源码(附文档)
- VC++ 串口
- VC++ 大富翁4_大富翁游戏源码
- VC++ 摄像头视频采集与回放源程序
- 转 VC++ 实现电子邮件(Email)发送
- 基于MFC的VC++仿QQ浏览器源码(雏形)
- VC++ 服务程序编写及安装与卸载
- VC++6.0番茄西红柿VAXvirsual assist X完美破
- 基于改进的fcm算法的图像分割vc++
- VC++6.0 绿色版,免安装,非常好用。
- Microsoft Visual C++ 2005 Redistributable Pack
- VC++MFC课程设计的学生成绩管理系统
- 大智慧365DLL插件设计
- VC++6.0汉化包
- VC++完整商业界面源码(再上传)
- VC++编程技术600个大型项目源码.rar
- VC++实现RSA加密算法
- VC++ 中国象棋经典游戏源代码
- 郁金香VC++游戏辅助视频教程
- C语言进阶源码---基于graphics实现图书
- 摄影测量相对定向VC++程序
- VC++数字图像处理典型算法及实现
- VC++酒店客房管理系统 MFC
- 车站计算机联锁vc++6.0程序代码
评论
共有 条评论