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

📄 remotekey.cpp

📁 监控开发资料,提供二次开发源码和使用说明书
💻 CPP
字号:
// RemoteKey.cpp : implementation file
//

#include "stdafx.h"
#include "newclient.h"
#include "RemoteKey.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CRemoteKey dialog


CRemoteKey::CRemoteKey(CWnd* pParent /*=NULL*/)
	: CDialog(CRemoteKey::IDD, pParent)
{
	//{{AFX_DATA_INIT(CRemoteKey)
	m_PanSel = -1;
	//}}AFX_DATA_INIT
}


void CRemoteKey::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CRemoteKey)
	DDX_Radio(pDX, IDC_RADIO2, m_PanSel);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CRemoteKey, CDialog)
	//{{AFX_MSG_MAP(CRemoteKey)
	ON_BN_CLICKED(IDC_EXIT, OnExit)
	ON_BN_CLICKED(IDC_BUT0, OnBut0)
	ON_BN_CLICKED(IDC_BUT1, OnBut1)
	ON_BN_CLICKED(IDC_BUT2, OnBut2)
	ON_BN_CLICKED(IDC_BUT3, OnBut3)
	ON_BN_CLICKED(IDC_BUT4, OnBut4)
	ON_BN_CLICKED(IDC_BUT8, OnBut8)
	ON_BN_CLICKED(IDC_BUT9, OnBut9)
	ON_BN_CLICKED(IDC_BUTA, OnButa)
	ON_BN_CLICKED(IDC_BUTEDIT, OnButedit)
	ON_BN_CLICKED(IDC_BUTESC, OnButesc)
	ON_BN_CLICKED(IDC_BUTMENU, OnButmenu)
	ON_BN_CLICKED(IDC_BUTMULTI, OnButmulti)
	ON_BN_CLICKED(IDC_BUTPAN, OnButpan)
	ON_BN_CLICKED(IDC_BUTPLAY, OnButplay)
	ON_BN_CLICKED(IDC_BUTREC, OnButrec)
	ON_BN_CLICKED(IDC_BUTOK, OnButok)
	ON_BN_CLICKED(IDC_BUTUP, OnButup)
	ON_BN_CLICKED(IDC_BUTDOWN, OnButdown)
	ON_BN_CLICKED(IDC_BUTLEFT, OnButleft)
	ON_BN_CLICKED(IDC_BUTRIGHT, OnButright)
	ON_BN_CLICKED(IDC_BUTSTART, OnButstart)
	ON_BN_CLICKED(IDC_BUTSTOP, OnButstop)
	ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
	ON_BN_CLICKED(IDC_BUTTON4, OnButton4)
	ON_BN_CLICKED(IDC_BUT5, OnBut5)
	ON_BN_CLICKED(IDC_BUT6, OnBut6)
	ON_BN_CLICKED(IDC_BUT7, OnBut7)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CRemoteKey message handlers

BOOL CRemoteKey::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
//1-按钮1,2-按钮2......9-按钮9,10-按钮0,11-POWER,12-MENU,13-ENTER,14-"ESC",
//15-"上"或者"云台上开始",16-"下"或者"云台下开始",17-"左"或者"云台左开始",18-"右"或者"云台右开始",
//19-"EDIT"或者"光圈+开始",22-"PLAY",23-"REC",24-"PAN"或者"光圈-开始",25-"多画面"或者"聚焦-开始",
//26-"输入法"或者"聚焦+开始",27-"对讲",28-"系统信息",29-"快进",30-"快退",32-"云台上结束",
//33-"云台下结束",34-"云台左结束",35-"云台右结束",36-"光圈+结束",37-"光圈-结束",38-"聚焦+结束",
//39-"聚焦-结束",40-"变倍+开始",41-"变倍+结束",42-"变倍-开始",43-"变倍-结束"
void CRemoteKey::OnOK() 
{
	// TODO: Add extra validation here
	
	//CDialog::OnOK();
}

void CRemoteKey::OnCancel() 
{
	// TODO: Add extra cleanup here
	
	//CDialog::OnCancel();
}

void CRemoteKey::OnExit() 
{
	// TODO: Add your control notification handler code here
	CDialog::OnCancel();
}

void CRemoteKey::OnBut0() 
{
	// TODO: Add your control notification handler code here
	NET_DVR_ClickKey(m_lServerID, 10);
}

void CRemoteKey::OnBut1() 
{
	// TODO: Add your control notification handler code here
	NET_DVR_ClickKey(m_lServerID, 1);
}

void CRemoteKey::OnBut2() 
{
	// TODO: Add your control notification handler code here
	NET_DVR_ClickKey(m_lServerID, 2);
}

void CRemoteKey::OnBut3() 
{
	// TODO: Add your control notification handler code here
	NET_DVR_ClickKey(m_lServerID, 3);
}

void CRemoteKey::OnBut4() 
{
	// TODO: Add your control notification handler code here
	NET_DVR_ClickKey(m_lServerID, 4);
}

void CRemoteKey::OnBut5() 
{
	// TODO: Add your control notification handler code here
	NET_DVR_ClickKey(m_lServerID, 5);
}

