| | |
| | | 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); |
| | | } |
| | | |
| | | |
| | |
| | | BOOL CPathSettingDlg::Create(CWnd* pParentWnd) |
| | | { |
| | | return CDialogEx::Create(IDD, pParentWnd); |
| | | |
| | | |
| | | } |
| | | |
| | | BOOL CPathSettingDlg::PreTranslateMessage(MSG* pMsg) |
| | |
| | | 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); |
| | | |
| | |
| | | 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\\")); |
| | |
| | | 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 >*/ |
| | |
| | | CString GetInspectorPath() { return m_strInspectorPath; } |
| | | CString GetReviewPath() { return m_strReviewPath; } |
| | | CString GetAlignPath() { return m_strAlignPath; } |
| | | CComboBox m_comboDirectionX; |
| | | CComboBox m_comboDirectionY; |
| | | virtual BOOL OnInitDialog(); |
| | | }; |
| | |
| | | #include "akGridCtrl/GridCellCheck.h" |
| | | #include "akImageView.h" |
| | | #include <algorithm> |
| | | #include "MacroFile.h" |
| | | |
| | | #ifdef _DEBUG |
| | | #define new DEBUG_NEW |
| | |
| | | CReveiwHistoryDlg::CReveiwHistoryDlg(CWnd* pParent /*=nullptr*/) |
| | | : CDialogEx(IDD_DLG_REVIEWHISTORY, pParent) |
| | | , m_nFileCount(0) |
| | | , m_nEditCamIdx(0) |
| | | , m_nEditScanIdx(0) |
| | | , m_dEditOffsetX(0) |
| | | , m_dEditOffsetY(0) |
| | | , m_strGantryIdx(_T("")) |
| | | , m_TextLastSaveOffsetTime(_T("")) |
| | | { |
| | | m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); |
| | | |
| | |
| | | m_nImageCount = 0; |
| | | m_nCellCount = 0; |
| | | m_bAsending = FALSE; |
| | | /*< LYW 20211018 - #3684 ADD Start >*/ |
| | | m_dCurDefectIdx = 0; |
| | | m_dCurDefectID = 0; |
| | | /*< LYW 20211018 - #3684 ADD End >*/ |
| | | /*< LYW 20211029 - #3684 ADD Start >*/ |
| | | DWORD dwThreadId = 0; |
| | | HANDLE hThread = CreateThread(NULL, 0, RunThreadReviewHistory, this, 0, &dwThreadId); |
| | | m_ThreadId = dwThreadId; |
| | | /*< LYW 20211029 - #3684 ADD End >*/ |
| | | |
| | | for (int i = 0; i < 105; i++) |
| | | { |
| | |
| | | m_nImageSize[i] = 0; |
| | | } |
| | | } |
| | | |
| | | /*< LYW 20211029 - #3684 ADD Start >*/ |
| | | CReveiwHistoryDlg::~CReveiwHistoryDlg(void) |
| | | { |
| | | PostThreadMessage(m_ThreadId, WM_QUIT, 0, 0); |
| | | } |
| | | /*< LYW 20211029 - #3684 ADD End >*/ |
| | | |
| | | void CReveiwHistoryDlg::DoDataExchange(CDataExchange* pDX) |
| | | { |
| | |
| | | DDX_Text(pDX, IDC_EDIT_FILE_COUNT, m_nFileCount); |
| | | DDX_Control(pDX, IDC_EDIT_FILE_COUNT, m_ctlFileCount); |
| | | DDX_Control(pDX, IDC_PROGRESS_LOAD, m_ctlProgress); |
| | | DDX_Text(pDX, IDC_EDIT_OFFSET_CAM_IDX, m_nEditCamIdx); |
| | | DDX_Text(pDX, IDC_EDIT_OFFSET_SCAN_IDX, m_nEditScanIdx); |
| | | DDX_Text(pDX, IDC_EDIT_OFFSET_X, m_dEditOffsetX); |
| | | DDX_Text(pDX, IDC_EDIT_OFFSET_Y, m_dEditOffsetY); |
| | | DDX_Text(pDX, IDC_EDIT_DFFSET_GANTRY_IDX, m_strGantryIdx); |
| | | DDX_Text(pDX, IDC_STATIC_LAST_SAVE_OFFSET_TIME, m_TextLastSaveOffsetTime); |
| | | } |
| | | |
| | | BEGIN_MESSAGE_MAP(CReveiwHistoryDlg, CDialogEx) |
| | |
| | | ON_BN_CLICKED(IDC_BUTTON_MAPVIEW_FIT, &CReveiwHistoryDlg::OnBnClickedButtonMapviewFit) |
| | | ON_MESSAGE(UM_FORMMAP_DEFECTSELECT, OnMapDefectSelected) |
| | | ON_MESSAGE(UM_FORMMAP_DEFECTMOUSEOVER, OnMapDefectMouseOver) |
| | | ON_MESSAGE(UM_WARNING_OFFSET, OnDisplayWarning) |
| | | ON_MESSAGE(UM_FORMMAP_IMAGEMOUSECLICK, OnImageClick) |
| | | ON_COMMAND(ID_OPTION_PATHSETTING, &CReveiwHistoryDlg::OnOptionPathsetting) |
| | | ON_COMMAND(ID_VIEW_ALLDEFECT, &CReveiwHistoryDlg::OnViewAlldefect) |
| | | ON_COMMAND(ID_VIEW_REVIEWDEFECT, &CReveiwHistoryDlg::OnViewReviewdefect) |
| | |
| | | ON_BN_CLICKED(IDC_CHK_SINGLE, &CReveiwHistoryDlg::OnClickedChkSingle) |
| | | ON_EN_CHANGE(IDC_EDIT_FILE_COUNT, &CReveiwHistoryDlg::OnChangeEditFileCount) |
| | | ON_WM_KEYDOWN() |
| | | ON_BN_CLICKED(IDC_BUTTON_OFFSET_APPLY, &CReveiwHistoryDlg::OnBnClickedButtonOffsetApply) |
| | | ON_BN_CLICKED(IDC_BUTTON_OFFSET_SAVE, &CReveiwHistoryDlg::OnBnClickedButtonOffsetSave) |
| | | END_MESSAGE_MAP() |
| | | |
| | | // CReveiwHistoryDlg ë©ìì§ ì²ë¦¬ê¸° |
| | |
| | | InitGridReviewLIst(&m_gridReviewList, IDC_STATIC_GRID_GLASS); |
| | | InitGridDefectLIst(&m_gridDefectInfo, IDC_STATIC_GRID_DEFECT); |
| | | InitGridGlassLIst(&m_gridGlassInfo, IDC_STATIC_GRID_GLASS_INFO); |
| | | |
| | | /*< LYW 20211025 - #3684 ADD Start >*/ |
| | | CString strPath = _T(""); |
| | | InitDataInfo(); |
| | | strPath.Format(_T("%s%s"), REVIEW_OFFSET_CONFIGFILE_PATH, REVIEW_OFFSET_CONFIGFILE_NAME); |
| | | LoadOffset(strPath); |
| | | /*< LYW 20211025 - #3684 ADD End >*/ |
| | | |
| | | OnViewReviewdefect(); |
| | | |
| | |
| | | _akDefect* pDefectInfo = &m_Formation.m_vecDefects[pDispInfo->item.row - 1]; |
| | | |
| | | m_FormationMap.setSelectDefect(pDefectInfo->m_nDefectID); |
| | | |
| | | //ImageShow(pDefectInfo->m_nDefectID); |
| | | if (!m_bDefectAll) |
| | | { |
| | |
| | | return 0; |
| | | } |
| | | |
| | | LRESULT CReveiwHistoryDlg::OnDisplayWarning(WPARAM wParam, LPARAM lParam) |
| | | { |
| | | AfxMessageBox(_T("ì ííì 리뷰 ë°ì´í°ë ì§ê¸ ì ì©ë OFFSET ë°ì´í° ì´ì ì ë°ì´í° ì
ëë¤. íì¤í ê²½ì°ê° ìëë¼ë©´ OFFSET ì
í
ì ê¸í´ì£¼ììì¤."), MB_OK | MB_ICONWARNING); |
| | | return 0; |
| | | } |
| | | |
| | | LRESULT CReveiwHistoryDlg::OnListDefectSelected(WPARAM wParam, LPARAM lParam) |
| | | { |
| | | int nSelectDefect = static_cast<int>(wParam); |
| | |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | /*< LYW 20211018 - #3684 ADD Start >*/ |
| | | LRESULT CReveiwHistoryDlg::OnImageClick(WPARAM wParam, LPARAM lParam) |
| | | { |
| | | CPathSettingDlg* lpDlg = CPathSettingDlg::GetMgr(); |
| | | if (lpDlg == NULL) return 0; |
| | | |
| | | _akDefect *pDefect; |
| | | pDefect = &m_Formation.m_vecDefects[m_dCurDefectIdx]; |
| | | if (pDefect == NULL) return 0; |
| | | |
| | | CPoint Point; |
| | | Point.x = GET_X_LPARAM(lParam); |
| | | Point.y = GET_Y_LPARAM(lParam); |
| | | |
| | | int dOffsetDrectionX; |
| | | int dOffsetDrectionY; |
| | | |
| | | if (lpDlg->m_comboDirectionX.GetCurSel() == 1) dOffsetDrectionX = -1; |
| | | else dOffsetDrectionX = 1; |
| | | |
| | | if (lpDlg->m_comboDirectionY.GetCurSel() == 1) dOffsetDrectionY = -1; |
| | | else dOffsetDrectionY = 1; |
| | | |
| | | if (pDefect->m_nDefectID == m_dCurDefectID) |
| | | { |
| | | m_nEditCamIdx = pDefect->m_nCameraID; |
| | | m_nEditScanIdx = pDefect->m_nScanIdx; |
| | | m_nCurModelIdx = pDefect->m_nModelIdx; |
| | | if (m_nCurModelIdx == 0) |
| | | { |
| | | m_strGantryIdx = _T("Left"); |
| | | m_dEditOffsetX = (double)(dOffsetDrectionX * (Point.x / 5)) / 1000; |
| | | m_dEditOffsetY = (double)-(dOffsetDrectionY * (Point.y / 5)) / 1000; |
| | | } |
| | | else if (m_nCurModelIdx == 1) |
| | | { |
| | | m_strGantryIdx = _T("Right"); |
| | | m_dEditOffsetX = (double)-(dOffsetDrectionX * (Point.x / 5)) / 1000; |
| | | m_dEditOffsetY = (double)-(dOffsetDrectionY * (Point.y / 5)) / 1000; |
| | | } |
| | | else AfxMessageBox(_T("ê²í¸ë¦¬ ì¸ë±ì¤ê° ë¹ì ì ì
ëë¤."), MB_OK | MB_ICONWARNING); |
| | | } |
| | | |
| | | else |
| | | { |
| | | if (IDOK == AfxMessageBox(_T("ì´ë¯¸ì§ ì¸ë±ì¤ê° ì¼ì¹íì§ ììµëë¤."), MB_OK | MB_ICONWARNING)) |
| | | { |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | UpdateData(FALSE); |
| | | return 0; |
| | | } |
| | | /*< LYW 20211018 - #3684 ADD End >*/ |
| | | |
| | | LRESULT CReveiwHistoryDlg::OnMapDefectMouseOver(WPARAM wParam, LPARAM lParam) |
| | | { |
| | |
| | | nSecond = write_local_time.wSecond; |
| | | CString strTime; |
| | | strTime.Format("%04d-%02d-%02d-%02d-%02d-%02d", nYear, nMonth, nDay, nHour, nMinute, nSecond); |
| | | |
| | | CloseHandle(h_File); |
| | | |
| | | m_vecStrGridTimeList.push_back(strTime); |
| | | } |
| | |
| | | Imagenoload(); |
| | | return; |
| | | } |
| | | |
| | | /*< LYW 20211028 - #3684 ADD Start >*/ |
| | | CString strBinFileName; |
| | | strBinFileName.Format("%s\\%s", strBinPath, strFileName); |
| | | m_CurrentResultFileTime = GetCurrentResultFileTime(strBinFileName); |
| | | /*< LYW 20211028 - #3684 ADD End >*/ |
| | | |
| | | if (bNewFile && m_chkSingle.GetCheck()) |
| | | { |
| | |
| | | { |
| | | SetScrollSetting(); |
| | | } |
| | | /*< LYW 20211028 - #3684 ADD Start >*/ |
| | | if (m_LastSaveOffsetTime >= m_CurrentResultFileTime) |
| | | { |
| | | PostThreadMessage(m_ThreadId, UM_THREAD_WARNING_OFFSET, 0, 0); |
| | | } |
| | | /*< LYW 20211028 - #3684 ADD End >*/ |
| | | } |
| | | |
| | | void CReveiwHistoryDlg::OnCbnSelchangeComboRawtype() |
| | |
| | | } |
| | | } |
| | | _akReviewList* pImageInfo = &m_Formation.m_vecImage[nIndex]; |
| | | m_dCurDefectID = pImageInfo->m_nDefectID; |
| | | m_dCurDefectIdx = nIndex; |
| | | // _akDefect *pDefect; |
| | | // pDefect = &m_Formation.m_vecDefects[nIndex]; |
| | | // m_dCurDefectCam = pDefect->m_nCameraID; |
| | | // m_dCurDefectModuleIdx = pDefect->m_nModelIdx; |
| | | // m_dCurDefectScan = pDefect->m_nScanIdx; |
| | | //ëª ë²ì§¸ ì¸ì§ ëì§ë¤. |
| | | |
| | | CString wekfjlwe = pImageInfo->m_strReviewImageName; |
| | |
| | | m_ctlFileCount.GetWindowText(strCount); |
| | | m_nFileCount = _ttoi(strCount); |
| | | } |
| | | |
| | | /*< LYW 20211028 - #3684 ADD Start >*/ |
| | | void CReveiwHistoryDlg::UpdateLastSaveOffsetTime(CString FileName) |
| | | { |
| | | |
| | | HANDLE h_file = CreateFile(FileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); |
| | | |
| | | FILETIME create_time, access_time, write_time; |
| | | GetFileTime(h_file, &create_time, &access_time, &write_time); |
| | | |
| | | SYSTEMTIME access_system_time; |
| | | FileTimeToSystemTime(&access_time, &access_system_time); |
| | | |
| | | SYSTEMTIME access_system_Local_time; |
| | | SystemTimeToTzSpecificLocalTime(NULL, &access_system_time, &access_system_Local_time); |
| | | |
| | | CTime FIleTime(access_system_Local_time); |
| | | m_LastSaveOffsetTime = FIleTime; |
| | | |
| | | CloseHandle(h_file); |
| | | |
| | | m_TextLastSaveOffsetTime.Format(_T("%04d/%02d/%02d/%02d:%02d:%02d"), m_LastSaveOffsetTime.GetYear(), m_LastSaveOffsetTime.GetMonth(), |
| | | m_LastSaveOffsetTime.GetDay(), m_LastSaveOffsetTime.GetHour(), m_LastSaveOffsetTime.GetMinute(), m_LastSaveOffsetTime.GetSecond()); |
| | | |
| | | UpdateData(FALSE); |
| | | } |
| | | CTime CReveiwHistoryDlg::GetCurrentResultFileTime(CString FileName) |
| | | { |
| | | HANDLE h_file = CreateFile(FileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); |
| | | |
| | | if (h_file != INVALID_HANDLE_VALUE) |
| | | { |
| | | FILETIME create_time, access_time, write_time; |
| | | GetFileTime(h_file, &create_time, &access_time, &write_time); |
| | | |
| | | SYSTEMTIME access_system_time; |
| | | FileTimeToSystemTime(&access_time, &access_system_time); |
| | | |
| | | SYSTEMTIME access_system_Local_time; |
| | | SystemTimeToTzSpecificLocalTime(NULL, &access_system_time, &access_system_Local_time); |
| | | |
| | | CloseHandle(h_file); |
| | | |
| | | CTime FIleTime(access_system_Local_time); |
| | | m_CurrentResultFileTime = FIleTime; |
| | | |
| | | return m_CurrentResultFileTime; |
| | | } |
| | | |
| | | else |
| | | { |
| | | return CTime::GetCurrentTime(); |
| | | } |
| | | |
| | | |
| | | } |
| | | /*< LYW 20211028 - #3684 ADD End >*/ |
| | | |
| | | BOOL CReveiwHistoryDlg::GetCheckFileLoad(int nCount) |
| | | { |
| | |
| | | |
| | | CDialogEx::OnKeyDown(nChar, nRepCnt, nFlags); |
| | | } |
| | | |
| | | /*< LYW 20211025 - #3684 ADD Start >*/ |
| | | void CReveiwHistoryDlg::OnBnClickedButtonOffsetApply() |
| | | { |
| | | // TODO: ì¬ê¸°ì 컨í¸ë¡¤ ì림 ì²ë¦¬ê¸° ì½ë를 ì¶ê°í©ëë¤. |
| | | ApplyOffset(m_nCurModelIdx, m_nEditCamIdx, m_nEditScanIdx, m_dEditOffsetX, m_dEditOffsetY); |
| | | } |
| | | |
| | | |
| | | void CReveiwHistoryDlg::OnBnClickedButtonOffsetSave() |
| | | { |
| | | // TODO: ì¬ê¸°ì 컨í¸ë¡¤ ì림 ì²ë¦¬ê¸° ì½ë를 ì¶ê°í©ëë¤. |
| | | SaveOffset(); |
| | | } |
| | | |
| | | BOOL CReveiwHistoryDlg::LoadOffset(CString strFilePath) |
| | | { |
| | | //dBarValue = 0; |
| | | CMacroFile macroFile; |
| | | |
| | | if (!macroFile.Read(strFilePath)) |
| | | return FALSE; |
| | | |
| | | UpdateLastSaveOffsetTime(strFilePath); |
| | | |
| | | macroFile.GetItem(_T("CAMERA_COUNT"), m_nCameraCount, 0); |
| | | macroFile.GetItem(_T("SCAN_COUNT"), m_nScanCount, 0); |
| | | macroFile.GetItem(_T("XPOS_COUNT"), m_XposCount, 0); |
| | | CString strItem = _T(""); |
| | | double dXoffset = 0; |
| | | double dYoffset = 0; |
| | | double dXMin = 0; |
| | | double dXMAX = 0; |
| | | |
| | | double dValue = 0; |
| | | dValue = 2 * CAM_MAX_COUNT*SCAN_MAX_COUNT; |
| | | dValue = 1600 / dValue; |
| | | |
| | | for (int nModuleidx = 0; nModuleidx < 2; nModuleidx++) |
| | | { |
| | | for (int nCamidx = 0; nCamidx < CAM_MAX_COUNT; nCamidx++) |
| | | { |
| | | for (int nScanidx = 0; nScanidx < SCAN_MAX_COUNT; nScanidx++) |
| | | { |
| | | |
| | | for (int nXposIndex = 0; nXposIndex < XPOS_MAX_COUNT; nXposIndex++) |
| | | { |
| | | |
| | | strItem.Format(_T("MODULE[%d]_CAM[%d]_SCAN[%d]_IDX[%d]_OFFSET_X"), nModuleidx, nCamidx, nScanidx, nXposIndex); |
| | | macroFile.GetItem(strItem, dXoffset); |
| | | |
| | | |
| | | strItem.Format(_T("MODULE[%d]_CAM[%d]_SCAN[%d]_IDX[%d]_OFFSET_Y"), nModuleidx, nCamidx, nScanidx, nXposIndex); |
| | | macroFile.GetItem(strItem, dYoffset); |
| | | |
| | | strItem.Format(_T("MODULE[%d]_CAM[%d]_SCAN[%d]_IDX[%d]_XPOS_X_MIN"), nModuleidx, nCamidx, nScanidx, nXposIndex); |
| | | macroFile.GetItem(strItem, dXMin); |
| | | |
| | | strItem.Format(_T("MODULE[%d]_CAM[%d]_SCAN[%d]_IDX[%d]_XPOS_X_MAN"), nModuleidx, nCamidx, nScanidx, nXposIndex); |
| | | macroFile.GetItem(strItem, dXMAX); |
| | | |
| | | SetInputOffSet(nModuleidx, nCamidx, nScanidx, nXposIndex, dXoffset, dYoffset, dXMin, dXMAX); |
| | | |
| | | } |
| | | //IncressProcessBar(dValue); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return TRUE; |
| | | |
| | | } |
| | | |
| | | BOOL CReveiwHistoryDlg::SaveOffset() |
| | | { |
| | | //dBarValue = 0; |
| | | |
| | | CString strForderPath; |
| | | CString strFileName; |
| | | CTime time = CTime::GetCurrentTime(); |
| | | /*< LYW 20211028 - #3684 ADD Start >*/ |
| | | m_LastSaveOffsetTime = time; |
| | | /*< LYW 20211028 - #3684 ADD End >*/ |
| | | strFileName.Format(_T("ReviewOffSet_%04d%02d%02d%02d%02d%02d.cfg"), time.GetYear(), time.GetMonth(), time.GetDay(), time.GetHour(), time.GetMinute(), time.GetSecond()); |
| | | strForderPath.Format(_T("%s%s"), REVIEW_OFFSET_BACKUP_FORDER_PATH, strFileName); |
| | | |
| | | CopyFile(REVIEW_OFFSET_CONFIGFILE_FULL_PATHNAME, strForderPath, FALSE); |
| | | |
| | | BOOL bReturn = FALSE; |
| | | CString strTemp; |
| | | int nTemp; |
| | | double dTemp; |
| | | |
| | | CMacroFile macroFile; |
| | | macroFile.Clear(); |
| | | |
| | | CString strItem = _T(""); |
| | | |
| | | |
| | | strItem.Format(_T("CAMERA_COUNT")); |
| | | macroFile.SetItem(strItem, m_nCameraCount); |
| | | |
| | | strItem.Format(_T("SCAN_COUNT")); |
| | | macroFile.SetItem(strItem, m_nScanCount); |
| | | |
| | | strItem.Format(_T("XPOS_COUNT")); |
| | | macroFile.SetItem(strItem, m_XposCount); |
| | | |
| | | |
| | | CString strData; |
| | | double dData = 0; |
| | | for (int nModuleidx = 0; nModuleidx < 2; nModuleidx++) |
| | | { |
| | | for (int nCamidx = 0; nCamidx < CAM_MAX_COUNT; nCamidx++) |
| | | { |
| | | for (int nScanidx = 0; nScanidx < SCAN_MAX_COUNT; nScanidx++) |
| | | { |
| | | |
| | | for (int nXposIndex = 0; nXposIndex < XPOS_MAX_COUNT; nXposIndex++) |
| | | { |
| | | |
| | | OffSetInfo pOffSet = GetOffSetInfo(nModuleidx, nCamidx, nScanidx, nXposIndex); |
| | | |
| | | strItem.Format(_T("MODULE[%d]_CAM[%d]_SCAN[%d]_IDX[%d]_OFFSET_X"), nModuleidx, nCamidx, nScanidx); |
| | | dData = pOffSet.dXoffSetValue; |
| | | macroFile.SetItem(strItem, dData); |
| | | |
| | | strItem.Format(_T("MODULE[%d]_CAM[%d]_SCAN[%d]_IDX[%d]_OFFSET_Y"), nModuleidx, nCamidx, nScanidx); |
| | | dData = pOffSet.dYoffSetValue; |
| | | macroFile.SetItem(strItem, dData); |
| | | |
| | | strItem.Format(_T("MODULE[%d]_CAM[%d]_SCAN[%d]_IDX[%d]_XPOS_X_MIN"), nModuleidx, nCamidx, nScanidx); |
| | | dData = pOffSet.dXposMin; |
| | | macroFile.SetItem(strItem, dData); |
| | | |
| | | strItem.Format(_T("MODULE[%d]_CAM[%d]_SCAN[%d]_IDX[%d]_XPOS_X_MAN"), nModuleidx, nCamidx, nScanidx); |
| | | dData = pOffSet.dXposMax; |
| | | macroFile.SetItem(strItem, dData); |
| | | } |
| | | //IncressProcessBar(5); |
| | | } |
| | | } |
| | | } |
| | | |
| | | CString strFilePath; |
| | | strFilePath.Format(_T("%s%s"), REVIEW_OFFSET_CONFIGFILE_PATH, REVIEW_OFFSET_CONFIGFILE_NAME); |
| | | |
| | | bReturn = macroFile.Write(strFilePath); |
| | | |
| | | if (bReturn) |
| | | { |
| | | /*< LYW 20211028 - #3684 ADD Start >*/ |
| | | UpdateLastSaveOffsetTime(strFilePath); |
| | | AfxMessageBox(_T("OFFSET SAVE SUCCESS"), MB_OK | MB_ICONASTERISK); |
| | | /*< LYW 20211028 - #3684 ADD End >*/ |
| | | } |
| | | else AfxMessageBox(_T("OFFSET SAVE FAIL"), MB_OK | MB_ICONHAND); |
| | | |
| | | return bReturn; |
| | | } |
| | | |
| | | BOOL CReveiwHistoryDlg::ApplyOffset(int nModuleidx, int nCamIndex, int ScanIndex, double dXOffsetValue, double dYOffsetValue) |
| | | { |
| | | if (nCamIndex > CAM_MAX_COUNT || nCamIndex < 0) |
| | | { |
| | | return FALSE; |
| | | } |
| | | |
| | | if (ScanIndex > SCAN_MAX_COUNT || ScanIndex < 0) |
| | | { |
| | | return FALSE; |
| | | } |
| | | |
| | | |
| | | if (nModuleidx == 0) |
| | | { |
| | | VecOffSetScanData* pScandata = &m_vecOffSetCameraInfo[nCamIndex]; |
| | | VecOffSetData* pData = &pScandata->at(ScanIndex); |
| | | OffSetInfo* pOffSetData = &pData->at(0); |
| | | if (pOffSetData->bCheckSave == TRUE) |
| | | { |
| | | AfxMessageBox(_T("ì´ë¯¸ ì ì¥í OFFSET ì
ëë¤. ë¤ì ì
í
ì ìíìë©´ íë¡ê·¸ë¨ì ì¬ìì í´ì£¼ì¸ì"), MB_OK | MB_ICONWARNING); |
| | | return FALSE; |
| | | } |
| | | else |
| | | { |
| | | pOffSetData->dXoffSetValue += dXOffsetValue; |
| | | pOffSetData->dYoffSetValue += dYOffsetValue; |
| | | pOffSetData->bCheckSave = TRUE; |
| | | } |
| | | } |
| | | else if (nModuleidx == 1) |
| | | { |
| | | VecOffSetScanData* pScandata = &m_vecOffSetCameraInfo2[nCamIndex]; |
| | | VecOffSetData* pData = &pScandata->at(ScanIndex); |
| | | OffSetInfo* pOffSetData = &pData->at(0); |
| | | if (pOffSetData->bCheckSave == TRUE) |
| | | { |
| | | AfxMessageBox(_T("ì´ë¯¸ ì ì¥í OFFSET ì
ëë¤. ë¤ì ì
í
ì ìíìë©´ íë¡ê·¸ë¨ì ì¬ìì í´ì£¼ì¸ì"), MB_OK | MB_ICONWARNING); |
| | | return FALSE; |
| | | } |
| | | else |
| | | { |
| | | pOffSetData->dXoffSetValue += dXOffsetValue; |
| | | pOffSetData->dYoffSetValue += dYOffsetValue; |
| | | pOffSetData->bCheckSave = TRUE; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return FALSE; |
| | | } |
| | | } |
| | | |
| | | BOOL CReveiwHistoryDlg::SetInputOffSet(int nModuleidx, int nCamIndex, int ScanIndex, int nXposIndex, double dXOffsetValue, double dYOffsetValue, double dXposMin, double dXposMax, BOOL bCheckSave/* = 0*/) |
| | | { |
| | | if (nCamIndex > CAM_MAX_COUNT || nCamIndex < 0) |
| | | { |
| | | return FALSE; |
| | | } |
| | | |
| | | if (ScanIndex > SCAN_MAX_COUNT || ScanIndex < 0) |
| | | { |
| | | return FALSE; |
| | | } |
| | | |
| | | |
| | | if (nModuleidx == 0) |
| | | { |
| | | VecOffSetScanData* pScandata = &m_vecOffSetCameraInfo[nCamIndex]; |
| | | VecOffSetData* pData = &pScandata->at(ScanIndex); |
| | | OffSetInfo* pOffSetData = &pData->at(nXposIndex); |
| | | pOffSetData->dXoffSetValue = dXOffsetValue; |
| | | pOffSetData->dYoffSetValue = dYOffsetValue; |
| | | pOffSetData->dXposMin = dXposMin; |
| | | pOffSetData->dXposMax = dXposMax; |
| | | pOffSetData->bCheckSave = bCheckSave; |
| | | |
| | | } |
| | | else if (nModuleidx == 1) |
| | | { |
| | | VecOffSetScanData* pScandata = &m_vecOffSetCameraInfo2[nCamIndex]; |
| | | VecOffSetData* pData = &pScandata->at(ScanIndex); |
| | | OffSetInfo* pOffSetData = &pData->at(nXposIndex); |
| | | pOffSetData->dXoffSetValue = dXOffsetValue; |
| | | pOffSetData->dYoffSetValue = dYOffsetValue; |
| | | pOffSetData->dXposMin = dXposMin; |
| | | pOffSetData->dXposMax = dXposMax; |
| | | pOffSetData->bCheckSave = bCheckSave; |
| | | } |
| | | else |
| | | { |
| | | return FALSE; |
| | | } |
| | | } |
| | | |
| | | void CReveiwHistoryDlg::InitDataInfo() |
| | | { |
| | | //미리 ê³µê° í ë¹ |
| | | for (int nCamidx = 0; nCamidx < CAM_MAX_COUNT; nCamidx++) |
| | | { |
| | | |
| | | VecOffSetScanData pVecScanData; |
| | | for (int nScanidx = 0; nScanidx < SCAN_MAX_COUNT; nScanidx++) |
| | | { |
| | | VecOffSetData pVecData; |
| | | for (int nXposIndex = 0; nXposIndex < XPOS_MAX_COUNT; nXposIndex++) |
| | | { |
| | | |
| | | OffSetInfo pInfo; |
| | | pInfo.nXposIndex = nXposIndex; |
| | | pInfo.nScanIndex = nScanidx; |
| | | pInfo.nCamIndex = nCamidx; |
| | | pVecData.push_back(pInfo); |
| | | |
| | | } |
| | | pVecScanData.push_back(pVecData); |
| | | |
| | | } |
| | | |
| | | m_vecOffSetCameraInfo.push_back(pVecScanData); |
| | | } |
| | | |
| | | for (int nCamidx = 0; nCamidx < CAM_MAX_COUNT; nCamidx++) |
| | | { |
| | | |
| | | VecOffSetScanData pVecScanData; |
| | | for (int nScanidx = 0; nScanidx < SCAN_MAX_COUNT; nScanidx++) |
| | | { |
| | | VecOffSetData pVecData; |
| | | for (int nXposIndex = 0; nXposIndex < XPOS_MAX_COUNT; nXposIndex++) |
| | | { |
| | | |
| | | OffSetInfo pInfo; |
| | | pInfo.nXposIndex = nXposIndex; |
| | | pInfo.nScanIndex = nScanidx; |
| | | pInfo.nCamIndex = nCamidx; |
| | | pVecData.push_back(pInfo); |
| | | |
| | | } |
| | | pVecScanData.push_back(pVecData); |
| | | |
| | | } |
| | | |
| | | m_vecOffSetCameraInfo2.push_back(pVecScanData); |
| | | } |
| | | |
| | | } |
| | | |
| | | OffSetInfo CReveiwHistoryDlg::GetOffSetInfo(int nModuleidx, int nCamIndex, int ScanIndex, int nXposIndex) |
| | | { |
| | | OffSetInfo pOFF; |
| | | if (nCamIndex > CAM_MAX_COUNT || nCamIndex < 0) |
| | | { |
| | | return pOFF; |
| | | } |
| | | |
| | | if (ScanIndex > SCAN_MAX_COUNT || ScanIndex < 0) |
| | | { |
| | | return pOFF; |
| | | } |
| | | |
| | | |
| | | if (nModuleidx == 0) |
| | | { |
| | | VecOffSetScanData* pScandata = &m_vecOffSetCameraInfo[nCamIndex]; |
| | | VecOffSetData* pData = &pScandata->at(ScanIndex); |
| | | OffSetInfo* pOffSetData = &pData->at(nXposIndex); |
| | | |
| | | return *pOffSetData; |
| | | } |
| | | else if (nModuleidx == 1) |
| | | { |
| | | VecOffSetScanData* pScandata = &m_vecOffSetCameraInfo2[nCamIndex]; |
| | | VecOffSetData* pData = &pScandata->at(ScanIndex); |
| | | OffSetInfo* pOffSetData = &pData->at(nXposIndex); |
| | | return *pOffSetData; |
| | | } |
| | | else |
| | | { |
| | | return pOFF; |
| | | } |
| | | } |
| | | /*< LYW 20211025 - #3684 ADD End >*/ |
| | | |
| | | /*< LYW 20211029 - #3684 ADD Start >*/ |
| | | DWORD RunThreadReviewHistory(LPVOID param) |
| | | { |
| | | MSG msg; |
| | | CReveiwHistoryDlg* pDlg = (CReveiwHistoryDlg*)param; |
| | | while (GetMessage(&msg, NULL, 0, 0)) |
| | | { |
| | | //CString* pstrLog = reinterpret_cast<CString*>(msg.wParam); |
| | | switch (msg.message) |
| | | { |
| | | case UM_THREAD_WARNING_OFFSET: |
| | | |
| | | Sleep(100); |
| | | pDlg->PostMessage(UM_WARNING_OFFSET); |
| | | break; |
| | | |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | /*< LYW 20211029 - #3684 ADD End >*/ |
| | |
| | | |
| | | |
| | | #define MAX_COUNT 100 |
| | | /*< LYW 20211025 - #3684 ADD Start >*/ |
| | | enum OFFSETCOUNT { |
| | | CAM_MAX_COUNT = 20, XPOS_MAX_COUNT = 10, SCAN_MAX_COUNT = 10, PROGRESS_BAR_MAX = 2000 |
| | | }; |
| | | |
| | | #define REVIEW_OFFSET_CONFIGFILE_PATH _T("D:\\DIT_Review\\ReviewServerConfig\\") //210805 |
| | | #define REVIEW_OFFSET_CONFIGFILE_NAME _T("ReviewOffSet.cfg") |
| | | #define REVIEW_OFFSET_CONFIGFILE_FULL_PATHNAME _T("D:\\DIT_Review\\ReviewServerConfig\\ReviewOffSet.cfg") |
| | | #define REVIEW_OFFSET_BACKUP_FORDER_NAME _T("OffsetBackup") |
| | | #define REVIEW_OFFSET_BACKUP_FORDER_PATH _T("D:\\DIT_Review\\ReviewServerConfig\\OffsetBackup\\") |
| | | /*< LYW 20211025 - #3684 ADD End >*/ |
| | | |
| | | struct _DefectList |
| | | { |
| | |
| | | CString m_strJudge; |
| | | }; |
| | | |
| | | /*< LYW 20211025 - #3684 ADD Start >*/ |
| | | struct OffSetInfo |
| | | { |
| | | int nXposIndex; |
| | | int nScanIndex; |
| | | int nCamIndex; |
| | | double dXposMax; |
| | | double dXposMin; |
| | | double dYposMax; |
| | | double dYposMin; |
| | | double dXoffSetValue; |
| | | double dYoffSetValue; |
| | | BOOL bCheckSave; |
| | | |
| | | }; |
| | | typedef std::vector<OffSetInfo> VecOffSetData; |
| | | typedef std::vector<VecOffSetData> VecOffSetScanData; |
| | | typedef std::vector<VecOffSetScanData> VecOffSetCameraInfo; |
| | | /*< LYW 20211025 - #3684 ADD End >*/ |
| | | |
| | | /*< LYW 20211029 - #3684 ADD Start >*/ |
| | | DWORD RunThreadReviewHistory(LPVOID param); |
| | | /*< LYW 20211029 - #3684 ADD End >*/ |
| | | |
| | | // CReveiwHistoryDlg ëí ìì |
| | | class CReveiwHistoryDlg : public CDialogEx |
| | | { |
| | | // ìì±ì
ëë¤. |
| | | public: |
| | | CReveiwHistoryDlg(CWnd* pParent = nullptr); // íì¤ ìì±ìì
ëë¤. |
| | | /*< LYW 20211029 - #3684 ADD Start >*/ |
| | | ~CReveiwHistoryDlg(void); |
| | | /*< LYW 20211029 - #3684 ADD End >*/ |
| | | |
| | | // ëí ìì ë°ì´í°ì
ëë¤. |
| | | #ifdef AFX_DESIGN_TIME |
| | |
| | | CProgressCtrl m_ctlProgress; |
| | | |
| | | CakGridCtrl m_ctrlGridGlassList; |
| | | |
| | | /*< LYW 20211018 - #3684 ADD Start >*/ |
| | | //CurrentDefect, Offset ê³ì° ì¬ì© |
| | | int m_dCurDefectIdx; |
| | | int m_dCurDefectID; |
| | | /*< LYW 20211018 - #3684 ADD End >*/ |
| | | |
| | | /*< LYW 20211028 - #3684 ADD Start >*/ |
| | | CTime m_LastSaveOffsetTime; |
| | | CTime m_CurrentResultFileTime; |
| | | /*< LYW 20211028 - #3684 ADD End >*/ |
| | | /*< LYW 20211029 - #3684 ADD Start >*/ |
| | | DWORD m_ThreadId; |
| | | /*< LYW 20211029 - #3684 ADD End >*/ |
| | | |
| | | // tracker |
| | | BOOL m_bDrawTracker; |
| | |
| | | afx_msg void OnBnClickedButtonMapviewFit(); |
| | | afx_msg void OnDestroy(); |
| | | afx_msg LRESULT OnMapDefectSelected(WPARAM wParam, LPARAM lParam); |
| | | afx_msg LRESULT OnDisplayWarning(WPARAM wParam, LPARAM lParam); |
| | | afx_msg LRESULT OnMapDefectMouseOver(WPARAM wParam, LPARAM lParam); |
| | | afx_msg LRESULT OnListDefectSelected(WPARAM wParam, LPARAM lParam); |
| | | /*< LYW 20211018 - #3684 ADD Start >*/ |
| | | afx_msg LRESULT OnImageClick(WPARAM wParam, LPARAM lParam); |
| | | /*< LYW 20211018 - #3684 ADD End >*/ |
| | | afx_msg void OnSize(UINT nType, int cx, int cy); |
| | | |
| | | afx_msg void OnOptionPathsetting(); |
| | |
| | | void BinFileOpen(int nCount); |
| | | void OnCbnSelchangeComboRawtype(); |
| | | |
| | | |
| | | /*< LYW 20211025 - #3684 ADD Start >*/ |
| | | afx_msg void OnBnClickedButtonOffsetApply(); |
| | | afx_msg void OnBnClickedButtonOffsetSave(); |
| | | BOOL LoadOffset(CString strFilePath); |
| | | BOOL SaveOffset(); |
| | | BOOL ApplyOffset(int nModuleidx, int nCamIndex, int ScanIndex, double dXOffsetValue, double dYOffsetValue); |
| | | BOOL SetInputOffSet(int nModuleidx, int nCamIndex, int ScanIndex, int nXposIndex, double dXOffsetValue, double dYOffsetValue, double dXposMin, double dXposMax, BOOL bCheckSave = 0); |
| | | void InitDataInfo(); |
| | | OffSetInfo GetOffSetInfo(int nMoudleidx, int nCamIndex, int ScanIndex, int nXposIndex); |
| | | |
| | | int m_nCameraCount; |
| | | int m_nScanCount; |
| | | int m_XposCount; |
| | | int m_nCurModelIdx; |
| | | |
| | | /*< LYW 20211025 - #3684 ADD End >*/ |
| | | |
| | | //Xpos ìì¹ë³ ì¤ì Offset Data 를 ê°ì§ê³ ìë Vector |
| | | VecOffSetData m_vecOffSetData; |
| | | //Scan Index를 íµí OffSet Data 를 ê´ë¦¬í기ìí Vector |
| | | VecOffSetScanData m_vecOffSetScanData; |
| | | //CamIndex를 íµí ê´ë¦¬ë¥¼ ìí Vector module 0 |
| | | VecOffSetCameraInfo m_vecOffSetCameraInfo; |
| | | //CamIndex를 íµí ê´ë¦¬ë¥¼ ìí Vector module 1 |
| | | VecOffSetCameraInfo m_vecOffSetCameraInfo2; |
| | | |
| | | void ShowProgressBar(); |
| | | void setDefectShow(int nDefectID, BOOL bEnsureVisible); |
| | | void ImageShow(int nDefectID); |
| | |
| | | //LYW 20210825 #3486 ADD START |
| | | void ImageRotate(CImage& SrcImage, CImage& DstImage, double degree = 180.0); |
| | | //LYW 20210825 #3486 ADD END |
| | | |
| | | /*< LYW 20211028 - #3684 ADD Start >*/ |
| | | void UpdateLastSaveOffsetTime(CString FileName); |
| | | CTime GetCurrentResultFileTime(CString FileName); |
| | | /*< LYW 20211028 - #3684 ADD End >*/ |
| | | |
| | | BOOL GetCheckFileLoad(int nCount); |
| | | |
| | |
| | | int GetCellCount() { return m_nCellCount; } |
| | | |
| | | afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); |
| | | int m_nEditCamIdx; |
| | | int m_nEditScanIdx; |
| | | double m_dEditOffsetX; |
| | | double m_dEditOffsetY; |
| | | CString m_strGantryIdx; |
| | | /*< LYW 20211028 - #index ADD Start >*/ |
| | | CString m_TextLastSaveOffsetTime; |
| | | /*< LYW 20211028 - #index ADD End >*/ |
| | | }; |
| | |
| | | |
| | | #define UM_FORMMAP_DEFECTMOUSEOVER WM_USER+0x2001 |
| | | #define UM_FORMMAP_DEFECTSELECT WM_USER+0x2002 |
| | | /*< LYW 20211028 - #3684 ADD Start >*/ |
| | | #define UM_WARNING_OFFSET WM_USER+0x2004 |
| | | //Thread msg Map |
| | | #define UM_THREAD_WARNING_OFFSET WM_USER + 0x1001 |
| | | /*< LYW 20211028 - #3684 ADD End >*/ |
| | | |
| | | class CakFormationMap : public CakGraphBasic3 |
| | | { |
| | |
| | | |
| | | pOldBitmap = BitmapDC.SelectObject(&pImageData->m_Bitmap); |
| | | |
| | | double dOnePixelX = (double)m_rectData.Width() / m_AxisX.GetRangeValue(); |
| | | double dOnePixelY = (double)m_rectData.Height() / m_AxisY.GetRangeValue(); |
| | | /*< LYW 20211018 - #3684 MOD Start >*/ |
| | | m_dOnePixelX = m_AxisX.GetRangeValue() / (double)m_rectData.Width(); |
| | | m_dOnePixelY = m_AxisY.GetRangeValue() / (double)m_rectData.Height(); |
| | | /*< LYW 20211018 - #3684 MOD End >*/ |
| | | /*< Origin Code >*/ |
| | | //double dOnePixelX = (double)m_rectData.Width() / m_AxisX.GetRangeValue(); |
| | | //double dOnePixelY = (double)m_rectData.Height() / m_AxisY.GetRangeValue(); |
| | | |
| | | if (1)//dOnePixelX > 2 && dOnePixelY > 2) |
| | | { |
| | |
| | | //ê¸ë¼ì¤ ì¸ê°ì 그리기 íí[2016/3/23] |
| | | { |
| | | pOldBrush = (CBrush*)pDC->SelectObject(&BrushGlass); |
| | | CPen pen; |
| | | CPen pen, CenterLinePen; |
| | | pen.CreatePen(PS_SOLID, 1, RGB(64, 191, 79)); |
| | | /*< LYW 20211029 - #3684 ADD Start >*/ |
| | | CenterLinePen.CreatePen(PS_DOT, 1, RGB(255, 0, 0)); |
| | | /*< LYW 20211029 - #3684 ADD End >*/ |
| | | pDC->SelectObject(&pen); |
| | | |
| | | pDC->MoveTo(GetWindowPosX(rectGlass.left), GetWindowPosY(rectGlass.top)); |
| | |
| | | pDC->LineTo(GetWindowPosX(rectGlass.left), GetWindowPosY(rectGlass.bottom)); |
| | | pDC->LineTo(GetWindowPosX(rectGlass.left), GetWindowPosY(rectGlass.top)); |
| | | |
| | | /*< LYW 20211029 - #3684 ADD Start >*/ |
| | | pDC->SelectObject(&CenterLinePen); |
| | | pDC->MoveTo(GetWindowPosX((rectGlass.left + rectGlass.right) / 2), GetWindowPosY(rectGlass.top)); |
| | | pDC->LineTo(GetWindowPosX((rectGlass.left + rectGlass.right) / 2), GetWindowPosY(rectGlass.bottom)); |
| | | pDC->MoveTo(GetWindowPosX(rectGlass.left), GetWindowPosY((rectGlass.top + rectGlass.bottom) / 2)); |
| | | pDC->LineTo(GetWindowPosX(rectGlass.right), GetWindowPosY((rectGlass.top + rectGlass.bottom) / 2)); |
| | | /*< LYW 20211029 - #3684 ADD End >*/ |
| | | |
| | | pDC->SelectObject(&pOldBrush); |
| | | |
| | | } |
| | | } |
| | | pDC->SelectClipRgn(NULL); |
| | |
| | | |
| | | CRect rect; |
| | | this->GetClientRect(rect); |
| | | |
| | | /*< LYW 20211018 - #3684 ADD Start >*/ |
| | | CPoint Center; |
| | | Center.x = rect.Width() / 2; |
| | | Center.y = rect.Height() / 2; |
| | | /*< LYW 20211018 - #3684 ADD End >*/ |
| | | |
| | | point.x += m_nHScroll; |
| | | point.y += m_nVScroll; |
| | | /*< LYW 20211018 - #3684 MOD Start >*/ |
| | | point.x = (point.x - Center.x) * m_dOnePixelX; |
| | | point.y = (point.y - Center.y) * m_dOnePixelY; |
| | | /*< LYW 20211018 - #3684 MOD End >*/ |
| | | /*< Origin Code >*/ |
| | | GetParent()->PostMessage(UM_FORMMAP_IMAGEMOUSECLICK, static_cast<WPARAM>(0), MAKELPARAM(point.x, point.y)); |
| | | /*m_pParentWnd->SendMessage(WM_LBUTTONDOWN, static_cast<WPARAM>(nFlags), MAKELPARAM(point.x, point.y));*/ |
| | | } |
| | | break; |
| | |
| | | #include "akGraph/akGraphBasic3.h" |
| | | #include <vector> |
| | | |
| | | /*< LYW 20211018 - #3684 ADD Start >*/ |
| | | #define UM_FORMMAP_IMAGEMOUSECLICK WM_USER+0x2003 |
| | | /*< LYW 20211018 - #3684 ADD End >*/ |
| | | |
| | | struct SPixelInfo |
| | | { |
| | | SPixelInfo() |
| | |
| | | // Max Scroll Pos |
| | | int m_nMaxVScroll; |
| | | int m_nMaxHScroll; |
| | | /*< LYW 20211018 - #3684 ADD Start >*/ |
| | | // OnePixel |
| | | double m_dOnePixelX; |
| | | double m_dOnePixelY; |
| | | /*< LYW 20211018 - #3684 ADD End >*/ |
| | | |
| | | |
| | | }; |
| | | |
| | | class CakImageView : public CakGraphBasic3, public CakDataImage2 |
| | |
| | | #define IDC_PROGRESS_FILE 1047 |
| | | #define IDC_PROGRESS1 1048 |
| | | #define IDC_PROGRESS_LOAD 1048 |
| | | #define IDC_EDIT_DFFSET_GANTRY_IDX 1054 |
| | | #define IDC_EDIT_OFFSET_CAM_IDX 1055 |
| | | #define IDC_COMBO_OFFSET_DIRECTION_X 1055 |
| | | #define IDC_EDIT_OFFSET_SCAN_IDX 1056 |
| | | #define IDC_COMBO_OFFSET_DIRECTION_Y 1056 |
| | | #define IDC_EDIT_OFFSET_X 1057 |
| | | #define IDC_EDIT_OFFSET_Y 1058 |
| | | #define IDC_BUTTON_OFFSET_SAVE 1059 |
| | | #define IDC_BUTTON_OFFSET_APPLY 1060 |
| | | #define IDC_STATIC_GROUP_LAST_OFFSET_SAVE_TIME 1061 |
| | | #define IDC_STATIC_LAST_SAVE_OFFSET_TIME 1062 |
| | | #define ID_OPTION_PATHSETTING 32771 |
| | | #define ID_VIEW_ALLDEFECT 32772 |
| | | #define ID_VIEW_REVIEWDEFECT 32773 |
| | |
| | | #ifndef APSTUDIO_READONLY_SYMBOLS |
| | | #define _APS_NEXT_RESOURCE_VALUE 150 |
| | | #define _APS_NEXT_COMMAND_VALUE 32776 |
| | | #define _APS_NEXT_CONTROL_VALUE 1054 |
| | | #define _APS_NEXT_CONTROL_VALUE 1063 |
| | | #define _APS_NEXT_SYMED_VALUE 104 |
| | | #endif |
| | | #endif |
| | |
| | | [Path] |
| | | Align=D:\ResultData\Align\ |
| | | Bin=D:\DIT_ResultData\RawBin\ |
| | | Inspector=\\126.100.100.1\d\Image\Defect |
| | | Inspector=D:\Defect |
| | | Review=D:\ResultData\UploadImage\ |
| | | DirectionX=0 |
| | | DirectionY=0 |
»õ ÆÄÀÏ |
| | |
| | | #pragma once |
| | | #include "stdafx.h" |
| | | |
| | | class CMacroFile |
| | | { |
| | | public: |
| | | CMacroFile() { Clear(); } |
| | | ~CMacroFile() { Clear(); } |
| | | |
| | | void Clear() |
| | | { |
| | | m_arTiltleLine.RemoveAll(); |
| | | m_arValueLine.RemoveAll(); |
| | | } |
| | | |
| | | BOOL Read(const TCHAR* lpstrFilePath) |
| | | { |
| | | CStdioFile file; |
| | | CFileException ex; |
| | | |
| | | if ( !file.Open(lpstrFilePath, CFile::modeRead, &ex)) |
| | | { |
| | | |
| | | #ifdef _DEBUG |
| | | TCHAR szCause[255] = {0}; |
| | | ex.GetErrorMessage(szCause, 255); |
| | | TRACE(szCause); |
| | | #endif |
| | | return FALSE; |
| | | } |
| | | |
| | | CString strLine; |
| | | CString strTiltle, strValue; |
| | | int p = 0; |
| | | |
| | | while(file.ReadString(strLine)) |
| | | { |
| | | strTiltle = _T(""); |
| | | strValue = _T(""); |
| | | |
| | | |
| | | if ( -1 == (p = strLine.Find(_T('='), 0))) continue; |
| | | |
| | | strTiltle = strLine.Left(p); |
| | | strValue = strLine.Right(strLine.GetLength() - p - 1); |
| | | |
| | | m_arTiltleLine.Add(strTiltle); |
| | | m_arValueLine.Add(strValue); |
| | | |
| | | |
| | | } |
| | | |
| | | file.Close(); |
| | | |
| | | return TRUE; |
| | | } |
| | | |
| | | BOOL Write(const TCHAR* lpstrFilePath) |
| | | { |
| | | CStdioFile file; |
| | | CFileException ex; |
| | | |
| | | if ( !file.Open(lpstrFilePath, CFile::modeCreate | CFile::modeWrite, &ex)) |
| | | { |
| | | #ifdef _DEBUG |
| | | TCHAR szCause[255] = {0}; |
| | | ex.GetErrorMessage(szCause, 255); |
| | | TRACE(szCause); |
| | | #endif |
| | | return FALSE; |
| | | } |
| | | |
| | | CString strLine = _T(""); |
| | | CString strTiltle, strValue; |
| | | |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strTiltle = _T(""); |
| | | strValue = _T(""); |
| | | |
| | | strTiltle = m_arTiltleLine.GetAt(nIndex); |
| | | strValue = m_arValueLine.GetAt(nIndex); |
| | | |
| | | strLine.Format(_T("%s=%s"), strTiltle, strValue); |
| | | |
| | | file.WriteString(CString(strLine)+_T("\n")); |
| | | |
| | | } |
| | | |
| | | file.Close(); |
| | | |
| | | return TRUE; |
| | | } |
| | | |
| | | void GetItem(const TCHAR* lpstrTitle, short& sValue, short sDefault=0) |
| | | { |
| | | CString strText = _T(""); |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strText = m_arTiltleLine.GetAt(nIndex); |
| | | if(strText.Compare(lpstrTitle)==0) |
| | | { |
| | | strText = m_arValueLine.GetAt(nIndex); |
| | | sValue = ::_ttoi((LPCTSTR)strText); |
| | | return; |
| | | } |
| | | } |
| | | sValue = sDefault; |
| | | } |
| | | |
| | | void GetItem(const TCHAR* lpstrTitle, int& nValue, int nDefault=0) |
| | | { |
| | | CString strText = _T(""); |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strText = m_arTiltleLine.GetAt(nIndex); |
| | | if(strText.Compare(lpstrTitle)==0) |
| | | { |
| | | strText = m_arValueLine.GetAt(nIndex); |
| | | strText.Remove('`'); |
| | | nValue = ::_ttoi((LPCTSTR)strText); |
| | | return; |
| | | } |
| | | } |
| | | nValue = nDefault; |
| | | } |
| | | |
| | | void GetItem(const TCHAR* lpstrTitle, UINT& unValue, UINT unDefault=0) |
| | | { |
| | | CString strText = _T(""); |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strText = m_arTiltleLine.GetAt(nIndex); |
| | | if(strText.Compare(lpstrTitle)==0) |
| | | { |
| | | strText = m_arValueLine.GetAt(nIndex); |
| | | unValue = ::_ttoi((LPCTSTR)strText); |
| | | return; |
| | | } |
| | | } |
| | | unValue = unDefault; |
| | | } |
| | | |
| | | void GetItem(const TCHAR* lpstrTitle, long& lValue, long lDefault=0) |
| | | { |
| | | CString strText = _T(""); |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strText = m_arTiltleLine.GetAt(nIndex); |
| | | if(strText.Compare(lpstrTitle) == 0) |
| | | { |
| | | strText = m_arValueLine.GetAt(nIndex); |
| | | lValue = ::_ttoi((LPCTSTR)strText); |
| | | return; |
| | | } |
| | | } |
| | | lValue = lDefault; |
| | | } |
| | | |
| | | void GetItem(const TCHAR* lpstrTitle, float& fValue, float fDefault=0.0f) |
| | | { |
| | | CString strText = _T(""); |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strText = m_arTiltleLine.GetAt(nIndex); |
| | | if(strText.Compare(lpstrTitle) == 0) |
| | | { |
| | | strText = m_arValueLine.GetAt(nIndex); |
| | | //strText.Replace('\'',''); |
| | | strText.Remove('`'); |
| | | fValue = float(_tstof((LPCTSTR)strText)); |
| | | return; |
| | | } |
| | | } |
| | | fValue = fDefault; |
| | | } |
| | | |
| | | void GetItem(const TCHAR* lpstrTitle, double& dValue, double dDefault=0.0) |
| | | { |
| | | CString strText = _T(""); |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strText = m_arTiltleLine.GetAt(nIndex); |
| | | if(strText.Compare(lpstrTitle) == 0) |
| | | { |
| | | strText = m_arValueLine.GetAt(nIndex); |
| | | dValue = _tcstod((LPCTSTR)strText, NULL); |
| | | return; |
| | | } |
| | | } |
| | | dValue = dDefault; |
| | | } |
| | | |
| | | void GetItem(const TCHAR* lpstrTitle, TCHAR &cValue, TCHAR cDefault=_T(' ')) |
| | | { |
| | | CString strText = _T(""); |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strText = m_arTiltleLine.GetAt(nIndex); |
| | | if(strText.Compare(lpstrTitle) == 0) |
| | | { |
| | | strText = m_arValueLine.GetAt(nIndex); |
| | | cValue = (m_arValueLine.GetAt(nIndex)).GetAt(0); |
| | | return; |
| | | } |
| | | } |
| | | cValue = cDefault; |
| | | } |
| | | |
| | | void GetItem(const TCHAR* lpstrTitle, CString& strValue, CString strDefault=_T("")) |
| | | { |
| | | CString strText = _T(""); |
| | | |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strText = m_arTiltleLine.GetAt(nIndex); |
| | | |
| | | if(strText.Compare(lpstrTitle) == 0) |
| | | { |
| | | strValue = m_arValueLine.GetAt(nIndex); |
| | | return; |
| | | } |
| | | } |
| | | strValue = strDefault; |
| | | } |
| | | |
| | | |
| | | void SetItem(const TCHAR* lpstrTitle, const short& sValue) |
| | | { |
| | | TCHAR szValue[256]; |
| | | _stprintf_s(szValue, _T("%d"), sValue); |
| | | |
| | | SetItem(lpstrTitle, szValue); |
| | | } |
| | | |
| | | void SetItem(const TCHAR* lpstrTitle,const int& nValue) |
| | | { |
| | | TCHAR szValue[256]; |
| | | _stprintf_s(szValue, _T("%d"), nValue); |
| | | |
| | | SetItem(lpstrTitle, szValue); |
| | | } |
| | | |
| | | void SetItem(const TCHAR* lpstrTitle, const UINT& unValue) |
| | | { |
| | | TCHAR szValue[256]; |
| | | _stprintf_s(szValue, _T("%d"), unValue); |
| | | |
| | | SetItem(lpstrTitle, szValue); |
| | | } |
| | | |
| | | void SetItem(const TCHAR* lpstrTitle, const long& lValue) |
| | | { |
| | | TCHAR szValue[256]; |
| | | _stprintf_s(szValue, _T("%d"), lValue); |
| | | |
| | | SetItem(lpstrTitle, szValue); |
| | | } |
| | | |
| | | void SetItem(const TCHAR* lpstrTitle, const float& fValue) |
| | | { |
| | | TCHAR szValue[256]; |
| | | _stprintf_s(szValue, _T("%.8f"), fValue); |
| | | |
| | | SetItem(lpstrTitle, szValue); |
| | | } |
| | | |
| | | void SetItem(const TCHAR* lpstrTitle, const double& dValue) |
| | | { |
| | | TCHAR szValue[256]; |
| | | _stprintf_s(szValue, _T("%.8lf"), dValue); |
| | | |
| | | SetItem(lpstrTitle, szValue); |
| | | } |
| | | |
| | | void SetItem(const TCHAR* lpstrTitle, const TCHAR &cValue) |
| | | { |
| | | TCHAR szValue[256]; |
| | | _stprintf_s(szValue, _T("%c"), cValue); |
| | | |
| | | SetItem(lpstrTitle, szValue); |
| | | } |
| | | |
| | | void SetItem(const TCHAR* lpstrTitle, const CString& strValue) |
| | | { |
| | | SetItem(lpstrTitle, (LPCTSTR)strValue); |
| | | } |
| | | |
| | | void SetItem(const TCHAR* lpstrTitle, const TCHAR* lpstrValue) |
| | | { |
| | | BOOL bNewItem = TRUE; |
| | | CString strText = _T(""); |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strText = m_arTiltleLine.GetAt(nIndex); |
| | | if(strText.Compare(lpstrTitle) == 0) |
| | | { |
| | | m_arValueLine.SetAt(nIndex, lpstrValue); |
| | | bNewItem = FALSE; |
| | | } |
| | | } |
| | | |
| | | if(bNewItem) |
| | | { |
| | | m_arTiltleLine.Add(lpstrTitle); |
| | | m_arValueLine.Add(lpstrValue); |
| | | } |
| | | } |
| | | |
| | | void GetItem(const TCHAR* lpstrTitle, TCHAR* lpBuffer, const int nMaxLength) |
| | | { |
| | | ASSERT(lpBuffer); |
| | | ASSERT(nMaxLength > 0); |
| | | |
| | | ZeroMemory(lpBuffer, sizeof(char)*nMaxLength); |
| | | |
| | | CString strText = _T(""); |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strText = m_arTiltleLine.GetAt(nIndex); |
| | | if(strText.Compare(lpstrTitle) == 0) |
| | | { |
| | | strText = m_arValueLine.GetAt(nIndex); |
| | | _tcscpy_s(lpBuffer, strText.GetLength(), (LPCTSTR)strText); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | void GetItem(const TCHAR* lpstrStartChar, const TCHAR* lpstrEndChar, TCHAR* lpBuffer, const int nMaxLength) |
| | | { |
| | | ASSERT(lpBuffer); |
| | | ASSERT(nMaxLength > 0); |
| | | |
| | | ZeroMemory(lpBuffer, sizeof(char)*nMaxLength); |
| | | |
| | | CString strTitle , strValue ; |
| | | |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strTitle = _T(""); |
| | | strValue = _T(""); |
| | | |
| | | strTitle = m_arTiltleLine.GetAt(nIndex); |
| | | strValue = m_arValueLine.GetAt(nIndex); |
| | | |
| | | if (strTitle.IsEmpty()) continue; |
| | | |
| | | if( strTitle.GetAt(0) == _T('!') && strValue.Compare(lpstrStartChar) == 0) |
| | | { |
| | | for(int n2thIndex = nIndex+1; m_arTiltleLine.GetSize(); n2thIndex++) |
| | | { |
| | | strTitle = _T(""); |
| | | strValue = _T(""); |
| | | |
| | | strTitle = m_arTiltleLine.GetAt(n2thIndex); |
| | | strValue = m_arValueLine.GetAt(n2thIndex); |
| | | |
| | | if (strTitle.IsEmpty()) continue; |
| | | |
| | | if( strTitle.GetAt(0) == _T('!') && strValue.Compare(lpstrEndChar) == 0) |
| | | break; |
| | | |
| | | if ( int((_tcslen(lpBuffer) + strValue.GetLength()+1)) > nMaxLength) |
| | | break; |
| | | |
| | | _tcscat_s(lpBuffer, strValue.GetLength(), (LPCTSTR)strValue); |
| | | _tcscat_s(lpBuffer, 1, _T("\n")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | void SetItem(const TCHAR* lpstrStartChar, const TCHAR* lpstrEndChar, const TCHAR* lpstrMacroFormat, ...) |
| | | { |
| | | va_list list; |
| | | TCHAR strText[2000] = {0}; |
| | | |
| | | va_start(list, lpstrMacroFormat); |
| | | _vstprintf_s(strText, lpstrMacroFormat, list); |
| | | va_end(list); |
| | | |
| | | CString strTitle , strValue ; |
| | | |
| | | BOOL bNewItem = TRUE; |
| | | |
| | | for(int nIndex=0; nIndex<m_arTiltleLine.GetSize(); nIndex++) |
| | | { |
| | | strTitle = m_arTiltleLine.GetAt(nIndex); |
| | | strValue = m_arValueLine.GetAt(nIndex); |
| | | |
| | | if (strTitle.IsEmpty()) continue; |
| | | |
| | | if( strTitle.GetAt(0) == _T('!') && strValue.Compare(lpstrEndChar) == 0) |
| | | { |
| | | m_arTiltleLine.InsertAt(nIndex, _T("!"), 1); |
| | | m_arValueLine.InsertAt(nIndex, strText, 1); |
| | | bNewItem = FALSE; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (bNewItem) |
| | | { |
| | | m_arTiltleLine.Add(_T("!")); |
| | | m_arValueLine.Add(lpstrStartChar); |
| | | |
| | | m_arTiltleLine.Add(_T("!")); |
| | | m_arValueLine.Add(strText); |
| | | |
| | | m_arTiltleLine.Add(_T("!")); |
| | | m_arValueLine.Add(lpstrEndChar); |
| | | |
| | | } |
| | | } |
| | | |
| | | protected: |
| | | CStringArray m_arTiltleLine; |
| | | CStringArray m_arValueLine; |
| | | }; |
| | |
| | | |
| | | |
| | | //SAlignFindResult findResult = pAlignFinder->FindAlign(pCameraImage->GetImageData(View_Matching), findParam, pCameraImage->GetImageData(View_Template)); |
| | | //Main Align Matching |
| | | SAlignFindResult findResult = pAlignFinder->FindAlign(&camImage, findParam, pCameraImage->GetImageData(View_Template)); |
| | | g_pLog->DisplayMessage(_T("Main TempleteMatching Result : %d Cam ResultCode = %d, PixelX = %d, PixelY = %d, MatchingRate = %.3lf"), nCameraIdx, findResult.nResultCode, int(findResult.dPosX + 0.5), int(findResult.dPosY + 0.5), findResult.dMatchValue); |
| | | |
| | | // result process |
| | | //Main Align Matching result process |
| | | if (findResult.nResultCode==AlignMatch_Success) |
| | | { |
| | | g_pLog->DisplayMessage(_T("Main TempleteMatching Success!")); |
| | | /*< LYW 20211015 - #3671 ADD Start >*/ |
| | | m_pACC2P->IACC2P_SetAccumaulate(0); |
| | | /*< LYW 20211015 - #3671 ADD End >*/ |
| | | g_pLog->DisplayMessage(_T("Main TempleteMatching Success! Accumaulate = %d"), m_pACC2P->IACC2P_GetAccumaulate()); |
| | | m_AlignResult.nFindAlign[nCameraIdx] = 1; |
| | | m_AlignResult.dFindPixelX[nCameraIdx] = int(findResult.dPosX + 0.5); |
| | | m_AlignResult.dFindPixelY[nCameraIdx] = int(findResult.dPosY + 0.5); |
| | |
| | | |
| | | else |
| | | { |
| | | //Assistant Align Matching |
| | | SAlignFindResult findAssistantResult = pAlignFinder->FindAlign(&camImage, findParam, pCameraImage->GetImageData(View_AssistantTemplate)); |
| | | g_pLog->DisplayMessage(_T("Assistant TempleteMatching Result : %d Cam ResultCode = %d, PixelX = %d, PixelY = %d, MatchingRate = %.3lf"), nCameraIdx, findAssistantResult.nResultCode, int(findAssistantResult.dPosX + 0.5), int(findAssistantResult.dPosY + 0.5), findAssistantResult.dMatchValue); |
| | | //Assistant Align Matching result process |
| | | if (findAssistantResult.nResultCode == AlignMatch_Success) |
| | | { |
| | | g_pLog->DisplayMessage(_T("Assistant TempleteMatching Success!")); |
| | | /*< LYW 20211015 - #3671 ADD Start >*/ |
| | | m_pACC2P->IACC2P_SetAccumaulate(0); |
| | | /*< LYW 20211015 - #3671 ADD End >*/ |
| | | g_pLog->DisplayMessage(_T("Assistant TempleteMatching Success! Accumaulate = %d"),m_pACC2P->IACC2P_GetAccumaulate()); |
| | | m_AlignResult.nFindAlign[nCameraIdx] = 1; |
| | | m_AlignResult.dFindPixelX[nCameraIdx] = int(findAssistantResult.dPosX + 0.5); |
| | | m_AlignResult.dFindPixelY[nCameraIdx] = int(findAssistantResult.dPosY + 0.5); |
| | |
| | | |
| | | else |
| | | { |
| | | //Main, Assistant Find Pos Compare |
| | | int dffmain2assistanstX = int(findResult.dPosX) - int(findAssistantResult.dPosX); |
| | | int dffmain2assistanstY = int(findResult.dPosY) - int(findAssistantResult.dPosY); |
| | | g_pLog->DisplayMessage(_T("Main, Assistant TempleteMatching All Low Score! differenceX = %d, differenceY = %d"), dffmain2assistanstX, dffmain2assistanstY); |
| | | |
| | | if (abs(dffmain2assistanstX) <= findParam.dMatchingPixelStandard && abs(dffmain2assistanstY) <= findParam.dMatchingPixelStandard && findResult.dMatchValue != 0.0) |
| | | if (abs(dffmain2assistanstX) <= findParam.dMatchingPixelStandard && abs(dffmain2assistanstY) <= findParam.dMatchingPixelStandard && findResult.dMatchValue != 0.0 && findAssistantResult.dMatchValue != 0.0) |
| | | { |
| | | //Main, Assistant Find Pos Compare Result Success Process |
| | | m_AlignResult.nFindAlign[nCameraIdx] = 1; |
| | | m_AlignResult.dFindPixelX[nCameraIdx] = int(findResult.dPosX + 0.5); |
| | | m_AlignResult.dFindPixelY[nCameraIdx] = int(findResult.dPosY + 0.5); |
| | | /*< LYW 20211015 - #3671 MOD Start >*/ |
| | | m_AlignResult.dFindPixelX[nCameraIdx] = int((findResult.dPosX + findAssistantResult.dPosX) / 2 + 0.5); |
| | | m_AlignResult.dFindPixelY[nCameraIdx] = int((findResult.dPosY + findAssistantResult.dPosY) / 2 + 0.5); |
| | | /*< LYW 20211015 - #3671 MOD End >*/ |
| | | /*< Origin Code >*/ |
| | | //m_AlignResult.dFindPixelX[nCameraIdx] = int(findResult.dPosX + 0.5); |
| | | //m_AlignResult.dFindPixelY[nCameraIdx] = int(findResult.dPosY + 0.5); |
| | | m_AlignResult.dFindScore[nCameraIdx] = findResult.dMatchValue; |
| | | m_pACC2P->IACC2P_SetAccumaulate(m_pACC2P->IACC2P_GetAccumaulate() + 1); |
| | | g_pLog->DisplayMessage(_T("Main, Assistant Templete Find Same Point! Align Success! Accumaulate = %d"), m_pACC2P->IACC2P_GetAccumaulate()); |
| | |
| | | |
| | | else |
| | | { |
| | | //Main, Assistant Find Pos Compare Result Fail Process |
| | | g_pLog->DisplayMessage(_T("Main Assistant Templete Don`t Find Same Point! Align Fail!")); |
| | | m_AlignResult.nFindAlign[nCameraIdx] = 0; |
| | | m_AlignResult.dFindScore[nCameraIdx] = findResult.dMatchValue; |
| | | } |
| | | |
| | | if (m_pACC2P->IACC2P_GetAccumaulate() > findParam.dMatchingAlarmCondition) |
| | | if (m_pACC2P->IACC2P_GetAccumaulate() >= findParam.dMatchingAlarmCondition) |
| | | { |
| | | //Main, Assistant Find Pos Alarm Process |
| | | m_AlignResult.nFindAlign[nCameraIdx] = 0; |
| | | m_AlignResult.dFindScore[nCameraIdx] = findResult.dMatchValue; |
| | | m_pACC2P->IACC2P_SetAccumaulate(0); |
| | |
| | | ON_MESSAGE(WM_OFFSETTOOL_MESSAGE2, OnUpdatedata) |
| | | ON_BN_CLICKED(IDC_BUTTON_SAVE_SETTING_FILE, &DlgReviewOffSetTool::OnBnClickedButtonSaveSettingFile) |
| | | ON_BN_CLICKED(IDC_CHECK_OFFSET_MODE, &DlgReviewOffSetTool::OnBnClickedCheckOffsetMode) |
| | | ON_BN_CLICKED(IDC_OFFSET_LOAD, &DlgReviewOffSetTool::OnBnClickedOffsetLoad) |
| | | END_MESSAGE_MAP() |
| | | |
| | | |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | /*< LYW 20211025 - #3684 ADD Start >*/ |
| | | void DlgReviewOffSetTool::OnBnClickedOffsetLoad() |
| | | { |
| | | |
| | | // TODO: ì¬ê¸°ì 컨í¸ë¡¤ ì림 ì²ë¦¬ê¸° ì½ë를 ì¶ê°í©ëë¤. |
| | | ReadConfigFile(); |
| | | UpdateGridcontrol(); |
| | | UpdateData(TRUE); |
| | | Invalidate(FALSE); |
| | | } |
| | | /*< LYW 20211025 - #3684 ADD End >*/ |
| | |
| | | double m_editGlassOffSetmodeXpos; |
| | | double m_editGlassOffSetmodeYpos; |
| | | afx_msg void OnBnClickedCheckOffsetMode(); |
| | | /*< LYW 20211025 - #index ADD Start >*/ |
| | | afx_msg void OnBnClickedOffsetLoad(); |
| | | /*< LYW 20211025 - #index ADD End >*/ |
| | | }; |
| | |
| | | //ììí ë ë¤ ì§ì°ê³ ë¤ì ë³µì¬ê° íìí ì§ |
| | | //std::experimental::filesystem::remove_all(_REVIEW_SERVER_SYSTEM_SETTING_BACKUP_PATH_CPJT); |
| | | //std::experimental::filesystem::remove_all(_REVIEW_RECIPE_BACKUP_PATH_CPJT); |
| | | ISP2P_CopyFolder(_REVIEW_SERVER_CONFIG_PATH_, _REVIEW_SERVER_SYSTEM_SETTING_BACKUP_PATH_CPJT); |
| | | ISP2P_CopyFolder(_REVIEW_RECIPE_PATH_, _REVIEW_RECIPE_BACKUP_PATH_CPJT); |
| | | //ISP2P_CopyFolder(_REVIEW_SERVER_CONFIG_PATH_, _REVIEW_SERVER_SYSTEM_SETTING_BACKUP_PATH_CPJT); |
| | | //ISP2P_CopyFolder(_REVIEW_RECIPE_PATH_, _REVIEW_RECIPE_BACKUP_PATH_CPJT); |
| | | //LYW_#3344_CF AOI Review Config File ë°±ì
ê¸°ë¥ ê°ì ADD END |
| | | SetProgramVersion(); |
| | | |
| | |
| | | EDITTEXT IDC_EDIT_SETTINGFILE_PATH,545,50,202,14,ES_AUTOHSCROLL | WS_DISABLED |
| | | LTEXT "X Pos Count",IDC_STATIC,621,32,40,8 |
| | | EDITTEXT IDC_EDIT_XPOS_COUNT,662,28,40,14,ES_AUTOHSCROLL |
| | | PUSHBUTTON "APPLY GRID DATA",IDC_BUTTON_APPLY_GRID_DATA,132,62,134,23 |
| | | PUSHBUTTON "APPLY GRID DATA",IDC_BUTTON_APPLY_GRID_DATA,209,62,65,23 |
| | | PUSHBUTTON "APPLY",IDC_BUTTON_APPLT_OFFSET_PARAM,704,14,43,23 |
| | | CONTROL "",IDC_PROGRESS_PROCESS,"msctls_progress32",PBS_SMOOTH | WS_BORDER,337,67,168,14 |
| | | PUSHBUTTON "SAVE",IDC_BUTTON_SAVE_SETTING_FILE,279,64,56,20 |
| | |
| | | EDITTEXT IDC_EDIT_SCAN_INDEX,621,67,19,14,ES_AUTOHSCROLL |
| | | EDITTEXT IDC_EDIT_CAM_INDEX,600,67,19,14,ES_AUTOHSCROLL |
| | | EDITTEXT IDC_EDIT_MOTOR_YPOS,694,67,54,14,ES_AUTOHSCROLL |
| | | PUSHBUTTON "Offset Load",IDC_OFFSET_LOAD,139,63,62,22 |
| | | END |
| | | |
| | | IDD_DLG_REVIEW_HISTORY_TOOL DIALOGEX 0, 0, 961, 455 |
| | |
| | | SetWsiType(0); |
| | | WSIAllReadySignal(1); |
| | | Sleep(1000); |
| | | |
| | | /*< LYW 20211028 - #3718 ADD Start >*/ |
| | | // WSI Redeay ì¡ì í Review TimeOver 1í ì¶ê° ì²´í¬ |
| | | if (GetProcessStatus() == ProcessReviewEnd_CPJT || GetProcessStatus() == ProcessReviewUnloding_CPJT) |
| | | { |
| | | g_pLog->DisplayMessage(_T("[ProcessStop] WSI StartProcessing Sequence Stop Status : %d"), GetProcessStatus()); |
| | | return TRUE; |
| | | } |
| | | /*< LYW 20211028 - #3718 ADD End >*/ |
| | | |
| | | if(!WSIAllStartSignal()) |
| | | { |
| | | g_pLog->DisplayMessage(_T("[WSI] WSI Start Fail!!")); |
| | |
| | | //{{NO_DEPENDENCIES}} |
| | | // Microsoft Visual C++ìì ìì±í í¬í¨ íì¼ì
ëë¤. |
| | | // ReviewSystem.rcìì ì¬ì©ëê³ ììµëë¤. |
| | | // Microsoft Visual C++ìì ìì±í í¬í¨ íì¼ì
ëë¤. |
| | | // ReviewSystem.rcìì ì¬ì©ëê³ ììµëë¤. |
| | | // |
| | | #define IDCANCEL 2 |
| | | #define IDD_ABOUTBOX 100 |
| | |
| | | #define IDC_EDIT_WSI_HEIGHT12 1182 |
| | | #define IDC_EDIT_WSI_HEIGHT13 1183 |
| | | #define IDC_LIST_WSI_DIAGNOSIS_RESULT 1184 |
| | | #define IDC_OFFSET_LOAD 1185 |
| | | #define ID_INS_HOOK 32772 |
| | | #define ID_UNINS_HOOK 32773 |
| | | |
| | |
| | | #ifndef APSTUDIO_READONLY_SYMBOLS |
| | | #define _APS_NEXT_RESOURCE_VALUE 381 |
| | | #define _APS_NEXT_COMMAND_VALUE 32775 |
| | | #define _APS_NEXT_CONTROL_VALUE 1185 |
| | | #define _APS_NEXT_CONTROL_VALUE 1186 |
| | | #define _APS_NEXT_SYMED_VALUE 346 |
| | | #endif |
| | | #endif |