// CParkDevParameter.cpp : 实现文件
//

#include "stdafx.h"
#include "NETSDKDemo3.0.3.h"
#include "CParkDevParameterDlg.h"


// CCParkDevParameter 对话框

IMPLEMENT_DYNAMIC(CCParkDevParameterDlg, CDialog)

CCParkDevParameterDlg::CCParkDevParameterDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CCParkDevParameterDlg::IDD, pParent)
{

}

CCParkDevParameterDlg::~CCParkDevParameterDlg()
{
}

void CCParkDevParameterDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_PARK_GETCFG_COMBO, m_ComboxGetConfig);
	DDX_Control(pDX, IDC_PARK_SETCFG_COMBO, m_ComboxSetConfig);
	DDX_Control(pDX, IDC_COMBO3, m_ComboxCapability);
	DDX_Control(pDX, IDC_PARK_OSDEFFECT_COMBO, m_ComboxOsdFontStytle);
	DDX_Control(pDX, IDC_PARK_OSDFONTSIZE_COMBO, m_ComboxOsdFontSize);
	DDX_Control(pDX, IDC_PARK_OSDMIN_COMBO, m_ComboxOsdMin);
	DDX_Control(pDX, IDC_PARK_OSDFONTCOL_COMBO, m_ComboxOsdColor);
}


BEGIN_MESSAGE_MAP(CCParkDevParameterDlg, CDialog)
	ON_BN_CLICKED(IDC_PARK_GETCFG_BUTTON, &CCParkDevParameterDlg::OnBnClickedParkGetcfgButton)
	ON_BN_CLICKED(IDC_PARK_SETCFG_BUTTON, &CCParkDevParameterDlg::OnBnClickedParkSetcfgButton)
	ON_BN_CLICKED(IDC_PARK_GETCAPA_BUTTON2, &CCParkDevParameterDlg::OnBnClickedParkGetcapaButton2)
	ON_BN_CLICKED(IDC_PARK_SETOSD_BUTTON, &CCParkDevParameterDlg::OnBnClickedParkSetosdButton)
//	ON_BN_CLICKED(IDC_PARK_GETCFGS_BUTTON, &CCParkDevParameterDlg::OnBnClickedParkGetcfgsButton)
END_MESSAGE_MAP()


// CCParkDevParameter 消息处理程序
BOOL CCParkDevParameterDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// TODO:  在此添加额外的初始化
	m_lChannelID = 0;
	InitComb();

	return TRUE;  // return TRUE unless you set the focus to a control
	// 异常: OCX 属性页应返回 FALSE
}


void CCParkDevParameterDlg::InitComb()
{
	m_ComboxGetConfig.InsertString(0, "设备信息");
	m_ComboxGetConfig.InsertString(1, "NTP参数");
	m_ComboxGetConfig.InsertString(2, "视频编码参数");
	m_ComboxGetConfig.InsertString(3, "视频编码参数(扩展，建议使用)");
	m_ComboxGetConfig.InsertString(4, "图像采集制式");
	//m_ComboxGetConfig.InsertString(5, "OSD配置信息");
	m_ComboxGetConfig.InsertString(5, "OSD配置信息(扩展，建议使用)");
	m_ComboxGetConfig.InsertString(6, "OSD内容样式");
	m_ComboxGetConfig.InsertString(7, "开关量配置信息");
	m_ComboxGetConfig.InsertString(8, "开关量输入数量");
	m_ComboxGetConfig.InsertString(9, "图像配置信息");
	m_ComboxGetConfig.InsertString(10, "网络配置信息");
	m_ComboxGetConfig.InsertString(11, "硬盘信息");
	m_ComboxGetConfig.InsertString(12, "聚焦信息");
	m_ComboxGetConfig.InsertString(13, "昼夜模式信息");
	m_ComboxGetConfig.InsertString(14, "透雾模式信息");
	//m_ComboxGetConfig.InsertString(16, "车位状态信息(老接口)");
	//m_ComboxGetConfig.InsertString(17, "车位信息(old)");
	m_ComboxGetConfig.InsertString(15, "叠加OSD样式配置");
	//m_ComboxGetConfig.InsertString(17, "叠加OSD配置");
//	m_ComboxGetConfig.InsertString(18, "访问策略");
	m_ComboxGetConfig.InsertString(16, "图像曝光参数宽动态控制");
	m_ComboxGetConfig.InsertString(17, "图像宽动态");
	m_ComboxGetConfig.InsertString(18, "白片彩片的切换");
	m_ComboxGetConfig.InsertString(19, "图像参数");
	//m_ComboxGetConfig.InsertString(22, "环保图像清晰度");
	m_ComboxGetConfig.InsertString(20, "名单配置，放行策略");
	m_ComboxGetConfig.InsertString(21, "名单配置，出入白名单");
	m_ComboxGetConfig.InsertString(22, "名单配置，出入黑名单");
	m_ComboxGetConfig.InsertString(23, "车位内置指示灯控制");
	m_ComboxGetConfig.InsertString(24, "出入口安装向导配置");
	m_ComboxGetConfig.SetCurSel(0);

	m_ComboxSetConfig.InsertString(0, "NTP参数");
	m_ComboxSetConfig.InsertString(1, "视频编码参数");
	m_ComboxSetConfig.InsertString(2, "视频编码参数(扩展，建议使用)");
	m_ComboxSetConfig.InsertString(3, "图像采集制式");
	m_ComboxSetConfig.InsertString(4, "OSD配置信息");
	m_ComboxSetConfig.InsertString(5, "OSD配置信息(扩展，建议使用)");
	m_ComboxSetConfig.InsertString(6, "OSD内容样式");
	m_ComboxSetConfig.InsertString(7, "开关量配置信息");
	m_ComboxSetConfig.InsertString(8, "触发开关量");
	m_ComboxSetConfig.InsertString(9, "图像配置信息");
	m_ComboxSetConfig.InsertString(10, "网络配置信息");
	m_ComboxSetConfig.InsertString(11, "聚焦信息");
	m_ComboxSetConfig.InsertString(12, "昼夜模式信息");
	m_ComboxSetConfig.InsertString(13, "透雾模式信息");
	m_ComboxSetConfig.InsertString(14, "车位信息");
	m_ComboxSetConfig.InsertString(15, "叠加OSD样式配置");
	m_ComboxSetConfig.InsertString(16, "叠加OSD配置");
	m_ComboxSetConfig.InsertString(17, "访问策略");
	m_ComboxSetConfig.InsertString(18, "图像曝光参数宽动态控制");
	m_ComboxSetConfig.InsertString(19, "图像宽动态");
	m_ComboxSetConfig.InsertString(20, "白片彩片的切换");
	m_ComboxSetConfig.InsertString(21, "图像参数");
	m_ComboxSetConfig.InsertString(22, "图像清晰度");
	m_ComboxSetConfig.InsertString(23, "图像通道切换");
	m_ComboxSetConfig.InsertString(24, "名单配置，放行策略");
	m_ComboxSetConfig.InsertString(25, "名单配置，出入白名单");
	m_ComboxSetConfig.InsertString(26, "名单配置，出入黑名单");
	m_ComboxSetConfig.InsertString(27, "车位内置指示灯控制");
	m_ComboxSetConfig.InsertString(28, "出入口安装向导配置");
	m_ComboxSetConfig.SetCurSel(0);


	m_ComboxCapability.InsertString(0, "视频编码能力集");
	m_ComboxCapability.InsertString(1, "OSD参数能力集");
	m_ComboxCapability.InsertString(2, "视频编码能力集(扩展)");
	m_ComboxCapability.SetCurSel(0);

	m_ComboxOsdFontStytle.InsertString(0,"Background");
	m_ComboxOsdFontStytle.InsertString(1,"Stroke");
	m_ComboxOsdFontStytle.InsertString(2,"Hollow");
	m_ComboxOsdFontStytle.InsertString(3,"Normal");
	m_ComboxOsdFontStytle.InsertString(4,"Inverse");
	m_ComboxOsdFontStytle.SetCurSel(0);

	m_ComboxOsdFontSize.InsertString(0,"X-large");
	m_ComboxOsdFontSize.InsertString(1,"large");
	m_ComboxOsdFontSize.InsertString(2,"Medium");
	m_ComboxOsdFontSize.InsertString(3,"small");
	m_ComboxOsdFontSize.SetCurSel(0);

	m_ComboxOsdMin.InsertString(0,"None");
	m_ComboxOsdMin.InsertString(1,"Single");
	m_ComboxOsdMin.InsertString(2,"Double");
	m_ComboxOsdMin.SetCurSel(0);

	m_ComboxOsdColor.InsertString(0,"Black");
	m_ComboxOsdColor.InsertString(1,"Red");
	m_ComboxOsdColor.InsertString(2,"Blue");
	m_ComboxOsdColor.InsertString(3,"Green");
	m_ComboxOsdColor.SetCurSel(0);
}


void GetDeviceConfig()
{
	CString strError;
	INT32 dwBytesReturned = 0;
	NETDEV_DEVICE_BASICINFO_S stDeviceBasicInfo = {0};

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_DEVICECFG, &stDeviceBasicInfo, sizeof(NETDEV_DEVICE_BASICINFO_S), &dwBytesReturned);
	if (TRUE != bRet)
	{
		strError.Format("获取设备信息失败, 错误码:%d", bRet);
		AfxMessageBox(strError);
		return;
	}

	strError.Format("设备型号：%s\n硬件序列号：%s\n软件版本号：%s\nIPv4的Mac地址：%s\n设备名称：%s", stDeviceBasicInfo.szDevModel, stDeviceBasicInfo.szSerialNum, 
		stDeviceBasicInfo.szFirmwareVersion, stDeviceBasicInfo.szMacAddress, stDeviceBasicInfo.szDeviceName);
	AfxMessageBox(strError);

	return;
}

