Browse Source

Merging

QGC4.4
pixhawk 15 years ago
parent
commit
6a455039a8
  1. 3
      images/earth.html
  2. 794
      qgroundcontrol.pri
  3. 2
      src/Core.cc
  4. 28
      src/comm/LinkManager.cc
  5. 2
      src/comm/LinkManager.h
  6. 6
      src/comm/MAVLinkProtocol.cc
  7. 6
      src/comm/MAVLinkSimulationLink.cc
  8. 74
      src/comm/SerialLink.cc
  9. 36
      src/uas/SlugsMAV.cc
  10. 3
      src/uas/SlugsMAV.h
  11. 45
      src/uas/UAS.cc
  12. 26
      src/uas/UAS.h
  13. 5
      src/uas/UASInterface.h
  14. 10
      src/uas/UASManager.cc
  15. 3
      src/uas/UASManager.h
  16. 22
      src/ui/CommConfigurationWindow.cc
  17. 9
      src/ui/CommConfigurationWindow.h
  18. 25
      src/ui/CommSettings.ui
  19. 1679
      src/ui/MainWindow.cc
  20. 226
      src/ui/MainWindow.h
  21. 170
      src/ui/MainWindow.ui
  22. 1
      src/ui/MapWidget.cc
  23. 9
      src/ui/ParameterInterface.cc
  24. 4
      src/ui/QGCRemoteControlView.cc
  25. 9
      src/ui/SerialConfigurationWindow.cc
  26. 6
      src/ui/SerialConfigurationWindow.h
  27. 95
      src/ui/SlugsDataSensorView.cc
  28. 50
      src/ui/SlugsDataSensorView.h
  29. 23
      src/ui/SlugsDataSensorView.ui
  30. 8
      src/ui/SlugsPIDControl.cpp
  31. 4
      src/ui/SlugsPIDControl.h
  32. 14
      src/ui/SlugsPIDControl.ui
  33. 64
      src/ui/SlugsPadCameraControl.cpp
  34. 9
      src/ui/SlugsPadCameraControl.h
  35. 83
      src/ui/SlugsVideoCamControl.cpp
  36. 41
      src/ui/SlugsVideoCamControl.h
  37. 6
      src/ui/WaypointList.cc
  38. 1
      src/ui/WaypointView.cc
  39. 2
      src/ui/linechart/LinechartPlot.cc
  40. 13
      src/ui/linechart/Linecharts.cc
  41. 3
      src/ui/map3D/GCManipulator.cc
  42. 5
      src/ui/map3D/QMap3D.cc

3
images/earth.html

@ -1,8 +1,9 @@ @@ -1,8 +1,9 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<html>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<!-- <head> -->
<!-- QGroundControl -->
<title>QGroundControl Google Earth View</title>
<!-- *** Replace the key below below with your own API key, available at http://code.google.com/apis/maps/signup.html *** -->

794
qgroundcontrol.pri

