Ongoing90 #3684 CF AOI Review 전설비 Review History Defect이미지 클릭시 Offset 자동 계산 기능 추가
- 설비 별 상하 좌우에 따른 모터 Direction이 달라 설정 할 수 있도록 구현
- 이미지 클릭시 추가해야할 Offset 이 자동으로 계산 되어 표시되도록 구현
| | |
| | | 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(); |
| | | }; |
| | |
| | | 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_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 >*/ |
| | | |
| | | for (int i = 0; i < 105; i++) |
| | | { |
| | |
| | | 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); |
| | | } |
| | | |
| | | 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_FORMMAP_IMAGEMOUSECLICK, OnImageClick) |
| | | ON_COMMAND(ID_OPTION_PATHSETTING, &CReveiwHistoryDlg::OnOptionPathsetting) |
| | | ON_COMMAND(ID_VIEW_ALLDEFECT, &CReveiwHistoryDlg::OnViewAlldefect) |
| | | ON_COMMAND(ID_VIEW_REVIEWDEFECT, &CReveiwHistoryDlg::OnViewReviewdefect) |
| | |
| | | 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; |
| | | if (pDefect->m_nModelIdx == 0) |
| | | { |
| | | m_strGantryIdx = _T("Left"); |
| | | m_dEditOffsetX = (double)(dOffsetDrectionX * (Point.x / 5)) / 1000; |
| | | m_dEditOffsetY = (double)-(dOffsetDrectionY * (Point.y / 5)) / 1000; |
| | | } |
| | | else if (pDefect->m_nModelIdx == 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) |
| | | { |
| | | int nSelectDefect = static_cast<int>(wParam); |
| | |
| | | } |
| | | } |
| | | _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; |
| | |
| | | |
| | | CakGridCtrl m_ctrlGridGlassList; |
| | | |
| | | /*< LYW 20211018 - #3684 ADD Start >*/ |
| | | //CurrentDefect, Offset 계산 사용 |
| | | int m_dCurDefectIdx; |
| | | int m_dCurDefectID; |
| | | /*< LYW 20211018 - #3684 ADD End >*/ |
| | | |
| | | // tracker |
| | | BOOL m_bDrawTracker; |
| | | CPoint m_ptTrackerStart; |
| | |
| | | afx_msg LRESULT OnMapDefectSelected(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(); |
| | |
| | | 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; |
| | | }; |
| | |
| | | |
| | | 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) |
| | | { |
| | |
| | | |
| | | 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 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 1057 |
| | | #define _APS_NEXT_SYMED_VALUE 104 |
| | | #endif |
| | | #endif |
| | |
| | | Bin=D:\DIT_ResultData\RawBin\ |
| | | Inspector=\\126.100.100.1\d\Image\Defect |
| | | Review=D:\ResultData\UploadImage\ |
| | | DirectionX=0 |
| | | DirectionY=0 |