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

📄 line.h

📁 EVC 编的示波器程序
💻 H
字号:
// Line.h: interface for the CLine class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_LINE_H__C6ACEDC4_2BE5_11D6_836B_5254AB372662__INCLUDED_)
#define AFX_LINE_H__C6ACEDC4_2BE5_11D6_836B_5254AB372662__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "BaseGr.h"
#include "LineData.h"

#define	LEGENDWIDTH 30
//#define TIMEINTERVAL_PIXS	20
#define YAXISDASHNUM 10					//Y轴刻线数
#define WINDOWYLENGTHORIGIN 20			//Y轴起始窗口长度 数值-10~+10

#define WINDOWTIMELENGTHORIGIN 20		//起始窗口时间 20ms
#define TIMEDASHNUM	20					//时间轴刻线数
#define SAMPLEPERIOD 10					//采样周期 1ms

#define LEFTLEFTWIDTH 40				//示波窗口到整个作图区上下左右的宽度 pixs	
#define RIGHTLEFTWIDTH 34		
#define TOPLEFTWIDTH 10
#define BOTTOMLEFTWIDTH 10


class CLine : public CBaseGr  
{
public:
	CLine();
	virtual ~CLine();

	BOOL	m_bChanelOpen[3];
	BOOL	m_bCoordinataFlag;
	double  m_dYOffset[3];

protected:
	CList<CLineData*,CLineData*&> LineDataList;
	BOOL WithDash;					//网格线标志位
	BOOL WithDot;					//数据点是否画出标志位
	int xCoorDeta;					//x轴像素尺度 
	int xDeta;						//x轴数值尺度 
	int yCoorDeta;					//y轴像素尺度
	int yDeta;						//y轴数值尺度
	double xcoorfator;				//x轴转换尺度	
	double ycoorfator;				//y轴转换尺度
	int nWidth;						//图例宽度
	double timePerUnit;				//时间刻度
	double IndextoPixsCoef;			//索引像素转换系数
	
	int yzeroPixPos;				//零点位置
	int xPixsPerUnit;
	int yPixsPerUnit;
	double YValuePerUnit[3];			//Y轴刻度
	double YValuetoPixsCoef[3];		//值像素转换系数

	int DotSize;

	CBaseGr::Align TitleMode;
	CBaseGr::Align LegendMode;

	CDC     m_dcCoordinate;
	CDC     m_dcContent;
	CDC		m_dcLegend;
	CDC		m_dcTmp;

	CBitmap *m_pbitmapOldCoordinate;
	CBitmap *m_pbitmapOldContent;
	CBitmap *m_pbitmapOldLegend;
	CBitmap *m_pbitmapOldTmp;

	CBitmap m_bitmapCoordinate;
	CBitmap m_bitmapContent;
	CBitmap m_bitmapLegend;
	CBitmap m_bitmapTmp;

	CDC		m_memDC ;
	CBitmap *m_pmemOldBitmap ; 
	CBitmap m_memBitmap ;	

public:
	void SetWithDash(BOOL bWithDash=TRUE) { WithDash=bWithDash; }
	void SetWithDot(BOOL bWithDot=TRUE) { WithDot = bWithDot;}
	void SetDotSize(int nDs=3) { DotSize = nDs;}
	void SetTitleMode(CBaseGr::Align eTitleMode) { TitleMode = eTitleMode;}
	void SetLegendMode(CBaseGr::Align eLegendMode) { LegendMode = eLegendMode;}
	void AddLineData(CLineData*& pLineData);	

	double SetYValueRef(int iIndex=0,int m_nsetYValue=2);
	double SetTimeRef(int m_nsettime);

	virtual void DrawCurveLine(CDC* pDC,int LeftTopx,int LeftTopy,int RightBottomx,int RightBottomy);
	virtual void DrawLegend(CDC* pDC,int Startx,int Starty,int Width=30,Align Mode=TOP,COLORREF FontColor=RGB(0,0,0));
protected:

	virtual void DrawContent(CDC* pDC,int LeftTopx,int LeftTopy,int RightBottomx,int RightBottomy);
	virtual void DrawCoordinate(CDC* pDC,int LeftTopx,int LeftTopy,int RightBottomx,int RightBottomy,BOOL WithDash=FALSE);
};

#endif // !defined(AFX_LINE_H__C6ACEDC4_2BE5_11D6_836B_5254AB372662__INCLUDED_)

⌨️ 快捷键说明

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