//-----------------------------------------------------------------------------
#ifndef DeviceConfigureFrameH
#define DeviceConfigureFrameH DeviceConfigureFrameH
//-----------------------------------------------------------------------------
#include "wx/wx.h"
#include "DebugFileParser.h"
#include <mvIMPACT_CPP/mvIMPACT_acquire.h>

class DeviceListCtrl;

//-----------------------------------------------------------------------------
class DeviceConfigureFrame : public wxFrame
//-----------------------------------------------------------------------------
{
public:
		DeviceConfigureFrame(const wxString& title, const wxPoint& pos, const wxSize& size);
	   ~DeviceConfigureFrame();
	void ActivateDeviceInPropView( int deviceIndex );
	int SetID( int deviceIndex );
	int UpdateFirmware( int deviceIndex );
	int UpdateKernelDriver( int deviceIndex );
	void UpdateMenu( int deviceIndex );
	DeviceManager& GetDeviceManager( void ) { return m_devMgr; }
protected:
	// event handlers (these functions should _not_ be virtual)
	void OnAbout( wxCommandEvent& event );
	void OnConfigureLogOutput( wxCommandEvent& event );
	void OnQuit( wxCommandEvent& event );
	void OnSetID( wxCommandEvent& event );
	void OnSize( wxSizeEvent& event );
	void OnTimer( wxTimerEvent& event );
	void OnUpdateFirmware( wxCommandEvent& event );
	void OnUpdateKernelDriver( wxCommandEvent& event );
	enum TTimerEvent
	{
		teListUpdate
	};
private:
	void								DoSize( void );
	void								BuildList( void );
	void								WriteLogMessage( const wxString& msg, const wxTextAttr& style );
	mvIMPACT::acquire::DeviceManager	m_devMgr;
	DeviceListCtrl*						m_pDevListCtrl;
	wxMenuItem*							m_pMIActionSetID;
	wxMenuItem*							m_pMIActionUpdateFW;
	wxMenuItem*							m_pMIActionUpdateKernelDriver;
	wxPanel*							m_pPanel;
	wxTextCtrl*							m_pLogWindow;
	wxTimer								m_listUpdateTimer;
	unsigned int						m_lastDevMgrChangedCount;
	LogConfigurationVector				m_debugData;
	// any class wishing to process wxWidgets events must use this macro
	DECLARE_EVENT_TABLE()
	//-----------------------------------------------------------------------------
	// IDs for the controls and the menu commands
	enum TMenuItem
	//-----------------------------------------------------------------------------
	{
		miQuit = 1,
		miAbout,
		miSetID = 1000,
		miUpdateFW,
		miUpdateKernelDriver,
		miConfigureLogOutput
	};
	//-----------------------------------------------------------------------------
	enum TDeviceIDLimits
	//-----------------------------------------------------------------------------
	{
		didlMin = 0,
		didlMax = 250
	};
};

#endif // DeviceConfigureFrameH
