派生自 development/c++

zhangjixing
2019-01-12 963090c963b367333cd4f1b173cb51ae227551a5
QiaoJiaSystem/StructureApp/JudgmentRetrogradeTool.cpp
@@ -11,7 +11,7 @@
JudgmentRetrogradeTool::JudgmentRetrogradeTool(const SdkRule &rule) :
    TimerElement(1000),
    m_triggerElement(0, rule.nTriggerDelay * 1000 * 1000),
    m_triggerElement(rule.nTriggerDelay * 8, 0),
    m_sdkRule(rule),
    pManagerEsDB(nullptr) {
    pManagerEsDB = new EsDBTool(appPref.getStringData("ipAdd"), appPref.getIntData("ipPort"));
@@ -175,18 +175,24 @@
            m_mapPerRet[scoredRect.id] = true;
            m_triggerElement.setState(true);
            auto t_image = image(
                CvUtil::zoomRectEqual(scoredRect.rect, 1.2, 1.2) & cv::Rect(0, 0, image.cols, image.rows)).clone();
            //  auto t_image = image(scoredRect.rect& cv::Rect(0, 0, image.cols, image.rows)).clone();
            std::string imgUrl = uploadImgToFdfs(t_image);
            saveInfoToEs(imgUrl, scoredRect);
            break;
        } else {
            m_triggerElement.setState(false);
        }
          m_triggerElement.triggerOnce();
          if(m_triggerElement.getTriggerState())
          {
              auto t_image = image(
                  CvUtil::zoomRectEqual(scoredRect.rect, 1.2, 1.2) & cv::Rect(0, 0, image.cols, image.rows)).clone();
              //  auto t_image = image(scoredRect.rect& cv::Rect(0, 0, image.cols, image.rows)).clone();
              std::string imgUrl = uploadImgToFdfs(t_image);
              saveInfoToEs(imgUrl, scoredRect);
          }
    }
    m_triggerElement.triggerOnce();
}
std::string JudgmentRetrogradeTool::uploadImgToFdfs(cv::Mat &image) {
@@ -230,7 +236,8 @@
    t_json["personPicUrl"] = "";// 人员 地库图片
    t_json["ChannlId"] = getProperty("ch_id"); // 通道id
    t_json["likeDate"] = AppUtil::getTimeSecString(); // 比对时间
    t_json["picAddress"] = getProperty("str_addr");// 抓拍地址
    t_json["picAddress"] = m_sdkRule.strAddr.toStdString();// 抓拍地址
    DBG("picAddress="<<m_sdkRule.strAddr.toStdString());
    t_json["picMaxUrl"] = "wait todo"; // 大图路径
@@ -253,7 +260,7 @@
    t_json["personIsHub"] = m_triggerElement.getTriggerState() ? "1" : "4"; //1: 报警  2: 可疑  3: 安全  4: 未知
    t_json["videoIp"] = getProperty("local_ip");//当前服务器IP地址
    t_json["ack_alarm"] = m_triggerElement.getTriggerState() ? "0" : "";  //  que ren shi fou bao jing
    t_json["cluster_id"] = "wait todo"; // ji qun id
    t_json["cluster_id"] = appPref.getStringData("clusterID");; // ji qun id
    bool retface = false;
    if (pManagerEsDB)