// WinSetDlg.cpp : implementation file
//
#include "stdafx.h"
#include "MVCTest.h"
#include "WinSetDlg.h"
#include "MVCAPI.h"
#include "Math.h"
#include "MVC1280Setting.h"
#include "MVCLLUT.h"
#include "MVCUNIQ.h"
#include "DlgMVC360Set.h"
#include "SerConfigDlg.h"
#include "DlgMV2048Set.h"
#include "DlgGamma.h"
#include "DlgMV2GE.h"
#include "MVNCCD.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
DWORD ShutterSpeed[16]={30,60,120,240,500,1000,2000,4000,6000,8000,10000,12000,15000,20000,31000,62000};
DWORD ShutterSpeed800[16]={45,120,250,500,1000,1500,2000,4000,5000,9000,12000,14000,18000,24000,35000,71000};
DWORD ShutterSpeed610[16]={110,220,440,900,1800,3500,4500,7000,9000,14000,18000,22000,28000,37000,55000,110000};
DWORD ShutterSpeed600[16]={60,125,250,500,1000,2000,4000,5000,6000,8000,10000,12500,15000,20000,31000,62000};
DWORD ShutterSpeed2000[16]={16,50,100,200,400,500,1000,2000,3000,5000,6500,8000,10000,13000,20000,40000};
DWORD ShutterSpeed2001[16]={16,500,1000,1500,2000,3000,4000,5000,6000,6500,8000,10000,15000,20000,40000,80000};
/////////////////////////////////////////////////////////////////////////////
// CWinSetDlg dialog
UINT MAXWIDTH = 1280;
UINT MAXHEIGHT = 1024;
UINT MAXXSHIFT = 100;
UINT MAXYSHIFT = 100;
extern int m_iCurDevNo;
CWinSetDlg::CWinSetDlg(CWnd* pParent /*=NULL*/)
: CDialog(CWinSetDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CWinSetDlg)
m_iImgWidth = 1280;
m_iImgHeight = 1024;
m_iXOffset = 0;
m_iYOffset = 0;
m_iRolling = 0;
m_Master = 0;
m_bXBinning = FALSE;
m_bYBinning = FALSE;
m_iDACGain = 64;
m_iOutGain = 0;
m_bGrayColor = FALSE;
m_EnGamma = FALSE;
m_EnSoftTriger = FALSE;
m_bPixelConvert = FALSE;
m_EnTTLOUT = FALSE;
m_bBayerMode = FALSE;
m_iReg = 0;
m_iVal = 0;
m_iLineTime = 0;
m_bMirror = FALSE;
m_bColFlip = FALSE;
m_bAGC = FALSE;
m_bAEC = FALSE;
m_bNoHeight = FALSE;
m_bNoWidth = FALSE;
m_iFrameRate = 1;
m_iSInttime = 1;
m_iSkipFrame = 0;
m_bPixelClock = FALSE;
m_iLineDelay0 = 100;
m_iLineDelay1 = 100;
//}}AFX_DATA_INIT
}
void CWinSetDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CWinSetDlg)
DDX_Control(pDX, IDC_CMB_CAMBITLUT, m_BitLut);
DDX_Control(pDX, IDC_CMB_RGBMODE, m_iRBGMode);
DDX_Control(pDX, IDC_SLIDER_LINETIME, m_pLineTimeSlider);
DDX_Control(pDX, IDC_CMB_CAMTYPE, m_CamType);
DDX_Control(pDX, IDC_SLIDER_WIDTH, m_pWidthSlider);
DDX_Control(pDX, IDC_SLIDER_HEIGHT, m_pHeightSlider);
DDX_Control(pDX, IDC_SLIDER_YOFFSET, m_pYOffsetSlider);
DDX_Control(pDX, IDC_SLIDER_XOFFSET, m_pXOffsetSlider);
DDX_Control(pDX, IDC_SLIDER_INTETIME, m_pInteTimeSlider);
DDX_Control(pDX, IDC_SLIDER_REDGAIN, m_pRedGainSlider);
DDX_Control(pDX, IDC_SLIDER_GREENGAIN, m_pGreenGainSlider);
DDX_Control(pDX, IDC_SLIDER_BLUEGAIN, m_pBlueGainSlider);
DDX_Control(pDX, IDC_SLIDER_OUTGAIN, m_pOUTGAINOffSlider);
DDX_Control(pDX, IDC_SLIDER_DACGAIN, m_pDACOffSlider);
DDX_Text(pDX, IDC_EDIT_WIDTH, m_iImgWidth);
DDV_MinMaxDWord(pDX, m_iImgWidth, 1, 8192);
DDX_Text(pDX, IDC_EDIT_HEIGHT, m_iImgHeight);
DDV_MinMaxDWord(pDX, m_iImgHeight, 1, 16000);
DDX_Text(pDX, IDC_EDIT_XOFFSET, m_iXOffset);
DDV_MinMaxDWord(pDX, m_iXOffset, 0, 4096);
DDX_Text(pDX, IDC_EDIT_YOFFSET, m_iYOffset);
DDV_MinMaxDWord(pDX, m_iYOffset, 0, 4096);
DDX_Text(pDX, IDC_EDIT_INTETIME, m_iIntTime);
DDX_Control(pDX, IDC_CMB_BITMODE, m_BitModeCMB);
DDX_Radio(pDX, IDC_ROLLING, m_iRolling);
DDX_Radio(pDX, IDC_MASTER, m_Master);
DDX_Check(pDX, IDC_CHKXBINNING, m_bXBinning);
DDX_Check(pDX, IDC_CHKYBINNING, m_bYBinning);
DDX_Text(pDX, IDC_EDIT_DACGAIN, m_iDACGain);
DDV_MinMaxDWord(pDX, m_iDACGain, 0, 255);
DDX_Text(pDX, IDC_EDIT_OUTGAIN, m_iOutGain);
DDV_MinMaxDWord(pDX, m_iOutGain, 0, 65535);
DDX_Check(pDX, IDC_GRAYCOLOR, m_bGrayColor);
DDX_Check(pDX, IDC_CHECKGAMMA, m_EnGamma);
DDX_Check(pDX, IDC_TRIGGER, m_EnSoftTriger);
DDX_Check(pDX, IDC_PIXELCONVERT, m_bPixelConvert);
DDX_Check(pDX, IDC_TTLOUT, m_EnTTLOUT);
DDX_Check(pDX, IDC_BayerMode, m_bBayerMode);
DDX_Text(pDX, IDC_EDIT_REG, m_iReg);
DDV_MinMaxDWord(pDX, m_iReg, 0, 255);
DDX_Text(pDX, IDC_EDIT_VAL, m_iVal);
DDV_MinMaxByte(pDX, m_iVal, 0, 255);
DDX_Text(pDX, IDC_EDIT_LINETIME, m_iLineTime);
DDX_Check(pDX, IDC_CHKENMirror, m_bMirror);
DDX_Check(pDX, IDC_CHKENCOLFlip, m_bColFlip);
DDX_Check(pDX, IDC_AUTOAGC, m_bAGC);
DDX_Check(pDX, IDC_AUTOAEC, m_bAEC);
DDX_Check(pDX, IDC_UNDEFINEHEI, m_bNoHeight);
DDX_Check(pDX, IDC_UNDEFINEWID, m_bNoWidth);
DDX_Text(pDX, IDC_EDIT_FRAME, m_iFrameRate);
DDV_MinMaxDWord(pDX, m_iFrameRate, 1, 100);
DDX_Text(pDX, IDC_EDIT_INTTIME, m_iSInttime);
DDV_MinMaxDWord(pDX, m_iSInttime, 1, 200000);
DDX_Text(pDX, IDC_EDIT_SKIPFRAME, m_iSkipFrame);
DDX_Check(pDX, IDC_CHK_CLOCKP, m_bPixelClock);
DDX_Text(pDX, IDC_EDIT_DELAY1, m_iLineDelay0);
DDX_Text(pDX, IDC_EDIT_DELAY2, m_iLineDelay1);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CWinSetDlg, CDialog)
//{{AFX_MSG_MAP(CWinSetDlg)
ON_WM_HSCROLL()
ON_BN_CLICKED(IDC_SETTING, OnSetting)
ON_WM_CREATE()
ON_WM_SHOWWINDOW()
ON_BN_CLICKED(IDC_ROLLING, OnRolling)
ON_BN_CLICKED(IDC_SNAP, OnSnap)
ON_BN_CLICKED(IDC_MASTER, OnMaster)
ON_BN_CLICKED(IDC_SLAVE, OnSlave)
ON_BN_CLICKED(IDC_CHKXBINNING, OnChkxbinning)
ON_BN_CLICKED(IDC_CHKYBINNING, OnChkybinning)
ON_BN_CLICKED(IDC_CHECKGAMMA, OnCheckgamma)
ON_BN_CLICKED(IDC_TRIGGER, OnTrigger)
ON_BN_CLICKED(IDC_MVC1280CONTROL, OnMvc1280control)
ON_BN_CLICKED(IDC_PIXELCONVERT, OnPixelconvert)
ON_BN_CLICKED(IDC_NoisePixel, OnNoisePixel)
ON_BN_CLICKED(IDC_TTLOUT, OnTtlout)
ON_BN_CLICKED(IDC_CL_GPIOLUT, OnClGpiolut)
ON_EN_CHANGE(IDC_EDIT_HEIGHT, OnChangeEditHeight)
ON_EN_CHANGE(IDC_EDIT_WIDTH, OnChangeEditWidth)
ON_EN_CHANGE(IDC_EDIT_YOFFSET, OnChangeEditYoffset)
ON_EN_CHANGE(IDC_EDIT_XOFFSET, OnChangeEditXoffset)
ON_BN_CLICKED(IDC_BayerMode, OnBayerMode)
ON_BN_CLICKED(IDC_GRAYCOLOR, OnGraycolor)
ON_BN_CLICKED(IDC_MVCUNIQCONTROL, OnMvcuniqcontrol)
ON_BN_CLICKED(IDC_WATCHDOG, OnWatchdog)
ON_BN_CLICKED(IDC_BTN_WRITE, OnBtnWrite)
ON_BN_CLICKED(IDC_BTN_READ, OnBtnRead)
ON_BN_CLICKED(IDC_BTN_CLOSE, OnBtnClose)
ON_WM_KEYDOWN()
ON_WM_KEYUP()
ON_WM_CLOSE()
ON_BN_CLICKED(IDC_CHKENMirror, OnCHKENMirror)
ON_BN_CLICKED(IDC_CHKENCOLFlip, OnCHKENCOLFlip)
ON_BN_CLICKED(IDC_AUTOAGC, OnAutoagc)
ON_BN_CLICKED(IDC_AUTOAEC, OnAutoaec)
ON_BN_CLICKED(IDC_MVC360SET, OnMvc360set)
ON_CBN_SELCHANGE(IDC_CMB_RGBMODE, OnSelchangeCmbRgbmode)
ON_BN_CLICKED(IDC_CL_SerialSet, OnCLSerialSet)
ON_BN_CLICKED(IDC_MVC2048SET, OnMvc2048set)
ON_BN_CLICKED(IDC_GAMMA, OnGamma)
ON_BN_CLICKED(IDC_SOFTMODE, OnSoftmode)
ON_BN_CLICKED(IDC_BTN_OK, OnBtnOk)
ON_BN_CLICKED(IDC_CAM_SYNC, OnCamSync)
ON_BN_CLICKED(IDC_CL_MV2GE, OnClMv2ge)
ON_BN_CLICKED(IDC_BTN_SAVEPARAM, OnBtnSaveparam)
ON_BN_CLICKED(IDC_BTN_DELAY, OnBtnDelay)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CWinSetDlg message handlers
void CWinSetDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
char StrBuf[255];
DWORD SetVal;
MVC_TYPE CamType = MVC_GetCameraType(m_iCurDevNo);
DWORD SnapMode;
double ShutterTime;
switch(pScrollBar->GetDlgCtrlID())
{
case IDC_SLIDER_LINETIME:
if((CamType == MVC2048DLM_GE15)||(CamType == MVC2048DLM_GE19))
{
m_iLineTime = (m_pLineTimeSlider.GetPos()/4)*4;
MVC_SetParameter(m_iCurDevNo,MVCADJ_LINETIME,(DWORD)m_iLineTime);
float TmpVal = ((float)m_iLineTime*8.3)/1000 + 70;
DWORD TotalLineNum = 1000000/TmpVal ;
sprintf(StrBuf,"Line.Time: %.2f us = %d", TmpVal,TotalLineNum);
GetDlgItem(IDC_TEXT_LINETIME)->SetWindowText(StrBuf);
}
case IDC_SLIDER_INTETIME:
m_iIntTime = m_pInteTimeSlider.GetPos()
评论5
最新资源