123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- #ifndef GLOBALCONFIG_H
- #define GLOBALCONFIG_H
- #include <QString>
- #include "GlobalVariable.h"
- /* ====================================================================================
- * ***************************** GlobalConfig ***********************************
- * ====================================================================================*/
- #define GConfig GlobalConfig::getInstance()
- /**
- * @brief 配置文件信息
- *
- */
- class GlobalConfig
- {
- GlobalConfig();
- ~GlobalConfig() = default;
- GlobalConfig(const GlobalConfig& other) = delete;
- GlobalConfig& operator=(const GlobalConfig& other) = delete;
- public:
- static GlobalConfig& getInstance()
- {
- static GlobalConfig gc;
- return gc;
- }
- /* 读取配置文件 */
- bool readConfig(const QString& strConfigFile);
- /* 打印读取到的值 */
- void printValue();
-
- int AppUpdateOnWorkTimeInterval_Time; /* 更新在岗信息的时间间隔 */
- int AppPeopleOnWork_Time; /* 离岗时间 */
- int AppContraband_Time; /* 违禁物品出现的时间 */
- int AppBadMan_Time; /* 非法入侵超时时间 */
- int AppTired_Time; /* 疲劳检测时间 */
- int AppPeopleCont; /* 区域人员统计 */
- int AppPlayPhone; /* 玩手机识别 */
- int AppMouse; /* 老鼠识别 */
- int AppMask; /* 戴口罩识别 */
- int CheckSet; /* 服务端多久检测一次配置 */
- int EventTimeValid; /* 事件时间有效期 */
- int ThreadSleepMS; /* 任务线程休眠时间,单位是ms */
- std::string Key; /* Key */
- std::string Secret; /* Secret */
- public:
- /* 添加通道信息 */
- void setChannelInfo(std::map<int, std::string> mapChannelName);
- /* 清空通道信息 */
- void clearChannelInfo();
- /* 获取通道名称 */
- std::string getChannelName(int ChannelID);
- /* 获取通道信息 */
- std::map<int, std::string> getChannelInfoMap();
- /* 添加摄像机信息 */
- void setCameraInfo(std::map<int, std::string> mapCameraName);
- /* 获取摄像机名称 */
- std::string getCameraName(int CameraID);
- /* 获取摄像机信息列表 */
- std::map<int, std::string> getCameraInfoMap() { return m_mapCameraName; }
- private:
- QReadWriteLock m_rwLockChnInfo; /* 读写锁 */
- std::map<int, std::string> m_mapChannelName; /* 通道名称 */
- /* 摄像机名称 */
- QReadWriteLock m_rwLockCamInfo; /* 读写锁 */
- std::map<int, std::string> m_mapCameraName; /* 摄像机名称 */
- };
- #endif /* GLOBALCONFIG_H */
|