/* * @Description: * @Version: 1.0 * @Autor: lishengyin * @Date: 2022-03-07 11:52:08 * @LastEditors: lishengyin * @LastEditTime: 2022-09-29 15:47:50 */ #ifndef __CONFIG_H_ #define __CONFIG_H_ #include #include #include // mutex #include #include #include "Util/logger.h" #include "requests.hpp" #include "inifile.h" using namespace std; using namespace toolkit; using namespace inifile; #define GSD_MAJOR_VERSION 2 #define GSD_MINOR_VERSION 0 #define GSD_PATCH_VERSION 0 class config { public: using Ptr = std::shared_ptr; std::string Spug_IP; int Spug_Port; std::string NettyIP; int NettyPort; std::string cameraIp; std::string usr; std::string pwd; std::string comPort; std::string SimCode; std::string vpnIP; // 过滤器设置 int sensitivity = 0; int interval = 2000; int TimeOut = 0; // Debug配置 int debug = 0; double DiskUsageThreshold = 0.80; int HardDiskCleanupTime = 3; int InferDataRetentionTime = 3; std::string mysql_IP = "192.168.31.174"; int mysql_port = 13306; std::string app; // 临时版本 vector DeviceIds; int deviceType = 0; vector HostIPs; std::string localIP = ""; int getHistoryVideoFlag = 0; int ClearPastRecords = 0; double bboxSize = 0.0; int ExpelInterval = 10000; int LowVersion = 1; int ExpelPort = 19002; int InferInterval = 2000; std::string payServerIP = "10.81.160.141"; int filterLevel = 2; int vpn = 0; std::string payServerIP_tcp = "192.168.1.102"; int payServerPort_tcp = 12500; int InferChecker = 0; std::string InferCheckerIP = "192.168.31.219"; int InferCheckerPort = 8860; int Hepu = 0; std::string HepuIP = "192.168.0.36"; int HepuPort = 80; std::string HepuURL = "/cgi-bin/proc.cgi"; std::string HepuUsr = "sunwin"; std::string HepuPwd = "123456"; protected: #ifdef RELEASE std::string configFile = "/etc/gsd/config.ini"; #else std::string configFile = "../config/config.ini"; #endif std::string apiKey = "sunwin202110291532"; IniFile m_ini; private: config(){} config(config&) = delete; config& operator=(const config&) = delete; public: ~config(){} /** * @description: 获取智能指针 * @param {*} * @return {*} */ static Ptr getPtr(); /** * @description: 更新数据 * @param {*} * @return {*} */ bool Update(); /** * @description: 获取Simcode * @param {*} * @return {*} */ std::string getSimCode(); /** * @description: getApp * @param {*} * @return {*} */ std::string getApp(); /** * @description: 获取基础配置 * @param {*} * @return {*} */ bool getBasicConfig(); /** * @description: 获取版本 * @return {*} */ std::string getVersion(); /** * @description: 获取IP列表 * @return {*} */ vector getHostIP(); /** * @description: 获取历史视频 * @return {*} */ void getHistoryVideo(vector& result); }; #endif