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
a8d4af86
Commit
a8d4af86
authored
Apr 10, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1441 from DonLakeFlyer/CompilerWarning
Fix new clang warnings
parents
999a4a87
4eb16a06
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
22 deletions
+22
-22
PrimaryFlightDisplay.cc
src/ui/PrimaryFlightDisplay.cc
+12
-12
QGCFlightDisplay.cc
src/ui/flightdisplay/QGCFlightDisplay.cc
+9
-9
Waypoint2DIcon.cc
src/ui/map/Waypoint2DIcon.cc
+1
-1
No files found.
src/ui/PrimaryFlightDisplay.cc
View file @
a8d4af86
...
...
@@ -264,7 +264,7 @@ void PrimaryFlightDisplay::updateAttitude(UASInterface* uas, double roll, double
float
rolldeg
=
roll
*
(
180.0
/
M_PI
);
if
(
fabsf
(
roll
-
rolldeg
)
>
2.5
f
)
{
if
(
fabsf
(
(
float
)
roll
-
rolldeg
)
>
2.5
f
)
{
_valuesChanged
=
true
;
}
...
...
@@ -277,7 +277,7 @@ void PrimaryFlightDisplay::updateAttitude(UASInterface* uas, double roll, double
float
pitchdeg
=
pitch
*
(
180.0
/
M_PI
);
if
(
fabsf
(
pitch
-
pitchdeg
)
>
2.5
f
)
{
if
(
fabsf
(
(
float
)
pitch
-
pitchdeg
)
>
2.5
f
)
{
_valuesChanged
=
true
;
}
...
...
@@ -291,7 +291,7 @@ void PrimaryFlightDisplay::updateAttitude(UASInterface* uas, double roll, double
yaw
=
yaw
*
(
180.0
/
M_PI
);
if
(
yaw
<
0
)
yaw
+=
360
;
if
(
fabs
f
(
heading
-
yaw
)
>
10.0
f
)
{
if
(
fabs
(
heading
-
yaw
)
>
10.0
)
{
_valuesChanged
=
true
;
}
...
...
@@ -311,11 +311,11 @@ void PrimaryFlightDisplay::updateSpeed(UASInterface* uas, double _groundSpeed, d
Q_UNUSED
(
uas
);
Q_UNUSED
(
timestamp
);
if
(
fabs
f
(
groundSpeed
-
_groundSpeed
)
>
0.5
f
)
{
if
(
fabs
(
groundSpeed
-
_groundSpeed
)
>
0.5
)
{
_valuesChanged
=
true
;
}
if
(
fabs
f
(
airSpeed
-
_airSpeed
)
>
1.0
f
)
{
if
(
fabs
(
airSpeed
-
_airSpeed
)
>
1.0
)
{
_valuesChanged
=
true
;
}
...
...
@@ -327,19 +327,19 @@ void PrimaryFlightDisplay::updateAltitude(UASInterface* uas, double _altitudeAMS
Q_UNUSED
(
uas
);
Q_UNUSED
(
timestamp
);
if
(
fabs
f
(
altitudeAMSL
-
_altitudeAMSL
)
>
0.5
f
)
{
if
(
fabs
(
altitudeAMSL
-
_altitudeAMSL
)
>
0.5
)
{
_valuesChanged
=
true
;
}
if
(
fabs
f
(
altitudeWGS84
-
_altitudeWGS84
)
>
0.5
f
)
{
if
(
fabs
(
altitudeWGS84
-
_altitudeWGS84
)
>
0.5
)
{
_valuesChanged
=
true
;
}
if
(
fabs
f
(
altitudeRelative
-
_altitudeRelative
)
>
0.5
f
)
{
if
(
fabs
(
altitudeRelative
-
_altitudeRelative
)
>
0.5
)
{
_valuesChanged
=
true
;
}
if
(
fabs
f
(
climbRate
-
_climbRate
)
>
0.5
f
)
{
if
(
fabs
(
climbRate
-
_climbRate
)
>
0.5
)
{
_valuesChanged
=
true
;
}
...
...
@@ -657,7 +657,7 @@ void PrimaryFlightDisplay::drawPitchScale(
// f(p) = (90-p) * 1/(90-PITCH_SCALE_WIDTHREDUCTION_FROM)
// or PITCH_SCALE_WIDTHREDUCTION + f(pitch) - f(pitch) * PITCH_SCALE_WIDTHREDUCTION
// or PITCH_SCALE_WIDTHREDUCTION (1-f(pitch)) + f(pitch)
int
fromVertical
=
abs
(
pitch
>=
0
?
90
-
pitch
:
-
90
-
pitch
);
int
fromVertical
=
f
abs
(
pitch
>=
0
?
90
-
pitch
:
-
90
-
pitch
);
float
temp
=
fromVertical
*
1
/
(
90.0
f
-
PITCH_SCALE_WIDTHREDUCTION_FROM
);
linewidth
*=
(
PITCH_SCALE_WIDTHREDUCTION
*
(
1
-
temp
)
+
temp
);
}
...
...
@@ -882,7 +882,7 @@ void PrimaryFlightDisplay::drawAICompassDisk(QPainter& painter, QRectF area, flo
// TODO : Sign might be wrong?
// TODO : The case where error exceeds max. Truncate to max. and make that visible somehow.
bool
errorBeyondRadius
=
false
;
if
(
abs
(
navigationCrosstrackError
)
>
CROSSTRACK_MAX
)
{
if
(
f
abs
(
navigationCrosstrackError
)
>
CROSSTRACK_MAX
)
{
errorBeyondRadius
=
true
;
navigationCrosstrackError
=
navigationCrosstrackError
>
0
?
CROSSTRACK_MAX
:
-
CROSSTRACK_MAX
;
}
...
...
@@ -1026,7 +1026,7 @@ void PrimaryFlightDisplay::drawAltimeter(
painter
.
drawLine
(
vvArrowBegin
,
vvArrowEnd
);
// Yeah this is a repetition of above code but we are going to trash it all anyway, so no fix.
float
vvArowHeadSize
=
abs
(
vvPixHeight
-
markerHalfHeight
*
vvSign
);
float
vvArowHeadSize
=
f
abs
(
vvPixHeight
-
markerHalfHeight
*
vvSign
);
if
(
vvArowHeadSize
>
w
*
ALTIMETER_VVI_WIDTH
/
3
)
vvArowHeadSize
=
w
*
ALTIMETER_VVI_WIDTH
/
3
;
float
xcenter
=
rightEdge
-
w
*
ALTIMETER_VVI_WIDTH
/
2
;
...
...
src/ui/flightdisplay/QGCFlightDisplay.cc
View file @
a8d4af86
...
...
@@ -145,7 +145,7 @@ void QGCFlightDisplay::_updateAttitude(UASInterface*, double roll, double pitch,
}
else
{
bool
update
=
false
;
float
rolldeg
=
roll
*
(
180.0
/
M_PI
);
if
(
fabs
f
(
roll
-
rolldeg
)
>
2.5
f
)
{
if
(
fabs
(
roll
-
rolldeg
)
>
2.5
)
{
update
=
true
;
}
_roll
=
rolldeg
;
...
...
@@ -160,7 +160,7 @@ void QGCFlightDisplay::_updateAttitude(UASInterface*, double roll, double pitch,
}
else
{
bool
update
=
false
;
float
pitchdeg
=
pitch
*
(
180.0
/
M_PI
);
if
(
fabs
f
(
pitch
-
pitchdeg
)
>
2.5
f
)
{
if
(
fabs
(
pitch
-
pitchdeg
)
>
2.5
)
{
update
=
true
;
}
_pitch
=
pitchdeg
;
...
...
@@ -176,7 +176,7 @@ void QGCFlightDisplay::_updateAttitude(UASInterface*, double roll, double pitch,
bool
update
=
false
;
yaw
=
yaw
*
(
180.0
/
M_PI
);
if
(
yaw
<
0
)
yaw
+=
360
;
if
(
fabs
f
(
_heading
-
yaw
)
>
10.0
f
)
{
if
(
fabs
(
_heading
-
yaw
)
>
10.0
)
{
update
=
true
;
}
_heading
=
yaw
;
...
...
@@ -199,11 +199,11 @@ void QGCFlightDisplay::_updateSpeed(UASInterface*, double groundSpeed, double ai
double
oldairSpeed
=
_airSpeed
;
_groundSpeed
=
groundSpeed
;
_airSpeed
=
airSpeed
;
if
(
fabs
f
(
oldgroundSpeed
-
groundSpeed
)
>
0.5
f
)
{
if
(
fabs
(
oldgroundSpeed
-
groundSpeed
)
>
0.5
)
{
if
(
_refreshTimer
->
isActive
())
emit
groundSpeedChanged
();
_valuesChanged
=
true
;
}
if
(
fabs
f
(
oldairSpeed
-
airSpeed
)
>
1.0
f
)
{
if
(
fabs
(
oldairSpeed
-
airSpeed
)
>
1.0
)
{
if
(
_refreshTimer
->
isActive
())
emit
airSpeedChanged
();
_valuesChanged
=
true
;
}
...
...
@@ -221,19 +221,19 @@ void QGCFlightDisplay::_updateAltitude(UASInterface*, double altitudeAMSL, doubl
if
(
_climbRate
>
-
0.01
&&
_climbRate
<
0.01
)
{
_climbRate
=
0.0
;
}
if
(
fabs
f
(
oldaltitudeAMSL
-
altitudeAMSL
)
>
0.5
f
)
{
if
(
fabs
(
oldaltitudeAMSL
-
altitudeAMSL
)
>
0.5
)
{
if
(
_refreshTimer
->
isActive
())
emit
altitudeAMSLChanged
();
_valuesChanged
=
true
;
}
if
(
fabs
f
(
oldaltitudeWGS84
-
altitudeWGS84
)
>
0.5
f
)
{
if
(
fabs
(
oldaltitudeWGS84
-
altitudeWGS84
)
>
0.5
)
{
if
(
_refreshTimer
->
isActive
())
emit
altitudeWGS84Changed
();
_valuesChanged
=
true
;
}
if
(
fabs
f
(
oldaltitudeRelative
-
altitudeRelative
)
>
0.5
f
)
{
if
(
fabs
(
oldaltitudeRelative
-
altitudeRelative
)
>
0.5
)
{
if
(
_refreshTimer
->
isActive
())
emit
altitudeRelativeChanged
();
_valuesChanged
=
true
;
}
if
(
fabs
f
(
oldclimbRate
-
climbRate
)
>
0.5
f
)
{
if
(
fabs
(
oldclimbRate
-
climbRate
)
>
0.5
)
{
if
(
_refreshTimer
->
isActive
())
emit
climbRateChanged
();
_valuesChanged
=
true
;
}
...
...
src/ui/map/Waypoint2DIcon.cc
View file @
a8d4af86
...
...
@@ -307,7 +307,7 @@ void Waypoint2DIcon::paint(QPainter *painter, const QStyleOptionGraphicsItem *op
penDash
.
setWidth
(
1
);
//penDash.setStyle(Qt::DotLine);
// A negative radius indicates counter-clockwise rotation, but we still want to draw it positive
const
int
loiter
=
map
->
metersToPixels
(
fabs
f
(
waypoint
->
getLoiterOrbit
()),
Coord
());
const
int
loiter
=
map
->
metersToPixels
(
fabs
(
waypoint
->
getLoiterOrbit
()),
Coord
());
if
(
loiter
>
picture
.
width
()
/
2
)
{
painter
->
setPen
(
penBlack
);
...
...
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