#pragma once
#include <list>
using namespace std;


struct RESULT
{
	INT16 i16SBP;
	INT16 i16DBP;
	INT16 i16MBP;
	INT16 i16PR;
	INT16 i16Flag;
	TCHAR cTime[20];
};

// CStaticBPValueNormal

class CStaticBPValueNormal : public CStatic
{
	DECLARE_DYNAMIC(CStaticBPValueNormal)

public:
	CStaticBPValueNormal();
	virtual ~CStaticBPValueNormal();

protected:
	afx_msg void OnPaint();
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	DECLARE_MESSAGE_MAP()

private:
	//大字体界面，保存的血压测量结果
	list<struct RESULT> m_stNIBPResult;
	// 设置血压结果
	INT16 m_i16SBP, m_i16DBP;
	// 设置血压高阈值
	INT16 m_i16SBPAlmH, m_i16DBPAlmH;
	// 设置血压低阈值
	INT16 m_i16SBPAlmL, m_i16DBPAlmL;
	// 设置血压时间
	INT16 m_i16Hour, m_i16Min,m_i16Sec;
	// 设置袖带压
	INT16 m_i16Press;
	

	INT  m_i32Width, m_i32Height;
	INT m_i32Style;
	CRect m_rectCtrl;			// 控件区域
	CRect m_rectValue;			// 显示数值区域
	CDC dcMem; //用于缓冲作图的内存DC 
	CBitmap bmp; //内存中承载临时图象的位图
	CBitmap bitmapAlm;
	CDC dcMemAlm;
	CFont fontResultBig;
	CFont fontResult;
	CFont fontBig;
	CFont font;
	CFont font1;
	CFont fontList;
	int m_i32ReDraw;
	int m_i32Unit;
	int m_i32BlinkNum;
	int m_i32Blink;
	INT m_i32AlmFlag;

public:
	static INT m_i32NormalWidth, m_i32NormalHeight;
	static INT m_i32BigWidth, m_i32BigHeight;

	static INT m_i32NormalX, m_i32NormalY;
	static INT m_i32BigX, m_i32BigY;

	static COLORREF m_rgbBlink;
	static COLORREF m_rgbText;

	void Add_Result(INT16 i16SBP,INT16 i16DBP,INT16 i16MBP,INT16 i16PR,INT16 i16Flag);
	void Show_ResultList();
	void Set_Style(INT style);
	// 设置时间
	int set_time(int h, int m, int s, UINT8 redraw);
	// 设置血压结果
	int set_result(int SBP, int DSP, UINT8 redraw);
	// 设置报警上限
	int set_alm_H(int SBP, int DBP, UINT8 redraw);
	// 设置报警下限
	int set_alm_L(int SBP, int DBP, UINT8 redraw);
	// 设置静压
	int set_press(int p, UINT8 redraw);
	// 重画
	void Redraw();
	// 闪烁
	void Blink();
	void Set_Blink(int Blink);
	//设置、绘制报警开关标识
	void Set_AlmFlag(INT a, UINT8 redraw);
};


