
// VerbpoDlg.h : 头文件
//
#pragma once
#include "windows.h" 
#pragma comment(lib, "WinMM.Lib")  
#include "mmsystem.h"
#include <Digitalv.h>
#include "ColorText_Static.h"
#include "./ButtonST/BtnST.h"
#include "./CStaticWave/ECGWave.h"
#include "./CStaticWave/RespWave.h"
#include "./CStaticWave/PlethWave.h"
#include "./CStaticWave/ResultTrend.h"
#include "./CStaticWave/ECGRespSpo2Trend.h"
#include "StaticValueECGNormal.h"
#include "StaticBPValueNormal.h"
#include "StaticValueTempNormal.h"
#include "StaticValueSPO2Normal.h"
#include "StaticValueRespNormal.h"
#include "StaticValueFANormal.h"
#include "DisplayField.h"

#include "Border.h"
#include "DialogECGSet.h"
#include "DialogRespSet.h"
#include "DialogTempSet.h"
#include "DialogOXYSet.h"
#include "DialogBPSet.h"
#include "DialogAirOxySet.h"
#include "DialogNumInput.h"
#include "DialogRec.h"
#include "DialogPatInfo.h"
#include "DialogSysSet.h"
#include "DialogTrendChart.h"
#include "DialogAlmSearch.h"
#include "DialogDataRec.h"
#include "DialogNIBPRec.h"
#include "DialogSysRec.h"
#include "DialogSysParaSet.h"
#include "DialogAlmSet.h"
#include "afxwin.h"
#include "DirectSound.h"	// Added by ClassView


#define IDC_MAIN					(IDC_USER+0xff)
#define IDC_MAIN_BUTTON_SHOW		(IDC_MAIN+1)
#define IDC_MAIN_BUTTON_LEFT		(IDC_MAIN+2)
#define IDC_MAIN_BUTTON_RIGHT		(IDC_MAIN+3)
#define IDC_MAIN_BUTTON_MUTE		(IDC_MAIN+4)
#define IDC_MAIN_BUTTON_PRINT		(IDC_MAIN+5)
#define IDC_MAIN_BUTTON_DATA_REC	(IDC_MAIN+6)
#define IDC_MAIN_BUTTON_BP			(IDC_MAIN+7)
#define IDC_MAIN_BUTTON_FREEZE		(IDC_MAIN+8)
#define IDC_MAIN_BUTTON_ALARM		(IDC_MAIN+9)
#define IDC_MAIN_BUTTON_ALARM_REC		(IDC_MAIN+10)
#define IDC_MAIN_BUTTON_TREND_CHART_REC		(IDC_MAIN+11)
#define IDC_MAIN_BUTTON_TREND_TABLE_REC		(IDC_MAIN+12)
#define IDC_MAIN_BUTTON_NIBP_REC		(IDC_MAIN+13)
#define IDC_MAIN_BUTTON_SYS_REC		(IDC_MAIN+14)
#define IDC_MAIN_BUTTON_PAT			(IDC_MAIN+15)
#define IDC_MAIN_BUTTON_MEDCAL		(IDC_MAIN+16)
#define IDC_MAIN_BUTTON_SYS			(IDC_MAIN+17)
#define IDC_MAIN_BUTTON_MENU		(IDC_MAIN+18)
#define IDC_MAIN_BUTTON_SHUT		(IDC_MAIN+19)




#define IDC_NORMAL				(IDC_MAIN+0xff)
#define IDC_NORMAL_COMBO_LEAD1	(IDC_NORMAL+1)
#define IDC_NORMAL_COMBO_LEAD2	(IDC_NORMAL+2)
#define IDC_NORMAL_COMBO_SPEED	(IDC_NORMAL+3)
#define IDC_NORMAL_COMBO_GAIN	(IDC_NORMAL+4)
#define IDC_NORMAL_LABEL		(IDC_NORMAL+5)
#define IDC_NORMAL_COMBO_FILTER	(IDC_NORMAL+6)
#define IDC_NORMAL_COMBO_RESP_SPEED	(IDC_NORMAL+7)
#define IDC_NORMAL_COMBO_RESP_GAIN	(IDC_NORMAL+8)
#define IDC_NORMAL_COMBO_PLETH_SPEED	(IDC_NORMAL+9)


#define STATUS_HEIGHT		60


class CVerbpoDlgAutoProxy;


// CVerbpoDlg 对话框
class CVerbpoDlg : public CDialogEx
{
	DECLARE_DYNAMIC(CVerbpoDlg);
	friend class CVerbpoDlgAutoProxy;

// 构造
public:
	CVerbpoDlg(CWnd* pParent = NULL);	// 标准构造函数
	virtual ~CVerbpoDlg();

// 对话框数据
	enum { IDD = IDD_VERBPO_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV 支持
	
