Commit f3bd1452 authored by Helen Oleynikova's avatar Helen Oleynikova

Clean-up for video transmission.

parent 94abcb70
...@@ -1387,15 +1387,12 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) ...@@ -1387,15 +1387,12 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
++imagePacketsArrived; ++imagePacketsArrived;
// emit signal if all packets arrived // emit signal if all packets arrived
// && seq >= imagePackets-1 if (imagePacketsArrived >= imagePackets)
if ((imagePacketsArrived >= imagePackets))
{ {
// Restart statemachine // Restart statemachine
imagePackets = 0; imagePackets = 0;
imagePacketsArrived = 0; imagePacketsArrived = 0;
emit imageReady(this); emit imageReady(this);
//imagePacketsArrived = 0;
//imagePackets = 0;
//qDebug() << "imageReady emitted. all packets arrived"; //qDebug() << "imageReady emitted. all packets arrived";
} }
} }
...@@ -2205,8 +2202,6 @@ QImage UAS::getImage() ...@@ -2205,8 +2202,6 @@ QImage UAS::getImage()
if (!image.loadFromData(imageRecBuffer)) if (!image.loadFromData(imageRecBuffer))
{ {
qDebug() << __FILE__ << __LINE__ << "Loading data from image buffer failed!"; qDebug() << __FILE__ << __LINE__ << "Loading data from image buffer failed!";
//imagePacketsArrived = 0;
//imagePackets = 0;
return QImage(); return QImage();
} }
} }
...@@ -2216,7 +2211,6 @@ QImage UAS::getImage() ...@@ -2216,7 +2211,6 @@ QImage UAS::getImage()
imagePackets = 0; imagePackets = 0;
imageRecBuffer.clear(); imageRecBuffer.clear();
return image; return image;
} }
void UAS::requestImage() void UAS::requestImage()
......
...@@ -1376,7 +1376,7 @@ void HUD::copyImage(UASInterface* uas) ...@@ -1376,7 +1376,7 @@ void HUD::copyImage(UASInterface* uas)
{ {
QImage temp_im = u->getImage(); QImage temp_im = u->getImage();
if (temp_im.byteCount() > 0) { if (temp_im.byteCount() > 0) {
this->glImage = temp_im;//u->getImage(); this->glImage = temp_im;
} }
// Save to directory if logging is enabled // Save to directory if logging is enabled
......
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