From eda637f58fc3c4053b9c6e10030d9c48d4a01fe6 Mon Sep 17 00:00:00 2001 From: fattony Date: Fri, 29 Jul 2011 11:52:24 +0200 Subject: [PATCH] enabled all four video streams with image id check disabled hud instruments at startup --- src/apps/qgcvideo/QGCVideoMainWindow.cc | 187 ++++++++++++++++++------ src/apps/qgcvideo/QGCVideoWidget.cc | 2 +- 2 files changed, 141 insertions(+), 48 deletions(-) diff --git a/src/apps/qgcvideo/QGCVideoMainWindow.cc b/src/apps/qgcvideo/QGCVideoMainWindow.cc index 6aeab61fc..0fe36fb9b 100644 --- a/src/apps/qgcvideo/QGCVideoMainWindow.cc +++ b/src/apps/qgcvideo/QGCVideoMainWindow.cc @@ -37,7 +37,10 @@ QByteArray imageRecBuffer1 = QByteArray(376*240,255); QByteArray imageRecBuffer2 = QByteArray(376*240,255); + QByteArray imageRecBuffer3 = QByteArray(376*240,255); + QByteArray imageRecBuffer4 = QByteArray(376*240,255); static int part = 0; + unsigned char last_id = 0; QGCVideoMainWindow::QGCVideoMainWindow(QWidget *parent) : QMainWindow(parent), @@ -75,6 +78,7 @@ void QGCVideoMainWindow::receiveBytes(LinkInterface* link, QByteArray data) QString bytes; QString index; + QString imageid; QString ascii; @@ -93,90 +97,147 @@ void QGCVideoMainWindow::receiveBytes(LinkInterface* link, QByteArray data) header = header.arg(imgWidth).arg(imgHeight).arg(imgColors); unsigned char i0 = data[0]; + unsigned char id = data[1]; + + index.append(QString().sprintf("%02x", i0)); + imageid.append(QString().sprintf("%02x", id)); + qDebug() << "Received" << data.size() << "bytes"<< " part: " <video1Widget->copyImage(test); - ui->video2Widget->copyImage(image1); - ui->video3Widget->copyImage(image2); - //ui->video4Widget->copyImage(test); + ui->video1Widget->copyImage(image1); + ui->video2Widget->copyImage(image2); + ui->video3Widget->copyImage(image3); + ui->video4Widget->copyImage(image4); part = 0; imageRecBuffer1.clear(); imageRecBuffer2.clear(); + imageRecBuffer3.clear(); + imageRecBuffer4.clear(); } - index.append(QString().sprintf("%02x ", i0)); - for (int j=0; j 31 && data.at(j) < 127) @@ -240,9 +334,8 @@ void QGCVideoMainWindow::receiveBytes(LinkInterface* link, QByteArray data) ascii.append(219); } - } - qDebug() << "Received" << data.size() << "bytes"; - qDebug() << "index: " <