// DlgSystemCamera.cpp : ±¸Çö ÆÄÀÏÀÔ´Ï´Ù.
|
//
|
|
#include "stdafx.h"
|
#include "ReviewSystemSetting.h"
|
#include "DlgSystemCamera.h"
|
#include "ReviewSystemSettingDlg.h"
|
#include "CHCommonControls/GridCellCombo.h"
|
#include "CHCommonControls/GridCellCheck.h"
|
#include "CHReviewSetting/GantryInfo.h"
|
#include "CHReviewSetting/SystemInfo.h"
|
|
// CDlgSystemCamera ´ëÈ »óÀÚÀÔ´Ï´Ù.
|
|
IMPLEMENT_DYNAMIC(CDlgSystemCamera, CDialog)
|
|
CDlgSystemCamera::CDlgSystemCamera(CWnd* pParent /*=NULL*/)
|
: CDialog(CDlgSystemCamera::IDD, pParent)
|
, m_nGantryIdx(0)
|
, m_nHeaderIdx(0)
|
{
|
m_nCameraCount = 0;
|
}
|
|
CDlgSystemCamera::~CDlgSystemCamera()
|
{
|
}
|
|
void CDlgSystemCamera::DoDataExchange(CDataExchange* pDX)
|
{
|
CDialog::DoDataExchange(pDX);
|
DDX_Control(pDX, IDC_GRID_SYSTEM_CAMERA_INFO, m_ctrlGridCameraInfo);
|
DDX_Text(pDX, IDC_EDIT_SYS_SC_GANTRY_IDX, m_nGantryIdx);
|
DDX_Text(pDX, IDC_EDIT_SYS_SC_HEADER_IDX, m_nHeaderIdx);
|
}
|
|
|
BEGIN_MESSAGE_MAP(CDlgSystemCamera, CDialog)
|
ON_BN_CLICKED(IDC_BUTTON_SYS_SYSTEM_CAMERA_RESET, &CDlgSystemCamera::OnBnClickedButtonSysSystemCameraReset)
|
ON_BN_CLICKED(IDC_BUTTON_SYS_SYSTEM_CAMERA_APPLY, &CDlgSystemCamera::OnBnClickedButtonSysSystemCameraApply)
|
END_MESSAGE_MAP()
|
|
|
// CDlgSystemCamera ¸Þ½ÃÁö 󸮱âÀÔ´Ï´Ù.
|
|
BOOL CDlgSystemCamera::OnInitDialog()
|
{
|
CDialog::OnInitDialog();
|
|
// TODO: ¿©±â¿¡ Ãß°¡ ÃʱâÈ ÀÛ¾÷À» Ãß°¡ÇÕ´Ï´Ù.
|
InitCameraInfoGridControl();
|
FillCameraInfo();
|
|
return TRUE; // return TRUE unless you set the focus to a control
|
// ¿¹¿Ü: OCX ¼Ó¼º ÆäÀÌÁö´Â FALSE¸¦ ¹ÝÈ¯ÇØ¾ß ÇÕ´Ï´Ù.
|
}
|
|
BOOL CDlgSystemCamera::PreTranslateMessage(MSG* pMsg)
|
{
|
// TODO: ¿©±â¿¡ Ư¼öÈµÈ Äڵ带 Ãß°¡ ¹×/¶Ç´Â ±âº» Ŭ·¡½º¸¦ È£ÃâÇÕ´Ï´Ù.
|
if( pMsg->message == WM_KEYDOWN )
|
{
|
if(pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE )
|
{
|
::TranslateMessage(pMsg);
|
::DispatchMessage(pMsg);
|
return TRUE;
|
}
|
}
|
|
return CDialog::PreTranslateMessage(pMsg);
|
}
|
|
void CDlgSystemCamera::OnBnClickedButtonSysSystemCameraReset()
|
{
|
// TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù.
|
ResetCameraInfoGrid();
|
}
|
|
void CDlgSystemCamera::OnBnClickedButtonSysSystemCameraApply()
|
{
|
// TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù.
|
UpdateData(TRUE);
|
|
CReviewSystemSettingDlg* pDlg = (CReviewSystemSettingDlg*)AfxGetMainWnd();
|
if (pDlg==NULL) return;
|
|
CHeaderInfo *pHeaderInfo = pDlg->GetSys_HeaderInfo(m_nGantryIdx, m_nHeaderIdx);
|
if (pHeaderInfo==NULL) return;
|
|
int nColIdx = 1;
|
int nCameraCount = pHeaderInfo->GetCameraInfoCount();
|
CStringArray strArrayOption;
|
CString strItemText = _T("");
|
CString strTemp = _T("");
|
for(int i=0; i<nCameraCount; i++)
|
{
|
int nRowIdx = 1;
|
CCameraControlInfo_Plus *pCameraInfo = pHeaderInfo->GetCameraInfo(i);
|
if (pCameraInfo==NULL) continue;
|
|
// 1.Total Index
|
strItemText = m_ctrlGridCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraInfo->SetIndex(_ttoi(strItemText));
|
|
// 2. Name
|
nRowIdx++;
|
strItemText = m_ctrlGridCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraInfo->SetName(strItemText);
|
|
// 3. ±âÁØ Ä«¸Þ¶ó
|
nRowIdx++;
|
CGridCellCheck *pCellCheck = (CGridCellCheck*)m_ctrlGridCameraInfo.GetCell(nRowIdx, nColIdx);
|
if(pCellCheck)
|
{
|
pCameraInfo->SetStandardCamera(pCellCheck->GetCheck());
|
}
|
|
// 4. Ä«¸Þ¶ó ¶óÀ̺귯¸® ŸÀÔ
|
nRowIdx++;
|
CGridCellCombo *pCellCombo = (CGridCellCombo*)m_ctrlGridCameraInfo.GetCell(nRowIdx, nColIdx);
|
if(pCellCombo)
|
{
|
strArrayOption.RemoveAll();
|
strItemText = pCellCombo->GetText();
|
pCellCombo->GetOptions(strArrayOption);
|
int nArrayCount = (int)strArrayOption.GetCount();
|
|
for(int j=0; j<nArrayCount; j++)
|
{
|
strTemp = strArrayOption.GetAt(j);
|
if(strTemp.Compare(strItemText) == 0)
|
{
|
pCameraInfo->SetLibraryType(j);
|
break;
|
}
|
}
|
}
|
|
// 5. Ä«¸Þ¶ó Çø³ ŸÀÔ
|
nRowIdx++;
|
pCellCombo = (CGridCellCombo*)m_ctrlGridCameraInfo.GetCell(nRowIdx, nColIdx);
|
if(pCellCombo)
|
{
|
strArrayOption.RemoveAll();
|
strItemText = pCellCombo->GetText();
|
pCellCombo->GetOptions(strArrayOption);
|
int nArrayCount = (int)strArrayOption.GetCount();
|
|
for(int j=0; j<nArrayCount; j++)
|
{
|
strTemp = strArrayOption.GetAt(j);
|
if(strTemp.Compare(strItemText) == 0)
|
{
|
pCameraInfo->SetFlipType(j);
|
break;
|
}
|
}
|
}
|
// 6.Camera Connect Port
|
nRowIdx++;
|
strItemText = m_ctrlGridCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraInfo->SetConnectionPort(strItemText);
|
|
// 7. Ä«¸Þ¶ó ±×·¡¹ö À妽º
|
nRowIdx++;
|
strItemText = m_ctrlGridCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraInfo->SetGrabberIndex(_ttoi(strItemText));
|
|
// 8. Ä«¸Þ¶ó ä³Î À妽º
|
nRowIdx++;
|
strItemText = m_ctrlGridCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraInfo->SetChannelIndex(_ttoi(strItemText));
|
|
// 9. Ä«¸Þ¶ó ÇÁ·¹ÀÓ °³¼ö
|
nRowIdx++;
|
strItemText = m_ctrlGridCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraInfo->SetFrameCount(_ttoi(strItemText));
|
|
// 10. Ä«¸Þ¶ó ÇÁ·¹ÀÓ ³ÐÀÌ
|
nRowIdx++;
|
strItemText = m_ctrlGridCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraInfo->SetFrameWidth(_ttoi(strItemText));
|
|
// 11. Ä«¸Þ¶ó ÇÁ·¹ÀÓ ³ôÀÌ
|
nRowIdx++;
|
strItemText = m_ctrlGridCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraInfo->SetFrameHeight(_ttoi(strItemText));
|
|
// 12. Ä«¸Þ¶ó À̹ÌÁö ¹öÆÛ °³¼ö
|
nRowIdx++;
|
strItemText = m_ctrlGridCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraInfo->SetImageBufferCount(_ttoi(strItemText));
|
|
// 13. Ä«¸Þ¶ó ÇØ»óµµ
|
nRowIdx++;
|
strItemText = m_ctrlGridCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraInfo->SetPixelResolution(_tcstod(strItemText, NULL));
|
|
// 14. Ä«¸Þ¶ó XÃà ¹æÇâ
|
nRowIdx++;
|
pCellCombo = (CGridCellCombo*)m_ctrlGridCameraInfo.GetCell(nRowIdx, nColIdx);
|
|
if(pCellCombo)
|
{
|
strArrayOption.RemoveAll();
|
strItemText = pCellCombo->GetText();
|
pCellCombo->GetOptions(strArrayOption);
|
int nArrayCount = (int)strArrayOption.GetCount();
|
|
for(int j=0; j<nArrayCount; j++)
|
{
|
strTemp = strArrayOption.GetAt(j);
|
if(strTemp.Compare(strItemText) == 0)
|
{
|
pCameraInfo->SetAxisDirectionX(j);
|
break;
|
}
|
}
|
}
|
|
// 15. Ä«¸Þ¶ó YÃà ¹æÇâ
|
nRowIdx++;
|
pCellCombo = (CGridCellCombo*)m_ctrlGridCameraInfo.GetCell(nRowIdx, nColIdx);
|
if(pCellCombo)
|
{
|
strArrayOption.RemoveAll();
|
strItemText = pCellCombo->GetText();
|
pCellCombo->GetOptions(strArrayOption);
|
int nArrayCount = (int)strArrayOption.GetCount();
|
for(int j=0; j<nArrayCount; j++)
|
{
|
strTemp = strArrayOption.GetAt(j);
|
if(strTemp.Compare(strItemText) == 0)
|
{
|
pCameraInfo->SetAxisDirectionY(j);
|
break;
|
}
|
}
|
}
|
|
// 16. Ä«¸Þ¶ó°£ °Å¸® X
|
nRowIdx++;
|
strItemText = m_ctrlGridCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraInfo->SetCameraDistanceX(_tcstod(strItemText, NULL));
|
|
// 17. Ä«¸Þ¶ó°£ °Å¸® Y
|
nRowIdx++;
|
strItemText = m_ctrlGridCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraInfo->SetCameraDistanceY(_tcstod(strItemText, NULL));
|
|
// 18. Ä«¸Þ¶ó ¿É¼Â X
|
nRowIdx++;
|
strItemText = m_ctrlGridCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraInfo->SetCameraOffsetX(_tcstod(strItemText, NULL));
|
|
// 19. Ä«¸Þ¶ó ¿É¼Â Y
|
nRowIdx++;
|
strItemText = m_ctrlGridCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraInfo->SetCameraOffsetY(_tcstod(strItemText, NULL));
|
|
// 20. Ä«¸Þ¶ó Gain R
|
nRowIdx++;
|
strItemText = m_ctrlGridCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraInfo->SetGainRed(_tcstod(strItemText, NULL));
|
|
// 21. Ä«¸Þ¶ó Gain G
|
nRowIdx++;
|
strItemText = m_ctrlGridCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraInfo->SetGainGreen(_tcstod(strItemText, NULL));
|
|
// 22. Ä«¸Þ¶ó Gain G
|
nRowIdx++;
|
strItemText = m_ctrlGridCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraInfo->SetGainBlue(_tcstod(strItemText, NULL));
|
|
// 23. Camera Frame Channel
|
nRowIdx++;
|
strItemText = m_ctrlGridCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraInfo->SetFrameChannels(_ttoi(strItemText));
|
|
// 24. Camera Grab Count
|
nRowIdx++;
|
strItemText = m_ctrlGridCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraInfo->SetGrabCount(_ttoi(strItemText));
|
|
// 25.FFC File Name
|
// nRowIdx++;
|
// strItemText = m_ctrlGridCameraInfo.GetItemText(nRowIdx, nColIdx);
|
// pCameraInfo->SetFfcFilename(strItemText);
|
|
nColIdx++;
|
}
|
}
|
|
void CDlgSystemCamera::InitCameraInfoGridControl()
|
{
|
int nRowIdx, nColIdx, nRows, nCols, nFixRows, nFixCols;
|
CString strTemp;
|
|
nRows = CAMERA_INFO_GRID_ROW_COUNT;
|
nCols = m_nCameraCount + 1;
|
nFixRows = 1;
|
nFixCols = 1;
|
nRowIdx = 0;
|
nColIdx = 0;
|
|
m_ctrlGridCameraInfo.GetDefaultCell(FALSE, FALSE)->SetBackClr(RGB(0xFF, 0xFF, 0xE0));
|
m_ctrlGridCameraInfo.SetRowCount(nRows);
|
m_ctrlGridCameraInfo.SetColumnCount(nCols);
|
m_ctrlGridCameraInfo.SetFixedRowCount(nFixRows);
|
m_ctrlGridCameraInfo.SetFixedColumnCount(nFixCols);
|
|
GV_ITEM Item;
|
|
Item.mask = GVIF_TEXT;
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Camera Index")); //_T("Ä«¸Þ¶ó À妽º"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Total Index")); //_T("Total Index"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Camera Name")); //_T("Ä«¸Þ¶ó À̸§"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Standard Camera")); //_T("±âÁØ Ä«¸Þ¶ó"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Library Type")); //_T("Ä«¸Þ¶ó ¶óÀ̺귯¸® ŸÀÔ"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Flip Type")); //_T("Ä«¸Þ¶ó Çø³ ŸÀÔ"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("CCF File Path")); //_T("Ä«¸Þ¶ó ¿¬°á Á¤º¸")
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Grabber Index")); //_T("Ä«¸Þ¶ó ±×·¡¹ö À妽º"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Channel Index")); //_T("Ä«¸Þ¶ó ±×·¡¹ö ä³Î À妽º"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Frame Count (f/s)")); //_T("Ä«¸Þ¶ó ÇÁ·¹ÀÓ °³¼ö"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Frame Width (pxl)")); //_T("Ä«¸Þ¶ó ÇÁ·¹ÀÓ ³ÐÀÌ(pixel)"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Frame Hight (pxl)")); //_T("Ä«¸Þ¶ó ÇÁ·¹ÀÓ ³ôÀÌ(pixel)"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Image Buffer Count")); //_T("À̹ÌÁö ¹öÆÛ °³¼ö"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Resolution (um/pxl)")); //_T("Ä«¸Þ¶ó ÇØ»óµµ"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("X Axis Direction")); //_T("Ä«¸Þ¶ó XÃà ¹æÇâ"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Y Axis Direction")); //_T("Ä«¸Þ¶ó YÃà ¹æÇâ"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Camera Distance_X(mm)")); //_T("Ä«¸Þ¶ó°£ °Å¸® X(mm)"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Camera Distance_Y(mm)")); //_T("Ä«¸Þ¶ó°£ °Å¸® Y(mm)"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Camera Offset_X(mm)")); //_T("XÃà Ä«¸Þ¶ó ¿É¼Â(mm)"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Camera Offset_Y(mm)")); //_T("YÃà Ä«¸Þ¶ó ¿É¼Â(mm)"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Camera Gain R")); //_T("Ä«¸Þ¶ó °ÔÀÎ R"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Camera Gain G")); //_T("Ä«¸Þ¶ó °ÔÀÎ G"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Camera Gain B")); //_T("Ä«¸Þ¶ó °ÔÀÎ B"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
// Camera Frame Channel
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Frame Channel (Color)")); //_T("Ä«¸Þ¶ó ÇÁ·¹ÀÓ Ã¤³Î"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
// Camera Grab Count
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Grab Count")); //_T("Ä«¸Þ¶ó ±×·¦ °³¼ö"));
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
// FFC File Name
|
// Item.row = nRowIdx++;
|
// Item.col = nColIdx;
|
// strTemp.Format(_T("FFC File Name")); //_T("Camera Connect Port"));
|
// Item.strText = strTemp;
|
// m_ctrlGridCameraInfo.SetItem(&Item);
|
|
m_ctrlGridCameraInfo.AutoSize();
|
}
|
|
void CDlgSystemCamera::FillCameraInfo()
|
{
|
ChangeCameraCountCameraInfoGridControl();
|
|
CReviewSystemSettingDlg* pDlg = (CReviewSystemSettingDlg*)AfxGetMainWnd();
|
if (pDlg==NULL) return;
|
|
CHeaderInfo *pHeaderInfo = pDlg->GetSys_HeaderInfo(m_nGantryIdx, m_nHeaderIdx);
|
if (pHeaderInfo==NULL) return;
|
|
CGridCellCheck* pCellCheck = NULL;
|
CGridCellCombo* pCellCombo = NULL;
|
CStringArray strArrayOption;
|
CString strItemText = _T("");
|
|
int nColIdx = 1;
|
int nCameraCount = pHeaderInfo->GetCameraInfoCount();
|
for(int i=0; i<nCameraCount; i++)
|
{
|
int nRowIdx = 1;
|
|
CCameraControlInfo_Plus *pCameraInfo = pHeaderInfo->GetCameraInfo(i);
|
if (pCameraInfo==NULL) continue;
|
|
// 1.Total Index
|
strItemText.Format(_T("%d"), pCameraInfo->GetIndex());
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// 2. Camera Name
|
nRowIdx++;
|
strItemText.Format(_T("%s"), pCameraInfo->GetName());
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// 3. ±âÁØ Ä«¸Þ¶ó
|
nRowIdx++;
|
pCellCheck = (CGridCellCheck*)m_ctrlGridCameraInfo.GetCell(nRowIdx, nColIdx);
|
if(pCellCheck)
|
{
|
pCellCheck->SetCheck(pCameraInfo->GetStandardCamera());
|
}
|
|
// 4. Ä«¸Þ¶ó ¶óÀ̺귯¸® ŸÀÔ
|
nRowIdx++;
|
pCellCombo = (CGridCellCombo*)m_ctrlGridCameraInfo.GetCell(nRowIdx, nColIdx);
|
if(pCellCombo)
|
{
|
strArrayOption.RemoveAll();
|
pCellCombo->GetOptions(strArrayOption);
|
if(strArrayOption.GetSize() > 0 && pCameraInfo->GetLibraryType() > -1)
|
{
|
strItemText = strArrayOption.GetAt(pCameraInfo->GetLibraryType());
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
}
|
}
|
|
// 5. Ä«¸Þ¶ó Çø³ ŸÀÔ
|
nRowIdx++;
|
pCellCombo = (CGridCellCombo*)m_ctrlGridCameraInfo.GetCell(nRowIdx, nColIdx);
|
if(pCellCombo)
|
{
|
strArrayOption.RemoveAll();
|
pCellCombo->GetOptions(strArrayOption);
|
|
if(strArrayOption.GetSize() > 0 && pCameraInfo->GetFlipType() > -1)
|
{
|
strItemText = strArrayOption.GetAt(pCameraInfo->GetFlipType());
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
}
|
}
|
|
// 6. Ä«¸Þ¶ó ¿¬°á Á¤º¸
|
nRowIdx++;
|
strItemText.Format(_T("%s"), pCameraInfo->GetConnectionPort());
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// 7. Ä«¸Þ¶ó ±×·¡¹ö À妽º
|
nRowIdx++;
|
strItemText.Format(_T("%d"), pCameraInfo->GetGrabberIndex());
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// 8. Ä«¸Þ¶ó ±×·¡¹ö ä³Î À妽º
|
nRowIdx++;
|
strItemText.Format(_T("%d"), pCameraInfo->GetChannelIndex());
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// 9. Ä«¸Þ¶ó ÇÁ·¹ÀÓ °³¼ö
|
nRowIdx++;
|
strItemText.Format(_T("%d"), pCameraInfo->GetFrameCount());
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// 10. Ä«¸Þ¶ó ÇÁ·¹ÀÓ ³ÐÀÌ
|
nRowIdx++;
|
strItemText.Format(_T("%d"), pCameraInfo->GetFrameWidth());
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// 11. Ä«¸Þ¶ó ÇÁ·¹ÀÓ ³ôÀÌ
|
nRowIdx++;
|
strItemText.Format(_T("%d"), pCameraInfo->GetFrameHeight());
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// 12. Ä«¸Þ¶ó À̹ÌÁö ¹öÆÛ °³¼ö
|
nRowIdx++;
|
strItemText.Format(_T("%d"), pCameraInfo->GetImageBufferCount());
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// 13. Ä«¸Þ¶ó ÇØ»óµµ
|
nRowIdx++;
|
strItemText.Format(_T("%.08lf"), pCameraInfo->GetPixelResolution());
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// 14. Ä«¸Þ¶ó XÃà ¹æÇâ
|
nRowIdx++;
|
pCellCombo = (CGridCellCombo*)m_ctrlGridCameraInfo.GetCell(nRowIdx, nColIdx);
|
if(pCellCombo)
|
{
|
strArrayOption.RemoveAll();
|
pCellCombo->GetOptions(strArrayOption);
|
|
if(strArrayOption.GetSize() > 0 && pCameraInfo->GetAxisDirectionX() > -1)
|
{
|
strItemText = strArrayOption.GetAt(pCameraInfo->GetAxisDirectionX());
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
}
|
}
|
|
// 15. Ä«¸Þ¶ó YÃà ¹æÇâ
|
nRowIdx++;
|
pCellCombo = (CGridCellCombo*)m_ctrlGridCameraInfo.GetCell(nRowIdx, nColIdx);
|
if(pCellCombo)
|
{
|
strArrayOption.RemoveAll();
|
pCellCombo->GetOptions(strArrayOption);
|
|
if(strArrayOption.GetSize() > 0 && pCameraInfo->GetAxisDirectionY() > -1)
|
{
|
strItemText = strArrayOption.GetAt(pCameraInfo->GetAxisDirectionY());
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
}
|
}
|
|
// 16. Ä«¸Þ¶ó°£ °Å¸® X
|
nRowIdx++;
|
strItemText.Format(_T("%.03lf"), pCameraInfo->GetCameraDistanceX());
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// 17. Ä«¸Þ¶ó°£ °Å¸® Y
|
nRowIdx++;
|
strItemText.Format(_T("%.03lf"), pCameraInfo->GetCameraDistanceY());
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// 18. Ä«¸Þ¶ó ¿É¼Â X
|
nRowIdx++;
|
strItemText.Format(_T("%.03lf"), pCameraInfo->GetCameraOffsetX());
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// 19. Ä«¸Þ¶ó ¿É¼Â Y
|
nRowIdx++;
|
strItemText.Format(_T("%.03lf"), pCameraInfo->GetCameraOffsetY());
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// 20. Ä«¸Þ¶ó Gain R
|
nRowIdx++;
|
strItemText.Format(_T("%.3lf"), pCameraInfo->GetGainRed());
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// 21. Ä«¸Þ¶ó Gain G
|
nRowIdx++;
|
strItemText.Format(_T("%.3lf"), pCameraInfo->GetGainGreen());
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// 22. Ä«¸Þ¶ó Gain G
|
nRowIdx++;
|
strItemText.Format(_T("%.3lf"), pCameraInfo->GetGainBlue());
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// 23. Camera Frame Channel
|
nRowIdx++;
|
strItemText.Format(_T("%d"),pCameraInfo->GetFrameChannels());
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// 24. Camera Grab Count
|
nRowIdx++;
|
strItemText.Format(_T("%d"),pCameraInfo->GetGrabCount());
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// 25.FFC File Name
|
// nRowIdx++;
|
// strItemText.Format(_T("%s"),pCameraInfo->GetFfcFilename());
|
// m_ctrlGridCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
nColIdx++;
|
}
|
}
|
|
void CDlgSystemCamera::ChangeCameraCountCameraInfoGridControl()
|
{
|
int i, j, nRowIdx, nColIdx;
|
int nWidth, nMargin, nDataColumnWidth;
|
CString strTemp;
|
CRect rect;
|
m_ctrlGridCameraInfo.GetWindowRect(&rect);
|
m_ctrlGridCameraInfo.SetColumnCount(m_nCameraCount + 1);
|
nWidth = m_ctrlGridCameraInfo.GetColumnWidth(0);
|
|
nMargin = 22;
|
nDataColumnWidth = rect.Width() - nWidth - nMargin;
|
|
if(m_nCameraCount > 0)
|
{
|
GV_ITEM Item;
|
CStringArray strArrayOption;
|
CGridCellCombo* pCellCombo = NULL;
|
nColIdx = 1;
|
nDataColumnWidth = nDataColumnWidth / m_nCameraCount;
|
|
for(i = 0; i < m_nCameraCount; i++)
|
{
|
m_ctrlGridCameraInfo.SetColumnWidth(i + 1, nDataColumnWidth);
|
|
//Ä«¸Þ¶ó À妽º
|
nRowIdx = 0;
|
Item.mask = GVIF_TEXT;
|
Item.row = nRowIdx;
|
Item.col = nColIdx;
|
strTemp.Format(_T("%02d"), i);
|
Item.strText = strTemp;
|
m_ctrlGridCameraInfo.SetItem(&Item);
|
|
// 1.Total Index
|
nRowIdx++;
|
// 2. Camera Name
|
nRowIdx++;
|
|
// 3. ±âÁØ Ä«¸Þ¶ó
|
nRowIdx++;
|
Item.strText = _T("");
|
m_ctrlGridCameraInfo.SetCellType(nRowIdx, nColIdx, RUNTIME_CLASS(CGridCellCheck));
|
m_ctrlGridCameraInfo.SetItemState(nRowIdx, nColIdx, m_ctrlGridCameraInfo.GetItemState(nRowIdx, nColIdx) | GVIS_READONLY);
|
|
// 4. Ä«¸Þ¶ó ¶óÀ̺귯¸® ŸÀÔ
|
nRowIdx++;
|
strArrayOption.RemoveAll();
|
for(j = 0; j < CameraLibrary_Count; j++)
|
{
|
switch(j)
|
{
|
case CameraLibrary_Simulation:
|
strTemp.Format(_T("Simulation"));
|
break;
|
case CameraLibrary_Sapera:
|
strTemp.Format(_T("Sapera"));
|
break;
|
case CameraLibrary_FlyCapture:
|
strTemp.Format(_T("FlyCapture"));
|
break;
|
case CameraLibrary_JAI:
|
strTemp.Format(_T("JAI"));
|
break;
|
case CameraLibrary_Baumer:
|
strTemp.Format(_T("Baumer"));
|
break;
|
case CAMERA_LIBRARY_PYLON:
|
strTemp.Format(_T("Pylon"));
|
break;
|
default:
|
strTemp.Format(_T(""));
|
break;
|
}
|
|
strArrayOption.Add(strTemp);
|
}
|
m_ctrlGridCameraInfo.SetCellType(nRowIdx, nColIdx, RUNTIME_CLASS(CGridCellCombo));
|
pCellCombo = (CGridCellCombo*)m_ctrlGridCameraInfo.GetCell(nRowIdx, nColIdx);
|
pCellCombo->SetOptions(strArrayOption);
|
pCellCombo->SetStyle(CBS_DROPDOWN);
|
|
// 5. Ä«¸Þ¶ó Çø³ ŸÀÔ
|
nRowIdx++;
|
strArrayOption.RemoveAll();
|
for(j = 0; j < CAMERA_FLIP_TYPE_COUNT; j++)
|
{
|
switch(j)
|
{
|
case CAMERA_FLIP_NONE :
|
strTemp.Format(_T("None"));
|
break;
|
case CAMERA_FLIP_VERT :
|
strTemp.Format(_T("Vertical"));
|
break;
|
case CAMERA_FLIP_HORIZ:
|
strTemp.Format(_T("Horizontal"));
|
break;
|
case CAMERA_FLIP_VERT+CAMERA_FLIP_HORIZ :
|
strTemp.Format(_T("Both"));
|
break;
|
default:
|
strTemp.Format(_T(""));
|
break;
|
}
|
|
strArrayOption.Add(strTemp);
|
}
|
m_ctrlGridCameraInfo.SetCellType(nRowIdx, nColIdx, RUNTIME_CLASS(CGridCellCombo));
|
pCellCombo = (CGridCellCombo*)m_ctrlGridCameraInfo.GetCell(nRowIdx, nColIdx);
|
pCellCombo->SetOptions(strArrayOption);
|
pCellCombo->SetStyle(CBS_DROPDOWN);
|
|
// 6. Ä«¸Þ¶ó ¿¬°á Á¤º¸
|
nRowIdx++;
|
// 7. Ä«¸Þ¶ó ±×·¡¹ö À妽º
|
nRowIdx++;
|
// 8. Ä«¸Þ¶ó ±×·¡¹ö ä³Î À妽º
|
nRowIdx++;
|
// 9. Ä«¸Þ¶ó ÇÁ·¹ÀÓ °³¼ö
|
nRowIdx++;
|
// 10. Ä«¸Þ¶ó ÇÁ·¹ÀÓ ³ÐÀÌ
|
nRowIdx++;
|
// 11. Ä«¸Þ¶ó ÇÁ·¹ÀÓ ³ôÀÌ
|
nRowIdx++;
|
// 12. Ä«¸Þ¶ó À̹ÌÁö ¹öÆÛ °³¼ö
|
nRowIdx++;
|
// 13. Ä«¸Þ¶ó ÇØ»óµµ
|
nRowIdx++;
|
|
// 14. Ä«¸Þ¶ó XÃà ¹æÇâ
|
nRowIdx++;
|
strArrayOption.RemoveAll();
|
for(j = 0; j < CAMERA_DIRECTION_COUNT; j++)
|
{
|
switch(j)
|
{
|
case CAMERA_DIRECTION_FORWARD:
|
strTemp.Format(_T("Nomal Direction"));//_T("Á¤¹æÇâ"));
|
break;
|
case CAMERA_DIRECTION_BACKWARD:
|
strTemp.Format(_T("Reverse Direction"));//_T("¿ª¹æÇâ"));
|
break;
|
default:
|
strTemp.Format(_T(""));
|
break;
|
}
|
|
strArrayOption.Add(strTemp);
|
}
|
m_ctrlGridCameraInfo.SetCellType(nRowIdx, nColIdx, RUNTIME_CLASS(CGridCellCombo));
|
pCellCombo = (CGridCellCombo*)m_ctrlGridCameraInfo.GetCell(nRowIdx, nColIdx);
|
pCellCombo->SetOptions(strArrayOption);
|
pCellCombo->SetStyle(CBS_DROPDOWN);
|
|
// 15. Ä«¸Þ¶ó YÃà ¹æÇâ
|
nRowIdx++;
|
strArrayOption.RemoveAll();
|
for(j = 0; j < CAMERA_DIRECTION_COUNT; j++)
|
{
|
switch(j)
|
{
|
case CAMERA_DIRECTION_FORWARD:
|
strTemp.Format(_T("Nomal Direction"));//_T("Á¤¹æÇâ"));
|
break;
|
case CAMERA_DIRECTION_BACKWARD:
|
strTemp.Format(_T("Reverse Direction"));//_T("¿ª¹æÇâ"));
|
break;
|
default:
|
strTemp.Format(_T(""));
|
break;
|
}
|
|
strArrayOption.Add(strTemp);
|
}
|
m_ctrlGridCameraInfo.SetCellType(nRowIdx, nColIdx, RUNTIME_CLASS(CGridCellCombo));
|
pCellCombo = (CGridCellCombo*)m_ctrlGridCameraInfo.GetCell(nRowIdx, nColIdx);
|
pCellCombo->SetOptions(strArrayOption);
|
pCellCombo->SetStyle(CBS_DROPDOWN);
|
|
// WSI »ç¿ëÀ¯¹«
|
// nRowIdx += 12;
|
// Item.strText = _T("");
|
// m_ctrlGridCameraInfo.SetCellType(nRowIdx, nColIdx, RUNTIME_CLASS(CGridCellCheck));
|
// m_ctrlGridCameraInfo.SetItemState(nRowIdx, nColIdx, m_ctrlGridCameraInfo.GetItemState(nRowIdx, nColIdx) | GVIS_READONLY);
|
|
nColIdx++;
|
}
|
}
|
}
|
|
void CDlgSystemCamera::ResetCameraInfoGrid()
|
{
|
int i, j, nRowIdx, nColIdx;
|
CString strItemText;
|
CGridCellCheck* pCellCheck = NULL;
|
|
nRowIdx = 0;
|
nColIdx = 0;
|
strItemText = _T("");
|
|
for(i = 0; i < m_nCameraCount; i++)
|
{
|
nRowIdx = 1;
|
nColIdx++;
|
|
for(j = 0; j < CAMERA_INFO_GRID_ROW_COUNT - 1; j++)
|
{
|
switch (j)
|
{
|
case 0:
|
pCellCheck = (CGridCellCheck*)m_ctrlGridCameraInfo.GetCell(nRowIdx++, nColIdx);
|
if(pCellCheck)
|
{
|
pCellCheck->SetCheck(FALSE);
|
}
|
break;
|
default:
|
m_ctrlGridCameraInfo.SetItemText(nRowIdx++, nColIdx, strItemText);
|
break;
|
}
|
}
|
}
|
|
m_ctrlGridCameraInfo.Invalidate(FALSE);
|
}
|
|
void CDlgSystemCamera::UpdateDialogData(int nGantryIdx, int nHeaderIdx, int nCameraCount)
|
{
|
m_nGantryIdx = nGantryIdx;
|
m_nHeaderIdx = nHeaderIdx;
|
m_nCameraCount = nCameraCount;
|
|
UpdateData(FALSE);
|
FillCameraInfo();
|
m_ctrlGridCameraInfo.Invalidate(FALSE);
|
}
|