123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223 |
- // MatCenter.cpp : implementation file
- //
- #include "stdafx.h"
- #include "newclient.h"
- #include "MatCenter.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CMatCenter dialog
- CMatCenter::CMatCenter(CWnd* pParent /*=NULL*/)
- : CDialog(CMatCenter::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CMatCenter)
- m_Ip = _T("");
- m_Port = 0;
- m_UserName = _T("");
- m_UserPSW = _T("");
- m_Ip1 = _T("");
- m_Port1 = 0;
- m_Port2 = 0;
- m_UserName1 = _T("");
- m_UserName2 = _T("");
- m_UserPSW1 = _T("");
- m_UserPSW2 = _T("");
- m_CtrlMedia1 = FALSE;
- m_CtrlMedia2 = FALSE;
- m_CtrlMedia3 = FALSE;
- m_CtrlMedia4 = FALSE;
- //}}AFX_DATA_INIT
- }
- void CMatCenter::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CMatCenter)
- DDX_Control(pDX, IDC_COMISOLATED, m_IsolatedCtrl);
- DDX_Control(pDX, IDC_COMPRO, m_ProCtrl);
- DDX_Text(pDX, IDC_EDITIP, m_Ip);
- DDX_Text(pDX, IDC_EDITPORT, m_Port);
- DDX_Text(pDX, IDC_EDITUSERNAME, m_UserName);
- DDX_Text(pDX, IDC_EDITUSERPSW, m_UserPSW);
- DDX_Text(pDX, IDC_EDITIP2, m_Ip1);
- DDX_Text(pDX, IDC_EDITPORT1, m_Port1);
- DDX_Text(pDX, IDC_EDITPORT2, m_Port2);
- DDX_Text(pDX, IDC_EDITUSERNAME1, m_UserName1);
- DDX_Text(pDX, IDC_EDITUSERNAME2, m_UserName2);
- DDX_Text(pDX, IDC_EDITUSERPSW1, m_UserPSW1);
- DDX_Text(pDX, IDC_EDITUSERPSW2, m_UserPSW2);
- DDX_Check(pDX, IDC_CHECK1, m_CtrlMedia1);
- DDX_Check(pDX, IDC_CHECK2, m_CtrlMedia2);
- DDX_Check(pDX, IDC_CHECK3, m_CtrlMedia3);
- DDX_Check(pDX, IDC_CHECK4, m_CtrlMedia4);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CMatCenter, CDialog)
- //{{AFX_MSG_MAP(CMatCenter)
- ON_BN_CLICKED(IDC_BUTGET, OnButget)
- ON_BN_CLICKED(IDC_BUTSET, OnButset)
- ON_BN_CLICKED(IDC_BUTSET1, OnButset1)
- ON_BN_CLICKED(IDC_BUTGET2, OnButget2)
- ON_BN_CLICKED(IDC_BUTEXIT, OnButexit)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CMatCenter message handlers
- BOOL CMatCenter::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- // TODO: Add extra initialization here
- m_ProCtrl.SetCurSel(0);
- m_IsolatedCtrl.SetCurSel(0);
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CMatCenter::OnCancel()
- {
- // TODO: Add extra cleanup here
-
- // CDialog::OnCancel();
- }
- void CMatCenter::OnOK()
- {
- // TODO: Add extra validation here
-
- // CDialog::OnOK();
- }
- void CMatCenter::OnButget()
- {
- // TODO: Add your control notification handler code here
- /*
- NET_DVR_MATRIX_CENTER stru;
- if (!NET_DVR_MatrixGetCenter(m_lServerID, &stru))
- {
- CString sTemp;
- sTemp.Format("ERROR: NET_DVR_MatrixGetCenter = %d \n", NET_DVR_GetLastError());
- TRACE(sTemp);
- // return FALSE;
- }
- m_Port = stru.MatrixCenterPort;
- m_Ip = stru.sMatrixCenterIP;
- m_UserPSW = stru.sPasswd;
- m_UserName = stru.sUsrName;
- UpdateData(FALSE);
- */
- }
- void CMatCenter::OnButset()
- {
- // TODO: Add your control notification handler code here
- /*
- UpdateData(TRUE);
- NET_DVR_MATRIX_CENTER stru;
- stru.dwSize = sizeof(NET_DVR_MATRIX_CENTER);
- stru.MatrixCenterPort = m_Port;
- memcpy(stru.sMatrixCenterIP, m_Ip, 16);
- memcpy(stru.sPasswd, m_UserPSW, PASSWD_LEN);
- memcpy(stru.sUsrName, m_UserName, NAME_LEN);
- if (!NET_DVR_MatrixSetCenter(m_lServerID, &stru))
- {
- CString sTemp;
- sTemp.Format("ERROR: NET_DVR_MatrixSetCenter = %d \n", NET_DVR_GetLastError());
- TRACE(sTemp);
- // return FALSE;
- }
- */
- }
- void CMatCenter::OnButset1()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
- // NET_DVR_MATRIX_LOCAL_HOST_INFO stru;
- // stru.dwSize = sizeof(NET_DVR_MATRIX_LOCAL_HOST_INFO);
- // stru.dwLocalHostProperty = m_ProCtrl.GetCurSel();
- // stru.dwIsIsolated = m_IsolatedCtrl.GetCurSel();
- // stru.dwLocalMatrixHostPort = m_Port1;
- // memcpy(stru.byLocalMatrixHostPasswd, m_UserPSW1, PASSWD_LEN);
- // memcpy(stru.byLocalMatrixHostUsrName, m_UserName1, NAME_LEN);
- // stru.dwLocalMatrixCtrlMedia = 0x00;
- // if (m_CtrlMedia1)
- // {
- // stru.dwLocalMatrixCtrlMedia |= 0x01;
- // }
- // if (m_CtrlMedia2)
- // {
- // stru.dwLocalMatrixCtrlMedia |= 0x02;
- // }
- // if (m_CtrlMedia3)
- // {
- // stru.dwLocalMatrixCtrlMedia |= 0x04;
- // }
- // if (m_CtrlMedia4)
- // {
- // stru.dwLocalMatrixCtrlMedia |= 0x08;
- // }
- // stru.dwMatrixCenterPort = m_Port2;
- // memcpy(stru.sMatrixCenterIP, m_Ip1, 16);
- // memcpy(stru.byMatrixCenterPasswd, m_UserPSW2, PASSWD_LEN);
- // memcpy(stru.byMatrixCenterUsrName, m_UserName2, NAME_LEN);
- // if (!NET_DVR_MatrixSetLocalHost(m_lServerID, &stru))
- // {
- // CString sTemp;
- // sTemp.Format("ERROR: NET_DVR_MatrixSetLocalHost = %d \n", NET_DVR_GetLastError());
- // AfxMessageBox(sTemp);
- // return;
- // }
- // MessageBox("ÉèÖóɹ¦!");
- }
- void CMatCenter::OnButget2()
- {
- // TODO: Add your control notification handler code here
- // NET_DVR_MATRIX_LOCAL_HOST_INFO stru;
- // if (!NET_DVR_MatrixGetLocalHost(m_lServerID, &stru))
- // {
- // CString sTemp;
- // sTemp.Format("ERROR: NET_DVR_MatrixGetLocalHost = %d \n", NET_DVR_GetLastError());
- // AfxMessageBox(sTemp);
- // }
- // else
- // {
- // m_ProCtrl.SetCurSel(stru.dwLocalHostProperty);
- // m_IsolatedCtrl.SetCurSel(stru.dwIsIsolated);
- // m_Port1 = stru.dwLocalMatrixHostPort;
- // m_UserPSW1 = stru.byLocalMatrixHostPasswd;
- // m_UserName1 = stru.byLocalMatrixHostUsrName;
- // //m_CtrlMedia = stru.dwLocalMatrixCtrlMedia;
- // m_CtrlMedia1 = stru.dwLocalMatrixCtrlMedia & 0x01;
- // m_CtrlMedia2 = (stru.dwLocalMatrixCtrlMedia & 0x02)>>1;
- // m_CtrlMedia3 = (stru.dwLocalMatrixCtrlMedia & 0x04)>>2;
- // m_CtrlMedia4 = (stru.dwLocalMatrixCtrlMedia & 0x08)>>3;
- // m_Port2 = stru.dwMatrixCenterPort;
- // m_Ip1 = stru.sMatrixCenterIP;
- // m_UserPSW2 = stru.byMatrixCenterPasswd;
- // m_UserName2 = stru.byMatrixCenterUsrName;
- // }
- //
- // UpdateData(FALSE);
- }
- void CMatCenter::OnButexit()
- {
- // TODO: Add your control notification handler code here
- CDialog::OnOK();
- }
|