»õ ÆÄÀÏ |
| | |
| | | // 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")); |
| | | } |