// DlgSystemHeader.cpp : ±¸Çö ÆÄÀÏÀÔ´Ï´Ù.
|
//
|
|
#include "stdafx.h"
|
#include "ReviewSystemSetting.h"
|
#include "DlgSystemHeader.h"
|
#include "ReviewSystemSettingDlg.h"
|
#include "CHReviewSetting/Sys_SystemManager.h"
|
#include "CHCommonControls/GridCellCombo.h"
|
#include "CHCommonControls/GridCellCheck.h"
|
#include "CHReviewSetting/HeaderInfo.h"
|
|
|
// CDlgSystemHeader ´ëÈ »óÀÚÀÔ´Ï´Ù.
|
|
IMPLEMENT_DYNAMIC(CDlgSystemHeader, CDialog)
|
|
CDlgSystemHeader::CDlgSystemHeader(CWnd* pParent /*=NULL*/)
|
: CDialog(CDlgSystemHeader::IDD, pParent)
|
, m_nGantryIdx(0)
|
, m_nHeaderIdx(0)
|
, m_nMagnificCount(0)
|
{
|
m_nMagnificCount = 0;
|
}
|
|
CDlgSystemHeader::~CDlgSystemHeader()
|
{
|
}
|
|
void CDlgSystemHeader::DoDataExchange(CDataExchange* pDX)
|
{
|
CDialog::DoDataExchange(pDX);
|
DDX_Text(pDX, IDC_EDIT_SYS_SH_GANTRY_IDX, m_nGantryIdx);
|
DDX_Text(pDX, IDC_EDIT_SYS_SH_HEADER_IDX, m_nHeaderIdx);
|
DDX_Control(pDX, IDC_GRID_SYSTEM_HEADER_INFO, m_ctrlGridHeaderInfo);
|
DDX_Control(pDX, IDC_GRID_SYSTEM_MAGNIFIC_INFO, m_ctrlGridMagnificInfo);
|
}
|
|
|
BEGIN_MESSAGE_MAP(CDlgSystemHeader, CDialog)
|
ON_BN_CLICKED(IDC_BUTTON_SYS_SYSTEM_HEADER_RESET, &CDlgSystemHeader::OnBnClickedButtonSysSystemHeaderReset)
|
ON_BN_CLICKED(IDC_BUTTON_SYS_SYSTEM_HEADER_APPLY, &CDlgSystemHeader::OnBnClickedButtonSysSystemHeaderApply)
|
END_MESSAGE_MAP()
|
|
|
// CDlgSystemHeader ¸Þ½ÃÁö 󸮱âÀÔ´Ï´Ù.
|
|
BOOL CDlgSystemHeader::OnInitDialog()
|
{
|
CDialog::OnInitDialog();
|
|
// TODO: ¿©±â¿¡ Ãß°¡ ÃʱâÈ ÀÛ¾÷À» Ãß°¡ÇÕ´Ï´Ù.
|
InitHeaderInfoGridControl();
|
FillHeaderInfo();
|
|
InitMagnificInfoGridControl();
|
FillMagnificInfo();
|
|
return TRUE; // return TRUE unless you set the focus to a control
|
// ¿¹¿Ü: OCX ¼Ó¼º ÆäÀÌÁö´Â FALSE¸¦ ¹ÝÈ¯ÇØ¾ß ÇÕ´Ï´Ù.
|
}
|
|
void CDlgSystemHeader::InitMagnificInfoGridControl()
|
{
|
int nRowIdx, nColIdx, nRows, nCols, nFixRows, nFixCols;
|
CString strTemp;
|
|
nRows = MAGNIFIC_INFO_GRID_ROW_COUNT;
|
nCols = m_nMagnificCount + 1;
|
nFixRows = 1; nFixCols = 1;
|
nRowIdx = 0; nColIdx = 0;
|
|
CRect rect;
|
m_ctrlGridMagnificInfo.GetWindowRect(&rect);
|
|
m_ctrlGridMagnificInfo.GetDefaultCell(FALSE, FALSE)->SetBackClr(RGB(0xFF, 0xFF, 0xE0));
|
m_ctrlGridMagnificInfo.SetRowCount(nRows);
|
m_ctrlGridMagnificInfo.SetColumnCount(nCols);
|
m_ctrlGridMagnificInfo.SetFixedRowCount(nFixRows);
|
m_ctrlGridMagnificInfo.SetFixedColumnCount(nFixCols);
|
|
GV_ITEM Item;
|
nColIdx = 0;
|
Item.mask = GVIF_TEXT;
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Index"));//_T("À妽º"));
|
Item.strText = strTemp;
|
m_ctrlGridMagnificInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Magnification Name"));//_T("¹èÀ² À̸§"));
|
Item.strText = strTemp;
|
m_ctrlGridMagnificInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Magnification"));//_T("¹èÀ² Á¤º¸(¹è)"));
|
Item.strText = strTemp;
|
m_ctrlGridMagnificInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Magnification X Offset (mm)"));//_T("¹èÀ² X¿É¼Â(mm)"));
|
Item.strText = strTemp;
|
m_ctrlGridMagnificInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Magnification Y Offset (mm)"));//_T("¹èÀ² Y¿É¼Â(mm)"));
|
Item.strText = strTemp;
|
m_ctrlGridMagnificInfo.SetItem(&Item);
|
|
Item.row = nRowIdx++;
|
Item.col = nColIdx;
|
strTemp.Format(_T("MSG Home Position"));//_T("¹èÀ² Y¿É¼Â(mm)"));
|
Item.strText = strTemp;
|
m_ctrlGridMagnificInfo.SetItem(&Item);
|
|
//Item.row = nRowIdx++;
|
//Item.col = nColIdx;
|
//strTemp.Format(_T("TEST X Offset (mm)"));//_T("¹èÀ² X¿É¼Â(mm)")); cmark
|
//Item.strText = strTemp;
|
//m_ctrlGridMagnificInfo.SetItem(&Item);
|
|
//Item.row = nRowIdx++;
|
//Item.col = nColIdx;
|
//strTemp.Format(_T("TEST Y Offset (mm)"));//_T("¹èÀ² Y¿É¼Â(mm)"));
|
//Item.strText = strTemp;
|
//m_ctrlGridMagnificInfo.SetItem(&Item);
|
|
|
// m_ctrlGridMagnificInfo.AutoSize();
|
}
|
void CDlgSystemHeader::FillMagnificInfo()
|
{
|
CReviewSystemSettingDlg* pDlg = (CReviewSystemSettingDlg*)AfxGetMainWnd();
|
if (pDlg==NULL) return;
|
|
CSys_SystemManager* pSystemManager = pDlg->GetSystemManager();
|
if(pSystemManager==NULL) return;
|
|
CSystemInfo *pSystemInfo = pSystemManager->GetSystemInfo();
|
if(pSystemInfo==NULL) return;
|
|
CGantryInfo *pGantryInfo = pSystemInfo->GetGantryInfo(m_nGantryIdx);
|
if (pGantryInfo==NULL) return;
|
|
CHeaderInfo *pHeaderInfo = pGantryInfo->GetHeaderInfo(m_nHeaderIdx);
|
if (pHeaderInfo==NULL) return;
|
|
m_nMagnificCount = pHeaderInfo->GetMagnificInfoCount();;
|
|
if(m_nMagnificCount < 0) m_nMagnificCount = 0;
|
|
ChangeMagnificCountMagnificInfoGridControl();
|
|
int nColIdx = 1;
|
CString strItemText = _T("");
|
for (int nMagnificIdx=0; nMagnificIdx<pHeaderInfo->GetMagnificInfoCount(); nMagnificIdx++)
|
{
|
CMagnificInfo *pMaginificInfo = pHeaderInfo->GetMagnificInfo(nMagnificIdx);
|
if (pMaginificInfo==NULL) continue;
|
|
//1. Magnific name
|
int nRowIdx = 1;
|
m_ctrlGridMagnificInfo.SetItemText(nRowIdx, nColIdx, pMaginificInfo->m_strMagnificName);
|
|
//2. Magnification
|
nRowIdx++;
|
strItemText.Format(_T("%lf"), pMaginificInfo->m_dMagnification);
|
m_ctrlGridMagnificInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
//3. Magnific offset X
|
nRowIdx++;
|
strItemText.Format(_T("%.3lf"), pMaginificInfo->m_dMagnificOffsetX);
|
m_ctrlGridMagnificInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
//4. Magnific offset Y
|
nRowIdx++;
|
strItemText.Format(_T("%.3lf"), pMaginificInfo->m_dMagnificOffsetY);
|
m_ctrlGridMagnificInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
//5. MSG Home Position
|
nRowIdx++;
|
strItemText.Format(_T("%d"), pMaginificInfo->m_nMsgHomePosition);
|
m_ctrlGridMagnificInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
////6. Test offset X cmark
|
//nRowIdx++;
|
//strItemText.Format(_T("%.3lf"), pMaginificInfo->m_dTestOffsetX);
|
//m_ctrlGridMagnificInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
////7. Test offset Y
|
//nRowIdx++;
|
//strItemText.Format(_T("%.3lf"), pMaginificInfo->m_dTestOffsetY);
|
//m_ctrlGridMagnificInfo.SetItemText(nRowIdx, nColIdx, strItemText);
|
|
|
nColIdx++;
|
}
|
}
|
|
void CDlgSystemHeader::ChangeMagnificCountMagnificInfoGridControl()
|
{
|
int i, nRowIdx, nColIdx;
|
int nWidth, nMargin, nDataColumnWidth;
|
CString strTemp;
|
CRect rect;
|
m_ctrlGridMagnificInfo.GetWindowRect(&rect);
|
m_ctrlGridMagnificInfo.SetColumnCount(m_nMagnificCount + 1);
|
nWidth = m_ctrlGridMagnificInfo.GetColumnWidth(0);
|
|
nMargin = 5;
|
nDataColumnWidth = rect.Width() - nWidth - nMargin;
|
|
if(m_nMagnificCount > 0)
|
{
|
GV_ITEM Item;
|
nColIdx = 1;
|
nDataColumnWidth = nDataColumnWidth / m_nMagnificCount;
|
for(i = 0; i < m_nMagnificCount; i++)
|
{
|
m_ctrlGridMagnificInfo.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_ctrlGridMagnificInfo.SetItem(&Item);
|
|
nColIdx++;
|
}
|
}
|
}
|
|
BOOL CDlgSystemHeader::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 CDlgSystemHeader::OnBnClickedButtonSysSystemHeaderReset()
|
{
|
// TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù.
|
int nRowIdx, nColIdx;
|
CString strItemText = _T("");
|
|
nRowIdx = 0;
|
nColIdx = 1;
|
|
//1. ±âÁØ Çì´õ
|
CGridCellCheck *pCellCheck = (CGridCellCheck*)m_ctrlGridHeaderInfo.GetCell(nRowIdx++, nColIdx);
|
if(pCellCheck)
|
{
|
pCellCheck->SetCheck(FALSE);
|
}
|
|
//2. Module Type
|
strItemText = _T("");
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strItemText);
|
|
//2. Lens Type
|
strItemText = _T("");
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strItemText);
|
|
//3. YÃà À̸§
|
strItemText = _T("");
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strItemText);
|
|
//4. SXÃà À̸§
|
strItemText = _T("");
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strItemText);
|
|
//5. ¹èÀ² °³¼ö
|
strItemText = _T("");
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strItemText);
|
|
//6. Á¶¸í Index
|
strItemText = _T("");
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strItemText);
|
|
//7. Á¶¸í ä³Î
|
strItemText = _T("");
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strItemText);
|
|
//8. ¸®º¼¹ö Index
|
strItemText = _T("");
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strItemText);
|
|
//9. ¸®º¼¹ö ä³Î
|
strItemText = _T("");
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strItemText);
|
|
//10. AFM Index
|
strItemText = _T("");
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strItemText);
|
|
//11. AFM ä³Î
|
strItemText = _T("");
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strItemText);
|
|
//12. WSI Index
|
strItemText = _T("");
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strItemText);
|
|
//13. WSI ä³Î
|
strItemText = _T("");
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strItemText);
|
|
m_ctrlGridHeaderInfo.Invalidate(FALSE);
|
}
|
|
void CDlgSystemHeader::OnBnClickedButtonSysSystemHeaderApply()
|
{
|
// 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 nRowIdx = 0;
|
int nColIdx = 1;
|
|
//1. ±âÁØ °ÕÆ®¸®
|
CGridCellCheck *pCellCheck = (CGridCellCheck*)m_ctrlGridHeaderInfo.GetCell(nRowIdx, nColIdx);
|
if(pCellCheck)
|
{
|
pHeaderInfo->m_bStandardHeader = pCellCheck->GetCheck();
|
}
|
nRowIdx++;
|
|
//2. Module Type
|
CGridCellCombo *pCellCombo = (CGridCellCombo*)m_ctrlGridHeaderInfo.GetCell(nRowIdx++, nColIdx);
|
if(pCellCombo)
|
{
|
CStringArray strArrayOption;
|
CString strItemText = pCellCombo->GetText();
|
pCellCombo->GetOptions(strArrayOption);
|
int nArrayCount = (int)strArrayOption.GetCount();
|
for(int i=0; i<nArrayCount; i++)
|
{
|
CString strTemp = strArrayOption.GetAt(i);
|
if(strTemp.Compare(strItemText) == 0)
|
{
|
pHeaderInfo->m_nModuleType = i+1;
|
break;
|
}
|
}
|
}
|
|
//2. Lens Type
|
pCellCombo = (CGridCellCombo*)m_ctrlGridHeaderInfo.GetCell(nRowIdx++, nColIdx);
|
if(pCellCombo)
|
{
|
CStringArray strArrayOption;
|
CString strItemText = pCellCombo->GetText();
|
pCellCombo->GetOptions(strArrayOption);
|
int nArrayCount = (int)strArrayOption.GetCount();
|
for(int i=0; i<nArrayCount; i++)
|
{
|
CString strTemp = strArrayOption.GetAt(i);
|
if(strTemp.Compare(strItemText) == 0)
|
{
|
pHeaderInfo->m_nLensType = i;
|
break;
|
}
|
}
|
}
|
|
//3. YÃà À̸§
|
pHeaderInfo->m_strYAxisName = m_ctrlGridHeaderInfo.GetItemText(nRowIdx++, nColIdx);
|
|
//4. ZÃà À̸§
|
pHeaderInfo->m_strZAxisName = m_ctrlGridHeaderInfo.GetItemText(nRowIdx++, nColIdx);
|
|
//5. ¹èÀ² °³¼ö
|
pHeaderInfo->SetMagnificInfoCount( _ttoi(m_ctrlGridHeaderInfo.GetItemText(nRowIdx++, nColIdx)));
|
|
//6. Á¶¸í Index
|
pHeaderInfo->m_nLightIndex = _ttoi(m_ctrlGridHeaderInfo.GetItemText(nRowIdx++, nColIdx));
|
|
//7. Á¶¸í ä³Î
|
pHeaderInfo->m_nLightChannel = _ttoi(m_ctrlGridHeaderInfo.GetItemText(nRowIdx++, nColIdx));
|
|
//8. ¸®º¼¹ö Index
|
pHeaderInfo->m_nRevolverIndex = _ttoi(m_ctrlGridHeaderInfo.GetItemText(nRowIdx++, nColIdx));
|
|
//9. ¸®º¼¹ö ä³Î
|
pHeaderInfo->m_nRevolverChannel = _ttoi(m_ctrlGridHeaderInfo.GetItemText(nRowIdx++, nColIdx));
|
|
//10. AFM Index
|
pHeaderInfo->m_nAFMIndex = _ttoi(m_ctrlGridHeaderInfo.GetItemText(nRowIdx++, nColIdx));
|
|
//11. AFM ä³Î
|
pHeaderInfo->m_nAFMChannel = _ttoi(m_ctrlGridHeaderInfo.GetItemText(nRowIdx++, nColIdx));
|
|
//12. WSI Index
|
pHeaderInfo->m_nWSIIndex = _ttoi(m_ctrlGridHeaderInfo.GetItemText(nRowIdx++, nColIdx));
|
|
//13. WSI ä³Î
|
pHeaderInfo->m_nWSIChannel = _ttoi(m_ctrlGridHeaderInfo.GetItemText(nRowIdx++, nColIdx));
|
|
/* CRevolverInfo* pRevolverInfo = pHeaderInfo->GetRevolverInfo(m_nRevolverIdx);
|
if(pRevolverInfo == NULL) return;*/
|
|
CString strItemText = _T("");
|
|
for(int MgnificIdx = 0; MgnificIdx < pHeaderInfo->GetMagnificInfoCount(); MgnificIdx++)
|
{
|
CMagnificInfo* pMagnificInfo = pHeaderInfo->GetMagnificInfo(MgnificIdx);
|
if(pMagnificInfo == NULL) continue;
|
int nRowIdx = 1;
|
|
strItemText = m_ctrlGridMagnificInfo.GetItemText(nRowIdx++, MgnificIdx + 1);
|
pMagnificInfo->m_strMagnificName = strItemText;
|
strItemText = m_ctrlGridMagnificInfo.GetItemText(nRowIdx++, MgnificIdx + 1);
|
pMagnificInfo->m_dMagnification = _ttof(strItemText);
|
strItemText = m_ctrlGridMagnificInfo.GetItemText(nRowIdx++, MgnificIdx + 1);
|
pMagnificInfo->m_dMagnificOffsetX = _ttof(strItemText);
|
strItemText = m_ctrlGridMagnificInfo.GetItemText(nRowIdx++, MgnificIdx + 1);
|
pMagnificInfo->m_dMagnificOffsetY = _ttof(strItemText);
|
strItemText = m_ctrlGridMagnificInfo.GetItemText(nRowIdx++, MgnificIdx + 1);
|
pMagnificInfo->m_nMsgHomePosition = _ttoi(strItemText);
|
|
strItemText = m_ctrlGridMagnificInfo.GetItemText(nRowIdx++, MgnificIdx + 1); //cmark
|
pMagnificInfo->m_dTestOffsetX = _ttof(strItemText);
|
strItemText = m_ctrlGridMagnificInfo.GetItemText(nRowIdx++, MgnificIdx + 1);
|
pMagnificInfo->m_dTestOffsetY = _ttof(strItemText);
|
|
|
}
|
m_nMagnificCount = pHeaderInfo->GetMagnificInfoCount();
|
FillMagnificInfo();
|
}
|
|
void CDlgSystemHeader::InitHeaderInfoGridControl()
|
{
|
int i, nRowIdx, nColIdx, nRows, nCols, nFixRows, nFixCols, nMargin;
|
CString strTemp;
|
CRect rect;
|
|
nRows = SYSTEM_HEADER_INFO_GRID_ROW_COUNT;
|
nCols = SYSTEM_HEADER_INFO_GRID_COL_COUNT;
|
nFixRows = 0;
|
nFixCols = 1;
|
nRowIdx = 0;
|
nColIdx = 0;
|
nMargin = 25;
|
|
m_ctrlGridHeaderInfo.GetWindowRect(&rect);
|
m_ctrlGridHeaderInfo.GetDefaultCell(FALSE, FALSE)->SetBackClr(RGB(0xFF, 0xFF, 0xE0));
|
m_ctrlGridHeaderInfo.SetRowCount(nRows);
|
m_ctrlGridHeaderInfo.SetColumnCount(nCols);
|
m_ctrlGridHeaderInfo.SetFixedRowCount(nFixRows);
|
m_ctrlGridHeaderInfo.SetFixedColumnCount(nFixCols);
|
m_ctrlGridHeaderInfo.SetColumnWidth(nColIdx++, 200);
|
m_ctrlGridHeaderInfo.SetColumnWidth(nColIdx++, rect.Width() - nMargin - 200);
|
|
GV_ITEM Item;
|
nColIdx = 0;
|
CStringArray strArrayOption;
|
CGridCellCombo* pCellCombo = NULL;
|
|
Item.mask = GVIF_TEXT;
|
Item.row = nRowIdx;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Standard Header"));//_T("±âÁØ Çì´õ"));
|
Item.strText = strTemp;
|
m_ctrlGridHeaderInfo.SetItem(&Item);
|
|
nRowIdx++;
|
Item.row = nRowIdx;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Module Type"));//_T("¸ðµâ ŸÀÔ"));
|
Item.strText = strTemp;
|
m_ctrlGridHeaderInfo.SetItem(&Item);
|
|
nRowIdx++;
|
Item.row = nRowIdx;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Lens Type"));//_T("·»Áî ŸÀÔ"));
|
Item.strText = strTemp;
|
m_ctrlGridHeaderInfo.SetItem(&Item);
|
|
nRowIdx++;
|
Item.mask = GVIF_TEXT;
|
Item.row = nRowIdx;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Y Axis Name"));//_T("YÃà À̸§"));
|
Item.strText = strTemp;
|
m_ctrlGridHeaderInfo.SetItem(&Item);
|
|
nRowIdx++;
|
Item.row = nRowIdx;
|
strTemp.Format(_T("SX Axis Name"));//_T("SXÃà À̸§"));
|
Item.strText = strTemp;
|
m_ctrlGridHeaderInfo.SetItem(&Item);
|
|
nRowIdx++;
|
Item.row = nRowIdx;
|
strTemp.Format(_T("Magnification Count (ea)"));//_T("¹èÀ² °³¼ö"));
|
Item.strText = strTemp;
|
m_ctrlGridHeaderInfo.SetItem(&Item);
|
|
nRowIdx++;
|
Item.row = nRowIdx;
|
strTemp.Format(_T("Light Index"));//_T("Á¶¸í Index"));
|
Item.strText = strTemp;
|
m_ctrlGridHeaderInfo.SetItem(&Item);
|
|
nRowIdx++;
|
Item.row = nRowIdx;
|
strTemp.Format(_T("Light Channel"));//_T("Á¶¸í ä³Î"));
|
Item.strText = strTemp;
|
m_ctrlGridHeaderInfo.SetItem(&Item);
|
|
nRowIdx++;
|
Item.row = nRowIdx;
|
strTemp.Format(_T("Revolver Index"));//_T("¸®º¼¹ö Index"));
|
Item.strText = strTemp;
|
m_ctrlGridHeaderInfo.SetItem(&Item);
|
|
nRowIdx++;
|
Item.row = nRowIdx;
|
strTemp.Format(_T("Revolver Channel"));//_T("¸®º¼¹ö ä³Î"));
|
Item.strText = strTemp;
|
m_ctrlGridHeaderInfo.SetItem(&Item);
|
|
nRowIdx++;
|
Item.row = nRowIdx;
|
strTemp.Format(_T("AFM Index"));
|
Item.strText = strTemp;
|
m_ctrlGridHeaderInfo.SetItem(&Item);
|
|
nRowIdx++;
|
Item.row = nRowIdx;
|
strTemp.Format(_T("AFM Channel"));//_T("AFM ä³Î"));
|
Item.strText = strTemp;
|
m_ctrlGridHeaderInfo.SetItem(&Item);
|
|
nRowIdx++;
|
Item.row = nRowIdx;
|
strTemp.Format(_T("WSI Index"));
|
Item.strText = strTemp;
|
m_ctrlGridHeaderInfo.SetItem(&Item);
|
|
nRowIdx++;
|
Item.row = nRowIdx;
|
strTemp.Format(_T("WSI Channel"));//_T("WSI ä³Î"));
|
Item.strText = strTemp;
|
m_ctrlGridHeaderInfo.SetItem(&Item);
|
|
//±âÁØ °ÕÆ®¸®
|
nRowIdx = 0;
|
nColIdx = 1;
|
Item.strText = _T("");
|
m_ctrlGridHeaderInfo.SetCellType(nRowIdx, nColIdx, RUNTIME_CLASS(CGridCellCheck));
|
m_ctrlGridHeaderInfo.SetItemState(nRowIdx, nColIdx, m_ctrlGridHeaderInfo.GetItemState(nRowIdx, nColIdx) | GVIS_READONLY);
|
|
//Module Type
|
nRowIdx++;
|
strArrayOption.RemoveAll();
|
for(i=0; i<MODULE_COUNT; i++)
|
{
|
switch(i)
|
{
|
case MODULE_TYPE_REVIEW:
|
strTemp.Format(_T("Reveiw"));
|
break;
|
case MODULE_TYPE_MEASURE:
|
strTemp.Format(_T("Measure"));
|
break;
|
case MODULE_TYPE_REVIEW_MEASURE:
|
strTemp.Format(_T("Review, Measure"));
|
break;
|
case MODULE_TYPE_WSI:
|
strTemp.Format(_T("WSI"));
|
break;
|
case MODULE_TYPE_REVIEW_WSI:
|
strTemp.Format(_T("Review, WSI"));
|
break;
|
case MODULE_TYPE_MEASURE_WSI:
|
strTemp.Format(_T("Measure, WSI"));
|
break;
|
case MODULE_TYPE_REVIEW_MEASURE_WSI:
|
strTemp.Format(_T("Review, Measure, WSI"));
|
break;
|
default:
|
strTemp.Format(_T(""));
|
break;
|
}
|
strArrayOption.Add(strTemp);
|
}
|
m_ctrlGridHeaderInfo.SetCellType(nRowIdx, nColIdx, RUNTIME_CLASS(CGridCellCombo));
|
pCellCombo = (CGridCellCombo*)m_ctrlGridHeaderInfo.GetCell(nRowIdx, nColIdx);
|
pCellCombo->SetOptions(strArrayOption);
|
pCellCombo->SetStyle(CBS_DROPDOWN);
|
|
// Lens Type
|
nRowIdx++;
|
strArrayOption.RemoveAll();
|
for(i=0; i<LensType_Count; i++)
|
{
|
switch(i)
|
{
|
case LensType_SingleTube:
|
strTemp.Format(_T("Single Tube"));
|
break;
|
|
case LensType_DualTube:
|
strTemp.Format(_T("Dual Tube"));
|
break;
|
|
default:
|
continue;
|
}
|
strArrayOption.Add(strTemp);
|
}
|
m_ctrlGridHeaderInfo.SetCellType(nRowIdx, nColIdx, RUNTIME_CLASS(CGridCellCombo));
|
pCellCombo = (CGridCellCombo*)m_ctrlGridHeaderInfo.GetCell(nRowIdx, nColIdx);
|
pCellCombo->SetOptions(strArrayOption);
|
pCellCombo->SetStyle(CBS_DROPDOWN);
|
}
|
|
void CDlgSystemHeader::FillHeaderInfo()
|
{
|
CReviewSystemSettingDlg* pDlg = (CReviewSystemSettingDlg*)AfxGetMainWnd();
|
if (pDlg==NULL) return;
|
|
CHeaderInfo *pHeaderInfo = pDlg->GetSys_HeaderInfo(m_nGantryIdx, m_nHeaderIdx);
|
if (pHeaderInfo==NULL) return;
|
|
int nRowIdx = 0;
|
int nColIdx = 1;
|
|
//1. ±âÁØ Çì´õ
|
CGridCellCheck *pCellCheck = (CGridCellCheck*)m_ctrlGridHeaderInfo.GetCell(nRowIdx++, nColIdx);
|
if(pCellCheck)
|
{
|
pCellCheck->SetCheck(pHeaderInfo->m_bStandardHeader);
|
}
|
|
//2. Module Type
|
CStringArray strArrayOption;
|
CGridCellCombo *pCellCombo = (CGridCellCombo*)m_ctrlGridHeaderInfo.GetCell(nRowIdx, nColIdx);
|
if(pCellCombo)
|
{
|
strArrayOption.RemoveAll();
|
pCellCombo->GetOptions(strArrayOption);
|
if(strArrayOption.GetSize() > 0 && pHeaderInfo->m_nModuleType > -1)
|
{
|
CString strItemText = strArrayOption.GetAt(pHeaderInfo->m_nModuleType-1);
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strItemText);
|
}
|
}
|
|
//3. Lens Type
|
strArrayOption;
|
pCellCombo = (CGridCellCombo*)m_ctrlGridHeaderInfo.GetCell(nRowIdx, nColIdx);
|
if(pCellCombo)
|
{
|
strArrayOption.RemoveAll();
|
pCellCombo->GetOptions(strArrayOption);
|
if(strArrayOption.GetSize() > 0 && pHeaderInfo->m_nLensType > -1)
|
{
|
CString strItemText = strArrayOption.GetAt(pHeaderInfo->m_nLensType);
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strItemText);
|
}
|
}
|
|
//3. YÃà À̸§
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, pHeaderInfo->m_strYAxisName);
|
|
//4. SXÃà À̸§
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, pHeaderInfo->m_strZAxisName);
|
|
//5. ¹èÀ² °³¼ö
|
CString strTemp = _T("");
|
strTemp.Format(_T("%d"), pHeaderInfo->GetMagnificInfoCount());
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strTemp);
|
|
//6. Á¶¸í Index
|
strTemp = _T("");
|
strTemp.Format(_T("%d"), pHeaderInfo->m_nLightIndex);
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strTemp);
|
|
//7. Á¶¸í ä³Î
|
strTemp = _T("");
|
strTemp.Format(_T("%d"), pHeaderInfo->m_nLightChannel);
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strTemp);
|
|
//8. ¸®º¼¹ö Index
|
strTemp = _T("");
|
strTemp.Format(_T("%d"), pHeaderInfo->m_nRevolverIndex);
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strTemp);
|
|
//9. ¸®º¼¹ö ä³Î
|
strTemp = _T("");
|
strTemp.Format(_T("%d"), pHeaderInfo->m_nRevolverChannel);
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strTemp);
|
|
//10. AFM Index
|
strTemp = _T("");
|
strTemp.Format(_T("%d"), pHeaderInfo->m_nAFMIndex);
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strTemp);
|
|
//11. AFM ä³Î
|
strTemp = _T("");
|
strTemp.Format(_T("%d"), pHeaderInfo->m_nAFMChannel);
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strTemp);
|
|
//12. WSI Index
|
strTemp = _T("");
|
strTemp.Format(_T("%d"), pHeaderInfo->m_nWSIIndex);
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strTemp);
|
|
//13. WSI ä³Î
|
strTemp = _T("");
|
strTemp.Format(_T("%d"), pHeaderInfo->m_nWSIChannel);
|
m_ctrlGridHeaderInfo.SetItemText(nRowIdx++, nColIdx, strTemp);
|
}
|
|
void CDlgSystemHeader::UpdateDialogData(int nGantryIdx, int nHeaderIdx)
|
{
|
m_nGantryIdx = nGantryIdx;
|
m_nHeaderIdx = nHeaderIdx;
|
UpdateData(FALSE);
|
FillHeaderInfo();
|
FillMagnificInfo();
|
m_ctrlGridHeaderInfo.Invalidate(FALSE);
|
m_ctrlGridMagnificInfo.Invalidate(FALSE);
|
}
|