From 9ad2aa59da822e9d30c5e0cd677025fe6e12df95 Mon Sep 17 00:00:00 2001 From: LYW <leeyeanwoo@diteam.co.kr> Date: 화, 09 11월 2021 17:37:17 +0900 Subject: [PATCH] Ongoing90 #3662 CF AOI Review 전설비 알람 발생 조치 --- ReviewHistory/ReveiwHistory/PathSettingDlg.cpp | 336 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 336 insertions(+), 0 deletions(-) diff --git a/ReviewHistory/ReveiwHistory/PathSettingDlg.cpp b/ReviewHistory/ReveiwHistory/PathSettingDlg.cpp new file mode 100644 index 0000000..73c9669 --- /dev/null +++ b/ReviewHistory/ReveiwHistory/PathSettingDlg.cpp @@ -0,0 +1,336 @@ +癤�// 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); + DDX_Control(pDX, IDC_COMBO_OFFSET_DIRECTION_X, m_comboDirectionX); + DDX_Control(pDX, IDC_COMBO_OFFSET_DIRECTION_Y, m_comboDirectionY); +} + + +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); + /*< LYW 20211018 - #3684 ADD Start >*/ + CString strTemp; + strTemp.Format(_T("%d"), m_comboDirectionX.GetCurSel()); + INIWriteStr("Path", "DirectionX", strTemp, strFilePath); + strTemp.Format(_T("%d"), m_comboDirectionY.GetCurSel()); + INIWriteStr("Path", "DirectionY", strTemp, strFilePath); + + /*< LYW 20211018 - #3684 ADD End >*/ + + + 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); + + CString strTemp; + strTemp = INIReadStr(strAppName, _T("DirectionX"), strFilePath); + m_comboDirectionX.SetCurSel(_ttoi(strTemp)); + strTemp = INIReadStr(strAppName, _T("DirectionY"), strFilePath); + m_comboDirectionY.SetCurSel(_ttoi(strTemp)); + + 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")); +} + + +/*< LYW 20211018 - #3684 ADD Start >*/ +BOOL CPathSettingDlg::OnInitDialog() +{ + __super::OnInitDialog(); + + // TODO: �뿬湲곗뿉 異붽� 珥덇린�솕 �옉�뾽�쓣 異붽��빀�땲�떎. + m_comboDirectionX.AddString(_T("Nomal")); + m_comboDirectionX.AddString(_T("Reverse")); + m_comboDirectionY.AddString(_T("Nomal")); + m_comboDirectionY.AddString(_T("Reverse")); + + m_comboDirectionX.SetCurSel(0); + m_comboDirectionY.SetCurSel(0); + + return TRUE; // return TRUE unless you set the focus to a control + // �삁�쇅: OCX �냽�꽦 �럹�씠吏��뒗 FALSE瑜� 諛섑솚�빐�빞 �빀�땲�떎. +} +/*< LYW 20211018 - #3684 ADD End >*/ -- Gitblit v1.9.3