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

📄 recordgraph.h

📁 一款不错的关于绘制波形编程的软件源代码
💻 H
字号:
#if !defined(AFX_RECORDGRAPH_H__04D79208_4709_4075_B603_7A45C7393B3A__INCLUDED_)
#define AFX_RECORDGRAPH_H__04D79208_4709_4075_B603_7A45C7393B3A__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// RecordGraph.h : header file
//

#define RECORDGRAPHCLASS		_T("RecordGraphClass")

#define AXISSTYLE_SHOWLEFT		0x00000001
#define AXISSTYLE_SHOWBOTTOM	0x00000002
#define AXISSTYLE_SHOWRIGHT		0x00000004
#define AXISSTYLE_SHOWTOP		0x00000008

#define AXIS_LEFT				0x00000001
#define AXIS_TOP				0x00000002
#define AXIS_RIGHT				0x00000003
#define AXIS_BOTTOM				0x00000004

#define TIMEUNIT_DAY			0x00000001
#define TIMEUNIT_MONTH			0x00000002
#define TIMEUNIT_HOUR			0x00000003
#define TIMEUNIT_MINUTE			0x00000004

#include "RecordFile.h"
/////////////////////////////////////////////////////////////////////////////
// CRecordGraph window

class CRecordGraph : public CWnd
{
// Construction
public:
	CRecordGraph();

// Attributes
public:
	enum
	{
		dayUnit = 1,
		monthUnit,
		hourUnit,
		minuteUnit,
		secondUnit,
	};

// Operations
public:
	void SetMargin(int left, int top, int right, int bottom);
	void SetGridSize(int width, int height);

	void SetBkColor(COLORREF color);
	void SetGridColor(COLORREF color);
	void SetAxisColor(COLORREF color);
	void SetAxisStyle(UINT style);

	void SetAxisUnitType(UINT axis, UINT type);

	void SetTimeAxisMinScale(const COleDateTime& dateTime);
	void SetTimeAxisUnitType(UINT type);

	void SetRecordFile(CRecordFile recordfile); // zxb add

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CRecordGraph)
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CRecordGraph();

private:
	COLORREF m_bkColor;
	COLORREF m_scaleColor;

	int m_leftMargin;
	int m_rightMargin;
	int m_topMargin;
	int m_bottomMargin;

	int m_gridWidth;
	int m_gridHeight;
	int m_xGridCount;
	int m_yGridCount;

	UINT m_timeAxisUnitType;
	COleDateTime m_timeAxisMinScale;
	
	CFont m_scaleFont;
	CRect m_rcClient;

	
	BOOL RegisterWndClass();
	void DrawGraph(CDC* pDC);
	void DrawGrids(CDC* pDC, CPen& axisPen, CPen& gridsPen);
	
	void DrawTimeAxisScales(CDC* pDC);
	void AdjustGridMargin();
	void DrawStreamGraph(CDC *pDC, CPen &vavePen,LPCTSTR strFilePath);//zxb add

public:
	LPCTSTR  m_FilePath;
	int		 m_nDrawPageNum;
	int		 m_nCurDrawNum;
	UINT     nCheck;
	BOOL  bDrawBaseLineOne;  //是否画基准线
	BOOL  bDrawBaseLineTwo;
	int   XbaseLineOne,XbaseLineTwo;//两条基准线的X坐标值

	UINT nStartPageIndex;   //画图页对应的数据页
	UINT nStartRecordIndex;

	void OnAverage(int &nAverage);
	void OnGraphMessage(WPARAM wParam,LPARAM lParam);

protected:
	//{{AFX_MSG(CRecordGraph)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnPaint();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnLButtonDblClk(UINT   nFlags,   CPoint   point); 
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_RECORDGRAPH_H__04D79208_4709_4075_B603_7A45C7393B3A__INCLUDED_)


⌨️ 快捷键说明

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