	virtual BOOL DestroyWindow();
	afx_msg void OnBnClickedButtonShow();
	afx_msg void OnBnClickedButtonLeft();
	afx_msg void OnBnClickedButtonRight();
	afx_msg void OnBnClickedButtonMute();
	afx_msg void OnBnClickedButtonPrint();
	afx_msg void OnBnClickedButtonDataRec();
	afx_msg void OnBnClickedButtonBP();
	afx_msg void OnBnClickedButtonFreeze();
	afx_msg void OnBnClickedButtonAlarmSet();
	afx_msg void OnBnClickedButtonAlarmRec();
	afx_msg void OnBnClickedButtonTrendChartRec();
	afx_msg void OnBnClickedButtonTrendTableRec();
	afx_msg void OnBnClickedButtonNIBPRec();
	afx_msg void OnBnClickedButtonSysRec();
	afx_msg void OnBnClickedButtonPat();
	afx_msg void OnBnClickedButtonMedCal();
	afx_msg void OnBnClickedButtonSys();
	afx_msg void OnBnClickedButtonMenu();
	afx_msg void OnBnClickedButtonShut();
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	afx_msg void OnTimer(UINT_PTR nIDEvent);
	afx_msg void OnCbnSelchangeComboComSpo2();
	afx_msg void OnCbnSelchangeComboComPr();
	afx_msg void OnBnClickedButtonComSpo2AlmFigner();
	afx_msg void OnBnClickedButtonComSpo2Probe();
	afx_msg void OnCbnSelchangeComboComTemp();
	afx_msg void OnBnClickedButtonComTempAlm();
	afx_msg void OnCbnSelchangeComboComHr();
	afx_msg void OnCbnSelchangeComboComSt();
	afx_msg void OnCbnSelchangeComboComRr();
	afx_msg void OnBnClickedButtonComApnea();
	afx_msg void OnCbnSelchangeComboComSbp();
	afx_msg void OnCbnSelchangeComboComDbp();
	afx_msg void OnBnClickedButtonComNibp();
	afx_msg void OnCbnSelchangeComboComOxy();
	afx_msg void OnBnClickedButtonComOxyAlm();
	
// 实现
protected:
	CVerbpoDlgAutoProxy* m_pAutoProxy;
	HICON m_hIcon;

	BOOL CanExit();

	// 生成的消息映射函数
	virtual BOOL OnInitDialog();
	LRESULT OnStaticValueECGNormalDBLCLK(WPARAM wPara, LPARAM lPara);
	LRESULT OnStaticValueBPNormalDBLCLK(WPARAM wPara, LPARAM lPara);
	LRESULT OnStaticValueTEMPNormalDBLCLK(WPARAM wPara, LPARAM lPara);
	LRESULT OnStaticValueOXYNormalDBLCLK(WPARAM wPara, LPARAM lPara);
	LRESULT OnStaticValueRESPNormalDBLCLK(WPARAM wPara, LPARAM lPara);
	LRESULT OnStaticValueFANormalDBLCLK(WPARAM wPara, LPARAM lPara);
	afx_msg void OnCbnSelchangeComboLead1();
	afx_msg void OnCbnSelchangeComboLead2();
	afx_msg void OnCbnSelchangeComboECGFilter();
	afx_msg void OnCbnSelchangeComboECGSpeed();
	afx_msg void OnCbnSelchangeComboECGGain();
	afx_msg void OnCbnSelchangeComboPlethSpeed();
	afx_msg void OnCbnSelchangeComboRespSpeed();
	afx_msg void OnCbnSelchangeComboRespGain();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnClose();
	virtual void OnOK();
	virtual void OnCancel();
	DECLARE_MESSAGE_MAP()

private:

	CFont   m_CFont;
	
	CButtonST *MainButtonShow;//0
	CButtonST *MainButtonLeft;
	CButtonST *MainButtonRight;
	CButtonST *MainButtonMute;//1
	CButtonST *MainButtonPrint;//2
	CButtonST *MainButtonDataRec;//3
	CButtonST *MainButtonBP;//4
	CButtonST *MainButtonFreeze;//5
	CButtonST *MainButtonAlarmSet;//6
	CButtonST *MainButtonAlarmRec;//6
	CButtonST *MainButtonTrendChartRec;//7
	CButtonST *MainButtonTrendTableRec;//8
	CButtonST *MainButtonTrendNIBPRec;//9
	CButtonST *MainButtonSysRec;//9
	CButtonST *MainButtonPat;//10
	CButtonST *MainButtonMedCal;//11
	CButtonST *MainButtonSys;//11
	CButtonST *MainButtonMenu;//12
	CButtonST *MainButtonShut;//13
	
	
	
	
	CComboBox *NormalComboECGFilter;
	CComboBox *NormalComboECGSpeed;
	CComboBox *NormalComboECGGain;
	CComboBox *NormalComboRespSpeed;
	CComboBox *NormalComboRespGain;
	CComboBox *NormalComboPlethSpeed;

	CColorText_Static *NormalLabelECG1;
	CColorText_Static *NormalLabelECG2;
	CColorText_Static *NormalLabelResp;
	CColorText_Static *NormalLabelPleth;

