///////////////////////////////////////////////////////////
// Author:			Stefan Liersch
// Contact:			stefan.liersch@googlemail.com,
//					stefan.liersch@ufz.de
//
// Date:			2008-04-10
// last modified:	2008-04-10
//
//---------------------------------------------------------
// DESCRIPTION
//---------------------------------------------------------
//
//---------------------------------------------------------
// ToDo
//---------------------------------------------------------
//	- 
///////////////////////////////////////////////////////////

//---------------------------------------------------------------------

#ifndef __PG_SOIL_SALINITY_DLG_BASE_H_
#define __PG_SOIL_SALINITY_DLG_BASE_H_
//---------------------------------------------------------------------

// Include wxWidgets' headers
#ifndef WX_PRECOMP
    #include <wx/wx.h>
#endif

#include "libpq-fe.h"

#include "pgsql/pgdatabase.h"
#include "soil_salinity/pg_soil_salinity_map.h"

#include "saga_gui/wksp_layer.h"
#include "saga_gui/wksp_simplefeature.h"
#include "saga_gui/wksp_data_manager.h" // g_pData
#include "saga_gui/wksp_simplefeature_manager.h"

#include "saga_gui/SAGA_Frame.h"
#include "saga_gui/helper.h"			// using function MSG_General_Add()
#define MSG_ADD(s)	MSG_General_Add(s, true, true);

#include <vector>
typedef std::vector<double> vector_d;
typedef std::vector<int> vector_i;
typedef std::vector<bool> vector_b;

//---------------------------------------------------------------------


class CSoilSalinityDlgBase
{
public:
	CSoilSalinityDlgBase(void);
	CSoilSalinityDlgBase(CSoilSalinityMap* pSSMap);
	//-----------------------------------------------------------------

	~CSoilSalinityDlgBase(void);
	//-----------------------------------------------------------------

	wxArrayString						_Get_Month_Array();

protected:

	vector_d							m_parameters;
	vector_i							m_settings;
	vector_b							m_checked;


	// last serial (automatically generated primary key)
	int									m_last_serial;

	wxArrayString						_Get_FeatureIDs(CSG_SimpleFeature* pSimpleFeature, int col);

	CWKSP_SimpleFeature*				_Get_WKSP_SimpleFeature(CSG_SimpleFeature* pSimpleFeature);
	
	int									_Get_Selection(CSG_SimpleFeature* pSimpleFeature);

	wxArrayString						_Get_ColumnNames(CSG_SimpleFeature* pSimpleFeature);

	int									m_CurrentSelection;
	int									m_ID_Column; // selected column to identify fields

	void								_Set_ChoiceBox(wxChoice* pChoice, wxArrayString astr, int selection);

	virtual void						_Zero_Controls();

	//-----------------------------------------------------------------
	// EXTERNAL CLASSES
	//-----------------------------------------------------------------
	class CSoilSalinityMap*				m_pSSMap;
	class CSG_SimpleFeature*			m_pSimpleFeature;
	class CParmWeights					m_ParmWeights;
	class CWKSP_SimpleFeature*			m_pWKSP_SimpleFeature;
	class CWKSP_SimpleFeature_Manager*	m_pSimpleFeatureManager;

};
//---------------------------------------------------------------------
#endif /* __PG_SOIL_SALINITY_DLG_BASE_H_ */