From e8ba1e78e72f3f7ec2841f55fd90253b4dc414df Mon Sep 17 00:00:00 2001
From: LYW <leeyeanwoo@diteam.co.kr>
Date: 목, 14 10월 2021 14:15:04 +0900
Subject: [PATCH] Ongoing60 #3671 CF AOI Review 전설비 Align Matching 방법 개선

---
 ReviewSystem/ReviewRecipeEditor/DlgAlign.cpp |  125 +++++++++++++++++++++++++++++++++++++++--
 1 files changed, 118 insertions(+), 7 deletions(-)

diff --git a/ReviewSystem/ReviewRecipeEditor/DlgAlign.cpp b/ReviewSystem/ReviewRecipeEditor/DlgAlign.cpp
index 96e4780..453c49c 100644
--- a/ReviewSystem/ReviewRecipeEditor/DlgAlign.cpp
+++ b/ReviewSystem/ReviewRecipeEditor/DlgAlign.cpp
@@ -19,6 +19,10 @@
 {
 	m_pFirstView = new CCHImageView(this);
 	m_pSecondView = new CCHImageView(this);
+	/*< LYW 20211012 - #3671 ADD Start >*/
+	m_pFirstAssistantView = new CCHImageView(this);
+	m_pSecondAssistantView = new CCHImageView(this);
+	/*< LYW 20211012 - #3671 ADD End >*/
 }
 
 CDlgAlign::~CDlgAlign()
@@ -34,7 +38,19 @@
 		delete m_pSecondView;
 		m_pSecondView = NULL;
 	}
+	/*< LYW 20211012 - #3671 ADD Start >*/
+	if (m_pFirstAssistantView)
+	{
+		delete m_pFirstAssistantView;
+		m_pFirstAssistantView = NULL;
+	}
 
+	if (m_pSecondAssistantView)
+	{
+		delete m_pSecondAssistantView;
+		m_pSecondAssistantView = NULL;
+	}
+	/*< LYW 20211012 - #3671 ADD End >*/
 }
 
 void CDlgAlign::DoDataExchange(CDataExchange* pDX)
@@ -100,6 +116,16 @@
 		{
 			m_pSecondView->Invalidate(TRUE);
 		}
+		/*< LYW 20211012 - #3671 ADD Start >*/
+		else if (nIdx == 2 && m_pFirstAssistantView->LoadImage(strFilepath))
+		{
+			m_pFirstAssistantView->Invalidate(TRUE);
+		}
+		else if (nIdx == 3 && m_pSecondAssistantView->LoadImage(strFilepath))
+		{
+			m_pSecondAssistantView->Invalidate(TRUE);
+		}
+		/*< LYW 20211012 - #3671 ADD End >*/
 		
 
 		m_ctrlGridAlignImageInfo.SetItemText(nIdx, 1, strFilename);
@@ -131,8 +157,8 @@
 		CRect rect;
 		rect.left = 10;
 		rect.top = 550;
-		rect.right = rect.left + 232;
-		rect.bottom = rect.top + 232;
+		rect.right = rect.left + 150;
+		rect.bottom = rect.top + 150;
 
 		m_pFirstView->Create(NULL, NULL, WS_CHILD | WS_VISIBLE | LBS_NOTIFY , rect, this, 0);
 		m_pFirstView->SetDrawType(DrawFit);
@@ -144,16 +170,46 @@
 	if (m_pSecondView)
 	{
 		CRect rect;
-		rect.left = 244;
+		rect.left = 161;
 		rect.top = 550;
-		rect.right = rect.left + 232;
-		rect.bottom = rect.top + 232;
+		rect.right = rect.left + 150;
+		rect.bottom = rect.top + 150;
 
 		m_pSecondView->Create(NULL, NULL, WS_CHILD | WS_VISIBLE | LBS_NOTIFY , rect, this, 0);
 		m_pSecondView->SetDrawType(DrawFit);
 		m_pSecondView->SetViewName(_T("Second"));
 		m_pSecondView->ShowWindow(SW_SHOW);
 	}
+
+	/*< LYW 20211012 - #3671 ADD Start >*/
+	if (m_pFirstAssistantView)
+	{
+		CRect rect;
+		rect.left = 10;
+		rect.top = 701;
+		rect.right = rect.left + 150;
+		rect.bottom = rect.top + 150;
+
+		m_pFirstAssistantView->Create(NULL, NULL, WS_CHILD | WS_VISIBLE | LBS_NOTIFY, rect, this, 0);
+		m_pFirstAssistantView->SetDrawType(DrawFit);
+		m_pFirstAssistantView->SetViewName(_T("FirstAssistant"));
+		m_pFirstAssistantView->ShowWindow(SW_SHOW);
+	}
+
+	if (m_pSecondAssistantView)
+	{
+		CRect rect;
+		rect.left = 161;
+		rect.top = 701;
+		rect.right = rect.left + 150;
+		rect.bottom = rect.top + 150;
+
+		m_pSecondAssistantView->Create(NULL, NULL, WS_CHILD | WS_VISIBLE | LBS_NOTIFY, rect, this, 0);
+		m_pSecondAssistantView->SetDrawType(DrawFit);
+		m_pSecondAssistantView->SetViewName(_T("SecondAssistant"));
+		m_pSecondAssistantView->ShowWindow(SW_SHOW);
+	}
+	/*< LYW 20211012 - #3671 ADD End >*/
 
 	return TRUE;  // return TRUE unless you set the focus to a control
 	// 예외: OCX 속성 페이지는 FALSE를 반환해야 합니다.
