// DialogTrendChart.cpp : 实现文件
//

#include "stdafx.h"
#include "Verbpo.h"
#include "DialogTrendChart.h"
#include "afxdialogex.h"


// CDialogTrendChart 对话框

IMPLEMENT_DYNAMIC(CDialogTrendChart, CDialogEx)

CDialogTrendChart::CDialogTrendChart(CWnd* pParent /*=NULL*/)
	: CDialogEx(CDialogTrendChart::IDD, pParent)
{
	
}

CDialogTrendChart::~CDialogTrendChart()
{
}

void CDialogTrendChart::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_COMBO_TREND_CHART_PARA, m_ComboPara);
}


BEGIN_MESSAGE_MAP(CDialogTrendChart, CDialogEx)
	//ON_MESSAGE(WM_MONITOR_STATUS, OnMonitorStatus)
	ON_WM_DESTROY()
	ON_BN_CLICKED(IDOK, &CDialogTrendChart::OnBnClickedOk)
	ON_BN_CLICKED(IDC_BUTTON_TREND_CHART_DOWN_RANGE, &CDialogTrendChart::OnBnClickedButtonTrendChartDownRange)
	ON_BN_CLICKED(IDC_BUTTON_TREND_CHART_UP_RANGE, &CDialogTrendChart::OnBnClickedButtonTrendChartUpRange)
	ON_CBN_SELCHANGE(IDC_COMBO_TREND_CHART_PARA, &CDialogTrendChart::OnCbnSelchangeComboTrendChartPara)
	ON_BN_CLICKED(IDC_BUTTON_TREND_CHART_PRE, &CDialogTrendChart::OnBnClickedButtonTrendChartPre)
	ON_BN_CLICKED(IDC_BUTTON_TREND_CHART_NEXT, &CDialogTrendChart::OnBnClickedButtonTrendChartNext)
END_MESSAGE_MAP()


BOOL CDialogTrendChart::OnInitDialog()
{
	CString a_cs;
	CDialogEx::OnInitDialog();
	

	m_ComboPara.AddString(CString(_T("心律")));
	m_ComboPara.AddString(CString(_T("呼吸率")));
	m_ComboPara.AddString(CString(_T("血氧饱和度")));
	m_ComboPara.AddString(CString(_T("脉率")));
	m_ComboPara.AddString(CString(_T("体温")));
	m_ComboPara.AddString(CString(_T("PCVs")));
	m_ComboPara.AddString(CString(_T("ST")));
	m_ComboPara.AddString(CString(_T("氧浓度")));
	m_ComboPara.SetCurSel(0);


	m_pCTrendChart = new CTrendChart;
	// TODO:  在此添加额外的初始化
	m_pCTrendChart->Set_UnitLength_Value(820);
	m_pCTrendChart->Set_Type(DATA_TYPE_HR);
	m_pCTrendChart->Create(NULL, WS_CHILD | WS_VISIBLE | SS_NOTIFY, CRect(0, 0, CTrendChart::m_i32Width, CTrendChart::m_i32Height), this, 123);
	m_pCTrendChart->ShowWindow(SW_SHOW);
	m_pCTrendChart->draw_wave();
	m_pCTrendChart->Invalidate(TRUE);

	return TRUE;  // return TRUE unless you set the focus to a control
	// 异常:  OCX 属性页应返回 FALSE
}



void CDialogTrendChart::OnDestroy()
{
	CDialogEx::OnDestroy();

	// TODO:  在此处添加消息处理程序代码
	m_pCTrendChart->DestroyWindow();
	delete m_pCTrendChart;
}

// CDialogTrendChart 消息处理程序


void CDialogTrendChart::OnBnClickedOk()
{
	// TODO:  在此添加控件通知处理程序代码
	CDialogEx::OnOK();
}


void CDialogTrendChart::OnBnClickedButtonTrendChartDownRange()
{
	// TODO:  在此添加控件通知处理程序代码
	m_pCTrendChart->Down_Adj_Range();
	m_pCTrendChart->draw_wave();
	m_pCTrendChart->Invalidate();
}


void CDialogTrendChart::OnBnClickedButtonTrendChartUpRange()
{
	// TODO:  在此添加控件通知处理程序代码
	m_pCTrendChart->Up_Adj_Range();
	m_pCTrendChart->draw_wave();
	m_pCTrendChart->Invalidate();
}


void CDialogTrendChart::OnCbnSelchangeComboTrendChartPara()
{
	// TODO:  在此添加控件通知处理程序代码
	m_pCTrendChart->Set_Type(m_ComboPara.GetCurSel() + 1);
	m_pCTrendChart->draw_wave();
	m_pCTrendChart->Invalidate();
}


void CDialogTrendChart::OnBnClickedButtonTrendChartPre()
{
	// TODO:  在此添加控件通知处理程序代码
}


void CDialogTrendChart::OnBnClickedButtonTrendChartNext()
{
	// TODO:  在此添加控件通知处理程序代码
}
