mrDarker
2025-08-15 c6e24163c3c852b4ac3e45d100b9253b3db0e182
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#pragma once
 
#include "General_Draw.h"
#include "SlimScrollView.h"
#include "EdgeInspector_Led.h"
#include "InspectionBuffer.h"
#include "GridCtrl.h"
#include "Global_Define.h"
#include "GlassRecipe.h"
#include "HardwareSettings.h"
// CViewSettingNotch ´ëÈ­ »óÀÚÀÔ´Ï´Ù.
 
#define PATH_NOTCH_IMAGE  _T("c:\\EdgeInspector_Led\\Notch")
 
#define        UM_NOTCH_APPLY_RECIPE                    (WM_USER + 3001)
 
class CViewSettingNotch : public CDialog
{
    DECLARE_DYNAMIC(CViewSettingNotch)
 
public:
    CViewSettingNotch(CWnd* pParent = NULL);   // Ç¥ÁØ »ý¼ºÀÚÀÔ´Ï´Ù.
    virtual ~CViewSettingNotch();
 
    // ´ëÈ­ »óÀÚ µ¥ÀÌÅÍÀÔ´Ï´Ù.
    enum { IDD = IDD_DLG_NOTCH_SETTING };
 
protected:
    virtual BOOL OnInitDialog();
    virtual BOOL PreTranslateMessage(MSG* pMsg);
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV Áö¿øÀÔ´Ï´Ù.    
    afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);    
    afx_msg void OnPaint();
 
    afx_msg void OnBnClickedButNotchLoad();
    afx_msg void OnBnClickedButNotchFindline();
    afx_msg void OnBnClickedButNotchSelectline();
    afx_msg void OnBnClickedButNotchFinalfind();
    afx_msg void OnBnClickedButNotchSaveMaster();
 
    afx_msg void OnBnClickedCheckUseNotchChipIns();
    
    DECLARE_MESSAGE_MAP()
 
public:
    void                SetRecipe(CHardwareSettings *pHard,CGlassRecipe *pRecipe);
    void                UpdateDlgData();
    void                SetIndex(int index){m_index = index;}
    void                SetParent(CWnd *pWnd){m_pParent=pWnd;}
 
protected:
    void                SetControl();
    void                InitImageControl();
    void                ShowMainImage();
    void                SetEnControl();
    void                LoadMasterImage();
    void                ShowMasterImage();
 
    void                UpDateNotchData(BOOL bWrite);
    void                Init_Grid();//20140528
    void                Init_GridHeader();//20140528
    void                FillGrid(BOOL bWrite,int nCurIdx);//20140528
 
    void                LoadNotchCadImage();//20140528
    void                DrawNotchInsPos();//20140528
    int                    FindNotchInsXPos(int nPosY);//20140528
 
    BOOL                GetSymmetricPoint(LPBYTE pImage, int nWidth, int nHeight, int nPitch, double *pdCenterX, double *pdCenterY);//20140611
    void                ProjectionLineDirection(LPBYTE pImage, int nWidth, int nHeight, int nPitch, int *pProjectionResult);//20140611
    void                ProjectionColumnDirection(LPBYTE pImage, int nWidth, int nHeight, int nPitch, int *pProjectionResult);//20140611
    double                SysmetricCorrelationSearch(int *pnData, int nData);//20140611
    double                PEARSONCorrelationCoefficent(int *pSourceData, int *pDestinationData, int nData);//20140611
    double                STATSGetMeanValue(int *pImageSource, int nDataCount);//20140611
    double                STATSGetSumValue(int *pImageSource, int nDataCount);//20140611
    int                    STATSGetMaxPosition(double *pData, int nDataCount);//20140611
    double                ParabolicInterpolation(double dPrevious, double dCenter,double dNext,int nCenterX);//20140611
 
protected:
    CFontControl        m_FontControl;
    CBrushControl        m_pBrushControl;
    CGridCtrl            m_ListNotchPos;//20140528
 
    CUIPictureControl    m_uiTitle_1;
    CUIPictureControl    m_uiTitle_2;
    CUIPictureControl    m_uiTitle_3;//20140528
    
protected:
    CGlassRecipe    *m_pGlassRecipe;
    CGlassRecipe    m_DlgGlassRecipe;
    CHardwareSettings    *m_pHardwareSetting;
    CSlimScrollView        *m_pMainView;
    CSlimScrollView        *m_pMasterView;
    CSISImageBuffer        m_ImageMain;    
    int                    m_nCutListIdx;
    CSISImageBuffer        m_ImageMaster[MAX_SCAN_COUNT];
    std::multimap<int, CPoint> m_NotchInsPoint;//20140528
    int                    m_nNotchCadCenterX;//20140528
    int                    m_nNotchCadCenterY;//20140528
    int                    m_nAlignMark2CadCenter;//20140528
    CWnd                *m_pParent;
 
protected:
    //CCCLabeling            m_pProcessLabel;
 
public:
    CComboBox            m_cboComp;
    int                    m_index;
    afx_msg void OnBnClickedButNotchMarkLoad();
    afx_msg void OnBnClickedButNotchMarkSaveMaster();
    afx_msg void OnBnClickedButNotchPosAdd();//20140528
    afx_msg void OnBnClickedButNotchPosDel();//20140528
    afx_msg void OnListNotchPosClick(NMHDR *pNotifyStruct, LRESULT* pResult);//20140528
    afx_msg void OnListNotchPosEdit(NMHDR *pNotifyStruct, LRESULT* pResult);//20140528
    afx_msg LRESULT OnNotchInsPosAdd(WPARAM wParam, LPARAM lParam);//20140528
    afx_msg LRESULT OnNotchInsPosMod(WPARAM wParam, LPARAM lParam);//20140528
    afx_msg void OnBnClickedButNotchPosMod();//20140528
    DECLARE_EVENTSINK_MAP()
    void ClickBtnNotchOk();
    void ClickBtnNotchCancel();
};