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

📄 prealarmdlg.h

📁 运用神经网络证据理论数据融合等算法实现设备的故障诊断
💻 H
字号:
// PreAlarmDlg.h : header file
//

#if !defined(AFX_PREALARMDLG_H__FE91F61B_6DB6_42B1_8446_DA0B930DFCAB__INCLUDED_)
#define AFX_PREALARMDLG_H__FE91F61B_6DB6_42B1_8446_DA0B930DFCAB__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "ButtonXp.h"
/////////////////////////////////////////////////////////////////////////////
// CPreAlarmDlg dialog

class CPreAlarmDlg : public CDialog
{
// Construction
public:
	CPreAlarmDlg(CWnd* pParent = NULL);	// standard constructor
    WORD m_ReadID_w3x;
	WORD m_DataType_w3x;
	WORD m_ReadID_w3y;
	WORD m_DataType_w3y;
	WORD m_ReadID_w4x;
	WORD m_DataType_w4x;
	WORD m_ReadID_w4y;
	WORD m_DataType_w4y;
	WORD m_ReadID_zt;
	WORD m_DataType_zt;
// Dialog Data
	//{{AFX_DATA(CPreAlarmDlg)
	enum { IDD = IDD_PREALARM_DIALOG };
	CButtonXp	m_b18;
	CButtonXp	m_b17;
	CButtonXp	m_b16;
	CButtonXp	m_b15;
	CButtonXp	m_b14;
	CButtonXp	m_b13;
	CButtonXp	m_b12;
	CButtonXp	m_b11;
	CButtonXp	m_b10;
	CButtonXp	m_b9;
	CButtonXp	m_b8;
	CButtonXp	m_b7;
	CButtonXp	m_b6;
	CButtonXp	m_b5;
	CButtonXp	m_b4;
	CButtonXp	m_b3;
	CButtonXp	m_b2;
	CButtonXp	m_b1;
	CComboBox	m_select;
	CTreeCtrl	m_Tw4y;
	CTreeCtrl	m_Tw4x;
	CTreeCtrl	m_Tw3y;
	CTreeCtrl	m_Tw3x;
	float	m_Ew3x;
	float	m_Ew3y;
	float	m_Ew4x;
	float	m_Ew4y;
	float	m_value01;
	float	m_value02;
	float	m_value03;
	float	m_value04;
	float	m_value05;
	float	m_value06;
	float	m_value07;
	float	m_value08;
	double	m_speed;
	double	m_alloweer;
	double	m_eer;
	CString	m_result;
	int		m_dsselectnum;
	int		m_dstotalnum;
	float	m_value09;
	float	m_value10;
	float	m_value11;
	float	m_value12;
	float	m_value13;
	float	m_value14;
	float	m_value15;
	float	m_value16;
	float	m_e1;
	float	m_e2;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CPreAlarmDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation	
	int k;                   //采集计数
	int N;                   //时域点数 
	int Nfft;                //fft点数 
	float F0;                //风机基频 
	float fs;                //采样频率
//BP	
private:
    enum {r=8};           //输入层 8个神经元
	enum {s1=9};      //中间层 9个神经元
	enum {s2=8};        //输出层 8个神经元
public:

	double* B1;             //权值、偏置参数
	double* B2;	            //权值、偏置参数
	double* W1;             //权值、偏置参数
	double* W2;             //权值、偏置参数
  
	double W1_init[s1*r];   //权值、偏置参数
	double W2_init[s2*s1];  //权值、偏置参数
	double B1_init[s1];     //权值、偏置参数
	double B2_init[s2];     //权值、偏置参数

	double W1_final[s1*r];  //权值、偏置参数
	double W2_final[s2*s1]; //权值、偏置参数
	double B1_final[s1];    //权值、偏置参数
	double B2_final[s2];    //权值、偏置参数

	double* P;              //当前输入样本的指针
	double* T;              //当前输出样本的指针

	double* A1;             //正向传播参数
	double* N1;             //正向传播参数
	double* A2;             //正向传播参数
	double* N2;             //正向传播参数

    double* AA2;

	double* E;              //反向传播参数

	double* S2;             //误差修正参数
	double* S1;             //误差修正参数

	double* dW1;            //权值修正参数
	double* dW2;            //权值修正参数
	double* dB1;            //偏置修正参数
	double* dB2;            //偏置修正参数

	void cretwb();
	void initwb();
	void loadwb();
	void savewb();

	double* f1(double A[],int m);  //激活函数
	double* f2(double A[],int m);  //激活函数
	double* F1(double N[],int m);  //激活函数
	double* F2(double N[],int m);  //激活函数

	long int learncount;           //学习次数

	int N_Err;                     //总的训练次数
	double error_accept;           //接受误差
	double numE[100000];           //误差存储矩阵
	double learnspeed;             //学习速度

    int Ns;                        //样本数
//DS
	double Bel[20][8]; 
	double Psl[20];
	int  N_BP;
 
void diagnose();  
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CPreAlarmDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnConnectKingdom();
	afx_msg void OnDisconnectKingdom();
	afx_msg void OnReadData();
	afx_msg void OnSaveData();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnTdataCurve();
	afx_msg void OnFdataCurve();
	afx_msg void OnCpeakValue();
	afx_msg void OnSubjection();
	afx_msg void OnCurveClear();
	afx_msg void OnBPTrain();
	afx_msg void OnBPEerPic();
	afx_msg void OnBPRun();
	afx_msg void OnBPSave();
	afx_msg void OnBPResult();
	afx_msg void OnDSBel();
	afx_msg void OnDSFuse();
	afx_msg void OnDSDiagnose();
	afx_msg void OnAutoRun();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_PREALARMDLG_H__FE91F61B_6DB6_42B1_8446_DA0B930DFCAB__INCLUDED_)

⌨️ 快捷键说明

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