Commit 76818248 authored by Yuelong Yu's avatar Yuelong Yu
Browse files

optimized log output

parent 9cc922de
......@@ -154,7 +154,9 @@ namespace FSDataRecvNS
{
vector<int16> img_data(img,img+m_x*m_y);
LOG_INFOS("write data:" + to_string(frame_no));
if(m_requested_frames < 352 || (m_saved_images+1) % 352 == 0)
LOG_INFOS("write data:" + to_string(frame_no));
WriteData(img_data,frame_no,error_code);
lock.lock();
......
......@@ -148,6 +148,13 @@ namespace FSDataRecvNS
lock.unlock();
if(m_mempool16bit->GetTotalReceivedFrames() == m_requested_frames)
{
LOG_INFOS("Get enough images stop : "+to_string(m_requested_frames));
Stop();
continue;
}
//error_code = m_udpconn->ReceivePacket((char*)(&m_packet),packet_size);
while(m_udpconn->ReceivePacket((char*)(&m_packet),packet_size) != -1)
{
......@@ -160,13 +167,6 @@ namespace FSDataRecvNS
BuildTrainImage(m_packet,packet_size);
else
BuildImage(m_packet);
if(m_mempool16bit->GetTotalReceivedFrames() == m_requested_frames)
{
LOG_INFOS("Get enough images stop : "+to_string(m_requested_frames));
Stop();
break;
}
}
}
}
......@@ -294,13 +294,13 @@ namespace FSDataRecvNS
lock.unlock();
}
LOG_INFOS("one image is finished,received images:"
+ to_string(m_received_imgs)
+ "package collected:"
+ to_string(m_packets_collected)
+ "bytes colltected:"
+ to_string(m_collected_bytes));
if(m_requested_frames < 352 || m_received_imgs % 352 == 0)
LOG_INFOS("one image is finished,received images:"
+ to_string(m_received_imgs)
+ "package collected:"
+ to_string(m_packets_collected)
+ "bytes colltected:"
+ to_string(m_collected_bytes));
m_collected_bytes = 0;
......@@ -318,7 +318,7 @@ namespace FSDataRecvNS
if(new_image_bytes != 0)
{
LOG_INFOS("copy remain:"+to_string(new_image_bytes)+" to new image");
LOG_STREAM(__FUNCTION__, TRACE, "copy remain:"+to_string(new_image_bytes)+" to new image");
memcpy(&m_img_data[m_collected_bytes/2],
&(packet_data.data[0]) + remain_bytes,
new_image_bytes);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment