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
d3c13e65
Commit
d3c13e65
authored
May 20, 2013
by
Michael Carpenter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes for compiling in windows and getting the AHRS working
parent
44dc6619
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
PrimaryFlightDisplay.cpp
src/ui/PrimaryFlightDisplay.cpp
+12
-9
No files found.
src/ui/PrimaryFlightDisplay.cpp
View file @
d3c13e65
...
...
@@ -10,14 +10,17 @@
#include <QPainterPath>
#include <QResizeEvent>
#include <math.h>
#include <cmath>
/*
*@TODO:
* global fixed pens
* repaint on demand multiple canvases
* multi implementation with shared model class
*/
double
round
(
double
value
,
int
digits
=
0
)
{
return
floor
(
value
*
pow
(
10
,
digits
)
+
0.5
)
/
pow
(
10
,
digits
);
}
const
int
PrimaryFlightDisplay
::
tickValues
[]
=
{
10
,
20
,
30
,
45
,
60
};
const
QString
PrimaryFlightDisplay
::
compassWindNames
[]
=
{
QString
(
"N"
),
...
...
@@ -35,7 +38,7 @@ PrimaryFlightDisplay::PrimaryFlightDisplay(int width, int height, QWidget *paren
roll
(
0
),
pitch
(
0
),
heading
(
NAN
),
heading
(
0
),
aboveASLAltitude
(
0
),
GPSAltitude
(
0
),
aboveHomeAltitude
(
0
),
...
...
@@ -80,7 +83,7 @@ PrimaryFlightDisplay::PrimaryFlightDisplay(int width, int height, QWidget *paren
// Refresh timer
refreshTimer
->
setInterval
(
updateInterval
);
connect
(
refreshTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
paintHUD
()));
connect
(
refreshTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
update
()));
}
PrimaryFlightDisplay
::~
PrimaryFlightDisplay
()
...
...
@@ -165,9 +168,9 @@ void PrimaryFlightDisplay::updateAttitude(UASInterface* uas, double roll, double
if
(
!
isnan
(
roll
)
&&
!
isinf
(
roll
)
&&
!
isnan
(
pitch
)
&&
!
isinf
(
pitch
)
&&
!
isnan
(
yaw
)
&&
!
isinf
(
yaw
))
{
// TODO: Units conversion?
this
->
roll
=
roll
;
this
->
pitch
=
pitch
;
this
->
heading
=
yaw
;
this
->
roll
=
roll
*
(
180.0
/
M_PI
)
;
this
->
pitch
=
pitch
*
(
180.0
/
M_PI
)
;
this
->
heading
=
yaw
*
(
180.0
/
M_PI
)
;
}
// TODO: Else-part. We really should have an "attitude bad or unknown" indication instead of just freezing.
...
...
@@ -309,7 +312,7 @@ void PrimaryFlightDisplay::paintEvent(QPaintEvent *event)
// the event is ignored as this widget
// is refreshed automatically
Q_UNUSED
(
event
);
makeDummyData
();
//
makeDummyData();
doPaint
();
}
...
...
@@ -319,7 +322,7 @@ void PrimaryFlightDisplay::paintOnTimer() {
*The whole tainted-flag shebang.
*well not really so critical. Worst problem is deletion?
*/
makeDummyData
();
//
makeDummyData();
doPaint
();
}
...
...
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