#pragma once


// CECGSTWave

enum _TREND_DATA_TYPE_
{
	DATA_TYPE_HR=1, 
	DATA_TYPE_RR,
	DATA_TYPE_SPO2,
	DATA_TYPE_PR,
	DATA_TYPE_TEMP,
	DATA_TYPE_PVCs,
	DATA_TYPE_ST,
	DATA_TYPE_OXY,
};

enum _TREND_CHART_RATIO_
{
	TREND_CHART_RATIO_1S = 1,
	TREND_CHART_RATIO_5S,
	TREND_CHART_RATIO_10S,
	TREND_CHART_RATIO_1MIN,
};

class CTrendChart : public CStatic
{
	DECLARE_DYNAMIC(CTrendChart)

public:
	CTrendChart();
	virtual ~CTrendChart();


	void Set_UnitLength_Value(int px);
	void draw_wave();
	void Set_Type(INT type);
	void Set_Ratio(INT ratio);
	void Set_Step(INT step);
	void Up_Adj_Range();
	void Down_Adj_Range();
	void Draw_HR_Chart();
	void Draw_RR_Chart();
	void Draw_SPO2_Chart();
	void Draw_PR_Chart();
	void Draw_TEMP_Chart();
	void Draw_PVCs_Chart();
	void Draw_ST_Chart();
	void Draw_OXY_Chart();
	afx_msg void OnPaint();
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnDestroy();
	DECLARE_MESSAGE_MAP()

private:
	CRect m_rectCtrl;			// 控件区域

	CDC dcMem; //用于缓冲作图的内存DC 
	CBitmap bmp; //内存中承载临时图象的位图

	CDC dcMemBK; //用于缓冲作图的内存DC 背景 
	CBitmap bmpBK; //内存中承载临时图象的位图 背景 

	CFont font;

	INT m_i32DestroyFlag;
	//趋势图数据的类型
	INT m_i32Type;
	INT m_i32AdjRange;
	INT m_i32Ratio;
	INT m_i32Step;
	

	COLORREF m_color;
	
	//波形的单位长度的数字量
	int UnitLength_Value;

	//波形互斥信号
	//	QMutex QMutexWaveDate;
	//波形的保存的缓存区
	INT16 *m_i16WaveDate;
	int  m_i16WaveDateLength;
	CCriticalSection m_CSWaveData;

	CPoint *m_pCPonit;
	CPen *penLine;
	CPen *penBKLine;
public:
	static INT m_i32PointNum;
	static INT  m_i32Height;
	static INT  m_i32Width;
};


