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

📄 monitor.h

📁 电信机房MDF、电源柜监控源码,主要用在通信机房配线设备监控、电源柜监控
💻 H
字号:

#pragma once
#include "eqpool.h"
#include "system.h"
#include "dataanalyse.h"
#include "protocol.h"

#include "serialport.h"
#include "socketcomm.h"
#include "gsmcomm.h"
#include "media.h"

#pragma comment(lib,"CMSerial.lib")
#pragma comment(lib,"CMTCPServer.lib")
#pragma comment(lib,"CMGSMComm.lib")

//#include "..\\CMTCPServer\\CMTCPServer\\udpserver.h"
//#include "..\\CMSerial\\CMSerial\\serialport.h"


// CMonitor 对话框

class CMonitor : public CWnd
{

public:
	CMonitor();   // 标准构造函数
	//CMonitor();   // 标准构造函数
	virtual ~CMonitor();
// 对话框数据
//enum { IDD = IDD_MONITOR };

protected:
	DECLARE_DYNAMIC(CMonitor)
	static UINT SendThd(LPVOID lpWnd);
	DECLARE_MESSAGE_MAP()

	afx_msg void OnSetFocus(CWnd *pOldWnd);


//{{AFX_MSG(CMDFDlg)

	afx_msg LRESULT onCom_RXChar(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT onSockReadString(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT onStatusChange(WPARAM wParam, LPARAM lParam);		//设备状态改变
	afx_msg LRESULT onAlarming(WPARAM wParam, LPARAM lParam);			//设备状态改变
	afx_msg LRESULT onReadData(WPARAM wParam, LPARAM lParam);			//设备状态改变
	afx_msg LRESULT onSendSMSInfo(WPARAM wParam, LPARAM lParam);		//接收手机短信
	
	char buff[MAX_SIZE];
	int iRev;
	HANDLE				m_hEventArray[3];
	
	CString strReceive;
//}}AFX_MSG
	CStatusBar  m_wndStatusBar;
	CToolBar    m_wndToolBar;
	//CChildView    m_wndView;
	CSplitterWnd  m_SplitterWnd;
	//CMainForm	  m_wndView;


public:
	// 监测服务器

	//CUdpServer		*m_udpServer[2];
	CSocketComm		*m_udpServer[2];

	CEQPool*		m_pEQPool ;				//设备池
	CDataAnalyse	*m_pAnalyse;			//数据逻辑处理包
	CGsmComm		*m_Gsm;					//短信组件

	// 起动系统监测功能
	BOOL StartMonitoring(void);
	// 停止系统监测功能
	BOOL StopMonitoring(void);
	// 重新起动监测功能
	int Restart(void);
	// 关闭监测功能
	BOOL Close(void);
	// 串口组件
	//CSerialPort		*m_comPort[10];
	CArray<CSerialPort *,CSerialPort *>  m_comPort;
	CStringArray	m_comArray;
	CMedia m_pMedia;
	// 取得监测串口号
	int GetComPort(void);
	// 数据访问组件
	CAdoDB *p_adodb;
	// 数据分析处理
	int DataAnalyse(CInfoFrame frame);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	// 协议处理包
	CProtocol* m_protocol;
	// 命令发送器
	CArray< sUnit,sUnit> m_UnitArray ;
	CArray<CEquipmentPort,CEquipmentPort> m_EquipState;

	// 送出信息到串口
	int SendInfoToCom(int iPort, CString strBuf);
private:
	// 监测线程指针
	CWinThread *m_pThread;
public:
	// 起动告警查询线程
	BOOL StartAsking(int iSecond);
	BOOL m_AskingStatus;
public:
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnCmStart();
	afx_msg void OnCmStop();
	afx_msg void OnAppExit();



protected:
//	virtual BOOL OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult);

	afx_msg LRESULT onSoundOpen(UINT wParam,LONG lParam);
	afx_msg LRESULT onSoundDone(UINT wParam,LONG lParam);
	afx_msg LRESULT onSoundClose(UINT wParam,LONG lParam);
	afx_msg LRESULT GsmVoice(WPARAM wParam,LPARAM lParam) ;
	afx_msg LRESULT GsmVoiceClose(WPARAM wParam,LPARAM lParam) ;

public:
	// 初始化监测设备端口状态
	int IniEquipPort();
	// WEB接收数据包分析
	int __cdecl WebDataAnalyse(CInfoFrame frame);
	// 初始化短信组件
	BOOL IniGsmInfo(void);
	// 送出告警信息
	int SendAlarmInfo(CEquipmentPort *m_ptAlarm);
	// 关闭GSMMODEM
	BOOL ClsoeGSM(void);
	//afx_msg void OnBnClickedOk();
	//afx_msg void OnBnClickedButton1();
	//afx_msg void OnBnClickedCancel();
	afx_msg void OnCmSound();
};

⌨️ 快捷键说明

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