	CDialogECGSet m_CDialogECGSet;
	CDialogRespSet m_CDialogRespSet;
	CDialogTempSet m_CDialogTempSet;
	CDialogOXYSet m_CDialogOXYSet;
	CDialogBPSet m_CDialogBPSet;
	CDialogAirOxySet m_CDialogAirOxySet;
	CDialogRec m_CDialogRec;
	CDialogPatInfo m_CDialogPatInfo;
	CDialogSysSet m_CDialogSysSet;
	CDialogAlmSearch m_CDialogAlmSearch;
	CDialogDataRec m_CDialogDataRec;
	CDialogNIBPRec m_CDialogNIBPRec;
	CDialogSysRec m_CDialogSysRec;
	CDialogTrendChart m_CDialogTrendChart;
	CDialogSysParaSet m_CDialogSysParaSet;
	CDialogAlmSet m_CDialogAlmSet;
	int m_i321MinTimerStart, m_i3230SecTimerStart, m_i32Timer, m_i321SecTimerStart2;
	INT m_i32AlmMute, m_i32AlmTime;
	MCIDEVICEID m_MCIDeviceID;
	DWORD m_dwStart;
	INT m_i32Freeze;
	INT m_i32AlmVolTypeLast, m_i32AlmVolTimeLast;
	//初始化 输入模拟数据 控件
	void InitComWidget();
	void InitButton();
	void InitNormalShow();
	void InitTrendResult();
	//按照心电设置的参数，初始化控件，并且向下位机发送相关命令
	void Init_ECG_Para_Set();
	//按照呼吸设置的参数，初始化控件，并且向下位机发送相关命令
	void Init_Resp_Para_Set();
	//按照血氧设置的参数，初始化控件，并且向下位机发送相关命令
	void Init_Oxy_Para_Set();
	//按照体温设置的参数，初始化控件，并且向下位机发送相关命令
	void Init_Temp_Para_Set();
	//按照血压设置的参数，初始化控件，并且向下位机发送相关命令
	void Init_NIBP_Para_Set();
	//按照氧浓度设置的参数，初始化控件，并且向下位机发送相关命令
	void Init_AirOxy_Para_Set();
public:
	CDirectSound m_sndSound1;
	CDirectSound m_sndSoundAlmH;
	CDirectSound m_sndSoundAlmM;
	CDirectSound m_sndSoundAlmL;
	static INT m_i32Normal_ECG_X, m_i32Normal_ECG_Y;

	INT m_i32Style;
	INT m_i32X, m_i32Y, m_i32Width, m_i32Height;

	CComboBox *NormalComboECG1Lead;
	CComboBox *NormalComboECG2Lead;

	//心电结果显示区
	CStaticValueECGNormal *m_ECGValueNormal;
	//血压结果显示区
	CStaticBPValueNormal *m_BPValueNormal;
	//体温结果显示区
	CStaticValueTempNormal *m_TempValueNormal;
	//血氧结果显示区
	CStaticValueSPO2Normal *m_SPO2ValueNormal;
	//呼吸结果显示区
	CStaticValueRespNormal *m_RespValueNormal;
	//氧浓度结果显示区
	CStaticValueFANormal *m_FAValueNormal;
	//心律、血氧饱和度呼吸趋势共存显示区
	CECGRespSpo2Trend *m_pCECGRespSpo2Trend;
	//状态报警显示区
	CDisplayField *m_DisplayField;

	CTrendResult *m_ECGTrendResult;
	CTrendResult *m_NIBPTrendResult;
	CTrendResult *m_TempTrendResult;
	CTrendResult *m_Spo2TrendResult;
	CTrendResult *m_RespTrendResult;
	CTrendResult *m_AirOxyTrendResult;

	struct ECG_DATA m_stECGData;
	struct RESP_DATA m_stRespData;
	struct OXY_DATA m_stOXYData;
	CDialogNumInput m_CDialogNumInput;
	CECGWave *m_pCECGWaveN[7];
	CRespWave *m_pCRespWave;
	CPlethWave *m_pCPlethWave;
	
	CComboBox m_ComboComHR;
	CComboBox m_ComboComST;
	CComboBox m_ComboComRR;
	CComboBox m_ComboComSpo2;
	CComboBox m_ComboComPR;
	CComboBox m_ComboComTemp;
	CButton m_CButtonComAPNEA;
	CButton m_CButtonComFinger;
	CButton m_CButtonComProbe;
	CButton m_CButtonComTempProbe;
	CComboBox m_ComboComSBP;
	CComboBox m_ComboComDBP;
	CButton m_ButtonComNIBP;
	CComboBox m_ComboComOXY;
	CButton m_ButtonComOXYAlm;
	
	CComboBox m_CComboComLead;
	CComboBox m_CComboComARRA;
	CComboBox m_CComboFinger;
	CComboBox m_CComboProbe;
	CComboBox m_CComboAirOxyProbe;
	CComboBox m_CComboTempProbe;
	CComboBox m_CComboAPNEA;
	afx_msg void OnCbnSelchangeComboComLead();
	afx_msg void OnCbnSelchangeComboComArra();
	
	afx_msg void OnCbnSelchangeComboComFinger();
	afx_msg void OnCbnSelchangeComboComProbe();
	afx_msg void OnCbnSelchangeComboComTempProbe();
	afx_msg void OnCbnSelchangeComboComAiroxyProbe();
	
	afx_msg void OnCbnSelchangeComboComApnea();
};