@ -1,399 +1,395 @@ @@ -1,399 +1,395 @@
#-------------------------------------------------
#
# QGroundControl - Micro Air Vehicle Groundstation
#
# Please see our website at <http://qgroundcontrol.org>
#
# Author:
# Lorenz Meier <mavteam@student.ethz.ch>
#
# (c) 2009-2010 PIXHAWK Team
#
# This file is part of the mav groundstation project
# QGroundControl is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# QGroundControl is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with QGroundControl. If not, see <http://www.gnu.org/licenses/>.
#
#-------------------------------------------------
#$$BASEDIR/lib/qextserialport/include
# $$BASEDIR/lib/openjaus/libjaus/include \
# $$BASEDIR/lib/openjaus/libopenJaus/include
message(Qt version $$[QT_VERSION])
release {
# DEFINES += QT_NO_DEBUG_OUTPUT
# DEFINES += QT_NO_WARNING_OUTPUT
}
QMAKE_POST_LINK += echo "Copying files"
#QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/debug/.
#QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/release/.
# MAC OS X
macx {
COMPILER_VERSION = system(gcc -v)
message(Using compiler $$COMPILER_VERSION)
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 ) {
# x86 Mac OS X Leopard 10.5 and earlier
CONFIG += x86 cocoa phonon
message(Building for Mac OS X 32bit/Leopard 10.5 and earlier)
# Enable function-profiling with the OS X saturn tool
debug {
#QMAKE_CXXFLAGS += -finstrument-functions
#LIBS += -lSaturn
}
} else {
# x64 Mac OS X Snow Leopard 10.6 and later
CONFIG += x86_64 cocoa
CONFIG -= x86 phonon
message(Building for Mac OS X 64bit/Snow Leopard 10.6 and later)
}
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5
#DESTDIR = $$BASEDIR/bin/mac
INCLUDEPATH += -framework SDL
LIBS += -framework IOKit \
-framework SDL \
-framework CoreFoundation \
-framework ApplicationServices \
-lm
ICON = $$BASEDIR/images/icons/macx.icns
# Copy audio files if needed
QMAKE_POST_LINK += && cp -rf $$BASEDIR/audio $$TARGETDIR/qgroundcontrol.app/Contents/MacOs
# Copy google earth starter file
QMAKE_POST_LINK += && cp -f $$BASEDIR/images/earth.html $$TARGETDIR/qgroundcontrol.app/Contents/MacOs
# Copy CSS stylesheet
QMAKE_POST_LINK += && cp -f $$BASEDIR/images/style-mission.css $$TARGETDIR/qgroundcontrol.app/Contents/MacOs/qgroundcontrol.css
# Copy model files
#QMAKE_POST_LINK += && cp -f $$BASEDIR/models/*.dae $$TARGETDIR/qgroundcontrol.app/Contents/MacOs
exists(/Library/Frameworks/osg.framework):exists(/Library/Frameworks/OpenThreads.framework) {
# No check for GLUT.framework since it's a MAC default
message("Building support for OpenSceneGraph")
DEPENDENCIES_PRESENT += osg
DEFINES += QGC_OSG_ENABLED
# Include OpenSceneGraph libraries
INCLUDEPATH += -framework GLUT \
-framework Carbon \
-framework OpenThreads \
-framework osg \
-framework osgViewer \
-framework osgGA \
-framework osgDB \
-framework osgText \
-framework osgWidget
LIBS += -framework GLUT \
-framework Carbon \
-framework OpenThreads \
-framework osg \
-framework osgViewer \
-framework osgGA \
-framework osgDB \
-framework osgText \
-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) {
message("ENABLED support for libfreenect")
DEPENDENCIES_PRESENT += libfreenect
# Include libfreenect libraries
LIBS += -lfreenect
DEFINES += QGC_LIBFREENECT_ENABLED
} else {
message("DISABLED libfreenect support")
}
# osg/osgEarth dynamic casts might fail without this compiler option.
# see http://osgearth.org/wiki/FAQ for details.
#QMAKE_CXXFLAGS += -Wl,-E
}
# GNU/Linux
linux-g++ {
debug {
DESTDIR = $$TARGETDIR/debug
CONFIG += debug
}
release {
DESTDIR = $$TARGETDIR/release
}
QMAKE_POST_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
INCLUDEPATH += /usr/include \
/usr/include/qt4/phonon
# $$BASEDIR/lib/flite/include \
# $$BASEDIR/lib/flite/lang
message(Building for GNU/Linux 32bit/i386)
LIBS += \
-L/usr/lib \
-lm \
-lflite_cmu_us_kal \
-lflite_usenglish \
-lflite_cmulex \
-lflite \
-lSDL \
-lSDLmain
exists(/usr/include/osg) {
message("Building support for OpenSceneGraph")
DEPENDENCIES_PRESENT += osg
# Include OpenSceneGraph libraries
LIBS += -losg \
-losgViewer
DEFINES += QGC_OSG_ENABLED
}
exists(/usr/include/osgEarth) | exists(/usr/local/include/osgEarth) {
message("Building support for osgEarth")
DEPENDENCIES_PRESENT += osgearth
# Include osgEarth libraries
LIBS += -losgEarth \
-losgEarthUtil
DEFINES += QGC_OSGEARTH_ENABLED
}
exists(/usr/local/include/libfreenect/libfreenect.h) {
message("Building support for libfreenect")
DEPENDENCIES_PRESENT += libfreenect
INCLUDEPATH += /usr/include/libusb-1.0
# Include libfreenect libraries
LIBS += -lfreenect
DEFINES += QGC_LIBFREENECT_ENABLED
}
QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$DESTDIR
QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$DESTDIR
QMAKE_POST_LINK += && mkdir -p $$DESTDIR/images
QMAKE_POST_LINK += && cp -f $$BASEDIR/images/Vera.ttf $$DESTDIR/images/Vera.ttf
QMAKE_POST_LINK += && cp -rf $$BASEDIR/images/patterns $$DESTDIR/images
# osg/osgEarth dynamic casts might fail without this compiler option.
# see http://osgearth.org/wiki/FAQ for details.
QMAKE_CXXFLAGS += -Wl,-E
}
linux-g++-64 {
debug {
DESTDIR = $$TARGETDIR/debug
CONFIG += debug
}
release {
DESTDIR = $$TARGETDIR/release
}
QMAKE_POST_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
INCLUDEPATH += /usr/include \
/usr/include/qt4/phonon
# $$BASEDIR/lib/flite/include \
# $$BASEDIR/lib/flite/lang
# 64-bit Linux
message(Building for GNU/Linux 64bit/x64 (g++-64))
LIBS += \
-L/usr/lib \
-lm \
-lflite_cmu_us_kal \
-lflite_usenglish \
-lflite_cmulex \
-lflite \
-lSDL \
-lSDLmain
exists(/usr/include/osg) {
message("Building support for OpenSceneGraph")
DEPENDENCIES_PRESENT += osg
# Include OpenSceneGraph libraries
LIBS += -losg \
-losgViewer
DEFINES += QGC_OSG_ENABLED
}
exists(/usr/include/osgEarth) {
message("Building support for osgEarth")
DEPENDENCIES_PRESENT += osgearth
# Include osgEarth libraries
LIBS += -losgEarth \
-losgEarthUtil
DEFINES += QGC_OSGEARTH_ENABLED
}
exists(/usr/local/include/libfreenect) {
message("Building support for libfreenect")
DEPENDENCIES_PRESENT += libfreenect
INCLUDEPATH += /usr/include/libusb-1.0
# Include libfreenect libraries
LIBS += -lfreenect
DEFINES += QGC_LIBFREENECT_ENABLED
}
QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$DESTDIR
QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$DESTDIR
QMAKE_POST_LINK += && mkdir -p $$DESTDIR/images
QMAKE_POST_LINK += && cp -f $$BASEDIR/images/Vera.ttf $$DESTDIR/images/Vera.ttf
QMAKE_POST_LINK += && cp -rf $$BASEDIR/images/patterns $$DESTDIR/images
# osg/osgEarth dynamic casts might fail without this compiler option.
# see http://osgearth.org/wiki/FAQ for details.
QMAKE_CXXFLAGS += -Wl,-E
}
# Windows (32bit)
win32-msvc2008 {
message(Building for Windows Visual Studio 2008 (32bit))
CONFIG += qaxcontainer
# Special settings for debug
#CONFIG += CONSOLE
INCLUDEPATH += $$BASEDIR/lib/sdl/msvc/include \
$$BASEDIR/lib/opal/include \
$$BASEDIR/lib/msinttypes
#"C:\Program Files\Microsoft SDKs\Windows\v7.0\Include"
LIBS += -L$$BASEDIR/lib/sdl/msvc/lib \
-lSDLmain -lSDL
exists($$BASEDIR/lib/osg123) {
message("Building support for OSG")
DEPENDENCIES_PRESENT += osg
# Include OpenSceneGraph and osgEarth libraries
INCLUDEPATH += $$BASEDIR/lib/osgEarth/win32/include \
$$BASEDIR/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/include
LIBS += -L$$BASEDIR/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/lib \
-losg \
-losgViewer \
-losgGA \
-losgDB \
-losgText \
-lOpenThreads
DEFINES += QGC_OSG_ENABLED
exists($$BASEDIR/lib/osgEarth123) {
DEPENDENCIES_PRESENT += osgearth
message("Building support for osgEarth")
DEFINES += QGC_OSGEARTH_ENABLED
LIBS += -L$$BASEDIR/lib/osgEarth/win32/lib \
-losgEarth \
-losgEarthUtil
}
}
RC_FILE = $$BASEDIR/qgroundcontrol.rc
# Copy dependencies
BASEDIR_WIN = $$replace(BASEDIR,"/","\\")
TARGETDIR_WIN = $$replace(TARGETDIR,"/","\\")
debug {
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll\" \"$$TARGETDIR_WIN\\debug\\SDL.dll\"
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\debug\audio\" /S /E /Y
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\debug\models\" /S /E /Y
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR/images/earth.html $$TARGETDIR_WIN\debug\"
}
release {
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\lib\sdl\win32\SDL.dll\" \"$$TARGETDIR_WIN\release\SDL.dll\"
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\release\audio\" /S /E /Y
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\release\models\" /S /E /Y
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR/images/earth.html $$TARGETDIR_WIN\release\"
}
}
# Windows (32bit)
win32-g++ {
message(Building for Windows Platform (32bit))
# Special settings for debug
#CONFIG += CONSOLE
INCLUDEPATH += $$BASEDIR/lib/sdl/include \
$$BASEDIR/lib/opal/include #\ #\
#"C:\Program Files\Microsoft SDKs\Windows\v7.0\Include"
LIBS += -L$$BASEDIR/lib/sdl/win32 \
-lmingw32 -lSDLmain -lSDL -mwindows
debug {
#DESTDIR = $$BUILDDIR/debug
}
release {
#DESTDIR = $$BUILDDIR/release
}
RC_FILE = $$BASEDIR/qgroundcontrol.rc
# Copy dependencies
debug {
QMAKE_POST_LINK += && cp $$BASEDIR/lib/sdl/win32/SDL.dll $$TARGETDIR/debug/SDL.dll
QMAKE_POST_LINK += && cp -r $$BASEDIR/audio $$TARGETDIR/debug/audio
QMAKE_POST_LINK += && cp -r $$BASEDIR/models $$TARGETDIR/debug/models
}
release {
QMAKE_POST_LINK += && cp $$BASEDIR/lib/sdl/win32/SDL.dll $$TARGETDIR/release/SDL.dll
QMAKE_POST_LINK += && cp -r $$BASEDIR/audio $$TARGETDIR/release/audio
QMAKE_POST_LINK += && cp -r $$BASEDIR/models $$TARGETDIR/release/models
}
# osg/osgEarth dynamic casts might fail without this compiler option.
# see http://osgearth.org/wiki/FAQ for details.
QMAKE_CXXFLAGS += -Wl,-E
}
#-------------------------------------------------
#
# QGroundControl - Micro Air Vehicle Groundstation
#
# Please see our website at <http://qgroundcontrol.org>
#
# Author:
# Lorenz Meier <mavteam@student.ethz.ch>
#
# (c) 2009-2010 PIXHAWK Team
#
# This file is part of the mav groundstation project
# QGroundControl is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# QGroundControl is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with QGroundControl. If not, see <http://www.gnu.org/licenses/>.
#
#-------------------------------------------------
#$$BASEDIR/lib/qextserialport/include
# $$BASEDIR/lib/openjaus/libjaus/include \
# $$BASEDIR/lib/openjaus/libopenJaus/include
message(Qt version $$[QT_VERSION])
release {
# DEFINES += QT_NO_DEBUG_OUTPUT
# DEFINES += QT_NO_WARNING_OUTPUT
}
QMAKE_POST_LINK += echo "Copying files"
#QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/debug/.
#QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/release/.
# MAC OS X
macx {
COMPILER_VERSION = system(gcc -v)
message(Using compiler $$COMPILER_VERSION)
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 ) {
# x86 Mac OS X Leopard 10.5 and earlier
CONFIG += x86 cocoa phonon
message(Building for Mac OS X 32bit/Leopard 10.5 and earlier)
# Enable function-profiling with the OS X saturn tool
debug {
#QMAKE_CXXFLAGS += -finstrument-functions
#LIBS += -lSaturn
}
} else {
# x64 Mac OS X Snow Leopard 10.6 and later
CONFIG += x86_64 cocoa
CONFIG -= x86 phonon
message(Building for Mac OS X 64bit/Snow Leopard 10.6 and later)
}
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5
#DESTDIR = $$BASEDIR/bin/mac
INCLUDEPATH += -framework SDL
LIBS += -framework IOKit \
-framework SDL \
-framework CoreFoundation \
-framework ApplicationServices \
-lm
ICON = $$BASEDIR/images/icons/macx.icns
# Copy audio files if needed
QMAKE_POST_LINK += && cp -rf $$BASEDIR/audio $$TARGETDIR/qgroundcontrol.app/Contents/MacOs
# Copy google earth starter file
QMAKE_POST_LINK += && cp -f $$BASEDIR/images/earth.html $$TARGETDIR/qgroundcontrol.app/Contents/MacOs
# Copy model files
#QMAKE_POST_LINK += && cp -f $$BASEDIR/models/*.dae $$TARGETDIR/qgroundcontrol.app/Contents/MacOs
exists(/Library/Frameworks/osg.framework):exists(/Library/Frameworks/OpenThreads.framework) {
# No check for GLUT.framework since it's a MAC default
message("Building support for OpenSceneGraph")
DEPENDENCIES_PRESENT += osg
DEFINES += QGC_OSG_ENABLED
# Include OpenSceneGraph libraries
INCLUDEPATH += -framework GLUT \
-framework Carbon \
-framework OpenThreads \
-framework osg \
-framework osgViewer \
-framework osgGA \
-framework osgDB \
-framework osgText \
-framework osgWidget
LIBS += -framework GLUT \
-framework Carbon \
-framework OpenThreads \
-framework osg \
-framework osgViewer \
-framework osgGA \
-framework osgDB \
-framework osgText \
-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) {
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
linux-g++ {
debug {
DESTDIR = $$TARGETDIR/debug
CONFIG += debug
}
release {
DESTDIR = $$TARGETDIR/release
}
QMAKE_POST_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
INCLUDEPATH += /usr/include \
/usr/local/include \
/usr/include/qt4/phonon
# $$BASEDIR/lib/flite/include \
# $$BASEDIR/lib/flite/lang
message(Building for GNU/Linux 32bit/i386)
LIBS += \
-L/usr/lib \
-lm \
-lflite_cmu_us_kal \
-lflite_usenglish \
-lflite_cmulex \
-lflite \
-lSDL \
-lSDLmain
exists(/usr/include/osg) {
message("Building support for OpenSceneGraph")
DEPENDENCIES_PRESENT += osg
# Include OpenSceneGraph libraries
LIBS += -losg \
-losgViewer
DEFINES += QGC_OSG_ENABLED
}
exists(/usr/include/osgEarth) | exists(/usr/local/include/osgEarth) {
message("Building support for osgEarth")
DEPENDENCIES_PRESENT += osgearth
# Include osgEarth libraries
LIBS += -losgEarth \
-losgEarthUtil
DEFINES += QGC_OSGEARTH_ENABLED
}
exists(/usr/local/include/libfreenect/libfreenect.h) {
message("Building support for libfreenect")
DEPENDENCIES_PRESENT += libfreenect
INCLUDEPATH += /usr/include/libusb-1.0
# Include libfreenect libraries
LIBS += -lfreenect
DEFINES += QGC_LIBFREENECT_ENABLED
}
QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$DESTDIR
QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$DESTDIR
QMAKE_POST_LINK += && mkdir -p $$DESTDIR/images
QMAKE_POST_LINK += && cp -rf $$BASEDIR/images/Vera.ttf $$DESTDIR/images/Vera.ttf
# osg/osgEarth dynamic casts might fail without this compiler option.
# see http://osgearth.org/wiki/FAQ for details.
QMAKE_CXXFLAGS += -Wl,-E
}
linux-g++-64 {
debug {
DESTDIR = $$TARGETDIR/debug
CONFIG += debug
}
release {
DESTDIR = $$TARGETDIR/release
}
QMAKE_POST_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
INCLUDEPATH += /usr/include \
/usr/include/qt4/phonon
# $$BASEDIR/lib/flite/include \
# $$BASEDIR/lib/flite/lang
# 64-bit Linux
message(Building for GNU/Linux 64bit/x64 (g++-64))
LIBS += \
-L/usr/lib \
-lm \
-lflite_cmu_us_kal \
-lflite_usenglish \
-lflite_cmulex \
-lflite \
-lSDL \
-lSDLmain
exists(/usr/include/osg) {
message("Building support for OpenSceneGraph")
DEPENDENCIES_PRESENT += osg
# Include OpenSceneGraph libraries
LIBS += -losg \
-losgViewer
DEFINES += QGC_OSG_ENABLED
}
exists(/usr/include/osgEarth) {
message("Building support for osgEarth")
DEPENDENCIES_PRESENT += osgearth
# Include osgEarth libraries
LIBS += -losgEarth \
-losgEarthUtil
DEFINES += QGC_OSGEARTH_ENABLED
}
exists(/usr/local/include/libfreenect) {
message("Building support for libfreenect")
DEPENDENCIES_PRESENT += libfreenect
INCLUDEPATH += /usr/include/libusb-1.0
# Include libfreenect libraries
LIBS += -lfreenect
DEFINES += QGC_LIBFREENECT_ENABLED
}
QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$DESTDIR
QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$DESTDIR
QMAKE_POST_LINK += && mkdir -p $$DESTDIR/images
QMAKE_POST_LINK += && cp -rf $$BASEDIR/images/Vera.ttf $$DESTDIR/images/Vera.ttf
# osg/osgEarth dynamic casts might fail without this compiler option.
# see http://osgearth.org/wiki/FAQ for details.
QMAKE_CXXFLAGS += -Wl,-E
}
# Windows (32bit)
win32-msvc2008 {
message(Building for Windows Visual Studio 2008 (32bit))
CONFIG += qaxcontainer
# Special settings for debug
#CONFIG += CONSOLE
INCLUDEPATH += $$BASEDIR/lib/sdl/msvc/include \
$$BASEDIR/lib/opal/include \
$$BASEDIR/lib/msinttypes
#"C:\Program Files\Microsoft SDKs\Windows\v7.0\Include"
LIBS += -L$$BASEDIR/lib/sdl/msvc/lib \
-lSDLmain -lSDL
exists($$BASEDIR/lib/osg123) {
message("Building support for OSG")
DEPENDENCIES_PRESENT += osg
# Include OpenSceneGraph and osgEarth libraries
INCLUDEPATH += $$BASEDIR/lib/osgEarth/win32/include \
$$BASEDIR/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/include
LIBS += -L$$BASEDIR/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/lib \
-losg \
-losgViewer \
-losgGA \
-losgDB \
-losgText \
-lOpenThreads
DEFINES += QGC_OSG_ENABLED
exists($$BASEDIR/lib/osgEarth123) {
DEPENDENCIES_PRESENT += osgearth
message("Building support for osgEarth")
DEFINES += QGC_OSGEARTH_ENABLED
LIBS += -L$$BASEDIR/lib/osgEarth/win32/lib \
-losgEarth \
-losgEarthUtil
}
}
RC_FILE = $$BASEDIR/qgroundcontrol.rc
# Copy dependencies
BASEDIR_WIN = $$replace(BASEDIR,"/","\\")
TARGETDIR_WIN = $$replace(TARGETDIR,"/","\\")
debug {
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll\" \"$$TARGETDIR_WIN\\debug\\SDL.dll\"
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\debug\audio\" /S /E /Y
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\debug\models\" /S /E /Y
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR/images/earth.html $$TARGETDIR_WIN\debug\"
}
release {
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\lib\sdl\win32\SDL.dll\" \"$$TARGETDIR_WIN\release\SDL.dll\"
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\release\audio\" /S /E /Y
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\release\models\" /S /E /Y
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR/images/earth.html $$TARGETDIR_WIN\release\"
}
}
# Windows (32bit)
win32-g++ {
message(Building for Windows Platform (32bit))
# Special settings for debug
#CONFIG += CONSOLE
INCLUDEPATH += $$BASEDIR/lib/sdl/include \
$$BASEDIR/lib/opal/include #\ #\
#"C:\Program Files\Microsoft SDKs\Windows\v7.0\Include"
LIBS += -L$$BASEDIR/lib/sdl/win32 \
-lmingw32 -lSDLmain -lSDL -mwindows
debug {
#DESTDIR = $$BUILDDIR/debug
}
release {
#DESTDIR = $$BUILDDIR/release
}
RC_FILE = $$BASEDIR/qgroundcontrol.rc
# Copy dependencies
debug {
QMAKE_POST_LINK += && cp $$BASEDIR/lib/sdl/win32/SDL.dll $$TARGETDIR/debug/SDL.dll
QMAKE_POST_LINK += && cp -r $$BASEDIR/audio $$TARGETDIR/debug/audio
QMAKE_POST_LINK += && cp -r $$BASEDIR/models $$TARGETDIR/debug/models
}
release {
QMAKE_POST_LINK += && cp $$BASEDIR/lib/sdl/win32/SDL.dll $$TARGETDIR/release/SDL.dll
QMAKE_POST_LINK += && cp -r $$BASEDIR/audio $$TARGETDIR/release/audio
QMAKE_POST_LINK += && cp -r $$BASEDIR/models $$TARGETDIR/release/models
}
# osg/osgEarth dynamic casts might fail without this compiler option.
# see http://osgearth.org/wiki/FAQ for details.
QMAKE_CXXFLAGS += -Wl,-E
}

2
src/Core.cc

@ -157,7 +157,7 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv) @@ -157,7 +157,7 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv)
**/
Core::~Core()
{
mainWindow->storeSettings();
//mainWindow->storeSettings();
mainWindow->hide();
mainWindow->deleteLater();
// Delete singletons

28
src/comm/LinkManager.cc

@ -32,6 +32,7 @@ This file is part of the QGROUNDCONTROL project @@ -32,6 +32,7 @@ This file is part of the QGROUNDCONTROL project
#include <QList>
#include <QApplication>
#include "LinkManager.h"
#include <iostream>
#include <QDebug>
@ -65,6 +66,7 @@ LinkManager::~LinkManager() @@ -65,6 +66,7 @@ LinkManager::~LinkManager()
void LinkManager::add(LinkInterface* link)
{
if(!link) return;
links.append(link);
emit newLink(link);
}
@ -73,6 +75,7 @@ void LinkManager::addProtocol(LinkInterface* link, ProtocolInterface* protocol) @@ -73,6 +75,7 @@ void LinkManager::addProtocol(LinkInterface* link, ProtocolInterface* protocol)
{
// Connect link to protocol
// the protocol will receive new bytes from the link
if(!link || !protocol) return;
connect(link, SIGNAL(bytesReceived(LinkInterface*, QByteArray)), protocol, SLOT(receiveBytes(LinkInterface*, QByteArray)));
// Store the connection information in the protocol links map
protocolLinks.insertMulti(protocol, link);
@ -91,7 +94,8 @@ bool LinkManager::connectAll() @@ -91,7 +94,8 @@ bool LinkManager::connectAll()
foreach (LinkInterface* link, links)
{
if(! link->connect()) allConnected = false;
if(!link) {}
else if(!link->connect()) allConnected = false;
}
return allConnected;
@ -103,7 +107,9 @@ bool LinkManager::disconnectAll() @@ -103,7 +107,9 @@ bool LinkManager::disconnectAll()
foreach (LinkInterface* link, links)
{
if(! link->disconnect()) allDisconnected = false;
//static int i=0;
if(!link){}
else if(!link->disconnect()) allDisconnected = false;
}
return allDisconnected;
@ -111,14 +117,32 @@ bool LinkManager::disconnectAll() @@ -111,14 +117,32 @@ bool LinkManager::disconnectAll()
bool LinkManager::connectLink(LinkInterface* link)
{
if(!link) return false;
return link->connect();
}
bool LinkManager::disconnectLink(LinkInterface* link)
{
if(!link) return false;
return link->disconnect();
}
bool LinkManager::removeLink(LinkInterface* link)
{
if(link)
{
for (int i=0; i < QList<LinkInterface*>(links).size(); i++)
{
if(link==links.at(i))
{
links.removeAt(i); //remove from link list
}
}
return true;
}
return false;
}
/**
* The access time is linear in the number of links.
*

2
src/comm/LinkManager.h

@ -67,6 +67,8 @@ public slots: @@ -67,6 +67,8 @@ public slots:
void add(LinkInterface* link);
void addProtocol(LinkInterface* link, ProtocolInterface* protocol);
bool removeLink(LinkInterface* link);
bool connectAll();
bool connectLink(LinkInterface* link);

6
src/comm/MAVLinkProtocol.cc

@ -159,7 +159,9 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b) @@ -159,7 +159,9 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
switch (heartbeat.autopilot)
{
case MAV_AUTOPILOT_GENERIC:
uas = new UAS(this, message.sysid);
// Connect this robot to the UAS object
connect(this, SIGNAL(messageReceived(LinkInterface*, mavlink_message_t)), uas, SLOT(receiveMessage(LinkInterface*, mavlink_message_t)));
break;
@ -202,11 +204,15 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b) @@ -202,11 +204,15 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
break;
}
// Set the autopilot type
uas->setAutopilotType((int)heartbeat.autopilot);
// Make UAS aware that this link can be used to communicate with the actual robot
uas->addLink(link);
// Now add UAS to "official" list, which makes the whole application aware of it
UASManager::instance()->addUAS(uas);
}
// Only count message if UAS exists for this message

6
src/comm/MAVLinkSimulationLink.cc

@ -660,7 +660,7 @@ qint64 MAVLinkSimulationLink::bytesAvailable() @@ -660,7 +660,7 @@ qint64 MAVLinkSimulationLink::bytesAvailable()
void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size)
{
qDebug() << "Simulation received " << size << " bytes from groundstation: ";
//qDebug() << "Simulation received " << size << " bytes from groundstation: ";
// Increase write counter
//bitsSentTotal += size * 8;
@ -838,9 +838,9 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size) @@ -838,9 +838,9 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size)
}
unsigned char v=data[i];
fprintf(stderr,"%02x ", v);
//fprintf(stderr,"%02x ", v);
}
fprintf(stderr,"\n");
//fprintf(stderr,"\n");
readyBufferMutex.lock();
for (int i = 0; i < streampointer; i++)

74
src/comm/SerialLink.cc

@ -36,6 +36,7 @@ This file is part of the QGROUNDCONTROL project @@ -36,6 +36,7 @@ This file is part of the QGROUNDCONTROL project
#include "LinkManager.h"
#include "QGC.h"
#include <MG.h>
#include <iostream>
#ifdef _WIN32
#include "windows.h"
#endif
@ -59,9 +60,18 @@ SerialLink::SerialLink(QString portname, BaudRateType baudrate, FlowType flow, P @@ -59,9 +60,18 @@ SerialLink::SerialLink(QString portname, BaudRateType baudrate, FlowType flow, P
// Load defaults from settings
QSettings settings(QGC::COMPANYNAME, QGC::APPNAME);
settings.sync();
if (settings.contains("SERIALLINK_COMM_PORT"))
{
this->porthandle = settings.value("SERIALLINK_COMM_PORT").toString();
}
// *nix (Linux, MacOS tested) serial port support
port = new QextSerialPort(porthandle, QextSerialPort::Polling);
//port = new QextSerialPort(porthandle, QextSerialPort::EventDriven);
if (settings.contains("SERIALLINK_COMM_PORT"))
{
setBaudRate(settings.value("SERIALLINK_COMM_BAUD").toInt());
setParityType(settings.value("SERIALLINK_COMM_PARITY").toInt());
setStopBitsType(settings.value("SERIALLINK_COMM_STOPBITS").toInt());
@ -76,6 +86,12 @@ SerialLink::SerialLink(QString portname, BaudRateType baudrate, FlowType flow, P @@ -76,6 +86,12 @@ SerialLink::SerialLink(QString portname, BaudRateType baudrate, FlowType flow, P
this->stopBits = stopBits;
this->timeout = 1; ///< The timeout controls how long the program flow should wait for new serial bytes. As we're polling, we don't want to wait at all.
}
port->setTimeout(timeout); // Timeout of 0 ms, we don't want to wait for data, we just poll again next time
port->setBaudRate(baudrate);
port->setFlowControl(flow);
port->setParity(parity);
port->setDataBits(dataBits);
port->setStopBits(stopBits);
// Set the port name
if (porthandle == "")
@ -104,15 +120,7 @@ SerialLink::SerialLink(QString portname, BaudRateType baudrate, FlowType flow, P @@ -104,15 +120,7 @@ SerialLink::SerialLink(QString portname, BaudRateType baudrate, FlowType flow, P
//some other error occurred. Inform user.
}
#else
// *nix (Linux, MacOS tested) serial port support
port = new QextSerialPort(porthandle, QextSerialPort::Polling);
//port = new QextSerialPort(porthandle, QextSerialPort::EventDriven);
port->setTimeout(timeout); // Timeout of 0 ms, we don't want to wait for data, we just poll again next time
port->setBaudRate(baudrate);
port->setFlowControl(flow);
port->setParity(parity);
port->setDataBits(dataBits);
port->setStopBits(stopBits);
#endif
// Link is setup, register it with link manager
@ -122,7 +130,7 @@ SerialLink::SerialLink(QString portname, BaudRateType baudrate, FlowType flow, P @@ -122,7 +130,7 @@ SerialLink::SerialLink(QString portname, BaudRateType baudrate, FlowType flow, P
SerialLink::~SerialLink()
{
disconnect();
delete port;
if(port) delete port;
port = NULL;
}
@ -186,7 +194,7 @@ void SerialLink::writeBytes(const char* data, qint64 size) @@ -186,7 +194,7 @@ void SerialLink::writeBytes(const char* data, qint64 size)
{
unsigned char v=data[i];
fprintf(stderr,"%02x ", v);
//fprintf(stderr,"%02x ", v);
}
}
}
@ -255,6 +263,8 @@ bool SerialLink::disconnect() @@ -255,6 +263,8 @@ bool SerialLink::disconnect()
port->close();
dataMutex.unlock();
if(this->isRunning()) this->terminate(); //stop running the thread, restart it upon connect
bool closed = true;
//port->isOpen();
@ -298,15 +308,6 @@ bool SerialLink::connect() @@ -298,15 +308,6 @@ bool SerialLink::connect()
**/
bool SerialLink::hardwareConnect()
{
// Store settings
QSettings settings(QGC::COMPANYNAME, QGC::APPNAME);
settings.setValue("SERIALLINK_COMM_PORT", this->porthandle);
settings.setValue("SERIALLINK_COMM_BAUD", this->baudrate);
settings.setValue("SERIALLINK_COMM_PARITY", this->parity);
settings.setValue("SERIALLINK_COMM_STOPBITS", this->stopBits);
settings.setValue("SERIALLINK_COMM_DATABITS", this->dataBits);
settings.sync();
QObject::connect(port, SIGNAL(aboutToClose()), this, SIGNAL(disconnected()));
port->open(QIODevice::ReadWrite);
@ -323,6 +324,15 @@ bool SerialLink::hardwareConnect() @@ -323,6 +324,15 @@ bool SerialLink::hardwareConnect()
if(connectionUp) {
emit connected();
emit connected(true);
// Store settings
QSettings settings(QGC::COMPANYNAME, QGC::APPNAME);
settings.setValue("SERIALLINK_COMM_PORT", this->porthandle);
settings.setValue("SERIALLINK_COMM_BAUD", getBaudRate());
settings.setValue("SERIALLINK_COMM_PARITY", getParityType());
settings.setValue("SERIALLINK_COMM_STOPBITS", getStopBitsType());
settings.setValue("SERIALLINK_COMM_DATABITS", getDataBitsType());
settings.sync();
}
return connectionUp;
@ -336,7 +346,14 @@ bool SerialLink::hardwareConnect() @@ -336,7 +346,14 @@ bool SerialLink::hardwareConnect()
**/
bool SerialLink::isConnected()
{
return port->isOpen();
if (port)
{
return port->isOpen();
}
else
{
return false;
}
}
int SerialLink::getId()
@ -541,7 +558,7 @@ bool SerialLink::setPortName(QString portName) @@ -541,7 +558,7 @@ bool SerialLink::setPortName(QString portName)
this->porthandle = "\\\\.\\" + this->porthandle;
}
#endif
delete port;
if(port) delete port;
port = new QextSerialPort(porthandle, QextSerialPort::Polling);
port->setBaudRate(baudrate);
@ -732,9 +749,16 @@ bool SerialLink::setBaudRate(int rate) @@ -732,9 +749,16 @@ bool SerialLink::setBaudRate(int rate)
break;
}
port->setBaudRate(this->baudrate);
if(reconnect) connect();
return accepted;
if (port)
{
port->setBaudRate(this->baudrate);
if(reconnect) connect();
return accepted;
}
else
{
return false;
}
}
bool SerialLink::setFlowType(int flow)

