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
d3ba1d38
Commit
d3ba1d38
authored
Nov 15, 2011
by
oberion
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'remotes/pixhawk/v10release' into dev_senseSoarMavlinkv10
parents
e93ddb81
56e11079
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
183 additions
and
123 deletions
+183
-123
qgroundcontrol.pri
qgroundcontrol.pri
+6
-31
qgroundcontrol.pro
qgroundcontrol.pro
+17
-15
GAudioOutput.cc
src/GAudioOutput.cc
+9
-9
MAVLinkSimulationLink.cc
src/comm/MAVLinkSimulationLink.cc
+3
-3
MAVLinkSimulationLink.h
src/comm/MAVLinkSimulationLink.h
+1
-0
MAVLinkSimulationMAV.cc
src/comm/MAVLinkSimulationMAV.cc
+3
-3
MAVLinkSimulationWaypointPlanner.cc
src/comm/MAVLinkSimulationWaypointPlanner.cc
+3
-3
SerialLink.cc
src/comm/SerialLink.cc
+3
-2
opmapwidget.cpp
src/libs/opmapcontrol/src/mapwidget/opmapwidget.cpp
+13
-1
waypointitem.cpp
src/libs/opmapcontrol/src/mapwidget/waypointitem.cpp
+3
-3
xmlconfig.cpp
src/libs/utils/xmlconfig.cpp
+1
-1
UAS.cc
src/uas/UAS.cc
+16
-20
UASWaypointManager.cc
src/uas/UASWaypointManager.cc
+11
-3
HDDisplay.cc
src/ui/HDDisplay.cc
+62
-9
HDDisplay.h
src/ui/HDDisplay.h
+8
-0
HSIDisplay.cc
src/ui/HSIDisplay.cc
+4
-3
MAVLinkDecoder.cc
src/ui/MAVLinkDecoder.cc
+0
-1
MainWindow.cc
src/ui/MainWindow.cc
+9
-5
MainWindow.h
src/ui/MainWindow.h
+1
-1
QGCParamWidget.cc
src/ui/QGCParamWidget.cc
+3
-3
UASControlWidget.cc
src/ui/uas/UASControlWidget.cc
+7
-7
No files found.
qgroundcontrol.pri
View file @
d3ba1d38
...
...
@@ -42,8 +42,8 @@ macx {
# COMPILER_VERSION = $$system(gcc -v)
#message(Using compiler $$COMPILER_VERSION)
CONFIG += x86 cocoa phonon
CONFIG -= x86
_64
CONFIG += x86
_64
cocoa phonon
CONFIG -= x86
#HARDWARE_PLATFORM = $$system(uname -a)
#contains( $$HARDWARE_PLATFORM, "9.6.0" ) || contains( $$HARDWARE_PLATFORM, "9.7.0" ) || contains( $$HARDWARE_PLATFORM, "9.8.0" ) || contains( $$HARDWARE_PLATFORM, "9.9.0" ) {
...
...
@@ -65,11 +65,10 @@ macx {
# debug {
#QMAKE_CXXFLAGS += -finstrument-functions
#LIBS += -lSaturn
CONFIG += console
# }
#}
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.
5
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.
6
#DESTDIR = $$BASEDIR/bin/mac
INCLUDEPATH += -framework SDL
...
...
@@ -103,7 +102,7 @@ macx {
DEFINES += QGC_OSG_ENABLED
# Include OpenSceneGraph libraries
INCLUDEPATH += -framework GLUT \
-framework C
arbon
\
-framework C
ocoa
\
-framework OpenThreads \
-framework osg \
-framework osgViewer \
...
...
@@ -113,7 +112,7 @@ macx {
-framework osgWidget
LIBS += -framework GLUT \
-framework C
arbon
\
-framework C
ocoa
\
-framework OpenThreads \
-framework osg \
-framework osgViewer \
...
...
@@ -123,37 +122,13 @@ macx {
-framework osgWidget
}
exists(/usr/include/osgEarth) {
message("Building support for osgEarth")
DEPENDENCIES_PRESENT += osgearth
# Include osgEarth libraries
INCLUDEPATH += -framework GDAL \
$$IN_PWD/lib/mac32-gcc/include \
-framework GEOS \
-framework SQLite3 \
-framework osgFX \
-framework osgTerrain
LIBS += -framework GDAL \
-framework GEOS \
-framework SQLite3 \
-framework osgFX \
-framework osgTerrain
DEFINES += QGC_OSGEARTH_ENABLED
}
exists(/opt/local/include/libfreenect) {
exists(/opt/local/include/libfreenect)|exists(/usr/local/include/libfreenect) {
message("Building support for libfreenect")
DEPENDENCIES_PRESENT += libfreenect
# Include libfreenect libraries
LIBS += -lfreenect
DEFINES += QGC_LIBFREENECT_ENABLED
}
# osg/osgEarth dynamic casts might fail without this compiler option.
# see http://osgearth.org/wiki/FAQ for details.
#QMAKE_CXXFLAGS += -Wl,-E
}
# GNU/Linux
...
...
qgroundcontrol.pro
View file @
d3ba1d38
...
...
@@ -42,12 +42,14 @@ RCC_DIR = $${BUILDDIR}/rcc
MAVLINK_CONF
=
""
DEFINES
+=
MAVLINK_NO_DATA
win32
{
QMAKE_INCDIR_QT
=
$$
(
QTDIR
)
/
include
QMAKE_LIBDIR_QT
=
$$
(
QTDIR
)
/
lib
QMAKE_UIC
=
"$$(QTDIR)/bin/uic.exe"
QMAKE_MOC
=
"$$(QTDIR)/bin/moc.exe"
QMAKE_RCC
=
"$$(QTDIR)/bin/rcc.exe"
QMAKE_QMAKE
=
"$$(QTDIR)/bin/qmake.exe"
}
...
...
@@ -540,19 +542,19 @@ TRANSLATIONS += es-MX.ts \
#
xbee
support
#
libxbee
only
supported
by
linux
and
windows
systems
win32
-
msvc2008
|
win32
-
msvc2010
|
linux
{
HEADERS
+=
src
/
comm
/
XbeeLinkInterface
.
h
\
src
/
comm
/
XbeeLink
.
h
\
src
/
comm
/
HexSpinBox
.
h
\
src
/
ui
/
XbeeConfigurationWindow
.
h
\
src
/
comm
/
CallConv
.
h
SOURCES
+=
src
/
comm
/
XbeeLink
.
cpp
\
src
/
comm
/
HexSpinBox
.
cpp
\
src
/
ui
/
XbeeConfigurationWindow
.
cpp
DEFINES
+=
XBEELINK
INCLUDEPATH
+=
thirdParty
/
libxbee
#
win32
-
msvc2008
|
win32
-
msvc2010
|
linux
{
#
HEADERS
+=
src
/
comm
/
XbeeLinkInterface
.
h
\
#
src
/
comm
/
XbeeLink
.
h
\
#
src
/
comm
/
HexSpinBox
.
h
\
#
src
/
ui
/
XbeeConfigurationWindow
.
h
\
#
src
/
comm
/
CallConv
.
h
#
SOURCES
+=
src
/
comm
/
XbeeLink
.
cpp
\
#
src
/
comm
/
HexSpinBox
.
cpp
\
#
src
/
ui
/
XbeeConfigurationWindow
.
cpp
#
DEFINES
+=
XBEELINK
#
INCLUDEPATH
+=
thirdParty
/
libxbee
#
TO
DO
:
build
library
when
it
does
not
exists
already
LIBS
+=
-
LthirdParty
/
libxbee
/
lib
\
-
llibxbee
}
#
LIBS
+=
-
LthirdParty
/
libxbee
/
lib
\
#
-
llibxbee
#
#
}
src/GAudioOutput.cc
View file @
d3ba1d38
...
...
@@ -119,9 +119,9 @@ GAudioOutput::GAudioOutput(QObject* parent) : QObject(parent),
}
#endif
// Initialize audio output
m_media
=
new
Phonon
::
MediaObject
(
this
);
Phonon
::
AudioOutput
*
audioOutput
=
new
Phonon
::
AudioOutput
(
Phonon
::
MusicCategory
,
this
);
createPath
(
m_media
,
audioOutput
);
//
m_media = new Phonon::MediaObject(this);
//
Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
//
createPath(m_media, audioOutput);
// Prepare regular emergency signal, will be fired off on calling startEmergency()
emergencyTimer
=
new
QTimer
();
...
...
@@ -228,8 +228,8 @@ void GAudioOutput::notifyPositive()
if
(
!
muted
)
{
// Use QFile to transform path for all OS
QFile
f
(
QCoreApplication
::
applicationDirPath
()
+
QString
(
"/audio/double_notify.wav"
));
m_media
->
setCurrentSource
(
Phonon
::
MediaSource
(
f
.
fileName
().
toStdString
().
c_str
()));
m_media
->
play
();
//
m_media->setCurrentSource(Phonon::MediaSource(f.fileName().toStdString().c_str()));
//
m_media->play();
}
}
...
...
@@ -238,8 +238,8 @@ void GAudioOutput::notifyNegative()
if
(
!
muted
)
{
// Use QFile to transform path for all OS
QFile
f
(
QCoreApplication
::
applicationDirPath
()
+
QString
(
"/audio/flat_notify.wav"
));
m_media
->
setCurrentSource
(
Phonon
::
MediaSource
(
f
.
fileName
().
toStdString
().
c_str
()));
m_media
->
play
();
//
m_media->setCurrentSource(Phonon::MediaSource(f.fileName().toStdString().c_str()));
//
m_media->play();
}
}
...
...
@@ -283,8 +283,8 @@ void GAudioOutput::beep()
// Use QFile to transform path for all OS
QFile
f
(
QCoreApplication
::
applicationDirPath
()
+
QString
(
"/audio/alert.wav"
));
qDebug
()
<<
"FILE:"
<<
f
.
fileName
();
m_media
->
setCurrentSource
(
Phonon
::
MediaSource
(
f
.
fileName
().
toStdString
().
c_str
()));
m_media
->
play
();
//
m_media->setCurrentSource(Phonon::MediaSource(f.fileName().toStdString().c_str()));
//
m_media->play();
}
}
...
...
src/comm/MAVLinkSimulationLink.cc
View file @
d3ba1d38
...
...
@@ -705,9 +705,9 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size)
}
break
;
// EXECUTE OPERATOR ACTIONS
case
MAVLINK_MSG_ID_COMMAND_
SHORT
:
{
mavlink_command_
short
_t
action
;
mavlink_msg_command_
short
_decode
(
&
msg
,
&
action
);
case
MAVLINK_MSG_ID_COMMAND_
LONG
:
{
mavlink_command_
long
_t
action
;
mavlink_msg_command_
long
_decode
(
&
msg
,
&
action
);
qDebug
()
<<
"SIM"
<<
"received action"
<<
action
.
command
<<
"for system"
<<
action
.
target_system
;
...
...
src/comm/MAVLinkSimulationLink.h
View file @
d3ba1d38
...
...
@@ -38,6 +38,7 @@ This file is part of the QGROUNDCONTROL project
#include <QQueue>
#include <QMutex>
#include <QMap>
#include <qmath.h>
#include <inttypes.h>
#include "QGCMAVLink.h"
...
...
src/comm/MAVLinkSimulationMAV.cc
View file @
d3ba1d38
...
...
@@ -303,12 +303,12 @@ void MAVLinkSimulationMAV::mainloop()
timer25Hz
--
;
}
static
unsigned
chan_counts
[
MAVLINK_COMM_NUM_BUFFERS
];
//
static unsigned chan_counts[MAVLINK_COMM_NUM_BUFFERS];
static
const
unsigned
message_lengths
[]
=
MAVLINK_MESSAGE_LENGTHS
;
static
unsigned
error_count
;
//
static unsigned error_count;
static
const
mavlink_message_info_t
message_info
[
256
]
=
MAVLINK_MESSAGE_INFO
;
mavlink_message_info_t
message_info
[
256
]
=
MAVLINK_MESSAGE_INFO
;
static
void
print_one_field
(
const
mavlink_message_t
*
msg
,
const
mavlink_field_info_t
*
f
,
int
idx
)
{
...
...
src/comm/MAVLinkSimulationWaypointPlanner.cc
View file @
d3ba1d38
...
...
@@ -815,10 +815,10 @@ void MAVLinkSimulationWaypointPlanner::mavlink_handler (const mavlink_message_t*
break
;
}
case
MAVLINK_MSG_ID_COMMAND_
SHORT
:
case
MAVLINK_MSG_ID_COMMAND_
LONG
:
{
// special action from ground station
mavlink_command_
short
_t
action
;
mavlink_msg_command_
short
_decode
(
msg
,
&
action
);
mavlink_command_
long
_t
action
;
mavlink_msg_command_
long
_decode
(
msg
,
&
action
);
if
(
action
.
target_system
==
systemid
)
{
if
(
verbose
)
qDebug
(
"Waypoint: received message with action %d
\n
"
,
action
.
command
);
// switch (action.action) {
...
...
src/comm/SerialLink.cc
View file @
d3ba1d38
...
...
@@ -211,8 +211,9 @@ using namespace TNX;
SerialLink
::
SerialLink
(
QString
portname
,
int
baudRate
,
bool
hardwareFlowControl
,
bool
parity
,
int
dataBits
,
int
stopBits
)
:
port
(
NULL
),
m_stopp
(
false
),
ports
(
new
QVector
<
QString
>
())
port
(
NULL
),
ports
(
new
QVector
<
QString
>
()),
m_stopp
(
false
)
{
// Setup settings
this
->
porthandle
=
portname
.
trimmed
();
...
...
src/libs/opmapcontrol/src/mapwidget/opmapwidget.cpp
View file @
d3ba1d38
...
...
@@ -33,7 +33,18 @@
namespace
mapcontrol
{
OPMapWidget
::
OPMapWidget
(
QWidget
*
parent
,
Configuration
*
config
)
:
QGraphicsView
(
parent
),
configuration
(
config
),
UAV
(
0
),
GPS
(
0
),
Home
(
0
),
followmouse
(
true
),
compass
(
0
),
showuav
(
false
),
showhome
(
false
),
showDiag
(
false
),
diagGraphItem
(
0
),
diagTimer
(
0
)
OPMapWidget
::
OPMapWidget
(
QWidget
*
parent
,
Configuration
*
config
)
:
QGraphicsView
(
parent
),
configuration
(
config
),
UAV
(
0
),
GPS
(
0
),
Home
(
0
),
followmouse
(
true
),
compass
(
0
),
showuav
(
false
),
showhome
(
false
),
diagTimer
(
0
),
showDiag
(
false
),
diagGraphItem
(
0
)
{
setSizePolicy
(
QSizePolicy
::
Preferred
,
QSizePolicy
::
Preferred
);
core
=
new
internals
::
Core
;
...
...
@@ -277,6 +288,7 @@ namespace mapcontrol
}
void
OPMapWidget
::
WPCreate
(
int
id
,
WayPointItem
*
item
)
{
Q_UNUSED
(
id
);
static
internals
::
PointLatLng
lastPos
;
ConnectWP
(
item
);
...
...
src/libs/opmapcontrol/src/mapwidget/waypointitem.cpp
View file @
d3ba1d38
...
...
@@ -29,14 +29,14 @@ namespace mapcontrol
{
WayPointItem
::
WayPointItem
(
const
internals
::
PointLatLng
&
coord
,
double
const
&
altitude
,
MapGraphicItem
*
map
)
:
map
(
map
),
autoreachedEnabled
(
true
),
coord
(
coord
),
reached
(
false
),
description
(
""
),
shownumber
(
true
),
isDragging
(
false
),
altitude
(
altitude
),
heading
(
0
),
autoreachedEnabled
(
true
)
heading
(
0
)
{
text
=
0
;
numberI
=
0
;
...
...
@@ -53,13 +53,13 @@ namespace mapcontrol
RefreshPos
();
}
WayPointItem
::
WayPointItem
(
const
internals
::
PointLatLng
&
coord
,
double
const
&
altitude
,
const
QString
&
description
,
MapGraphicItem
*
map
)
:
map
(
map
),
coord
(
coord
),
reached
(
false
),
description
(
description
),
shownumber
(
true
),
isDragging
(
false
),
altitude
(
altitude
),
map
(
map
),
heading
(
0
)
{
text
=
0
;
...
...
src/libs/utils/xmlconfig.cpp
View file @
d3ba1d38
...
...
@@ -63,7 +63,7 @@ bool XmlConfig::readXmlFile(QIODevice &device, QSettings::SettingsMap &map)
.
arg
(
errorLine
)
.
arg
(
errorColumn
)
.
arg
(
errorStr
);
qFatal
(
err
.
toLatin1
().
data
());
qFatal
(
"%s"
,
err
.
toLatin1
().
data
());
return
false
;
}
root
=
domDoc
.
documentElement
();
...
...
src/uas/UAS.cc
View file @
d3ba1d38
...
...
@@ -1459,6 +1459,7 @@ void UAS::writeParametersToStorage()
{
mavlink_message_t
msg
;
mavlink_msg_command_long_pack
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
&
msg
,
uasId
,
0
,
MAV_CMD_PREFLIGHT_STORAGE
,
1
,
1
,
-
1
,
-
1
,
-
1
,
0
,
0
,
0
);
qDebug
()
<<
"SENT COMMAND"
<<
MAV_CMD_PREFLIGHT_STORAGE
;
sendMessage
(
msg
);
}
...
...
@@ -1492,7 +1493,6 @@ void UAS::enableAllDataTransmission(int rate)
mavlink_msg_request_data_stream_encode
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
&
msg
,
&
stream
);
// Send message twice to increase chance of reception
sendMessage
(
msg
);
sendMessage
(
msg
);
}
void
UAS
::
enableRawSensorDataTransmission
(
int
rate
)
...
...
@@ -1514,7 +1514,6 @@ void UAS::enableRawSensorDataTransmission(int rate)
mavlink_msg_request_data_stream_encode
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
&
msg
,
&
stream
);
// Send message twice to increase chance of reception
sendMessage
(
msg
);
sendMessage
(
msg
);
}
void
UAS
::
enableExtendedSystemStatusTransmission
(
int
rate
)
...
...
@@ -1536,7 +1535,6 @@ void UAS::enableExtendedSystemStatusTransmission(int rate)
mavlink_msg_request_data_stream_encode
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
&
msg
,
&
stream
);
// Send message twice to increase chance of reception
sendMessage
(
msg
);
sendMessage
(
msg
);
}
void
UAS
::
enableRCChannelDataTransmission
(
int
rate
)
...
...
@@ -1562,7 +1560,6 @@ void UAS::enableRCChannelDataTransmission(int rate)
mavlink_msg_request_data_stream_encode
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
&
msg
,
&
stream
);
// Send message twice to increase chance of reception
sendMessage
(
msg
);
sendMessage
(
msg
);
#endif
}
...
...
@@ -1585,7 +1582,6 @@ void UAS::enableRawControllerDataTransmission(int rate)
mavlink_msg_request_data_stream_encode
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
&
msg
,
&
stream
);
// Send message twice to increase chance of reception
sendMessage
(
msg
);
sendMessage
(
msg
);
}
//void UAS::enableRawSensorFusionTransmission(int rate)
...
...
@@ -1629,7 +1625,6 @@ void UAS::enablePositionTransmission(int rate)
mavlink_msg_request_data_stream_encode
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
&
msg
,
&
stream
);
// Send message twice to increase chance of reception
sendMessage
(
msg
);
sendMessage
(
msg
);
}
void
UAS
::
enableExtra1Transmission
(
int
rate
)
...
...
@@ -2122,7 +2117,7 @@ void UAS::shutdown()
{
// If the active UAS is set, execute command
mavlink_message_t
msg
;
mavlink_msg_command_long_pack
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
&
msg
,
uasId
,
MAV_COMP_ID_ALL
,
MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN
,
0
,
2
,
0
,
0
,
0
,
0
,
0
,
0
);
mavlink_msg_command_long_pack
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
&
msg
,
uasId
,
MAV_COMP_ID_ALL
,
MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN
,
1
,
0
,
2
,
0
,
0
,
0
,
0
,
0
);
sendMessage
(
msg
);
result
=
true
;
}
...
...
@@ -2165,33 +2160,34 @@ QString UAS::getShortModeTextFor(int id)
qDebug
()
<<
"MODE:"
<<
modeid
;
// BASE MODE DECODING
if
(
modeid
&
MAV_MODE_FLAG_DECODE_POSITION_AUTO
)
if
(
modeid
&
(
uint8_t
)
MAV_MODE_FLAG_DECODE_POSITION_AUTO
)
{
mode
=
"AUTO"
;
mode
+
=
"AUTO"
;
}
else
if
(
modeid
&
MAV_MODE_FLAG_DECODE_POSITION_GUIDED
)
if
(
modeid
&
(
uint8_t
)
MAV_MODE_FLAG_DECODE_POSITION_GUIDED
)
{
mode
=
"GUIDED"
;
mode
+
=
"GUIDED"
;
}
else
if
(
modeid
&
MAV_MODE_FLAG_DECODE_POSITION_STABILIZE
)
if
(
modeid
&
(
uint8_t
)
MAV_MODE_FLAG_DECODE_POSITION_STABILIZE
)
{
mode
=
"STABILIZED"
;
mode
+
=
"STABILIZED"
;
}
else
if
(
modeid
&
MAV_MODE_FLAG_DECODE_POSITION_TEST
)
if
(
modeid
&
(
uint8_t
)
MAV_MODE_FLAG_DECODE_POSITION_TEST
)
{
mode
=
"TEST"
;
mode
+
=
"TEST"
;
}
else
if
(
modeid
&
MAV_MODE_FLAG_DECODE_POSITION_MANUAL
)
if
(
modeid
&
(
uint8_t
)
MAV_MODE_FLAG_DECODE_POSITION_MANUAL
)
{
mode
=
"MANUAL"
;
mode
+
=
"MANUAL"
;
}
else
if
(
modeid
==
0
)
{
mode
=
"PREFLIGHT"
;
}
// ARMED STATE DECODING
if
(
modeid
&
MAV_MODE_FLAG_DECODE_POSITION_SAFETY
)
if
(
modeid
&
(
uint8_t
)
MAV_MODE_FLAG_DECODE_POSITION_SAFETY
)
{
mode
.
prepend
(
"A|"
);
}
...
...
@@ -2201,7 +2197,7 @@ QString UAS::getShortModeTextFor(int id)
}
// HARDWARE IN THE LOOP DECODING
if
(
modeid
&
MAV_MODE_FLAG_DECODE_POSITION_HIL
)
if
(
modeid
&
(
uint8_t
)
MAV_MODE_FLAG_DECODE_POSITION_HIL
)
{
mode
.
prepend
(
"HIL:"
);
}
...
...
src/uas/UASWaypointManager.cc
View file @
d3ba1d38
...
...
@@ -45,8 +45,8 @@ UASWaypointManager::UASWaypointManager(UAS* _uas)
current_state
(
WP_IDLE
),
current_partner_systemid
(
0
),
current_partner_compid
(
0
),
protocol_timer
(
this
),
currentWaypointEditable
(
NULL
)
currentWaypointEditable
(
NULL
),
protocol_timer
(
this
)
{
if
(
uas
)
{
...
...
@@ -112,7 +112,14 @@ void UASWaypointManager::handleLocalPositionChanged(UASInterface* mav, double x,
void
UASWaypointManager
::
handleGlobalPositionChanged
(
UASInterface
*
mav
,
double
lat
,
double
lon
,
double
alt
,
quint64
time
)
{
Q_UNUSED
(
mav
);
Q_UNUSED
(
time
);
if
(
waypointsEditable
.
count
()
>
0
&&
currentWaypointEditable
&&
(
currentWaypointEditable
->
getFrame
()
==
MAV_FRAME_GLOBAL
||
currentWaypointEditable
->
getFrame
()
==
MAV_FRAME_GLOBAL_RELATIVE_ALT
))
{
// TODO FIXME Calculate distance
double
dist
=
0
;
emit
waypointDistanceChanged
(
dist
);
}
}
void
UASWaypointManager
::
handleWaypointCount
(
quint8
systemId
,
quint8
compId
,
quint16
count
)
...
...
@@ -240,6 +247,7 @@ void UASWaypointManager::handleWaypointReached(quint8 systemId, quint8 compId, m
void
UASWaypointManager
::
handleWaypointCurrent
(
quint8
systemId
,
quint8
compId
,
mavlink_mission_current_t
*
wpc
)
{
Q_UNUSED
(
compId
);
if
(
!
uas
)
return
;
if
(
systemId
==
uasid
)
{
// FIXME Petri
...
...
src/ui/HDDisplay.cc
View file @
d3ba1d38
...
...
@@ -216,7 +216,7 @@ void HDDisplay::saveState()
// Restore instrument settings
for
(
int
i
=
0
;
i
<
acceptList
->
count
();
i
++
)
{
QString
key
=
acceptList
->
at
(
i
);
instruments
+=
"|"
+
QString
::
number
(
minValues
.
value
(
key
,
-
1.0
))
+
","
+
key
+
","
+
acceptUnitList
->
at
(
i
)
+
","
+
QString
::
number
(
maxValues
.
value
(
key
,
+
1.0
))
+
","
+
((
symmetric
.
value
(
key
,
false
))
?
"s"
:
""
);
instruments
+=
"|"
+
QString
::
number
(
minValues
.
value
(
key
,
-
1.0
))
+
","
+
key
+
","
+
acceptUnitList
->
at
(
i
)
+
","
+
QString
::
number
(
maxValues
.
value
(
key
,
+
1.0
))
+
","
+
customNames
.
value
(
key
,
""
)
+
","
+
((
symmetric
.
value
(
key
,
false
))
?
"s"
:
""
);
}
// qDebug() << "Saving" << instruments;
...
...
@@ -271,16 +271,23 @@ void HDDisplay::addGauge()
QStringList
items
;
for
(
int
i
=
0
;
i
<
values
.
count
();
++
i
)
{
QString
key
=
values
.
keys
().
at
(
i
);
QString
label
=
key
;
QStringList
keySplit
=
key
.
split
(
"."
);
if
(
keySplit
.
size
()
>
1
)
{
keySplit
.
removeFirst
();
label
=
keySplit
.
join
(
"."
);
}
QString
unit
=
units
.
value
(
key
);
if
(
unit
.
contains
(
"deg"
)
||
unit
.
contains
(
"rad"
))
{
items
.
append
(
QString
(
"%1,%2,%3,%4,
s"
).
arg
(
"-180"
).
arg
(
key
).
arg
(
unit
).
arg
(
"+180"
));
items
.
append
(
QString
(
"%1,%2,%3,%4,
%5,s"
).
arg
(
"-180"
).
arg
(
key
).
arg
(
unit
).
arg
(
"+180"
).
arg
(
label
));
}
else
{
items
.
append
(
QString
(
"%1,%2,%3,%4
"
).
arg
(
"0"
).
arg
(
key
).
arg
(
unit
).
arg
(
"+100"
));
items
.
append
(
QString
(
"%1,%2,%3,%4
,%5"
).
arg
(
"0"
).
arg
(
key
).
arg
(
unit
).
arg
(
"+100"
).
arg
(
label
));
}
}
bool
ok
;
QString
item
=
QInputDialog
::
getItem
(
this
,
tr
(
"Add Gauge Instrument"
),
tr
(
"Format: min,
curve name, unit, max
[,s]"
),
items
,
0
,
true
,
&
ok
);
tr
(
"Format: min,
data name, unit, max, label
[,s]"
),
items
,
0
,
true
,
&
ok
);
if
(
ok
&&
!
item
.
isEmpty
())
{
addGauge
(
item
);
}
...
...
@@ -307,9 +314,19 @@ void HDDisplay::addGauge(const QString& gauge)
val
=
parts
.
at
(
3
).
toDouble
(
&
ok
);
success
&=
ok
;
if
(
ok
)
maxValues
.
insert
(
key
,
val
);
// Convert name
if
(
parts
.
length
()
>=
5
)
{
if
(
parts
.
at
(
4
).
length
()
>
0
)
{
customNames
.
insert
(
key
,
parts
.
at
(
4
));
}
}
// Convert symmetric flag
if
(
parts
.
length
()
>=
5
)
{
if
(
parts
.
at
(
4
).
contains
(
"s"
))
{
if
(
parts
.
length
()
>=
6
)
{
if
(
parts
.
at
(
5
).
contains
(
"s"
))
{
symmetric
.
insert
(
key
,
true
);
}
}
...
...
@@ -425,12 +442,15 @@ void HDDisplay::renderOverlay()
float
topSpacing
=
leftSpacing
;
float
yCoord
=
topSpacing
+
gaugeWidth
/
2.0
f
;
for
(
int
i
=
0
;
i
<
acceptList
->
size
();
++
i
)
{
for
(
int
i
=
0
;
i
<
acceptList
->
size
();
++
i
)
{
QString
value
=
acceptList
->
at
(
i
);
drawGauge
(
xCoord
,
yCoord
,
gaugeWidth
/
2.0
f
,
minValues
.
value
(
value
,
-
1.0
f
),
maxValues
.
value
(
value
,
1.0
f
),
value
,
values
.
value
(
value
,
minValues
.
value
(
value
,
0.0
f
)),
gaugeColor
,
&
painter
,
symmetric
.
value
(
value
,
false
),
goodRanges
.
value
(
value
,
qMakePair
(
0.0
f
,
0.5
f
)),
critRanges
.
value
(
value
,
qMakePair
(
0.7
f
,
1.0
f
)),
true
);
QString
label
=
customNames
.
value
(
value
);
drawGauge
(
xCoord
,
yCoord
,
gaugeWidth
/
2.0
f
,
minValues
.
value
(
value
,
-
1.0
f
),
maxValues
.
value
(
value
,
1.0
f
),
label
,
values
.
value
(
value
,
minValues
.
value
(
value
,
0.0
f
)),
gaugeColor
,
&
painter
,
symmetric
.
value
(
value
,
false
),
goodRanges
.
value
(
value
,
qMakePair
(
0.0
f
,
0.5
f
)),
critRanges
.
value
(
value
,
qMakePair
(
0.7
f
,
1.0
f
)),
true
);
xCoord
+=
gaugeWidth
+
leftSpacing
;
// Move one row down if necessary
if
(
xCoord
+
gaugeWidth
*
0.9
f
>
vwidth
)
{
if
(
xCoord
+
gaugeWidth
*
0.9
f
>
vwidth
)
{
yCoord
+=
topSpacing
+
gaugeWidth
;
xCoord
=
leftSpacing
+
gaugeWidth
/
2.0
f
;
}
...
...
@@ -807,12 +827,45 @@ float HDDisplay::refLineWidthToPen(float line)
return
line
*
2.50
f
;
}
void
HDDisplay
::
addSource
(
QObject
*
obj
)
{
//genericSources.append(obj);
// FIXME XXX HACK
// if (plots.size() > 0)
// {
// Connect generic source
connect
(
obj
,
SIGNAL
(
valueChanged
(
int
,
QString
,
QString
,
int
,
quint64
)),
this
,
SLOT
(
updateValue
(
int
,
QString
,
QString
,
int
,
quint64
)));
connect
(
obj
,
SIGNAL
(
valueChanged
(
int
,
QString
,
QString
,
unsigned
int
,
quint64
)),
this
,
SLOT
(
updateValue
(
int
,
QString
,
QString
,
unsigned
int
,
quint64
)));
connect
(
obj
,
SIGNAL
(
valueChanged
(
int
,
QString
,
QString
,
quint64
,
quint64
)),
this
,
SLOT
(
updateValue
(
int
,
QString
,
QString
,
quint64
,
quint64
)));
connect
(
obj
,
SIGNAL
(
valueChanged
(
int
,
QString
,
QString
,
qint64
,
quint64
)),
this
,
SLOT
(
updateValue
(
int
,
QString
,
QString
,
qint64
,
quint64
)));
connect
(
obj
,
SIGNAL
(
valueChanged
(
int
,
QString
,
QString
,
double
,
quint64
)),
this
,
SLOT
(
updateValue
(
int
,
QString
,
QString
,
double
,
quint64
)));
// }
}
void
HDDisplay
::
updateValue
(
const
int
uasId
,
const
QString
&
name
,
const
QString
&
unit
,
const
int
value
,
const
quint64
msec
)
{
if
(
!
intValues
.
contains
(
name
))
intValues
.
insert
(
name
,
true
);
updateValue
(
uasId
,
name
,
unit
,
(
double
)
value
,
msec
);
}
void
HDDisplay
::
updateValue
(
const
int
uasId
,
const
QString
&
name
,
const
QString
&
unit
,
const
unsigned
int
value
,
const
quint64
msec
)
{
if
(
!
intValues
.
contains
(
name
))
intValues
.
insert
(
name
,
true
);
updateValue
(
uasId
,
name
,
unit
,
(
double
)
value
,
msec
);
}
void
HDDisplay
::
updateValue
(
const
int
uasId
,
const
QString
&
name
,
const
QString
&
unit
,
const
qint64
value
,
const
quint64
msec
)
{
if
(
!
intValues
.
contains
(
name
))
intValues
.
insert
(
name
,
true
);
updateValue
(
uasId
,
name
,
unit
,
(
double
)
value
,
msec
);
}
void
HDDisplay
::
updateValue
(
const
int
uasId
,
const
QString
&
name
,
const
QString
&
unit
,
const
quint64
value
,
const
quint64
msec
)
{
if
(
!
intValues
.
contains
(
name
))
intValues
.
insert
(
name
,
true
);
updateValue
(
uasId
,
name
,
unit
,
(
double
)
value
,
msec
);
}
void
HDDisplay
::
updateValue
(
const
int
uasId
,
const
QString
&
name
,
const
QString
&
unit
,
const
double
value
,
const
quint64
msec
)
{
Q_UNUSED
(
uasId
);
...
...
src/ui/HDDisplay.h
View file @
d3ba1d38
...
...
@@ -68,7 +68,14 @@ public slots:
void
updateValue
(
const
int
uasId
,
const
QString
&
name
,
const
QString
&
unit
,
const
double
value
,
const
quint64
msec
);
/** @brief Update a HDD integer value */
void
updateValue
(
const
int
uasId
,
const
QString
&
name
,
const
QString
&
unit
,
const
int
value
,
const
quint64
msec
);
/** @brief Update a HDD integer value */
void
updateValue
(
const
int
uasId
,
const
QString
&
name
,
const
QString
&
unit
,
const
unsigned
int
value
,
const
quint64
msec
);
/** @brief Update a HDD integer value */
void
updateValue
(
const
int
uasId
,
const
QString
&
name
,
const
QString
&
unit
,
const
qint64
value
,
const
quint64
msec
);
/** @brief Update a HDD integer value */
void
updateValue
(
const
int
uasId
,
const
QString
&
name
,
const
QString
&
unit
,
const
quint64
value
,
const
quint64
msec
);
virtual
void
setActiveUAS
(
UASInterface
*
uas
);
void
addSource
(
QObject
*
obj
);
/** @brief Removes a plot item by the action data */
void
removeItemByAction
();
...
...
@@ -149,6 +156,7 @@ protected:
QMap
<
QString
,
float
>
maxValues
;
///< The maximum value this variable is assumed to have
QMap
<
QString
,
bool
>
symmetric
;
///< Draw the gauge / dial symmetric bool = yes
QMap
<
QString
,
bool
>
intValues
;
///< Is the gauge value an integer?
QMap
<
QString
,
QString
>
customNames
;
///< Custom names for the data names
QMap
<
QString
,
QPair
<
float
,
float
>
>
goodRanges
;
///< The range of good values
QMap
<
QString
,
QPair
<
float
,
float
>
>
critRanges
;
///< The range of critical values
double
scalingFactor
;
///< Factor used to scale all absolute values to screen coordinates
...
...
src/ui/HSIDisplay.cc
View file @
d3ba1d38
...
...
@@ -99,12 +99,13 @@ HSIDisplay::HSIDisplay(QWidget *parent) :
laserFix
(
0
),
mavInitialized
(
false
),
bottomMargin
(
10.0
f
),
topMargin
(
12.0
f
),
userSetPointSet
(
false
),
dragStarted
(
false
),
topMargin
(
12.0
f
),
leftDragStarted
(
false
),
mouseHasMoved
(
false
),
actionPending
(
false
)
actionPending
(
false
),
userSetPointSet
(
false
),
userXYSetPointSet
(
false
)
{
refreshTimer
->
setInterval
(
updateInterval
);
...
...
src/ui/MAVLinkDecoder.cc
View file @
d3ba1d38
...
...
@@ -12,7 +12,6 @@ MAVLinkDecoder::MAVLinkDecoder(MAVLinkProtocol* protocol, QObject *parent) :
messageFilter
.
insert
(
MAVLINK_MSG_ID_HEARTBEAT
,
false
);
messageFilter
.
insert
(
MAVLINK_MSG_ID_SYS_STATUS
,
false
);
messageFilter
.
insert
(
MAVLINK_MSG_ID_STATUSTEXT
,
false
);
messageFilter
.
insert
(
MAVLINK_MSG_ID_COMMAND_SHORT
,
false
);
messageFilter
.
insert
(
MAVLINK_MSG_ID_COMMAND_LONG
,
false
);
messageFilter
.
insert
(
MAVLINK_MSG_ID_COMMAND_ACK
,
false
);
messageFilter
.
insert
(
MAVLINK_MSG_ID_PARAM_SET
,
false
);
...
...
src/ui/MainWindow.cc
View file @
d3ba1d38
...
...
@@ -88,12 +88,12 @@ MainWindow* MainWindow::instance(QSplashScreen* screen)
MainWindow
::
MainWindow
(
QWidget
*
parent
)
:
QMainWindow
(
parent
),
currentView
(
VIEW_UNCONNECTED
),
currentStyle
(
QGC_MAINWINDOW_STYLE_INDOOR
),
aboutToCloseFlag
(
false
),
changingViewsFlag
(
false
),
centerStackActionGroup
(
this
),
styleFileName
(
QCoreApplication
::
applicationDirPath
()
+
"/style-indoor.css"
),
autoReconnect
(
false
),
currentStyle
(
QGC_MAINWINDOW_STYLE_INDOOR
),
centerStackActionGroup
(
this
),
lowPowerMode
(
false
)
{
hide
();
...
...
@@ -427,14 +427,18 @@ void MainWindow::buildCommonWidgets()
if
(
!
headDown1DockWidget
)
{
headDown1DockWidget
=
new
QDockWidget
(
tr
(
"Flight Display"
),
this
);
headDown1DockWidget
->
setWidget
(
new
HDDisplay
(
acceptList
,
"Flight Display"
,
this
)
);
HDDisplay
*
hdDisplay
=
new
HDDisplay
(
acceptList
,
"Flight Display"
,
this
);
hdDisplay
->
addSource
(
mavlinkDecoder
);
headDown1DockWidget
->
setWidget
(
hdDisplay
);
headDown1DockWidget
->
setObjectName
(
"HEAD_DOWN_DISPLAY_1_DOCK_WIDGET"
);
addTool
(
headDown1DockWidget
,
tr
(
"Flight Display"
),
Qt
::
RightDockWidgetArea
);
}
if
(
!
headDown2DockWidget
)
{
headDown2DockWidget
=
new
QDockWidget
(
tr
(
"Actuator Status"
),
this
);
headDown2DockWidget
->
setWidget
(
new
HDDisplay
(
acceptList2
,
"Actuator Status"
,
this
)
);
HDDisplay
*
hdDisplay
=
new
HDDisplay
(
acceptList2
,
"Actuator Status"
,
this
);
hdDisplay
->
addSource
(
mavlinkDecoder
);
headDown2DockWidget
->
setWidget
(
hdDisplay
);
headDown2DockWidget
->
setObjectName
(
"HEAD_DOWN_DISPLAY_2_DOCK_WIDGET"
);
addTool
(
headDown2DockWidget
,
tr
(
"Actuator Status"
),
Qt
::
RightDockWidgetArea
);
}
...
...
@@ -1603,4 +1607,4 @@ void MainWindow::arrangeSenseSoarCenterStack()
void MainWindow::connectSenseSoarActions()
{
}
*/
\ No newline at end of file
*/
src/ui/MainWindow.h
View file @
d3ba1d38
...
...
@@ -279,6 +279,7 @@ protected:
/** @brief Keeps track of the current view */
VIEW_SECTIONS
currentView
;
QGC_MAINWINDOW_STYLE
currentStyle
;
bool
aboutToCloseFlag
;
bool
changingViewsFlag
;
...
...
@@ -372,7 +373,6 @@ protected:
QTimer
*
videoTimer
;
QString
styleFileName
;
bool
autoReconnect
;
QGC_MAINWINDOW_STYLE
currentStyle
;
Qt
::
WindowStates
windowStateVal
;
bool
lowPowerMode
;
///< If enabled, QGC reduces the update rates of all widgets
QGCFlightGearLink
*
fgLink
;
...
...
src/ui/QGCParamWidget.cc
View file @
d3ba1d38
...
...
@@ -707,15 +707,15 @@ void QGCParamWidget::saveParameters()
{
case
QVariant
:
:
Int
:
paramValue
=
paramValue
.
arg
(
j
.
value
().
toInt
());
paramType
.
arg
(
MAVLINK_TYPE_INT32_T
);
paramType
=
paramType
.
arg
(
MAVLINK_TYPE_INT32_T
);
break
;
case
QVariant
:
:
UInt
:
paramValue
=
paramValue
.
arg
(
j
.
value
().
toUInt
());
paramType
.
arg
(
MAVLINK_TYPE_UINT32_T
);
paramType
=
paramType
.
arg
(
MAVLINK_TYPE_UINT32_T
);
break
;
case
QMetaType
:
:
Float
:
paramValue
=
paramValue
.
arg
(
j
.
value
().
toDouble
(),
25
,
'g'
,
12
);
paramType
.
arg
(
MAVLINK_TYPE_FLOAT
);
paramType
=
paramType
.
arg
(
MAVLINK_TYPE_FLOAT
);
break
;
default:
qCritical
()
<<
"ABORTED PARAM WRITE TO FILE, NO VALID QVARIANT TYPE"
<<
j
.
value
();
...
...
src/ui/uas/UASControlWidget.cc
View file @
d3ba1d38
...
...
@@ -50,12 +50,12 @@ UASControlWidget::UASControlWidget(QWidget *parent) : QWidget(parent),
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
setUAS
(
UASInterface
*
)));
ui
.
modeComboBox
->
clear
();
ui
.
modeComboBox
->
insertItem
(
MAV_MODE_PREFLIGHT
,
UAS
::
getShortModeTextFor
(
MAV_MODE_PREFLIGHT
)
);
ui
.
modeComboBox
->
insertItem
(
MAV_MODE_STABILIZE_ARMED
,
UAS
::
getShortModeTextFor
(
MAV_MODE_STABILIZE_ARM
ED
));
ui
.
modeComboBox
->
insertItem
(
MAV_MODE_MANUAL_ARMED
,
UAS
::
getShortModeTextFor
(
MAV_MODE_MANUAL_ARMED
)
);
ui
.
modeComboBox
->
insertItem
(
MAV_MODE_GUIDED_DISARMED
,
UAS
::
getShortModeTextFor
(
MAV_MODE_GUIDED_ARM
ED
));
ui
.
modeComboBox
->
insertItem
(
MAV_MODE_AUTO_ARMED
,
UAS
::
getShortModeTextFor
(
MAV_MODE_AUTO_ARM
ED
));
ui
.
modeComboBox
->
insertItem
(
MAV_MODE_TEST_ARMED
,
UAS
::
getShortModeTextFor
(
MAV_MODE_TEST_ARM
ED
));
ui
.
modeComboBox
->
insertItem
(
0
,
UAS
::
getShortModeTextFor
(
MAV_MODE_PREFLIGHT
),
MAV_MODE_PREFLIGHT
);
ui
.
modeComboBox
->
insertItem
(
1
,
UAS
::
getShortModeTextFor
((
MAV_MODE_FLAG_STABILIZE_ENABLED
|
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
)),
(
MAV_MODE_FLAG_STABILIZE_ENABLED
|
MAV_MODE_FLAG_MANUAL_INPUT_ENABL
ED
));
ui
.
modeComboBox
->
insertItem
(
2
,
UAS
::
getShortModeTextFor
(
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
),
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
);
ui
.
modeComboBox
->
insertItem
(
3
,
UAS
::
getShortModeTextFor
((
MAV_MODE_FLAG_STABILIZE_ENABLED
|
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
|
MAV_MODE_FLAG_GUIDED_ENABLED
)),
(
MAV_MODE_FLAG_STABILIZE_ENABLED
|
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
|
MAV_MODE_FLAG_GUIDED_ENABL
ED
));
ui
.
modeComboBox
->
insertItem
(
4
,
UAS
::
getShortModeTextFor
((
MAV_MODE_FLAG_STABILIZE_ENABLED
|
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
|
MAV_MODE_FLAG_GUIDED_ENABLED
|
MAV_MODE_FLAG_AUTO_ENABLED
)),
(
MAV_MODE_FLAG_STABILIZE_ENABLED
|
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
|
MAV_MODE_FLAG_GUIDED_ENABLED
|
MAV_MODE_FLAG_AUTO_ENABL
ED
));
ui
.
modeComboBox
->
insertItem
(
5
,
UAS
::
getShortModeTextFor
((
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
|
MAV_MODE_FLAG_TEST_ENABLED
)),
(
MAV_MODE_FLAG_MANUAL_INPUT_ENABLED
|
MAV_MODE_FLAG_TEST_ENABL
ED
));
connect
(
ui
.
modeComboBox
,
SIGNAL
(
activated
(
int
)),
this
,
SLOT
(
setMode
(
int
)));
connect
(
ui
.
setModeButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
transmitMode
()));
...
...
@@ -157,7 +157,7 @@ void UASControlWidget::updateState(int state)
void
UASControlWidget
::
setMode
(
int
mode
)
{
// Adapt context button mode
uasMode
=
mode
;
uasMode
=
ui
.
modeComboBox
->
itemData
(
mode
).
toInt
()
;
ui
.
modeComboBox
->
blockSignals
(
true
);
ui
.
modeComboBox
->
setCurrentIndex
(
mode
);
ui
.
modeComboBox
->
blockSignals
(
false
);
...
...
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