// Realtime Send Matrix View ImageDlg.h : header file
//

#if !defined(AFX_REALTIMESENDMATRIXVIEWIMAGEDLG_H__38A01BE2_4366_46D2_9B79_DEFC515CE2ED__INCLUDED_)
#define AFX_REALTIMESENDMATRIXVIEWIMAGEDLG_H__38A01BE2_4366_46D2_9B79_DEFC515CE2ED__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


#import ".\Origin8.tlb" rename_namespace("Origin")
#include "afxwin.h"
using namespace Origin;

#define NUM_ROWS 500
#define NUM_COLS 600
#define NUM_COLORS 256
/////////////////////////////////////////////////////////////////////////////
// CRealtimeSendMatrixViewImageDlg dialog

class CRealtimeSendMatrixViewImageDlg : public CDialog
{
// Construction
public:
	CRealtimeSendMatrixViewImageDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CRealtimeSendMatrixViewImageDlg)
	enum { IDD = IDD_REALTIMESENDMATRIXVIEWIMAGE_DIALOG };
	CComboBox	m_comboDelay;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CRealtimeSendMatrixViewImageDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CRealtimeSendMatrixViewImageDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnButtonStartstop();
	afx_msg void OnButtonSendonce();
	afx_msg void OnButtonSetplotcolor();
	afx_msg void OnButtonInit();
	afx_msg void OnButtonSetmatrix();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	void enableControls(bool bConnected);
	int getRGB(int red, int green, int blue);
	bool sendData();
	bool initOrigin();
	bool setZColormap(ColorMapPtr map);

private:
	USHORT getMaxValue();
	DataPlotPtr m_pDataPlot;
	MatrixPagePtr m_pMatrixPage;
	MatrixSheetPtr m_pMatrixSheet;
	MatrixObjectPtr m_pMatrixObject;
	IOApplicationPtr m_pOrigin;
	int m_nAuto;
	int m_nSendCount;
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_REALTIMESENDMATRIXVIEWIMAGEDLG_H__38A01BE2_4366_46D2_9B79_DEFC515CE2ED__INCLUDED_)
