#pragma once
#include <afxmt.h>
#include "../Data.h"

// CDataRecWave

class CAlmRecWave : public CStatic
{
	DECLARE_DYNAMIC(CAlmRecWave)

public:
	
	//在屏幕上单位长度的像素点个数
	static INT  m_i32ECGPixel;
	//波形的单位长度的数字量
	static INT  m_i32ECGValue;
	//在屏幕上单位长度的像素点个数
	static INT  m_i32RespPixel;
	//波形的单位长度的数字量
	static INT  m_i32RespValue;
	//在屏幕上单位长度的像素点个数
	static INT  m_i32PlethPixel;
	//波形的单位长度的数字量
	static INT  m_i32PlethValue;
	static INT m_i32Height;
	static INT  m_i32Width;
	CAlmRecWave();
	virtual ~CAlmRecWave();
	//绘制心电波形
	void Draw_Wave();
	void Erase();
	void copy_data(struct SAVE_ALM *st);
	void show_change();
	void show_pre();
	void show_next();
	void Move_Draw_Section(INT dir);
	afx_msg void OnDestroy();
protected:
	afx_msg void OnPaint();
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	DECLARE_MESSAGE_MAP()

private:
	CRect m_rectCtrl;			// 控件区域
	CRect m_rectValue;			// 显示数值区域
	CDC dcMem; //用于缓冲作图的内存DC 
	CBitmap bmp;
	INT m_i32Show;
	INT m_i32Index;

	struct SAVE_ALM m_stSAVE_ALM;
	CCriticalSection m_CSWaveData;
	
	CPen *penECGLine;
	CPen *penRespLine;
	CPen *penPlethLine;

	CPen *penErase;
	CFont font;
	CFont fontBig;
	CPoint *m_pCPonit;
	void Draw_X_Time();
	void Draw_ECG_Wave(INT x, INT y, INT type);
	void Draw_Resp_Wave(INT x, INT y);
	void Draw_Pleth_Wave(INT x, INT y);
};


