Răsfoiți Sursa

V0.4.8
1、添加了获取房间内最大人数的功能

Apple 2 zile în urmă
părinte
comite
0b954a74a8

+ 33 - 0
SecurePlayAuxServer/Application/FuncRegionalPerson.cpp

@@ -227,6 +227,16 @@ void FuncRegionalPersonCount::task()
         }
 
         /************ 挨个房间检测人数 ************/
+        for(const auto& RoomInfo : m_listRoomCamAct)
+        {
+            /* 取出房间内的最大值 */
+            int maxNum = 0;
+            std::string strImagePath;
+            getRoomMaxNum(RoomInfo.RoomID, maxNum, strImagePath);
+
+            m_liveDicNum += maxNum;
+            m_strLiveDicImagePath = strImagePath;
+        }
         
 
         /************ 检测频率直播间 + 导播间房间的人数 ************/
@@ -372,4 +382,27 @@ bool FuncRegionalPersonCount::findAlarmEnd(EndAlarmParam& alarmParam)
     return false;
 }
 
+/* 取出一个房间内的最大人数 */
+void FuncRegionalPersonCount::getRoomMaxNum(int roomID, int& maxNum, std::string& strImagePath)
+{
+    strImagePath.clear();
+    for(auto it : m_pListAlarm->listAlarmInfo)
+    {
+        if(it->RoomID == roomID)
+        {
+            /* 取出最大人数 */
+            int num = it->listPersonInfo.size();
+            if(num > maxNum)
+            {
+                maxNum = num;
+                strImagePath = it->ImageInfo;
+            }
+            if(strImagePath.empty())
+            {
+                strImagePath = it->ImageInfo;
+            }
+        }
+    }
+}
+
 

+ 6 - 0
SecurePlayAuxServer/Application/FuncRegionalPerson.h

@@ -2,6 +2,7 @@
 #define FUNCREGIONALPERSON_H
 
 #include "FuncBase.h"
+#include <string>
 
 
 enum class Enum_PeriodType
@@ -92,6 +93,8 @@ private:
     void autoEndAlarm();
     /* 查找是否已经结束了报警 */
     bool findAlarmEnd(EndAlarmParam& alarmParam);
+    /* 取出一个房间内的最大人数 */
+    void getRoomMaxNum(int roomID, int& maxNum, std::string& strImagePath);
 
 
 private:
@@ -101,6 +104,9 @@ private:
     QDateTime m_nowTime;                                        /* 当前时间 */
 
     std::list<EndAlarmParam> m_listEndAlarmPara;                /* 报警列表 */
+
+    int m_liveDicNum = 0;                                       /* 直播间和导播间的最大人数之和 */
+    std::string m_strLiveDicImagePath;                          /* 直播间和导播间的报警图片路径 */
 };