123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- // MatDynamicTest.cpp : implementation file
- //
- #include "stdafx.h"
- #include "StoneU_HC_OCX.h"
- #include "MatDynamicTest.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CMatDynamicTest dialog
- CMatDynamicTest::CMatDynamicTest(CWnd* pParent /*=NULL*/)
- : CDialog(CMatDynamicTest::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CMatDynamicTest)
- m_RemoteIP = _T("");
- m_RemotePort = 0;
- m_RemoteSurveillace = 0;
- m_RemoteUser = _T("");
- m_RemotePass = _T("");
- //}}AFX_DATA_INIT
- }
- void CMatDynamicTest::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CMatDynamicTest)
- DDX_Control(pDX, IDC_COMBODECCHANNUM, m_DecChanCombo);
- DDX_Control(pDX, IDC_COMBOTRANSMODE, m_TransModeCombo);
- DDX_Control(pDX, IDC_COMBOPROTOCOL, m_TransProtocolCombo);
- DDX_Text(pDX, IDC_EDITREMOTEIP, m_RemoteIP);
- DDX_Text(pDX, IDC_EDITREMOTEPORT, m_RemotePort);
- DDX_Text(pDX, IDC_EDITREMOTESURVE, m_RemoteSurveillace);
- DDX_Text(pDX, IDC_EDITREMOTENAME, m_RemoteUser);
- DDX_Text(pDX, IDC_EDITREMOTEPASS, m_RemotePass);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CMatDynamicTest, CDialog)
- //{{AFX_MSG_MAP(CMatDynamicTest)
- ON_BN_CLICKED(IDC_STARTDYNAMIC, OnStartdynamic)
- ON_BN_CLICKED(IDC_STOPDYNAMIC, OnStopdynamic)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CMatDynamicTest message handlers
- void CMatDynamicTest::OnStartdynamic()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
-
- NET_DVR_MATRIX_DYNAMIC_DEC dt;
- ZeroMemory(&dt, sizeof(dt));
- dt.dwSize = sizeof(NET_DVR_MATRIX_DYNAMIC_DEC);
- dt.struDecChanInfo.byChannel = (BYTE)m_RemoteSurveillace;
- dt.struDecChanInfo.byTransMode = m_TransModeCombo.GetCurSel();
- dt.struDecChanInfo.byTransProtocol = m_TransProtocolCombo.GetCurSel();
- sprintf((char *)dt.struDecChanInfo.sPassword, "%s", m_RemotePass);
- sprintf((char *)dt.struDecChanInfo.sUserName, "%s", m_RemoteUser);
- sprintf(dt.struDecChanInfo.sDVRIP, "%s", m_RemoteIP);
- dt.struDecChanInfo.wDVRPort = m_RemotePort;
-
- if (!NET_DVR_MatrixStartDynamic(m_lServerID, m_DecChanCombo.GetCurSel()+m_lStartChan, &dt))
- {
- CString tmp;
- tmp.Format("Error: NET_DVR_MatrixStartDynamic = %d\n", NET_DVR_GetLastError());
- AfxMessageBox(tmp);
- return;
- }
- MessageBox("³É¹¦Æô¶¯!");
- }
- void CMatDynamicTest::OnStopdynamic()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
- if (!NET_DVR_MatrixStopDynamic(m_lServerID, m_DecChanCombo.GetCurSel()+m_lStartChan))
- {
- TRACE("\nError: NET_DVR_MatrixStopDynamic = %d\n", NET_DVR_GetLastError());
- return;
- }
- MessageBox("³É¹¦Í£Ö¹!");
- }
- BOOL CMatDynamicTest::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- // TODO: Add extra initialization here
- CString tmp;
- for (int i=0; i<m_iChannelnumber;i++)
- {
- tmp.Format("%d", i + m_lStartChan);
- m_DecChanCombo.AddString(tmp);
- }
- m_DecChanCombo.SetCurSel(0);
- m_TransProtocolCombo.SetCurSel(0);
- m_TransModeCombo.SetCurSel(0);
- UpdateData(FALSE);
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
|