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

📄 histogramctrl.h

📁 1.使用串口同两块west4170(PID控制温度仪表). 2.可以显示当前温度,并可设定参数(主要是设定温度)
💻 H
字号:
#if !defined(AFX_HISTOGRAMCTRL_H__A1446DDE_3456_47A9_BA8E_D4F048F3325A__INCLUDED_)
#define AFX_HISTOGRAMCTRL_H__A1446DDE_3456_47A9_BA8E_D4F048F3325A__INCLUDED_

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

#include "AfxTempl.h"
/////////////////////////////////////////////////////////////////////////////
// CHistogramCtrl window

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

// Attributes
public:
	typedef enum {LOW_SPEED = 3000, NORMAL_SPEED = 1000, HIGH_SPEED = 500, IDLE = 0} SPEED;

// Operations
public:
	BOOL Create(DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT uID);
	void SetRange(UINT uLower, UINT uUpper);

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

// Implementation
public:
	int SetMeterIndex(int Index);
	BOOL SetGridsColor(COLORREF cr);			//设格子色
	BOOL SetBkColor(COLORREF cr);				//背景色
	void SetPen(int nWidth, COLORREF crColor);		//设笔宽和色
	CHistogramCtrl::SPEED SetSpeed(CHistogramCtrl::SPEED uSpeed);	//设速度
	void SetPos(UINT uPos);					//设定一个位置
	virtual ~CHistogramCtrl();
	virtual BOOL InvalidateCtrl();				//初始化
	// Generated message map functions
protected:
	//{{AFX_MSG(CHistogramCtrl)
	afx_msg void OnPaint();
	afx_msg void OnTimer(UINT nIDEvent);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
protected:
	enum SPEED m_uSpeed;			//速度
	UINT m_yPos;				//位置
	UINT m_yPreviousPos;			//前一个位置
	UINT m_uOffset;				//偏置

	void DrawLine();			//画线
	
	
	UINT GetAverage();			//取平均值

	CDC *m_pMemDC;

	UINT m_uLower;
	UINT m_uUpper;

	CRect m_rcClient;
	CPen m_colorPen;

	int m_nFirstLinePos;
	CComboBox m_ListMeterIndex;		//表号
	int m_nMeterIndex;			//表号

	COLORREF m_crBackGround;
	COLORREF m_crGrids;

	CList<UINT, UINT&> *m_pList;
};

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

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

#endif // !defined(AFX_HISTOGRAMCTRL_H__A1446DDE_3456_47A9_BA8E_D4F048F3325A__INCLUDED_)

⌨️ 快捷键说明

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