#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 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(); };