#ifndef MOTORDLG_H
#define MOTORDLG_H

#ifndef WM_MODELESSEXIT
#define WM_MODELESSEXIT (WM_USER + 1)
#endif

#include "types.h"

class Motor;
class Axis;
class DataManager;
class CMotorIndicator;

/////////////////////////////////////////////////////////////////////////////
// CMotorDlg dialog

class CMotorDlg : public CDialog
{
// Construction
public:
	CMotorDlg(CWnd* pParent, Axis *pAxis, Nat16 id);   
	~CMotorDlg();

	void UpdateStatus();
	void UpdateStopCode();
	void UpdateBitmap(UINT id, CBitmap & bitmap);

// Dialog Data
	//{{AFX_DATA(CMotorDlg)
	enum { IDD = IDD_MOTOR_DIALOG };
	int		_jogIncrement;
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMotorDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	Motor *_motor;
	Axis *_axis;
	CMotorIndicator *_indicator;
	int _nTimer;

	// Generated message map functions
	//{{AFX_MSG(CMotorDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnJog();
	afx_msg void OnFindHome();
	afx_msg void OnStop();
	afx_msg void OnClose();
	afx_msg void OnIncrementSelect(UINT nID);
	afx_msg void OnPaint();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	Nat16 _motorID;
	CWnd *m_pDialog;
	MBool _jogging;
	static Boolean _bitmapsLoaded;
	static CBitmap _flsBitmap;
	static CBitmap _rlsBitmap;
	static CBitmap _homeBitmap;
	static CBitmap _clrBitmap;
	static CBitmap _stopBitmap;

};

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif
