123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- /*
- * @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 <iostream>
- #include <memory>
- #include <mutex> // mutex
- #include <vector>
- #include <unistd.h>
- #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<config>;
- 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<int> DeviceIds;
- int deviceType = 0;
-
- vector<std::string> 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";
- int HepuProtocol = 31;
- 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<string> getHostIP();
- /**
- * @description: 获取历史视频
- * @return {*}
- */
- void getHistoryVideo(vector<std::string>& result);
- };
- #endif
|