@@ -316,6 +372,12 @@
 	nRowIdx++;
 	pRcpRsAlignManager->GetRsRcpAlignInfo()->m_strSecondImageFile = m_ctrlGridAlignImageInfo.GetItemText(nRowIdx, nColIdx);
 	nRowIdx++;
+	/*< LYW 20211012 - #3671 ADD Start >*/
+	pRcpRsAlignManager->GetRsRcpAlignInfo()->m_strFirstAssistantImageFile = m_ctrlGridAlignImageInfo.GetItemText(nRowIdx, nColIdx);
+	nRowIdx++;
+	pRcpRsAlignManager->GetRsRcpAlignInfo()->m_strSecondAssistantImageFile = m_ctrlGridAlignImageInfo.GetItemText(nRowIdx, nColIdx);
+	nRowIdx++;
+	/*< LYW 20211012 - #3671 ADD End >*/
 
 	strItemText = m_ctrlGridAlignImageInfo.GetItemText(nRowIdx, nColIdx);
 	pRcpRsAlignManager->GetRsRcpAlignInfo()->m_dMatchingRate = _tcstod(strItemText, NULL);
@@ -548,6 +610,22 @@
 	Item.strText = strTemp;
 	m_ctrlGridAlignImageInfo.SetItem(&Item);
 
+	/*< LYW 20211012 - #3671 ADD Start >*/
+	nRowIdx++;
+	Item.row = nRowIdx;
+	Item.col = nColIdx;
+	strTemp.Format(_T("1st Assist Mark"));
+	Item.strText = strTemp;
+	m_ctrlGridAlignImageInfo.SetItem(&Item);
+
+	nRowIdx++;
+	Item.row = nRowIdx;
+	Item.col = nColIdx;
+	strTemp.Format(_T("2nd Assist Mark"));
+	Item.strText = strTemp;
+	m_ctrlGridAlignImageInfo.SetItem(&Item);
+	/*< LYW 20211012 - #3671 ADD End >*/
+
 	nRowIdx++;
 	Item.row = nRowIdx;
 	Item.col = nColIdx;
@@ -611,15 +689,48 @@
 	m_ctrlGridAlignImageInfo.SetCellType(nRowIdx, nColIdx, RUNTIME_CLASS(CGridCellButton));
 	pCellButton = (CGridCellButton*)m_ctrlGridAlignImageInfo.GetCell(nRowIdx, nColIdx);
 	pCellButton->SetText(_T("Browser"));
+
+	/*< LYW 20211012 - #3671 ADD Start >*/
+	// first Assistant
+	nRowIdx = 2;
+	nColIdx = 1;
+	strItemText = pRcpRsAlignManager->GetRsRcpAlignInfo()->m_strFirstAssistantImageFile;
+	m_ctrlGridAlignImageInfo.SetItemText(nRowIdx, nColIdx, strItemText);
+
+	strFilename = ALIGN_IMAGE_PATH;
+	strFilename = strFilename + _T("\\") + strItemText;
+	m_pFirstAssistantView->LoadImage(strFilename);
+	/*m_pFirstView->Invalidate(TRUE);*/
+
+	nColIdx = 2;
+	m_ctrlGridAlignImageInfo.SetCellType(nRowIdx, nColIdx, RUNTIME_CLASS(CGridCellButton));
+	pCellButton = (CGridCellButton*)m_ctrlGridAlignImageInfo.GetCell(nRowIdx, nColIdx);
+	pCellButton->SetText(_T("Browser"));
+
+	// second Assistant
+	nRowIdx = 3;
+	nColIdx = 1;
+	strItemText = pRcpRsAlignManager->GetRsRcpAlignInfo()->m_strSecondAssistantImageFile;
+	m_ctrlGridAlignImageInfo.SetItemText(nRowIdx, nColIdx, strItemText);
+	strFilename = ALIGN_IMAGE_PATH;
+	strFilename = strFilename + _T("\\") + strItemText;
+	m_pSecondAssistantView->LoadImage(strFilename);
+	//m_pSecondView->Invalidate(TRUE);
+
+	nColIdx = 2;
+	m_ctrlGridAlignImageInfo.SetCellType(nRowIdx, nColIdx, RUNTIME_CLASS(CGridCellButton));
+	pCellButton = (CGridCellButton*)m_ctrlGridAlignImageInfo.GetCell(nRowIdx, nColIdx);
+	pCellButton->SetText(_T("Browser"));
+	/*< LYW 20211012 - #3671 ADD End >*/
 	//
 
-	nRowIdx = 2;
+	nRowIdx = 4;
 	nColIdx = 1;
 	strItemText.Format(_T("%.3lf"), pRcpRsAlignManager->GetRsRcpAlignInfo()->m_dMatchingRate);
 	m_ctrlGridAlignImageInfo.SetItemText(nRowIdx, nColIdx, strItemText);
 	
 	//
-	nRowIdx = 3; 
+	nRowIdx = 5; 
 	nColIdx = 1;
 	strItemText = pRcpRsAlignManager->GetRsRcpAlignInfo()->m_strTotalPitchImageFile;
 	m_ctrlGridAlignImageInfo.SetItemText(nRowIdx, nColIdx, strItemText);

--
Gitblit v1.9.3