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
ef8326f0
Commit
ef8326f0
authored
Jun 07, 2010
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working on horizontal situation indicator
parent
c6e9ece0
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
25 deletions
+25
-25
qgroundcontrol.pro
qgroundcontrol.pro
+4
-2
HDDisplay.cc
src/ui/HDDisplay.cc
+7
-1
HSIDisplay.cc
src/ui/HSIDisplay.cc
+8
-20
HSIDisplay.h
src/ui/HSIDisplay.h
+2
-2
MainWindow.cc
src/ui/MainWindow.cc
+2
-0
MainWindow.h
src/ui/MainWindow.h
+2
-0
No files found.
qgroundcontrol.pro
View file @
ef8326f0
...
...
@@ -140,7 +140,8 @@ HEADERS += src/MG.h \
src
/
comm
/
MAVLinkSyntaxHighlighter
.
h
\
src
/
ui
/
watchdog
/
WatchdogControl
.
h
\
src
/
ui
/
watchdog
/
WatchdogProcessView
.
h
\
src
/
ui
/
watchdog
/
WatchdogView
.
h
src
/
ui
/
watchdog
/
WatchdogView
.
h
\
src
/
ui
/
HSIDisplay
.
h
SOURCES
+=
src
/
main
.
cc
\
src
/
Core
.
cc
\
src
/
uas
/
UASManager
.
cc
\
...
...
@@ -193,5 +194,6 @@ SOURCES += src/main.cc \
src
/
comm
/
MAVLinkSyntaxHighlighter
.
cc
\
src
/
ui
/
watchdog
/
WatchdogControl
.
cc
\
src
/
ui
/
watchdog
/
WatchdogProcessView
.
cc
\
src
/
ui
/
watchdog
/
WatchdogView
.
cc
src
/
ui
/
watchdog
/
WatchdogView
.
cc
\
src
/
ui
/
HSIDisplay
.
cc
RESOURCES
=
mavground
.
qrc
src/ui/HDDisplay.cc
View file @
ef8326f0
...
...
@@ -74,6 +74,12 @@ HDDisplay::HDDisplay(QStringList* plotList, QWidget *parent) :
{
//m_ui->setupUi(this);
// Check if acceptlist exists
if
(
!
acceptList
)
{
acceptList
=
new
QStringList
();
}
this
->
setMinimumHeight
(
125
);
this
->
setMinimumWidth
(
100
);
...
...
@@ -146,7 +152,7 @@ void HDDisplay::paintDisplay()
painter
.
fillRect
(
QRect
(
0
,
0
,
width
(),
height
()),
backgroundColor
);
const
int
columns
=
3
;
const
float
spacing
=
0.4
f
;
// 40% of width
const
float
gaugeWidth
=
vwidth
/
(((
float
)
columns
)
+
(((
float
)
columns
+
1
)
*
spacing
+
spacing
*
0.
1
f
));
const
float
gaugeWidth
=
vwidth
/
(((
float
)
columns
)
+
(((
float
)
columns
+
1
)
*
spacing
+
spacing
*
0.
5
f
));
const
QColor
gaugeColor
=
QColor
(
200
,
200
,
200
);
//drawSystemIndicator(10.0f-gaugeWidth/2.0f, 20.0f, 10.0f, 40.0f, 15.0f, &painter);
//drawGauge(15.0f, 15.0f, gaugeWidth/2.0f, 0, 1.0f, "thrust", values.value("thrust", 0.0f), gaugeColor, &painter, qMakePair(0.45f, 0.8f), qMakePair(0.8f, 1.0f), true);
...
...
src/ui/HSIDisplay.cc
View file @
ef8326f0
...
...
@@ -31,14 +31,15 @@ This file is part of the PIXHAWK project
#include <QFile>
#include <QStringList>
#include <QPainter>
#include "UASManager.h"
#include "HSIDisplay.h"
#include "MG.h"
#include <QDebug>
HSIDisplay
::
HSIDisplay
(
Q
StringList
*
plotList
,
Q
Widget
*
parent
)
:
HDDisplay
(
plotList
,
parent
),
HSIDisplay
::
HSIDisplay
(
QWidget
*
parent
)
:
HDDisplay
(
NULL
,
parent
)
{
}
...
...
@@ -68,7 +69,7 @@ void HSIDisplay::paintDisplay()
const
int
columns
=
3
;
const
float
spacing
=
0.4
f
;
// 40% of width
const
float
gaugeWidth
=
vwidth
/
(((
float
)
columns
)
+
(((
float
)
columns
+
1
)
*
spacing
+
spacing
*
0.1
f
));
const
QColor
gauge
Color
=
QColor
(
200
,
200
,
200
);
const
QColor
ring
Color
=
QColor
(
200
,
200
,
200
);
//drawSystemIndicator(10.0f-gaugeWidth/2.0f, 20.0f, 10.0f, 40.0f, 15.0f, &painter);
//drawGauge(15.0f, 15.0f, gaugeWidth/2.0f, 0, 1.0f, "thrust", values.value("thrust", 0.0f), gaugeColor, &painter, qMakePair(0.45f, 0.8f), qMakePair(0.8f, 1.0f), true);
//drawGauge(15.0f+gaugeWidth*1.7f, 15.0f, gaugeWidth/2.0f, 0, 10.0f, "altitude", values.value("altitude", 0.0f), gaugeColor, &painter, qMakePair(1.0f, 2.5f), qMakePair(0.0f, 0.5f), true);
...
...
@@ -140,11 +141,10 @@ void HSIDisplay::drawBaseLines(float xRef, float yRef, float radius, float yaw,
drawCircle
(
xRef
,
yRef
,
radius
,
200.0
f
,
color
,
painter
);
//drawCircle(xRef, yRef, radius, 200.0f, 170.0f, 1.0f, color, painter);
QString
label
;
label
.
sprintf
(
"%05.1f"
,
value
);
// Draw the value
paintText
(
label
,
color
,
4.5
f
,
xRef
-
7.5
f
,
yRef
-
2.0
f
,
painter
);
// // Draw the value
// QString label;
// label.sprintf("%05.1f", value);
// paintText(label, color, 4.5f, xRef-7.5f, yRef-2.0f, painter);
// Draw the needle
// Scale the rotation so that the gauge does one revolution
...
...
@@ -172,15 +172,3 @@ void HSIDisplay::drawBaseLines(float xRef, float yRef, float radius, float yaw,
painter
->
setBrush
(
indexBrush
);
drawPolygon
(
p
,
painter
);
}
void
HDDisplay
::
changeEvent
(
QEvent
*
e
)
{
QWidget
::
changeEvent
(
e
);
switch
(
e
->
type
())
{
case
QEvent
:
:
LanguageChange
:
m_ui
->
retranslateUi
(
this
);
break
;
default:
break
;
}
}
src/ui/HSIDisplay.h
View file @
ef8326f0
...
...
@@ -44,8 +44,8 @@ This file is part of the PIXHAWK project
class
HSIDisplay
:
public
HDDisplay
{
Q_OBJECT
public:
HSIDisplay
(
Q
StringList
*
plotList
,
Q
Widget
*
parent
=
0
);
~
HSIDisplay
();
HSIDisplay
(
QWidget
*
parent
=
0
);
//
~HSIDisplay();
public
slots
:
void
setActiveUAS
(
UASInterface
*
uas
);
...
...
src/ui/MainWindow.cc
View file @
ef8326f0
...
...
@@ -100,6 +100,8 @@ settings()
parameters
->
setVisible
(
false
);
watchdogControl
=
new
WatchdogControl
(
this
);
watchdogControl
->
setVisible
(
false
);
hsi
=
new
HSIDisplay
(
this
);
hsi
->
setVisible
(
false
);
QStringList
*
acceptList
=
new
QStringList
();
acceptList
->
append
(
"roll IMU"
);
...
...
src/ui/MainWindow.h
View file @
ef8326f0
...
...
@@ -61,6 +61,7 @@ This file is part of the PIXHAWK project
#include "XMLCommProtocolWidget.h"
#include "HDDisplay.h"
#include "WatchdogControl.h"
#include "HSIDisplay.h"
#include "LogCompressor.h"
...
...
@@ -148,6 +149,7 @@ protected:
HDDisplay
*
headDown1
;
HDDisplay
*
headDown2
;
WatchdogControl
*
watchdogControl
;
HSIDisplay
*
hsi
;
// Popup widgets
JoystickWidget
*
joystickWidget
;
...
...
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