void GetNTPConfig()
{
	CString strError;
	INT32 dwBytesReturned = 0;
	NETDEV_SYSTEM_NTP_INFO_S stSystemNtpInfo;
	memset(&stSystemNtpInfo, 0, sizeof(NETDEV_SYSTEM_NTP_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_NTPCFG, &stSystemNtpInfo, sizeof(NETDEV_SYSTEM_NTP_INFO_S), &dwBytesReturned);
	if (TRUE != bRet)
	{
		strError.Format("获取NTP参数失败, 错误码:%d", bRet);
		AfxMessageBox(strError);
		return;
	}

	strError.Format("是否支持DHCP：%d\nNTP 信息：\n协议类型：%d\nIP地址：%s", stSystemNtpInfo.bSupportDHCP, stSystemNtpInfo.stAddr.eIPType, stSystemNtpInfo.stAddr.szIPAddr);
	AfxMessageBox(strError);

	return;
}

void GetStreamConfig()
{
	CString strError;
	INT32 dwBytesReturned = 0;
	NETDEV_VIDEO_STREAM_INFO_S stVideoStreamInfo;
	memset(&stVideoStreamInfo, 0, sizeof(NETDEV_VIDEO_STREAM_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_STREAMCFG, &stVideoStreamInfo, sizeof(NETDEV_VIDEO_STREAM_INFO_S), &dwBytesReturned);
	if (TRUE != bRet)
	{
		strError.Format("获取视频编码参数失败, 错误码:%d", bRet);
		AfxMessageBox(strError);
		return;
	}

	strError.Format("码流索引：%d\n是否启用：%d\n视频编码分辨率-Height：%d\n视频编码分辨率-Width：%d\n视频编码配置帧率：%d\n码率：%d\n视频编码格式：%d\n图像质量：%d\nI帧间隔：%d",
		stVideoStreamInfo.enStreamType, stVideoStreamInfo.bEnableFlag, stVideoStreamInfo.dwHeight, stVideoStreamInfo.dwWidth, stVideoStreamInfo.dwFrameRate,
		stVideoStreamInfo.dwBitRate, stVideoStreamInfo.enCodeType, stVideoStreamInfo.enQuality, stVideoStreamInfo.dwGop);
	AfxMessageBox(strError);

	return;
}

void GetStreamConfigEx()
{
	CString strError;
	INT32 dwBytesReturned = 0;
	NETDEV_VIDEO_STREAM_INFO_LIST_S stVideoStreamInfoList;
	memset(&stVideoStreamInfoList, 0, sizeof(NETDEV_VIDEO_STREAM_INFO_LIST_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_STREAMCFG_EX, &stVideoStreamInfoList, sizeof(NETDEV_VIDEO_STREAM_INFO_LIST_S), &dwBytesReturned);
	if (TRUE != bRet)
	{
		strError.Format("获取视频编码参数(扩展，建议使用)失败, 错误码:%d", bRet);
		AfxMessageBox(strError);
		return;
	}

	strError.Format("视频流个数：%d\n视频流信息列表\n[\n视频流是否启用编码：%d\n码流索引：%d\n主码流类型：%d\n视频编码参数信息\n[\nSVC配置,0：关闭,1：开启：%d\n视频编码格式信息：%d\n"\
		"图像宽度：%d\n图像高度：%d\n码率：%d\n码率类型：%d\n帧率：%d\nGop模式：%d\nI帧间隔，范围根据能力来定：%d\n图像质量，范围[1, 9]，9代表图像质量最高：%d\n"\
		"码流平滑等级，范围[1,9]，1代表平滑级别最低：%d\n智能编码模式：%d\n]\n]", stVideoStreamInfoList.udwNum, stVideoStreamInfoList.astVideoStreamInfoList[0].bEnabled,
		stVideoStreamInfoList.astVideoStreamInfoList[0].udwStreamID, stVideoStreamInfoList.astVideoStreamInfoList[0].udwMainStreamType,
		stVideoStreamInfoList.astVideoStreamInfoList[0].stVideoEncodeInfo.bEnableSVCMode, stVideoStreamInfoList.astVideoStreamInfoList[0].stVideoEncodeInfo.udwEncodeFormat,
		stVideoStreamInfoList.astVideoStreamInfoList[0].stVideoEncodeInfo.udwWidth, stVideoStreamInfoList.astVideoStreamInfoList[0].stVideoEncodeInfo.udwHeight,
		stVideoStreamInfoList.astVideoStreamInfoList[0].stVideoEncodeInfo.udwBitrate, stVideoStreamInfoList.astVideoStreamInfoList[0].stVideoEncodeInfo.udwBitrateType,
		stVideoStreamInfoList.astVideoStreamInfoList[0].stVideoEncodeInfo.udwFrameRate, stVideoStreamInfoList.astVideoStreamInfoList[0].stVideoEncodeInfo.udwGopType,
		stVideoStreamInfoList.astVideoStreamInfoList[0].stVideoEncodeInfo.udwIFrameInterval, stVideoStreamInfoList.astVideoStreamInfoList[0].stVideoEncodeInfo.udwImageQuality,
		stVideoStreamInfoList.astVideoStreamInfoList[0].stVideoEncodeInfo.udwSmoothLevel, stVideoStreamInfoList.astVideoStreamInfoList[0].stVideoEncodeInfo.udwSmartEncodeMode);
	AfxMessageBox(strError);

	return;
}

void GetVideoModeConfig()
{
	CString strError;
	INT32 dwBytesReturned = 0;
	NETDEV_VIDEO_MODE_INFO_S stVideoModeInfo;
	memset(&stVideoModeInfo, 0, sizeof(NETDEV_VIDEO_MODE_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_VIDEOMODECFG, &stVideoModeInfo, sizeof(NETDEV_VIDEO_MODE_INFO_S), &dwBytesReturned);
	if (TRUE != bRet)
	{
		strError.Format("获取图像采集制式失败, 错误码:%d", bRet);
		AfxMessageBox(strError);
		return;
	}

	strError.Format("图像宽度：%d\n图像高度：%d\n图像帧率：%d", stVideoModeInfo.udwWidth, stVideoModeInfo.udwHeight, stVideoModeInfo.udwFrameRate);
	AfxMessageBox(strError);

	return;
}

void GetPtzPresets()
{
	CString strTemp, strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_PTZ_ALLPRESETS_S stPtzPresets;
	memset(&stPtzPresets, 0, sizeof(NETDEV_PTZ_ALLPRESETS_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_PTZPRESETS, (LPVOID)&stPtzPresets, sizeof(NETDEV_PTZ_ALLPRESETS_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取云台预置位失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("预置位总数：%d\n预置位信息结构体\n[\n", stPtzPresets.dwSize);

	for(INT32 i = 0; i < stPtzPresets.dwSize; i++)
	{
		strTemp.Format("序号：%d, 预置位ID：%d, 预置位名称：%s\n", i, stPtzPresets.astPreset[i].dwPresetID, stPtzPresets.astPreset[i].szPresetName);
		strOut += strTemp;
	}
	strOut += "]";

	AfxMessageBox(strOut);

	return;
}

void GetOSDConfig()
{
	CString strTemp, strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_VIDEO_OSD_CFG_S stVideoOsdConfig;
	memset(&stVideoOsdConfig, 0, sizeof(NETDEV_VIDEO_OSD_CFG_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_OSDCFG, (LPVOID)&stVideoOsdConfig, sizeof(NETDEV_VIDEO_OSD_CFG_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取OSD配置信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("通道的时间OSD信息：\n[\n时间OSD使能：%d\n是否显示星期(预留)：%d\n区域坐标：顶点x坐标值[0,10000]：%d，顶点y坐标值[0,10000]：%d\n"\
		"时间OSD时间格式：%d\n日期OSD时间格式：%d\n]\n通道的名称OSD信息：\n[\nOSD字符叠加使能：%d\nOSD字符叠加区域坐标：顶点x坐标值[0,10000]：%d，"\
		"顶点y坐标值[0,10000]：%d\nOSD字符叠加名称字符串：%s\n]\n字符OSD个数：%d\n通道OSD字符叠加信息：\n[\n", stVideoOsdConfig.stTimeOSD.bEnableFlag,
		stVideoOsdConfig.stTimeOSD.bWeekEnableFlag, stVideoOsdConfig.stTimeOSD.stAreaScope.dwLocateX, stVideoOsdConfig.stTimeOSD.stAreaScope.dwLocateY,
		stVideoOsdConfig.stTimeOSD.udwTimeFormat, stVideoOsdConfig.stTimeOSD.udwDateFormat, stVideoOsdConfig.stNameOSD.bEnableFlag,
		stVideoOsdConfig.stNameOSD.stAreaScope.dwLocateX, stVideoOsdConfig.stNameOSD.stAreaScope.dwLocateY, stVideoOsdConfig.stNameOSD.szOSDText,
		stVideoOsdConfig.wTextNum);

	for(INT32 i = 0; i < NETDEV_OSD_TEXTOVERLAY_NUM; i++)
	{
		strTemp.Format("序号：%d, OSD字符叠加使能：%d, OSD字符叠加区域坐标：顶点x坐标值[0,10000]：%d,顶点y坐标值[0,10000]：%dOSD字符叠加名称字符串：%s\n", i,
			stVideoOsdConfig.astTextOverlay[i].bEnableFlag, stVideoOsdConfig.astTextOverlay[i].stAreaScope.dwLocateX,
			stVideoOsdConfig.astTextOverlay[i].stAreaScope.dwLocateY, stVideoOsdConfig.astTextOverlay[i].szOSDText);
		strOut += strTemp;
	}
	strOut += "]";

	AfxMessageBox(strOut);

	return;
}

void GetOSDContentConfig()
{
	CString strTemp, strTemp1, strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_OSD_CONTENT_S stOsdContent;
	memset(&stOsdContent, 0, sizeof(NETDEV_OSD_CONTENT_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_OSD_CONTENT_CFG, (LPVOID)&stOsdContent, sizeof(NETDEV_OSD_CONTENT_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取OSD配置信息(扩展，建议使用)失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("OSD区域数量：%d\nOSD区域内容信息列表：\n[\n", stOsdContent.udwNum);

	for(INT32 i = 0; (i < stOsdContent.udwNum) && (i < NETDEV_LEN_32); i++)
	{
		strTemp.Format("序号：%d, OSD区域使能：%d, OSD区域序号，范围[0,7]：%d, 当前区域内OSD数目：%d, OSD区域横坐标,范围[0,9999]：%d, OSD区域纵坐标,范围[0,9999]：%d, "\
			"old无此参数，OSD区域横坐标,范围[0,9999]：%d, old无此参数，OSD区域纵坐标,范围[0,9999]：%d, 当前区域内OSD内容信息：\n[\n", i,
			stOsdContent.astContentList[i].bEnabled, stOsdContent.astContentList[i].udwOSDID, stOsdContent.astContentList[i].udwAreaOSDNum,
			stOsdContent.astContentList[i].udwTopLeftX, stOsdContent.astContentList[i].udwTopLeftY, stOsdContent.astContentList[i].udwBotRightX,
			stOsdContent.astContentList[i].udwBotRightY);
		for (INT32 j = 0; (j < stOsdContent.astContentList[i].udwAreaOSDNum) && (j < NETDEV_LEN_8); j++)
		{
			strTemp1.Format("序号：%d, OSD内容类型：%d, OSD文本信息：%s\n", j, stOsdContent.astContentList[i].astContentInfo[j].udwContentType,
				stOsdContent.astContentList[i].astContentInfo[j].szOSDText);
			strTemp += strTemp1;
		}
		strTemp += "]\n";
		strOut += strTemp;
	}
	strOut += "]";

	AfxMessageBox(strOut);

	return;
}

void GetOSDContentStyleCfg()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_OSD_CONTENT_STYLE_S stOsdContentStyle;
	memset(&stOsdContentStyle, 0, sizeof(NETDEV_OSD_CONTENT_STYLE_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_OSD_CONTENT_STYLE_CFG, (LPVOID)&stOsdContentStyle, sizeof(NETDEV_OSD_CONTENT_STYLE_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取OSD内容样式失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("字体形式：%d\n字体大小：%d\n颜色：%d\n日期格式：%d\n时间格式：%d\n区域内字体对齐，固定8个区域，IPC支持：[%d, %d, %d, %d, %d, %d, %d, %d]\n边缘空的字符数，IPC支持：%d",
		stOsdContentStyle.udwFontStyle, stOsdContentStyle.udwFontSize, stOsdContentStyle.udwColor, stOsdContentStyle.udwDateFormat, stOsdContentStyle.udwTimeFormat,
		stOsdContentStyle.audwFontAlignList[0], stOsdContentStyle.audwFontAlignList[1], stOsdContentStyle.audwFontAlignList[2], stOsdContentStyle.audwFontAlignList[3],
		stOsdContentStyle.audwFontAlignList[4], stOsdContentStyle.audwFontAlignList[5], stOsdContentStyle.audwFontAlignList[6], stOsdContentStyle.audwFontAlignList[7],
		stOsdContentStyle.udwMargin);

	AfxMessageBox(strOut);

	return;
}

void GetAlarmOutputCfg()
{
	CString strTemp, strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_ALARM_OUTPUT_LIST_S stAlarmOutputList;
	memset(&stAlarmOutputList, 0, sizeof(NETDEV_ALARM_OUTPUT_LIST_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_ALARM_OUTPUTCFG, (LPVOID)&stAlarmOutputList, sizeof(NETDEV_ALARM_OUTPUT_LIST_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取开关量配置信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("开关量数量：%d\n开关量配置信息：\n[\n", stAlarmOutputList.dwSize);

	for (int i = 0; (i < stAlarmOutputList.dwSize) && (i < NETDEV_MAX_ALARM_IN_NUM); i++)
	{
		strTemp.Format("序号：%d, 开关量名称：%s, 通道号：%d, 输出开关量默认状态：%d, 告警持续时间 单位 S：%d\n", i, stAlarmOutputList.astAlarmOutputInfo[i].szName,
			stAlarmOutputList.astAlarmOutputInfo[i].dwChancelId, stAlarmOutputList.astAlarmOutputInfo[i].enDefaultStatus, stAlarmOutputList.astAlarmOutputInfo[i].dwDurationSec);
		strOut += strTemp;
	}
	strOut += "]";

	AfxMessageBox(strOut);

	return;
}

void GetAlarmInputCfg()
{
	CString strTemp, strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_ALARM_INPUT_LIST_S stAlarmInputList;
	memset(&stAlarmInputList, 0, sizeof(NETDEV_ALARM_INPUT_LIST_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_ALARM_INPUTCFG, (LPVOID)&stAlarmInputList, sizeof(NETDEV_ALARM_INPUT_LIST_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取开关量输入数量失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("输入开关量数量：%d\n输入开关量配置信息：\n[\n", stAlarmInputList.dwSize);

	for (int i = 0; (i < stAlarmInputList.dwSize) && (i < NETDEV_MAX_ALARM_IN_NUM); i++)
	{
		strTemp.Format("序号：%d, 输入开关量名称：%s\n", i, stAlarmInputList.astAlarmInputInfo[i].szName);
		strOut += strTemp;
	}
	strOut += "]";

	AfxMessageBox(strOut);

	return;
}

void GetImageCfg()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_IMAGE_SETTING_S stImageSetting;
	memset(&stImageSetting, 0, sizeof(NETDEV_IMAGE_SETTING_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_IMAGECFG, (LPVOID)&stImageSetting, sizeof(NETDEV_IMAGE_SETTING_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取图像配置信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("对比度：%d\n亮度：%d\n饱和度：%d\n锐度：%d", stImageSetting.dwContrast, stImageSetting.dwBrightness, stImageSetting.dwSaturation,
		stImageSetting.dwSharpness);
	AfxMessageBox(strOut);

	return;
}

void GetNetworkCfg()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_NETWORKCFG_S stNetworkCfg;
	memset(&stNetworkCfg, 0, sizeof(NETDEV_NETWORKCFG_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_NETWORKCFG, (LPVOID)&stNetworkCfg, sizeof(NETDEV_NETWORKCFG_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取网络配置信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("MTU值：%d\nIPv4的DHCP：%d\nIPv4的IP地址：%s\nIPv4的网关地址：%s\nIPv4的子网掩码：%s", stNetworkCfg.dwMTU, stNetworkCfg.bIPv4DHCP,
		stNetworkCfg.szIpv4Address, stNetworkCfg.szIPv4GateWay, stNetworkCfg.szIPv4SubnetMask);
	AfxMessageBox(strOut);

	return;
}

void GetPrivacyMaskCfg()
{
	CString strTemp, strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_PRIVACY_MASK_CFG_S stPrivacyMaskCfg;
	memset(&stPrivacyMaskCfg, 0, sizeof(NETDEV_PRIVACY_MASK_CFG_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_PRIVACYMASKCFG, (LPVOID)&stPrivacyMaskCfg, sizeof(NETDEV_PRIVACY_MASK_CFG_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取隐私遮盖配置信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("区域个数：%d\n遮盖区域参数：\n[\n", stPrivacyMaskCfg.dwSize);

	for (int i = 0; (i < stPrivacyMaskCfg.dwSize) && (i < NETDEV_MAX_PRIVACY_MASK_AREA_NUM); i++)
	{
		strTemp.Format("序号：%d, 是否启用：%d, 左上角X [0, 10000]：%d, 左上角Y [0, 10000]：%d, 右下角X [0, 10000]：%d, 右下角Y [0, 10000]：%d, 索引：%d\n", i,
			stPrivacyMaskCfg.astArea[i].bIsEanbled, stPrivacyMaskCfg.astArea[i].dwTopLeftX, stPrivacyMaskCfg.astArea[i].dwTopLeftY,
			stPrivacyMaskCfg.astArea[i].dwBottomRightX, stPrivacyMaskCfg.astArea[i].dwBottomRightY, stPrivacyMaskCfg.astArea[i].dwIndex);
		strOut += strTemp;
	}
	strOut += "]";
	AfxMessageBox(strOut);

	return;
}

void GetTamperAlarm()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_TAMPER_ALARM_INFO_S stTamperAlarmInfo;
	memset(&stTamperAlarmInfo, 0, sizeof(NETDEV_TAMPER_ALARM_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_TAMPERALARM, (LPVOID)&stTamperAlarmInfo, sizeof(NETDEV_TAMPER_ALARM_INFO_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取遮挡检测告警信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("灵敏度：%d", stTamperAlarmInfo.dwSensitivity);
	AfxMessageBox(strOut);

	return;
}

void GetMotionAlarm()
{
	CString strTemp, strTemp1, strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_MOTION_ALARM_INFO_S stMotionAlarmInfo;
	memset(&stMotionAlarmInfo, 0, sizeof(NETDEV_MOTION_ALARM_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_MOTIONALARM, (LPVOID)&stMotionAlarmInfo, sizeof(NETDEV_MOTION_ALARM_INFO_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取运动检测告警信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("灵敏度：%d\n物体大小：%d\n持续时间：%d\n屏幕宏块信息：\n[\n", stMotionAlarmInfo.dwSensitivity, stMotionAlarmInfo.dwObjectSize,
		stMotionAlarmInfo.dwHistory);

	for (int i = 0; i < NETDEV_SCREEN_INFO_ROW; i++)
	{
		strTemp += "[";
		for (int j = 0; j < NETDEV_SCREEN_INFO_COLUMN; j++)
		{
			strTemp1.Format("%d, ", stMotionAlarmInfo.awScreenInfo[i][j]);
			strTemp += strTemp1;
		}
		strTemp += "]\n";
		strOut += strTemp;
	}
	strOut += "]";

	AfxMessageBox(strOut);

	return;
}

void GetDisksInfo()
{
	CString strTemp, strTemp1, strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_DISK_INFO_LIST_S stDiskInfoList;
	memset(&stDiskInfoList, 0, sizeof(NETDEV_DISK_INFO_LIST_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_DISKSINFO, (LPVOID)&stDiskInfoList, sizeof(NETDEV_DISK_INFO_LIST_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取硬盘信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("硬盘个数：%d\n硬盘信息：\n[\n", stDiskInfoList.dwSize);

	for (int i = 0; i < NETDEV_SCREEN_INFO_ROW; i++)
	{

		strOut += strTemp;
	}
	strOut += "]";

	AfxMessageBox(strOut);

	return;
}

void GetPtzStatus()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_PTZ_STATUS_S stPtzStatusInfo;
	memset(&stPtzStatusInfo, 0, sizeof(NETDEV_PTZ_STATUS_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_PTZSTATUS, (LPVOID)&stPtzStatusInfo, sizeof(NETDEV_FOCUS_INFO_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取云台状态信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("绝对水平坐标:%f\n绝对竖直坐标:%f\n绝对聚焦倍数:%f\n云台状态类型：%d\n聚焦状态类型：%d\n", 
		stPtzStatusInfo.fPanTiltX,
		stPtzStatusInfo.fPanTiltY,
		stPtzStatusInfo.fZoomX,
		stPtzStatusInfo.enPanTiltStatus,
		stPtzStatusInfo.enZoomStatus
		);

	AfxMessageBox(strOut);

	return;
}

void GetFocusInfo()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_FOCUS_INFO_S stFocusInfo;
	memset(&stFocusInfo, 0, sizeof(NETDEV_FOCUS_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_FOCUSINFO, (LPVOID)&stFocusInfo, sizeof(NETDEV_FOCUS_INFO_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取聚焦信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("聚焦模式：%d", stFocusInfo.enFocusMode);

	AfxMessageBox(strOut);

	return;
}

void GetIrcutFilterInfo()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_IRCUT_FILTER_INFO_S stIrcutFilterInfo;
	memset(&stIrcutFilterInfo, 0, sizeof(NETDEV_IRCUT_FILTER_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_IRCUTFILTERINFO, (LPVOID)&stIrcutFilterInfo, sizeof(NETDEV_IRCUT_FILTER_INFO_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取昼夜模式信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("昼夜模式：%d", stIrcutFilterInfo.enIrCutFilterMode);

	AfxMessageBox(strOut);

	return;
}

/* PTZ适用 */
void GetDefoggingInfo()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_DEFOGGING_INFO_S stDefoggingInfo;
	memset(&stDefoggingInfo, 0, sizeof(NETDEV_DEFOGGING_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_DEFOGGINGINFO, (LPVOID)&stDefoggingInfo, sizeof(NETDEV_DEFOGGING_INFO_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取透雾模式信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("除雾模式：%d\n除雾等级：%f", stDefoggingInfo.enDefoggingMode, stDefoggingInfo.fDefoggingLevel);

	AfxMessageBox(strOut);

	return;
}

void GetParkStatusInfo()
{
	/*CString strTemp, strTemp1, strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_PARKSTATUS_INFO_S stParkStatusInfo;
	memset(&stParkStatusInfo, 0, sizeof(NETDEV_PARKSTATUS_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_PARKSTATUSINFO, (LPVOID)&stParkStatusInfo, sizeof(NETDEV_PARKSTATUS_INFO_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取车位状态信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("车位数量：%d\n车位状态信息：\n[\n", stParkStatusInfo.ulParkNum);

	for (int i = 0; (i < stParkStatusInfo.ulParkNum) && (i < 6); i++)
	{
		strTemp += "[";
		strTemp1.Format("相机编号：%s, 车位编号:%l, 采样时刻：%s, 车位状态，0无车，1有车，2识别异常：%l, 车牌号码:不能自动识别的用"-"表示，车位无车时忽略该字段：%s,"\
			"车位指示灯状态 0熄灭，1长亮，2快速闪烁，3慢速闪烁：%l, 车位指示灯颜色 1红色，2绿色，3黄色：%l, 跨车位告警 0未跨车位，1跨车位:%l", stParkStatusInfo.astParkSatus[i].szCamID,
			stParkStatusInfo.astParkSatus[i].lParkID, stParkStatusInfo.astParkSatus[i].szSampleTime, stParkStatusInfo.astParkSatus[i].lParkingLotStatus,
			stParkStatusInfo.astParkSatus[i].szCarPlate, stParkStatusInfo.astParkSatus[i].lLEDStatus, stParkStatusInfo.astParkSatus[i].lLEDColor,
			stParkStatusInfo.astParkSatus[i].lCrossAlarm);
		strTemp += strTemp1;
		strTemp += "]\n";
		strOut += strTemp;
	}
	strOut += "]";

	AfxMessageBox(strOut);*/

	return;
}

void GetCarportCfg()
{

	/*CString strTemp, strTemp1, strTemp2, strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_CARPORT_CFG_S stCarportCfg;
	memset(&stCarportCfg, 0, sizeof(NETDEV_CARPORT_CFG_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_CARPORTCFG, (LPVOID)&stCarportCfg, sizeof(NETDEV_CARPORT_CFG_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取车位信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("区域：%s\n车位区域信息：\n[\n", stCarportCfg.szArea);

	for (int i = 0; i < 6; i++)
	{
		strTemp += "[";
		strTemp1.Format("检测使能标志, 0表示不使能,1表示使能,2表示无效：%lu, 车位号：%lu, 车位区域坐标,多边形，最多支持6个点：有效点数:%lu, ",
			stCarportCfg.astParkAreaInfo[i].ulParkDetstaus, stCarportCfg.astParkAreaInfo[i].ulParkAreaID,
			stCarportCfg.astParkAreaInfo[i].stParkAreaLocation.ulNum);

		for (int j = 0; (j < stCarportCfg.astParkAreaInfo[i].stParkAreaLocation.ulNum) && (j < 12); j++)
		{
			strTemp2.Format("[序号：%d, 顶点x坐标值[0,10000]：%d, 顶点y坐标值[0,10000]：%d]", j, stCarportCfg.astParkAreaInfo[i].stParkAreaLocation.astPoint->dwLocateX,
				stCarportCfg.astParkAreaInfo[i].stParkAreaLocation.astPoint->dwLocateY);
			strTemp1 += strTemp2;
		}

		strTemp += strTemp1;
		strTemp += "]\n";
		strOut += strTemp;
	}
	strOut += "]";

	AfxMessageBox(strOut);*/

	return;
}

void GetOsdStyleCfg()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_OSDSTYLE_CFG_S stOsdStyleCfg;
	memset(&stOsdStyleCfg, 0, sizeof(NETDEV_OSDSTYLE_CFG_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_OSDSTYLECFG, (LPVOID)&stOsdStyleCfg, sizeof(NETDEV_OSDSTYLE_CFG_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取叠加OSD样式配置失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("字体形式：%d\n字体大小：%d\n字体, 暂不支持设置：%d\n颜色：%d\n透明度：%d\n时间格式：%d\n日期格式：%d", stOsdStyleCfg.ulFontStyle,
		stOsdStyleCfg.ulFontSize, stOsdStyleCfg.ulFontType, stOsdStyleCfg.ulColor, stOsdStyleCfg.ulAlpha, stOsdStyleCfg.ulTimeFormat, stOsdStyleCfg.ulDateFormat);
	AfxMessageBox(strOut);

	return;
}

/* 返回失败 */
void GetInfoOsdCfg()
{
	CString strTemp, strTemp1, strTemp2, strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_INFOOSD_CFG_S stInfoOsdCfg;
	memset(&stInfoOsdCfg, 0, sizeof(NETDEV_INFOOSD_CFG_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_INFOOSDCFG, (LPVOID)&stInfoOsdCfg, sizeof(NETDEV_INFOOSD_CFG_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取叠加OSD配置失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("叠加区域个数：%d\n叠加OSD 配置：\n[\n", stInfoOsdCfg.ulAreaNum);

	for (int i = 0; (i < stInfoOsdCfg.ulAreaNum) && (i < stInfoOsdCfg.ulAreaNum); i++)
	{
		strTemp.Format("叠加区域ID：%d, 使能开关：%d, 叠加内容：");
		for (int j = 0; j < 8; j++)
		{
			strTemp1.Format("[叠加内容类型：%lu, 自定义 OSD 内容：%s]", stInfoOsdCfg.astInfoOSD[i].astInfoParam[j].ulInfoType, stInfoOsdCfg.astInfoOSD[i].astInfoParam[j].szValue);
			strTemp += strTemp1;
		}
		strOut += strTemp;

		strTemp2.Format("叠加区域：左上角坐标：横坐标,万分比：%d, 纵坐标,万分比：%d, 右下角坐标：横坐标,万分比：%d, 纵坐标,万分比：%d", stInfoOsdCfg.astInfoOSD[i].stArea.stTopLeft.dwPointX,
			stInfoOsdCfg.astInfoOSD[i].stArea.stTopLeft.dwPointY, stInfoOsdCfg.astInfoOSD[i].stArea.stBotRight.dwPointX, stInfoOsdCfg.astInfoOSD[i].stArea.stBotRight.dwPointY);
		strOut += strTemp2;
	}
	strOut += "]";

	AfxMessageBox(strOut);

	return;
}

void GetAccpLicInfo()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_ACCPLIC_INFO_S stAccpLicInfo;
	memset(&stAccpLicInfo, 0, sizeof(NETDEV_ACCPLIC_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_ACCPLICINFO, (LPVOID)&stAccpLicInfo, sizeof(NETDEV_ACCPLIC_INFO_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取访问策略失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("友好密码 1开启，0关闭：%d\nMac地址校验 1开启，0关闭：%d\n", stAccpLicInfo.bFriendlyPassword, stAccpLicInfo.bMacBind);
	AfxMessageBox(strOut);

	return;
}

void GetExposureCfg()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_EXPOSURE_INFO_S stExposureInfo;
	memset(&stExposureInfo, 0, sizeof(NETDEV_EXPOSURE_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_EXPOSURE_CFG_S, (LPVOID)&stExposureInfo, sizeof(NETDEV_EXPOSURE_INFO_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取图像曝光参数宽动态控制失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("曝光模式：%d\n曝光补偿：%d\n光圈值, 单位: f值*100：%d\n快门值：%d\n增益, 单位: db：%d\n自定义曝光参数：\n[\n"\
		"最大光圈, 单位: f值*100：%d\n最小光圈, 单位: f值*100：%d\n最慢快门：%d\n最快快门：%d\n最大增益, 单位: db：%d\n"\
		"最小增益, 单位: db：%d\n]\n慢快门参数：[慢快门使能项：%d, 最慢慢快门：%d]\n宽动态参数：\n[\n宽动态模式：%d\n"\
		"曝光比率，暂不支持：%d\nulOnSense：%d\nulOffSense：%d\nbAntiFlicker：%d\n]\n测光参数：\n[\n测光模式：%d\n测光区域："\
		"百分比：(%d, %d),(%d, %d)\n参考亮度：%d\n持续时间：%d\n]\n昼夜参数：\n[\n昼夜模式：%d\n切换灵敏度：%d\n]", 
		stExposureInfo.ulMode, stExposureInfo.lExpCompensate, stExposureInfo.ulIris, stExposureInfo.ulShutter, stExposureInfo.ulGain,
		stExposureInfo.stCustomExposure.ulMaxIris, stExposureInfo.stCustomExposure.ulMinIris, stExposureInfo.stCustomExposure.ulSlowShutter,
		stExposureInfo.stCustomExposure.ulFastShutter, stExposureInfo.stCustomExposure.ulMaxGain, stExposureInfo.stCustomExposure.ulMinGain,
		stExposureInfo.stSlowShutter.bEnable, stExposureInfo.stSlowShutter.ulMaxSlowShutter, stExposureInfo.stWDR.ulMode, stExposureInfo.stWDR.ulExpRatio,
		stExposureInfo.stWDR.ulOnSense, stExposureInfo.stWDR.ulOffSense, stExposureInfo.stWDR.bAntiFlicker, stExposureInfo.stMetering.ulMode,
		stExposureInfo.stMetering.stArea.stTopLeft.dwPointX, stExposureInfo.stMetering.stArea.stTopLeft.dwPointY, stExposureInfo.stMetering.stArea.stBotRight.dwPointX,
		stExposureInfo.stMetering.stArea.stBotRight.dwPointY, stExposureInfo.stMetering.ulRefBrightness, stExposureInfo.stMetering.ulHoldTime,
		stExposureInfo.stDayNight.ulMode, stExposureInfo.stDayNight.ulSensitivity);
	AfxMessageBox(strOut);

	return;
}

void GetTelentConfig()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_TELNET_INFO_S stTelnetInfo;
	memset(&stTelnetInfo, 0, sizeof(NETDEV_TELNET_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_TELENTCONFIG, (LPVOID)&stTelnetInfo, sizeof(NETDEV_TELNET_INFO_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取图像宽动态失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("开关(是否启用),0 关闭,1 开启：%d", stTelnetInfo.bIsEnable);
	AfxMessageBox(strOut);

	return;
}

void GetIrcut()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_ICRCUT_INFO_S stIrcutInfo;
	memset(&stIrcutInfo, 0, sizeof(NETDEV_ICRCUT_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_IRCUT, (LPVOID)&stIrcutInfo, sizeof(NETDEV_ICRCUT_INFO_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取白片彩片的切换失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("开关(是否启用),0 关闭,1 开启：%d", stIrcutInfo.bIsEnable);
	AfxMessageBox(strOut);

	return;
}

void GetImgEnhance()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_IMAGENHANCE_S stImgEnhance;
	memset(&stImgEnhance, 0, sizeof(NETDEV_IMAGENHANCE_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_IMGENHANCE, (LPVOID)&stImgEnhance, sizeof(NETDEV_IMAGENHANCE_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取图像参数失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("亮度：%d\n饱和度：%d\n对比度：%d\n锐度：%d\n图像镜像：%d\n2D降噪：%d\n3D降噪：%d", stImgEnhance.ulBrightness, stImgEnhance.ulContrast,
		stImgEnhance.ulSaturation, stImgEnhance.ulSharpness, stImgEnhance.ulImageRotation, stImgEnhance.ul2DNoiseReduce, stImgEnhance.ul3DNoiseReduce);
	AfxMessageBox(strOut);

	return;
}

/* 调用失败 */
void GetImgClarData()
{
	CString strTemp, strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_IMGCLARDATA_S stImgClarData;
	memset(&stImgClarData, 0, sizeof(NETDEV_IMGCLARDATA_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_IMGCLARDATA, (LPVOID)&stImgClarData, sizeof(NETDEV_IMGCLARDATA_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取图像清晰度失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("图像通道号：%d\n图像清晰度数据：\n[", stImgClarData.ulImgChannel);
	for (int i = 0; i < 25; i++)
	{
		strTemp.Format("%d, ", stImgClarData.aulImgClarData[i]);
		strOut += strTemp;
	}
	strOut += "]";

	AfxMessageBox(strOut);

	return;
}

void GetInfoRelease()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_INFORELEASE_CFG_S stInfoReleaseCfg;
	memset(&stInfoReleaseCfg, 0, sizeof(NETDEV_INFORELEASE_CFG_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_INFORELEASE, (LPVOID)&stInfoReleaseCfg, sizeof(NETDEV_INFORELEASE_CFG_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取名单配置，放行策略失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("生效模式 0服务器控制模式 1离线控制模式 2单机控制模式：%d\n识别车辆 0全部放行 1白名单车辆放行 2非黑名单车辆放行：%d\n"\
		"未识别车辆 0不放行 1放行：%d\nuOutputSwitchID：%d", stInfoReleaseCfg.uCtrlMode, stInfoReleaseCfg.uReleaseTactics,
		stInfoReleaseCfg.uUnidentifiedRelease, stInfoReleaseCfg.uOutputSwitchID);
	AfxMessageBox(strOut);

	return;
}

void GetInfoWList()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_INFOWLIST_CFG_S stInfoWListCfg;
	memset(&stInfoWListCfg, 0, sizeof(NETDEV_INFOWLIST_CFG_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_INFOWLIST, (LPVOID)&stInfoWListCfg, sizeof(NETDEV_INFOWLIST_CFG_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取名单配置，出入白名单失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("出入白名单 0不勾选 1勾选：%d\n匹配模式 0模糊匹配 1精准匹配：%d\n忽略汉字 0不勾选 1勾选：%d\n允许字符不匹配数 0位0 1位1 2位2：%d",
		stInfoWListCfg.uEnabled, stInfoWListCfg.enMatchRule.uMatchMode, stInfoWListCfg.enMatchRule.uChineseIgnored, stInfoWListCfg.enMatchRule.uLetterFuzzyMatchLevel);
	AfxMessageBox(strOut);

	return;
}

void GetInfoBList()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_INFOBLIST_CFG_S stInfoBListCfg;
	memset(&stInfoBListCfg, 0, sizeof(NETDEV_INFOBLIST_CFG_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_INFOBLIST, (LPVOID)&stInfoBListCfg, sizeof(NETDEV_INFOBLIST_CFG_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取名单配置，出入黑名单失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("出入黑名单 0不勾选 1勾选：%d\n联动开关量 0否 1是：%d\n匹配模式 0模糊匹配 1精准匹配：%d\n忽略汉字 0不勾选 1勾选：%d\n"\
		"允许字符不匹配数 0位0 1位1 2位2：%d\n", stInfoBListCfg.uEnabled, stInfoBListCfg.LinkSwitchID, stInfoBListCfg.enMatchRule.uMatchMode,
		stInfoBListCfg.enMatchRule.uChineseIgnored, stInfoBListCfg.enMatchRule.uLetterFuzzyMatchLevel);
	AfxMessageBox(strOut);

	return;
}

void GetCarPortLedCtrl()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_CARPORT_CONTROLLED_S stCarPortLedCtrl;
	memset(&stCarPortLedCtrl, 0, sizeof(NETDEV_CARPORT_CONTROLLED_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_CARPORT_LED_CTRL, (LPVOID)&stCarPortLedCtrl, sizeof(NETDEV_CARPORT_CONTROLLED_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取车位内置指示灯控制失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("0 - 智能控制，1 - SDK控制：%d\n当前实际车位灯配置：\n[\n指示灯状态，0-熄灭，1-长亮，2-闪烁：%d\n指示灯颜色, 1-红色，2-黄色，3-绿色：%d\n]",
		stCarPortLedCtrl.ulControlMode, stCarPortLedCtrl.stCurrLEDCfg.ulLEDStatus, stCarPortLedCtrl.stCurrLEDCfg.ulLEDColour);
	AfxMessageBox(strOut);

	return;
}

void GetInstallGuideCfg()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_INSTALL_GUIDE_CFG_S stInstallGuideCfg;
	memset(&stInstallGuideCfg, 0, sizeof(NETDEV_INSTALL_GUIDE_CFG_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_INSTALL_GUIDE_CFG, (LPVOID)&stInstallGuideCfg, sizeof(NETDEV_INSTALL_GUIDE_CFG_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取出入口安装向导配置失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	strOut.Format("检测模式,0:线圈检测, 1:视频检测：%d\n相机到抓拍点距离：%d\n默认省份：%d", stInstallGuideCfg.ulDetectMode, stInstallGuideCfg.ulCapDistance,
		stInstallGuideCfg.ulDefaultProvince);
	AfxMessageBox(strOut);

	return;
}

void CCParkDevParameterDlg::OnBnClickedParkGetcfgButton()
{
	// TODO: 在此添加控件通知处理程序代码
	UpdateData(TRUE);
	int iCbIndex = m_ComboxGetConfig.GetCurSel();

	switch (iCbIndex)
	{
	case 0:
		{
			GetDeviceConfig();
			break;
		}
	case 1:
		{
			GetNTPConfig();
			break;
		}
	case 2:
		{
			GetStreamConfig();
			break;
		}
	case 3:
		{
			GetStreamConfigEx();
			break;
		}
	case 4:
		{
			GetVideoModeConfig();
			break;
		}
	/*case 5:
		{
			GetOSDConfig();
			break;
		}*/
	case 5:
		{
			GetOSDContentConfig();
			break;
		}
	case 6:
		{
			GetOSDContentStyleCfg();
			break;
		}
	case 7:
		{
			GetAlarmOutputCfg();
			break;
		}
	case 8:
		{
			GetAlarmInputCfg();
			break;
		}
	case 9:
		{
			GetImageCfg();
			break;
		}
	case 10:
		{
			GetNetworkCfg();
			break;
		}
	case 11:
		{
			GetPrivacyMaskCfg();
			break;
		}
	
	case 12:
		{
			GetFocusInfo();
			break;
		}
	case 13:
		{
			GetIrcutFilterInfo();
			break;
		}
	case 14:
		{
			GetDefoggingInfo();
			break;
		}
	/*case 16:
		{
			GetParkStatusInfo();
			break;
		}
	case 17:
		{
			GetCarportCfg();
			break;
		}*/
	case 15:
		{
			GetOsdStyleCfg();
			break;
		}
	/*case 16:
		{
			GetInfoOsdCfg();
			break;
		}*/
	/*case 18:
		{
			GetAccpLicInfo();
			break;
		}*/
	case 16:
		{
			GetExposureCfg();
			break;
		}
	case 17:
		{
			GetTelentConfig();
			break;
		}
	case 18:
		{
			GetIrcut();
			break;
		}
	case 19:
		{
			GetImgEnhance();
			break;
		}
	/*case 20:
		{
			GetImgClarData();
			break;
		}*/
	case 20:
		{
			GetInfoRelease();
			break;
		}
	case 21:
		{
			GetInfoWList();
			break;
		}
	case 22:
		{
			GetInfoBList();
			break;
		}
	case 23:
		{
			GetCarPortLedCtrl();
			break;
		}
	case 24:
		{
			GetInstallGuideCfg();
			break;
		}
	default:
		break;
	}

	return;
}


/* 调用失败 */
void SetNTPConfig()
{
	CString strError;
	INT32 dwBytesReturned = 0;
	NETDEV_SYSTEM_NTP_INFO_S stSystemNtpInfo;
	memset(&stSystemNtpInfo, 0, sizeof(NETDEV_SYSTEM_NTP_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_NTPCFG, &stSystemNtpInfo, sizeof(NETDEV_SYSTEM_NTP_INFO_S), &dwBytesReturned);
	if (TRUE != bRet)
	{
		strError.Format("获取NTP参数失败, 错误码:%d", bRet);
		AfxMessageBox(strError);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_NTPCFG, &stSystemNtpInfo, sizeof(NETDEV_SYSTEM_NTP_INFO_S));
	if (TRUE != bRet)
	{
		strError.Format("设置NTP参数失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strError.Format("设置NTP参数成功.");
	}
	AfxMessageBox(strError);

	return;
}

void SetStreamCfg()
{
	CString strError;
	INT32 dwBytesReturned = 0;
	NETDEV_VIDEO_STREAM_INFO_S stVideoStreamInfo;
	memset(&stVideoStreamInfo, 0, sizeof(NETDEV_VIDEO_STREAM_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_STREAMCFG, &stVideoStreamInfo, sizeof(NETDEV_VIDEO_STREAM_INFO_S), &dwBytesReturned);
	if (TRUE != bRet)
	{
		strError.Format("获取视频编码参数失败, 错误码:%d", NETDEV_GetLastError());
		AfxMessageBox(strError);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_STREAMCFG, &stVideoStreamInfo, sizeof(NETDEV_VIDEO_STREAM_INFO_S));
	if (TRUE != bRet)
	{
		strError.Format("设置视频编码参数失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strError.Format("设置视频编码参数成功.");
	}
	AfxMessageBox(strError);

	return;
}

void SetStreamConfigEx()
{
	CString strError;
	INT32 dwBytesReturned = 0;
	NETDEV_VIDEO_STREAM_INFO_LIST_S stVideoStreamInfoList;
	memset(&stVideoStreamInfoList, 0, sizeof(NETDEV_VIDEO_STREAM_INFO_LIST_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_STREAMCFG_EX, &stVideoStreamInfoList, sizeof(NETDEV_VIDEO_STREAM_INFO_LIST_S), &dwBytesReturned);
	if (TRUE != bRet)
	{
		strError.Format("获取视频编码参数(扩展，建议使用)失败, 错误码:%d", bRet);
		AfxMessageBox(strError);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_STREAMCFG_EX, &stVideoStreamInfoList, sizeof(NETDEV_VIDEO_STREAM_INFO_LIST_S));
	if (TRUE != bRet)
	{
		strError.Format("设置视频编码参数(扩展，建议使用)失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strError.Format("设置视频编码参数(扩展，建议使用)成功.");
	}
	AfxMessageBox(strError);

	return;
}

void SetVideoModeConfig()
{
	CString strError;
	INT32 dwBytesReturned = 0;
	NETDEV_VIDEO_MODE_INFO_S stVideoModeInfo;
	memset(&stVideoModeInfo, 0, sizeof(NETDEV_VIDEO_MODE_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_VIDEOMODECFG, &stVideoModeInfo, sizeof(NETDEV_VIDEO_MODE_INFO_S), &dwBytesReturned);
	if (TRUE != bRet)
	{
		strError.Format("获取图像采集制式失败, 错误码:%d", bRet);
		AfxMessageBox(strError);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_VIDEOMODECFG, &stVideoModeInfo, sizeof(NETDEV_VIDEO_MODE_INFO_S));
	if (TRUE != bRet)
	{
		strError.Format("设置图像采集制式失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strError.Format("设置图像采集制式成功.");
	}
	AfxMessageBox(strError);

	return;
}

void SetOSDConfig()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_VIDEO_OSD_CFG_S stVideoOsdConfig;
	memset(&stVideoOsdConfig, 0, sizeof(NETDEV_VIDEO_OSD_CFG_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_OSDCFG, (LPVOID)&stVideoOsdConfig, sizeof(NETDEV_VIDEO_OSD_CFG_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取OSD配置信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_OSDCFG, &stVideoOsdConfig, sizeof(NETDEV_VIDEO_OSD_CFG_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置OSD配置信息失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置OSD配置信息成功.");
	}
	AfxMessageBox(strOut);

	return;
}

void SetOSDContentConfig()
{
	CString strTemp, strTemp1, strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_OSD_CONTENT_S stOsdContent;
	memset(&stOsdContent, 0, sizeof(NETDEV_OSD_CONTENT_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_OSD_CONTENT_CFG, (LPVOID)&stOsdContent, sizeof(NETDEV_OSD_CONTENT_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取OSD配置信息(扩展，建议使用)失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_OSD_CONTENT_CFG, &stOsdContent, sizeof(NETDEV_OSD_CONTENT_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置OSD配置信息(扩展，建议使用)失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置OSD配置信息(扩展，建议使用)成功.");
	}
	AfxMessageBox(strOut);

	return;
}

void SetOSDContentStyleCfg()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_OSD_CONTENT_STYLE_S stOsdContentStyle;
	memset(&stOsdContentStyle, 0, sizeof(NETDEV_OSD_CONTENT_STYLE_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_OSD_CONTENT_STYLE_CFG, (LPVOID)&stOsdContentStyle, sizeof(NETDEV_OSD_CONTENT_STYLE_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取OSD内容样式失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_OSD_CONTENT_STYLE_CFG, &stOsdContentStyle, sizeof(NETDEV_OSD_CONTENT_STYLE_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置OSD内容样式失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置OSD内容样式成功.");
	}
	AfxMessageBox(strOut);

	return;
}

void SetAlarmOutputCfg()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_ALARM_OUTPUT_LIST_S stAlarmOutputList;
	memset(&stAlarmOutputList, 0, sizeof(NETDEV_ALARM_OUTPUT_LIST_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_ALARM_OUTPUTCFG, (LPVOID)&stAlarmOutputList, sizeof(NETDEV_ALARM_OUTPUT_LIST_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取开关量配置信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_ALARM_OUTPUTCFG, &stAlarmOutputList, sizeof(NETDEV_ALARM_OUTPUT_LIST_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置开关量配置信息失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置开关量配置信息成功.");
	}
	AfxMessageBox(strOut);

	return;
}

void TriggerAlarmOutput()
{

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	CString strOut;
	NETDEV_TRIGGER_ALARM_OUTPUT_S stTriggerAlarmOutput;
	memset(&stTriggerAlarmOutput, 0, sizeof(NETDEV_TRIGGER_ALARM_OUTPUT_S));
	strcpy(stTriggerAlarmOutput.szName,"Trgger");
	stTriggerAlarmOutput.enOutputState =NETDEV_BOOLEAN_STATUS_ACTIVE;

	BOOL bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_TRIGGER_ALARM_OUTPUT, &stTriggerAlarmOutput, sizeof(NETDEV_TRIGGER_ALARM_OUTPUT_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置开关量配置信息失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置开关量配置信息成功.");
	}
	AfxMessageBox(strOut);

	return;
}

void SetImageCfg()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_IMAGE_SETTING_S stImageSetting;
	memset(&stImageSetting, 0, sizeof(NETDEV_IMAGE_SETTING_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_IMAGECFG, (LPVOID)&stImageSetting, sizeof(NETDEV_IMAGE_SETTING_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取图像配置信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_IMAGECFG, &stImageSetting, sizeof(NETDEV_IMAGE_SETTING_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置图像配置信息失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置图像配置信息成功.");
	}
	AfxMessageBox(strOut);

	return;
}

void SetNetworkCfg()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_NETWORKCFG_S stNetworkCfg;
	memset(&stNetworkCfg, 0, sizeof(NETDEV_NETWORKCFG_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_NETWORKCFG, (LPVOID)&stNetworkCfg, sizeof(NETDEV_NETWORKCFG_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取网络配置信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_NETWORKCFG, &stNetworkCfg, sizeof(NETDEV_NETWORKCFG_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置网络配置信息失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置网络配置信息成功.");
	}
	AfxMessageBox(strOut);

	return;
}

void SetPrivacyMaskCfg()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_PRIVACY_MASK_CFG_S stPrivacyMaskCfg;
	memset(&stPrivacyMaskCfg, 0, sizeof(NETDEV_PRIVACY_MASK_CFG_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_PRIVACYMASKCFG, (LPVOID)&stPrivacyMaskCfg, sizeof(NETDEV_PRIVACY_MASK_CFG_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取隐私遮盖配置信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_PRIVACYMASKCFG, &stPrivacyMaskCfg, sizeof(NETDEV_PRIVACY_MASK_CFG_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置隐私遮盖配置信息失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置隐私遮盖配置信息成功.");
	}
	AfxMessageBox(strOut);

	return;
}

void SetTamperAlarm()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_TAMPER_ALARM_INFO_S stTamperAlarmInfo;
	memset(&stTamperAlarmInfo, 0, sizeof(NETDEV_TAMPER_ALARM_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_TAMPERALARM, (LPVOID)&stTamperAlarmInfo, sizeof(NETDEV_TAMPER_ALARM_INFO_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取遮挡检测告警信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_TAMPERALARM, &stTamperAlarmInfo, sizeof(NETDEV_TAMPER_ALARM_INFO_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置遮挡检测告警信息失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置遮挡检测告警信息成功.");
	}
	AfxMessageBox(strOut);

	return;
}

void SetMotionAlarm()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_MOTION_ALARM_INFO_S stMotionAlarmInfo;
	memset(&stMotionAlarmInfo, 0, sizeof(NETDEV_MOTION_ALARM_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_MOTIONALARM, (LPVOID)&stMotionAlarmInfo, sizeof(NETDEV_MOTION_ALARM_INFO_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取运动检测告警信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_MOTIONALARM, &stMotionAlarmInfo, sizeof(NETDEV_MOTION_ALARM_INFO_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置运动检测告警信息失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置运动检测告警信息成功.");
	}
	AfxMessageBox(strOut);

	return;
}

void SetFocusInfo()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_FOCUS_INFO_S stFocusInfo;
	memset(&stFocusInfo, 0, sizeof(NETDEV_FOCUS_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_FOCUSINFO, (LPVOID)&stFocusInfo, sizeof(NETDEV_FOCUS_INFO_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取聚焦信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_FOCUSINFO, &stFocusInfo, sizeof(NETDEV_FOCUS_INFO_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置聚焦信息失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置聚焦信息成功.");
	}
	AfxMessageBox(strOut);

	return;
}

void SetIrcutFilterInfo()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_IRCUT_FILTER_INFO_S stIrcutFilterInfo;
	memset(&stIrcutFilterInfo, 0, sizeof(NETDEV_IRCUT_FILTER_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_IRCUTFILTERINFO, (LPVOID)&stIrcutFilterInfo, sizeof(NETDEV_IRCUT_FILTER_INFO_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取昼夜模式信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_IRCUTFILTERINFO, &stIrcutFilterInfo, sizeof(NETDEV_IRCUT_FILTER_INFO_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置昼夜模式信息失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置昼夜模式信息成功.");
	}
	AfxMessageBox(strOut);

	return;
}

/* PTZ适用 */
void SetDefoggingInfo()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_DEFOGGING_INFO_S stDefoggingInfo;
	memset(&stDefoggingInfo, 0, sizeof(NETDEV_DEFOGGING_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_DEFOGGINGINFO, (LPVOID)&stDefoggingInfo, sizeof(NETDEV_DEFOGGING_INFO_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取透雾模式信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_DEFOGGINGINFO, &stDefoggingInfo, sizeof(NETDEV_DEFOGGING_INFO_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置透雾模式信息失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置透雾模式信息成功.");
	}
	AfxMessageBox(strOut);

	return;
}

void SetCarportCfg()
{
	CString strTemp, strTemp1, strTemp2, strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_CARPORT_CFG_S stCarportCfg;
	memset(&stCarportCfg, 0, sizeof(NETDEV_CARPORT_CFG_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_CARPORTCFG, (LPVOID)&stCarportCfg, sizeof(NETDEV_CARPORT_CFG_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取车位信息失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_CARPORTCFG, &stCarportCfg, sizeof(NETDEV_CARPORT_CFG_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置车位信息失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置车位信息成功.");
	}
	AfxMessageBox(strOut);

	return;
}

void SetOsdStyleCfg()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_OSDSTYLE_CFG_S stOsdStyleCfg;
	memset(&stOsdStyleCfg, 0, sizeof(NETDEV_OSDSTYLE_CFG_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_OSDSTYLECFG, (LPVOID)&stOsdStyleCfg, sizeof(NETDEV_OSDSTYLE_CFG_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取叠加OSD样式配置失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_OSDSTYLECFG, &stOsdStyleCfg, sizeof(NETDEV_OSDSTYLE_CFG_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置叠加OSD样式配置失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置叠加OSD样式配置成功.");
	}
	AfxMessageBox(strOut);

	return;
}

/* 返回失败 */
void SetInfoOsdCfg()
{
	CString strTemp, strTemp1, strTemp2, strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_INFOOSD_CFG_S stInfoOsdCfg;
	memset(&stInfoOsdCfg, 0, sizeof(NETDEV_INFOOSD_CFG_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_INFOOSDCFG, (LPVOID)&stInfoOsdCfg, sizeof(NETDEV_INFOOSD_CFG_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取叠加OSD配置失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_INFOOSDCFG, &stInfoOsdCfg, sizeof(NETDEV_INFOOSD_CFG_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置叠加OSD配置失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置叠加OSD配置成功.");
	}
	AfxMessageBox(strOut);

	return;
}

void SetAccpLicInfo()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_ACCPLIC_INFO_S stAccpLicInfo;
	memset(&stAccpLicInfo, 0, sizeof(NETDEV_ACCPLIC_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_ACCPLICINFO, (LPVOID)&stAccpLicInfo, sizeof(NETDEV_ACCPLIC_INFO_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取访问策略失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_ACCPLICINFO, &stAccpLicInfo, sizeof(NETDEV_ACCPLIC_INFO_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置访问策略失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置访问策略成功.");
	}
	AfxMessageBox(strOut);


	return;
}

void SetExposureCfg()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_EXPOSURE_INFO_S stExposureInfo;
	memset(&stExposureInfo, 0, sizeof(NETDEV_EXPOSURE_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_EXPOSURE_CFG_S, (LPVOID)&stExposureInfo, sizeof(NETDEV_EXPOSURE_INFO_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取图像曝光参数宽动态控制失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_EXPOSURE_CFG_S, &stExposureInfo, sizeof(NETDEV_EXPOSURE_INFO_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置图像曝光参数宽动态控制失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置图像曝光参数宽动态控制成功.");
	}
	AfxMessageBox(strOut);

	return;
}

void SetTelentConfig()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_TELNET_INFO_S stTelnetInfo;
	memset(&stTelnetInfo, 0, sizeof(NETDEV_TELNET_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_TELENTCONFIG, (LPVOID)&stTelnetInfo, sizeof(NETDEV_TELNET_INFO_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取图像宽动态失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_TELENTCONFIG, &stTelnetInfo, sizeof(NETDEV_TELNET_INFO_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置图像宽动态失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置图像宽动态成功.");
	}
	AfxMessageBox(strOut);

	return;
}

void SetIrcut()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_ICRCUT_INFO_S stIrcutInfo;
	memset(&stIrcutInfo, 0, sizeof(NETDEV_ICRCUT_INFO_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_IRCUT, (LPVOID)&stIrcutInfo, sizeof(NETDEV_ICRCUT_INFO_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取白片彩片的切换失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_IRCUT, &stIrcutInfo, sizeof(NETDEV_ICRCUT_INFO_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置白片彩片的切换失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置白片彩片的切换成功.");
	}
	AfxMessageBox(strOut);


	return;
}

void SetImgEnhance()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_IMAGENHANCE_S stImgEnhance;
	memset(&stImgEnhance, 0, sizeof(NETDEV_IMAGENHANCE_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_IMGENHANCE, (LPVOID)&stImgEnhance, sizeof(NETDEV_IMAGENHANCE_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取图像参数失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_IMGENHANCE, &stImgEnhance, sizeof(NETDEV_IMAGENHANCE_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置图像参数失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置图像参数成功.");
	}
	AfxMessageBox(strOut);

	return;
}

/* 调用失败 */
void SetImgClarData()
{
	CString strTemp, strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_IMGCLARDATA_S stImgClarData;
	memset(&stImgClarData, 0, sizeof(NETDEV_IMGCLARDATA_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_IMGCLARDATA, (LPVOID)&stImgClarData, sizeof(NETDEV_IMGCLARDATA_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取图像清晰度失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_IMGCLARDATA, &stImgClarData, sizeof(NETDEV_IMGCLARDATA_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置图像清晰度失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置图像清晰度成功.");
	}
	AfxMessageBox(strOut);

	return;
}

void SetImgSwitchChannel()
{
	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	CString strOut;
	NETDEV_IMGSWITCHANNEL_S stImgSwitchChannel;
	memset(&stImgSwitchChannel, 0, sizeof(NETDEV_IMGSWITCHANNEL_S));
	stImgSwitchChannel.ulImgChannel = 0;

	BOOL bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_IMGSWITCHCHANNEL, &stImgSwitchChannel, sizeof(NETDEV_IMGSWITCHANNEL_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置图像通道切换失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置图像通道切换成功.");
	}
	AfxMessageBox(strOut);

	return;
}

void SetInfoRelease()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_INFORELEASE_CFG_S stInfoReleaseCfg;
	memset(&stInfoReleaseCfg, 0, sizeof(NETDEV_INFORELEASE_CFG_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_INFORELEASE, (LPVOID)&stInfoReleaseCfg, sizeof(NETDEV_INFORELEASE_CFG_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取名单配置，放行策略失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_INFORELEASE, &stInfoReleaseCfg, sizeof(NETDEV_INFORELEASE_CFG_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置名单配置，放行策略失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置名单配置，放行策略成功.");
	}
	AfxMessageBox(strOut);

	return;
}

void SetInfoWList()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_INFOWLIST_CFG_S stInfoWListCfg;
	memset(&stInfoWListCfg, 0, sizeof(NETDEV_INFOWLIST_CFG_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_INFOWLIST, (LPVOID)&stInfoWListCfg, sizeof(NETDEV_INFOWLIST_CFG_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取名单配置，出入白名单失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_INFOWLIST, &stInfoWListCfg, sizeof(NETDEV_INFOWLIST_CFG_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置名单配置，出入白名单失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置名单配置，出入白名单成功.");
	}
	AfxMessageBox(strOut);

	return;
}

void SetInfoBList()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_INFOBLIST_CFG_S stInfoBListCfg;
	memset(&stInfoBListCfg, 0, sizeof(NETDEV_INFOBLIST_CFG_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_INFOBLIST, (LPVOID)&stInfoBListCfg, sizeof(NETDEV_INFOBLIST_CFG_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取名单配置，出入黑名单失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_INFOBLIST, &stInfoBListCfg, sizeof(NETDEV_INFOBLIST_CFG_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置名单配置，出入黑名单失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置名单配置，出入黑名单成功.");
	}
	AfxMessageBox(strOut);

	return;
}

void SetCarPortLedCtrl()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_CARPORT_CONTROLLED_S stCarPortLedCtrl;
	memset(&stCarPortLedCtrl, 0, sizeof(NETDEV_CARPORT_CONTROLLED_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_CARPORT_LED_CTRL, (LPVOID)&stCarPortLedCtrl, sizeof(NETDEV_CARPORT_CONTROLLED_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取车位内置指示灯控制失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_CARPORT_LED_CTRL, &stCarPortLedCtrl, sizeof(NETDEV_CARPORT_CONTROLLED_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置车位内置指示灯控制失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置车位内置指示灯控制成功.");
	}
	AfxMessageBox(strOut);


	return;
}

void SetInstallGuideCfg()
{
	CString strOut;
	INT32 dwBytesReturned = 0;
	NETDEV_INSTALL_GUIDE_CFG_S stInstallGuideCfg;
	memset(&stInstallGuideCfg, 0, sizeof(NETDEV_INSTALL_GUIDE_CFG_S));

	BOOL bRet = NETDEV_GetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_GET_INSTALL_GUIDE_CFG, (LPVOID)&stInstallGuideCfg, sizeof(NETDEV_INSTALL_GUIDE_CFG_S), &dwBytesReturned);
	if(TRUE != bRet)
	{
		strOut.Format("获取出入口安装向导配置失败, 错误码:%d", bRet);
		AfxMessageBox(strOut);
		return;
	}

	CString strText;
	strText.Format("GetDecdonfig succeed. ");
	AfxMessageBox(strText);

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, m_lChannelID, NETDEV_SET_INSTALL_GUIDE_CFG, &stInstallGuideCfg, sizeof(NETDEV_INSTALL_GUIDE_CFG_S));
	if (TRUE != bRet)
	{
		strOut.Format("设置出入口安装向导配置失败, 错误码:%d", NETDEV_GetLastError());
	}
	else
	{
		strOut.Format("设置出入口安装向导配置成功.");
	}
	AfxMessageBox(strOut);

	return;
}

void CCParkDevParameterDlg::OnBnClickedParkSetcfgButton()
{
	UpdateData(TRUE);
	int iCbIndex = m_ComboxSetConfig.GetCurSel();

	switch (iCbIndex)
	{
	case 0:
		{
			SetNTPConfig();
			break;
		}
	case 1:
		{
			SetStreamCfg();
			break;
		}
	case 2:
		{
			SetStreamConfigEx();
			break;
		}
	case 3:
		{
			SetVideoModeConfig();
			break;
		}
	case 4:
		{
			SetOSDConfig();
			break;
		}
	case 5:
		{
			SetOSDContentConfig();
			break;
		}
	case 6:
		{
			SetOSDContentStyleCfg();
			break;
		}
	case 7:
		{
			SetAlarmOutputCfg();
			break;
		}
	case 8:
		{
			TriggerAlarmOutput();
			break;
		}
	case 9:
		{
			SetImageCfg();
			break;
		}
	case 10:
		{
			SetNetworkCfg();
			break;
		}
	case 11:
		{
			SetFocusInfo();
			break;
		}
	case 12:
		{
			SetIrcutFilterInfo();
			break;
		}
	case 13:
		{
			SetDefoggingInfo();
			break;
		}
	case 14:
		{
			SetCarportCfg();
			break;
		}
	case 15:
		{
			SetOsdStyleCfg();
			break;
		}
	case 16:
		{
			SetInfoOsdCfg();
			break;
		}
	case 17:
		{
			SetAccpLicInfo();
			break;
		}
	case 18:
		{
			SetExposureCfg();
			break;
		}
	case 19:
		{
			SetTelentConfig();
			break;
		}
	case 20:
		{
			SetIrcut();
			break;
		}
	case 21:
		{
			SetImgEnhance();
			break;
		}
	case 22:
		{
			SetImgClarData();
			break;
		}
	case 23:
		{
			SetImgSwitchChannel();
			break;
		}
	case 24:
		{
			SetInfoRelease();
			break;
		}
	case 25:
		{
			SetInfoWList();
			break;
		}
	case 26:
		{
			SetInfoBList();
			break;
		}
	case 27:
		{
			SetCarPortLedCtrl();
			break;
		}
	case 28:
		{
			SetInstallGuideCfg();
			break;
		}
	default:
		break;
	}

	return;



}

void GetVideoEncodeCapability()
{
	CString strTemp, strTemp1, strOut, strError, strStreamType, strEncodeType;
	INT32 dwBytesReturned = 0;
	NETDEV_VIDEO_STREAM_CAP_S stVideoStreamCap;
	memset(&stVideoStreamCap, 0, sizeof(NETDEV_VIDEO_STREAM_CAP_S));

	BOOL bRet = NETDEV_GetDeviceCapability(m_lpDevHandle, m_lChannelID, NETDEV_CAP_VIDEO_ENCODE, &stVideoStreamCap, sizeof(NETDEV_VIDEO_STREAM_CAP_S), &dwBytesReturned);
	if (TRUE != bRet)
	{
		strError.Format("获取视频编码能力集失败, 错误码:%d", bRet);
		AfxMessageBox(strError);
		return;
	}

	switch (stVideoStreamCap.dwStreamType)
	{
	case 0:
		{
			strStreamType = "主流";
			break;
		}
	case 1:
		{
			strStreamType = "辅流";
			break;
		}
	case 2:
		{
			strStreamType = "第三流";
			break;
		}
	case 3:
		{
			strStreamType = "第四流";
			break;
		}
	default:
		{
			strStreamType = "未知";
			break;
		}
	}

	strOut.Format("码流类型：%s\n编码能力集个数：%d\n编码能力：\n[\n", strStreamType, stVideoStreamCap.dwEncodeCapSize);
	for (int i = 0; (i < stVideoStreamCap.dwEncodeCapSize) && (i < NETDEV_VIDEO_ENCODE_TYPE_MAX); i++)
	{
		switch (stVideoStreamCap.astEncodeCap[i].dwEncodeType)
		{
		case 0:
			{
				strEncodeType = "MJPEG";
				break;
			}
		case 1:
			{
				strEncodeType = "H.264";
				break;
			}
		case 2:
			{
				strEncodeType = "H.265";
				break;
			}
		default:
			{
				strEncodeType = "未知";
				break;
			}
		}


		strTemp.Format("(编码格式：%s\n分辨率数量：%d\n分辨率：%d X %d\nI帧间隔：%d-%d\n帧率：%d-%d\n编码间隔：%d-%d\n码率：%d-%d)\n", strEncodeType,
			stVideoStreamCap.astEncodeCap[i].dwResolutionSize, stVideoStreamCap.astEncodeCap[i].astResolution->dwWidth, stVideoStreamCap.astEncodeCap[i].astResolution->dwHeight,
			stVideoStreamCap.astEncodeCap[i].stIFrameInterval.dwMin, stVideoStreamCap.astEncodeCap[i].stIFrameInterval.dwMax, stVideoStreamCap.astEncodeCap[i].stFrameRate.dwMin,
			stVideoStreamCap.astEncodeCap[i].stFrameRate.dwMax, stVideoStreamCap.astEncodeCap[i].stEncodingInterval.dwMin, stVideoStreamCap.astEncodeCap[i].stEncodingInterval.dwMax,
			stVideoStreamCap.astEncodeCap[i].stBitRate.dwMin, stVideoStreamCap.astEncodeCap[i].stBitRate.dwMax);
		strOut += strTemp;
	}
	strOut += "]\n";

	strTemp1.Format("图像质量范围：%d-%d", stVideoStreamCap.stQuality.dwMin, stVideoStreamCap.stQuality.dwMax);
	strOut += strTemp1;

	AfxMessageBox(strOut);

	return;
}

void GetOsdCapability()
{
	CString strOut, strError, strTemp, strTemp1, strTemp2, strTemp3, strTemp4, strTemp5;
	CString astrDateFormat[NETDEV_OSD_DATE_FORMAT_MAX_NUM];
	INT32 dwBytesReturned = 0;
	NETDEV_OSD_CAP_S stOsdCapability;
	memset(&stOsdCapability, 0, sizeof(NETDEV_OSD_CAP_S));

	BOOL bRet = NETDEV_GetDeviceCapability(m_lpDevHandle, m_lChannelID, NETDEV_CAP_OSD, &stOsdCapability, sizeof(NETDEV_OSD_CAP_S), &dwBytesReturned);
	if (TRUE != bRet)
	{
		strError.Format("获取OSD参数能力集失败, 错误码:%d", bRet);
		AfxMessageBox(strError);
		return;
	}

	strOut.Format("是否支持配置,0：不支持 1：支持：%d\n是否支持OSD大小配置：%d\n是否支持OSD颜色配置：%d\n支持最大的OSD区域数：%d\n支持最大的OSD个数：%d\n"\
		"每个区域支持最大的OSD个数：%d\n支持的OSD内容类型数量：%d\n支持的时间OSD格式数量：%d\n支持的日期OSD格式数量：%d\n日期OSD格式列表：\n[\n",
		stOsdCapability.bIsSupportCfg, stOsdCapability.bIsSupportFontSizeCfg, stOsdCapability.bIsSupportFontColorCfg, stOsdCapability.udwMaxAreaNum,
		stOsdCapability.udwMaxOSDNum, stOsdCapability.udwMaxPerAreaOSDNum, stOsdCapability.udwSupportedOSDTypeNum, stOsdCapability.udwSupportedTimeFormatNum,
		stOsdCapability.udwSupportedDateFormatNum);

	for (int i = 0; (i < stOsdCapability.udwSupportedDateFormatNum) && (i < NETDEV_OSD_DATE_FORMAT_MAX_NUM); i++)
	{
		switch (stOsdCapability.aduwSupportedDateFormatList[i])
		{
		case NETDEV_OSD_DATE_FORMAT_YYYY_MMDD:
			{
				strTemp = "yyyy-MM-dd";
				break;
			}
		case NETDEV_OSD_DATE_FORMAT_MMDD_YYYY:
			{
				strTemp = "yyyy-MM-dd";
				break;
			}
		case NETDEV_OSD_DATE_FORMAT_CHINESE_YYYY_MMDD:
			{
				strTemp = "yyyy年MM月dd日 yyyy/MM/dd";
				break;
			}
		case NETDEV_OSD_DATE_FORMAT_CHINESE_MMDD_YYYY:
			{
				strTemp = "MM月dd日yyyy年 MM/dd/yyyy";
				break;
			}
		case NETDEV_OSD_DATE_FORMAT_CHINESE_YYY_MMDD_X:
			{
				strTemp = "yyyy年MM月dd日 星期X dddd yyyy MM dd";
				break;
			}
		case NETDEV_OSD_DATE_FORMAT_CHINESE_MMDD_YYYY_X:
			{
				strTemp = "MM月dd日yyyy年 星期X dddd MM dd yyyy";
				break;
			}
		case NETDEV_OSD_DATE_FORMAT_ENGLISH_DDMM_YYYY:
			{
				strTemp = "dd/MM/yyyy";
				break;
			}
		case NETDEV_OSD_DATE_FORMAT_ENGLISH_MMDD_YYYY:
			{
				strTemp = "MM/dd/yyyy";
				break;
			}
		case NETDEV_OSD_DATE_FORMAT_ENGLISH_DDMMMM_YYYY:
			{
				strTemp = "dd MMMM, yyyy";
				break;
			}
		case NETDEV_OSD_DATE_FORMAT_ENGLISH_MMMMDD_YYYY:
			{
				strTemp = "MMMM dd, yyyy";
				break;
			}
		case NETDEV_OSD_DATE_FORMAT_ENGLISH_DDDDDDMMMM_YYYY:
			{
				strTemp = "dddd, dd MMMM, yyyy";
				break;
			}
		case NETDEV_OSD_DATE_FORMAT_ENGLISH_DDDDDDMMMM_DDYYYY:
			{
				strTemp = "dddd, MMMM dd, yyyy";
				break;
			}
		case NETDEV_OSD_DATE_FORMAT_ENGLISH_YYYY_MMDD:
			{
				strTemp = "yyyy/MM/dd";
				break;
			}
		case NETDEV_OSD_DATE_FORMAT_ENGLISH_YYYY_MMMMDD:
			{
				strTemp = "yyyy, MMMM dd";
				break;
			}
		case NETDEV_OSD_DATE_FORMAT_ENGLISH_DDDDYY_MMDD:
			{
				strTemp = "dddd, yy, MM dd";
				break;
			}
		default:
			{
				strTemp = "未知";
				break;
			}
		}

		strTemp1.Format("%s\n", strTemp);
		strOut += strTemp1;
	}
	strOut +="]\n时间OSD格式列表：\n[\n";

	for (int i = 0; (i < stOsdCapability.udwSupportedTimeFormatNum) && (i < NETDEV_OSD_TIME_FORMAT_MAX_NUM); i++)
	{
		switch (stOsdCapability.audwSupportedTimeFormatList[i])
		{
		case NETDEV_OSD_TIME_FORMAT_HHMMSS:
			{
				strTemp2 = "HH:mm:ss";
				break;
			}
		case NETDEV_OSD_TIME_FORMAT_HH_MM_SS_T:
			{
				strTemp2 = "hh:mm:ss t.t.";
				break;
			}
		case NETDEV_OSD_TIME_FORMAT_HH_MM_SS_TT:
			{
				strTemp2 = "hh:mm:ss tt";
				break;
			}
		case NETDEV_OSD_TIME_FORMAT_TT_HH_MM_SS:
			{
				strTemp2 = "tt hh:mm:ss";
				break;
			}
		case NETDEV_OSD_TIME_FORMAT_PM_HH_MM_SS:
			{
				strTemp2 = "下午 hh:mm:ss  P.M. hh:mm:ss";
				break;
			}
		case NETDEV_OSD_TIME_FORMAT_HH_MM_SS_XX:
			{
				strTemp2 = "HH:mm:ss.xxx";
				break;
			}
		case NETDEV_OSD_TIME_FORMAT_HH_MM_SS_XX_TT:
			{
				strTemp2 = "hh:mm:ss.xxx tt";
				break;
			}
		default:
			{
				strTemp2 = "未知";
				break;
			}
		}

		strTemp3.Format("%s\n", strTemp2);
		strOut += strTemp3;
	}
	strOut += "]\n支持配置的OSD内容类型列表：\n[\n";

	for (int i = 0; (i < stOsdCapability.udwSupportedOSDTypeNum) && (i < NETDEV_OSD_TYPE_MAX_NUM); i++)
	{
		switch (stOsdCapability.audwSupportedOSDTypeList[i])
		{
		case NETDEV_OSD_CONTENT_TYPE_NOTUSE:
			{
				strTemp4 = "不使用";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_CUSTOM:
			{
				strTemp4 = "自定义";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_DATE_AND_TIME:
			{
				strTemp4 = "时间日期";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_PTZ_CONTROLLER:
			{
				strTemp4 = "云台控制者";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_PTZ_COORDINATES:
			{
				strTemp4 = "云台坐标";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_CRUISE:
			{
				strTemp4 = "巡航信息";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_ZOOM:
			{
				strTemp4 = "变倍信息";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_PRESET:
			{
				strTemp4 = "预置位信息";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_ALARM_INFO:
			{
				strTemp4 = "报警信息";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_ENCODE:
			{
				strTemp4 = "编码信息";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_SERIAL_PORT:
			{
				strTemp4 = "串口OSD";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_PTZ_ORIENTATION:
			{
				strTemp4 = "云台方位信息";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_CHN_NAME:
			{
				strTemp4 = "通道名称";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_DEBUG:
			{
				strTemp4 = "调试OSD";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_PEOPLE_COUNTING:
			{
				strTemp4 = "人数统计OSD";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_NETWORK_PORT:
			{
				strTemp4 = "网口OSD";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_TIME:
			{
				strTemp4 = "时间";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_DATE:
			{
				strTemp4 = "日期";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_SMART_CONTENT:
			{
				strTemp4 = "超感类OSD";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_BATTERY:
			{
				strTemp4 = "电池OSD";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_SCROLL_OSD:
			{
				strTemp4 = "滚动字幕OSD";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_PICTURE_OVERLAY:
			{
				strTemp4 = "LOGO OSD";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_MOTOR_VEHICLE_NUM:
			{
				strTemp4 = "天网卡口机动车流量";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_NON_MOTOR_VEHICLE_NUM:
			{
				strTemp4 = "天网卡口非机动车流量";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_PEOPLE_NUM:
			{
				strTemp4 = "天网卡口行人流量";
				break;
			}
		case NETDEV_OSD_CONTENT_TYPE_INFOOSD_NUM:
			{
				strTemp4 = "INFOOSD类型数目";
				break;
			}
		default:
			{
				strTemp4 = "未知";
				break;
			}
		}

		strTemp5.Format("%s\n", strTemp4);
		strOut += strTemp5;
	}
	strOut += "]";

	AfxMessageBox(strOut);

	return;
}

void GetVideoEncodeExCap()
{
	CString strTemp, strTemp1, strTemp2, strOut, strError;
	INT32 dwBytesReturned = 0;
	NETDEV_VIDEO_STREAM_CAP_EX_S stVideoStreamCapEx;
	memset(&stVideoStreamCapEx, 0, sizeof(NETDEV_VIDEO_STREAM_CAP_EX_S));

	BOOL bRet = NETDEV_GetDeviceCapability(m_lpDevHandle, m_lChannelID, NETDEV_CAP_VIDEO_ENCODE_EX, &stVideoStreamCapEx, sizeof(NETDEV_VIDEO_STREAM_CAP_EX_S), &dwBytesReturned);
	if (TRUE != bRet)
	{
		strError.Format("获取视频编码能力集失败, 错误码:%d", bRet);
		AfxMessageBox(strError);
		return;
	}

	strOut.Format("是否支持配置,0: 不支持, 1: 支持：%d, 是否支持码流平滑,0: 不支持, 1: 支持：%d, 图像制式是否可配,0: 不支持, 1: 支持：%d, 支持的视频编码格式个数：%d, "\
		"支持的视频编码格式列表：[", stVideoStreamCapEx.bIsSupportCfg, stVideoStreamCapEx.bIsSupportSmoothLevel, stVideoStreamCapEx.bIsSupportImageFormat,
		stVideoStreamCapEx.udwEncodeFormatNum);

	for (int i = 0; i < NETDEV_ENCODE_FORMAT_MAX_NUM; i++)
	{
		switch (stVideoStreamCapEx.audwEncodeFormatList[i])
		{
		case 0:
			{
				strTemp = "MJPEG";
				break;
			}
		case 1:
			{
				strTemp = "H.264";
				break;
			}
		case 2:
			{
				strTemp = "H.265";
				break;
			}
		default:
			break;
		}

		strOut += strTemp + ", ";
	}
	strOut +="], ";
	strTemp.Format("支持的I帧间隔最小值：%d, 支持的I帧间隔最大值：%d\n支持的GOP类型数量：%d, 支持的GOP类型列表：[", stVideoStreamCapEx.udwMinIFrameInterval,
		stVideoStreamCapEx.udwMaxIFrameInterval, stVideoStreamCapEx.udwGOPTypeNum);
	strOut += strTemp;

	for (int i = 0; i < NETDEV_GOP_TYPE_MAX_NUM; i++)
	{
		switch (stVideoStreamCapEx.audwGOPTypeList[i])
		{
		case NETDEV_GOP_TYPE_IP:
			{
				strTemp = "IP";
				break;
			}
		case NETDEV_GOP_TYPE_IBP:
			{
				strTemp = "IBP";
				break;
			}
		case NETDEV_GOP_TYPE_IBBP:
			{
				strTemp = "IBBP";
				break;
			}
		case NETDEV_GOP_TYPE_I:
			{
				strTemp = "I";
				break;
			}
		default:
			break;
		}

		strOut += strTemp + ", ";
	}
	strOut +="]\n";

	strTemp.Format("支持的视频制式个数：%d, 视频制式能力列表：[", stVideoStreamCapEx.udwVideoModeNum);
	strOut += strTemp;
	for (int i = 0; i < NETDEV_LEN_16; i++)
	{
		strTemp.Format("(图像宽度：%d, 图像高度：%d, 图像帧率：%d)", stVideoStreamCapEx.astVideoModeList[i].udwWidth, stVideoStreamCapEx.astVideoModeList[i].udwHeight,
			stVideoStreamCapEx.astVideoModeList[i].udwFrameRate);
		strOut += strTemp;
	}
	strOut += "]\n";

	strTemp.Format("支持的码流个数：%d\n支持的码流能力列表：\n[\n", stVideoStreamCapEx.udwStreamCapNum);
	strOut += strTemp;
	for (int i = 0; i < NETDEV_LEN_16; i++)
	{
		switch (stVideoStreamCapEx.astStreamCapList[i].udwstreamID)
		{
		case NETDEV_LIVE_STREAM_INDEX_MAIN:
			{
				strTemp2 = "主流";
				break;
			}
		case NETDEV_LIVE_STREAM_INDEX_AUX:
			{
				strTemp2 = "辅流";
				break;
			}
		case NETDEV_LIVE_STREAM_INDEX_THIRD:
			{
				strTemp2 = "第三流";
				break;
			}
		case NETDEV_LIVE_STREAM_INDEX_FOUTH:
			{
				strTemp2 = "第四流";
				break;
			}
		default:
			break;
		}

		strTemp.Format("码流索引：%s, 支持的分辨率个数：%d, 支持的帧率个数：%d, 当前码流最大帧率：%d, 当前码流MJPEG最大帧率：%d, 支持的帧率数组：[",
			strTemp2, stVideoStreamCapEx.astStreamCapList[i].udwResolutionNum, stVideoStreamCapEx.astStreamCapList[i].udwFrameRateNum,
			stVideoStreamCapEx.astStreamCapList[i].udwMaxFrameRate, stVideoStreamCapEx.astStreamCapList[i].udwMaxMJPEGFrameRate);

		strOut += strTemp;

		for (int j = 0; j < NETDEV_LEN_16; j++)
		{
			strTemp.Format("%d, ", stVideoStreamCapEx.astStreamCapList[i].audwFrameRateList[j]);
			strOut += strTemp;
		}
		strOut += "], 支持的分辨率列表：[";

		for (int j = 0; j < NETDEV_LEN_32; j++)
		{
			strTemp.Format("(图像宽度：%d, 图像高度：%d, 最小码率：%d, 最大码率：%d, 默认码率：%d)", stVideoStreamCapEx.astStreamCapList[i].astResolutionCapabilityList[j].udwWidth,
				stVideoStreamCapEx.astStreamCapList[i].astResolutionCapabilityList[j].udwHeight, stVideoStreamCapEx.astStreamCapList[i].astResolutionCapabilityList[j].udwMinBitRate,
				stVideoStreamCapEx.astStreamCapList[i].astResolutionCapabilityList[j].udwMaxBitRate, stVideoStreamCapEx.astStreamCapList[i].astResolutionCapabilityList[j].udwDefaultBitRate);

			strOut += strTemp;
		}
		strOut += "], ";

		strTemp.Format("图像扩展编码模式：支持的H.264图像智能编码模式种类个数：%d, 支持的H.264图像智能编码模式种类列表：[", stVideoStreamCapEx.astStreamCapList[i].stSmartEncode.udwH264SmartEncodeModeNum);
		strOut += strTemp;
		for (int j = 0; j < NETDEV_SMART_ENCODE_MODEL_MAX_NUM; j++)
		{
			strTemp.Format("%d, ", stVideoStreamCapEx.astStreamCapList[i].stSmartEncode.audwH264SmartEncodeModeList[j]);
			strOut += strTemp;
		}
		strOut += "], ";

		strTemp.Format("支持的H.265图像智能编码模式种类个数：%d, 支持的H.265图像智能编码模式种类列表:[",  stVideoStreamCapEx.astStreamCapList[i].stSmartEncode.udwH265SmartEncodeModeNum);
		for (int j = 0; j < NETDEV_SMART_ENCODE_MODEL_MAX_NUM; j++)
		{
			strTemp.Format("%d, ", stVideoStreamCapEx.astStreamCapList[i].stSmartEncode.audwH265SmartEncodeModeList[j]);
			strOut += strTemp;
		}
		strOut += "]\n";
	}
	strOut += "]";

	AfxMessageBox(strOut);

	return;
}


void CCParkDevParameterDlg::OnBnClickedParkGetcapaButton2()
{
	// TODO: 在此添加控件通知处理程序代码
	UpdateData(TRUE);
	int iCbIndex = m_ComboxCapability.GetCurSel();

	switch (iCbIndex)
	{
	case 0:
		{
			GetVideoEncodeCapability();
			break;
		}
	case 1:
		{
			GetOsdCapability();
			break;
		}
	case 2:
		{
			GetVideoEncodeExCap();
			break;
		}
	default:
		break;
	}
}

void CCParkDevParameterDlg::OnBnClickedParkSetosdButton()
{
	// TODO: 在此添加控件通知处理程序代码
	//设置OSD叠加内容；
	CString strOsdTest;
	CHAR szTmp[NETDEV_LEN_64] = {0};
	GetDlgItemText(IDC_PARK_OSDCONTENT_EDIT,strOsdTest);
    if (strOsdTest.GetLength() > 0)
    {
	   MBToUTF8(strOsdTest.GetBuffer(0), szTmp, sizeof(szTmp) - 1);
    }


	NETDEV_OSD_CONTENT_S stuInfoOsdCfgs;

	stuInfoOsdCfgs.udwNum = 8;

	//区域1
	for(int i = 0; i < stuInfoOsdCfgs.udwNum;i++ )
	{
		stuInfoOsdCfgs.astContentList[i].udwOSDID = i;
		if(i == 0)
		{
          stuInfoOsdCfgs.astContentList[i].bEnabled = 1;
		}
		else
		{
          stuInfoOsdCfgs.astContentList[i].bEnabled = 0;
		}
		stuInfoOsdCfgs.astContentList[i].udwAreaOSDNum = 8;

		stuInfoOsdCfgs.astContentList[i].udwTopLeftX = 2;
		stuInfoOsdCfgs.astContentList[i].udwTopLeftY = 3;

		stuInfoOsdCfgs.astContentList[i].udwBotRightX = 12;
		stuInfoOsdCfgs.astContentList[i].udwBotRightY = 13;

		for(int j = 0; j < stuInfoOsdCfgs.astContentList[i].udwAreaOSDNum; j++)
		{
			memset(stuInfoOsdCfgs.astContentList[i].astContentInfo[j].szOSDText,0,NETDEV_OSD_TEXT_MAX_LEN);
			if(i == 0 && j == 0)
			{
			  strncpy(stuInfoOsdCfgs.astContentList[i].astContentInfo[j].szOSDText,szTmp, sizeof(szTmp) - 1);
			  stuInfoOsdCfgs.astContentList[i].astContentInfo[j].udwContentType = NETDEV_OSD_CONTENT_TYPE_CUSTOM;
			}
			else
			{
              stuInfoOsdCfgs.astContentList[i].astContentInfo[j].udwContentType = NETDEV_OSD_CONTENT_TYPE_NOTUSE;
			}
		}
	}
	
	//注意若要叠加自己的内容，需要将叠加内容类型ulInfoType设置为IMOS_MW_OSD_INFO_TYPE_USERDEF（自定义）；
	ULONG ulRealBuffLong = sizeof(NETDEV_OSD_CONTENT_S);
	if (stuInfoOsdCfgs.udwNum > 1)
	{
		ulRealBuffLong += (stuInfoOsdCfgs.udwNum  - 1) * sizeof(NETDEV_OSD_CONTENT_INFO_S);
	}

	INT32 lChannelID = 1;
	UpdateData(TRUE);
	BOOL bRet = NETDEV_SetDevConfig(m_lpDevHandle, lChannelID, NETDEV_SET_OSD_CONTENT_CFG, &stuInfoOsdCfgs, ulRealBuffLong);
	if (TRUE != bRet)
	{
		MessageBox("set OSD text fail.");
	}
	else
	{
		MessageBox("set OSD text succeed.");
	}

	ULONG ulStyleCfgsSize = sizeof(NETDEV_OSD_CONTENT_STYLE_S);
	NETDEV_OSD_CONTENT_STYLE_S stuStyleCfgs;
	int sOsdcolor[4];
	sOsdcolor[0] = 0x000000;            /*Black*/
	sOsdcolor[1] = 0xFF0000;            /*Red*/
	sOsdcolor[2] = 0x0000FF;            /*Blue*/
    sOsdcolor[3] = 0x00FF00;            /**Green*/

	stuStyleCfgs.udwDateFormat = NETDEV_OSD_DATE_FORMAT_CHINESE_YYYY_MMDD;
	stuStyleCfgs.udwTimeFormat = NETDEV_OSD_TIME_FORMAT_PM_HH_MM_SS;

	stuStyleCfgs.audwFontAlignList[0] = NETDEV_OSD_ALIGN_LEFT;
	stuStyleCfgs.audwFontAlignList[1] = NETDEV_OSD_ALIGN_LEFT;
	stuStyleCfgs.audwFontAlignList[2] = NETDEV_OSD_ALIGN_LEFT;
	stuStyleCfgs.audwFontAlignList[3] = NETDEV_OSD_ALIGN_LEFT;
	stuStyleCfgs.audwFontAlignList[4] = NETDEV_OSD_ALIGN_LEFT;
	stuStyleCfgs.audwFontAlignList[5] = NETDEV_OSD_ALIGN_LEFT;
	stuStyleCfgs.audwFontAlignList[6] = NETDEV_OSD_ALIGN_LEFT;
	stuStyleCfgs.audwFontAlignList[7] = NETDEV_OSD_ALIGN_LEFT;

	int index = 0;
	index = m_ComboxOsdFontStytle.GetCurSel();
	stuStyleCfgs.udwFontStyle = index;
	

	index = m_ComboxOsdFontSize.GetCurSel();
	stuStyleCfgs.udwFontSize = index;

	index = m_ComboxOsdMin.GetCurSel();
	stuStyleCfgs.udwMargin = index;

	index = m_ComboxOsdColor.GetCurSel();
	stuStyleCfgs.udwColor = sOsdcolor[index];

	bRet = NETDEV_SetDevConfig(m_lpDevHandle, lChannelID, NETDEV_SET_OSD_CONTENT_STYLE_CFG, &stuStyleCfgs, ulStyleCfgsSize);
	if (TRUE != bRet)
	{
		MessageBox("set OSD cfg fail.");
	}
	else
	{
		MessageBox("set OSD cfg succeed.");
	}

	return;
}


//void CCParkDevParameterDlg::OnBnClickedParkGetcfgsButton()
//{
//	// TODO: 在此添加控件通知处理程序代码
//
//}
