//{{AFX_INCLUDES()
#include "cwslide.h"
#include "cwbutton.h"
#include "indicator2.h"
//}}AFX_INCLUDES
#if !defined(AFX_POWERBOARDDLG_H__D2DADD51_2562_446F_823F_F7BFAEEAF94C__INCLUDED_)
#define AFX_POWERBOARDDLG_H__D2DADD51_2562_446F_823F_F7BFAEEAF94C__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PowerBoardDlg.h : header file
//
#include "DataRecipient.h"
#include "DeviceDlg.h"
#include "StatusStatic.h"
#include "TestDlg.h"

#define NUM_CIRCUITS 16

class CDashboardRecipient;

/////////////////////////////////////////////////////////////////////////////
// CPowerBoardDlg dialog

class CPowerBoardDlg : public CTestDlg
{
// Construction
public:
	CPowerBoardDlg(CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(CPowerBoardDlg)
	enum { IDD = IDD_POWER_DIALOG };
	CListCtrl	m_circuitList;
	CCWSlide	m_temperature1;
	CCWSlide	m_temperature2;
	BOOL	m_water1;
	BOOL	m_water2;
	BOOL	m_water3;
	BOOL	m_water4;
	BOOL	m_descendBurning;
	BOOL	m_ascendBurning;
	BOOL	m_emerBurning;
	double	m_gfBatMinus;
	double	m_gfBatPlus;
	double	m_gfIsoMinus;
	double	m_gfIsoPlus;
	//}}AFX_DATA

	// My members
	void requestUpdate();
	void stopRequests();
	void resetDialog();

	bool IsPowerDriverRunning() 
	{ TRACE("Power driver running:%d\n", m_powerDriverRunning);
		return m_powerDriverRunning; };

	void setDevice(int number, const char *name, int circuit);
	void setCircuit(int number, bool value);
	void setWaterAlarm(int number, bool value);
	void setTemperature(int number, double value);
	void setCircuitCurrent(int number, double value);
	void setGroundFaultCurrent(int number, double value);
	void setCircuitInfo(int circNum, const char *name);
	void setDropWeightStatus(bool descend, bool ascend, bool emer);

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CPowerBoardDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	void initSubClassDlg();
	// My members
	int m_circuitLock;

	double currents[NUM_CIRCUITS];
	bool circuitStatus[NUM_CIRCUITS];
	CString circuitNames[NUM_CIRCUITS];
	bool nameChanged[NUM_CIRCUITS];
	bool statusChanged[NUM_CIRCUITS];

	bool m_powerDriverRunning;

	void ReloadList();

	// Generated message map functions
	//{{AFX_MSG(CPowerBoardDlg)
	afx_msg void OnValueChangedMvcWatchdogEnable(BOOL Value);
	afx_msg void OnValueChangedTcWatchdogEnable(BOOL Value);
	afx_msg void OnCircuitoff();
	afx_msg void OnCircuiton();
	afx_msg void OnPowerFail();
	afx_msg void OnRclickCircuitlist(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnFireDescend();
	afx_msg void OnFireAscend();
	afx_msg void OnFireEmer();
	afx_msg void OnUnfireAscend();
	afx_msg void OnUnfireDescend();
	afx_msg void OnUnfireEmer();
	DECLARE_EVENTSINK_MAP()
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_POWERBOARDDLG_H__D2DADD51_2562_446F_823F_F7BFAEEAF94C__INCLUDED_)
