//-----------------------------------------------------------------------------
#ifndef InfoPlotCanvasH
#define InfoPlotCanvasH InfoPlotCanvasH
//-----------------------------------------------------------------------------
#include <wx/dcclient.h>
#include "DevData.h"
#include "DrawingCanvas.h"
#include <deque>

//-----------------------------------------------------------------------------
class InfoPlotCanvas : public PlotCanvas
//-----------------------------------------------------------------------------
{
public:
	//-----------------------------------------------------------------------------
	enum TPlotSelection
	//-----------------------------------------------------------------------------
	{
		psFIRST,
		psTimestampDifference = psFIRST,
		psExposureTime_us,
		psFrameIDDifference,
		psFrameID,
		psGain_mdB,
		psLineCounter,
		psLAST
	};
	explicit		InfoPlotCanvas() {}
	explicit		InfoPlotCanvas( wxWindow* parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
									   const wxSize& size = wxDefaultSize, long style = wxSUNKEN_BORDER,
									   const wxString& name = wxT("info plot"), bool boActive = false );
				   ~InfoPlotCanvas();
	void			OnPaint( wxPaintEvent& );
	const wxString&	GetPlotSelectionName( TPlotSelection plotSelection ) const { return m_PlotNames[plotSelection]; }
	TPlotSelection	GetPlotSelection( void ) const { return m_SelectedPlot; }
	void			SetPlotSelection( TPlotSelection plotSelection );
	void			SetHistoryDepth( unsigned int historyDepth );
	unsigned int	GetHistoryDepth( void ) const { return m_HistoryDepth; }
	virtual void	RefreshData( const RequestInfoData& infoData, bool boForceRefresh = false );
	bool			RefreshPlotData( void );
private:
	TPlotSelection	m_SelectedPlot;
	unsigned int	m_HistoryDepth;
	std::deque<int64_type>	m_PlotValues;
	int64_type		m_CurrentPlotValue;
	int64_type		m_CurrentMaxPlotValue;
	int64_type		m_CurrentMinPlotValue;
	wxString		m_PlotNames[psLAST];
	bool			MustUpdate( bool boForceRefresh );
	DECLARE_DYNAMIC_CLASS(LineProfileCanvas)
	DECLARE_EVENT_TABLE()
};

#endif // InfoPlotCanvasH