36
src/uas/SlugsMAV.cc

@ -169,10 +169,16 @@ void SlugsMAV::emitSignals (void){ @@ -169,10 +169,16 @@ void SlugsMAV::emitSignals (void){
case 2:
emit slugsAirData(uasId, mlAirData);
emit slugsDiagnostic(uasId,mlDiagnosticData);
break;
case 3:
emit slugsPilotConsolePWM(uasId,mlPilotConsoleData);
emit remoteControlChannelScaledChanged(0,(mlPilotConsoleData.de- 1000.0f)/1000.0f);
emit remoteControlChannelScaledChanged(1,(mlPilotConsoleData.dla- 1000.0f)/1000.0f);
emit remoteControlChannelScaledChanged(2,(mlPilotConsoleData.dr- 1000.0f)/1000.0f);
emit remoteControlChannelScaledChanged(3,(mlPilotConsoleData.dra- 1000.0f)/1000.0f);
emit remoteControlChannelScaledChanged(0,(mlPilotConsoleData.dt- 1000.0f)/1000.0f);
emit slugsPWM(uasId, mlPwmCommands);
break;
@ -184,11 +190,13 @@ void SlugsMAV::emitSignals (void){ @@ -184,11 +190,13 @@ void SlugsMAV::emitSignals (void){
case 5:
emit slugsFilteredData(uasId,mlFilteredData);
emit slugsGPSDateTime(uasId, mlGpsDateTime);
break;
case 6:
emit slugsActionAck(uasId,mlActionAck);
emit emitGpsSignals();
break;
}
@ -212,20 +220,30 @@ void SlugsMAV::emitSignals (void){ @@ -212,20 +220,30 @@ void SlugsMAV::emitSignals (void){
#ifdef MAVLINK_ENABLED_SLUGS
void SlugsMAV::emitGpsSignals (void){
if (mlGpsData.fix_type > 0){
qDebug()<<"After Emit GPS Signal"<<mlGpsData.fix_type;
//ToDo Uncomment if. it was comment only to test
// if (mlGpsData.fix_type > 0){
emit globalPositionChanged(this,
mlGpsData.lon,
mlGpsData.lat,
mlGpsData.alt,
0.0);
// Smaller than threshold and not NaN
if (mlGpsData.v < 1000000 && mlGpsData.v == mlGpsData.v){
emit speedChanged(this, (double)mlGpsData.v, 0.0, 0.0, 0.0);
} else {
emit textMessageReceived(uasId, uasId, 255, QString("GCS ERROR: RECEIVED INVALID SPEED OF %1 m/s").arg(mlGpsData.v));
}
}
emit slugsGPSCogSog(uasId,mlGpsData.hdg, mlGpsData.v);
// // Smaller than threshold and not NaN
// if (mlGpsData.v < 1000000 && mlGpsData.v == mlGpsData.v){
// // emit speedChanged(this, (double)mlGpsData.v, 0.0, 0.0, 0.0);
// }
// else {
// emit textMessageReceived(uasId, uasId, 255, QString("GCS ERROR: RECEIVED INVALID SPEED OF %1 m/s").arg(mlGpsData.v));
// }
//}
}
void SlugsMAV::emitPidSignal()

3
src/uas/SlugsMAV.h

@ -47,6 +47,7 @@ public slots: @@ -47,6 +47,7 @@ public slots:
signals:
void slugsRawImu(int uasId, const mavlink_raw_imu_t& rawData);
void slugsGPSCogSog(int uasId, double cog, double sog);
#ifdef MAVLINK_ENABLED_SLUGS
@ -67,6 +68,8 @@ signals: @@ -67,6 +68,8 @@ signals:
void slugsBootMsg(int uasId, mavlink_boot_t& boot);
void slugsAttitude(int uasId, mavlink_attitude_t& attitude);
#endif
protected:

45
src/uas/UAS.cc

@ -43,12 +43,16 @@ This file is part of the QGROUNDCONTROL project @@ -43,12 +43,16 @@ This file is part of the QGROUNDCONTROL project
#include "GAudioOutput.h"
#include "MAVLinkProtocol.h"
#include "QGCMAVLink.h"
#include "LinkManager.h"
#include "SerialLink.h"
UAS::UAS(MAVLinkProtocol* protocol, int id) : UASInterface(),
uasId(id),
startTime(MG::TIME::getGroundTimeNow()),
commStatus(COMM_DISCONNECTED),
name(""),
autopilot(-1),
links(new QList<LinkInterface*>()),
unknownPackets(),
mavlink(protocol),
@ -93,6 +97,7 @@ UAS::UAS(MAVLinkProtocol* protocol, int id) : UASInterface(), @@ -93,6 +97,7 @@ UAS::UAS(MAVLinkProtocol* protocol, int id) : UASInterface(),
UAS::~UAS()
{
delete links;
links=NULL;
}
int UAS::getUASID() const
@ -124,6 +129,7 @@ void UAS::setSelected() @@ -124,6 +129,7 @@ void UAS::setSelected()
void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
{
if (!link) return;
if (!links->contains(link))
{
addLink(link);
@ -149,8 +155,10 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) @@ -149,8 +155,10 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
if (this->type != mavlink_msg_heartbeat_get_type(&message))
{
this->type = mavlink_msg_heartbeat_get_type(&message);
this->autopilot = mavlink_msg_heartbeat_get_autopilot(&message);
emit systemTypeSet(this, type);
}
break;
case MAVLINK_MSG_ID_BOOT:
getStatusForCode((int)MAV_STATE_BOOT, uasState, stateDescription);
@ -328,6 +336,10 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) @@ -328,6 +336,10 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
emit valueChanged(uasId, "Vz", pos.vz, time);
emit localPositionChanged(this, pos.x, pos.y, pos.z, time);
emit speedChanged(this, pos.vx, pos.vy, pos.vz, time);
// qDebug()<<"Local Position = "<<pos.x<<" - "<<pos.y<<" - "<<pos.z;
// qDebug()<<"Speed Local Position = "<<pos.vx<<" - "<<pos.vy<<" - "<<pos.vz;
//emit attitudeChanged(this, pos.roll, pos.pitch, pos.yaw, time);
// Set internal state
if (!positionLock)
@ -363,12 +375,8 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) @@ -363,12 +375,8 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
GAudioOutput::instance()->notifyPositive();
}
positionLock = true;
// Send to patch antenna
// FIXME Message re-routing should be implemented differently
//mavlink_message_t msg;
//mavlink_msg_global_position_pack(MG::SYSTEM::ID, MG::SYSTEM::COMPID, &msg, pos.usec, pos.lat, pos.lon, pos.alt, pos.vx, pos.vy, pos.vz);
//sendMessage(msg);
//TODO fix this hack for forwarding of global position for patch antenna tracking
forwardMessage(message);
}
break;
case MAVLINK_MSG_ID_GPS_RAW:
@ -830,8 +838,31 @@ void UAS::sendMessage(mavlink_message_t message) @@ -830,8 +838,31 @@ void UAS::sendMessage(mavlink_message_t message)
}
}
void UAS::forwardMessage(mavlink_message_t message)
{
// Emit message on all links that are currently connected
QList<LinkInterface*>link_list = LinkManager::instance()->getLinksForProtocol(mavlink);
foreach(LinkInterface* link, link_list)
{
SerialLink* serial = dynamic_cast<SerialLink*>(link);
if(serial != 0)
{
for(int i=0;i<links->size();i++)
{
if(serial != links->at(i))
{
qDebug()<<"Forwarding Over link: "<<serial->getName()<<" "<<serial;
sendMessage(serial, message);
}
}
}
}
}
void UAS::sendMessage(LinkInterface* link, mavlink_message_t message)
{
if(!link) return;
// Create buffer
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
// Write message into buffer, prepending start sign
@ -1501,7 +1532,7 @@ void UAS::addLink(LinkInterface* link) @@ -1501,7 +1532,7 @@ void UAS::addLink(LinkInterface* link)
links->append(link);
}
//links->append(link);
//qDebug() << " ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK";
qDebug() << link<<" ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK ADDED LINK";
}
/**

26
src/uas/UAS.h

@ -79,25 +79,26 @@ public: @@ -79,25 +79,26 @@ public:
/** @brief Get the links associated with this robot */
QList<LinkInterface*>* getLinks();
double getLocalX() const { return localX; };
double getLocalY() const { return localY; };
double getLocalZ() const { return localZ; };
double getLatitude() const { return latitude; };
double getLongitude() const { return longitude; };
double getAltitude() const { return altitude; };
double getLocalX() const { return localX; }
double getLocalY() const { return localY; }
double getLocalZ() const { return localZ; }
double getLatitude() const { return latitude; }
double getLongitude() const { return longitude; }
double getAltitude() const { return altitude; }
double getRoll() const { return roll; };
double getPitch() const { return pitch; };
double getYaw() const { return yaw; };
double getRoll() const { return roll; }
double getPitch() const { return pitch; }
double getYaw() const { return yaw; }
friend class UASWaypointManager;
protected:
int uasId; ///< Unique system ID
int type; ///< UAS type (from type enum)
unsigned char type; ///< UAS type (from type enum)
quint64 startTime; ///< The time the UAS was switched on
CommStatus commStatus; ///< Communication status
QString name; ///< Human-friendly name of the vehicle, e.g. bravo
int autopilot; ///< Type of the Autopilot: -1: None, 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM
QList<LinkInterface*>* links; ///< List of links this UAS can be reached by
QList<int> unknownPackets; ///< Packet IDs which are unknown and have been received
MAVLinkProtocol* mavlink; ///< Reference to the MAVLink instance
@ -164,6 +165,8 @@ protected: @@ -164,6 +165,8 @@ protected:
public:
UASWaypointManager &getWaypointManager(void) { return waypointManager; }
int getSystemType();
int getAutopilotType() {return autopilot;}
void setAutopilotType(int apType) { autopilot = apType;}
public slots:
/** @brief Launches the system **/
@ -215,6 +218,9 @@ public slots: @@ -215,6 +218,9 @@ public slots:
/** @brief Send a message over all links this UAS can be reached with (!= all links) */
void sendMessage(mavlink_message_t message);
/** @brief Temporary Hack for sending packets to patch Antenna. Send a message over all serial links except for this UAS's */
void forwardMessage(mavlink_message_t message);
/** @brief Set this UAS as the system currently in focus, e.g. in the main display widgets */
void setSelected();

