drawThread
This commit is contained in:
Binary file not shown.
@@ -98,7 +98,8 @@ void getMsgCallback(mqtt::const_message_ptr msg)
|
||||
try {
|
||||
// TODO 处理接收到到的位置数据
|
||||
auto json = nlohmann::json::parse(payload);
|
||||
//绘制标况
|
||||
//绘制 接收到的坐标 的方框
|
||||
thread([json](){
|
||||
for(auto & ii :json)
|
||||
{
|
||||
int x = static_cast<int>(ii["x"]);
|
||||
@@ -108,6 +109,7 @@ void getMsgCallback(mqtt::const_message_ptr msg)
|
||||
double distance = static_cast<double>(ii["distance"]);
|
||||
drawRect(x,y,w,h,distance);
|
||||
}
|
||||
}).detach();
|
||||
|
||||
}
|
||||
catch (const nlohmann::json::parse_error &e) {
|
||||
|
||||
Reference in New Issue
Block a user