From 919c2b20341a192b1b535caa45af1ecb546ac030 Mon Sep 17 00:00:00 2001 From: pixhawk Date: Mon, 30 May 2011 16:14:04 +0200 Subject: [PATCH] bmp_22x22_8bit sometimes showing from bmp_22x22_8bit_greyscale.mavlink with random pixels --- src/uas/UAS.cc | 1 + src/ui/HUD.cc | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index a77411a05..0586bdd3e 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -902,6 +902,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) // Restart statemachine imagePacketsArrived = 0; emit imageReady(this); + qDebug() << "imageReady emitted. all packets arrived"; //this->requestImage(); //qDebug() << "SENDING REQUEST TO GET NEW IMAGE FROM SYSTEM" << uasId; diff --git a/src/ui/HUD.cc b/src/ui/HUD.cc index 2f6eb2da9..19e14bf90 100644 --- a/src/ui/HUD.cc +++ b/src/ui/HUD.cc @@ -138,8 +138,8 @@ HUD::HUD(int width, int height, QWidget* parent) hudInstrumentsEnabled(true), videoEnabled(false), xImageFactor(1.0), - yImageFactor(1.0) - imageRequested(false), + yImageFactor(1.0), + imageRequested(false) { // Set auto fill to false setAutoFillBackground(false); @@ -168,7 +168,7 @@ HUD::HUD(int width, int height, QWidget* parent) imageTimer->setInterval(250); //connect(refreshTimer, SIGNAL(timeout()), this, SLOT(update())); connect(refreshTimer, SIGNAL(timeout()), this, SLOT(paintHUD())); - connect(imageTimer, SIGNAL(timeout()), this, SLOT(requestNewImage())); + // connect(imageTimer, SIGNAL(timeout()), this, SLOT(requestNewImage())); TODO // Resize to correct size and fill with image //glDrawPixels(glImage.width(), glImage.height(), GL_RGBA, GL_UNSIGNED_BYTE, glImage.bits()); @@ -1635,14 +1635,15 @@ void HUD::setPixels(int imgid, const unsigned char* imageData, int length, int s void HUD::requestNewImage() { - if (!imageRequested) - { - this->u->requestImage(); - imageRequested = true; - } - else - { + qDebug() << "HUD::requestNewImage()"; +// if (!imageRequested) +// { +// this->u->requestImage(); +// imageRequested = true; +// } +// else +// { this->glImage = this->u->getImage(); - imageRequested = false; - } +// imageRequested = false; +// } } -- 2.22.0