///////////////////////////////////////////////////////////
// File:			pg_soil_salinity_compare_dlg.h
//
// Author:			Stefan Liersch
// Contact:			stefan.liersch@googlemail.com,
//					stefan.liersch@ufz.de
//
// Date:			2008-09-30
// last modified:	2008-09-30
//
//---------------------------------------------------------
// DESCRIPTION
//---------------------------------------------------------
//
//---------------------------------------------------------
// ToDo
//---------------------------------------------------------
//	- 
///////////////////////////////////////////////////////////

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

#ifndef __HEADER_INCLUDED_soil_salinity_compare_h_
#define __HEADER_INCLUDED_soil_salinity_compare_h_
//---------------------------------------------------------------------

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

#include "soil_salinity/pg_soil_salinity_map.h"
#include "dialogs/pg_soil_salinity_dlg_base.h"

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

enum cmd_id_ssc {
	ID_CMD_SSC_COMBO_YEAR1 = 12000,
	ID_CMD_SSC_COMBO_MONTH1,
	ID_CMD_SSC_COMBO_YEAR2,
	ID_CMD_SSC_COMBO_MONTH2,
	ID_CMD_SSC_BUTTON_COMPARE
};

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

class CSoilSalinityCompareDlg : public wxDialog
{
public:
	CSoilSalinityCompareDlg(CSoilSalinityMap* pSSMap, bool bCreate, wxWindow *parent, wxWindowID id, const wxString &title);
	~CSoilSalinityCompareDlg();

private:
	vector_d							m_diff; // difference between salinity year1 and year2

	int									m_minYear;	// absolute min year in dataset
	int									m_maxYear;	// absolute max year in dataset
	int									m_nYears;	// absolute number of years in dataset

	bool								_Get_MinMaxYears(int& min, int& max);

	CSoilSalinityDlgBase				m_DLG_Base;

	CSoilSalinityMap*					m_pSSMap;

	CSG_Table*							m_pTable;

	CSG_String							_Get_Select_Year(int year, CSG_String month);

	bool								_Get_Salinity(CSG_String sql, vector_d& salinity);

	void								_CreateDialog();

	void								_On_Button_Compare(wxCommandEvent& event);

	void								_Write_DifferenceToTable();

	//-----------------------------------------------------------------
	//
	//	DIALOG CONTROLS
	//
	//-----------------------------------------------------------------
	wxComboBox*							m_pCombo_Year1;
	wxComboBox*							m_pCombo_Month1;
	wxComboBox*							m_pCombo_Year2;
	wxComboBox*							m_pCombo_Month2;
	wxButton*							m_pButtonCompare;
	wxButton*							m_pButtonCancel;


	DECLARE_EVENT_TABLE()
};

//---------------------------------------------------------------------
#endif /* __HEADER_INCLUDED_soil_salinity_compare_h_ */