Commit 6dd9fedf authored by Lorenz Meier's avatar Lorenz Meier
Browse files

Hotfix for confusing / dangling video stream flags

parent 3027250d
......@@ -581,30 +581,12 @@ void HUD::paintHUD()
scalingFactor = this->width()/vwidth;
double scalingFactorH = this->height()/vheight;
if (scalingFactorH < scalingFactor) scalingFactor = scalingFactorH;
// Fill with black background
if (videoEnabled) {
if (nextOfflineImage != "" && QFileInfo(nextOfflineImage).exists()) {
qDebug() << __FILE__ << __LINE__ << "template image:" << nextOfflineImage;
QImage fill = QImage(nextOfflineImage);
glImage = fill;
// Reset to save load efforts
nextOfflineImage = "";
}
}
// And if either video or the data stream is enabled, draw the next frame.
if (dataStreamEnabled || videoEnabled)
if (videoEnabled)
{
xImageFactor = width() / (float)glImage.width();
yImageFactor = height() / (float)glImage.height();
//float imageFactor = qMin(xImageFactor, yImageFactor);
// Resize to correct size and fill with image
// FIXME
}
QPainter painter;
......@@ -1331,14 +1313,6 @@ void HUD::saveImage()
saveImage(fileName);
}
void HUD::startImage(quint64 timestamp)
{
if (videoEnabled && offlineDirectory != "") {
// Load and diplay image file
nextOfflineImage = QString(offlineDirectory + "/%1.bmp").arg(timestamp);
}
}
void HUD::selectOfflineDirectory()
{
QString fileName = QFileDialog::getExistingDirectory(this, tr("Select image directory"), QDesktopServices::storageLocation(QDesktopServices::DesktopLocation));
......
......@@ -81,7 +81,6 @@ public slots:
void updateLoad(UASInterface*, double);
void selectWaypoint(int uasId, int id);
void startImage(quint64 timestamp);
void startImage(int imgid, int width, int height, int depth, int channels);
void setPixels(int imgid, const unsigned char* imageData, int length, int startIndex);
void finishImage();
......@@ -220,7 +219,6 @@ protected:
QString nextOfflineImage;
bool HUDInstrumentsEnabled;
bool videoEnabled;
bool dataStreamEnabled;
bool imageLoggingEnabled;
float xImageFactor;
float yImageFactor;
......
......@@ -103,14 +103,14 @@ void QGCRGBDView::contextMenuEvent(QContextMenuEvent* event)
void QGCRGBDView::enableRGB(bool enabled)
{
rgbEnabled = enabled;
dataStreamEnabled = rgbEnabled | depthEnabled;
videoEnabled = rgbEnabled | depthEnabled;
QWidget::resize(size().width(), size().height());
}
void QGCRGBDView::enableDepth(bool enabled)
{
depthEnabled = enabled;
dataStreamEnabled = rgbEnabled | depthEnabled;
videoEnabled = rgbEnabled | depthEnabled;
QWidget::resize(size().width(), size().height());
}
......
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