
// Verbpo.h : PROJECT_NAME 应用程序的主头文件
//




#define ECG_I_LEAD		0x00
#define ECG_II_LEAD		0x01
#define ECG_III_LEAD	0x02
#define ECG_AVF_LEAD	0x03
#define ECG_AVL_LEAD	0x04
#define ECG_AVR_LEAD	0x05
#define ECG_V1_LEAD		0x06

#pragma once

#ifndef __AFXWIN_H__
	#error "在包含此文件之前包含“stdafx.h”以生成 PCH 文件"
#endif

#include "resource.h"		// 主符号
#include "Data.h"


#define WM_STATIC_VALUE_ECG_NORMAL_DBLCLK      (WM_USER+1000)
#define WM_STATIC_VALUE_BP_NORMAL_DBLCLK      (WM_STATIC_VALUE_ECG_NORMAL_DBLCLK+1)
#define WM_STATIC_VALUE_TEMP_NORMAL_DBLCLK      (WM_STATIC_VALUE_BP_NORMAL_DBLCLK+1)
#define WM_STATIC_VALUE_OXY_NORMAL_DBLCLK      (WM_STATIC_VALUE_TEMP_NORMAL_DBLCLK+1)
#define WM_STATIC_VALUE_RESP_NORMAL_DBLCLK      (WM_STATIC_VALUE_OXY_NORMAL_DBLCLK+1)
#define WM_STATIC_VALUE_FA_NORMAL_DBLCLK      (WM_STATIC_VALUE_RESP_NORMAL_DBLCLK+1)
#define WM_MONITOR_STATUS						(WM_STATIC_VALUE_FA_NORMAL_DBLCLK+1)
#define WM_REC_GET_OK							(WM_MONITOR_STATUS+1)
// CVerbpoApp: 
// 有关此类的实现，请参阅 Verbpo.cpp
//

class CVerbpoApp : public CWinApp
{
public:
	CVerbpoApp();
#ifdef _DEBUG
protected:
	CMemoryState m_msOld, m_msNew, m_msDiff;
#endif  // _DEBUG
// 重写
public:
	int m_i32Show;
	
	int m_i32UartChannel;
	CData* m_Data;
	CWinThread* m_pThrdUart;
	CWinThread* m_pThrdDataSave;
	CWinThread* m_pThrdDraw;
	//报警栓锁，1为报警栓锁
	INT	m_i32AlmLock;
	virtual BOOL InitInstance();
	virtual int ExitInstance();
	int Get_Battery();
	int Get_Battery(INT * ACFlag, INT *BatteryFlag, INT *BatteryLifePercent);
	//是否插入电源适配器 若未知则为255
	int m_i32ACFlag;
	//电池电量 若未知则为255
	int m_i32BatteryLifePercent;
	//1 高，电量大于66 %
	//	2低，小于33 %
	//	4 极低，小于5 %
	//	8	充电中
	//	128	没有电池
	//	255	未知，无法读取状态
	int m_i32BatteryFlag;
	CCriticalSection m_CSBattery;

	int m_i32HR;
	int m_i32ST1, m_i32ST2;
	UINT8 m_u8LeadOff;
	UINT8 m_u8ARRA;

	INT16 m_i16RR;
	//窒息报警
	UINT8 m_u8APNEA;

	int m_i32SPO2;
	int m_i32PR;
	//血氧报警
	UINT8 m_u8SPO2Alm;

	INT16 m_i16Temp;
	UINT8 m_u8TempAlm;

	int m_i32SBP;
	int m_i32DBP;
	int m_i32NIBP;

	INT8 m_i8AirOxy;
	UINT8 m_i8AirOxyAlm;
	CCriticalSection m_CSCom;

	CString m_csSaveDataFileName;
	CString m_csSaveNIBPFileName;
	CString m_csSaveAlmPFileName;
	CString m_csSaveSysPFileName;

	CString m_csCompile;

	static CString m_csVersion;
// 实现

	DECLARE_MESSAGE_MAP()
};

extern CVerbpoApp theApp;