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

📄 水箱实验view.h

📁 这是一个水箱的液位控制程序
💻 H
字号:
// 水箱实验View.h : interface of the CMyView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_VIEW_H__4E20E838_7DF2_4C46_B6E4_A7F02F60325B__INCLUDED_)
#define AFX_VIEW_H__4E20E838_7DF2_4C46_B6E4_A7F02F60325B__INCLUDED_

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

#define MVCHANGE_DATA		WM_USER + 3
#define SVCHANGE_DATA		WM_USER + 4
#define AUTO_MAN			WM_USER + 5



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

public:
	void Displaydata();       //显示数据函数
	float pidcontrol1(float inDataOne,float SetDataOne,float inDataTwo,float SetDataTwo,double Kp,
		double Ki,double Kd);        //PID控制算法;
	float pidcontrol2(float inDataOne,float SetDataOne,float inDataTwo,float SetDataTwo,double Kp,
		double Ki,double Kd);
	float smithcontrol1(float dataOne,float SetDataOne,float inDataTwo,float SetDataTwo,double Kp,
		double Ki,double Kd);            //Smith控制算法 
	float smithcontrol2(float dataOne,float SetDataOne,float inDataTwo,float SetDataTwo,double Kp,
		double Ki,double Kd);
	float dmccontrol1(float dataOne,float SetDataOne,float inDataTwo,float SetDataTwo,double Kp,
		double Ki,double Kd);             //DMC预测算法
	float dmccontrol2(float dataOne,float SetDataOne,float inDataTwo,float SetDataTwo,double Kp,
		double Ki,double Kd);
	float othercontrol1(float dataOne,float SetDataOne,float inDataTwo,float SetDataTwo,double Kp,
		double Ki,double Kd);          //预留,为其它控制算法预留
	float othercontrol2(float dataOne,float SetDataOne,float inDataTwo,float SetDataTwo,double Kp,
		double Ki,double Kd);

	
	CBrush backBrush;          //棒形图初始设计
	CBrush mvBrush;
	CBrush svBrush;
//	CButton AorM;qwew
	int  aorm;
	int  aorm2;
	int m_seriesoption;
	BOOL  mvCapture;
	BOOL  svCapture;
	BOOL  mvOtherCapture;
	BOOL  svOtherCapture;
	int Mv;
	int Sv;
	int Mv1;
	int Sv1;
	void SetMv(int data);
	void SetMv1(int data);
	void SetSv(int data);
	void SetSv1(int data);
	int _mv;
	int _mv1;
	int _sv;
	int _sv1;
	float getdata1;
	float getdata2;

	float MvData[50000];      //控制器输出值,用于在画面上显示数据
	float SvData[50000];      //设置值,用于在画面上显示数据
	float PvData[50000];      //采样测量值,用于在画面上显示数据
	float PvGetData[50000];
	float PvGetDataOther[50000];

	float MvDataOther[50000];      //控制器输出值2,用于在画面上显示数据
	float SvDataOther[50000];      //设置值2,用于在画面上显示数据
	float PvDataOther[50000];      //采样测量值2,用于在画面上显示数据
	unsigned long datanumber;           //采样数据的个数
	float ec,ec1,ecOther,ec1Other;                 //误差变化率 
	float StepU1,StepU2;                            //控制量变化限制
	float e,e1,eOther,e1Other;                  //误差
	int cout;
	float U1,u;                  //输出值
	float U1Old,U1New;
	float U2Old,U2New;
	float U2,uOther;                  //输出值	
	float out,outOther;                //输出值
	float PvDataValue,PvDataValueOther;  //显示棒形图时的Pv值;
	CRgn mvRgn;
	CRgn mvRgnOther;
	CRgn svRgn;
	CRgn svRgnOther;
	
	int start;                //**程序中间变量,无须了解
	BOOL clean;               //**程序中间变量,无须了解 
	BOOL Move;                //**程序中间变量,无须了解
	BOOL newdisplay;          //程序中间变量,无须了解
	BOOL time;                //程序中间变量,无须了解
	BOOL StartOK;
	BOOL StopOK;
	int m_getsetmv1;
	int m_getsetmv2;

	int addy2;                    //调整曲线图位置,无需了解

	int m_historytimeget1;
	int	m_historytimeget2;

	int m_delaytime1;
	int m_delaytime2;
	int m_mvdownlimit1;
	int m_mvdownlimit2;
	int m_mvuplimit1;
	int m_mvuplimit2;
	int m_upwarning1;
	int m_upwarning2;
	int m_downwarning1;
	int m_downwarning2;

	BOOL delaystart;
	//绘图和滤波参数:
    BOOL m_hidemv1;
	BOOL m_hidemv2;
	BOOL m_hidepv1;
	BOOL m_hidepv2;
	BOOL m_hidesv1;
	BOOL m_hidesv2;
	BOOL m_showbkwhite1;
	BOOL m_showbkwhite2;
	BOOL m_filteryes1;
	BOOL m_filteryes2;
	float m_getfilternun1;
	float m_getfilternun2;

	//{{AFX_DATA(CMyView)
	enum{ IDD = IDD_MY_FORM };
	int m_time;
	double m_pidkp1;
	double m_pidkp2;
	double m_pidti1;
	double m_pidti2;
	double m_pidtd1;
	double m_pidtd2;
	int m_pidcontrolget;
	int m_getsetsv1;
	int m_getsetsv2;

		// NOTE: the ClassWizard will add data members here
	//}}AFX_DATA

// Attributes
public:
	CMyDoc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMyView)
	public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual void OnInitialUpdate(); // called first time after construct
	virtual void OnDraw(CDC* pDC);
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CMyView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CMyView)
	afx_msg void OnTime();
	afx_msg void OnOptionTime();
	afx_msg void OnPid();
	afx_msg void OnOptionPid();
	afx_msg void OnControler();
	afx_msg void OnOptionControlset();
	afx_msg void OnOptionSetsv();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnLeftscrollpage();
	afx_msg void OnRightscrollpage();
	afx_msg void OnDestroy();
	afx_msg void OnStart();
	afx_msg void OnStop();
	afx_msg void OnLeftscroll();
	afx_msg void OnRightscroll();
	afx_msg void OnAorm();
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnSave();
	afx_msg void OnRead();
	afx_msg void OnFileOpen();
	afx_msg void OnFileSaveAs();
	afx_msg void OnHistorydata();
	afx_msg void OnOptionHistorydata();
	afx_msg void OnSystemUpdownlimit();
	afx_msg void OnSystemWarninglimit();
	afx_msg void OnAorm2();
	afx_msg void OnSystemDelaytime();
	afx_msg void OnSystemDrawfilter();
	afx_msg void OnOptionSeries();
	afx_msg void OnIdentify();
	afx_msg void OnSavetxt3();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in 水箱实验View.cpp
inline CMyDoc* CMyView::GetDocument()
   { return (CMyDoc*)m_pDocument; }
#endif

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

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

#endif // !defined(AFX_VIEW_H__4E20E838_7DF2_4C46_B6E4_A7F02F60325B__INCLUDED_)

⌨️ 快捷键说明

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