资源简介
在以前的绘图模块基础上对信号处理结果显示,是学习信号处理的产物。虽然在matlab中更容易,但在项目中需要信号处理模块,所以编写为C++代码。目前,功能还比较简单,后期将逐渐键入更多信号处理的模块。
代码片段和文件信息
// Chart.cpp : implementation file
//
#include “stdafx.h“
#include “TestMyChart.h“
#include “Chart.h“
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CChart
//##ModelId=48A145880178
CChart::CChart()
{
m_bDrawReverseX = false; //绘图方向
m_bDrawReverseY = false; //绘图方向
m_bShowMenum = true;
m_bAllCurveSamebase = false;
m_bHideUnselectCurve = true;
m_bShowDataFlowMouse = false; //取数据时是否让数据跟随鼠标显示
m_crBackColor = RGB(0045);
m_crGridColor = RGB(120120120);
m_crframeColor = RGB(255255255);
m_brushBack.CreateSolidBrush(m_crBackColor) ;
m_brushGrid.CreateSolidBrush(m_crGridColor) ;
m_CurveMap.RemoveAll();
m_ptMaxPos.InitPoint(0.00.0);
m_ptMinPos.InitPoint(0.00.0);
m_ptZoomOffset.InitPoint(0.00.0);
m_ptMoveOffset.InitPoint(0.00.0);
m_rectClient.SetRectEmpty();
m_rectPlot.SetRectEmpty();
m_rectPlotframe.SetRectEmpty();
m_ptMargin.x = 10;
m_ptMargin.y = 10;
m_dVerticalFactor = 1.0;
m_dHorizontalFactor = 1.0;
m_iControlMode = CURVE_MOVE;
m_bLeftButtonDown = false;
m_iVerticalControlMode = false; //默认是水平控制模式(指管轮操作模式的移动即缩放功能)
m_recMouseSelect.SetRectEmpty();
m_pCurSelCurveObj = NULL;
}
//##ModelId=48A145880186
CChart::~CChart()
{
POSITION pos=m_CurveMap.GetStartPosition();
CString strKey;
Cobject* pOb;
while(pos)
{
m_CurveMap.GetNextAssoc(posstrKeypOb);
delete pOb;
pOb = NULL;
}
}
BEGIN_MESSAGE_MAP(CChart CWnd)
//{{AFX_MSG_MAP(CChart)
ON_WM_SIZE()
ON_WM_PAINT()
ON_WM_LBUTTONDOWN()
ON_WM_MOUSEMOVE()
ON_WM_LBUTTONUP()
ON_WM_MOUSEWHEEL()
ON_WM_RBUTTONDOWN()
ON_WM_CONTEXTMENU()
ON_WM_LBUTTONDBLCLK()
//}}AFX_MSG_MAP
ON_UPDATE_COMMAND_UI_RANGE(999010010OnUpdateMenuState)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChart message handlers
//##ModelId=48ACE0A6036B
BOOL CChart::Create(DWORD dwstyle const RECT &rect CWnd *pParentWnd UINT nID)
{
BOOL result ;
static CString className = AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW) ;
result = CWnd::CreateEx(WS_THICKframe
className NULL dwstyle
rect.left rect.toprect.right-rect.left rect.bottom-rect.top
pParentWnd->GetSafeHwnd() (HMENU)nID) ;
if (result != 0)
{
this->SetMargin();
InvalidateCtrl();
this->DrawGrid();
}
return result ;
}
//##ModelId=48A14589009E
BOOL CChart::InvalidateCtrl() //
{
CClientDC dc(this) ;
//创建绘制网格的内存绘图对象
m_dcGrid.DeleteDC();
m_dcGrid.CreateCompatibleDC(&dc) ;
m_bitmapBackground.Deleteobject();
m_bitmapBackground.CreateCompatibleBitmap(&dc m_nClientWidth m_nClientHeight) ;
m_pbitmapOldBack
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2008-09-18 12:22 TestMyChart
目录 0 2008-09-18 12:22 TestMyChart\res
......R 1078 2008-09-18 12:22 TestMyChart\res\TestMyChart.ico
......R 403 2008-09-18 12:22 TestMyChart\res\TestMyChart.rc2
....SHR 119 2008-10-23 13:09 TestMyChart\res\vssver2.scc
文件 159 2008-10-23 13:09 TestMyChart\mssccprj.scc
......R 3669 2008-09-18 12:22 TestMyChart\ReadMe.txt
文件 3158 2008-10-23 16:51 TestMyChart\fft.h
......R 213 2008-09-18 12:22 TestMyChart\StdAfx.cpp
......R 999 2008-09-18 12:22 TestMyChart\StdAfx.h
......R 4655 2008-10-23 11:51 TestMyChart\TestMyChart.dsp
......R 25581 2008-10-22 11:21 TestMyChart\CurveObj.cpp
文件 1459 2008-09-18 12:22 TestMyChart\TestMyChart.h
文件 9335 2008-10-23 16:29 TestMyChart\TestMyChart.rc
文件 56832 2008-10-23 20:11 TestMyChart\TestMyChart.opt
文件 3325 2008-10-23 20:11 TestMyChart\TestMyChart.clw
......R 2696 2008-09-18 12:22 TestMyChart\threadtrace.cpp
......R 1566 2008-09-18 12:22 TestMyChart\threadtrace.h
文件 2200 2008-10-22 21:39 TestMyChart\TestMyChart.cpp
....SHR 540 2008-10-23 19:50 TestMyChart\vssver2.scc
文件 648 2008-09-19 20:22 TestMyChart\TestMyChart.dsw
......R 8503 2008-09-27 10:39 TestMyChart\CurveObj.h
文件 3131 2008-10-23 13:29 TestMyChart\resource.h
文件 40424 2008-10-23 16:29 TestMyChart\TestMyChart.aps
......R 7829 2008-09-27 11:20 TestMyChart\Chart.h
......R 49257 2008-10-22 17:47 TestMyChart\Chart.cpp
文件 75 2008-09-27 09:02 TestMyChart\TestMyChart.bbs
文件 258 2008-10-23 20:08 TestMyChart\TestMyChart.plg
文件 2571 2008-10-23 16:24 TestMyChart\TestMyChartDlg.h
文件 13390 2008-10-23 19:50 TestMyChart\TestMyChartDlg.cpp
............此处省略4个文件信息
- 上一篇:功能强大的多条曲线绘制类 (MFC,VC++)
- 下一篇:客房管理系统含一万字论文
评论
共有 条评论