Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
6dd9fedf
Commit
6dd9fedf
authored
Feb 14, 2014
by
Lorenz Meier
Browse files
Hotfix for confusing / dangling video stream flags
parent
3027250d
Changes
3
Show whitespace changes
Inline
Side-by-side
src/ui/HUD.cc
View file @
6dd9fedf
...
...
@@ -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
));
...
...
src/ui/HUD.h
View file @
6dd9fedf
...
...
@@ -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
;
...
...
src/ui/QGCRGBDView.cc
View file @
6dd9fedf
...
...
@@ -103,14 +103,14 @@ void QGCRGBDView::contextMenuEvent(QContextMenuEvent* event)
void
QGCRGBDView
::
enableRGB
(
bool
enabled
)
{
rgbEnabled
=
enabled
;
dataStream
Enabled
=
rgbEnabled
|
depthEnabled
;
video
Enabled
=
rgbEnabled
|
depthEnabled
;
QWidget
::
resize
(
size
().
width
(),
size
().
height
());
}
void
QGCRGBDView
::
enableDepth
(
bool
enabled
)
{
depthEnabled
=
enabled
;
dataStream
Enabled
=
rgbEnabled
|
depthEnabled
;
video
Enabled
=
rgbEnabled
|
depthEnabled
;
QWidget
::
resize
(
size
().
width
(),
size
().
height
());
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment