|
@@ -12,6 +12,8 @@ int g_eventTimeVaild = 600; /* 事件时间有效性,单位秒,超
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ActionList g_actionList; /* 全局算法列表 */
|
|
|
|
+
|
|
/* ====================================================================================
|
|
/* ====================================================================================
|
|
* *************************** DeviceInfo成员函数 *******************************
|
|
* *************************** DeviceInfo成员函数 *******************************
|
|
* ====================================================================================*/
|
|
* ====================================================================================*/
|
|
@@ -527,11 +529,103 @@ bool FuncActionInfo::addActionInfo(const ActionInfo& info)
|
|
{
|
|
{
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ /* 将其添加到对应的房间 */
|
|
|
|
+ bool isFind = false;
|
|
|
|
+ for(auto& it0 : listRoomCamActInfo)
|
|
|
|
+ {
|
|
|
|
+ if((it0.RoomID == info.RoomID) && (it0.RoomType == info.RoomType))
|
|
|
|
+ {
|
|
|
|
+ isFind = true;
|
|
|
|
+ it0.mapCameraAction.insert(std::make_pair(info.CameraID, info.ActionID));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ /* 没找到这个房间,就创建 */
|
|
|
|
+ if(!isFind)
|
|
|
|
+ {
|
|
|
|
+ RoomCamActInfo roomCamActInfo;
|
|
|
|
+ roomCamActInfo.RoomID = info.RoomID;
|
|
|
|
+ roomCamActInfo.RoomType = info.RoomType;
|
|
|
|
+ roomCamActInfo.mapCameraAction.insert(std::make_pair(info.CameraID, info.ActionID));
|
|
|
|
+ listRoomCamActInfo.push_back(roomCamActInfo);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return true;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @brief 添加功能信息,一个应用功能在一个频道内只有一个实例
|
|
|
|
+ *
|
|
|
|
+ * @param func 应用功能
|
|
|
|
+ * @return true 添加成功,或者已有这个应用功能
|
|
|
|
+ * @return false
|
|
|
|
+ */
|
|
|
|
+bool ListFuncActInfo::addFuncActionInfo(AppFunction func)
|
|
|
|
+{
|
|
|
|
+ if(func == AppFunction::APP_NONE)
|
|
|
|
+ {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ /* 先查找有没有这个应用信息 */
|
|
|
|
+ if(findAppFunction(func))
|
|
|
|
+ {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ FuncActionInfo* pFuncActionInfo = new FuncActionInfo;
|
|
|
|
+ pFuncActionInfo->appFunction = func;
|
|
|
|
+ listFuncActionInfo.push_back(pFuncActionInfo);
|
|
|
|
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * @brief 添加算法信息,根据传进来的算法ID,将其加入到对应的功能中
|
|
|
|
+ *
|
|
|
|
+ * @param info
|
|
|
|
+ * @return true
|
|
|
|
+ * @return false
|
|
|
|
+ */
|
|
|
|
+bool ListFuncActInfo::addActionInfo(const ActionInfo& info)
|
|
|
|
+{
|
|
|
|
+ if(info.ActionID.empty())
|
|
|
|
+ {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ /* 人脸识别算法 */
|
|
|
|
+ if(info.ActionID == g_actionList.ActFace)
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return true;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/* 查找应用信息 */
|
|
|
|
+bool ListFuncActInfo::findAppFunction(const AppFunction func)
|
|
|
|
+{
|
|
|
|
+ for(const auto& it0 : listFuncActionInfo)
|
|
|
|
+ {
|
|
|
|
+ if(it0->appFunction == func)
|
|
|
|
+ {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+}
|
|
|
|
+/* 根据频率和功能查找实例 */
|
|
|
|
+FuncActionInfo* ListFuncActInfo::findAppFunction(const int ChannelID, const AppFunction func)
|
|
|
|
+{
|
|
|
|
+ for(const auto& it0 : listFuncActionInfo)
|
|
|
|
+ {
|
|
|
|
+ if( (it0->appFunction == func) && (it0->ChannelID == ChannelID) )
|
|
|
|
+ {
|
|
|
|
+ return it0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return nullptr;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
|
|
/* ====================================================================================
|
|
/* ====================================================================================
|
|
* ************************** GlobalConfig成员函数 ******************************
|
|
* ************************** GlobalConfig成员函数 ******************************
|