完成框架目录和模块重构;新增核心、单例、工具、加密及框架 SDK;统一任务、相机和 RPC 接口,并增加离线检测、相机标定、备份恢复、版本管理、崩溃守护和心跳监控功能。
50 lines
1.3 KiB
C++
50 lines
1.3 KiB
C++
#include <HikDevicelistCache.h>
|
|
|
|
#include <QMutexLocker>
|
|
|
|
#include <cstring>
|
|
|
|
HikDevicelistCache::HikDevicelistCache()
|
|
{
|
|
std::memset(&m_deviceInfoList, 0, sizeof(m_deviceInfoList));
|
|
std::memset(&m_gentlIfInfoList, 0, sizeof(m_gentlIfInfoList));
|
|
}
|
|
|
|
MV_CC_DEVICE_INFO_LIST HikDevicelistCache::getDeviceInfoList() const
|
|
{
|
|
QMutexLocker locker(&m_mutex);
|
|
if (!m_deviceInfoListScanned) {
|
|
MV_CC_DEVICE_INFO_LIST scannedList{};
|
|
if (MV_CC_EnumDevices(MV_GIGE_DEVICE | MV_USB_DEVICE, &scannedList) == MV_OK) {
|
|
m_deviceInfoList = scannedList;
|
|
}
|
|
m_deviceInfoListScanned = true;
|
|
}
|
|
return m_deviceInfoList;
|
|
}
|
|
|
|
MV_GENTL_IF_INFO_LIST HikDevicelistCache::getGentlIfInfoList() const
|
|
{
|
|
QMutexLocker locker(&m_mutex);
|
|
return m_gentlIfInfoList;
|
|
}
|
|
|
|
void HikDevicelistCache::setDeviceInfoList(const MV_CC_DEVICE_INFO_LIST& deviceInfoList)
|
|
{
|
|
QMutexLocker locker(&m_mutex);
|
|
m_deviceInfoList = deviceInfoList;
|
|
m_deviceInfoListScanned = true;
|
|
}
|
|
|
|
void HikDevicelistCache::setGentlIfInfoList(const MV_GENTL_IF_INFO_LIST& gentlIfInfoList)
|
|
{
|
|
QMutexLocker locker(&m_mutex);
|
|
m_gentlIfInfoList = gentlIfInfoList;
|
|
}
|
|
|
|
HikDevicelistCache& appHikDeviceListCache()
|
|
{
|
|
static HikDevicelistCache cache;
|
|
return cache;
|
|
}
|