📄 remotekey.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_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-numeral 1 key, 2-numeral 2 key......9-numeral 9 key, 10-numeral 10 key,
//11-POWER key, 12-MENU key, 13-ENTER key, 14-"ESC" key,
//15-"up" or "Tilt up start", 16-"down" or "Tile down start", 17-"left" or "Pan left start", 18-"right" or "Pan right start",
//19-"EDIT" or "Iris+", 22-"PLAY", 23-"REC", 24-"PTZ" or "Iris-", 25-"Prev" or "Focus-",
//26-"A" or "Focus+", 27-"VOIP", 28-"Info",29-"Fast",30-"Backward",32-"Tilt up stop",
//33-"tilt down stop",34-"Pan left stop",35-"Pan right stop",36-"Iris+ stop",37-"Iris- stop",38-"Focus+ stop",
//39-"focus- stop",40-"Zoom+ start",41-"Zoom+ stop",42-"zoom- start",43-"zoom- stop"
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;
}
}
//DEL void CRemoteKey::OnButton3()
//DEL {
//DEL // TODO: Add your control notification handler code here
//DEL // NET_DVR_Preview(m_lServerID, 1);
//DEL }
//DEL void CRemoteKey::OnButton4()
//DEL {
//DEL // TODO: Add your control notification handler code here
//DEL // NET_DVR_PreviewOne(m_lServerID, 3);
//DEL }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -