www.pudn.com > PressMonitor_q.zip > 3DTrendCtrl.h


#if !defined(AFX_3DTRENDCTRL_H__30FB6305_9546_497F_9BF8_8EA6B4495F54__INCLUDED_) 
#define AFX_3DTRENDCTRL_H__30FB6305_9546_497F_9BF8_8EA6B4495F54__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
// 3DTrendCtrl.h : header file 
// 
#include "TrendCurve.h" 
///////////////////////////////////////////////////////////////////////////// 
// C3DTrendCtrl window 
 
#define SCALE_LEFT				0 
#define SCALE_CENTER			1 
#define SCALE_RIGHT				2 
 
	 
struct Scale{ 
		float       MiniValue; 
		float       MaxiValue; 
		float       VertRatio; 
		CString     strUnit; 
		UINT		nStyle; 
		COLORREF	clr; 
}; 
	 
class C3DTrendCtrl : public CStatic 
{ 
// Construction 
public: 
	C3DTrendCtrl(); 
 
// Attributes 
public: 
	bool		m_bGridBelow; 
    int			m_nValueStep; 
	int			m_nTimeStep; 
	int			m_nTimeStepCount; 
	int			m_nCurveDataCount; 
 
	Scale		m_scale[3]; 
 
	int			m_nFrameWidth; 
 
	//fontHeight Value 
	int			m_nScaleHeight; 
	int			m_nUnitHeight; 
	int			m_nNameHeight; 
	int			m_nValueHeight; 
	int			m_nTimeHeight; 
 
 
	CArray m_curveArray; 
protected: 
 
    // CDC and images 
	CDC			m_dcBackground ; 
	CBitmap		*m_pBitmapOldBackground ; 
	CBitmap		m_bitmapBackground ; 
 
	// bar rect setting 
	CRect		m_rectCtrl ; 
	CRect		m_rectPane ; 
	CRect		m_rectChart ; 
	CRect		m_rectPaneLeft ; 
	CRect		m_rectPaneRight ; 
	CRect		m_rectPaneTop ; 
	CRect		m_rectPaneBottom ; 
 
 
    // barchart colours 
	COLORREF	m_crGrid; 
	COLORREF	m_crFrame; 
	COLORREF	m_crBkGnd; 
	COLORREF	m_crPane; 
	COLORREF	m_crValue; 
	COLORREF	m_crName; 
	COLORREF	m_crRulerScale; 
	COLORREF	m_crRulerTime; 
	COLORREF	m_crTime; 
 
	//system colours 
    COLORREF    m_crWindowText; 
	COLORREF	m_crWindow; 
	COLORREF	m_cr3DFace;      
    COLORREF    m_crShadow; 
	COLORREF	m_crHighlight; 
	COLORREF	m_crDkShadow; 
	COLORREF	m_crLight;   
	 
// Operations 
public: 
	//unit operations 
 
 
	//curves operations 
	bool		RemoveAllCurves(); 
	bool		AddCurve(CString strName,COLORREF clr=RGB(0,0,0),CString strUnit=CURVE_UNIT_MPA,int nPenSize=1,bool bHide=false); 
	void		ShowCurve(int index); 
	void		HideCurve(int index); 
	void		SetCurvePenSize(int index,int nPenSize); 
	void		SetCurveData(int index,int dataIndex,double value,CTime time); 
	void		ShiftCurveData(int index,double value,CTime time); 
	bool		AddCurveData(int index,double value,CTime time); 
 
public:   
	//functions to get value of curves; 
    int	        GetCurveCount() const    { return m_curveArray.GetSize(); } 
	CString		GetCurveUnit(int index); 
	int			GetCurvePenSize(int index); 
	COLORREF	GetCurveColor(int index); 
	int			GetCurveDataArraySize(int index); 
	CTime		GetCurveDataTime(int index,int dataIndex); 
	double		GetCurveDataValue(int index,int dataIndex); 
	CDataInfo*	GetCurveData(int index,int dataIndex); 
	CString		GetCurveName(int index); 
	bool		GetCurveDispState(int index); 
// Overrides 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(C3DTrendCtrl) 
	//}}AFX_VIRTUAL 
 
// Implementation 
public: 
	void PrintName(CDC* pDC); 
	void PrintTime(CDC* pDC); 
	void PrintCurve(CDC* pDC, int index); 
	void PrintCurves(CDC* pDC); 
	void PrintGrid(CDC* pDC); 
	void PrintScale(CDC* pDC); 
	void PrintUnit(CDC* pDC); 
	//print implementation 
	void PrintCalculating(CRect& rect); 
	void OnPrint(CDC *pDC,CRect& rect); 
 
	//initialize implementation 
	BOOL SetScale(Scale* scale, int ValueStep = 4); 
	BOOL Initialize(Scale* scale,int nStepCount=10,int nTimeStep=5,int nValueStep=4,bool bPrint=false); 
	 
	//refresh implementation 
    void RefreshWindow()                     { Invalidate();    } 
	void ReCalculating(); 
	void ReconstructControl(); 
 
	//draw implementation 
	void PaintNameBack(CDC* pDC,CRect& rect,int index); 
	void DrawValue(CDC *pDC); 
	void DrawName(CDC *pDC); 
	void DrawTime(CDC *pDC); 
	void DrawCurves(CDC *pDC); 
	void DrawCurve(CDC *pDC,int index); 
	void DrawGrid(CDC *pDC); 
	void DrawScale(CDC *pDC); 
	void DrawUnit(CDC *pDC); 
	void DrawRuler(CDC *pDC); 
	void DrawPane(CDC *pDC); 
	void DrawFrame(CDC *pDC); 
 
	virtual ~C3DTrendCtrl(); 
 
	// Generated message map functions 
protected: 
	//{{AFX_MSG(C3DTrendCtrl) 
	afx_msg BOOL OnEraseBkgnd(CDC* pDC); 
	afx_msg void OnPaint(); 
	afx_msg void OnSize(UINT nType, int cx, int cy); 
	//}}AFX_MSG 
 
	DECLARE_MESSAGE_MAP() 
}; 
 
///////////////////////////////////////////////////////////////////////////// 
 
//{{AFX_INSERT_LOCATION}} 
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. 
 
#endif // !defined(AFX_3DTRENDCTRL_H__30FB6305_9546_497F_9BF8_8EA6B4495F54__INCLUDED_)