// 4133_MultiROIDlg.h : header file
//

#pragma once
#include "afxwin.h"
#include "NET_ICube_API.h"

// Set of controls for each ROI

struct ROI_CONTROLS {
    int nROI_ID;
	int SliderXPos;
	int SliderYPos;
	int SliderXRes;
	int SliderYRes;
	int EditXPos;
	int EditYPos;
	int EditXRes;
	int EditYRes;
	int SliderRepetitions;
	int EditRepetitions;
	int SliderExposure;
	int EditExposure;
	int SliderGain;
	int EditGain;
	int ButtonSet;
	int CheckEnable;
	int ButtonAvi;
	int ButtonBmp;
	int ButtonGrab;
	bool bGrabCallback;
};

typedef LONG __stdcall ROI_CALLBACK(BYTE *pBuf, LONG lBufferSize,PVOID pContext);

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

// Dialog Data
	enum { IDD = IDD_MY4133_MULTIROI_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support


// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()

	void SetRoiID(int nRoiID);
	void StartRoi1(void);
	int OpenCam(void);
	void SetRoiParameter(int nRoiID,int nParam,int nVal);
	void SetRoiWindow(int nRoiID,ROI_PROPERTY roi_prop,ROI_CALLBACK roiCallback);
	float GetRoiExposureMSec(int nRoiID);
	void SetRoiExp(int nRoiID,char* fVal);
    void GetRoiGain(ROI_CONTROLS roiControl);
    void GetRoiExposure(ROI_CONTROLS roiControl);
    void GetRoiRepetitions(ROI_CONTROLS roiControl);
    void GetRoiRange(ROI_CONTROLS roiControl,
                        ROI_PROPERTY *roi_prop,ROI_RANGE_PROPERTY *roi_range_prop);
    void SetControls(BOOL IsEnabled, ROI_CONTROLS roiControl);
    void SetControlCheck(BOOL IsEnabled, ROI_CONTROLS roiControl);
    void SetSaveControls(BOOL IsEnabled, ROI_CONTROLS roiControl);


public:
	CComboBox m_ComboCam;
	CComboBox m_ComboShutter;
	afx_msg void OnClose();
	afx_msg void OnBnClickedButtonStop();
	afx_msg void OnBnClickedButtonSetRoi1();
	afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg void OnBnClickedCheckEnableRoi1();
	afx_msg void OnBnClickedButtonSetRoi2();
	afx_msg void OnBnClickedButtonSetRoi3();
	afx_msg void OnBnClickedButtonGrabRoi1();
	afx_msg void OnBnClickedButtonBmpRoi1();
	afx_msg void OnBnClickedButtonAviRoi1();
	afx_msg void OnBnClickedCheckEnableRoi12();
	afx_msg void OnBnClickedButtonSetRoi12();
	afx_msg void OnBnClickedCheckEnableRoi2();
	afx_msg void OnBnClickedCheckEnableRoi3();
	afx_msg void OnBnClickedButtonSetRoi4();
	afx_msg void OnBnClickedCheckEnableRoi4();
	afx_msg void OnBnClickedButtonGrabRoi4();
	afx_msg void OnBnClickedButtonBmpRoi4();
	afx_msg void OnBnClickedButtonAviRoi4();
	afx_msg void OnBnClickedButtonGrabRoi3();
	afx_msg void OnBnClickedButtonBmpRoi3();
	afx_msg void OnBnClickedButtonAviRoi3();
	afx_msg void OnBnClickedButtonGrabRoi2();
	afx_msg void OnBnClickedButtonBmpRoi2();
	afx_msg void OnBnClickedButtonAviRoi2();
	afx_msg void OnBnClickedCheckDefectCor();
	afx_msg void OnCbnSelchangeComboShutter();
	afx_msg void OnTimer(UINT_PTR nIDEvent);
	afx_msg void OnCbnSelchangeComboCam();
public:
	afx_msg void OnEnChangeEditExposureRoi1();
public:
	afx_msg void OnEnChangeEditExposureRoi2();
public:
	afx_msg void OnEnChangeEditExposureRoi3();
public:
	afx_msg void OnEnChangeEditExposureRoi4();
public:
	afx_msg void OnBnClickedButtonDoSwTrigger();
public:
	afx_msg void OnBnClickedCheckEnableTrigger();
public:
	afx_msg void OnBnClickedRadioSoftwareTrigger();
public:
	afx_msg void OnBnClickedRadioHardwareTrigger();
public:
	afx_msg void OnBnClickedButtonSetAllRois();
};
