📄 matcolumn.cpp
字号:
// MatColumn.cpp : implementation file
//
#include "stdafx.h"
#include "newclient.h"
#include "MatColumn.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
LONG g_lCAmount = 0;
LONG g_lCAmount1 = 0;
CMatColumn *MatColumn;
void CALLBACK fColLocalDataCallBack(LONG lUserID, char *sIPAddr, LONG lColumnAmout, char *pRecvDataBuffer,DWORD dwBufSize,DWORD dwUser)
{
// NET_DVR_MATRIX_COLUMN_ELEMENT stru;
// int index = 0;
// CString sTemp;
// if (lColumnAmout <= 0)
// {
// AfxMessageBox("No Local Matrix Column Info.!");
// return ;
// }
// if ((g_lCAmount <= lColumnAmout) && (lColumnAmout > 0))
// {
// if (dwBufSize == sizeof(NET_DVR_MATRIX_COLUMN_ELEMENT))
// {
// memcpy(&stru, pRecvDataBuffer, dwBufSize);
//
// sTemp.Format("%d", stru.dwLocalDispChanNum);
// index = MatColumn->m_List.InsertItem(MatColumn->m_List.GetItemCount(), sTemp, 0);
// sTemp.Format("%d", stru.dwGlobalDispChanNum);
// MatColumn->m_List.SetItemText(index, 1, sTemp);
//
// MatColumn->m_iColumnNum++;
// }
// g_lCAmount++;
// }
// if (lColumnAmout == g_lCAmount)
// {
// AfxMessageBox("Finished!");
// }
}
void CALLBACK fColGlobalDataCallBack(LONG lUserID, char *sIPAddr, LONG lColumnAmout, char *pRecvDataBuffer,DWORD dwBufSize,DWORD dwUser)
{
// NET_DVR_MATRIX_GLOBAL_COLUMN_ELEMENT stru;
// CString sTemp;
// int index = 0;
// if (lColumnAmout <= 0)
// {
// AfxMessageBox("No Global Matrix Column Info.!");
// return;
// }
// if ((g_lCAmount1 <= lColumnAmout) && (lColumnAmout > 0))
// {
// if (dwBufSize == sizeof(NET_DVR_MATRIX_GLOBAL_COLUMN_ELEMENT))
// {
// memcpy(&stru, pRecvDataBuffer, dwBufSize);
//
// if (stru.dwConflictTag)
// {
// sTemp.Format("Conflicted");
// }
// else
// {
// sTemp.Format("not Conflict");
// }
// index = MatColumn->m_list1.InsertItem(MatColumn->m_list1.GetItemCount(), sTemp, 0);
// sTemp.Format("%d", stru.dwConflictGloDispChan);
// MatColumn->m_list1.SetItemText(MatColumn->m_iColumnNum1, 1, sTemp);
// sTemp.Format("%d", stru.struColumnInfo.dwLocalDispChanNum);
// MatColumn->m_list1.SetItemText(MatColumn->m_iColumnNum1, 2, sTemp);
// sTemp.Format("%d", stru.struColumnInfo.dwGlobalDispChanNum);
// MatColumn->m_list1.SetItemText(MatColumn->m_iColumnNum1, 3, sTemp);
//
// MatColumn->m_iColumnNum1++;
// }
// g_lCAmount1++;
// }
// if (lColumnAmout == g_lCAmount1)
// {
// AfxMessageBox("Finished!");
// }
//
}
/////////////////////////////////////////////////////////////////////////////
// CMatColumn dialog
CMatColumn::CMatColumn(CWnd* pParent /*=NULL*/)
: CDialog(CMatColumn::IDD, pParent)
{
//{{AFX_DATA_INIT(CMatColumn)
m_GlobalChan = 0;
m_LocalChan = 0;
//}}AFX_DATA_INIT
}
void CMatColumn::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMatColumn)
DDX_Control(pDX, IDC_LIST2, m_list1);
DDX_Control(pDX, IDC_LIST, m_List);
DDX_Text(pDX, IDC_EDITGLOBALCHAN, m_GlobalChan);
DDX_Text(pDX, IDC_EDITLOCALCHAN, m_LocalChan);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMatColumn, CDialog)
//{{AFX_MSG_MAP(CMatColumn)
ON_BN_CLICKED(IDC_BUTEXIT, OnButexit)
ON_BN_CLICKED(IDC_BUTLOCALSET, OnButlocalset)
ON_BN_CLICKED(IDC_BUTLOCALGET, OnButlocalget)
ON_BN_CLICKED(IDC_BUTGLOBALGET, OnButglobalget)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMatColumn message handlers
void CMatColumn::OnCancel()
{
// TODO: Add extra cleanup here
// CDialog::OnCancel();
}
void CMatColumn::OnOK()
{
// TODO: Add extra validation here
// CDialog::OnOK();
}
BOOL CMatColumn::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_List.SetExtendedStyle(LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT);
m_List.InsertColumn(0, "Local Channel", LVCFMT_LEFT, 120, -1);
m_List.InsertColumn(1, "Global Channel", LVCFMT_LEFT, 120, -1);
m_iColumnNum = 0;
m_iSelChan = 0;
m_list1.SetExtendedStyle(LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT);
m_list1.InsertColumn(0, "Conflict?", LVCFMT_LEFT, 120, -1);
m_list1.InsertColumn(1, "Channel Conflicted", LVCFMT_LEFT, 120, -1);
m_list1.InsertColumn(2, "Local Channel", LVCFMT_LEFT, 120, -1);
m_list1.InsertColumn(3, "Global Channel", LVCFMT_LEFT, 120, -1);
// ZeroMemory(&stru, sizeof(NET_DVR_MATRIX_COLUMN_ELEMENT));
MatColumn = this;
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CMatColumn::OnButexit()
{
// TODO: Add your control notification handler code here
CDialog::OnOK();
}
void CMatColumn::OnButlocalset()
{
// TODO: Add your control notification handler code here
// UpdateData(TRUE);
// stru.dwGlobalDispChanNum = m_GlobalChan;
// stru.dwLocalDispChanNum = m_LocalChan;
//
// if (!NET_DVR_MatrixSetLocalColumnInfo(m_lServerID, 1, &stru))
// {
// CString sTemp;
// sTemp.Format("ERROR: NET_DVR_MatrixSetLocalColumnInfo = %d \n", NET_DVR_GetLastError());
// AfxMessageBox(sTemp);
// return;
// }
// MessageBox("success!");
}
void CMatColumn::OnButlocalget()
{
// TODO: Add your control notification handler code here
// m_iColumnNum = 0;
// g_lCAmount = 0;
// m_List.DeleteAllItems();
// if (!NET_DVR_MatrixGetLocalColumnInfo(m_lServerID, fColLocalDataCallBack, 0))
// {
// CString sTemp;
// sTemp.Format("ERROR: NET_DVR_MatrixGetLocalColumnInfo = %d \n", NET_DVR_GetLastError());
// AfxMessageBox(sTemp);
// }
}
void CMatColumn::OnButglobalget()
{
// TODO: Add your control notification handler code here
// m_iColumnNum1 = 0;
// g_lCAmount1 = 0;
// m_list1.DeleteAllItems();
// if (!NET_DVR_MatrixGetGlobalColumnInfo(m_lServerID, fColGlobalDataCallBack, 0))
// {
// CString sTemp;
// sTemp.Format("ERROR: NET_DVR_MatrixGetGlobalColumnInfo = %d \n", NET_DVR_GetLastError());
// AfxMessageBox(sTemp);
// }
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -