⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fibertestclientview.h

📁 用API的串口采集数据,并且在界面上显示数据
💻 H
字号:
// FiberTestClientView.h : interface of the CFiberTestClientView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_FIBERTESTCLIENTVIEW_H__6E85D9FA_3BBA_490B_8233_69C831161DAA__INCLUDED_)
#define AFX_FIBERTESTCLIENTVIEW_H__6E85D9FA_3BBA_490B_8233_69C831161DAA__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


#define TIME_DRAW			100				//采样周期(单位:毫秒,可根据需要定制) 

#define ID_TIMER_DRAW_POINT 1				//画点A,B,C的定时器编号
#define ID_TIMER_READ_POINT	2				//采样,记录数据库的定时器编号

#define	TIME_BASE			100				//周期基准(单位:毫秒,用于计算,勿改动)
#define POINT_NULL			255				//不可能的点值,无效值
#define POINT_COUNT			(30000/TIME_DRAW) //30秒内采样点的个数

//如果直接从数据库读取数据显示,需注释下一行,取消 “INPUT_DATA”的定义
//如果从串口读取数据显示的,需要下行定义(#define INPUT_DATA),且必须要把从串口读到的数据即时放入暂存(需完善 080412_ReadData 部分?)
#define INPUT_DATA				//如果直接从串口读取数据显示并储存;

class CFiberTestClientView : public CFormView
{
protected: // create from serialization only
	CFiberTestClientView();
	DECLARE_DYNCREATE(CFiberTestClientView)
	CFiberTestClientDoc* GetDocument();

public:
	//{{AFX_DATA(CFiberTestClientView)
	enum { IDD = IDD_FIBERTESTCLIENT_FORM };
	int		m_xtime1;
	int		m_ymax;
	int		m_ymin;
	CString	m_Coord;
	CString	m_datatime;
	//}}AFX_DATA

// Attributes
public:


	int m_left,m_top,m_right,m_bottom;
	int m_IntervalPan;
	int m_Interval;	


	int		m_xtime;
	int		m_iPointCount;			//采样点的数量
	bool	m_bIsSetDrawPoint;		//画数据线定时器已设定标志;
	bool	m_bIsSetReadPoint;		//读暂存数据定时器设定标志
	bool	m_bIsFinishDraw;			//已绘采样点数量
	bool    m_bIsReTest;

	UINT	*m_uPointA;	//A点的数据
	UINT	*m_uPointB;	//B....
	UINT	*m_uPointC;	//C....
	UINT	*m_uDrawedPointA;//已画过的A点的数据;
	UINT	*m_uDrawedPointB;//........B.......
	UINT	*m_uDrawedPointC;//........C.......
	static	UINT m_uTempPointA;			//A点的数据暂存
	static	UINT m_uTempPointB;			//B.......
	static	UINT m_uTempPointC;			//C.......
// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CFiberTestClientView)
	public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual void OnInitialUpdate(); // called first time after construct
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);

	//}}AFX_VIRTUAL

// Implementation
public:
	void InitData();
	void DrawWave(CDC *pDC);
	void DrawPoint();//画数据曲线


	virtual ~CFiberTestClientView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
	private:
		CDC *pDC;             //屏幕绘图设备
		CDC memDC;            //内存绘图设备
		int m_High;           //绘图起点
		int m_Low;            //绘图终点


// Generated message map functions
protected:
	void Read();
		CString GetTime();

	LRESULT OnComm(WPARAM wParam, LPARAM lParam);
	void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
	//{{AFX_MSG(CFiberTestClientView)
	afx_msg void OnChangeYmin();
	afx_msg void OnChangeYmax();
	afx_msg void OnPaint();
	afx_msg void OnChangeTestTime();
	afx_msg void OnTimer(UINT nIDEvent);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in FiberTestClientView.cpp
inline CFiberTestClientDoc* CFiberTestClientView::GetDocument()
   { return (CFiberTestClientDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_FIBERTESTCLIENTVIEW_H__6E85D9FA_3BBA_490B_8233_69C831161DAA__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -