Merge branch 'yw.1.2.fixbug' of ssh://192.168.1.226:29418/development/c++ into yw.1.2.fixbug
| | |
| | | |
| | | if (count > 0) { |
| | | for (auto rule:ruleMap) { |
| | | elem["nSdkTypes"].append(rule.second.nSdkType); |
| | | if (rule.second.nIsRun == 1) { |
| | | elem["nSdkTypes"].append(rule.second.nSdkType); |
| | | } |
| | | } |
| | | } |
| | | // Record_Cam_Sdk rec_sdk = db_c.searchCamSdkTableByCamId(iter->str_cam_dev_id); |
| | |
| | | // |
| | | // 对比报警的基类 |
| | | // Created by ps on 2/26/18. |
| | | // |
| | | |
| | |
| | | #include <basic/util/thread/MultiThread.h> |
| | | #include <basic/util/BASE64/Base64.h> |
| | | |
| | | /*** |
| | | * 需要对比的一条记录 |
| | | */ |
| | | struct AlarmData { |
| | | int num; |
| | | std::string tableName; |
| | |
| | | float threshold; |
| | | }; |
| | | |
| | | /*** |
| | | * 数据库中查询的一条记录 |
| | | */ |
| | | struct FeatureData { |
| | | long face_id; |
| | | std::string uuid; |
| | |
| | | std::string idcard; |
| | | }; |
| | | |
| | | /*** |
| | | * 字符串根据符号分割并返回数据 |
| | | * @param str_list |
| | | * @return |
| | | */ |
| | | static std::vector<std::string> AlarmServerPropertyAnalyseByComma(std::string str_list) { |
| | | std::vector<std::string> result; |
| | | char *property_list = const_cast<char *>(str_list.c_str()); |
| | |
| | | CPU_Number = 1 |
| | | }; |
| | | |
| | | /*** |
| | | * 报警服务基类 |
| | | */ |
| | | class AlarmServer { |
| | | |
| | | public: |
| | |
| | | dataRemoveBuffer.clear(); |
| | | } |
| | | |
| | | /*** |
| | | * 初始化时使用线程加载数据库 |
| | | * @param str_config |
| | | */ |
| | | void initDB(std::string str_config) { |
| | | std::thread thd(loadDBCahce, this, str_config); |
| | | thd.detach(); |
| | | } |
| | | |
| | | /*** |
| | | * 移除数据 |
| | | * @param key |
| | | */ |
| | | void removeData(std::string key) { |
| | | std::lock_guard<std::mutex> guard(dataRemoveBufferMtx); |
| | | dataRemoveBuffer.insert(key); |
| | |
| | | add_executable(${PROJECT_NAME} |
| | | main.cpp |
| | | rpc/FaceSearchServer.cpp |
| | | FaceSearchServerResources.cpp |
| | | FaceFeatureSearchServerI.cpp |
| | | FaceFeatureSearchServerI.h |
| | | CasiaFaceWrapper/CasiaFaceWrapperN.cpp |
| | |
| | | static bool getRet(std::string startTime, std::string endTime) { |
| | | auto crrentTime = AppUtil::getTimeSecString(); |
| | | |
| | | if (crrentTime.compare(startTime) > 0 && crrentTime.compare(endTime) < 0) { |
| | | if (crrentTime.compare(startTime) > 0 && (crrentTime.compare(endTime) < 0 || endTime == "0000-00-00 00:00:00")) { |
| | | return true; |
| | | } |
| | | return false; |
| | | |
| | | } |
| | | |
| | | #endif //COMPARETEST_FACEDBCOMPARESERVER_H |
| | |
| | | // |
| | | // 人脸对比主进程入口 |
| | | // Created by pans on 4/27/18. |
| | | // |
| | | #include <iostream> |
| | |
| | | using namespace std; |
| | | |
| | | int main(int argc, char **argv) { |
| | | std::cout<<__DATE__<<" "<<__TIME__<<std::endl; |
| | | std::cout << __DATE__ << " " << __TIME__ << std::endl; |
| | | SAVE_APP_ARGS; |
| | | ENABLEGLOG(GET_STR_CONFIG("logPath").c_str()); |
| | | auto ich = Ice::initialize(argc, argv); |
| | |
| | | |
| | | // appPref.setStringData("ipAdd", "192.168.1.185"); |
| | | // appPref.setIntData("ipPort", 9200); |
| | | |
| | | //设置es上传ip和端口 |
| | | appPref.setStringData("ipAdd", appConfig.getStringProperty("ES_IP")); |
| | | appPref.setIntData("ipPort", appConfig.getIntProperty("ES_PORT")); |
| | | |