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

optimized log output

parent 9cc922de
...@@ -154,7 +154,9 @@ namespace FSDataRecvNS ...@@ -154,7 +154,9 @@ namespace FSDataRecvNS
{ {
vector<int16> img_data(img,img+m_x*m_y); 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); WriteData(img_data,frame_no,error_code);
lock.lock(); lock.lock();
......
...@@ -148,6 +148,13 @@ namespace FSDataRecvNS ...@@ -148,6 +148,13 @@ namespace FSDataRecvNS
lock.unlock(); 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); //error_code = m_udpconn->ReceivePacket((char*)(&m_packet),packet_size);
while(m_udpconn->ReceivePacket((char*)(&m_packet),packet_size) != -1) while(m_udpconn->ReceivePacket((char*)(&m_packet),packet_size) != -1)
{ {
...@@ -160,13 +167,6 @@ namespace FSDataRecvNS ...@@ -160,13 +167,6 @@ namespace FSDataRecvNS
BuildTrainImage(m_packet,packet_size); BuildTrainImage(m_packet,packet_size);
else else
BuildImage(m_packet); 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 ...@@ -294,13 +294,13 @@ namespace FSDataRecvNS
lock.unlock(); lock.unlock();
} }
if(m_requested_frames < 352 || m_received_imgs % 352 == 0)
LOG_INFOS("one image is finished,received images:" LOG_INFOS("one image is finished,received images:"
+ to_string(m_received_imgs) + to_string(m_received_imgs)
+ "package collected:" + "package collected:"
+ to_string(m_packets_collected) + to_string(m_packets_collected)
+ "bytes colltected:" + "bytes colltected:"
+ to_string(m_collected_bytes)); + to_string(m_collected_bytes));
m_collected_bytes = 0; m_collected_bytes = 0;
...@@ -318,7 +318,7 @@ namespace FSDataRecvNS ...@@ -318,7 +318,7 @@ namespace FSDataRecvNS
if(new_image_bytes != 0) 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], memcpy(&m_img_data[m_collected_bytes/2],
&(packet_data.data[0]) + remain_bytes, &(packet_data.data[0]) + remain_bytes,
new_image_bytes); new_image_bytes);
......
Supports Markdown
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