// NumericalSolverDialog.cpp : implementation file
//

#include "stdafx.h"
#include "DiagramEng.h"
#include "NumericalSolverDialog.h"

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

/////////////////////////////////////////////////////////////////////////////
// CNumericalSolverDialog dialog


CNumericalSolverDialog::CNumericalSolverDialog(CWnd* pParent /*=NULL*/)
	: CDialog(CNumericalSolverDialog::IDD, pParent)
{
	//{{AFX_DATA_INIT(CNumericalSolverDialog)
	m_dTimeStart = 0.0;
	m_dTimeStop = 0.0;
	m_dTimeStepSize = 0.0;
	m_strTimeStepType = _T("");
	m_strIntegrationMethod = _T("");
	m_dATOL = 0.0;
	m_dRTOL = 0.0;
	m_strWarning = _T("");
	//}}AFX_DATA_INIT
}


void CNumericalSolverDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CNumericalSolverDialog)
	DDX_Text(pDX, ID_NUM_SOLVER_DLG_TSTART, m_dTimeStart);
	DDX_Text(pDX, ID_NUM_SOLVER_DLG_TSTOP, m_dTimeStop);
	DDX_Text(pDX, ID_NUM_SOLVER_DLG_TSTEPSIZE, m_dTimeStepSize);
	DDX_CBString(pDX, ID_NUM_SOLVER_DLG_CB_TSTEPTYPE, m_strTimeStepType);
	DDX_CBString(pDX, ID_NUM_SOLVER_DLG_CB_INTEGRATOR, m_strIntegrationMethod);
	DDX_Text(pDX, ID_NUM_SOLVER_DLG_ATOL, m_dATOL);
	DDX_Text(pDX, ID_NUM_SOLVER_DLG_RTOL, m_dRTOL);
	DDX_Text(pDX, ID_NUM_SOLVER_DLG_WARNING, m_strWarning);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CNumericalSolverDialog, CDialog)
	//{{AFX_MSG_MAP(CNumericalSolverDialog)
	ON_BN_CLICKED(ID_NUM_SOLVER_DLG_BTN_OK, OnNumericalSolverDlgBtnOk)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CNumericalSolverDialog message handlers

void CNumericalSolverDialog::OnNumericalSolverDlgBtnOk() 
{
	// TODO: Add your control notification handler code here
	
	// DiagramEng (start)

	//AfxMessageBox("\n CNumericalSolverDialog::OnNumericalSolverDlgBtnOk()\n", MB_OK, 0);
	
	// Update variable values with the Dlg Wnd control values
	UpdateData(TRUE);

	// Close the dialog wnd with OnOK()
	OnOK();

	// DiagramEng (end)
}
