#ifndef __LRSDIALOG_H__
#define __LRSDIALOG_H__

// lrsclientdialog.h : header file
//
#include "LRSEventsC.h"
#include "gui\cprogress\progress.h"
#include "gui\resource.h"
#include "gui\statusdialog.h"

/////////////////////////////////////////////////////////////////////////////
// Forward declarations
class CLrsClient;
class CAlarmSetpointDialog;

/////////////////////////////////////////////////////////////////////////////
// GUI formatting
#define MIN_TEMP_DISPLAY 0
#define MAX_TEMP_DISPLAY 50
#define MIN_RH_DISPLAY 0
#define MAX_RH_DISPLAY 100

#define ALARM_COLOR RGB(255,0,0)	 //RED
#define WARNING_COLOR RGB(255,255,0) //YELLOW
#define GOOD_COLOR RGB(53,168,111)   //NICE GREEN
#define BAD_READING_COLOR RGB(164,72,255) //PURPLE

#ifndef NUM_HOUSINGS
#define NUM_HOUSINGS 2
#endif

/////////////////////////////////////////////////////////////////////////////
// CProgressCtrlDialog dialog
// Shows progress bar indicating connect or disconnect status
// depending on display mode passed to <Create> 
/////////////////////////////////////////////////////////////////////////////
class CProgressCtrlDialog : public CDialog
{
// Construction
public:
	
	CProgressCtrlDialog(CWnd* pParent = NULL);   // standard constructor

	enum displayMode {CONNECT, DISCONNECT};

	BOOL Create(CWnd* pParent, const char *dialogTitle, displayMode mode);

// Dialog Data
	//{{AFX_DATA(CProgressCtrlDialog)
	enum { IDD = IDD_CPROGRESS_DIALOG };
		// NOTE: the ClassWizard will add data members here
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CProgressCtrlDialog)
	public:
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CProgressCtrlDialog)
	virtual BOOL OnInitDialog();
	afx_msg void OnTimer(UINT nIDEvent);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

private:
	CLrsClient *_theApp;
	int m_timerID; //Timer id for init progress display
	displayMode _mode;
	CString _title; //Title of progress dialog
	CWnd *_parent; // Pointer to parent dialog
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

/////////////////////////////////////////////////////////////////////////////
// CLrsClientDialog dialog
/////////////////////////////////////////////////////////////////////////////

class CLrsClientDialog : public CDialog
{
// Construction
public:
	
	CLrsClientDialog(CWnd* pParent = NULL);	// standard constructor
	~CLrsClientDialog();

	BOOL Create();

// Dialog Data
	//{{AFX_DATA(CJunkDlg)
	enum { IDD = IDD_CLIENT_DIALOG };
		// NOTE: the ClassWizard will add data members here
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CJunkDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;
	CProgress m_TemperatureBar[NUM_HOUSINGS]; //Progress bar used to display temperature
	CProgress m_RHBar[NUM_HOUSINGS]; //Progress bar used to display relative humidity

	// Generated message map functions
	//{{AFX_MSG(CLrsClientDialog)
	virtual BOOL OnInitDialog();
	virtual void OnCancel();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();	
	afx_msg void OnDestroy();
	afx_msg void OnButtonChangeElecSetpoints();
	afx_msg void OnButtonChangeSpectSetpoints();
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	afx_msg void OnShowStatus();
	afx_msg void OnReconnectToTarget();
	afx_msg void OnTimer(UINT nIDEvent);
	//}}AFX_MSG
	afx_msg LRESULT OnEvent(WPARAM wParam, LPARAM lParam);
	DECLARE_MESSAGE_MAP()

private:	
	void UpdateHKDisplay(LRS::HousekeepingData *data);
	CLrsClient *_theApp;
	CLrsStatusDialog *m_pStatusDialog;
	CProgressCtrlDialog *m_pLinkProgress;
	CLinkIndicator *m_pLinkIndicator;	
	CTimeIndicator *m_pTimeIndicator;
	CAlarmSetpointDialog *m_pAlarmDialog[NUM_HOUSINGS];	
	COLORREF m_waterAlarmColor[NUM_HOUSINGS];
	int m_nTimer;
};

#endif // __LRSDIALOG_H__
