// GlassMap.h: interface for the CGlassMap class. // ////////////////////////////////////////////////////////////////////// #pragma once #include "InspectDefect.h" #include "Server_MemDC.h" #include "DefectMap.h" #include "Global_Define.h" #include "GlassRecipe.h" #include "HardwareSettings.h" #include "Glass_Data.h" #define RCUT_DEFECT_TYPECOUNT 5 #define ID_TIMER_BLINK 9001 #define ID_TIMER_MASKBLINK 9002 #define COLOR_0 RGB(255,0,0) // TB #define COLOR_1 RGB(0,0,255) // TW #define COLOR_2 RGB(0,200,200) // RB #define COLOR_3 RGB(88,224,88) // RW #define COLOR_4 RGB(100,0,100) // BB #define COLOR_5 RGB(128,0,0) // BW #define COLOR_6 RGB(0,100,0) // CD #define COLOR_7 RGB(255,128,0) // NO #define COLOR_8 RGB(0,128,128) // NO #define COLOR_9 RGB(0,5,128) #define COLOR_10 RGB(0,255,0) // NO #define COLOR_STACK_0 RGB(50,0,100) // BML #define COLOR_STACK_1 RGB(70,100,50) // BLU #define COLOR_STACK_2 RGB(90,200,0) // GRN #define COLOR_STACK_3 RGB(110,0,100) // RED #define COLOR_STACK_4 RGB(130,100,50) // RPL #define COLOR_STACK_5 RGB(150,200,0) // OCL #define COLOR_STACK_6 RGB(170,0,100) // PS #define COLOR_STACK_7 RGB(190,100,50) // ANL #define COLOR_STACK_8 RGB(210,200,0) // FINAL #define COLOR_STACK_9 RGB(230,0,100) // MASK #define MAPSTACK_STEP_COUNT 10 #define UM_MAP_SELECTDEFECT (WM_USER + 8763) #define MAX_POINT_VALUE_CNT 3 enum Disp_SplineLocation { Disp_Spline_BotRight=0,Disp_Spline_BotLeft,Disp_Spline_TopRight,Disp_Spline_TopLeft,Disp_Spline_None }; enum NotchDirArry {NotchDir_A=0,NotchDir_B,NotchDir_C,NotchDir_D,NotchDir_Non}; class CGlassMap : public CDefectMap { public: CGlassMap(); virtual ~CGlassMap(); void SetGlassRecipe(CHardwareSettings *pHard,CGlassRecipe* pRecipe,BOOL bTFTArea); void ReCalRectDraw(); virtual void DrawGlass(CDC* pDC); virtual void MouseLBtnDblClk(CPoint& point); virtual void MouseLBtnDwn(CPoint& point); virtual void MouseLBtnMove(CPoint& point); virtual void MouseLBtnUp(CPoint& point); virtual void MouseRBtnDwn(CPoint& point); virtual void Timer(UINT nIDEvent); void ZoomInDefectMap(); void SetZoomMode(BOOL bSet){ m_bSetZoomMode = bSet; } BOOL SetSelectDefect(int nGlassDefectIdx); void SetDrawMapRefresh(){Invalidate(FALSE);} void DrawDefects(MapDefect* pMapDefect,CGlass_Data *pGlassData); void SetGlasssize(int nIdx,double dValue); void SetPointCutData(DimensionDir enDir,double *pCutArea,double dAvgVal); void SetPointDimenData(DimensionDir enDir,double *pDimen,double dAvgVal); void SetSplineData(Disp_SplineLocation enDir,double dValue); void SetCornerXData(Disp_SplineLocation enDir,double dValue); void SetCornerYData(Disp_SplineLocation enDir,double dValue); CInspectDefect *GetSelectDefect(){return m_pSelDefect;} void SetMapIndex(_ST_MAPSETTINGS_INDEX MapIndex){m_MapIndex=MapIndex;} protected: int m_nBlinkColor; BOOL m_bSetZoomMode; BOOL m_bZoomDrag; BOOL m_bZoomInMode; CRect m_rectZoomDrag,m_rectZoomWindow; double m_dZoomRatioH; double m_dZoomRatioV; double m_dGlasssize[2]; //iskang Add notch iamge view BOOL m_bNotch; int m_nNotchDir; int m_nMinDefectSize; inline int GetSmallSize(); inline int GetMidSize(); inline int GetLargeSize(); inline int GetHugeSize(); ////////////////////////////////////////////////////////////////////////// // Glass Info CHardwareSettings *m_pHardwareSetting; CGlassRecipe *m_pRecipe; MapDefect *m_pMapDefect; CInspectDefect *m_pSelDefect; CGlass_Data *m_pGlassData; CBrush m_BrushDefect[RCUT_DEFECT_TYPECOUNT]; CRect m_rectGlass; BOOL m_bTFTArea; int m_nCutAreaSize[4][MAX_POINT_VALUE_CNT]; int m_nCutAreaAVG[4]; int m_nDimensionSize[4][MAX_POINT_VALUE_CNT]; int m_nDimensionAVG[4]; double m_dSplineSize[4]; double m_dCornerSize_X[4]; double m_dCornerSize_Y[4]; _ST_MAPSETTINGS_INDEX m_MapIndex; protected: void DrawGlassDefect(HDC hDC); void DrawGlassPreDefect(HDC hDC,MapDefect *pMapDefect,int iPre); void DrawGlassBackGround(HDC hDC); void DrawGlassBackGroundRev(HDC hDC); void DrawGlassPosition(HDC hDC); void DrawZoonInMode(CDC *pDC,CControlMemDC *memDC); void DrawTriangle(HDC hDC, HPEN hPen, CPoint ptCenter, int nRadius); void DrawCircle(HDC hDC, HPEN hPen, CPoint ptCenter, int nRadius); void DrawCross(HDC hDC, HPEN hPen, CPoint ptCenter, int nRadius); void DrawRightAngleCross(HDC hDC, HPEN hPen, CPoint ptCenter, int nRadius); void DrawRect(HDC hDC, HPEN hPen, CRect rect); void DrawGlassArea(HDC hDC); void DrawRectangle(HDC hDC, CRect rectDrag, COLORREF pencolor, COLORREF brushcolor); void FillPolygon(HDC hDC,POINT *poly,int npoly,DWORD color,int nTop,int nBottom); void DrawPointValue(HDC hDC); void DrawPointValue(HDC hDC,CRect rectBase,CPoint pointSkip,int *pCurValue,int *pDimenValue,int nLoopCnt=MAX_POINT_VALUE_CNT); void DrawSplineValue(HDC hDC); void DrawCornerXValue(HDC hDC); void DrawCornerYValue(HDC hDC); protected: void CalDefectRect(CRect &rect,BOOL bRet=FALSE,BOOL bDirOpt=TRUE); void CalDefectRect(CPoint &point,BOOL bRet=FALSE,BOOL bDirOpt=TRUE); CString GetPositionString(DimensionDir dir); void ConvertOriginToView(int iSide,CRect &RectDefect); void ConvertOriginToViewRev(int iSide,CRect &RectDefect); CInspectDefect* FindSelDefect(CPoint pt); // Ãß¿ø±¹ - UI º¯°æ protected: CGlassMap* m_ptrOtherSideClass; public: void SetOtherGlassMapPtr(CGlassMap* ptr){m_ptrOtherSideClass = ptr;} CGlassMap* GetOtherGlassMapPtr(){return m_ptrOtherSideClass;} void DrawPointValue(HDC hDC,CRect rectBase,CPoint pointSkip,int *pCurValue, int *pCurValue2, int *pDimenValue,int nIndex,int nLoopCnt=MAX_POINT_VALUE_CNT); };