5
src/uas/UASInterface.h

@ -157,6 +157,9 @@ public: @@ -157,6 +157,9 @@ public:
return color;
}
virtual int getAutopilotType() = 0;
virtual void setAutopilotType(int apType)= 0;
public slots:
/** @brief Launches the system/Liftof **/
@ -241,6 +244,8 @@ public slots: @@ -241,6 +244,8 @@ public slots:
virtual void startGyroscopeCalibration() = 0;
virtual void startPressureCalibration() = 0;
protected:
QColor color;

10
src/uas/UASManager.cc

@ -85,6 +85,11 @@ void UASManager::addUAS(UASInterface* uas) @@ -85,6 +85,11 @@ void UASManager::addUAS(UASInterface* uas)
}
}
QList<UASInterface*> UASManager::getUASList()
{
return systems.values();
}
UASInterface* UASManager::getActiveUAS()
{
if(!activeUAS)
@ -96,6 +101,11 @@ UASInterface* UASManager::getActiveUAS() @@ -96,6 +101,11 @@ UASInterface* UASManager::getActiveUAS()
return activeUAS; ///< Return zero pointer if no UAS has been loaded
}
UASInterface* UASManager::silentGetActiveUAS()
{
return activeUAS; ///< Return zero pointer if no UAS has been loaded
}
bool UASManager::launchActiveUAS()
{
// If the active UAS is set, execute command

3
src/uas/UASManager.h

@ -57,6 +57,7 @@ public: @@ -57,6 +57,7 @@ public:
* @return NULL pointer if no UAS exists, active UAS else
**/
UASInterface* getActiveUAS();
UASInterface* silentGetActiveUAS();
/**
* @brief Get the UAS with this id
*
@ -68,6 +69,8 @@ public: @@ -68,6 +69,8 @@ public:
**/
UASInterface* getUASForId(int id);
QList<UASInterface*> getUASList();
public slots:

22
src/ui/CommConfigurationWindow.cc

@ -47,6 +47,7 @@ This file is part of the QGROUNDCONTROL project @@ -47,6 +47,7 @@ This file is part of the QGROUNDCONTROL project
#endif
#include "MAVLinkProtocol.h"
#include "MAVLinkSettingsWidget.h"
#include "LinkManager.h"
CommConfigurationWindow::CommConfigurationWindow(LinkInterface* link, ProtocolInterface* protocol, QWidget *parent, Qt::WindowFlags flags) : QWidget(parent, flags)
{
@ -58,6 +59,10 @@ CommConfigurationWindow::CommConfigurationWindow(LinkInterface* link, ProtocolIn @@ -58,6 +59,10 @@ CommConfigurationWindow::CommConfigurationWindow(LinkInterface* link, ProtocolIn
// add link types
ui.linkType->addItem("Serial",QGC_LINK_SERIAL);
ui.linkType->addItem("UDP",QGC_LINK_UDP);
ui.linkType->addItem("Simulation",QGC_LINK_SIMULATION);
ui.linkType->addItem("Serial Forwarding",QGC_LINK_FORWARDING);
ui.connectionType->addItem("MAVLink", QGC_PROTOCOL_MAVLINK);
// Create action to open this menu
// Create configuration action for this link
@ -195,11 +200,20 @@ void CommConfigurationWindow::setLinkName(QString name) @@ -195,11 +200,20 @@ void CommConfigurationWindow::setLinkName(QString name)
void CommConfigurationWindow::remove()
{
link->disconnect();
//delete link;
//delete action;
if(action) delete action; //delete action first since it has a pointer to link
action=NULL;
if(link)
{
LinkManager::instance()->removeLink(link); //remove link from LinkManager list
link->disconnect(); //disconnect port, and also calls terminate() to stop the thread
if (link->isRunning()) link->terminate(); // terminate() the serial thread just in case it is still running
link->wait(); // wait() until thread is stoped before deleting
delete link;
}
link=NULL;
this->window()->close();
qDebug() << "TODO: Link cannot be deleted: CommConfigurationWindow::remove() NOT IMPLEMENTED!";
}
void CommConfigurationWindow::connectionState(bool connect)

9
src/ui/CommConfigurationWindow.h

@ -42,7 +42,14 @@ This file is part of the QGROUNDCONTROL project @@ -42,7 +42,14 @@ This file is part of the QGROUNDCONTROL project
enum qgc_link_t
{
QGC_LINK_SERIAL,
QGC_LINK_UDP
QGC_LINK_UDP,
QGC_LINK_SIMULATION,
QGC_LINK_FORWARDING
};
enum qgc_protocol_t
{
QGC_PROTOCOL_MAVLINK
};
#ifdef OPAL_RT

25
src/ui/CommSettings.ui

@ -43,23 +43,7 @@ @@ -43,23 +43,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="linkType">
<item>
<property name="text">
<string>Serial Link</string>
</property>
</item>
<item>
<property name="text">
<string>UDP</string>
</property>
</item>
<item>
<property name="text">
<string>Simulation</string>
</property>
</item>
</widget>
<widget class="QComboBox" name="linkType"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
@ -71,13 +55,8 @@ @@ -71,13 +55,8 @@
<item row="1" column="1">
<widget class="QComboBox" name="connectionType">
<property name="currentIndex">
<number>0</number>
<number>-1</number>
</property>
<item>
<property name="text">
<string>MAVLink</string>
</property>
</item>
</widget>
</item>
</layout>

1679
src/ui/MainWindow.cc

File diff suppressed because it is too large Load Diff

226
src/ui/MainWindow.h

@ -87,8 +87,8 @@ public: @@ -87,8 +87,8 @@ public:
~MainWindow();
public slots:
/** @brief Store the mainwindow settings */
void storeSettings();
// /** @brief Store the mainwindow settings */
// void storeSettings();
/**
* @brief Shows a status message on the bottom status bar
@ -122,22 +122,8 @@ public slots: @@ -122,22 +122,8 @@ public slots:
void loadEngineerView();
/** @brief Load view for operator */
void loadOperatorView();
/** @brief Load 3D view */
void load3DView();
/** @brief Load 3D Google Earth view */
void loadGoogleEarthView();
/** @brief Load 3D map view */
void load3DMapView();
/** @brief Load view with all widgets */
void loadAllView();
/** @brief Load MAVLink XML generator view */
void loadMAVLinkView();
/** @brief Load data view, allowing to plot flight data */
void loadDataView();
/** @brief Load data view, allowing to plot flight data */
void loadDataView(QString fileName);
/** @brief Load view for global operator, allowing to flight on earth */
void loadGlobalOperatorView();
/** @brief Show the online help for users */
void showHelp();
@ -146,25 +132,200 @@ public slots: @@ -146,25 +132,200 @@ public slots:
/** @brief Show the project roadmap */
void showRoadMap();
// Fixme find a nicer solution that scales to more AP types
void loadSlugsView();
void loadPixhawkView();
/** @brief Shows the widgets based on configuration and current view and autopilot */
void presentView();
/** @brief Reload the CSS style sheet */
void reloadStylesheet();
/*
==========================================================
Potentially Deprecated
==========================================================
*/
void loadPixhawkEngineerView();
/** @brief Load view with all widgets */
void loadAllView();
void loadWidgets();
/** @brief Load data view, allowing to plot flight data */
void loadDataView();
/** @brief Load data view, allowing to plot flight data */
void loadDataView(QString fileName);
/** @brief Load 3D map view */
void load3DMapView();
/** @brief Load 3D Google Earth view */
void loadGoogleEarthView();
/** @brief Load 3D view */
void load3DView();
/**
* @brief Shows a Docked Widget based on the action sender
*
* This slot is written to be used in conjunction with the addToToolsMenu function
* It shows the QDockedWidget based on the action sender
*
*/
void showToolWidget();
/**
* @brief Shows a Widget from the center stack based on the action sender
*
* This slot is written to be used in conjunction with the addToCentralWidgetsMenu function
* It shows the Widget based on the action sender
*
*/
void showCentralWidget();
/** @brief Updates a QDockWidget's checked status based on its visibility */
void updateVisibilitySettings (bool vis);
/** @brief Updates a QDockWidget's location */
void updateLocationSettings (Qt::DockWidgetArea location);
protected:
// These defines are used to save the settings when selecting with
// which widgets populate the views
// FIXME: DO NOT PUT CUSTOM VALUES IN THIS ENUM since it is iterated over
// this will be fixed in a future release.
typedef enum _TOOLS_WIDGET_NAMES {
MENU_UAS_CONTROL,
MENU_UAS_INFO,
MENU_CAMERA,
MENU_UAS_LIST,
MENU_WAYPOINTS,
MENU_STATUS,
MENU_DETECTION,
MENU_DEBUG_CONSOLE,
MENU_PARAMETERS,
MENU_HDD_1,
MENU_HDD_2,
MENU_WATCHDOG,
MENU_HUD,
MENU_HSI,
MENU_RC_VIEW,
MENU_SLUGS_DATA,
MENU_SLUGS_PID,
MENU_SLUGS_HIL,
MENU_SLUGS_CAMERA,
CENTRAL_SEPARATOR= 255, // do not change
CENTRAL_LINECHART,
CENTRAL_PROTOCOL,
CENTRAL_MAP,
CENTRAL_3D_LOCAL,
CENTRAL_3D_MAP,
CENTRAL_OSGEARTH,
CENTRAL_GOOGLE_EARTH,
CENTRAL_HUD,
CENTRAL_DATA_PLOT,
}TOOLS_WIDGET_NAMES;
typedef enum _SETTINGS_SECTIONS {
SECTION_MENU,
SUB_SECTION_CHECKED,
SUB_SECTION_LOCATION,
} SETTINGS_SECTIONS;
typedef enum _VIEW_SECTIONS {
VIEW_ENGINEER,
VIEW_OPERATOR,
VIEW_PILOT,
VIEW_MAVLINK,
} VIEW_SECTIONS;
QHash<int, QAction*> toolsMenuActions; // Holds ptr to the Menu Actions
QHash<int, QWidget*> dockWidgets; // Holds ptr to the Actual Dock widget
QHash<int, Qt::DockWidgetArea> dockWidgetLocations; // Holds the location
/**
* @brief Adds an already instantiated QDockedWidget to the Tools Menu
*
* This function does all the hosekeeping to have a QDockedWidget added to the
* tools menu and connects the QMenuAction to a slot that shows the widget and
* checks/unchecks the tools menu item
*
* @param widget The QDockedWidget being added
* @param title The entry that will appear in the Menu and in the QDockedWidget title bar
* @param slotName The slot to which the triggered() signal of the menu action will be connected.
* @param tool The ENUM defined in MainWindow.h that is associated to the widget
* @param location The default location for the QDockedWidget in case there is no previous key in the settings
*/
void addToToolsMenu (QWidget* widget, const QString title, const char * slotName, TOOLS_WIDGET_NAMES tool, Qt::DockWidgetArea location);
/**
* @brief Determines if a QDockWidget needs to be show and if so, shows it
*
* Based on the the autopilot and the current view it queries the settings and shows the
* widget if necessary
*
* @param widget The QDockWidget requested to be shown
* @param view The view for which the QDockWidget is requested
*/
void showTheWidget (TOOLS_WIDGET_NAMES widget, VIEW_SECTIONS view = VIEW_MAVLINK);
/**
* @brief Adds an already instantiated QWidget to the center stack
*
* This function does all the hosekeeping to have a QWidget added to the tools menu
* tools menu and connects the QMenuAction to a slot that shows the widget and
* checks/unchecks the tools menu item. This is used for all the central widgets (those in
* the center stack.
*
* @param widget The QWidget being added
* @param title The entry that will appear in the Menu
* @param slotName The slot to which the triggered() signal of the menu action will be connected.
* @param centralWidget The ENUM defined in MainWindow.h that is associated to the widget
*/
void addToCentralWidgetsMenu ( QWidget* widget, const QString title,const char * slotName, TOOLS_WIDGET_NAMES centralWidget);
/**
* @brief Determines if a QWidget needs to be show and if so, shows it
*
* Based on the the autopilot and the current view it queries the settings and shows the
* widget if necessary
*
* @param centralWidget The QWidget requested to be shown
* @param view The view for which the QWidget is requested
*/
void showTheCentralWidget (TOOLS_WIDGET_NAMES centralWidget, VIEW_SECTIONS view);
/** @brief Keeps track of the current view */
VIEW_SECTIONS currentView;
QStatusBar* statusBar;
QStatusBar* createStatusBar();
void loadWidgets();
void connectActions();
void clearView();
void buildWidgets();
void connectWidgets();
void arrangeCenterStack();
void configureWindowName();
QMenu* createCenterWidgetMenu();
QMenu* createDockWidgetMenu();
void buildCommonWidgets();
void buildPxWidgets();
void buildSlugsWidgets();
void connectCommonWidgets();
void connectPxWidgets();
void connectSlugsWidgets();
void arrangeCommonCenterStack();
void arrangePxCenterStack();
void arrangeSlugsCenterStack();
void connectCommonActions();
void connectPxActions();
void connectSlugsActions();
void configureWindowName();
// TODO Should be moved elsewhere, as the protocol does not belong to the UI
MAVLinkProtocol* mavlink;
@ -174,13 +335,13 @@ protected: @@ -174,13 +335,13 @@ protected:
LinkInterface* udpLink;
QSettings settings;
// Widget lists
QList<QPointer<QWidget> > centerWidgets;
QList<QPointer<QDockWidget> > dockWidgets;
QStackedWidget *centerStack;
// Center widgets
QPointer<Linecharts> linechartWidget;
QPointer<HUD> hudWidget;
QPointer<MapWidget> mapWidget;
QPointer<XMLCommProtocolWidget> protocolWidget;
QPointer<QGCDataPlot2D> dataplotWidget;
@ -203,7 +364,9 @@ protected: @@ -203,7 +364,9 @@ protected:
QPointer<QDockWidget> headDown1DockWidget;
QPointer<QDockWidget> headDown2DockWidget;
QPointer<QDockWidget> watchdogControlDockWidget;
QPointer<QDockWidget> headUpDockWidget;
QPointer<QDockWidget> hsiDockWidget;
QPointer<QDockWidget> rcViewDockWidget;
QPointer<QDockWidget> hudDockWidget;
@ -227,6 +390,7 @@ protected: @@ -227,6 +390,7 @@ protected:
QAction* killUASAct;
QAction* simulateUASAct;
LogCompressor* comp;
QString screenFileName;
QTimer* videoTimer;
@ -234,6 +398,8 @@ protected: @@ -234,6 +398,8 @@ protected:
private:
Ui::MainWindow ui;
QString buildMenuKey (SETTINGS_SECTIONS section , TOOLS_WIDGET_NAMES tool, VIEW_SECTIONS view);
};
#endif /* _MAINWINDOW_H_ */

170
src/ui/MainWindow.ui

@ -38,19 +38,17 @@ @@ -38,19 +38,17 @@
<x>0</x>
<y>0</y>
<width>1000</width>
<height>25</height>
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menuUnmanned_System">
<widget class="QMenu" name="menuMGround">
<property name="title">
<string>Unmanned System</string>
<string>File</string>
</property>
<addaction name="actionLiftoff"/>
<addaction name="actionLand"/>
<addaction name="actionEmergency_Land"/>
<addaction name="actionEmergency_Kill"/>
<addaction name="actionJoystick_Settings"/>
<addaction name="actionSimulate"/>
<addaction name="separator"/>
<addaction name="actionConfiguration"/>
<addaction name="actionExit"/>
</widget>
<widget class="QMenu" name="menuNetwork">
<property name="title">
@ -59,61 +57,58 @@ @@ -59,61 +57,58 @@
<addaction name="actionAdd_Link"/>
<addaction name="separator"/>
</widget>
<widget class="QMenu" name="menuWindow">
<widget class="QMenu" name="menuConnected_Systems">
<property name="title">
<string>Select System</string>
</property>
</widget>
<widget class="QMenu" name="menuUnmanned_System">
<property name="title">
<string>Window</string>
<string>Unmanned System</string>
</property>
<property name="separatorsCollapsible">
<bool>false</bool>
</property>
<addaction name="actionEngineerView"/>
<addaction name="actionPilotView"/>
<addaction name="actionOperatorView"/>
<addaction name="action3DMapView"/>
<addaction name="action3DView"/>
<addaction name="actionGoogleEarthView"/>
<addaction name="actionGlobalOperatorView"/>
<addaction name="actionLiftoff"/>
<addaction name="actionLand"/>
<addaction name="actionEmergency_Land"/>
<addaction name="actionEmergency_Kill"/>
<addaction name="separator"/>
<addaction name="actionShow_MAVLink_view"/>
<addaction name="actionShow_data_analysis_view"/>
<addaction name="actionShow_full_view"/>
<addaction name="actionStyleConfig"/>
<addaction name="actionShow_Slugs_View"/>
<addaction name="actionConfiguration"/>
</widget>
<widget class="QMenu" name="menuHelp">
<widget class="QMenu" name="menuTools">
<property name="title">
<string>Help</string>
<string>Tools</string>
</property>
<addaction name="actionOnline_documentation"/>
<addaction name="actionProject_Roadmap"/>
<addaction name="actionCredits_Developers"/>
</widget>
<widget class="QMenu" name="menuConnected_Systems">
<widget class="QMenu" name="menuHelp">
<property name="title">
<string>Select System</string>
<string>Help</string>
</property>
<addaction name="actionOnline_Documentation"/>
<addaction name="actionProject_Roadmap_2"/>
<addaction name="actionDeveloper_Credits"/>
</widget>
<widget class="QMenu" name="menuMGround">
<widget class="QMenu" name="menuPerspectives">
<property name="title">
<string>File</string>
<string>Perspectives</string>
</property>
<addaction name="actionJoystickSettings"/>
<addaction name="actionSimulate"/>
<addaction name="actionOperatorsView"/>
<addaction name="actionEngineersView"/>
<addaction name="actionPilotsView"/>
<addaction name="separator"/>
<addaction name="actionExit"/>
<addaction name="actionMavlinkView"/>
<addaction name="actionReloadStyle"/>
</widget>
<addaction name="menuMGround"/>
<addaction name="menuNetwork"/>
<addaction name="menuConnected_Systems"/>
<addaction name="menuUnmanned_System"/>
<addaction name="menuWindow"/>
<addaction name="menuTools"/>
<addaction name="menuPerspectives"/>
<addaction name="menuHelp"/>
</widget>
<widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<widget class="QStatusBar" name="statusBar"/>
<action name="actionExit">
<property name="icon">
@ -218,6 +213,9 @@ @@ -218,6 +213,9 @@
<property name="text">
<string>Joystick settings</string>
</property>
<property name="visible">
<bool>true</bool>
</property>
</action>
<action name="actionOperatorView">
<property name="icon">
@ -348,6 +346,90 @@ @@ -348,6 +346,90 @@
<string>Show Slugs View</string>
</property>
</action>
<action name="actionJoystick_Settings">
<property name="icon">
<iconset resource="../../mavground.qrc">
<normaloff>:/images/devices/input-gaming.svg</normaloff>:/images/devices/input-gaming.svg</iconset>
</property>
<property name="text">
<string>Joystick Settings</string>
</property>
<property name="visible">
<bool>false</bool>
</property>
</action>
<action name="actionOnline_Documentation">
<property name="icon">
<iconset resource="../../mavground.qrc">
<normaloff>:/images/apps/utilities-system-monitor.svg</normaloff>:/images/apps/utilities-system-monitor.svg</iconset>
</property>
<property name="text">
<string>Online Documentation</string>
</property>
</action>
<action name="actionProject_Roadmap_2">
<property name="icon">
<iconset resource="../../mavground.qrc">
<normaloff>:/images/status/software-update-available.svg</normaloff>:/images/status/software-update-available.svg</iconset>
</property>
<property name="text">
<string>Project Roadmap</string>
</property>
</action>
<action name="actionDeveloper_Credits">
<property name="icon">
<iconset resource="../../mavground.qrc">
<normaloff>:/images/categories/preferences-system.svg</normaloff>:/images/categories/preferences-system.svg</iconset>
</property>
<property name="text">
<string>Developer Credits</string>
</property>
</action>
<action name="actionOperatorsView">
<property name="icon">
<iconset resource="../../mavground.qrc">
<normaloff>:/images/status/weather-overcast.svg</normaloff>:/images/status/weather-overcast.svg</iconset>
</property>
<property name="text">
<string>Operator</string>
</property>
</action>
<action name="actionEngineersView">
<property name="icon">
<iconset resource="../../mavground.qrc">
<normaloff>:/images/apps/utilities-system-monitor.svg</normaloff>:/images/apps/utilities-system-monitor.svg</iconset>
</property>
<property name="text">
<string>Engineer</string>
</property>
</action>
<action name="actionMavlinkView">
<property name="icon">
<iconset resource="../../mavground.qrc">
<normaloff>:/images/devices/network-wired.svg</normaloff>:/images/devices/network-wired.svg</iconset>
</property>
<property name="text">
<string>Mavlink</string>
</property>
</action>
<action name="actionReloadStyle">
<property name="icon">
<iconset resource="../../mavground.qrc">
<normaloff>:/images/categories/applications-internet.svg</normaloff>:/images/categories/applications-internet.svg</iconset>
</property>
<property name="text">
<string>Reload Style</string>
</property>
</action>
<action name="actionPilotsView">
<property name="icon">
<iconset resource="../../mavground.qrc">
<normaloff>:/images/status/network-wireless-encrypted.svg</normaloff>:/images/status/network-wireless-encrypted.svg</iconset>
</property>
<property name="text">
<string>Pilot</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources>
@ -372,3 +454,5 @@ @@ -372,3 +454,5 @@
</connection>
</connections>
</ui>

1
src/ui/MapWidget.cc

@ -562,6 +562,7 @@ void MapWidget::updateGlobalPosition(UASInterface* uas, double lat, double lon, @@ -562,6 +562,7 @@ void MapWidget::updateGlobalPosition(UASInterface* uas, double lat, double lon,
// Icon
QPen* pointpen = new QPen(uasColor);
qDebug() << uas->getUASName();
MAV2DIcon* p = new MAV2DIcon(lat, lon, 20, uas->getUASName(), qmapcontrol::Point::Middle, pointpen);
uasIcons.insert(uas->getUASID(), p);
geomLayer->addGeometry(p);

9
src/ui/ParameterInterface.cc

@ -51,6 +51,15 @@ ParameterInterface::ParameterInterface(QWidget *parent) : @@ -51,6 +51,15 @@ ParameterInterface::ParameterInterface(QWidget *parent) :
// Setup UI connections
connect(m_ui->vehicleComboBox, SIGNAL(activated(int)), this, SLOT(selectUAS(int)));
// Get current MAV list
QList<UASInterface*> systems = UASManager::instance()->getUASList();
// Add each of them
foreach (UASInterface* sys, systems)
{
addUAS(sys);
}
// Setup MAV connections
connect(UASManager::instance(), SIGNAL(UASCreated(UASInterface*)), this, SLOT(addUAS(UASInterface*)));
this->setVisible(false);

4
src/ui/QGCRemoteControlView.cc

@ -115,10 +115,10 @@ void QGCRemoteControlView::setUASId(int id) @@ -115,10 +115,10 @@ void QGCRemoteControlView::setUASId(int id)
connect(newUAS, SIGNAL(remoteControlRSSIChanged(float)), this, SLOT(setRemoteRSSI(float)));
connect(newUAS, SIGNAL(remoteControlChannelRawChanged(int,float)), this, SLOT(setChannelRaw(int,float)));
connect(newUAS, SIGNAL(remoteControlChannelRawChanged(int,float)), calibrationWindow, SLOT(setChannelRaw(int,float)));
// connect(newUAS, SIGNAL(remoteControlChannelRawChanged(int,float)), calibrationWindow, SLOT(setChannelRaw(int,float)));
connect(newUAS, SIGNAL(remoteControlChannelScaledChanged(int,float)), this, SLOT(setChannelScaled(int,float)));
connect(newUAS, SIGNAL(remoteControlChannelScaledChanged(int,float)), calibrationWindow, SLOT(setChannelScaled(int,float)));
// connect(newUAS, SIGNAL(remoteControlChannelScaledChanged(int,float)), calibrationWindow, SLOT(setChannelScaled(int,float)));
}
}

9
src/ui/SerialConfigurationWindow.cc

@ -510,12 +510,3 @@ void SerialConfigurationWindow::setLinkName(QString name) @@ -510,12 +510,3 @@ void SerialConfigurationWindow::setLinkName(QString name)
setWindowTitle(tr("Configuration of ") + link->getName());
}
void SerialConfigurationWindow::remove()
{
link->disconnect();
//delete link;
//delete action;
this->window()->close();
qDebug() << "TODO: Link cannot be deleted: SerialConfigurationWindow::remove() NOT IMPLEMENTED!";
}

6
src/ui/SerialConfigurationWindow.h

@ -60,12 +60,6 @@ public slots: @@ -60,12 +60,6 @@ public slots:
void setParityEven();
void setPortName(QString port);
void setLinkName(QString name);
/**
* @brief Remove this link
*
* Disconnects the associated link, removes it from all menus and closes the window.
*/
void remove();
void setupPortList();
protected slots:

95
src/ui/SlugsDataSensorView.cc

@ -41,10 +41,12 @@ void SlugsDataSensorView::addUAS(UASInterface* uas) @@ -41,10 +41,12 @@ void SlugsDataSensorView::addUAS(UASInterface* uas)
connect(slugsMav, SIGNAL(speedChanged(UASInterface*,double,double,double,quint64)), this, SLOT(slugSpeedLocalPositionChanged(UASInterface*,double,double,double,quint64)));
connect(slugsMav, SIGNAL(attitudeChanged(UASInterface*,double,double,double,quint64)), this, SLOT(slugAttitudeChanged(UASInterface*,double,double,double,quint64)));
connect(slugsMav, SIGNAL(globalPositionChanged(UASInterface*,double,double,double,quint64)), this, SLOT(slugsGlobalPositionChanged(UASInterface*,double,double,double,quint64)));
connect(slugsMav,SIGNAL(slugsGPSCogSog(int,double,double)),this,SLOT(slugsGPSCogSog(int,double,double)));
//connect slugs especial messages
//connect slugs especial messages
connect(slugsMav, SIGNAL(slugsSensorBias(int,const mavlink_sensor_bias_t&)), this, SLOT(slugsSensorBiasChanged(int,const mavlink_sensor_bias_t&)));
connect(slugsMav, SIGNAL(slugsDiagnostic(int,const mavlink_diagnostic_t&)), this, SLOT(slugsDiagnosticMessageChanged(int,const mavlink_diagnostic_t&)));
connect(slugsMav, SIGNAL(slugsCPULoad(int,const mavlink_cpu_load_t&)), this, SLOT(slugsCpuLoadChanged(int,const mavlink_cpu_load_t&)));
@ -53,6 +55,8 @@ void SlugsDataSensorView::addUAS(UASInterface* uas) @@ -53,6 +55,8 @@ void SlugsDataSensorView::addUAS(UASInterface* uas)
connect(slugsMav, SIGNAL(slugsPWM(int,const mavlink_pwm_commands_t&)),this,SLOT(slugsPWMChanged(int,const mavlink_pwm_commands_t&)));
connect(slugsMav, SIGNAL(slugsFilteredData(int,const mavlink_filtered_data_t&)),this,SLOT(slugsFilteredDataChanged(int,const mavlink_filtered_data_t&)));
connect(slugsMav, SIGNAL(slugsGPSDateTime(int,const mavlink_gps_date_time_t&)),this,SLOT(slugsGPSDateTimeChanged(int,const mavlink_gps_date_time_t&)));
connect(slugsMav,SIGNAL(slugsAirData(int, const mavlink_air_data_t&)),this,SLOT(slugsAirDataChanged(int, const mavlink_air_data_t&)));
#endif // MAVLINK_ENABLED_SLUGS
// Set this UAS as active if it is the first one
@ -69,6 +73,15 @@ void SlugsDataSensorView::slugRawDataChanged(int uasId, const mavlink_raw_imu_t @@ -69,6 +73,15 @@ void SlugsDataSensorView::slugRawDataChanged(int uasId, const mavlink_raw_imu_t
ui->m_Axr->setText(QString::number(rawData.xacc));
ui->m_Ayr->setText(QString::number(rawData.yacc));
ui->m_Azr->setText(QString::number(rawData.zacc));
ui->m_Mxr->setText(QString::number(rawData.xmag));
ui->m_Myr->setText(QString::number(rawData.ymag));
ui->m_Mzr->setText(QString::number(rawData.zmag));
ui->m_Gxr->setText(QString::number(rawData.xgyro));
ui->m_Gyr->setText(QString::number(rawData.ygyro));
ui->m_Gzr->setText(QString::number(rawData.zgyro));
}
void SlugsDataSensorView::setActiveUAS(UASInterface* uas){
@ -85,9 +98,13 @@ void SlugsDataSensorView::slugsGlobalPositionChanged(UASInterface *uas, @@ -85,9 +98,13 @@ void SlugsDataSensorView::slugsGlobalPositionChanged(UASInterface *uas,
Q_UNUSED(uas);
Q_UNUSED(time);
ui->m_GpsLatitude->setText(QString::number(lat));
ui->m_GpsLongitude->setText(QString::number(lon));
ui->m_GpsHeight->setText(QString::number(alt));
qDebug()<<"GPS Position = "<<lat<<" - "<<lon<<" - "<<alt;
}
@ -103,6 +120,8 @@ void SlugsDataSensorView::slugLocalPositionChanged(UASInterface* uas, @@ -103,6 +120,8 @@ void SlugsDataSensorView::slugLocalPositionChanged(UASInterface* uas,
ui->ed_y->setPlainText(QString::number(y));
ui->ed_z->setPlainText(QString::number(z));
//qDebug()<<"Local Position = "<<x<<" - "<<y<<" - "<<z;
}
void SlugsDataSensorView::slugSpeedLocalPositionChanged(UASInterface* uas,
@ -117,6 +136,9 @@ void SlugsDataSensorView::slugSpeedLocalPositionChanged(UASInterface* uas, @@ -117,6 +136,9 @@ void SlugsDataSensorView::slugSpeedLocalPositionChanged(UASInterface* uas,
ui->ed_vy->setPlainText(QString::number(vy));
ui->ed_vz->setPlainText(QString::number(vz));
//qDebug()<<"Speed Local Position = "<<vx<<" - "<<vy<<" - "<<vz;
}
void SlugsDataSensorView::slugAttitudeChanged(UASInterface* uas,
@ -132,6 +154,8 @@ void SlugsDataSensorView::slugAttitudeChanged(UASInterface* uas, @@ -132,6 +154,8 @@ void SlugsDataSensorView::slugAttitudeChanged(UASInterface* uas,
ui->m_Pitch->setPlainText(QString::number(slugpitch));
ui->m_Yaw->setPlainText(QString::number(slugyaw));
qDebug()<<"Attitude change = "<<slugroll<<" - "<<slugpitch<<" - "<<slugyaw;
}
@ -148,6 +172,7 @@ void SlugsDataSensorView::slugsSensorBiasChanged(int systemId, @@ -148,6 +172,7 @@ void SlugsDataSensorView::slugsSensorBiasChanged(int systemId,
}
void SlugsDataSensorView::slugsDiagnosticMessageChanged(int systemId,
const mavlink_diagnostic_t& diagnostic){
Q_UNUSED(systemId);
@ -229,17 +254,75 @@ void SlugsDataSensorView::slugsFilteredDataChanged(int systemId, @@ -229,17 +254,75 @@ void SlugsDataSensorView::slugsFilteredDataChanged(int systemId,
void SlugsDataSensorView::slugsGPSDateTimeChanged(int systemId,
const mavlink_gps_date_time_t& gpsDateTime){
Q_UNUSED(systemId);
ui->m_GpsDate->setText(QString::number(gpsDateTime.month) + "/" +
QString::number(gpsDateTime.day) + "/" +
QString month, day;
month = QString::number(gpsDateTime.month);
day = QString::number(gpsDateTime.day);
if(gpsDateTime.month < 10) month = "0" + QString::number(gpsDateTime.month);
if(gpsDateTime.day < 10) day = "0" + QString::number(gpsDateTime.day);
ui->m_GpsDate->setText(day + "/" +
month + "/" +
QString::number(gpsDateTime.year));
ui->m_GpsTime->setText(QString::number(gpsDateTime.hour) + ":" +
QString::number(gpsDateTime.min) + ":" +
QString::number(gpsDateTime.sec));
QString hour, min, sec;
hour = QString::number(gpsDateTime.hour);
min = QString::number(gpsDateTime.min);
sec = QString::number(gpsDateTime.sec);
if(gpsDateTime.hour < 10) hour = "0" + QString::number(gpsDateTime.hour);
if(gpsDateTime.min < 10) min = "0" + QString::number(gpsDateTime.min);
if(gpsDateTime.sec < 10) sec = "0" + QString::number(gpsDateTime.sec);
ui->m_GpsTime->setText(hour + ":" +
min + ":" +
sec);
ui->m_GpsSat->setText(QString::number(gpsDateTime.visSat));
}
/**
* @brief Updates the air data widget - 171
*/
void SlugsDataSensorView::slugsAirDataChanged(int systemId, const mavlink_air_data_t &airData)
{
Q_UNUSED(systemId);
ui->ed_dynamic->setText(QString::number(airData.dynamicPressure));
ui->ed_static->setText(QString::number(airData.staticPressure));
ui->ed_temp->setText(QString::number(airData.temperature));
// qDebug()<<"Air Data = "<<airData.dynamicPressure<<" - "
// <<airData.staticPressure<<" - "
// <<airData.temperature;
}
/**
* @brief set COG and SOG values
*
* COG and SOG GPS display on the Widgets
*/
void SlugsDataSensorView::slugsGPSCogSog(int systemId,
double cog,
double sog)
{
Q_UNUSED(systemId);
ui->m_GpsCog->setText(QString::number(cog));
ui->m_GpsSog->setText(QString::number(sog));
}
#endif // MAVLINK_ENABLED_SLUGS

50
src/ui/SlugsDataSensorView.h

@ -70,6 +70,9 @@ public slots: @@ -70,6 +70,9 @@ public slots:
void setActiveUAS(UASInterface* uas);
/**
* @brief Updates the Raw Data widget
*/
void slugRawDataChanged (int uasId, const mavlink_raw_imu_t& rawData);
#ifdef MAVLINK_ENABLED_SLUGS
@ -114,58 +117,79 @@ public slots: @@ -114,58 +117,79 @@ public slots:
double lon,
double alt,
quint64 time);
/**
* @brief Updates the sensor bias widget
* @brief set COG and SOG values
*
* COG and SOG GPS display on the Widgets
*/
void slugsGPSCogSog(int systemId,
double cog,
double sog);
/**
* @brief Updates the CPU load widget - 170
*/
void slugsCpuLoadChanged(int systemId,
const mavlink_cpu_load_t& cpuLoad);
/**
* @brief Updates the air data widget - 171
*/
void slugsAirDataChanged(int systemId,
const mavlink_air_data_t& airData);
/**
* @brief Updates the sensor bias widget - 172
*/
void slugsSensorBiasChanged(int systemId,
const mavlink_sensor_bias_t& sensorBias);
/**
* @brief Updates the diagnostic widget
* @brief Updates the diagnostic widget - 173
*/
void slugsDiagnosticMessageChanged(int systemId,
const mavlink_diagnostic_t& diagnostic);
/**
* @brief Updates the CPU load widget
*/
void slugsCpuLoadChanged(int systemId,
const mavlink_cpu_load_t& cpuLoad);
/**
* @brief Updates the Navigation widget
* @brief Updates the Navigation widget - 176
*/
void slugsNavegationChanged(int systemId,
const mavlink_slugs_navigation_t& slugsNavigation);
/**
* @brief Updates the Data Log widget
* @brief Updates the Data Log widget - 177
*/
void slugsDataLogChanged(int systemId,
const mavlink_data_log_t& dataLog);
/**
* @brief Updates the PWM Commands widget
* @brief Updates the PWM Commands widget - 175
*/
void slugsPWMChanged(int systemId,
const mavlink_pwm_commands_t& pwmCommands);
/**
* @brief Updates the filtered sensor measurements widget
* @brief Updates the filtered sensor measurements widget - 178
*/
void slugsFilteredDataChanged(int systemId,
const mavlink_filtered_data_t& filteredData);
/**
* @brief Updates the gps Date Time widget
* @brief Updates the gps Date Time widget - 179
*/
void slugsGPSDateTimeChanged(int systemId,
const mavlink_gps_date_time_t& gpsDateTime);
#endif // MAVLINK_ENABLED_SLUGS
protected:

23
src/ui/SlugsDataSensorView.ui

@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>399</width>
<height>667</height>
<height>604</height>
</rect>
</property>
<property name="sizePolicy">
@ -24,18 +24,18 @@ @@ -24,18 +24,18 @@
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
<width>399</width>
<height>604</height>
</size>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_17">
<item>
<layout class="QGridLayout" name="gridLayout_23">
<item row="0" column="0">
<widget class="QTabWidget" name="SlugsSensorView_tabWidget">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -989,7 +989,7 @@ @@ -989,7 +989,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>13</height>
<height>5</height>
</size>
</property>
</spacer>
@ -1791,8 +1791,8 @@ @@ -1791,8 +1791,8 @@
<attribute name="title">
<string>Tab 2</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_11">
<item>
<layout class="QGridLayout" name="gridLayout_22">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="QGroupBox" name="gpsData_groupBox">
@ -4483,11 +4483,6 @@ @@ -4483,11 +4483,6 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Tab 4</string>
</attribute>
</widget>
</widget>
</item>
</layout>

8
src/ui/SlugsPIDControl.cpp

@ -55,6 +55,7 @@ void SlugsPIDControl::activeUasSet(UASInterface* uas) @@ -55,6 +55,7 @@ void SlugsPIDControl::activeUasSet(UASInterface* uas)
connect(slugsMav,SIGNAL(slugsPidValues(int,mavlink_pid_t)),this, SLOT(receivePidValues(int,mavlink_pid_t)) );
connect(ui->setGeneral_pushButton,SIGNAL(clicked()),this,SLOT(slugsTimerStartSet()));
connect(ui->getGeneral_pushButton,SIGNAL(clicked()),this,SLOT(slugsTimerStartGet()));
}
#endif // MAVLINK_ENABLED_SLUG
@ -473,9 +474,9 @@ void SlugsPIDControl::changeColor_GREEN_Pitch2dT_groupBox() @@ -473,9 +474,9 @@ void SlugsPIDControl::changeColor_GREEN_Pitch2dT_groupBox()
//create the packet
pidMessage.target = activeUAS->getUASID();
pidMessage.idx = 8;
pidMessage.pVal = ui->dR_P_set->text().toFloat();
pidMessage.iVal = ui->dR_I_set->text().toFloat();
pidMessage.dVal = ui->dR_D_set->text().toFloat();
pidMessage.pVal = ui->P2dT_FF_set->text().toFloat();
pidMessage.iVal = 0;//ui->dR_I_set->text().toFloat();
pidMessage.dVal = 0;//ui->dR_D_set->text().toFloat();
mavlink_message_t msg;
@ -543,6 +544,7 @@ void SlugsPIDControl::receivePidValues(int systemId, const mavlink_pid_t &pidVal @@ -543,6 +544,7 @@ void SlugsPIDControl::receivePidValues(int systemId, const mavlink_pid_t &pidVal
break;
case 8:
ui->P2dT_FF_get->setText(QString::number(pidValues.pVal));
break;
default:

4
src/ui/SlugsPIDControl.h

@ -283,10 +283,10 @@ private: @@ -283,10 +283,10 @@ private:
#endif
QTimer* refreshTimerSet; ///< The main timer, controls the update view
QTimer* refreshTimerGet; ///< The main timer, controls the update view
QTimer* refreshTimerGet; ///< The main timer, controls the update view
int counterRefreshSet;
int counterRefreshGet;
QMutex valuesMutex;
QMutex valuesMutex;
};
#endif // SLUGSPIDCONTROL_H

14
src/ui/SlugsPIDControl.ui

@ -122,13 +122,6 @@ @@ -122,13 +122,6 @@
</layout>
</item>
<item>
<widget class="QLabel" name="recepcion_label">
<property name="text">
<string>Recepcion</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -956,6 +949,13 @@ @@ -956,6 +949,13 @@
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="recepcion_label">
<property name="text">
<string>Recepcion</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

64
src/ui/SlugsPadCameraControl.cpp

@ -13,6 +13,9 @@ SlugsPadCameraControl::SlugsPadCameraControl(QWidget *parent) : @@ -13,6 +13,9 @@ SlugsPadCameraControl::SlugsPadCameraControl(QWidget *parent) :
ui->setupUi(this);
x1= 0;
y1 = 0;
bearingPad = 0;
distancePad = 0;
directionPad = "no";
}
@ -23,13 +26,25 @@ SlugsPadCameraControl::~SlugsPadCameraControl() @@ -23,13 +26,25 @@ SlugsPadCameraControl::~SlugsPadCameraControl()
void SlugsPadCameraControl::mouseMoveEvent(QMouseEvent *event)
{
emit mouseMoveCoord(event->x(),event->y());
//emit mouseMoveCoord(event->x(),event->y());
if(dragging)
{
if(abs(x1-event->x())>20 || abs(y1-event->y())>20)
{
getDeltaPositionPad(event->x(), event->y());
x1 = event->x();
y1 = event->y();
}
}
}
void SlugsPadCameraControl::mousePressEvent(QMouseEvent *event)
{
emit mousePressCoord(event->x(),event->y());
//emit mousePressCoord(event->x(),event->y());
dragging = true;
x1 = event->x();
y1 = event->y();
@ -37,8 +52,13 @@ void SlugsPadCameraControl::mousePressEvent(QMouseEvent *event) @@ -37,8 +52,13 @@ void SlugsPadCameraControl::mousePressEvent(QMouseEvent *event)
void SlugsPadCameraControl::mouseReleaseEvent(QMouseEvent *event)
{
emit mouseReleaseCoord(event->x(),event->y());
getDeltaPositionPad(event->x(), event->y());
dragging = false;
//emit mouseReleaseCoord(event->x(),event->y());
//getDeltaPositionPad(event->x(), event->y());
xFin = event->x();
yFin = event->y();
}
@ -59,6 +79,13 @@ void SlugsPadCameraControl::paintEvent(QPaintEvent *pe) @@ -59,6 +79,13 @@ void SlugsPadCameraControl::paintEvent(QPaintEvent *pe)
painter.drawLine(QPoint(ui->frame->geometry().topLeft().x(),ui->frame->height()/2),
QPoint(ui->frame->geometry().bottomRight().x(),ui->frame->height()/2));
painter.setPen(Qt::white);
//QPointF coordTemp = getPointBy_BearingDistance(ui->frame->width()/2,ui->frame->height()/2,bearingPad,distancePad);
painter.drawLine(QPoint(ui->frame->width()/2,ui->frame->height()/2),
QPoint(xFin,yFin));
// painter.drawLine(QPoint());
//painter.drawLines(padLines);
@ -92,7 +119,7 @@ void SlugsPadCameraControl::getDeltaPositionPad(int x2, int y2) @@ -92,7 +119,7 @@ void SlugsPadCameraControl::getDeltaPositionPad(int x2, int y2)
{
emit dirCursorText("right up");
//bearing = 315;
dir = "riht up";
dir = "right up";
}
else
{
@ -100,7 +127,7 @@ void SlugsPadCameraControl::getDeltaPositionPad(int x2, int y2) @@ -100,7 +127,7 @@ void SlugsPadCameraControl::getDeltaPositionPad(int x2, int y2)
{
emit dirCursorText("right");
//bearing = 315;
dir = "riht";
dir = "right";
}
else
{
@ -108,7 +135,7 @@ void SlugsPadCameraControl::getDeltaPositionPad(int x2, int y2) @@ -108,7 +135,7 @@ void SlugsPadCameraControl::getDeltaPositionPad(int x2, int y2)
{
emit dirCursorText("right down");
//bearing = 315;
dir = "riht down";
dir = "right down";
}
else
{
@ -158,8 +185,15 @@ void SlugsPadCameraControl::getDeltaPositionPad(int x2, int y2) @@ -158,8 +185,15 @@ void SlugsPadCameraControl::getDeltaPositionPad(int x2, int y2)
}
bearingPad = bearing;
distancePad = dist;
directionPad = dir;
emit changeCursorPosition(bearing, dist, dir);
update();
}
double SlugsPadCameraControl::getDistPixel(int x1, int y1, int x2, int y2)
@ -229,3 +263,19 @@ QPointF SlugsPadCameraControl::ObtenerMarcacionDistanciaPixel(double lon1, doubl @@ -229,3 +263,19 @@ QPointF SlugsPadCameraControl::ObtenerMarcacionDistanciaPixel(double lon1, doubl
return QPointF(marcacion,distancia);
}
QPointF SlugsPadCameraControl::getPointBy_BearingDistance(double lat1, double lon1, double rumbo, double distancia)
{
double lon2 = 0;
double lat2 = 0;
double rad= M_PI/180;
rumbo = rumbo*rad;
lon2=(lon1 + ((distancia/60) * (sin(rumbo))));
lat2=(lat1 + ((distancia/60) * (cos(rumbo))));
return QPointF(lon2,lat2);
}

9
src/ui/SlugsPadCameraControl.h

@ -21,6 +21,9 @@ public slots: @@ -21,6 +21,9 @@ public slots:
void getDeltaPositionPad(int x, int y);
double getDistPixel(int x1, int y1, int x2, int y2);
QPointF ObtenerMarcacionDistanciaPixel(double lon1, double lat1, double lon2, double lat2);
QPointF getPointBy_BearingDistance(double lat1, double lon1, double rumbo, double distancia);
signals:
void mouseMoveCoord(int x, int y);
@ -36,11 +39,17 @@ protected: @@ -36,11 +39,17 @@ protected:
void mouseMoveEvent(QMouseEvent* event);
void paintEvent(QPaintEvent *pe);
private:
Ui::SlugsPadCameraControl *ui;
bool dragging;
int x1;
int y1;
int xFin;
int yFin;
double bearingPad;
double distancePad;
QString directionPad;
};

83
src/ui/SlugsVideoCamControl.cpp

@ -20,29 +20,12 @@ @@ -20,29 +20,12 @@
SlugsVideoCamControl::SlugsVideoCamControl(QWidget *parent) :
QWidget(parent),
ui(new Ui::SlugsVideoCamControl)
//dragging(0)
{
ui->setupUi(this);
// x1= 0;
// y1 = 0;
connect(ui->viewCamBordeatMap_checkBox,SIGNAL(clicked(bool)),this,SLOT(changeViewCamBorderAtMapStatus(bool)));
// tL = ui->padCamContro_frame->frameGeometry().topLeft();
// bR = ui->padCamContro_frame->frameGeometry().bottomRight();
//ui->padCamContro_frame->setVisible(true);
// // create a layout for camera pad
// QGridLayout* padCameraLayout = new QGridLayout(this);
// padCameraLayout->setSpacing(2);
// padCameraLayout->setMargin(0);
// padCameraLayout->setAlignment(Qt::AlignTop);
//ui->padCamContro_frame->setLayout(padCameraLayout);
// create a camera pad widget
//test = new QPushButton(QIcon(":/images/actions/list-add.svg"), "", this);
//test->setMaximumWidth(50);
//ui->gridLayout->addWidget(test, 0,0);
connect(ui->viewCamBordeatMap_checkBox,SIGNAL(clicked(bool)),this,SLOT(changeViewCamBorderAtMapStatus(bool)));
padCamera = new SlugsPadCameraControl(this);
ui->gridLayout->addWidget(padCamera);
@ -53,28 +36,6 @@ SlugsVideoCamControl::SlugsVideoCamControl(QWidget *parent) : @@ -53,28 +36,6 @@ SlugsVideoCamControl::SlugsVideoCamControl(QWidget *parent) :
connect(padCamera,SIGNAL(changeCursorPosition(double,double,QString)),this,SLOT(getDeltaPositionPad(double,double,QString)));
//padCamera->setVisible(true);
// padCameraLayout->addWidget(padCamera);
// QGraphicsScene *scene = new QGraphicsScene(ui->CamControlPanel_graphicsView);
// scene->setItemIndexMethod(QGraphicsScene::NoIndex);
// scene->setSceneRect(-200, -200, 400, 400);
// setScene(scene);
// setCacheMode(CacheBackground);
// setViewportUpdateMode(BoundingRectViewportUpdate);
// setRenderHint(QPainter::Antialiasing);
// setTransformationAnchor(AnchorUnderMouse);
// setResizeAnchor(AnchorViewCenter);
// ui->CamControlPanel_graphicsView->installEventFilter(this);
// ui->label_x->installEventFilter(this);
}
SlugsVideoCamControl::~SlugsVideoCamControl()
@ -82,41 +43,41 @@ SlugsVideoCamControl::~SlugsVideoCamControl() @@ -82,41 +43,41 @@ SlugsVideoCamControl::~SlugsVideoCamControl()
delete ui;
}
void SlugsVideoCamControl::mouseMoveEvent(QMouseEvent *event)
{
Q_UNUSED(event);
//void SlugsVideoCamControl::mouseMoveEvent(QMouseEvent *event)
//{
// Q_UNUSED(event);
}
//}
void SlugsVideoCamControl::mousePressEvent(QMouseEvent *evnt)
{
Q_UNUSED(evnt);
//void SlugsVideoCamControl::mousePressEvent(QMouseEvent *evnt)
//{
// Q_UNUSED(evnt);
}
//}
void SlugsVideoCamControl::mouseReleaseEvent(QMouseEvent *evnt)
{
Q_UNUSED(evnt);
//void SlugsVideoCamControl::mouseReleaseEvent(QMouseEvent *evnt)
//{
// Q_UNUSED(evnt);
}
//}
void SlugsVideoCamControl::mousePadMoveEvent(int x, int y)
{
//void SlugsVideoCamControl::mousePadMoveEvent(int x, int y)
//{
}
//}
void SlugsVideoCamControl::mousePadPressEvent(int x, int y)
{
//void SlugsVideoCamControl::mousePadPressEvent(int x, int y)
//{
}
//}
void SlugsVideoCamControl::mousePadReleaseEvent(int x, int y)
{
//void SlugsVideoCamControl::mousePadReleaseEvent(int x, int y)
//{
}
//}
void SlugsVideoCamControl::changeViewCamBorderAtMapStatus(bool status)
{

41
src/ui/SlugsVideoCamControl.h

@ -27,22 +27,43 @@ public: @@ -27,22 +27,43 @@ public:
~SlugsVideoCamControl();
public slots:
/**
* @brief status = true: emit signal to draw a border cam over the map
*/
void changeViewCamBorderAtMapStatus(bool status);
void getDeltaPositionPad(double dir, double dist, QString dirText);
void mousePadPressEvent(int x, int y);
void mousePadReleaseEvent(int x, int y);
void mousePadMoveEvent(int x, int y);
/**
* @brief show the values of mousepad on ui (labels) and emit a changeCamPosition(signal)
* with values:
* bearing and distance from mouse over the pad
* dirText: direction of mouse movement in text format (up, right,right up,right down,
* left, left up, left down, down)
*/
void getDeltaPositionPad(double bearing, double distance, QString dirText);
// /**
// * @brief
// */
// void mousePadPressEvent(int x, int y);
// void mousePadReleaseEvent(int x, int y);
// void mousePadMoveEvent(int x, int y);
signals:
void changeCamPosition(double dist, double dir, QString textDir);
/**
* @brief emit values from mousepad:
* bearing and distance from mouse over the pad
* dirText: direction of mouse movement in text format (up, right,right up,right down,
* left, left up, left down, down)
*/
void changeCamPosition(double distance, double bearing, QString textDir);
/**
* @brief emit signal to draw a border cam over the map if status is true
*/
void viewCamBorderAtMap(bool status);
protected:
void mousePressEvent(QMouseEvent* event);
void mouseReleaseEvent(QMouseEvent* event);
void mouseMoveEvent(QMouseEvent* event);
// void mousePressEvent(QMouseEvent* event);
// void mouseReleaseEvent(QMouseEvent* event);
// void mouseMoveEvent(QMouseEvent* event);

6
src/ui/WaypointList.cc

@ -153,7 +153,7 @@ void WaypointList::loadWaypoints() @@ -153,7 +153,7 @@ void WaypointList::loadWaypoints()
QString fileName = QFileDialog::getOpenFileName(this, tr("Load File"), ".", tr("Waypoint File (*.txt)"));
uas->getWaypointManager().loadWaypoints(fileName);
}
}
}
void WaypointList::transmit()
@ -474,14 +474,14 @@ void WaypointList::on_clearWPListButton_clicked() @@ -474,14 +474,14 @@ void WaypointList::on_clearWPListButton_clicked()
if (uas)
{
emit clearPathclicked();
emit clearPathclicked();
const QVector<Waypoint *> &waypoints = uas->getWaypointManager().getWaypointList();
while(!waypoints.isEmpty())//for(int i = 0; i <= waypoints.size(); i++)
{
WaypointView* widget = wpViews.find(waypoints[0]).value();
widget->remove();
}
}
}
else
{
// if(isGlobalWP)

1
src/ui/WaypointView.cc

@ -146,6 +146,7 @@ void WaypointView::changedAction(int index) @@ -146,6 +146,7 @@ void WaypointView::changedAction(int index)
break;
case MAV_ACTION_NAVIGATE:
m_ui->autoContinue->show();
m_ui->orbitSpinBox->show();
break;
case MAV_ACTION_LOITER:
m_ui->orbitSpinBox->show();

2
src/ui/linechart/LinechartPlot.cc

@ -56,7 +56,7 @@ maxInterval(MAX_STORAGE_INTERVAL), @@ -56,7 +56,7 @@ maxInterval(MAX_STORAGE_INTERVAL),
timeScaleStep(DEFAULT_SCALE_INTERVAL), // 10 seconds
automaticScrollActive(false),
m_active(true),
m_groundTime(false),
m_groundTime(true),
d_data(NULL),
d_curve(NULL)
{

13
src/ui/linechart/Linecharts.cc

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
#include "Linecharts.h"
#include "UASManager.h"
Linecharts::Linecharts(QWidget *parent) :
QStackedWidget(parent),
@ -6,6 +7,18 @@ Linecharts::Linecharts(QWidget *parent) : @@ -6,6 +7,18 @@ Linecharts::Linecharts(QWidget *parent) :
active(true)
{
this->setVisible(false);
// Get current MAV list
QList<UASInterface*> systems = UASManager::instance()->getUASList();
// Add each of them
foreach (UASInterface* sys, systems)
{
addSystem(sys);
}
connect(UASManager::instance(), SIGNAL(UASCreated(UASInterface*)),
this, SLOT(addSystem(UASInterface*)));
connect(UASManager::instance(), SIGNAL(activeUASSet(int)),
this, SLOT(selectSystem(int)));
}

3
src/ui/map3D/GCManipulator.cc

@ -30,6 +30,7 @@ This file is part of the QGROUNDCONTROL project @@ -30,6 +30,7 @@ This file is part of the QGROUNDCONTROL project
*/
#include "GCManipulator.h"
#include <osg/Version>
GCManipulator::GCManipulator()
{
@ -254,7 +255,7 @@ GCManipulator::calcMovement(void) @@ -254,7 +255,7 @@ GCManipulator::calcMovement(void)
if (buttonMask == GUIEventAdapter::LEFT_MOUSE_BUTTON)
{
// rotate camera
#ifdef __APPLE__
#if ((OPENSCENEGRAPH_MAJOR_VERSION == 2) & (OPENSCENEGRAPH_MINOR_VERSION > 8)) | (OPENSCENEGRAPH_MAJOR_VERSION > 2)
osg::Vec3d axis;
#else
osg::Vec3 axis;

5
src/ui/map3D/QMap3D.cc

@ -38,8 +38,13 @@ This file is part of the QGROUNDCONTROL project @@ -38,8 +38,13 @@ This file is part of the QGROUNDCONTROL project
QMap3D::QMap3D(QWidget * parent, const char * name, WindowFlags f) :
QWidget(parent,f)
{
Q_UNUSED(name);
setupUi(this);
#if ((OPENSCENEGRAPH_MAJOR_VERSION == 2) & (OPENSCENEGRAPH_MINOR_VERSION > 8)) | (OPENSCENEGRAPH_MAJOR_VERSION > 2)
graphicsView->setCameraManipulator(new osgEarth::Util::EarthManipulator);
#else
graphicsView->setCameraManipulator(new osgEarthUtil::EarthManipulator);
#endif
graphicsView->setSceneData(new osg::Group);
graphicsView->updateCamera();
show();

Loading…
Cancel
Save