Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
5795eb6b
Commit
5795eb6b
authored
Jan 19, 2011
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjusted minor paths and destructors
parent
8e3ebca8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
190 additions
and
162 deletions
+190
-162
HUD.cc
src/ui/HUD.cc
+190
-162
No files found.
src/ui/HUD.cc
View file @
5795eb6b
...
...
@@ -142,11 +142,11 @@ HUD::HUD(int width, int height, QWidget* parent)
fill
.
setColor
(
2
,
qRgb
(
0
,
0
,
0
));
fill
.
fill
(
0
);
QString
imagePath
=
"/Users/user/Desktop/frame0000.png"
;
qDebug
()
<<
__FILE__
<<
__LINE__
<<
"template image:"
<<
imagePath
;
fill
=
QImage
(
imagePath
);
//
QString imagePath = "/Users/user/Desktop/frame0000.png";
//
qDebug() << __FILE__ << __LINE__ << "template image:" << imagePath;
//
fill = QImage(imagePath);
glImage
=
QGLWidget
::
convertToGLFormat
(
fill
);
//
glImage = QGLWidget::convertToGLFormat(fill);
// Refresh timer
refreshTimer
->
setInterval
(
updateInterval
);
...
...
@@ -154,8 +154,7 @@ HUD::HUD(int width, int height, QWidget* parent)
connect
(
refreshTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
paintHUD
()));
// Resize to correct size and fill with image
resize
(
fill
.
size
());
glDrawPixels
(
glImage
.
width
(),
glImage
.
height
(),
GL_RGBA
,
GL_UNSIGNED_BYTE
,
glImage
.
bits
());
//glDrawPixels(glImage.width(), glImage.height(), GL_RGBA, GL_UNSIGNED_BYTE, glImage.bits());
// Set size once
//setFixedSize(fill.size());
...
...
@@ -189,7 +188,7 @@ HUD::HUD(int width, int height, QWidget* parent)
HUD
::~
HUD
()
{
refreshTimer
->
stop
();
}
QSize
HUD
::
sizeHint
()
const
...
...
@@ -551,6 +550,8 @@ void HUD::paintEvent(QPaintEvent *event)
void
HUD
::
paintHUD
()
{
if
(
isVisible
())
{
// static quint64 interval = 0;
// qDebug() << "INTERVAL:" << MG::TIME::getGroundTimeNow() - interval << __FILE__ << __LINE__;
// interval = MG::TIME::getGroundTimeNow();
...
...
@@ -609,7 +610,33 @@ void HUD::paintHUD()
glClear
(
GL_COLOR_BUFFER_BIT
|
GL_DEPTH_BUFFER_BIT
);
// Blue / Brown background
if
(
noCamera
)
paintCenterBackground
(
roll
,
pitch
,
yawTrans
);
if
(
noCamera
)
{
paintCenterBackground
(
roll
,
pitch
,
yawTrans
);
}
// else {
// Fill with black background
QString
imagePath
=
"/Users/user/Desktop/frame0000.png"
;
if
(
QFileInfo
(
imagePath
).
exists
())
{
//qDebug() << __FILE__ << __LINE__ << "template image:" << imagePath;
QImage
fill
=
QImage
(
imagePath
);
glImage
=
QGLWidget
::
convertToGLFormat
(
fill
);
float
xFactor
;
float
yFactor
;
xFactor
=
width
()
/
(
float
)
fill
.
width
();
yFactor
=
height
()
/
(
float
)
fill
.
height
();
glPixelZoom
(
xFactor
,
yFactor
);
// Resize to correct size and fill with image
glDrawPixels
(
glImage
.
width
(),
glImage
.
height
(),
GL_RGBA
,
GL_UNSIGNED_BYTE
,
glImage
.
bits
());
// FIXME Adjust viewport to scale image into view
}
// }
glMatrixMode
(
GL_MODELVIEW
);
glPopMatrix
();
...
...
@@ -707,7 +734,7 @@ void HUD::paintHUD()
painter
.
drawRoundedRect
(
compassRect
,
2
,
2
);
QString
yawAngle
;
// const float yawDeg = ((values.value("yaw", 0.0f)/M_PI)*180.0f)+180.f;
// const float yawDeg = ((values.value("yaw", 0.0f)/M_PI)*180.0f)+180.f;
// YAW is in compass-human readable format, so 0 - 360deg. This is normal in aviation, not -180 - +180.
const
float
yawDeg
=
((
yawLP
/
M_PI
)
*
180.0
f
)
+
180.0
f
;
...
...
@@ -751,6 +778,7 @@ void HUD::paintHUD()
//glDisable(GL_MULTISAMPLE);
//glFlush();
}
}
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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