#include "ihacres_cal.h"


void Cihacres_cal::CreateDialog1()
{
	CSG_Parameter	*pNode;
	CSG_String s;

	pNode = Parameters.Add_Table(
		NULL	, "TABLE"	, _TL("Table"),
		"",
		PARAMETER_INPUT
	);

	Parameters.Add_Table_Field(
		pNode	, "DATE_Field"	, _TL("Date Column"),
		"Select the column containing the Date"
	);

	Parameters.Add_Table_Field(
		pNode	, "DISCHARGE_Field"	, _TL("Streamflow Column"),
		"Select the Column containing Discharge Values"
	);

	Parameters.Add_Table_Field(
		pNode	, "PCP_Field"	, _TL("Precipitation Column"),
		"Select the Column containing precipitation Values"
	);

	Parameters.Add_Table_Field(
		pNode	, "TMP_Field"	, _TL("Temperature Column"),
		"Select the Column containing Temperature Values"
	);

	Parameters.Add_Value(
		pNode,	"USE_TMP",	_TL("Using temperature data?"),
		_TL("If checked, then temperature data are used."),
		PARAMETER_TYPE_Bool, true
	);

	pNode = Parameters.Add_Value(
		NULL,	"NSIM",	_TL("Number of Simulations"),
		_TL("Number of Simulations for Calibration"),
		PARAMETER_TYPE_Int,
		1000, 1, true, 10000000, true
	);

	pNode = Parameters.Add_Value(
		NULL,	"AREA",	_TL("Area of the Watershed in [km2]"),
		_TL("Area of the Watershed in [km2] used for unit conversion"),
		PARAMETER_TYPE_Double,
		100.0, 0.00001, true, 0.0, false
	);

	s.Printf("Node2", 2);
		pNode = Parameters.Add_Node(NULL,s,"Non-Linear Module","");

	Parameters.Add_Value(
		pNode,	"NL_ONLY",	_TL("Calibrate non-linear module only"),
		_TL("If checked, then only the non-linear module will be calibrated"),
		PARAMETER_TYPE_Bool, true
	);

	Parameters.Add_Value(
		pNode,	"CFAC_lb",	_TL("Parameter (c) [lower bound]"),
		_TL("Parameter (c) to fit streamflow volume"),
		PARAMETER_TYPE_Double,
		0.001, 0.0, true, 1.0, true
	);
	Parameters.Add_Value(
		pNode,	"CFAC_ub",	_TL("Parameter (c) [upper bound]"),
		_TL("Parameter (c) to fit streamflow volume"),
		PARAMETER_TYPE_Double,
		0.01, 0.0, true, 1.0, true
	);

	Parameters.Add_Value(
		pNode,	"TwFAC_lb",	_TL("(Tw) wetness decline time constant [lower bound]"),
		_TL("Tw is approximately the time constant, or inversely,"
		"the rate at which the catchment wetness declines in the absence of rainfall"),
		PARAMETER_TYPE_Double,
		1.0, 0.01, true, 150.0, true
	);
	Parameters.Add_Value(
		pNode,	"TwFAC_ub",	_TL("(Tw) wetness decline time constant [upper bound]"),
		_TL("Tw is approximately the time constant, or inversely,"
		"the rate at which the catchment wetness declines in the absence of rainfall"),
		PARAMETER_TYPE_Double,
		1.0, 0.01, true, 150.0, true
		);

	Parameters.Add_Value(
		pNode,	"DEV_ERAINDIS",	_TL("Maximum Deviation: ExcessRain-Streamflow [%]"),
		_TL("Maximum Deviation between estimated excess rainfall and observed streamflow volumes"),
		PARAMETER_TYPE_Double,
		5.0, 0.0, true, 50.0, true
	);

	Parameters.Add_Value(
		pNode,	"DEV_ERAINPCP",	_TL("Maximum Overestimation of ExcessRain [%]"),
		_TL("Maximum Sum of overestimated ExcessRain to total ExcessRain in [%]"),
		PARAMETER_TYPE_Double,
		5.0, 0.0, true, 50.0, true
	);

	s.Printf("Node3", 3);
	pNode = Parameters.Add_Node(NULL,s,"Storage Configuration","");

	Parameters.Add_Choice(
		pNode	, "STORAGE"		, "Storage",
		"",
		CSG_String::Format("%s|%s|%s|",
			_TL("Single Storage"),			//  0
			_TL("Two Parallel Storages"),	//  1 
			_TL("Two Storages in Series")	//  2 
		)
	);

	s.Printf("Node4", 4);
	pNode = Parameters.Add_Node(NULL,s,"IHACRES Version","");

	Parameters.Add_Choice(
		pNode	, "IHACVERS"		, "IHACRES Version",
		"",
		CSG_String::Format("%s|%s|%s|%s|",
			_TL("Jakeman & Hornberger (1993)"),	//  0
			_TL("Kokkonen et al. (2003)"),		//  1 
			_TL("IHACRES v1.0 + SNOW MODULE"),	//  2 
			_TL("Croke et al. (2005)")			//	3
		)
	);

	Parameters.Add_Table_Output(
		NULL	, "TABLEout"	, _TL("Table"),
		""
	);
	Parameters.Add_Table_Output(
		NULL	, "TABLEparms"	, _TL("Table"),
		""
	);
}