From efafab5273ba3ff13a19f07088c320a5180188b6 Mon Sep 17 00:00:00 2001
From: pans <pansen626@sina.com>
Date: 星期四, 31 一月 2019 10:49:56 +0800
Subject: [PATCH] 1.2_布控feature: Auto stash before merge of "ywv1.2_布控feature" and "origin/ywv1.2_布控feature"
---
QiaoJiaSystem/StructureApp/HiredisTool.cpp | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/QiaoJiaSystem/StructureApp/HiredisTool.cpp b/QiaoJiaSystem/StructureApp/HiredisTool.cpp
index 2094325..6a8715b 100644
--- a/QiaoJiaSystem/StructureApp/HiredisTool.cpp
+++ b/QiaoJiaSystem/StructureApp/HiredisTool.cpp
@@ -89,15 +89,19 @@
CvUtil::cvMat2Buffer(img,buf);
// json["time"]=info.time;
json["img"]=std::string(buf.begin(),buf.end());
- // buf.clear();
- std::string strBuf=std::string(buf.begin(),buf.end());
- if(!listLpush(file_name,json.toStyledString()));
+ if(!checkParam())
{
+ return false;
+ }
+ redisReply *reply;
+ reply = (redisReply*)redisCommand(m_redis,"lpush %s %s", file_name.c_str(),json.toStyledString().c_str());
+ if(!checkResult(reply))
+ {
return false;
}
- //DBG(json.toStyledString());
+ freeReplyObject(reply);
return true;
}
@@ -109,12 +113,12 @@
std::string content;
cv::Mat imgTep;
-
listRpop(file_name,content);
Json::Reader reader;
Json::Value value;
+
if(!reader.parse(content,value))
{
return ;
@@ -124,9 +128,12 @@
std::vector<uchar> data;
data.resize(str.size());
+
data.assign(str.begin(),str.end());
+
CvUtil::buffer2CvMat(data,imgTep);
- imgTep.copyTo(img);
+
+ imgTep.copyTo(img);
// return img;
}
--
Gitblit v1.8.0