/** * * gsd_CenterGroup.h * */ #pragma once #include #include #include "config.hpp" #include "Util/logger.h" #include "Poller/Timer.h" #include "httplib.h" using namespace toolkit; namespace gsd { class CenterGroup : public drogon::Plugin { public: CenterGroup() {} /// This method must be called by drogon to initialize and start the plugin. /// It must be implemented by the user. void initAndStart(const Json::Value &config) override; /// This method must be called by drogon to shutdown the plugin. /// It must be implemented by the user. void shutdown() override; /** * @description: 获取比例 * @return {*} */ double getProportion(); /** * @description: 获取推理引擎 * @return {*} */ std::string getInferEngine(); /** * @description: readJsonFromString * @param {string&} mystr * @return {*} */ static Json::Value readJsonFromString(const string& mystr); /** * @description: 获取版本 * @return {*} */ std::string getVersion(); /** * @description: getDebug * @return {*} */ int getDebug(); /** * @description: 获取 * @return {*} */ vector getInferTargets(); /** * @description: InferTargets * @param {vector} data * @return {*} */ void setInferTargets(vector data); /** * @description: getAlienLabels * @return {*} */ vector getAlienLabels(); /** * @description: setAlienLabels * @param {vector} data * @return {*} */ void setAlienLabels(vector data); /** * @description: getInferSave * @param {*} * @return {*} */ bool getInferSave(); /** * @description: getSavePath * @param {*} * @return {*} */ std::string getSavePath(); protected: /** * @description: 更新数据 * @return {*} */ void Update(); private: gsd::config::Ptr m_config = nullptr; Timer::Ptr ConfigTimer = nullptr; std::string apiKey = "sunwin202110291532"; std::string spug_ip = "192.168.1.1"; int spug_port = 9090; std::string app = "gsd_"; // string std::string gsd_check_Engine = "best6_fp16.engine"; // 比例过滤器阈值 double gsd_check_Proportion_th = 0.5; // 数据记录 int gsd_check_InferSave = 0; std::string gsd_check_SavePath = "./data/"; }; }