From bd13fa3f9396f1f681759f4623c55d5f91d74a9c Mon Sep 17 00:00:00 2001
From: LYW <leeyeanwoo@diteam.co.kr>
Date: 목, 29 7월 2021 11:42:19 +0900
Subject: [PATCH] Ongoing90 #3524 CF AOI Review 디포커스 알람 추가 및 FDC 보고 방식 개선

---
 ReviewHistory/ReveiwHistory/PathSettingDlg.cpp |  297 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 297 insertions(+), 0 deletions(-)

diff --git a/ReviewHistory/ReveiwHistory/PathSettingDlg.cpp b/ReviewHistory/ReveiwHistory/PathSettingDlg.cpp
new file mode 100644
index 0000000..d5f7424
--- /dev/null
+++ b/ReviewHistory/ReveiwHistory/PathSettingDlg.cpp
@@ -0,0 +1,297 @@
+癤�// PathSettingDlg.cpp: 援ы쁽 �뙆�씪
+//
+
+#include "stdafx.h"
+#include "ReveiwHistory.h"
+#include "PathSettingDlg.h"
+#include "afxdialogex.h"
+
+#define PathSettingFilePath	( _T("PathSetting.ini") )
+// CPathSettingDlg ���솕 �긽�옄
+
+IMPLEMENT_DYNAMIC(CPathSettingDlg, CDialogEx)
+
+CPathSettingDlg::CPathSettingDlg(CWnd* pParent /*=nullptr*/)
+	: CDialogEx(IDD_DLG_PATH_SETTING, pParent)
+{
+	m_strBinPath.Empty();
+	m_strInspectorPath.Empty();
+	m_strReviewPath.Empty();
+	m_strAlignPath.Empty();
+}
+
+CPathSettingDlg::~CPathSettingDlg()
+{
+}
+
+void CPathSettingDlg::DoDataExchange(CDataExchange* pDX)
+{
+	CDialogEx::DoDataExchange(pDX);
+}
+
+
+BEGIN_MESSAGE_MAP(CPathSettingDlg, CDialogEx)
+	ON_BN_CLICKED(IDC_BTN_BIN_PATH, &CPathSettingDlg::OnBnClickedBtnBinPath)
+	ON_BN_CLICKED(IDC_BTN_INSPECTOR_PATH, &CPathSettingDlg::OnBnClickedBtnInspectorPath)
+	ON_BN_CLICKED(IDC_BTN_REVIEW_PATH, &CPathSettingDlg::OnBnClickedBtnReviewPath)
+	ON_BN_CLICKED(IDC_BTN_ALIGN_PATH, &CPathSettingDlg::OnBnClickedBtnAlignPath)
+	ON_BN_CLICKED(IDC_BTN_SAVE, &CPathSettingDlg::OnBnClickedBtnSave)
+	ON_BN_CLICKED(IDCANCEL, &CPathSettingDlg::OnBnClickedCancel)
+END_MESSAGE_MAP()
+
+
+// CPathSettingDlg 硫붿떆吏� 泥섎━湲�
+BOOL CPathSettingDlg::Create(CWnd* pParentWnd)
+{
+	return CDialogEx::Create(IDD, pParentWnd);
+}
+
+BOOL CPathSettingDlg::PreTranslateMessage(MSG* pMsg)
+{
+	// TODO: �뿬湲곗뿉 �듅�닔�솕�맂 肄붾뱶瑜� 異붽� 諛�/�삉�뒗 湲곕낯 �겢�옒�뒪瑜� �샇異쒗빀�땲�떎.
+	if (pMsg->message == WM_KEYDOWN)
+	{
+		if (pMsg->wParam == VK_ESCAPE)
+		{
+			ShowWindow(SW_HIDE);
+
+			return TRUE;
+		}
+	}
+
+	return __super::PreTranslateMessage(pMsg);
+}
+
+void CPathSettingDlg::OnDestroy()
+{
+	CDialogEx::OnDestroy();
+}
+
+void CPathSettingDlg::OnShowWindow(BOOL bShow, UINT nStatus)
+{
+	__super::OnShowWindow(bShow, nStatus);
+
+	// TODO: �뿬湲곗뿉 硫붿떆吏� 泥섎━湲� 肄붾뱶瑜� 異붽��빀�땲�떎.
+	if (TRUE == bShow)
+	{
+	}
+}
+
+void CPathSettingDlg::OnBnClickedBtnBinPath()
+{
+	// TODO: �뿬湲곗뿉 而⑦듃濡� �븣由� 泥섎━湲� 肄붾뱶瑜� 異붽��빀�땲�떎.
+	ITEMIDLIST *pidlBrowse;
+	CString strPath;
+
+	BROWSEINFO BrInfo;
+
+	BrInfo.hwndOwner = GetSafeHwnd();
+	BrInfo.pidlRoot = NULL;
+
+	memset(&BrInfo, 0, sizeof(BrInfo));
+	BrInfo.lpszTitle = _T("Please select a folder that contains Bin files");
+	BrInfo.ulFlags = BIF_RETURNONLYFSDIRS;
+	pidlBrowse = SHBrowseForFolder(&BrInfo);
+	TCHAR szPathName[200];
+
+	::SHGetPathFromIDList(pidlBrowse, szPathName);
+
+	CString strTmpPath = (LPCTSTR)szPathName;
+	CFileFind finder;
+	BOOL bFindPath = finder.FindFile(strTmpPath);
+
+	if (bFindPath)
+	{
+		SetDlgItemText(IDC_EDIT_BIN_PATH, strTmpPath);
+	}
+
+	LOG(Dbg, _T("[PathSetting] Bin Path Setting"));
+}
+
+
+void CPathSettingDlg::OnBnClickedBtnInspectorPath()
+{
+	// TODO: �뿬湲곗뿉 而⑦듃濡� �븣由� 泥섎━湲� 肄붾뱶瑜� 異붽��빀�땲�떎.
+	ITEMIDLIST *pidlBrowse;
+	CString strPath;
+
+	BROWSEINFO BrInfo;
+
+	BrInfo.hwndOwner = GetSafeHwnd();
+	BrInfo.pidlRoot = NULL;
+
+	memset(&BrInfo, 0, sizeof(BrInfo));
+	BrInfo.lpszTitle = _T("Please select a folder that contains Inspector Image files");
+	BrInfo.ulFlags = BIF_RETURNONLYFSDIRS;
+	pidlBrowse = SHBrowseForFolder(&BrInfo);
+	TCHAR szPathName[200];
+
+	::SHGetPathFromIDList(pidlBrowse, szPathName);
+
+	CString strTmpPath = (LPCTSTR)szPathName;
+	CFileFind finder;
+	BOOL bFindPath = finder.FindFile(strTmpPath);
+
+	if (bFindPath)
+	{
+		SetDlgItemText(IDC_EDIT_INSPECTOR_PATH, strTmpPath);
+	}
+
+	LOG(Dbg, _T("[PathSetting] Align Inspector Setting"));
+}
+
+
+void CPathSettingDlg::OnBnClickedBtnReviewPath()
+{
+	// TODO: �뿬湲곗뿉 而⑦듃濡� �븣由� 泥섎━湲� 肄붾뱶瑜� 異붽��빀�땲�떎.
+	ITEMIDLIST *pidlBrowse;
+	CString strPath;
+
+	BROWSEINFO BrInfo;
+
+	BrInfo.hwndOwner = GetSafeHwnd();
+	BrInfo.pidlRoot = NULL;
+
+	memset(&BrInfo, 0, sizeof(BrInfo));
+	BrInfo.lpszTitle = _T("Please select a folder that contains Review Image files");
+	BrInfo.ulFlags = BIF_RETURNONLYFSDIRS;
+	pidlBrowse = SHBrowseForFolder(&BrInfo);
+	TCHAR szPathName[200];
+
+	::SHGetPathFromIDList(pidlBrowse, szPathName);
+
+	CString strTmpPath = (LPCTSTR)szPathName;
+	CFileFind finder;
+	BOOL bFindPath = finder.FindFile(strTmpPath);
+
+	if (bFindPath)
+	{
+		SetDlgItemText(IDC_EDIT_REVIEW_PATH, strTmpPath);
+	}
+	LOG(Dbg, _T("[PathSetting] Review Path Setting"));
+}
+
+
+void CPathSettingDlg::OnBnClickedBtnAlignPath()
+{
+	// TODO: �뿬湲곗뿉 而⑦듃濡� �븣由� 泥섎━湲� 肄붾뱶瑜� 異붽��빀�땲�떎.
+	ITEMIDLIST *pidlBrowse;
+	CString strPath;
+
+	BROWSEINFO BrInfo;
+
+	BrInfo.hwndOwner = GetSafeHwnd();
+	BrInfo.pidlRoot = NULL;
+
+	memset(&BrInfo, 0, sizeof(BrInfo));
+	BrInfo.lpszTitle = _T("Please select a folder that contains Align Image files");
+	BrInfo.ulFlags = BIF_RETURNONLYFSDIRS;
+	pidlBrowse = SHBrowseForFolder(&BrInfo);
+	TCHAR szPathName[200];
+
+	::SHGetPathFromIDList(pidlBrowse, szPathName);
+
+	CString strTmpPath = (LPCTSTR)szPathName;
+	CFileFind finder;
+	BOOL bFindPath = finder.FindFile(strTmpPath);
+
+	if (bFindPath)
+	{
+		SetDlgItemText(IDC_EDIT_ALIGN_PATH, strTmpPath);
+	}
+
+	LOG(Dbg, _T("[PathSetting] Align Path Setting"));
+}
+
+
+void CPathSettingDlg::OnBnClickedBtnSave()
+{
+	// TODO: �뿬湲곗뿉 而⑦듃濡� �븣由� 泥섎━湲� 肄붾뱶瑜� 異붽��빀�땲�떎.
+	CString strFilePath;
+	strFilePath.Format("%s\\Config\\%s", GetExePath(), PathSettingFilePath);
+
+	GetDlgItemText(IDC_EDIT_ALIGN_PATH, m_strAlignPath);
+	INIWriteStr("Path", "Align", m_strAlignPath, strFilePath);
+	GetDlgItemText(IDC_EDIT_BIN_PATH, m_strBinPath);
+	INIWriteStr("Path", "Bin", m_strBinPath, strFilePath);
+	GetDlgItemText(IDC_EDIT_INSPECTOR_PATH, m_strInspectorPath);
+	INIWriteStr("Path", "Inspector", m_strInspectorPath, strFilePath);
+	GetDlgItemText(IDC_EDIT_REVIEW_PATH, m_strReviewPath);
+	INIWriteStr("Path", "Review", m_strReviewPath, strFilePath);
+
+	AfxMessageBox(_T("���옣 �릺�뿀�뒿�땲�떎"), MB_OK | MB_ICONWARNING);
+
+	LOG(Dbg, _T("[PathSetting] PathSetting Save"));
+
+	ShowWindow(SW_HIDE);
+}
+
+void CPathSettingDlg::OnBnClickedCancel()
+{
+	// TODO: �뿬湲곗뿉 而⑦듃濡� �븣由� 泥섎━湲� 肄붾뱶瑜� 異붽��빀�땲�떎.
+	CString strTemp;
+	strTemp.Format(_T(""));
+
+	if (m_strAlignPath == "")
+	{
+		m_strAlignPath.Format(_T("D:\\ResultData\\Align\\"));
+	}
+	if (m_strBinPath == "")
+	{
+		m_strBinPath.Format(_T("D:\\DIT_ResultData\\RawBin\\"));
+	}
+	if (m_strInspectorPath == "")
+	{
+		m_strInspectorPath.Format(_T("\\\\126.100.100.1\\D\\Image\\Defect\\"));
+	}
+	if (m_strReviewPath == "")
+	{
+		m_strReviewPath.Format(_T("D:\\ResultData\\UploadImage\\"));
+	}
+
+	SetDlgItemText(IDC_EDIT_ALIGN_PATH, m_strAlignPath);
+	SetDlgItemText(IDC_EDIT_BIN_PATH, m_strBinPath);
+	SetDlgItemText(IDC_EDIT_INSPECTOR_PATH, m_strInspectorPath);
+	SetDlgItemText(IDC_EDIT_REVIEW_PATH, m_strReviewPath);
+
+	LOG(Dbg, _T("[PathSetting] PathSetting Cancel"));
+
+	ShowWindow(SW_HIDE);
+}
+
+void CPathSettingDlg::PathSettingLoad()
+{
+	// TODO: �뿬湲곗뿉 而⑦듃濡� �븣由� 泥섎━湲� 肄붾뱶瑜� 異붽��빀�땲�떎.
+	CString strFilePath;
+	strFilePath.Format(_T("%s\\Config\\%s"), GetExePath(), PathSettingFilePath);
+
+	CString strAppName = _T("Path");
+	m_strAlignPath = INIReadStr(strAppName, _T("Align"), strFilePath);
+	m_strBinPath = INIReadStr(strAppName, _T("Bin"), strFilePath);
+	m_strInspectorPath = INIReadStr(strAppName, _T("Inspector"), strFilePath);
+	m_strReviewPath = INIReadStr(strAppName, _T("Review"), strFilePath);
+
+	if (m_strAlignPath == "")
+	{
+		m_strAlignPath.Format(_T("D:\\ResultData\\Align\\"));
+	}
+	if (m_strBinPath == "")
+	{
+		m_strBinPath.Format(_T("D:\\DIT_ResultData\\RawBin\\"));
+	}
+	if (m_strInspectorPath == "")
+	{
+		m_strInspectorPath.Format(_T("\\\\126.100.100.1\\D\\Image\\Defect\\"));
+	}
+	if (m_strReviewPath == "")
+	{
+		m_strReviewPath.Format(_T("D:\\ResultData\\UploadImage\\"));
+	}
+
+	SetDlgItemText(IDC_EDIT_ALIGN_PATH, m_strAlignPath);
+	SetDlgItemText(IDC_EDIT_BIN_PATH, m_strBinPath);
+	SetDlgItemText(IDC_EDIT_INSPECTOR_PATH, m_strInspectorPath);
+	SetDlgItemText(IDC_EDIT_REVIEW_PATH, m_strReviewPath);
+
+	LOG(Dbg, _T("[PathSetting] Start Review Path Setting Load"));
+}
\ No newline at end of file

--
Gitblit v1.9.3