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

📄 ~dlgalarm.~h

📁 实时监控
💻 ~H
字号:
#if !defined(AFX_DLGALARM_H__92896D1E_1D89_4223_B99E_915D981E8F52__INCLUDED_)
#define AFX_DLGALARM_H__92896D1E_1D89_4223_B99E_915D981E8F52__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgAlarm.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CDlgAlarm dialog
#include "modelessdlg.h"
#include "../utils/LED.h"
#include "../utils/DirectSound.h"
#include <vector>

class alarm_data
{
public:
	ULONG ip;
	USHORT port;
	DWORD alarms[3];
	CString alias;

	alarm_data(ULONG i, USHORT p, LPCTSTR als, const DWORD* al)
	{
		ip = i;
		port = p;
		alias = als;
		set_alarm(al);
	}
	alarm_data(const alarm_data& ref)
	{
		*this = ref;
	}
	alarm_data& operator=(const alarm_data& ref)
	{
		ip = ref.ip;
		port = ref.port;
		set_alarm(ref.alarms);
		alias = ref.alias;
		return *this;
	}
	void set_alarm(const DWORD* al)
	{
		memcpy(alarms, al, 12);
	}
};

class CDlgAlarm : public modelessdlg<CDialog, CDlgAlarm>
{
	HICON red;
	HICON green;
	
	enum {LEDS = 48};
	enum {CAMERA=0, MD=1, VIDEO_LOST=2};

	void restore_status();
	void update_status();
	void update_combo();
	
	void set_timer(UINT timer);
	void check_alarms(const DWORD* alarms);

	typedef std::vector<UINT> timer_list;
	timer_list tl;
	
	typedef std::vector<alarm_data> alarm_list;
	alarm_list al;
	
	CDirectSound ds;
	bool hidden;
	bool alarming;

// Construction
public:
	CDlgAlarm(CWnd* pParent = NULL);   // standard constructor
	virtual void show(CWnd* parent = NULL);
	virtual void hide();

	void hide_alarm(bool h=true);

	void add_alarm(ULONG _ip, USHORT _port, LPCTSTR alias, const DWORD* masks);
	void remove_alarm(ULONG _ip, USHORT _port);

	void clear_alarm();
	bool alarms_present() const;
	
// Dialog Data
	//{{AFX_DATA(CDlgAlarm)
	enum { IDD = IDD_ALARM };
	CLed m_led[3][LEDS/3];
	CComboBox	m_cbremote;
	int			m_remote;
	//}}AFX_DATA

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

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CDlgAlarm)
	virtual void OnCancel();
	virtual void OnOK();
	virtual BOOL OnInitDialog();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnSelChangeRemote();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_DLGALARM_H__92896D1E_1D89_4223_B99E_915D981E8F52__INCLUDED_)

⌨️ 快捷键说明

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