// DlgSystem.cpp : ±¸Çö ÆÄÀÏÀÔ´Ï´Ù.
|
//
|
|
#include "stdafx.h"
|
#include "ReviewSystemSetting.h"
|
#include "DlgSystem.h"
|
#include "ReviewSystemSettingDlg.h"
|
|
#include "CHReviewSetting/Sys_SystemManager.h"
|
// CDlgSystem ´ëÈ »óÀÚÀÔ´Ï´Ù.
|
|
IMPLEMENT_DYNAMIC(CDlgSystem, CDialog)
|
|
CDlgSystem::CDlgSystem(CWnd* pParent /*=NULL*/)
|
: CDialog(CDlgSystem::IDD, pParent)
|
, m_nGantryCount(0)
|
, m_nHeaderCount(0)
|
, m_nCameraCount(0)
|
, m_nLightCount(0)
|
, m_nRevolverCount(0)
|
, m_nAFMCount(0)
|
, m_nWSICount(0)
|
, m_bLongRun(FALSE)
|
, m_bUseVisionAlign(TRUE)
|
, m_nLongRunCount(0)
|
{
|
m_pDlgSystemGantry = NULL;
|
m_pDlgSystemHeader = NULL;
|
m_pDlgSystemCamera = NULL;
|
m_pDlgSystemLight = NULL;
|
m_pDlgSystemRevolver = NULL;
|
m_pDlgSystemAFM = NULL;
|
m_pDlgSystemWSI = NULL;
|
}
|
|
CDlgSystem::~CDlgSystem()
|
{
|
if(m_pDlgSystemGantry)
|
{
|
delete m_pDlgSystemGantry;
|
m_pDlgSystemGantry = NULL;
|
}
|
|
if(m_pDlgSystemHeader)
|
{
|
delete m_pDlgSystemHeader;
|
m_pDlgSystemHeader = NULL;
|
}
|
|
if(m_pDlgSystemCamera)
|
{
|
delete m_pDlgSystemCamera;
|
m_pDlgSystemCamera = NULL;
|
}
|
|
if(m_pDlgSystemLight)
|
{
|
delete m_pDlgSystemLight;
|
m_pDlgSystemLight = NULL;
|
}
|
|
if(m_pDlgSystemRevolver)
|
{
|
delete m_pDlgSystemRevolver;
|
m_pDlgSystemRevolver = NULL;
|
}
|
|
if(m_pDlgSystemAFM)
|
{
|
delete m_pDlgSystemAFM;
|
m_pDlgSystemAFM = NULL;
|
}
|
|
if(m_pDlgSystemWSI)
|
{
|
delete m_pDlgSystemWSI;
|
m_pDlgSystemWSI = NULL;
|
}
|
}
|
|
void CDlgSystem::DoDataExchange(CDataExchange* pDX)
|
{
|
CDialog::DoDataExchange(pDX);
|
DDX_Text(pDX, IDC_EDIT_SYS_SYSTEM_GANTRY_COUNT, m_nGantryCount);
|
DDX_Text(pDX, IDC_EDIT_SYS_SYSTEM_HEADER_COUNT, m_nHeaderCount);
|
|
DDX_Text(pDX, IDC_EDIT_SYS_SYSTEM_LONG_RUN_COUNT, m_nLongRunCount);
|
DDX_Text(pDX, IDC_EDIT_SYS_SYSTEM_EQPID, m_strEqpID);
|
DDX_Text(pDX, IDC_EDIT_SYS_SYSTEM_COLLISION_DISTANCE, m_dCollisionDistance);
|
DDX_Check(pDX, IDC_CHECK_SYS_SYSTEM_LONG_RUN, m_bLongRun);
|
DDX_Check(pDX, IDC_CHECK_SYS_USE_VISION_ALIGN, m_bUseVisionAlign);
|
DDX_Control(pDX, IDC_SYSTEM_INFO, m_ctrlGridSystemInfo);
|
DDX_Control(pDX, IDC_TAB_SYS_SYSTEM_TAB, m_ctrlTabSystem);
|
|
DDX_Control(pDX, IDC_COMBO_LINE_TYPE, m_ctrlLineType);
|
DDX_Control(pDX, IDC_COMBO_MACHINE_TYPE, m_ctrlMachineType);
|
DDX_Control(pDX, IDC_COMBO_MONITOR_POSITION, m_ctrlMonotorPosition);
|
}
|
|
|
BEGIN_MESSAGE_MAP(CDlgSystem, CDialog)
|
ON_BN_CLICKED(IDC_BUTTON_SYS_SYSTEM_RESET, &CDlgSystem::OnBnClickedButtonSysSystemReset)
|
ON_BN_CLICKED(IDC_BUTTON_SYS_SYSTEM_APPLY, &CDlgSystem::OnBnClickedButtonSysSystemApply)
|
ON_EN_CHANGE(IDC_EDIT_SYS_SYSTEM_GANTRY_COUNT, &CDlgSystem::OnEnChangeEditSysSystemGantryCount)
|
ON_EN_CHANGE(IDC_EDIT_SYS_SYSTEM_HEADER_COUNT, &CDlgSystem::OnEnChangeEditSysSystemHeaderCount)
|
ON_EN_CHANGE(IDC_EDIT_SYS_SYSTEM_CAMERA_COUNT, &CDlgSystem::OnEnChangeEditSysSystemCameraCount)
|
ON_EN_CHANGE(IDC_EDIT_SYS_SYSTEM_LIGHT_COUNT, &CDlgSystem::OnEnChangeEditSysSystemLightCount)
|
ON_NOTIFY(TCN_SELCHANGE, IDC_TAB_SYS_SYSTEM_TAB, &CDlgSystem::OnTcnSelchangeTabSysSystemTab)
|
ON_NOTIFY(NM_DBLCLK, IDC_SYSTEM_INFO, &CDlgSystem::OnGridDblClick)
|
ON_CBN_SELCHANGE(IDC_COMBO_LINE_TYPE, &CDlgSystem::OnCbnSelchangeComboLineType)
|
END_MESSAGE_MAP()
|
|
|
// CDlgSystem ¸Þ½ÃÁö 󸮱âÀÔ´Ï´Ù.
|
|
BOOL CDlgSystem::OnInitDialog()
|
{
|
CDialog::OnInitDialog();
|
|
// TODO: ¿©±â¿¡ Ãß°¡ ÃʱâÈ ÀÛ¾÷À» Ãß°¡ÇÕ´Ï´Ù.
|
|
CString strValue = _T("");
|
for (int i=0; i<SystemLine_Count; i++)
|
{
|
strValue = _T("");
|
switch(i)
|
{
|
case SystemLine_CPJT:
|
strValue.Format(_T("CPJT"));
|
break;
|
}
|
m_ctrlLineType.InsertString(i, strValue);
|
}
|
|
CReviewSystemSettingDlg* pDlg = (CReviewSystemSettingDlg*)AfxGetMainWnd();
|
if(pDlg)
|
{
|
CSystemInfo *pSystemInfo = pDlg->GetSys_SystemInfo();
|
if(pSystemInfo)
|
{
|
m_bLongRun = pSystemInfo->m_bLongRun;
|
m_nLongRunCount = pSystemInfo->m_nLongRunCount;
|
m_bUseVisionAlign = pSystemInfo->m_bUseVisionAlign;
|
m_dCollisionDistance = pSystemInfo->m_dCollisionDistance;
|
m_strEqpID = pSystemInfo->m_strEqpID;
|
m_ctrlLineType.SetCurSel(pSystemInfo->m_nLineType);
|
|
InitMachineType(pSystemInfo->m_nLineType);
|
m_ctrlMachineType.SetCurSel(pSystemInfo->m_nMachineType);
|
|
InitMonitorPosition(pSystemInfo->m_nMonitorPosition);
|
|
UpdateData(FALSE);
|
}
|
|
}
|
|
InitSystemInfoGridControl();
|
FillSystemInfo();
|
|
CreateTabDlg();
|
InitTabControl();
|
|
return TRUE; // return TRUE unless you set the focus to a control
|
// ¿¹¿Ü: OCX ¼Ó¼º ÆäÀÌÁö´Â FALSE¸¦ ¹ÝÈ¯ÇØ¾ß ÇÕ´Ï´Ù.
|
}
|
|
BOOL CDlgSystem::InitMachineType( int nLineType )
|
{
|
CString strValue = _T("");
|
|
//m_ctrlMachineType.Clear();
|
m_ctrlMachineType.ResetContent();
|
|
switch(nLineType)
|
{
|
|
case SystemLine_CPJT:
|
for (int i=0; i<SystemMachine_CPJT_Count; i++)
|
{
|
strValue = _T("");
|
switch(i)
|
{
|
case SystemMachine_CPJT_QD:
|
strValue.Format(_T("CPJT QD"));
|
break;
|
case SystemMachine_CPJT_RGB:
|
strValue.Format(_T("CPJT RGB"));
|
break;
|
case SystemMachine_CPJT_BANK:
|
strValue.Format(_T("CPJT BANK"));
|
break;
|
case SystemMachine_CPJT_OC:
|
strValue.Format(_T("CPJT OC"));
|
break;
|
case SystemMachine_CPJT_BDI:
|
strValue.Format(_T("CPJT BDI"));
|
break;
|
case SystemMachine_CPJT_CS:
|
strValue.Format(_T("CPJT CS"));
|
break;
|
}
|
m_ctrlMachineType.InsertString(i, strValue);
|
}
|
break;
|
}
|
m_ctrlMachineType.SetCurSel(0);
|
return TRUE;
|
}
|
|
// [2017:1:13]-[WEZASW] : ´ÙÁß ¸ð´ÏÅÍ¿¡¼ÀÇ ReviewSystem Display
|
BOOL CDlgSystem::InitMonitorPosition( int nMonitorPosition )
|
{
|
CString strValue = _T("");
|
|
m_ctrlMonotorPosition.ResetContent();
|
|
for (int i=0; i<SystemMonitor_Count; i++)
|
{
|
strValue = _T("");
|
switch(i)
|
{
|
case SystemMonitor_CENTER:
|
strValue.Format(_T("CENTER"));
|
break;
|
case SystemMonitor_TOP:
|
strValue.Format(_T("TOP"));
|
break;
|
case SystemMonitor_BOTTOM:
|
strValue.Format(_T("BOTTOM"));
|
break;
|
case SystemMonitor_LEFT:
|
strValue.Format(_T("LEFT"));
|
break;
|
case SystemMonitor_RIGHT:
|
strValue.Format(_T("RIGHT"));
|
break;
|
}
|
m_ctrlMonotorPosition.InsertString(i, strValue);
|
}
|
|
m_ctrlMonotorPosition.SetCurSel(nMonitorPosition);
|
|
return TRUE;
|
}
|
|
BOOL CDlgSystem::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 CDlgSystem::OnBnClickedButtonSysSystemReset()
|
{
|
// TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù.
|
m_nGantryCount = 0;
|
m_nHeaderCount = 0;
|
m_nCameraCount = 0;
|
m_nLightCount = 0;
|
m_nRevolverCount = 0;
|
m_nWSICount = 0;
|
m_bLongRun = FALSE;
|
m_bUseVisionAlign = TRUE;
|
m_nLongRunCount = 0;
|
m_dCollisionDistance = 0.0;
|
|
|
|
UpdateData(FALSE);
|
|
OnEnChangeEditSysSystemGantryCount();
|
}
|
|
void CDlgSystem::OnBnClickedButtonSysSystemApply()
|
{
|
// TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù.
|
UpdateData(TRUE);
|
|
CReviewSystemSettingDlg* pDlg = (CReviewSystemSettingDlg*)AfxGetMainWnd();
|
if (pDlg==NULL) return;
|
|
CSystemInfo *pSystemInfo = pDlg->GetSys_SystemInfo();
|
if (pSystemInfo==NULL) return;
|
|
pSystemInfo->m_nLineType = m_ctrlLineType.GetCurSel();
|
pSystemInfo->m_nMachineType = m_ctrlMachineType.GetCurSel();
|
pSystemInfo->m_nMonitorPosition = m_ctrlMonotorPosition.GetCurSel();
|
pSystemInfo->m_bLongRun = m_bLongRun;
|
pSystemInfo->m_nLongRunCount = m_nLongRunCount;
|
pSystemInfo->m_bUseVisionAlign = m_bUseVisionAlign;
|
pSystemInfo->m_dCollisionDistance = m_dCollisionDistance;
|
pSystemInfo->m_strEqpID = m_strEqpID;
|
|
// set resize
|
pSystemInfo->SetGantryInfoCount(m_nGantryCount);
|
int k = 1;
|
for (int i=0; i<m_nGantryCount; i++)
|
{
|
CGantryInfo *pGantryInfo = pSystemInfo->GetGantryInfo(i);
|
if (pGantryInfo==NULL) continue;
|
|
pGantryInfo->SetHeaderInfoCount(m_nHeaderCount);
|
for (int j=0; j<m_nHeaderCount; j++)
|
{
|
CHeaderInfo *pHeaderInfo = pGantryInfo->GetHeaderInfo(j);
|
if (pHeaderInfo==NULL) continue;
|
|
m_nCameraCount = _ttoi(m_ctrlGridSystemInfo.GetItemText(k,2));
|
m_nLightCount = _ttoi(m_ctrlGridSystemInfo.GetItemText(k,3));
|
m_nRevolverCount = _ttoi(m_ctrlGridSystemInfo.GetItemText(k,4));
|
m_nAFMCount = _ttoi(m_ctrlGridSystemInfo.GetItemText(k,5));
|
m_nWSICount = _ttoi(m_ctrlGridSystemInfo.GetItemText(k++,6));
|
|
pHeaderInfo->SetCameraInfoCount(m_nCameraCount);
|
pHeaderInfo->SetLightInfoCount(m_nLightCount);
|
pHeaderInfo->SetRevolverInfoCount(m_nRevolverCount);
|
pHeaderInfo->SetAFMInfoCount(m_nAFMCount);
|
pHeaderInfo->SetWSIInfoCount(m_nWSICount);
|
}
|
}
|
|
CGantryInfo *pGantryInfo = pSystemInfo->GetGantryInfo(m_pDlgSystemGantry->m_nGantryIdx);
|
if(pGantryInfo != NULL){
|
CHeaderInfo *pHeaderInfo = pGantryInfo->GetHeaderInfo(m_pDlgSystemGantry->m_nHeaderIdx);
|
if(pHeaderInfo != NULL){
|
m_pDlgSystemGantry->UpdateDialogData(m_pDlgSystemGantry->m_nGantryIdx, m_pDlgSystemGantry->m_nHeaderIdx);
|
m_pDlgSystemHeader->UpdateDialogData(m_pDlgSystemGantry->m_nGantryIdx, m_pDlgSystemGantry->m_nHeaderIdx);
|
m_pDlgSystemCamera->UpdateDialogData(m_pDlgSystemGantry->m_nGantryIdx, m_pDlgSystemGantry->m_nHeaderIdx, pHeaderInfo->GetCameraInfoCount());
|
m_pDlgSystemLight->UpdateDialogData(m_pDlgSystemGantry->m_nGantryIdx, m_pDlgSystemGantry->m_nHeaderIdx, pHeaderInfo->GetLightInfoCount());
|
m_pDlgSystemRevolver->UpdateDialogData(m_pDlgSystemGantry->m_nGantryIdx, m_pDlgSystemGantry->m_nHeaderIdx, pHeaderInfo->GetRevolverInfoCount());
|
m_pDlgSystemAFM->UpdateDialogData(m_pDlgSystemGantry->m_nGantryIdx, m_pDlgSystemGantry->m_nHeaderIdx, pHeaderInfo->GetAFMInfoCount());
|
m_pDlgSystemWSI->UpdateDialogData(m_pDlgSystemGantry->m_nGantryIdx, m_pDlgSystemGantry->m_nHeaderIdx, pHeaderInfo->GetWsiInfoCount());
|
}
|
}
|
}
|
|
void CDlgSystem::OnEnChangeEditSysSystemGantryCount()
|
{
|
// TODO: RICHEDIT ÄÁÆ®·ÑÀÎ °æ¿ì, ÀÌ ÄÁÆ®·ÑÀº
|
// CDialog::OnInitDialog() ÇÔ¼ö¸¦ ÀçÁöÁ¤
|
//ÇÏ°í ¸¶½ºÅ©¿¡ OR ¿¬»êÇÏ¿© ¼³Á¤µÈ ENM_CHANGE Ç÷¡±×¸¦ ÁöÁ¤ÇÏ¿© CRichEditCtrl().SetEventMask()¸¦ È£ÃâÇÏÁö ¾ÊÀ¸¸é
|
// ÀÌ ¾Ë¸² ¸Þ½ÃÁö¸¦ º¸³»Áö ¾Ê½À´Ï´Ù.
|
|
// TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù.
|
UpdateData(TRUE);
|
|
CReviewSystemSettingDlg* pDlg = (CReviewSystemSettingDlg*)AfxGetMainWnd();
|
if (pDlg==NULL) return;
|
|
CSystemInfo *pSystemInfo = pDlg->GetSys_SystemInfo();
|
if (pSystemInfo==NULL) return;
|
|
int i, j, nRowIdx, nColIdx, nRowCount;
|
CString strTemp;
|
CRect rect;
|
m_ctrlGridSystemInfo.GetWindowRect(&rect);
|
nRowCount = m_nGantryCount + 1;
|
if(m_nHeaderCount > 0)
|
{
|
nRowCount += m_nGantryCount * (m_nHeaderCount - 1);
|
}
|
m_ctrlGridSystemInfo.SetRowCount(nRowCount);
|
|
if(m_nGantryCount > 0)
|
{
|
GV_ITEM Item;
|
Item.mask = GVIF_TEXT;
|
nRowIdx = 1;
|
|
if(pSystemInfo->GetGantryInfoCount() != m_nGantryCount)
|
pSystemInfo->SetGantryInfoCount(m_nGantryCount);
|
|
for(i = 0; i < m_nGantryCount; i++)
|
{
|
CGantryInfo *pGantryInfo = pSystemInfo->GetGantryInfo(i);
|
if (pGantryInfo==NULL) continue;
|
|
if(pGantryInfo->GetHeaderInfoCount() != m_nHeaderCount)
|
pGantryInfo->SetHeaderInfoCount(m_nHeaderCount);
|
|
for(j = 0; j < m_nHeaderCount; j++)
|
{
|
CHeaderInfo *pHeaderInfo = pGantryInfo->GetHeaderInfo(j);
|
|
//°ÕÆ®¸® À妽º
|
nColIdx = 0;
|
Item.row = nRowIdx;
|
Item.col = nColIdx;
|
strTemp.Format(_T("%02d"), i);
|
Item.strText = strTemp;
|
m_ctrlGridSystemInfo.SetItem(&Item);
|
|
//Çì´õ À妽º
|
nColIdx = 1;
|
Item.row = nRowIdx;
|
Item.col = nColIdx++;
|
strTemp.Format(_T("%02d"), j);
|
Item.strText = strTemp;
|
m_ctrlGridSystemInfo.SetItem(&Item);
|
|
|
//Ä«¸Þ¶ó °³¼ö
|
Item.row = nRowIdx;
|
Item.col = nColIdx++;
|
if(pHeaderInfo == NULL){
|
strTemp.Format(_T("%d"), m_nCameraCount);
|
}else{
|
strTemp.Format(_T("%d"), pHeaderInfo->GetCameraInfoCount());
|
}
|
Item.strText = strTemp;
|
m_ctrlGridSystemInfo.SetItem(&Item);
|
|
|
//Á¶¸í °³¼ö
|
Item.row = nRowIdx;
|
Item.col = nColIdx++;
|
if(pHeaderInfo == NULL){
|
strTemp.Format(_T("%d"), m_nLightCount);
|
}else{
|
strTemp.Format(_T("%d"), pHeaderInfo->GetLightInfoCount());
|
}
|
Item.strText = strTemp;
|
m_ctrlGridSystemInfo.SetItem(&Item);
|
|
//¸®º¼¹ö °³¼ö
|
Item.row = nRowIdx;
|
Item.col = nColIdx++;
|
if(pHeaderInfo == NULL){
|
strTemp.Format(_T("%d"), m_nRevolverCount);
|
}
|
else{
|
strTemp.Format(_T("%d"), pHeaderInfo->GetRevolverInfoCount());
|
}
|
Item.strText = strTemp;
|
m_ctrlGridSystemInfo.SetItem(&Item);
|
|
//AFM °³¼ö
|
Item.row = nRowIdx;
|
Item.col = nColIdx++;
|
if(pHeaderInfo == NULL){
|
strTemp.Format(_T("%d"), m_nAFMCount);
|
}else{
|
strTemp.Format(_T("%d"), pHeaderInfo->GetAFMInfoCount());
|
}
|
Item.strText = strTemp;
|
m_ctrlGridSystemInfo.SetItem(&Item);
|
|
//WSI °³¼ö
|
Item.row = nRowIdx;
|
Item.col = nColIdx++;
|
if(pHeaderInfo == NULL){
|
strTemp.Format(_T("%d"), m_nWSICount);
|
}else{
|
strTemp.Format(_T("%d"), pHeaderInfo->GetWsiInfoCount());
|
}
|
Item.strText = strTemp;
|
m_ctrlGridSystemInfo.SetItem(&Item);
|
|
if(j < m_nHeaderCount - 1)
|
{
|
nRowIdx++;
|
}
|
}
|
|
nRowIdx++;
|
}
|
}
|
|
m_ctrlGridSystemInfo.Invalidate(TRUE);
|
}
|
|
void CDlgSystem::OnEnChangeEditSysSystemHeaderCount()
|
{
|
// TODO: RICHEDIT ÄÁÆ®·ÑÀÎ °æ¿ì, ÀÌ ÄÁÆ®·ÑÀº
|
// CDialog::OnInitDialog() ÇÔ¼ö¸¦ ÀçÁöÁ¤
|
//ÇÏ°í ¸¶½ºÅ©¿¡ OR ¿¬»êÇÏ¿© ¼³Á¤µÈ ENM_CHANGE Ç÷¡±×¸¦ ÁöÁ¤ÇÏ¿© CRichEditCtrl().SetEventMask()¸¦ È£ÃâÇÏÁö ¾ÊÀ¸¸é
|
// ÀÌ ¾Ë¸² ¸Þ½ÃÁö¸¦ º¸³»Áö ¾Ê½À´Ï´Ù.
|
|
// TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù.
|
UpdateData(TRUE);
|
OnEnChangeEditSysSystemGantryCount();
|
}
|
|
void CDlgSystem::OnEnChangeEditSysSystemCameraCount()
|
{
|
// TODO: RICHEDIT ÄÁÆ®·ÑÀÎ °æ¿ì, ÀÌ ÄÁÆ®·ÑÀº
|
// CDialog::OnInitDialog() ÇÔ¼ö¸¦ ÀçÁöÁ¤
|
//ÇÏ°í ¸¶½ºÅ©¿¡ OR ¿¬»êÇÏ¿© ¼³Á¤µÈ ENM_CHANGE Ç÷¡±×¸¦ ÁöÁ¤ÇÏ¿© CRichEditCtrl().SetEventMask()¸¦ È£ÃâÇÏÁö ¾ÊÀ¸¸é
|
// ÀÌ ¾Ë¸² ¸Þ½ÃÁö¸¦ º¸³»Áö ¾Ê½À´Ï´Ù.
|
|
// TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù.
|
UpdateData(TRUE);
|
OnEnChangeEditSysSystemGantryCount();
|
}
|
|
void CDlgSystem::OnEnChangeEditSysSystemLightCount()
|
{
|
// TODO: RICHEDIT ÄÁÆ®·ÑÀÎ °æ¿ì, ÀÌ ÄÁÆ®·ÑÀº
|
// CDialog::OnInitDialog() ÇÔ¼ö¸¦ ÀçÁöÁ¤
|
//ÇÏ°í ¸¶½ºÅ©¿¡ OR ¿¬»êÇÏ¿© ¼³Á¤µÈ ENM_CHANGE Ç÷¡±×¸¦ ÁöÁ¤ÇÏ¿© CRichEditCtrl().SetEventMask()¸¦ È£ÃâÇÏÁö ¾ÊÀ¸¸é
|
// ÀÌ ¾Ë¸² ¸Þ½ÃÁö¸¦ º¸³»Áö ¾Ê½À´Ï´Ù.
|
|
// TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù.
|
UpdateData(TRUE);
|
OnEnChangeEditSysSystemGantryCount();
|
}
|
|
void CDlgSystem::OnTcnSelchangeTabSysSystemTab(NMHDR *pNMHDR, LRESULT *pResult)
|
{
|
// TODO: ¿©±â¿¡ ÄÁÆ®·Ñ ¾Ë¸² 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù.
|
int nIdx;
|
|
nIdx = m_ctrlTabSystem.GetCurSel();
|
|
switch(nIdx)
|
{
|
case TAB_GANTRY_INFO:
|
m_pDlgSystemGantry->ShowWindow(SW_SHOW);
|
m_pDlgSystemHeader->ShowWindow(SW_HIDE);
|
m_pDlgSystemCamera->ShowWindow(SW_HIDE);
|
m_pDlgSystemLight->ShowWindow(SW_HIDE);
|
m_pDlgSystemRevolver->ShowWindow(SW_HIDE);
|
m_pDlgSystemAFM->ShowWindow(SW_HIDE);
|
m_pDlgSystemWSI->ShowWindow(SW_HIDE);
|
break;
|
case TAB_HEADER_INFO:
|
m_pDlgSystemGantry->ShowWindow(SW_HIDE);
|
m_pDlgSystemHeader->ShowWindow(SW_SHOW);
|
m_pDlgSystemCamera->ShowWindow(SW_HIDE);
|
m_pDlgSystemLight->ShowWindow(SW_HIDE);
|
m_pDlgSystemRevolver->ShowWindow(SW_HIDE);
|
m_pDlgSystemAFM->ShowWindow(SW_HIDE);
|
m_pDlgSystemWSI->ShowWindow(SW_HIDE);
|
break;
|
case TAB_CAMERA_INFO:
|
m_pDlgSystemGantry->ShowWindow(SW_HIDE);
|
m_pDlgSystemHeader->ShowWindow(SW_HIDE);
|
m_pDlgSystemCamera->ShowWindow(SW_SHOW);
|
m_pDlgSystemLight->ShowWindow(SW_HIDE);
|
m_pDlgSystemRevolver->ShowWindow(SW_HIDE);
|
m_pDlgSystemAFM->ShowWindow(SW_HIDE);
|
m_pDlgSystemWSI->ShowWindow(SW_HIDE);
|
break;
|
case TAB_LIGHT_INFO:
|
m_pDlgSystemGantry->ShowWindow(SW_HIDE);
|
m_pDlgSystemHeader->ShowWindow(SW_HIDE);
|
m_pDlgSystemCamera->ShowWindow(SW_HIDE);
|
m_pDlgSystemLight->ShowWindow(SW_SHOW);
|
m_pDlgSystemRevolver->ShowWindow(SW_HIDE);
|
m_pDlgSystemAFM->ShowWindow(SW_HIDE);
|
m_pDlgSystemWSI->ShowWindow(SW_HIDE);
|
break;
|
case TAB_REVOLVER_INFO:
|
m_pDlgSystemGantry->ShowWindow(SW_HIDE);
|
m_pDlgSystemHeader->ShowWindow(SW_HIDE);
|
m_pDlgSystemCamera->ShowWindow(SW_HIDE);
|
m_pDlgSystemLight->ShowWindow(SW_HIDE);
|
m_pDlgSystemRevolver->ShowWindow(SW_SHOW);
|
m_pDlgSystemAFM->ShowWindow(SW_HIDE);
|
m_pDlgSystemWSI->ShowWindow(SW_HIDE);
|
break;
|
case TAB_AFM_INFO:
|
m_pDlgSystemGantry->ShowWindow(SW_HIDE);
|
m_pDlgSystemHeader->ShowWindow(SW_HIDE);
|
m_pDlgSystemCamera->ShowWindow(SW_HIDE);
|
m_pDlgSystemLight->ShowWindow(SW_HIDE);
|
m_pDlgSystemRevolver->ShowWindow(SW_HIDE);
|
m_pDlgSystemAFM->ShowWindow(SW_SHOW);
|
m_pDlgSystemWSI->ShowWindow(SW_HIDE);
|
break;
|
case TAB_WSI_INFO:
|
m_pDlgSystemGantry->ShowWindow(SW_HIDE);
|
m_pDlgSystemHeader->ShowWindow(SW_HIDE);
|
m_pDlgSystemCamera->ShowWindow(SW_HIDE);
|
m_pDlgSystemLight->ShowWindow(SW_HIDE);
|
m_pDlgSystemRevolver->ShowWindow(SW_HIDE);
|
m_pDlgSystemAFM->ShowWindow(SW_HIDE);
|
m_pDlgSystemWSI->ShowWindow(SW_SHOW);
|
break;
|
default:
|
break;
|
}
|
|
*pResult = 0;
|
}
|
|
void CDlgSystem::InitSystemInfoGridControl()
|
{
|
int nRowIdx, nColIdx, nRows, nCols, nFixRows, nFixCols;
|
int nMargin, nDataColumnWidth;
|
CString strTemp;
|
CRect rect;
|
|
nRows = m_nGantryCount + 1;
|
nCols = SYSTEM_INFO_GRID_COL_COUNT;
|
nFixRows = 1;
|
nFixCols = 0;
|
nRowIdx = 0;
|
nColIdx = 0;
|
nMargin = 22;
|
|
m_ctrlGridSystemInfo.GetWindowRect(&rect);
|
m_ctrlGridSystemInfo.GetDefaultCell(FALSE, FALSE)->SetBackClr(RGB(0xFF, 0xFF, 0xE0));
|
m_ctrlGridSystemInfo.SetRowCount(nRows);
|
m_ctrlGridSystemInfo.SetColumnCount(nCols);
|
m_ctrlGridSystemInfo.SetFixedRowCount(nFixRows);
|
m_ctrlGridSystemInfo.SetFixedColumnCount(nFixCols);
|
//m_ctrlGridSystemInfo.SetEditable(FALSE);
|
m_ctrlGridSystemInfo.SetListMode(TRUE);
|
nDataColumnWidth = (rect.Width() - nMargin) / SYSTEM_INFO_GRID_COL_COUNT;
|
|
GV_ITEM Item;
|
|
Item.mask = GVIF_TEXT;
|
Item.row = nRowIdx;
|
Item.col = nColIdx;
|
strTemp.Format(_T("Gantry Idx"));//_T("°ÕÆ®¸® À妽º"));
|
Item.strText = strTemp;
|
m_ctrlGridSystemInfo.SetItem(&Item);
|
m_ctrlGridSystemInfo.SetColumnWidth(nColIdx++, nDataColumnWidth);
|
|
Item.col = nColIdx;
|
strTemp.Format(_T("Header Idx"));//_T("Çì´õ À妽º"));
|
Item.strText = strTemp;
|
m_ctrlGridSystemInfo.SetItem(&Item);
|
m_ctrlGridSystemInfo.SetColumnWidth(nColIdx++, nDataColumnWidth);
|
|
Item.col = nColIdx;
|
strTemp.Format(_T("Camera Cnt"));//_T("Ä«¸Þ¶ó °³¼ö"));
|
Item.strText = strTemp;
|
m_ctrlGridSystemInfo.SetItem(&Item);
|
m_ctrlGridSystemInfo.SetColumnWidth(nColIdx++, nDataColumnWidth);
|
|
Item.col = nColIdx;
|
strTemp.Format(_T("Light Cnt"));//_T("Á¶¸í °³¼ö"));
|
Item.strText = strTemp;
|
m_ctrlGridSystemInfo.SetItem(&Item);
|
m_ctrlGridSystemInfo.SetColumnWidth(nColIdx++, nDataColumnWidth);
|
|
Item.col = nColIdx;
|
strTemp.Format(_T("Revolver Cnt"));//_T("¸®º¼¹ö °³¼ö"));
|
Item.strText = strTemp;
|
m_ctrlGridSystemInfo.SetItem(&Item);
|
m_ctrlGridSystemInfo.SetColumnWidth(nColIdx++, nDataColumnWidth);
|
|
Item.col = nColIdx;
|
strTemp.Format(_T("AFM Cnt"));//_T("AFM °³¼ö"));
|
Item.strText = strTemp;
|
m_ctrlGridSystemInfo.SetItem(&Item);
|
m_ctrlGridSystemInfo.SetColumnWidth(nColIdx++, nDataColumnWidth);
|
|
Item.col = nColIdx;
|
strTemp.Format(_T("WSI Cnt"));//_T("AFM °³¼ö"));
|
Item.strText = strTemp;
|
m_ctrlGridSystemInfo.SetItem(&Item);
|
m_ctrlGridSystemInfo.SetColumnWidth(nColIdx++, nDataColumnWidth);
|
}
|
|
void CDlgSystem::FillSystemInfo()
|
{
|
CReviewSystemSettingDlg* pDlg = (CReviewSystemSettingDlg*)AfxGetMainWnd();
|
if (pDlg==NULL) return;
|
|
CSystemInfo *pSystemInfo = pDlg->GetSys_SystemInfo();
|
if (pSystemInfo==NULL) return;
|
|
m_nGantryCount = 0;
|
m_nHeaderCount = 0;
|
m_nCameraCount = 0;
|
m_nLightCount = 0;
|
m_nRevolverCount = 0;
|
|
m_nGantryCount = pSystemInfo->GetGantryInfoCount();
|
CGantryInfo *pGantryInfo = pSystemInfo->GetGantryInfo(0);
|
if (pGantryInfo)
|
{
|
m_nHeaderCount = pGantryInfo->GetHeaderInfoCount();
|
CHeaderInfo *pHeaderInfo = pGantryInfo->GetHeaderInfo(0);
|
if (pHeaderInfo)
|
{
|
m_nCameraCount = pHeaderInfo->GetCameraInfoCount();
|
m_nLightCount = pHeaderInfo->GetLightInfoCount();
|
m_nRevolverCount = pHeaderInfo->GetRevolverInfoCount();
|
m_nAFMCount = pHeaderInfo->GetAFMInfoCount();
|
m_nWSICount = pHeaderInfo->GetWsiInfoCount();
|
}
|
}
|
|
UpdateData(FALSE);
|
|
OnEnChangeEditSysSystemGantryCount();
|
|
}
|
|
void CDlgSystem::CreateTabDlg()
|
{
|
CRect rtCtrl;
|
m_ctrlTabSystem.GetWindowRect(&rtCtrl);
|
ScreenToClient(&rtCtrl);
|
|
rtCtrl.DeflateRect(2, 22, 3, 2);
|
|
m_pDlgSystemGantry = new CDlgSystemGantry;
|
m_pDlgSystemGantry->Create(CDlgSystemGantry::IDD, this);
|
m_pDlgSystemGantry->MoveWindow(rtCtrl);
|
m_pDlgSystemGantry->ShowWindow(SW_SHOW);
|
|
m_pDlgSystemHeader = new CDlgSystemHeader;
|
m_pDlgSystemHeader->Create(CDlgSystemHeader::IDD, this);
|
m_pDlgSystemHeader->MoveWindow(rtCtrl);
|
|
m_pDlgSystemCamera = new CDlgSystemCamera;
|
m_pDlgSystemCamera->Create(CDlgSystemCamera::IDD, this);
|
m_pDlgSystemCamera->MoveWindow(rtCtrl);
|
|
m_pDlgSystemLight = new CDlgSystemLight;
|
m_pDlgSystemLight->Create(CDlgSystemLight::IDD, this);
|
m_pDlgSystemLight->MoveWindow(rtCtrl);
|
|
m_pDlgSystemRevolver = new CDlgSystemRevolver;
|
m_pDlgSystemRevolver->Create(CDlgSystemRevolver::IDD, this);
|
m_pDlgSystemRevolver->MoveWindow(rtCtrl);
|
|
m_pDlgSystemAFM = new CDlgSystemAFM;
|
m_pDlgSystemAFM->Create(CDlgSystemAFM::IDD, this);
|
m_pDlgSystemAFM->MoveWindow(rtCtrl);
|
|
m_pDlgSystemWSI = new CDlgSystemWSI;
|
m_pDlgSystemWSI->Create(CDlgSystemWSI::IDD, this);
|
m_pDlgSystemWSI->MoveWindow(rtCtrl);
|
}
|
|
void CDlgSystem::InitTabControl()
|
{
|
int nIdx = 0;
|
m_ctrlTabSystem.InsertItem(nIdx++, _T("Gantry Infomation"));//_T("°ÕÆ®¸® Á¤º¸"));
|
m_ctrlTabSystem.InsertItem(nIdx++, _T("Header Infomation"));//_T("Çì´õ Á¤º¸"));
|
m_ctrlTabSystem.InsertItem(nIdx++, _T("Camera Infomation"));//_T("Ä«¸Þ¶ó Á¤º¸"));
|
m_ctrlTabSystem.InsertItem(nIdx++, _T("Light Infomation"));//_T("Á¶¸í Á¤º¸"));
|
m_ctrlTabSystem.InsertItem(nIdx++, _T("Revolver Infomation"));//_T("¸®º¼¹ö Á¤º¸"));
|
m_ctrlTabSystem.InsertItem(nIdx++, _T("AFM Infomation"));//_T("AFM Á¤º¸"));
|
m_ctrlTabSystem.InsertItem(nIdx++, _T("WSI Infomation"));//_T("WSI Á¤º¸"));
|
}
|
|
void CDlgSystem::OnGridDblClick(NMHDR *pNotifyStruct, LRESULT* pResult)
|
{
|
CReviewSystemSettingDlg* pDlg = (CReviewSystemSettingDlg*)AfxGetMainWnd();
|
if (pDlg==NULL) return;
|
|
CSystemInfo *pSystemInfo = pDlg->GetSys_SystemInfo();
|
if (pSystemInfo==NULL) return;
|
|
int i, j, nGantryIdx, nHeaderIdx, nCameraCount, nLightCount, nRevolverCount, nAFMCount, nWSICount, nMagnificInfo;
|
CString strItemText = _T("");
|
NM_GRIDVIEW* pItem = (NM_GRIDVIEW*) pNotifyStruct;
|
|
int nIdx = pItem->iRow - 1;
|
|
if(nIdx >= 0)
|
{
|
strItemText = m_ctrlGridSystemInfo.GetItemText(pItem->iRow, 0);
|
nGantryIdx = _ttoi(strItemText);
|
|
strItemText = m_ctrlGridSystemInfo.GetItemText(pItem->iRow, 1);
|
nHeaderIdx = _ttoi(strItemText);
|
|
strItemText = m_ctrlGridSystemInfo.GetItemText(pItem->iRow, 2);
|
nCameraCount = _ttoi(strItemText);
|
|
strItemText = m_ctrlGridSystemInfo.GetItemText(pItem->iRow, 3);
|
nLightCount = _ttoi(strItemText);
|
|
strItemText = m_ctrlGridSystemInfo.GetItemText(pItem->iRow, 4);
|
nRevolverCount = _ttoi(strItemText);
|
|
strItemText = m_ctrlGridSystemInfo.GetItemText(pItem->iRow, 5);
|
nAFMCount = _ttoi(strItemText);
|
|
strItemText = m_ctrlGridSystemInfo.GetItemText(pItem->iRow, 6);
|
nWSICount = _ttoi(strItemText);
|
|
//°ÕÆ®¸® °¹¼ö
|
if(m_nGantryCount != pSystemInfo->GetGantryInfoCount())
|
{
|
pSystemInfo->SetGantryInfoCount(m_nGantryCount);
|
}
|
|
if(m_nGantryCount > 0)
|
{
|
//Çì´õ °¹¼ö
|
CGantryInfo *pGantryInfo = pSystemInfo->GetGantryInfo(0);
|
if (pGantryInfo)
|
{
|
if(m_nHeaderCount != pGantryInfo->GetHeaderInfoCount())
|
{
|
for(i = 0; i < m_nGantryCount; i++)
|
{
|
CGantryInfo *pGantryInfo = pDlg->GetSys_GantryInfo(i);
|
if (pGantryInfo==NULL) continue;
|
pGantryInfo->SetHeaderInfoCount(m_nHeaderCount);
|
}
|
}
|
}
|
|
CHeaderInfo *pHeaderInfo = pGantryInfo->GetHeaderInfo(0);
|
if (pHeaderInfo)
|
{
|
for(i = 0; i < m_nGantryCount; i++)
|
{
|
for(j = 0; j < m_nHeaderCount; j++)
|
{
|
CHeaderInfo *pHeaderInfo = pDlg->GetSys_HeaderInfo(i, j);
|
if (pHeaderInfo==NULL) continue;
|
|
nMagnificInfo = pHeaderInfo->GetMagnificInfoCount();
|
/*if (m_nCameraCount!=pHeaderInfo->GetCameraInfoCount())
|
{
|
pHeaderInfo->SetCameraInfoCount(m_nCameraCount);
|
}
|
|
if (m_nLightCount!=pHeaderInfo->GetLightInfoCount())
|
{
|
pHeaderInfo->SetLightInfoCount(m_nLightCount);
|
}
|
|
if (m_nRevolverCount!=pHeaderInfo->GetRevolverInfoCount())
|
{
|
pHeaderInfo->SetRevolverInfoCount(m_nRevolverCount);
|
}
|
|
if (m_nAFMCount!=pHeaderInfo->GetAFMInfoCount())
|
{
|
pHeaderInfo->SetAFMInfoCount(m_nAFMCount);
|
}*/
|
}
|
}
|
|
}
|
}
|
|
if(m_pDlgSystemGantry)
|
{
|
m_pDlgSystemGantry->UpdateDialogData(nGantryIdx, nHeaderIdx);
|
}
|
|
if(m_pDlgSystemHeader)
|
{
|
m_pDlgSystemHeader->UpdateDialogData(nGantryIdx, nHeaderIdx);
|
}
|
|
if(m_pDlgSystemCamera)
|
{
|
m_pDlgSystemCamera->UpdateDialogData(nGantryIdx, nHeaderIdx, nCameraCount);
|
}
|
|
if(m_pDlgSystemLight)
|
{
|
m_pDlgSystemLight->UpdateDialogData(nGantryIdx, nHeaderIdx, nLightCount);
|
}
|
|
if(m_pDlgSystemRevolver)
|
{
|
m_pDlgSystemRevolver->UpdateDialogData(nGantryIdx, nHeaderIdx, nRevolverCount);
|
}
|
|
if (m_pDlgSystemAFM)
|
{
|
m_pDlgSystemAFM->UpdateDialogData(nGantryIdx, nHeaderIdx, nAFMCount);
|
}
|
|
if (m_pDlgSystemWSI)
|
{
|
m_pDlgSystemWSI->UpdateDialogData(nGantryIdx, nHeaderIdx, nWSICount);
|
}
|
}
|
}
|
|
void CDlgSystem::OnCbnSelchangeComboLineType()
|
{
|
int nLineType = m_ctrlLineType.GetCurSel();
|
|
InitMachineType(nLineType);
|
}
|