1 Star 0 Fork 0

yyj8209/HikVisionStation

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
DlgDevWorkMode.cpp 3.53 KB
一键复制 编辑 原始数据 按行查看 历史
yyj8209 提交于 2021-09-27 20:21 . init
// DlgDevWordMode.cpp : implementation file
//
#include "stdafx.h"
#include "clientdemo.h"
#include "DlgDevWorkMode.h"
#include "DlgStorageServerSwitch.h"
#include "DlgCloudStorage.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgDevWordMode dialog
CDlgDevWorkMode::CDlgDevWorkMode(CWnd* pParent /*=NULL*/)
: CDialog(CDlgDevWorkMode::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgDevWordMode)
m_bEnableCS = FALSE;
//}}AFX_DATA_INIT
m_lUserID = -1;
m_iDevIndex = -1;
m_lChannel = -1;
memset(&m_struCSCfg,0,sizeof(m_struCSCfg));
}
void CDlgDevWorkMode::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgDevWordMode)
DDX_Check(pDX, IDC_CHK_ENABLE_CS, m_bEnableCS);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgDevWorkMode, CDialog)
//{{AFX_MSG_MAP(CDlgDevWordMode)
ON_BN_CLICKED(IDC_BTN_GET, OnBtnGet)
ON_BN_CLICKED(IDC_BTN_SET, OnBtnSet)
ON_BN_CLICKED(IDC_BTN_EXIT, OnBtnExit)
ON_BN_CLICKED(IDC_BTN_STORAGE_SERVER_SWITCH, OnBtnStorageServerSwitch)
ON_BN_CLICKED(IDC_BTN_STORAGE_SERVER_FILE, OnBtnStorageServerFile)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgDevWordMode message handlers
void CDlgDevWorkMode::OnBtnGet()
{
// TODO: Add your control notification handler code here
DWORD dwReturned = 0;
char szLan[1024] = {0};
if (!NET_DVR_GetDVRConfig(m_lUserID,NET_DVR_GET_CLOUD_STORAGE_CFG,0,&m_struCSCfg,sizeof(m_struCSCfg),&dwReturned))
{
g_pMainDlg->AddLog(m_iDevIndex, OPERATION_FAIL_T, "NET_DVR_GET_CLOUD_STORAGE_CFG");
g_StringLanType(szLan, "获取云存储配置信息失败", "Get Cloud Storage failed!");
AfxMessageBox(szLan);
return;
}
else
{
g_pMainDlg->AddLog(m_iDevIndex, OPERATION_SUCC_T, "NET_DVR_GET_CLOUD_STORAGE_CFG");
}
m_bEnableCS = m_struCSCfg.byEnableCS;
UpdateData(FALSE);
}
BOOL CDlgDevWorkMode::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
OnBtnGet();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDlgDevWorkMode::OnBtnSet()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
char szLan[1024] = {0};
m_struCSCfg.dwSize = sizeof(m_struCSCfg);
m_struCSCfg.byEnableCS = m_bEnableCS;
if (!NET_DVR_SetDVRConfig(m_lUserID,NET_DVR_SET_CLOUD_STORAGE_CFG,0,&m_struCSCfg,sizeof(m_struCSCfg)))
{
g_pMainDlg->AddLog(m_iDevIndex, OPERATION_FAIL_T, "NET_DVR_SET_CLOUD_STORAGE_CFG");
g_StringLanType(szLan, "设置云存储配置信息失败", "Set Cloud Storage failed");
AfxMessageBox(szLan);
return;
}
else
{
g_pMainDlg->AddLog(m_iDevIndex, OPERATION_SUCC_T, "NET_DVR_SET_CLOUD_STORAGE_CFG");
}
UpdateData(FALSE);
}
void CDlgDevWorkMode::OnBtnExit()
{
// TODO: Add your control notification handler code here
CDialog::OnCancel();
}
void CDlgDevWorkMode::OnBtnStorageServerSwitch()
{
CDlgStorageServerSwitch dlg;
dlg.m_lServerID = m_lUserID;
dlg.m_lChannel = m_lChannel;
dlg.m_iDevIndex = m_iDevIndex;
dlg.DoModal();
}
void CDlgDevWorkMode::OnBtnStorageServerFile()
{
// TODO: Add your control notification handler code here
CDlgCloudStorage dlg;
dlg.m_lUserID = m_lUserID;
dlg.m_iDeviceIndex = m_iDevIndex;
dlg.DoModal();
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/yyj8209/hik-vision-station.git
git@gitee.com:yyj8209/hik-vision-station.git
yyj8209
hik-vision-station
HikVisionStation
master

搜索帮助