// output.cpp : implementation file
//

#include "stdafx.h"
#include "extractor.h"
#include "OutputDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// COutputDlg dialog


COutputDlg::COutputDlg(CWnd* pParent /*=NULL*/)
	: CDialog(COutputDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(COutputDlg)
	m_iIFrameType = 1;
	m_iPFrameType = 0;
	m_bMaxIFrameIntervalChecked = TRUE;
	m_iMaxIFrameInterval = 100;
	m_ProbeInterval = 10;
	m_bProbeChecked = TRUE;
	//}}AFX_DATA_INIT
}


void COutputDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(COutputDlg)
	DDX_Radio(pDX, IDC_RADIO1, m_iIFrameType);
	DDX_Radio(pDX, IDC_RADIO5, m_iPFrameType);
	DDX_Check(pDX, IDC_CHECK1, m_bMaxIFrameIntervalChecked);
	DDX_Text(pDX, IDC_EDIT1, m_iMaxIFrameInterval);
	DDX_Text(pDX, IDC_EDIT2, m_ProbeInterval);
	DDX_Check(pDX, IDC_CHECK3, m_bProbeChecked);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(COutputDlg, CDialog)
	//{{AFX_MSG_MAP(COutputDlg)
	ON_EN_CHANGE(IDC_EDIT1, OnChangeEdit1)
	ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
	ON_BN_CLICKED(IDC_CHECK3, OnCheck3)
	ON_EN_CHANGE(IDC_EDIT2, OnChangeEdit2)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// COutputDlg message handlers


void COutputDlg::OnOK() 
{
	// TODO: Add extra validation here
	this->UpdateData();
	CDialog::OnOK();
	
}

void COutputDlg::OnChangeEdit1() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function and call CRichEditCtrl().SetEventMask()
	// with the ENM_CHANGE flag ORed into the mask.
	
	// TODO: Add your control notification handler code here
	this->UpdateData();
}

void COutputDlg::OnCheck1() 
{
	// TODO: Add your control notification handler code here

	this->UpdateData();
	if(!m_bMaxIFrameIntervalChecked)
	{
		CWnd* pWnd = GetDlgItem(IDC_EDIT1);
		pWnd->EnableWindow(FALSE);
		m_iMaxIFrameInterval=0;
	}
	else
	{	
		CWnd* pWnd = GetDlgItem(IDC_EDIT1);
		pWnd->EnableWindow(TRUE);
	}
	
}

void COutputDlg::OnCheck3() 
{
	// TODO: Add your control notification handler code here
	this->UpdateData();
	if(!m_bProbeChecked)
	{
		CWnd* pWnd = GetDlgItem(IDC_EDIT2);
		pWnd->EnableWindow(FALSE);
		m_ProbeInterval=0;
	}
	else
	{	
		CWnd* pWnd = GetDlgItem(IDC_EDIT2);
		pWnd->EnableWindow(TRUE);
	}
}

void COutputDlg::OnChangeEdit2() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function and call CRichEditCtrl().SetEventMask()
	// with the ENM_CHANGE flag ORed into the mask.
	
	// TODO: Add your control notification handler code here
	this->UpdateData();
}

int COutputDlg::GetIFrameType()
{
	return this->m_iIFrameType;
}

int COutputDlg::GetPFrameType()
{
	return this->m_iPFrameType;
}

int COutputDlg::GetProbeInterval()
{
	return this->m_ProbeInterval;
}

int COutputDlg::GetMaxIFrameInterval()
{
	return this->m_iMaxIFrameInterval;
}

BOOL COutputDlg::CheckProbe()
{
	return this->m_bProbeChecked;
}

BOOL COutputDlg::CheckMaxIFrameIntvl()
{
	return this->m_bMaxIFrameIntervalChecked;
}
