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

📄 boardlist.cpp

📁 采集卡demo
💻 CPP
字号:
// BoardList.cpp : implementation file
//

#include "stdafx.h"
#include "demo.h"
#include "BoardList.h"
#include "hikvisionsdk.h"

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

/////////////////////////////////////////////////////////////////////////////
// CBoardList dialog


CBoardList::CBoardList(CWnd* pParent /*=NULL*/)
	: CDialog(CBoardList::IDD, pParent)
{
	//{{AFX_DATA_INIT(CBoardList)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CBoardList::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CBoardList)
	DDX_Control(pDX, IDC_TREE1, m_list);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CBoardList, CDialog)
	//{{AFX_MSG_MAP(CBoardList)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CBoardList message handlers
char *boardType[]=
{
		"DS-400XM",
		"DS-400XH",
		"DS-4004HC",
		"DS-4008HC",
		"DS-4016HC",
		"DS-4001HF",
		"DS-4004HF",
		"DS-4002MD",
		"DS-4004MD",
		"DS-4016HCS",
		"DS-4002HT",
		"DS-4004HT",
		"DS-4008HT",
		"DS-4004HC+",
		"DS-4008HC+",
		"DS-4016HC+"



};
BOOL CBoardList::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	UINT boardCount;
	DS_BOARD_DETAIL boardDetail;
	DSP_DETAIL dspDetail;
	CDialog::OnInitDialog();
	char str[100];
	char sn[12+1];
	
	m_list.DeleteAllItems();
	boardCount=GetBoardCount();
	for(UINT board=0;board<boardCount;board++)
	{
		GetBoardDetail(board,&boardDetail);
		for(UINT i=0;i<12;i++)
			sn[i]=boardDetail.sn[i]+0x30;
		sn[12]=0;
		sprintf(str,"Board:%2u Type:%s,SN:%s",
			board,boardType[boardDetail.type],sn);
		HTREEITEM hBoard=m_list.InsertItem(str,TVI_ROOT,TVI_LAST);
		for(UINT dsp=0;dsp<boardDetail.dspCount;dsp++)
		{
			GetDspDetail(boardDetail.firstDspIndex+dsp,&dspDetail);
			sprintf(str,"DSP:%2u",boardDetail.firstDspIndex+dsp);
			HTREEITEM hDsp=m_list.InsertItem(str,hBoard,TVI_LAST);
			for(UINT encode=0;encode<dspDetail.encodeChannelCount;encode++)
			{
				sprintf(str,"Encode channel:%2u",
					dspDetail.firstEncodeChannelIndex+encode);
				m_list.InsertItem(str,hDsp,TVI_LAST);
			}
			for(UINT decode=0;decode<dspDetail.decodeChannelCount;decode++)
			{
				sprintf(str,"Decode channel:%2u",
					dspDetail.firstDecodeChannelIndex+decode);
				m_list.InsertItem(str,hDsp,TVI_LAST);
			}
			for(UINT display=0;display<dspDetail.displayChannelCount;display++)
			{
				sprintf(str,"Display channel:%2u",
					dspDetail.firstDisplayChannelIndex+display);
				m_list.InsertItem(str,hDsp,TVI_LAST);
			}
		}
	}	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

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