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

📄 realtimectrlview.h

📁 一个演示实时多任务系统运行的仿真程序源码
💻 H
字号:
// RealTimeCtrlView.h : interface of the CRealTimeCtrlView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_REALTIMECTRLVIEW_H__2D43C15C_FEE3_4B1B_9740_7A1B6B8E210B__INCLUDED_)
#define AFX_REALTIMECTRLVIEW_H__2D43C15C_FEE3_4B1B_9740_7A1B6B8E210B__INCLUDED_

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


class CRealTimeCtrlView : public CFormView
{
protected: // create from serialization only
	CRealTimeCtrlView();
	DECLARE_DYNCREATE(CRealTimeCtrlView)

public:
	//{{AFX_DATA(CRealTimeCtrlView)
	enum { IDD = IDD_REALTIMECTRL_FORM };
	CSliderCtrl	m_SliderManual;
	CEdit	m_ManualStatus;
	CEdit	m_EditManual;
	CScrollBar	m_Scrollbar;
	CEdit	m_EditRuntime;
	CEdit	m_EditShowSV;
	CEdit	m_EditShowPV;
	CEdit	m_EditShowMV;
	CEdit	m_DateEdit;
	CEdit	m_TimeEdit;
	float	m_fK;
	float	m_fMH;
	float	m_fML;
	float	m_fKp;
	float	m_fL;
	float	m_fTp;
	float	m_fTs;
	float	m_fKP;
	float	m_fTD;
	float	m_fTI;
	float	m_fSV;
	float	m_fTc;
	//}}AFX_DATA

// Attributes
public:
	CRealTimeCtrlDoc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CRealTimeCtrlView)
	public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual void OnInitialUpdate(); // called first time after construct
	virtual void OnDraw(CDC* pDC);
	//}}AFX_VIRTUAL

// Implementation
public:
	void PIDCtrlCal();
	void ManualCtrl();
	BOOL m_bFirstPoint;
	void DrawPoint();
	void ModelCal();
	BOOL m_bAuto;
	BOOL m_bSuspend;

 	CPoint m_ptPV1,m_ptMV1,m_ptSV1;			//上一个点的坐标
	CPoint m_ptPV,m_ptMV,m_ptSV;			//本次点的坐标

	float m_fMV[600];						//m_fMV[0]是本次,m_fMV[1]是前一次,类推
	float m_fPV;							//本次测量值
	float m_fPV1;							//上一次的测量值

	float m_fd;								//变增益控制的阀值

	float m_fDV,m_fDV1,m_fDV2;				//本次,上次,上上次的偏差
	float m_fm;								//不完全微分增益
	float m_fU,m_fU1;						//不完全微分所用的中间变量

	float m_fManual;						//手动控制值

	CArray<CPoint,CPoint> m_StrokePV;		//PV曲线
	CArray<CPoint,CPoint> m_StrokeMV;		//MV曲线
	CArray<CPoint,CPoint> m_StrokeSV;		//SV曲线

/*	CArray<float,float> m_ValuePV;			//PV历史值记录
	CArray<float,float> m_ValueMV;			//MV历史值记录
	CArray<float,float> m_ValueSV;			//SV历史值记录*/

	int m_nRuntime;							//运行时间	

	long m_lXAdd;							//X方向增量
	int m_nNowPage;							//现在为第几页
	int m_nNowPage2;
	int m_nNowPage3;
	int m_nAllPage;							//共几页

	int m_nSpeed;							//仿真速度
	
	void DrawStroke(CDC* pDC);				//在OnDraw中画三条曲线
	void DrawStroke();						//画历史曲线

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

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CRealTimeCtrlView)
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnCtrlparaReset();
	afx_msg void OnObjparaReset();
	afx_msg void OnCtrlparaOk();
	afx_msg void OnObjparaOk();
	afx_msg void OnButtonAutoandmanual();
	afx_msg void OnButtonRun();
	afx_msg void OnButtonStop();
	afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg void OnButtonRestart();
	afx_msg void OnMenuSpeed1();
	afx_msg void OnUpdateMenuSpeed1(CCmdUI* pCmdUI);
	afx_msg void OnMenuSpeed8();
	afx_msg void OnUpdateMenuSpeed8(CCmdUI* pCmdUI);
	afx_msg void OnMenuSpeed2();
	afx_msg void OnUpdateMenuSpeed2(CCmdUI* pCmdUI);
	afx_msg void OnMenuSpeed4();
	afx_msg void OnUpdateMenuSpeed4(CCmdUI* pCmdUI);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnMenuSpeed16();
	afx_msg void OnUpdateMenuSpeed16(CCmdUI* pCmdUI);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in RealTimeCtrlView.cpp
inline CRealTimeCtrlDoc* CRealTimeCtrlView::GetDocument()
   { return (CRealTimeCtrlDoc*)m_pDocument; }
#endif

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

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

#endif // !defined(AFX_REALTIMECTRLVIEW_H__2D43C15C_FEE3_4B1B_9740_7A1B6B8E210B__INCLUDED_)

⌨️ 快捷键说明

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