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
16558d70
Commit
16558d70
authored
Apr 16, 2013
by
Lorenz Meier
Browse files
Icon fixes, HSI shows satellites correctly rotated
parent
8b5026a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
libs/opmapcontrol/src/mapwidget/uavitem.cpp
View file @
16558d70
...
@@ -58,7 +58,10 @@ namespace mapcontrol
...
@@ -58,7 +58,10 @@ namespace mapcontrol
Q_UNUSED
(
option
);
Q_UNUSED
(
option
);
Q_UNUSED
(
widget
);
Q_UNUSED
(
widget
);
// painter->rotate(-90);
// painter->rotate(-90);
QPainter
::
RenderHints
oldhints
=
painter
->
renderHints
();
painter
->
setRenderHints
(
QPainter
::
Antialiasing
|
QPainter
::
SmoothPixmapTransform
);
painter
->
drawPixmap
(
-
pic
.
width
()
/
2
,
-
pic
.
height
()
/
2
,
pic
);
painter
->
drawPixmap
(
-
pic
.
width
()
/
2
,
-
pic
.
height
()
/
2
,
pic
);
painter
->
setRenderHints
(
oldhints
);
// painter->drawRect(QRectF(-pic.width()/2,-pic.height()/2,pic.width()-1,pic.height()-1));
// painter->drawRect(QRectF(-pic.width()/2,-pic.height()/2,pic.width()-1,pic.height()-1));
}
}
QRectF
UAVItem
::
boundingRect
()
const
QRectF
UAVItem
::
boundingRect
()
const
...
...
src/ui/HSIDisplay.cc
View file @
16558d70
...
@@ -1310,9 +1310,13 @@ void HSIDisplay::drawSafetyArea(const QPointF &topLeft, const QPointF &bottomRig
...
@@ -1310,9 +1310,13 @@ void HSIDisplay::drawSafetyArea(const QPointF &topLeft, const QPointF &bottomRig
void
HSIDisplay
::
drawGPS
(
QPainter
&
painter
)
void
HSIDisplay
::
drawGPS
(
QPainter
&
painter
)
{
{
float
xCenter
=
xCenterPos
;
float
xCenter
=
xCenterPos
;
float
yCenter
=
xCenterPos
;
float
yCenter
=
yCenterPos
;
// Max satellite circle radius
const
float
yawDeg
=
((
yaw
/
M_PI
)
*
180.0
f
);
int
yawRotate
=
static_cast
<
int
>
(
yawDeg
)
%
360
;
// XXX check rotation direction
// Max satellite circle radius
const
float
margin
=
0.15
f
;
// 20% margin of total width on each side
const
float
margin
=
0.15
f
;
// 20% margin of total width on each side
float
radius
=
(
vwidth
-
vwidth
*
2.0
f
*
margin
)
/
2.0
f
;
float
radius
=
(
vwidth
-
vwidth
*
2.0
f
*
margin
)
/
2.0
f
;
quint64
currTime
=
MG
::
TIME
::
getGroundTimeNowUsecs
();
quint64
currTime
=
MG
::
TIME
::
getGroundTimeNowUsecs
();
...
@@ -1353,8 +1357,8 @@ void HSIDisplay::drawGPS(QPainter &painter)
...
@@ -1353,8 +1357,8 @@ void HSIDisplay::drawGPS(QPainter &painter)
painter
.
setPen
(
color
);
painter
.
setPen
(
color
);
painter
.
setBrush
(
brush
);
painter
.
setBrush
(
brush
);
float
xPos
=
xCenter
+
(
sin
(((
sat
->
azimuth
/
255.0
f
)
*
360.0
f
)
/
180.0
f
*
M_PI
)
*
cos
(
sat
->
elevation
/
180.0
f
*
M_PI
))
*
radius
;
float
xPos
=
xCenter
+
(
sin
(((
sat
->
azimuth
/
255.0
f
)
*
360.0
f
-
yawRotate
)
/
180.0
f
*
M_PI
)
*
cos
(
sat
->
elevation
/
180.0
f
*
M_PI
))
*
radius
;
float
yPos
=
yCenter
-
(
cos
(((
sat
->
azimuth
/
255.0
f
)
*
360.0
f
)
/
180.0
f
*
M_PI
)
*
cos
(
sat
->
elevation
/
180.0
f
*
M_PI
))
*
radius
;
float
yPos
=
yCenter
-
(
cos
(((
sat
->
azimuth
/
255.0
f
)
*
360.0
f
-
yawRotate
)
/
180.0
f
*
M_PI
)
*
cos
(
sat
->
elevation
/
180.0
f
*
M_PI
))
*
radius
;
// Draw circle for satellite, filled for used satellites
// Draw circle for satellite, filled for used satellites
drawCircle
(
xPos
,
yPos
,
vwidth
*
0.02
f
,
1.0
f
,
color
,
&
painter
);
drawCircle
(
xPos
,
yPos
,
vwidth
*
0.02
f
,
1.0
f
,
color
,
&
painter
);
...
...
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