// DlgAlign.cpp : ���� �����Դϴ�.
|
//
|
|
#include "stdafx.h"
|
#include "ReviewSystemSetting.h"
|
#include "DlgAlign.h"
|
#include "ReviewSystemSettingDlg.h"
|
#include "CHReviewSetting/Sys_AlignManager.h"
|
#include "CHReviewSetting/SystemInfo.h"
|
|
// CDlgAlign ��ȭ �����Դϴ�.
|
|
IMPLEMENT_DYNAMIC(CDlgAlign, CDialog)
|
|
CDlgAlign::CDlgAlign(CWnd* pParent /*=NULL*/)
|
: CDialog(CDlgAlign::IDD, pParent)
|
{
|
|
}
|
|
CDlgAlign::~CDlgAlign()
|
{
|
}
|
|
void CDlgAlign::DoDataExchange(CDataExchange* pDX)
|
{
|
CDialog::DoDataExchange(pDX);
|
DDX_Control(pDX, IDC_GRID_ALIGN_CAMERA_INFO, m_ctrlGridAlignCameraInfo);
|
DDX_Control(pDX, IDC_AlignCamera_Frame_Apply, m_ctrlCheckAlignCameraFrameRateApply);
|
}
|
|
|
BEGIN_MESSAGE_MAP(CDlgAlign, CDialog)
|
ON_BN_CLICKED(IDC_BUTTON_SYS_ALIGN_RESET, &CDlgAlign::OnBnClickedButtonSysAlignReset)
|
ON_BN_CLICKED(IDC_BUTTON_SYS_ALIGN_APPLY, &CDlgAlign::OnBnClickedButtonSysAlignApply)
|
END_MESSAGE_MAP()
|
|
|
// CDlgAlign ���� ó�����Դϴ�.
|
|
BOOL CDlgAlign::OnInitDialog()
|
{
|
CDialog::OnInitDialog();
|
|
// TODO: ��� �߰� �ʱ�ȭ �۾��� �߰��մϴ�.
|
InitAlignCameraInfoGridControl();
|
FillAlignCameraInfo();
|
|
return TRUE; // return TRUE unless you set the focus to a control
|
// ����: OCX �Ӽ� �������� FALSE�� ��ȯ�ؾ� �մϴ�.
|
}
|
|
BOOL CDlgAlign::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 CDlgAlign::OnBnClickedButtonSysAlignReset()
|
{
|
// TODO: ��� ��Ʈ�� �˸� ó���� �ڵ带 �߰��մϴ�.
|
ResetAlignCameraInfoGrid();
|
}
|
|
void CDlgAlign::OnBnClickedButtonSysAlignApply()
|
{
|
// TODO: ��� ��Ʈ�� �˸� ó���� �ڵ带 �߰��մϴ�.
|
UpdateData(TRUE);
|
|
int i, j, nArrayCount = 0;
|
CString strTemp = _T("");
|
|
CReviewSystemSettingDlg* pDlg = (CReviewSystemSettingDlg*)AfxGetMainWnd();
|
if (pDlg==NULL) return;
|
|
CSys_AlignManager *pSysAlignManager = pDlg->GetAlignManager();
|
if (pSysAlignManager==NULL) return;
|
|
//CAlignCameraInfo cameraInfo;
|
CStringArray strArrayOption;
|
|
int nColIdx = 1;
|
pSysAlignManager->SetAlignCameraInfoCount(ALIGN_CAMERA_COUNT);
|
|
for (i=0; i<ALIGN_CAMERA_COUNT; i++)
|
{
|
int nRowIdx = 0;
|
|
CAlignCameraInfo *pAlignCameraInfo = pSysAlignManager->GetAlignCameraInfo(i);
|
if (pAlignCameraInfo==NULL) continue;
|
|
if(m_ctrlCheckAlignCameraFrameRateApply.GetCheck()){
|
pAlignCameraInfo->SetAlignCameraFrameRateApply(TRUE);
|
}
|
else{
|
pAlignCameraInfo->SetAlignCameraFrameRateApply(FALSE);
|
}
|
|
CCameraControlInfo_Plus* pCameraControlInfo = pAlignCameraInfo->GetCameraControlInfo();
|
if(pCameraControlInfo == NULL) continue;
|
|
//////////////////////////////////////////////////////////////////////////
|
// ī�� �ε���
|
CString strItemText = m_ctrlGridAlignCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraControlInfo->SetIndex(_ttoi(strItemText));
|
|
// ���� �
|
nRowIdx++;
|
CGridCellCheck *pCellCheck = (CGridCellCheck*)m_ctrlGridAlignCameraInfo.GetCell(nRowIdx, nColIdx);
|
if(pCellCheck)
|
{
|
pCameraControlInfo->SetStandardCamera(pCellCheck->GetCheck());
|
}
|
|
// ī�� ���̺귯�� Ÿ��
|
nRowIdx++;
|
CGridCellCombo* pCellCombo = (CGridCellCombo*)m_ctrlGridAlignCameraInfo.GetCell(nRowIdx, nColIdx);
|
if(pCellCombo)
|
{
|
strArrayOption.RemoveAll();
|
LPCTSTR strItemText = pCellCombo->GetText();
|
pCellCombo->GetOptions(strArrayOption);
|
nArrayCount = (int)strArrayOption.GetCount();
|
|
for(j = 0; j < nArrayCount; j++)
|
{
|
strTemp = strArrayOption.GetAt(j);
|
if(strTemp.Compare(strItemText) == 0)
|
{
|
//cameraInfo.m_nCameraLibraryType = j;
|
pCameraControlInfo->SetLibraryType(j);
|
break;
|
}
|
}
|
}
|
|
// ī�� �ø� Ÿ��
|
nRowIdx++;
|
pCellCombo = (CGridCellCombo*)m_ctrlGridAlignCameraInfo.GetCell(nRowIdx, nColIdx);
|
if(pCellCombo)
|
{
|
strArrayOption.RemoveAll();
|
LPCTSTR strItemText = pCellCombo->GetText();
|
pCellCombo->GetOptions(strArrayOption);
|
nArrayCount = (int)strArrayOption.GetCount();
|
for(j = 0; j < nArrayCount; j++)
|
{
|
strTemp = strArrayOption.GetAt(j);
|
if(strTemp.Compare(strItemText) == 0)
|
{
|
pCameraControlInfo->SetFlipType(j);
|
break;
|
}
|
}
|
}
|
|
// ī�� �̸�
|
nRowIdx++;
|
strItemText = m_ctrlGridAlignCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraControlInfo->SetName(strItemText);
|
|
// � ���� ����
|
nRowIdx++;
|
strItemText = m_ctrlGridAlignCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraControlInfo->SetConnectionPort(strItemText);
|
|
// � ������ ����
|
nRowIdx++;
|
strItemText = m_ctrlGridAlignCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraControlInfo->SetFrameCount(_ttoi(strItemText));
|
|
// � ������ ����
|
nRowIdx++;
|
strItemText = m_ctrlGridAlignCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraControlInfo->SetFrameWidth(_ttoi(strItemText));
|
|
// � ������ ����
|
nRowIdx++;
|
strItemText = m_ctrlGridAlignCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraControlInfo->SetFrameHeight(_ttoi(strItemText));
|
|
// �̹��� ���� ����
|
nRowIdx++;
|
strItemText = m_ctrlGridAlignCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraControlInfo->SetImageBufferCount(_ttoi(strItemText));
|
|
// ī�� �ػ� (CCD)
|
nRowIdx++;
|
strItemText = m_ctrlGridAlignCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraControlInfo->SetPixelResolution(_tcstod(strItemText, NULL));
|
|
// ī�� �÷� ä�� (Depth : Gray 1)
|
nRowIdx++;
|
strItemText = m_ctrlGridAlignCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pCameraControlInfo->SetFrameChannels(_ttoi(strItemText));
|
|
// � X�� ����
|
nRowIdx++;
|
pCellCombo = (CGridCellCombo*)m_ctrlGridAlignCameraInfo.GetCell(nRowIdx, nColIdx);
|
|
if(pCellCombo)
|
{
|
strArrayOption.RemoveAll();
|
strItemText = pCellCombo->GetText();
|
pCellCombo->GetOptions(strArrayOption);
|
nArrayCount = (int)strArrayOption.GetCount();
|
|
for(j = 0; j < nArrayCount; j++)
|
{
|
strTemp = strArrayOption.GetAt(j);
|
if(strTemp.Compare(strItemText) == 0)
|
{
|
pCameraControlInfo->SetAxisDirectionX(j);
|
break;
|
}
|
}
|
}
|
|
// � Y�� ����
|
nRowIdx++;
|
pCellCombo = (CGridCellCombo*)m_ctrlGridAlignCameraInfo.GetCell(nRowIdx, nColIdx);
|
|
if(pCellCombo)
|
{
|
strArrayOption.RemoveAll();
|
strItemText = pCellCombo->GetText();
|
pCellCombo->GetOptions(strArrayOption);
|
nArrayCount = (int)strArrayOption.GetCount();
|
|
for(j = 0; j < nArrayCount; j++)
|
{
|
strTemp = strArrayOption.GetAt(j);
|
if(strTemp.Compare(strItemText) == 0)
|
{
|
pCameraControlInfo->SetAxisDirectionY(j);
|
break;
|
}
|
}
|
}
|
|
//////////////////////////////////////////////////////////////////////////
|
|
CLightControlInfo* pLightControlInfo = pAlignCameraInfo->GetLightContorlInfo();
|
if(pLightControlInfo == NULL) continue;
|
|
// ���� Ÿ��
|
nRowIdx++;
|
pCellCombo = (CGridCellCombo*)m_ctrlGridAlignCameraInfo.GetCell(nRowIdx, nColIdx);
|
if(pCellCombo)
|
{
|
strArrayOption.RemoveAll();
|
strItemText = pCellCombo->GetText();
|
pCellCombo->GetOptions(strArrayOption);
|
nArrayCount = (int)strArrayOption.GetCount();
|
for(j = 0; j < nArrayCount; j++)
|
{
|
strTemp = strArrayOption.GetAt(j);
|
if(strTemp.Compare(strItemText) == 0)
|
{
|
pLightControlInfo->SetControllerType(j);
|
break;
|
}
|
}
|
}
|
|
// ���� ��Ʈ
|
nRowIdx++;
|
strItemText = m_ctrlGridAlignCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pLightControlInfo->SetConnectionPort(strItemText);
|
|
// ������(Open/Close) ����
|
nRowIdx++;
|
strItemText = m_ctrlGridAlignCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pLightControlInfo->SetMaster(_ttoi(strItemText));
|
|
// ���� �
|
nRowIdx++;
|
strItemText = m_ctrlGridAlignCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pLightControlInfo->SetChannel(_ttoi(strItemText));
|
|
// ���� �⺻��
|
nRowIdx++;
|
strItemText = m_ctrlGridAlignCameraInfo.GetItemText(nRowIdx, nColIdx);
|
pLightControlInfo->SetDefaultValue(_ttoi(strItemText));
|
|
// � ������
|
nRowIdx++;
|
strItemText = m_ctrlGridAlignCameraInfo.GetItemText(nRowIdx, nColIdx);
|
BOOL nMode = FALSE;
|
if (_ttoi(strItemText) >= 2)
|
{
|
nMode = TRUE;
|
}
|
else if(_ttoi(strItemText)<-1)
|
{
|
nMode = FALSE;
|
}
|
else
|
{
|
nMode = _ttoi(strItemText);
|
}
|
pCameraControlInfo->SetCameraReverseX(nMode);
|
|
nColIdx++;
|
}
|
}
|
|
void CDlgAlign::InitAlignCameraInfoGridControl()
|
{
|
int i, j, nRowIdx, nColIdx, nRows, nCols, nFixRows, nFixCols;
|
int nWidth, nMargin, nDataColumnWidth;
|
CString strTemp;
|
CRect rect;
|
|
nRows = ALIGN_CAMERA_INFO_GRID_ROW_COUNT;
|
nCols = ALIGN_CAMERA_INFO_GRID_COL_COUNT;
|
nFixRows = 1;
|
nFixCols = 1;
|
nRowIdx = 0;
|
nColIdx = 0;
|
|
m_ctrlGridAlignCameraInfo.GetWindowRect(&rect);
|
m_ctrlGridAlignCameraInfo.GetDefaultCell(FALSE, FALSE)->SetBackClr(RGB(0xFF, 0xFF, 0xE0));
|
m_ctrlGridAlignCameraInfo.SetRowCount(nRows);
|
m_ctrlGridAlignCameraInfo.SetColumnCount(nCols);
|
m_ctrlGridAlignCameraInfo.SetFixedRowCount(nFixRows);
|
m_ctrlGridAlignCameraInfo.SetFixedColumnCount(nFixCols);
|
|
GV_ITEM Item;
|
CStringArray strArrayOption;
|
CGridCellCombo* pCellCombo = NULL;
|
|
//////////////////////////////////////////////////////////////////////////
|
Item.mask = GVIF_TEXT;
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Camera Index")); //_T("ī�� �ε���"));
|
Item.strText = strTemp;
|
m_ctrlGridAlignCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Standard Camera")); //_T("���� �"));
|
Item.strText = strTemp;
|
m_ctrlGridAlignCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Library Type")); //_T("ī�� ���̺귯��"));
|
Item.strText = strTemp;
|
m_ctrlGridAlignCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Flip Type")); //_T("ī�� �ø� Ÿ��"));
|
Item.strText = strTemp;
|
m_ctrlGridAlignCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Camera Name")); //_T("ī�� �̸�"));
|
Item.strText = strTemp;
|
m_ctrlGridAlignCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Connection Information")); //_T("ī�� ���� ����")); (�ø��� �ѹ�)
|
Item.strText = strTemp;
|
m_ctrlGridAlignCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Frame Count (f/s)")); //_T("� ������ ����"));
|
Item.strText = strTemp;
|
m_ctrlGridAlignCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Frame Width (pxl)")); //_T("� ������ ����"));
|
Item.strText = strTemp;
|
m_ctrlGridAlignCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Frame Height (pxl)")); //_T("� ������ ����"));
|
Item.strText = strTemp;
|
m_ctrlGridAlignCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Image Buffer Cnt (ea)")); //_T("�̹��� ���� ����"));
|
Item.strText = strTemp;
|
m_ctrlGridAlignCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Resolution (um/pxl)")); //_T("ī�� �ػ�"));
|
Item.strText = strTemp;
|
m_ctrlGridAlignCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Frame Channel (Color)")); //_T("ī�� �÷� ä��"));
|
Item.strText = strTemp;
|
m_ctrlGridAlignCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("X Axis Direction")); //_T("� X�� ����"));
|
Item.strText = strTemp;
|
m_ctrlGridAlignCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Y Axis Direction")); //_T("� Y�� ����"));
|
Item.strText = strTemp;
|
m_ctrlGridAlignCameraInfo.SetItem(&Item);
|
|
//////////////////////////////////////////////////////////////////////////
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Light Type")); //_T("���� Ÿ��"));
|
Item.strText = strTemp;
|
m_ctrlGridAlignCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Light Connection Port")); //_T("���� ��Ʈ"));
|
Item.strText = strTemp;
|
m_ctrlGridAlignCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Light Master")); //_T("������ ����"));
|
Item.strText = strTemp;
|
m_ctrlGridAlignCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Light Channel")); //_T("���� �"));
|
Item.strText = strTemp;
|
m_ctrlGridAlignCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Light Default Level")); //_T("���� �⺻��"));
|
Item.strText = strTemp;
|
m_ctrlGridAlignCameraInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Camera ReverseX Mode")); //_T("� ������ ���"));
|
Item.strText = strTemp;
|
m_ctrlGridAlignCameraInfo.SetItem(&Item);
|
|
m_ctrlGridAlignCameraInfo.AutoSize();
|
|
//////////////////////////////////////////////////////////////////////////
|
nColIdx = 1;
|
nMargin = 5;
|
nWidth = m_ctrlGridAlignCameraInfo.GetColumnWidth(0);
|
nDataColumnWidth = rect.Width() - nWidth - nMargin;
|
nDataColumnWidth = nDataColumnWidth / ALIGN_CAMERA_COUNT;
|
|
for(i = 0; i < ALIGN_CAMERA_COUNT; i++)
|
{
|
m_ctrlGridAlignCameraInfo.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_ctrlGridAlignCameraInfo.SetItem(&Item);
|
|
// ���� �
|
nRowIdx++;
|
Item.strText = _T("");
|
m_ctrlGridAlignCameraInfo.SetCellType(nRowIdx, nColIdx, RUNTIME_CLASS(CGridCellCheck));
|
m_ctrlGridAlignCameraInfo.SetItemState(nRowIdx, nColIdx, m_ctrlGridAlignCameraInfo.GetItemState(nRowIdx, nColIdx) | GVIS_READONLY);
|
|
// ī�� ���̺귯��
|
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 CAMERA_LIBRARY_PYLON:
|
strTemp.Format(_T("Pylon"));
|
break;
|
case CameraLibrary_JAI:
|
strTemp.Format(_T("JAI"));
|
break;
|
default:
|
strTemp.Format(_T(""));
|
break;
|
}
|
|
strArrayOption.Add(strTemp);
|
}
|
|
m_ctrlGridAlignCameraInfo.SetCellType(nRowIdx, nColIdx, RUNTIME_CLASS(CGridCellCombo));
|
pCellCombo = (CGridCellCombo*)m_ctrlGridAlignCameraInfo.GetCell(nRowIdx, nColIdx);
|
pCellCombo->SetOptions(strArrayOption);
|
pCellCombo->SetStyle(CBS_DROPDOWN);
|
|
// ī�� �ø� Ÿ��
|
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_ctrlGridAlignCameraInfo.SetCellType(nRowIdx, nColIdx, RUNTIME_CLASS(CGridCellCombo));
|
pCellCombo = (CGridCellCombo*)m_ctrlGridAlignCameraInfo.GetCell(nRowIdx, nColIdx);
|
pCellCombo->SetOptions(strArrayOption);
|
pCellCombo->SetStyle(CBS_DROPDOWN);
|
|
// ī�� �̸�
|
nRowIdx++;
|
// � ���� ����
|
nRowIdx++;
|
// � ������ ����
|
nRowIdx++;
|
// � ������ ����
|
nRowIdx++;
|
// � ������ ����
|
nRowIdx++;
|
// �̹��� ���� ����
|
nRowIdx++;
|
// ī�� �ػ�
|
nRowIdx++;
|
// ī�� �÷� ä��
|
nRowIdx++;
|
|
//� 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_ctrlGridAlignCameraInfo.SetCellType(nRowIdx, nColIdx, RUNTIME_CLASS(CGridCellCombo));
|
pCellCombo = (CGridCellCombo*)m_ctrlGridAlignCameraInfo.GetCell(nRowIdx, nColIdx);
|
pCellCombo->SetOptions(strArrayOption);
|
pCellCombo->SetStyle(CBS_DROPDOWN);
|
|
//� 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_ctrlGridAlignCameraInfo.SetCellType(nRowIdx, nColIdx, RUNTIME_CLASS(CGridCellCombo));
|
pCellCombo = (CGridCellCombo*)m_ctrlGridAlignCameraInfo.GetCell(nRowIdx, nColIdx);
|
pCellCombo->SetOptions(strArrayOption);
|
pCellCombo->SetStyle(CBS_DROPDOWN);
|
|
//////////////////////////////////////////////////////////////////////////
|
//���� Ÿ��
|
nRowIdx++;
|
strArrayOption.RemoveAll();
|
for(j = 0; j < LightController_Count; j++)
|
{
|
switch(j)
|
{
|
case LightController_Simulation:
|
strTemp.Format(_T("Simulation"));
|
break;
|
case LightController_ShinHan:
|
strTemp.Format(_T("ShinHan LED"));
|
break;
|
case LightController_KSVision:
|
strTemp.Format(_T("KSVision LED"));
|
break;
|
case LightController_PlusTek:
|
strTemp.Format(_T("PlusTek LED"));
|
break;
|
case LightController_Byon_ERI2:
|
strTemp.Format(_T("Byon LED"));
|
break;
|
case LightController_ALT_2RSD:
|
strTemp.Format(_T("ALT_2RSD LED"));
|
break;
|
case LightController_ALT_8RSDF:
|
strTemp.Format(_T("ALT_8RSDF LED"));
|
break;
|
case LightControl_LFusion_PDSeries:
|
strTemp.Format(_T("LFusion_PDSeries LED"));
|
break;
|
case LightController_ShinHan_TCP:
|
strTemp.Format(_T("ShinHan TCP LED"));
|
break;
|
default:
|
strTemp.Format(_T(""));
|
break;
|
}
|
strArrayOption.Add(strTemp);
|
}
|
|
m_ctrlGridAlignCameraInfo.SetCellType(nRowIdx, nColIdx, RUNTIME_CLASS(CGridCellCombo));
|
pCellCombo = (CGridCellCombo*)m_ctrlGridAlignCameraInfo.GetCell(nRowIdx, nColIdx);
|
pCellCombo->SetOptions(strArrayOption);
|
pCellCombo->SetStyle(CBS_DROPDOWN);
|
|
nColIdx++;
|
}
|
}
|
|
void CDlgAlign::FillAlignCameraInfo()
|
{
|
int i, nCameraCount, nRowIdx, nColIdx;
|
CString strItemText;
|
CReviewSystemSettingDlg* pDlg = (CReviewSystemSettingDlg*)AfxGetMainWnd();
|
if(pDlg == NULL) return;
|
|
CSys_AlignManager* pAlignManager = pDlg->GetAlignManager();
|
if(pAlignManager == NULL) return;
|
|
UpdateData(FALSE);
|
|
nCameraCount = pAlignManager->GetAlignCameraInfoCount();
|
|
if(nCameraCount > 0)
|
{
|
CAlignCameraInfo* pCameraInfo = NULL;
|
CGridCellCheck* pCellCheck = NULL;
|
CGridCellCombo* pCellCombo = NULL;
|
CStringArray strArrayOption;
|
|
nColIdx = 1;
|
|
for(i = 0; i < nCameraCount; i++)
|
{
|
nRowIdx = 1;
|
//if(pCameraInfo) pCameraInfo->Reset();
|
pCameraInfo = pAlignManager->GetAlignCameraInfo(i);
|
if(pCameraInfo == NULL) continue;
|
|
if(pCameraInfo->GetAlignCameraFrameRateApply()==TRUE)
|
{
|
m_ctrlCheckAlignCameraFrameRateApply.SetCheck(1);
|
}
|
else{
|
m_ctrlCheckAlignCameraFrameRateApply.SetCheck(0);
|
}
|
|
CCameraControlInfo_Plus* pCameraControlInfo = pCameraInfo->GetCameraControlInfo();
|
if(pCameraControlInfo == NULL) continue;
|
|
// ���� �
|
pCellCheck = (CGridCellCheck*)m_ctrlGridAlignCameraInfo.GetCell(nRowIdx, nColIdx);
|
if(pCellCheck)
|
{
|
pCellCheck->SetCheck(pCameraControlInfo->GetStandardCamera());
|
}
|
|
// ī�� ���̺귯��
|
nRowIdx++;
|
pCellCombo = (CGridCellCombo*)m_ctrlGridAlignCameraInfo.GetCell(nRowIdx, nColIdx);
|
if(pCellCombo)
|
{
|
strArrayOption.RemoveAll();
|
pCellCombo->GetOptions(strArrayOption);
|
|
if(strArrayOption.GetSize() > 0 && pCameraControlInfo->GetLibraryType() > -1)
|
{
|
strItemText = strArrayOption.GetAt(pCameraControlInfo->GetLibraryType());
|
m_ctrlGridAlignCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
}
|
}
|
|
// ī�� �ø� Ÿ��
|
nRowIdx++;
|
pCellCombo = (CGridCellCombo*)m_ctrlGridAlignCameraInfo.GetCell(nRowIdx, nColIdx);
|
if(pCellCombo)
|
{
|
strArrayOption.RemoveAll();
|
pCellCombo->GetOptions(strArrayOption);
|
|
if(strArrayOption.GetSize() > 0 && pCameraControlInfo->GetFlipType() > -1)
|
{
|
strItemText = strArrayOption.GetAt(pCameraControlInfo->GetFlipType());
|
m_ctrlGridAlignCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
}
|
}
|
|
// ī�� �̸�
|
nRowIdx++;
|
m_ctrlGridAlignCameraInfo.SetItemText(nRowIdx, nColIdx, pCameraControlInfo->GetName());
|
|
// � ���� ����
|
nRowIdx++;
|
strItemText.Format(_T("%s"), pCameraControlInfo->GetConnectionPort());
|
m_ctrlGridAlignCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// � ������ ����
|
nRowIdx++;
|
strItemText.Format(_T("%d"), pCameraControlInfo->GetFrameCount());
|
m_ctrlGridAlignCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// � ������ ����
|
nRowIdx++;
|
strItemText.Format(_T("%d"), pCameraControlInfo->GetFrameWidth());
|
m_ctrlGridAlignCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// � ������ ����
|
nRowIdx++;
|
strItemText.Format(_T("%d"), pCameraControlInfo->GetFrameHeight());
|
m_ctrlGridAlignCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// �̹��� ���� ����
|
nRowIdx++;
|
strItemText.Format(_T("%d"), pCameraControlInfo->GetImageBufferCount());
|
m_ctrlGridAlignCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// ī�� �ػ�
|
nRowIdx++;
|
strItemText.Format(_T("%.08lf"), pCameraControlInfo->GetPixelResolution());
|
m_ctrlGridAlignCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// ī�� �÷� ä��
|
nRowIdx++;
|
strItemText.Format(_T("%d"), pCameraControlInfo->GetFrameChannels());
|
m_ctrlGridAlignCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// � X�� ����
|
nRowIdx++;
|
pCellCombo = (CGridCellCombo*)m_ctrlGridAlignCameraInfo.GetCell(nRowIdx, nColIdx);
|
|
if(pCellCombo)
|
{
|
strArrayOption.RemoveAll();
|
pCellCombo->GetOptions(strArrayOption);
|
|
if(strArrayOption.GetSize() > 0 && pCameraControlInfo->GetAxisDirectionX() > -1)
|
{
|
strItemText = strArrayOption.GetAt(pCameraControlInfo->GetAxisDirectionX());
|
m_ctrlGridAlignCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
}
|
}
|
|
// � Y�� ����
|
nRowIdx++;
|
pCellCombo = (CGridCellCombo*)m_ctrlGridAlignCameraInfo.GetCell(nRowIdx, nColIdx);
|
|
if(pCellCombo)
|
{
|
strArrayOption.RemoveAll();
|
pCellCombo->GetOptions(strArrayOption);
|
|
if(strArrayOption.GetSize() > 0 && pCameraControlInfo->GetAxisDirectionY() > -1)
|
{
|
strItemText = strArrayOption.GetAt(pCameraControlInfo->GetAxisDirectionY());
|
m_ctrlGridAlignCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
}
|
}
|
|
CLightControlInfo* pLightControlInfo = pCameraInfo->GetLightContorlInfo();
|
if(pLightControlInfo == NULL) continue;
|
|
// ���� Ÿ��
|
nRowIdx++;
|
pCellCombo = (CGridCellCombo*)m_ctrlGridAlignCameraInfo.GetCell(nRowIdx, nColIdx);
|
if(pCellCombo)
|
{
|
strArrayOption.RemoveAll();
|
pCellCombo->GetOptions(strArrayOption);
|
|
|
if(strArrayOption.GetSize() > 0 && pLightControlInfo->GetControllerType() > -1)
|
{
|
strItemText = strArrayOption.GetAt(pLightControlInfo->GetControllerType());
|
m_ctrlGridAlignCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
}
|
}
|
|
// ���� ��Ʈ
|
nRowIdx++;
|
m_ctrlGridAlignCameraInfo.SetItemText(nRowIdx, nColIdx, pLightControlInfo->GetConnectionPort());
|
|
// ������ ����
|
nRowIdx++;
|
strItemText.Format(_T("%d"), pLightControlInfo->GetMaster());
|
m_ctrlGridAlignCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// ���� �
|
nRowIdx++;
|
strItemText.Format(_T("%d"), pLightControlInfo->GetChannel());
|
m_ctrlGridAlignCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// ���� �⺻��
|
nRowIdx++;
|
strItemText.Format(_T("%d"), pLightControlInfo->GetDefaultValue());
|
m_ctrlGridAlignCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
// � ������ ���
|
nRowIdx++;
|
strItemText.Format(_T("%d"), pCameraControlInfo->GetCameraReverseX());
|
m_ctrlGridAlignCameraInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
nColIdx++;
|
}
|
}
|
}
|
|
void CDlgAlign::ResetAlignCameraInfoGrid()
|
{
|
int i, j, nRowIdx, nColIdx;
|
CString strItemText;
|
CGridCellCheck* pCellCheck = NULL;
|
|
nRowIdx = 0;
|
nColIdx = 0;
|
strItemText = _T("");
|
|
for(i = 0; i < ALIGN_CAMERA_COUNT; i++)
|
{
|
nRowIdx = 1;
|
nColIdx++;
|
|
for(j = 0; j < ALIGN_CAMERA_INFO_GRID_ROW_COUNT - 1; j++)
|
{
|
switch (j)
|
{
|
case 0:
|
pCellCheck = (CGridCellCheck*)m_ctrlGridAlignCameraInfo.GetCell(nRowIdx++, nColIdx);
|
|
if(pCellCheck)
|
{
|
pCellCheck->SetCheck(FALSE);
|
}
|
break;
|
default:
|
m_ctrlGridAlignCameraInfo.SetItemText(nRowIdx++, nColIdx, strItemText);
|
break;
|
}
|
}
|
}
|
|
m_ctrlGridAlignCameraInfo.Invalidate(TRUE);
|
}
|