void CRemoteKey::OnBut6() 
{
	// TODO: Add your control notification handler code here
	NET_DVR_ClickKey(m_lServerID, 6);
}

void CRemoteKey::OnBut7() 
{
	// TODO: Add your control notification handler code here
	NET_DVR_ClickKey(m_lServerID, 7);
}

void CRemoteKey::OnBut8() 
{
	// TODO: Add your control notification handler code here
	NET_DVR_ClickKey(m_lServerID, 8);
}

void CRemoteKey::OnBut9() 
{
	// TODO: Add your control notification handler code here
	NET_DVR_ClickKey(m_lServerID, 9);
}

void CRemoteKey::OnButa() 
{
	// TODO: Add your control notification handler code here
	NET_DVR_ClickKey(m_lServerID, 26);
}

void CRemoteKey::OnButedit() 
{
	// TODO: Add your control notification handler code here
	NET_DVR_ClickKey(m_lServerID, 19);
}

void CRemoteKey::OnButesc() 
{
	// TODO: Add your control notification handler code here
	NET_DVR_ClickKey(m_lServerID, 14);
}

void CRemoteKey::OnButmenu() 
{
	// TODO: Add your control notification handler code here
	NET_DVR_ClickKey(m_lServerID, 12);
}

void CRemoteKey::OnButmulti() 
{
	// TODO: Add your control notification handler code here
	NET_DVR_ClickKey(m_lServerID, 25);
}

void CRemoteKey::OnButpan() 
{
	// TODO: Add your control notification handler code here
	NET_DVR_ClickKey(m_lServerID, 24);
}

void CRemoteKey::OnButplay() 
{
	// TODO: Add your control notification handler code here
	NET_DVR_ClickKey(m_lServerID, 22);
}

void CRemoteKey::OnButrec() 
{
	// TODO: Add your control notification handler code here
	NET_DVR_ClickKey(m_lServerID, 23);
}


void CRemoteKey::OnButok() 
{
	// TODO: Add your control notification handler code here
	NET_DVR_ClickKey(m_lServerID, 13);
}

void CRemoteKey::OnButup() 
{
	// TODO: Add your control notification handler code here
	NET_DVR_ClickKey(m_lServerID, 15);
}

void CRemoteKey::OnButdown() 
{
	// TODO: Add your control notification handler code here
	NET_DVR_ClickKey(m_lServerID, 16);
}

void CRemoteKey::OnButleft() 
{
	// TODO: Add your control notification handler code here
	NET_DVR_ClickKey(m_lServerID, 17);
}

void CRemoteKey::OnButright() 
{
	// TODO: Add your control notification handler code here
	NET_DVR_ClickKey(m_lServerID, 18);
}

void CRemoteKey::OnButstart() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	switch(m_PanSel) {
	case 0:
		NET_DVR_ClickKey(m_lServerID, 19);
		break;
	case 1:
		NET_DVR_ClickKey(m_lServerID, 24);
		break;
	case 2:
		NET_DVR_ClickKey(m_lServerID, 26);
		break;
	case 3:
		NET_DVR_ClickKey(m_lServerID, 25);
		break;
	case 4:
		NET_DVR_ClickKey(m_lServerID, 40);
		break;
	case 5:
		NET_DVR_ClickKey(m_lServerID, 42);
		break;
	case 6:
		NET_DVR_ClickKey(m_lServerID, 15);
		break;
	case 7:
		NET_DVR_ClickKey(m_lServerID, 16);
		break;
	case 8:
		NET_DVR_ClickKey(m_lServerID, 17);
		break;
	case 9:
		NET_DVR_ClickKey(m_lServerID, 18);
		break;
	default:
		break;
	}
}

void CRemoteKey::OnButstop() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	switch(m_PanSel) {
	case 0:
		NET_DVR_ClickKey(m_lServerID, 36);
		break;
	case 1:
		NET_DVR_ClickKey(m_lServerID, 37);
		break;
	case 2:
		NET_DVR_ClickKey(m_lServerID, 38);
		break;
	case 3:
		NET_DVR_ClickKey(m_lServerID, 39);
		break;
	case 4:
		NET_DVR_ClickKey(m_lServerID, 41);
		break;
	case 5:
		NET_DVR_ClickKey(m_lServerID, 43);
		break;
	case 6:
		NET_DVR_ClickKey(m_lServerID, 32);
		break;
	case 7:
		NET_DVR_ClickKey(m_lServerID, 33);
		break;
	case 8:
		NET_DVR_ClickKey(m_lServerID, 34);
		break;
	case 9:
		NET_DVR_ClickKey(m_lServerID, 35);
		break;
	default:
		break;
	}
}

void CRemoteKey::OnButton3() 
{
	// TODO: Add your control notification handler code here
//	NET_DVR_Preview(m_lServerID, 1);
}

void CRemoteKey::OnButton4() 
{
	// TODO: Add your control notification handler code here
//	NET_DVR_PreviewOne(m_lServerID, 3);
}

⌨️ 快捷键说明

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