派生自 development/c++

xuxiuxi
2019-03-08 5bf0020b189b2bc8c64737c2af4ea77c3e8f5612
QiaoJiaSystem/StructureApp/PerStaticElement.cpp
@@ -36,7 +36,7 @@
void PerStaticElement::threadInitial()
{
   setMask(m_sdkRule.strAreas.toStdString());
//   setMask(m_sdkRule.strAreas.toStdString());
}
@@ -175,14 +175,17 @@
    int size=arrayAreas.size();
    npts=size;
    pointArray=new cv::Point2i[size];
    float sizeW=(float)appPref.getIntData(m_sdkRule.strCamId.toStdString()+"width")/480;
    float sizeH=(float)appPref.getIntData(m_sdkRule.strCamId.toStdString()+"height")/270;
    for(int i = 0;i < arrayAreas.size();++i)
    {
        QJsonValue jsonValue = arrayAreas[i];
        QJsonObject obj = jsonValue.toObject();
        int x = obj.value("x").toDouble()*4;
        int y = obj.value("y").toDouble()*4;
        int x = obj.value("x").toDouble() *sizeW;
        int y = obj.value("y").toDouble() *sizeH;
        mPolygon<<(QPoint(x,y));
        DBG("width="<<sizeW);
        DBG("height="<<sizeH);
    }
}
QJsonArray PerStaticElement::getJsonArrayFromQString(const QString& strJson)
@@ -266,7 +269,8 @@
    t_json["videoIp"] = m_sdkRule.strAddr.toStdString();  // 设备ip
    t_json["ack_alarm"]=m_triggerElement.getTriggerState()?"0":"";  //  que ren shi fou bao jing
    t_json["cluster_id"]=appPref.getStringData("clusterID");; // ji qun id
    t_json["imgKey"] = obj.properties["imgKey"];
    INFO("SaveImgKeyToES: "<<obj.properties["imgKey"]);
    bool retface = false;
    if(pManagerEsDB)
    retface = pManagerEsDB->insertData("personaction", "perVideoAction", t_json.toStyledString(), str_uuid);
@@ -300,4 +304,9 @@
{
    value.copyTo(image);
    if(!m_bSetWH)
    {
        setMask(m_sdkRule.strAreas.toStdString());
        m_bSetWH=true;
    }
}