diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index 0de09c58a60ece411b7e7a6abacb1cfe02ce7b5d..a9594a43ac4e6d314cc9a0d03eb0b3f1a4abf406 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -1,463 +1,466 @@ -# ------------------------------------------------- -# QGroundControl - Micro Air Vehicle Groundstation -# Please see our website at -# Author: -# Lorenz Meier -# (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 . -# ------------------------------------------------- -# Include QMapControl map library -# prefer version from external directory / -# from http://github.com/pixhawk/qmapcontrol/ -# over bundled version in lib directory -# Version from GIT repository is preferred -# include ( "../qmapcontrol/QMapControl/QMapControl.pri" ) #{ -# Include bundled version if necessary - -include(lib/QMapControl/QMapControl.pri) -include(lib/nmea/nmea.pri) - -# message("Including bundled QMapControl version as FALLBACK. This is fine on Linux and MacOS, but not the best choice in Windows") -QT += network \ - opengl \ - svg \ - xml \ - phonon \ - webkit -TEMPLATE = app -TARGET = qgroundcontrol -BASEDIR = $$IN_PWD -TARGETDIR = $$OUT_PWD -BUILDDIR = $$TARGETDIR/build -LANGUAGE = C++ -OBJECTS_DIR = $$BUILDDIR/obj -MOC_DIR = $$BUILDDIR/moc -UI_HEADERS_DIR = src/ui/generated -MAVLINK_CONF = "" - -# If the user config file exists, it will be included. -# if the variable MAVLINK_CONF contains the name of an -# additional project, QGroundControl includes the support -# of custom MAVLink messages of this project -exists(user_config.pri) { - include(user_config.pri) - message("----- USING CUSTOM USER QGROUNDCONTROL CONFIG FROM user_config.pri -----") - message("Adding support for additional MAVLink messages for: " $$MAVLINK_CONF) - message("------------------------------------------------------------------------") -} - -INCLUDEPATH += $$BASEDIR/../mavlink/include/common -contains(MAVLINK_CONF, pixhawk) { - # Remove the default set - it is included anyway - INCLUDEPATH -= $$BASEDIR/../mavlink/include/common - - # PIXHAWK SPECIAL MESSAGES - INCLUDEPATH += $$BASEDIR/../mavlink/include/pixhawk - DEFINES += QGC_USE_PIXHAWK_MESSAGES -} -contains(MAVLINK_CONF, slugs) { - # Remove the default set - it is included anyway - INCLUDEPATH -= $$BASEDIR/../mavlink/include/common - - # SLUGS SPECIAL MESSAGES - INCLUDEPATH += $$BASEDIR/../mavlink/include/slugs - DEFINES += QGC_USE_SLUGS_MESSAGES -} -contains(MAVLINK_CONF, ualberta) { - # Remove the default set - it is included anyway - INCLUDEPATH -= $$BASEDIR/../mavlink/include/common - - # UALBERTA SPECIAL MESSAGES - INCLUDEPATH += $$BASEDIR/../mavlink/include/ualberta - DEFINES += QGC_USE_UALBERTA_MESSAGES -} -contains(MAVLINK_CONF, ardupilotmega) { - # Remove the default set - it is included anyway - INCLUDEPATH -= $$BASEDIR/../mavlink/include/common - - # UALBERTA SPECIAL MESSAGES - INCLUDEPATH += $$BASEDIR/../mavlink/include/ardupilotmega - DEFINES += QGC_USE_ARDUPILOTMEGA_MESSAGES -} - -# } -# Include general settings for MAVGround -# necessary as last include to override any non-acceptable settings -# done by the plugins above -include(qgroundcontrol.pri) - -# QWT plot and QExtSerial depend on paths set by qgroundcontrol.pri -# Include serial port library -include(src/lib/qextserialport/qextserialport.pri) - -# Include QWT plotting library -include(src/lib/qwt/qwt.pri) -DEPENDPATH += . \ - lib/QMapControl \ - lib/QMapControl/src \ - plugins -INCLUDEPATH += . \ - lib/QMapControl \ - $$BASEDIR/../mavlink/include - -# ../mavlink/include \ -# MAVLink/include \ -# mavlink/include -# Input -FORMS += src/ui/MainWindow.ui \ - src/ui/CommSettings.ui \ - src/ui/SerialSettings.ui \ - src/ui/UASControl.ui \ - src/ui/UASList.ui \ - src/ui/UASInfo.ui \ - src/ui/Linechart.ui \ - src/ui/UASView.ui \ - src/ui/ParameterInterface.ui \ - src/ui/WaypointList.ui \ - src/ui/WaypointView.ui \ - src/ui/ObjectDetectionView.ui \ - src/ui/JoystickWidget.ui \ - src/ui/DebugConsole.ui \ - src/ui/MapWidget.ui \ - src/ui/XMLCommProtocolWidget.ui \ - src/ui/HDDisplay.ui \ - src/ui/MAVLinkSettingsWidget.ui \ - src/ui/AudioOutputWidget.ui \ - src/ui/QGCSensorSettingsWidget.ui \ - src/ui/watchdog/WatchdogControl.ui \ - src/ui/watchdog/WatchdogProcessView.ui \ - src/ui/watchdog/WatchdogView.ui \ - src/ui/QGCFirmwareUpdate.ui \ - src/ui/QGCPxImuFirmwareUpdate.ui \ - src/ui/QGCDataPlot2D.ui \ - src/ui/QGCRemoteControlView.ui \ - src/ui/QMap3D.ui \ - src/ui/QGCWebView.ui \ - src/ui/map3D/QGCGoogleEarthView.ui \ - src/ui/SlugsDataSensorView.ui \ - src/ui/SlugsHilSim.ui \ - src/ui/SlugsPIDControl.ui \ - src/ui/SlugsVideoCamControl.ui \ - src/ui/SlugsPadCameraControl.ui \ - src/ui/uas/QGCUnconnectedInfoWidget.ui \ - src/ui/designer/QGCToolWidget.ui \ - src/ui/designer/QGCParamSlider.ui \ - src/ui/designer/QGCActionButton.ui \ - src/ui/QGCMAVLinkLogPlayer.ui \ - src/ui/QGCWaypointListMulti.ui \ - src/ui/mission/QGCCustomWaypointAction.ui \ - src/ui/QGCUDPLinkConfiguration.ui \ - src/ui/QGCSettingsWidget.ui - -INCLUDEPATH += src \ - src/ui \ - src/ui/linechart \ - src/ui/uas \ - src/ui/map \ - src/uas \ - src/comm \ - include/ui \ - src/input \ - src/lib/qmapcontrol \ - src/ui/mavlink \ - src/ui/param \ - src/ui/watchdog \ - src/ui/map3D \ - src/ui/designer - -HEADERS += src/MG.h \ - src/Core.h \ - src/uas/UASInterface.h \ - src/uas/UAS.h \ - src/uas/UASManager.h \ - src/comm/LinkManager.h \ - src/comm/LinkInterface.h \ - src/comm/SerialLinkInterface.h \ - src/comm/SerialLink.h \ - src/comm/SerialSimulationLink.h \ - src/comm/ProtocolInterface.h \ - src/comm/MAVLinkProtocol.h \ - src/comm/AS4Protocol.h \ - src/ui/CommConfigurationWindow.h \ - src/ui/SerialConfigurationWindow.h \ - src/ui/MainWindow.h \ - src/ui/uas/UASControlWidget.h \ - src/ui/uas/UASListWidget.h \ - src/ui/uas/UASInfoWidget.h \ - src/ui/HUD.h \ - src/ui/linechart/LinechartWidget.h \ - src/ui/linechart/LinechartPlot.h \ - src/ui/linechart/Scrollbar.h \ - src/ui/linechart/ScrollZoomer.h \ - src/configuration.h \ - src/ui/uas/UASView.h \ - src/ui/CameraView.h \ - src/comm/MAVLinkSimulationLink.h \ - src/comm/UDPLink.h \ - src/ui/ParameterInterface.h \ - src/ui/WaypointList.h \ - src/Waypoint.h \ - src/ui/WaypointView.h \ - src/ui/ObjectDetectionView.h \ - src/input/JoystickInput.h \ - src/ui/JoystickWidget.h \ - src/ui/DebugConsole.h \ - src/ui/MapWidget.h \ - src/ui/XMLCommProtocolWidget.h \ - src/ui/mavlink/DomItem.h \ - src/ui/mavlink/DomModel.h \ - src/comm/MAVLinkXMLParser.h \ - src/ui/HDDisplay.h \ - src/ui/MAVLinkSettingsWidget.h \ - src/ui/AudioOutputWidget.h \ - src/GAudioOutput.h \ - src/LogCompressor.h \ - src/ui/QGCParamWidget.h \ - src/ui/QGCSensorSettingsWidget.h \ - src/ui/linechart/Linecharts.h \ - src/uas/SlugsMAV.h \ - src/uas/PxQuadMAV.h \ - src/uas/ArduPilotMegaMAV.h \ - src/comm/MAVLinkSyntaxHighlighter.h \ - src/ui/watchdog/WatchdogControl.h \ - src/ui/watchdog/WatchdogProcessView.h \ - src/ui/watchdog/WatchdogView.h \ - src/uas/UASWaypointManager.h \ - src/ui/HSIDisplay.h \ - src/QGC.h \ - src/ui/QGCFirmwareUpdate.h \ - src/ui/QGCPxImuFirmwareUpdate.h \ - src/ui/QGCDataPlot2D.h \ - src/ui/linechart/IncrementalPlot.h \ - src/ui/map/Waypoint2DIcon.h \ - src/ui/map/MAV2DIcon.h \ - src/ui/QGCRemoteControlView.h \ - src/ui/RadioCalibration/RadioCalibrationData.h \ - src/ui/RadioCalibration/RadioCalibrationWindow.h \ - src/ui/RadioCalibration/AirfoilServoCalibrator.h \ - src/ui/RadioCalibration/SwitchCalibrator.h \ - src/ui/RadioCalibration/CurveCalibrator.h \ - src/ui/RadioCalibration/AbstractCalibrator.h \ - src/comm/QGCMAVLink.h \ - src/ui/QGCWebView.h \ - src/ui/map3D/QGCWebPage.h \ - src/ui/SlugsDataSensorView.h \ - src/ui/SlugsHilSim.h \ - src/ui/SlugsPIDControl.h \ - src/ui/SlugsVideoCamControl.h \ - src/ui/SlugsPadCameraControl.h \ - src/ui/QGCMainWindowAPConfigurator.h \ - src/comm/MAVLinkSwarmSimulationLink.h \ - src/ui/uas/QGCUnconnectedInfoWidget.h \ - src/ui/designer/QGCToolWidget.h \ - src/ui/designer/QGCParamSlider.h \ - src/ui/designer/QGCActionButton.h \ - src/ui/designer/QGCToolWidgetItem.h \ - src/ui/QGCMAVLinkLogPlayer.h \ - src/comm/MAVLinkSimulationWaypointPlanner.h \ - src/comm/MAVLinkSimulationMAV.h \ - src/uas/QGCMAVLinkUASFactory.h \ - src/ui/QGCWaypointListMulti.h \ - src/ui/QGCUDPLinkConfiguration.h \ - src/ui/QGCSettingsWidget.h - -# Google Earth is only supported on Mac OS and Windows with Visual Studio Compiler -macx|win32-msvc2008: { - HEADERS += src/ui/map3D/QGCGoogleEarthView.h -} - -contains(DEPENDENCIES_PRESENT, osg) { - message("Including headers for OpenSceneGraph") - - # Enable only if OpenSceneGraph is available - HEADERS += src/ui/map3D/Q3DWidget.h \ - src/ui/map3D/GCManipulator.h \ - src/ui/map3D/ImageWindowGeode.h \ - src/ui/map3D/QOSGWidget.h \ - src/ui/map3D/PixhawkCheetahGeode.h \ - src/ui/map3D/Pixhawk3DWidget.h \ - src/ui/map3D/Q3DWidgetFactory.h \ - src/ui/map3D/WebImageCache.h \ - src/ui/map3D/WebImage.h \ - src/ui/map3D/TextureCache.h \ - src/ui/map3D/Texture.h \ - src/ui/map3D/Imagery.h \ - src/ui/map3D/HUDScaleGeode.h \ - src/ui/map3D/WaypointGroupNode.h - contains(DEPENDENCIES_PRESENT, osgearth) { - message("Including headers for OSGEARTH") - - # Enable only if OpenSceneGraph is available - HEADERS += src/ui/map3D/QMap3D.h - } -} -contains(DEPENDENCIES_PRESENT, libfreenect) { - message("Including headers for libfreenect") - - # Enable only if libfreenect is available - HEADERS += src/input/Freenect.h -} - -SOURCES += src/main.cc \ - src/Core.cc \ - src/uas/UASManager.cc \ - src/uas/UAS.cc \ - src/comm/LinkManager.cc \ - src/comm/SerialLink.cc \ - src/comm/SerialSimulationLink.cc \ - src/comm/MAVLinkProtocol.cc \ - src/comm/AS4Protocol.cc \ - src/ui/CommConfigurationWindow.cc \ - src/ui/SerialConfigurationWindow.cc \ - src/ui/MainWindow.cc \ - src/ui/uas/UASControlWidget.cc \ - src/ui/uas/UASListWidget.cc \ - src/ui/uas/UASInfoWidget.cc \ - src/ui/HUD.cc \ - src/ui/linechart/LinechartWidget.cc \ - src/ui/linechart/LinechartPlot.cc \ - src/ui/linechart/Scrollbar.cc \ - src/ui/linechart/ScrollZoomer.cc \ - src/ui/uas/UASView.cc \ - src/ui/CameraView.cc \ - src/comm/MAVLinkSimulationLink.cc \ - src/comm/UDPLink.cc \ - src/ui/ParameterInterface.cc \ - src/ui/WaypointList.cc \ - src/Waypoint.cc \ - src/ui/WaypointView.cc \ - src/ui/ObjectDetectionView.cc \ - src/input/JoystickInput.cc \ - src/ui/JoystickWidget.cc \ - src/ui/DebugConsole.cc \ - src/ui/MapWidget.cc \ - src/ui/XMLCommProtocolWidget.cc \ - src/ui/mavlink/DomItem.cc \ - src/ui/mavlink/DomModel.cc \ - src/comm/MAVLinkXMLParser.cc \ - src/ui/HDDisplay.cc \ - src/ui/MAVLinkSettingsWidget.cc \ - src/ui/AudioOutputWidget.cc \ - src/GAudioOutput.cc \ - src/LogCompressor.cc \ - src/ui/QGCParamWidget.cc \ - src/ui/QGCSensorSettingsWidget.cc \ - src/ui/linechart/Linecharts.cc \ - src/uas/SlugsMAV.cc \ - src/uas/PxQuadMAV.cc \ - src/uas/ArduPilotMegaMAV.cc \ - src/comm/MAVLinkSyntaxHighlighter.cc \ - src/ui/watchdog/WatchdogControl.cc \ - src/ui/watchdog/WatchdogProcessView.cc \ - src/ui/watchdog/WatchdogView.cc \ - src/uas/UASWaypointManager.cc \ - src/ui/HSIDisplay.cc \ - src/QGC.cc \ - src/ui/QGCFirmwareUpdate.cc \ - src/ui/QGCPxImuFirmwareUpdate.cc \ - src/ui/QGCDataPlot2D.cc \ - src/ui/linechart/IncrementalPlot.cc \ - src/ui/map/Waypoint2DIcon.cc \ - src/ui/map/MAV2DIcon.cc \ - src/ui/QGCRemoteControlView.cc \ - src/ui/RadioCalibration/RadioCalibrationWindow.cc \ - src/ui/RadioCalibration/AirfoilServoCalibrator.cc \ - src/ui/RadioCalibration/SwitchCalibrator.cc \ - src/ui/RadioCalibration/CurveCalibrator.cc \ - src/ui/RadioCalibration/AbstractCalibrator.cc \ - src/ui/RadioCalibration/RadioCalibrationData.cc \ - src/ui/QGCWebView.cc \ - src/ui/map3D/QGCWebPage.cc \ - src/ui/SlugsDataSensorView.cc \ - src/ui/SlugsHilSim.cc \ - src/ui/SlugsPIDControl.cpp \ - src/ui/SlugsVideoCamControl.cpp \ - src/ui/SlugsPadCameraControl.cpp \ - src/ui/QGCMainWindowAPConfigurator.cc \ - src/comm/MAVLinkSwarmSimulationLink.cc \ - src/ui/uas/QGCUnconnectedInfoWidget.cc \ - src/ui/designer/QGCToolWidget.cc \ - src/ui/designer/QGCParamSlider.cc \ - src/ui/designer/QGCActionButton.cc \ - src/ui/designer/QGCToolWidgetItem.cc \ - src/ui/QGCMAVLinkLogPlayer.cc \ - src/comm/MAVLinkSimulationWaypointPlanner.cc \ - src/comm/MAVLinkSimulationMAV.cc \ - src/uas/QGCMAVLinkUASFactory.cc \ - src/ui/QGCWaypointListMulti.cc \ - src/ui/QGCUDPLinkConfiguration.cc \ - src/ui/QGCSettingsWidget.cc - -macx|win32-msvc2008: { - SOURCES += src/ui/map3D/QGCGoogleEarthView.cc -} - -contains(DEPENDENCIES_PRESENT, osg) { - message("Including sources for OpenSceneGraph") - - # Enable only if OpenSceneGraph is available - SOURCES += src/ui/map3D/Q3DWidget.cc \ - src/ui/map3D/ImageWindowGeode.cc \ - src/ui/map3D/GCManipulator.cc \ - src/ui/map3D/QOSGWidget.cc \ - src/ui/map3D/PixhawkCheetahGeode.cc \ - src/ui/map3D/Pixhawk3DWidget.cc \ - src/ui/map3D/Q3DWidgetFactory.cc \ - src/ui/map3D/WebImageCache.cc \ - src/ui/map3D/WebImage.cc \ - src/ui/map3D/TextureCache.cc \ - src/ui/map3D/Texture.cc \ - src/ui/map3D/Imagery.cc \ - src/ui/map3D/HUDScaleGeode.cc \ - src/ui/map3D/WaypointGroupNode.cc \ - - - contains(DEPENDENCIES_PRESENT, osgearth) { - message("Including sources for osgEarth") - - # Enable only if OpenSceneGraph is available - SOURCES += src/ui/map3D/QMap3D.cc - } -} -contains(DEPENDENCIES_PRESENT, libfreenect) { - message("Including sources for libfreenect") - - # Enable only if libfreenect is available - SOURCES += src/input/Freenect.cc -} -RESOURCES += mavground.qrc - -# Include RT-LAB Library -win32:exists(src/lib/opalrt/OpalApi.h):exists(C:/OPAL-RT/RT-LAB7.2.4/Common/bin) { - message("Building support for Opal-RT") - LIBS += -LC:/OPAL-RT/RT-LAB7.2.4/Common/bin \ - -lOpalApi - INCLUDEPATH += src/lib/opalrt - HEADERS += src/comm/OpalRT.h \ - src/comm/OpalLink.h \ - src/comm/Parameter.h \ - src/comm/QGCParamID.h \ - src/comm/ParameterList.h \ - src/ui/OpalLinkConfigurationWindow.h - SOURCES += src/comm/OpalRT.cc \ - src/comm/OpalLink.cc \ - src/comm/Parameter.cc \ - src/comm/QGCParamID.cc \ - src/comm/ParameterList.cc \ - src/ui/OpalLinkConfigurationWindow.cc - FORMS += src/ui/OpalLinkSettings.ui - DEFINES += OPAL_RT -} - -TRANSLATIONS += es-MX.ts \ - en-US.ts +# ------------------------------------------------- +# QGroundControl - Micro Air Vehicle Groundstation +# Please see our website at +# Author: +# Lorenz Meier +# (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 . +# ------------------------------------------------- +# Include QMapControl map library +# prefer version from external directory / +# from http://github.com/pixhawk/qmapcontrol/ +# over bundled version in lib directory +# Version from GIT repository is preferred +# include ( "../qmapcontrol/QMapControl/QMapControl.pri" ) #{ +# Include bundled version if necessary + +include(lib/QMapControl/QMapControl.pri) +include(lib/nmea/nmea.pri) + +# message("Including bundled QMapControl version as FALLBACK. This is fine on Linux and MacOS, but not the best choice in Windows") +QT += network \ + opengl \ + svg \ + xml \ + phonon \ + webkit +TEMPLATE = app +TARGET = qgroundcontrol +BASEDIR = $$IN_PWD +TARGETDIR = $$OUT_PWD +BUILDDIR = $$TARGETDIR/build +LANGUAGE = C++ +OBJECTS_DIR = $$BUILDDIR/obj +MOC_DIR = $$BUILDDIR/moc +UI_HEADERS_DIR = src/ui/generated +MAVLINK_CONF = "" + +# If the user config file exists, it will be included. +# if the variable MAVLINK_CONF contains the name of an +# additional project, QGroundControl includes the support +# of custom MAVLink messages of this project +exists(user_config.pri) { + include(user_config.pri) + message("----- USING CUSTOM USER QGROUNDCONTROL CONFIG FROM user_config.pri -----") + message("Adding support for additional MAVLink messages for: " $$MAVLINK_CONF) + message("------------------------------------------------------------------------") +} + +INCLUDEPATH += $$BASEDIR/../mavlink/include/common +contains(MAVLINK_CONF, pixhawk) { + # Remove the default set - it is included anyway + INCLUDEPATH -= $$BASEDIR/../mavlink/include/common + + # PIXHAWK SPECIAL MESSAGES + INCLUDEPATH += $$BASEDIR/../mavlink/include/pixhawk + DEFINES += QGC_USE_PIXHAWK_MESSAGES +} +contains(MAVLINK_CONF, slugs) { + # Remove the default set - it is included anyway + INCLUDEPATH -= $$BASEDIR/../mavlink/include/common + + # SLUGS SPECIAL MESSAGES + INCLUDEPATH += $$BASEDIR/../mavlink/include/slugs + DEFINES += QGC_USE_SLUGS_MESSAGES +} +contains(MAVLINK_CONF, ualberta) { + # Remove the default set - it is included anyway + INCLUDEPATH -= $$BASEDIR/../mavlink/include/common + + # UALBERTA SPECIAL MESSAGES + INCLUDEPATH += $$BASEDIR/../mavlink/include/ualberta + DEFINES += QGC_USE_UALBERTA_MESSAGES +} +contains(MAVLINK_CONF, ardupilotmega) { + # Remove the default set - it is included anyway + INCLUDEPATH -= $$BASEDIR/../mavlink/include/common + + # UALBERTA SPECIAL MESSAGES + INCLUDEPATH += $$BASEDIR/../mavlink/include/ardupilotmega + DEFINES += QGC_USE_ARDUPILOTMEGA_MESSAGES +} + +# } +# Include general settings for MAVGround +# necessary as last include to override any non-acceptable settings +# done by the plugins above +include(qgroundcontrol.pri) + +# QWT plot and QExtSerial depend on paths set by qgroundcontrol.pri +# Include serial port library +include(src/lib/qextserialport/qextserialport.pri) + +# Include QWT plotting library +include(src/lib/qwt/qwt.pri) +DEPENDPATH += . \ + lib/QMapControl \ + lib/QMapControl/src \ + plugins +INCLUDEPATH += . \ + lib/QMapControl \ + $$BASEDIR/../mavlink/include + +# ../mavlink/include \ +# MAVLink/include \ +# mavlink/include +# Input +FORMS += src/ui/MainWindow.ui \ + src/ui/CommSettings.ui \ + src/ui/SerialSettings.ui \ + src/ui/UASControl.ui \ + src/ui/UASList.ui \ + src/ui/UASInfo.ui \ + src/ui/Linechart.ui \ + src/ui/UASView.ui \ + src/ui/ParameterInterface.ui \ + src/ui/WaypointList.ui \ + src/ui/WaypointView.ui \ + src/ui/ObjectDetectionView.ui \ + src/ui/JoystickWidget.ui \ + src/ui/DebugConsole.ui \ + src/ui/MapWidget.ui \ + src/ui/XMLCommProtocolWidget.ui \ + src/ui/HDDisplay.ui \ + src/ui/MAVLinkSettingsWidget.ui \ + src/ui/AudioOutputWidget.ui \ + src/ui/QGCSensorSettingsWidget.ui \ + src/ui/watchdog/WatchdogControl.ui \ + src/ui/watchdog/WatchdogProcessView.ui \ + src/ui/watchdog/WatchdogView.ui \ + src/ui/QGCFirmwareUpdate.ui \ + src/ui/QGCPxImuFirmwareUpdate.ui \ + src/ui/QGCDataPlot2D.ui \ + src/ui/QGCRemoteControlView.ui \ + src/ui/QMap3D.ui \ + src/ui/QGCWebView.ui \ + src/ui/map3D/QGCGoogleEarthView.ui \ + src/ui/SlugsDataSensorView.ui \ + src/ui/SlugsHilSim.ui \ + src/ui/SlugsPIDControl.ui \ + src/ui/SlugsVideoCamControl.ui \ + src/ui/SlugsPadCameraControl.ui \ + src/ui/uas/QGCUnconnectedInfoWidget.ui \ + src/ui/designer/QGCToolWidget.ui \ + src/ui/designer/QGCParamSlider.ui \ + src/ui/designer/QGCActionButton.ui \ + src/ui/QGCMAVLinkLogPlayer.ui \ + src/ui/QGCWaypointListMulti.ui \ + src/ui/mission/QGCCustomWaypointAction.ui \ + src/ui/QGCUDPLinkConfiguration.ui \ + src/ui/QGCSettingsWidget.ui \ + src/ui/UASControlParameters.ui + +INCLUDEPATH += src \ + src/ui \ + src/ui/linechart \ + src/ui/uas \ + src/ui/map \ + src/uas \ + src/comm \ + include/ui \ + src/input \ + src/lib/qmapcontrol \ + src/ui/mavlink \ + src/ui/param \ + src/ui/watchdog \ + src/ui/map3D \ + src/ui/designer + +HEADERS += src/MG.h \ + src/Core.h \ + src/uas/UASInterface.h \ + src/uas/UAS.h \ + src/uas/UASManager.h \ + src/comm/LinkManager.h \ + src/comm/LinkInterface.h \ + src/comm/SerialLinkInterface.h \ + src/comm/SerialLink.h \ + src/comm/SerialSimulationLink.h \ + src/comm/ProtocolInterface.h \ + src/comm/MAVLinkProtocol.h \ + src/comm/AS4Protocol.h \ + src/ui/CommConfigurationWindow.h \ + src/ui/SerialConfigurationWindow.h \ + src/ui/MainWindow.h \ + src/ui/uas/UASControlWidget.h \ + src/ui/uas/UASListWidget.h \ + src/ui/uas/UASInfoWidget.h \ + src/ui/HUD.h \ + src/ui/linechart/LinechartWidget.h \ + src/ui/linechart/LinechartPlot.h \ + src/ui/linechart/Scrollbar.h \ + src/ui/linechart/ScrollZoomer.h \ + src/configuration.h \ + src/ui/uas/UASView.h \ + src/ui/CameraView.h \ + src/comm/MAVLinkSimulationLink.h \ + src/comm/UDPLink.h \ + src/ui/ParameterInterface.h \ + src/ui/WaypointList.h \ + src/Waypoint.h \ + src/ui/WaypointView.h \ + src/ui/ObjectDetectionView.h \ + src/input/JoystickInput.h \ + src/ui/JoystickWidget.h \ + src/ui/DebugConsole.h \ + src/ui/MapWidget.h \ + src/ui/XMLCommProtocolWidget.h \ + src/ui/mavlink/DomItem.h \ + src/ui/mavlink/DomModel.h \ + src/comm/MAVLinkXMLParser.h \ + src/ui/HDDisplay.h \ + src/ui/MAVLinkSettingsWidget.h \ + src/ui/AudioOutputWidget.h \ + src/GAudioOutput.h \ + src/LogCompressor.h \ + src/ui/QGCParamWidget.h \ + src/ui/QGCSensorSettingsWidget.h \ + src/ui/linechart/Linecharts.h \ + src/uas/SlugsMAV.h \ + src/uas/PxQuadMAV.h \ + src/uas/ArduPilotMegaMAV.h \ + src/comm/MAVLinkSyntaxHighlighter.h \ + src/ui/watchdog/WatchdogControl.h \ + src/ui/watchdog/WatchdogProcessView.h \ + src/ui/watchdog/WatchdogView.h \ + src/uas/UASWaypointManager.h \ + src/ui/HSIDisplay.h \ + src/QGC.h \ + src/ui/QGCFirmwareUpdate.h \ + src/ui/QGCPxImuFirmwareUpdate.h \ + src/ui/QGCDataPlot2D.h \ + src/ui/linechart/IncrementalPlot.h \ + src/ui/map/Waypoint2DIcon.h \ + src/ui/map/MAV2DIcon.h \ + src/ui/QGCRemoteControlView.h \ + src/ui/RadioCalibration/RadioCalibrationData.h \ + src/ui/RadioCalibration/RadioCalibrationWindow.h \ + src/ui/RadioCalibration/AirfoilServoCalibrator.h \ + src/ui/RadioCalibration/SwitchCalibrator.h \ + src/ui/RadioCalibration/CurveCalibrator.h \ + src/ui/RadioCalibration/AbstractCalibrator.h \ + src/comm/QGCMAVLink.h \ + src/ui/QGCWebView.h \ + src/ui/map3D/QGCWebPage.h \ + src/ui/SlugsDataSensorView.h \ + src/ui/SlugsHilSim.h \ + src/ui/SlugsPIDControl.h \ + src/ui/SlugsVideoCamControl.h \ + src/ui/SlugsPadCameraControl.h \ + src/ui/QGCMainWindowAPConfigurator.h \ + src/comm/MAVLinkSwarmSimulationLink.h \ + src/ui/uas/QGCUnconnectedInfoWidget.h \ + src/ui/designer/QGCToolWidget.h \ + src/ui/designer/QGCParamSlider.h \ + src/ui/designer/QGCActionButton.h \ + src/ui/designer/QGCToolWidgetItem.h \ + src/ui/QGCMAVLinkLogPlayer.h \ + src/comm/MAVLinkSimulationWaypointPlanner.h \ + src/comm/MAVLinkSimulationMAV.h \ + src/uas/QGCMAVLinkUASFactory.h \ + src/ui/QGCWaypointListMulti.h \ + src/ui/QGCUDPLinkConfiguration.h \ + src/ui/QGCSettingsWidget.h \ + src/ui/uas/UASControlParameters.h + +# Google Earth is only supported on Mac OS and Windows with Visual Studio Compiler +macx|win32-msvc2008: { + HEADERS += src/ui/map3D/QGCGoogleEarthView.h +} + +contains(DEPENDENCIES_PRESENT, osg) { + message("Including headers for OpenSceneGraph") + + # Enable only if OpenSceneGraph is available + HEADERS += src/ui/map3D/Q3DWidget.h \ + src/ui/map3D/GCManipulator.h \ + src/ui/map3D/ImageWindowGeode.h \ + src/ui/map3D/QOSGWidget.h \ + src/ui/map3D/PixhawkCheetahGeode.h \ + src/ui/map3D/Pixhawk3DWidget.h \ + src/ui/map3D/Q3DWidgetFactory.h \ + src/ui/map3D/WebImageCache.h \ + src/ui/map3D/WebImage.h \ + src/ui/map3D/TextureCache.h \ + src/ui/map3D/Texture.h \ + src/ui/map3D/Imagery.h \ + src/ui/map3D/HUDScaleGeode.h \ + src/ui/map3D/WaypointGroupNode.h + contains(DEPENDENCIES_PRESENT, osgearth) { + message("Including headers for OSGEARTH") + + # Enable only if OpenSceneGraph is available + HEADERS += src/ui/map3D/QMap3D.h + } +} +contains(DEPENDENCIES_PRESENT, libfreenect) { + message("Including headers for libfreenect") + + # Enable only if libfreenect is available + HEADERS += src/input/Freenect.h +} + +SOURCES += src/main.cc \ + src/Core.cc \ + src/uas/UASManager.cc \ + src/uas/UAS.cc \ + src/comm/LinkManager.cc \ + src/comm/SerialLink.cc \ + src/comm/SerialSimulationLink.cc \ + src/comm/MAVLinkProtocol.cc \ + src/comm/AS4Protocol.cc \ + src/ui/CommConfigurationWindow.cc \ + src/ui/SerialConfigurationWindow.cc \ + src/ui/MainWindow.cc \ + src/ui/uas/UASControlWidget.cc \ + src/ui/uas/UASListWidget.cc \ + src/ui/uas/UASInfoWidget.cc \ + src/ui/HUD.cc \ + src/ui/linechart/LinechartWidget.cc \ + src/ui/linechart/LinechartPlot.cc \ + src/ui/linechart/Scrollbar.cc \ + src/ui/linechart/ScrollZoomer.cc \ + src/ui/uas/UASView.cc \ + src/ui/CameraView.cc \ + src/comm/MAVLinkSimulationLink.cc \ + src/comm/UDPLink.cc \ + src/ui/ParameterInterface.cc \ + src/ui/WaypointList.cc \ + src/Waypoint.cc \ + src/ui/WaypointView.cc \ + src/ui/ObjectDetectionView.cc \ + src/input/JoystickInput.cc \ + src/ui/JoystickWidget.cc \ + src/ui/DebugConsole.cc \ + src/ui/MapWidget.cc \ + src/ui/XMLCommProtocolWidget.cc \ + src/ui/mavlink/DomItem.cc \ + src/ui/mavlink/DomModel.cc \ + src/comm/MAVLinkXMLParser.cc \ + src/ui/HDDisplay.cc \ + src/ui/MAVLinkSettingsWidget.cc \ + src/ui/AudioOutputWidget.cc \ + src/GAudioOutput.cc \ + src/LogCompressor.cc \ + src/ui/QGCParamWidget.cc \ + src/ui/QGCSensorSettingsWidget.cc \ + src/ui/linechart/Linecharts.cc \ + src/uas/SlugsMAV.cc \ + src/uas/PxQuadMAV.cc \ + src/uas/ArduPilotMegaMAV.cc \ + src/comm/MAVLinkSyntaxHighlighter.cc \ + src/ui/watchdog/WatchdogControl.cc \ + src/ui/watchdog/WatchdogProcessView.cc \ + src/ui/watchdog/WatchdogView.cc \ + src/uas/UASWaypointManager.cc \ + src/ui/HSIDisplay.cc \ + src/QGC.cc \ + src/ui/QGCFirmwareUpdate.cc \ + src/ui/QGCPxImuFirmwareUpdate.cc \ + src/ui/QGCDataPlot2D.cc \ + src/ui/linechart/IncrementalPlot.cc \ + src/ui/map/Waypoint2DIcon.cc \ + src/ui/map/MAV2DIcon.cc \ + src/ui/QGCRemoteControlView.cc \ + src/ui/RadioCalibration/RadioCalibrationWindow.cc \ + src/ui/RadioCalibration/AirfoilServoCalibrator.cc \ + src/ui/RadioCalibration/SwitchCalibrator.cc \ + src/ui/RadioCalibration/CurveCalibrator.cc \ + src/ui/RadioCalibration/AbstractCalibrator.cc \ + src/ui/RadioCalibration/RadioCalibrationData.cc \ + src/ui/QGCWebView.cc \ + src/ui/map3D/QGCWebPage.cc \ + src/ui/SlugsDataSensorView.cc \ + src/ui/SlugsHilSim.cc \ + src/ui/SlugsPIDControl.cpp \ + src/ui/SlugsVideoCamControl.cpp \ + src/ui/SlugsPadCameraControl.cpp \ + src/ui/QGCMainWindowAPConfigurator.cc \ + src/comm/MAVLinkSwarmSimulationLink.cc \ + src/ui/uas/QGCUnconnectedInfoWidget.cc \ + src/ui/designer/QGCToolWidget.cc \ + src/ui/designer/QGCParamSlider.cc \ + src/ui/designer/QGCActionButton.cc \ + src/ui/designer/QGCToolWidgetItem.cc \ + src/ui/QGCMAVLinkLogPlayer.cc \ + src/comm/MAVLinkSimulationWaypointPlanner.cc \ + src/comm/MAVLinkSimulationMAV.cc \ + src/uas/QGCMAVLinkUASFactory.cc \ + src/ui/QGCWaypointListMulti.cc \ + src/ui/QGCUDPLinkConfiguration.cc \ + src/ui/QGCSettingsWidget.cc \ + src/ui/uas/UASControlParameters.cpp + +macx|win32-msvc2008: { + SOURCES += src/ui/map3D/QGCGoogleEarthView.cc +} + +contains(DEPENDENCIES_PRESENT, osg) { + message("Including sources for OpenSceneGraph") + + # Enable only if OpenSceneGraph is available + SOURCES += src/ui/map3D/Q3DWidget.cc \ + src/ui/map3D/ImageWindowGeode.cc \ + src/ui/map3D/GCManipulator.cc \ + src/ui/map3D/QOSGWidget.cc \ + src/ui/map3D/PixhawkCheetahGeode.cc \ + src/ui/map3D/Pixhawk3DWidget.cc \ + src/ui/map3D/Q3DWidgetFactory.cc \ + src/ui/map3D/WebImageCache.cc \ + src/ui/map3D/WebImage.cc \ + src/ui/map3D/TextureCache.cc \ + src/ui/map3D/Texture.cc \ + src/ui/map3D/Imagery.cc \ + src/ui/map3D/HUDScaleGeode.cc \ + src/ui/map3D/WaypointGroupNode.cc \ + + + contains(DEPENDENCIES_PRESENT, osgearth) { + message("Including sources for osgEarth") + + # Enable only if OpenSceneGraph is available + SOURCES += src/ui/map3D/QMap3D.cc + } +} +contains(DEPENDENCIES_PRESENT, libfreenect) { + message("Including sources for libfreenect") + + # Enable only if libfreenect is available + SOURCES += src/input/Freenect.cc +} +RESOURCES += mavground.qrc + +# Include RT-LAB Library +win32:exists(src/lib/opalrt/OpalApi.h):exists(C:/OPAL-RT/RT-LAB7.2.4/Common/bin) { + message("Building support for Opal-RT") + LIBS += -LC:/OPAL-RT/RT-LAB7.2.4/Common/bin \ + -lOpalApi + INCLUDEPATH += src/lib/opalrt + HEADERS += src/comm/OpalRT.h \ + src/comm/OpalLink.h \ + src/comm/Parameter.h \ + src/comm/QGCParamID.h \ + src/comm/ParameterList.h \ + src/ui/OpalLinkConfigurationWindow.h + SOURCES += src/comm/OpalRT.cc \ + src/comm/OpalLink.cc \ + src/comm/Parameter.cc \ + src/comm/QGCParamID.cc \ + src/comm/ParameterList.cc \ + src/ui/OpalLinkConfigurationWindow.cc + FORMS += src/ui/OpalLinkSettings.ui + DEFINES += OPAL_RT +} + +TRANSLATIONS += es-MX.ts \ + en-US.ts diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index 3b4dd86442247a245ea4a1358c4d5d72c2e96714..7cb68436b7268b7927fcdc4ac83e0fe4bcd919ed 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -335,6 +335,14 @@ void MainWindow::buildCommonWidgets() addToToolsMenu (controlDockWidget, tr("Control"), SLOT(showToolWidget(bool)), MENU_UAS_CONTROL, Qt::LeftDockWidgetArea); } + if (!controlParameterWidget) + { + controlParameterWidget = new QDockWidget(tr("Control Parameters"), this); + controlParameterWidget->setObjectName("UNMANNED_SYSTEM_CONTROL_PARAMETERWIDGET"); + controlParameterWidget->setWidget( new UASControlParameters(this) ); + addToToolsMenu (controlParameterWidget, tr("Control Parameters"), SLOT(showToolWidget(bool)), MENU_UAS_CONTROL_PARAM, Qt::LeftDockWidgetArea); + } + if (!listDockWidget) { listDockWidget = new QDockWidget(tr("Unmanned Systems"), this); @@ -818,7 +826,7 @@ void MainWindow::showToolWidget(bool visible) else { removeDockWidget(dockWidget); - } + } QHashIterator i(dockWidgets); while (i.hasNext()) @@ -1007,10 +1015,11 @@ void MainWindow::connectCommonWidgets() // connect(waypointsDockWidget->widget(), SIGNAL(changePointList()), mapWidget, SLOT(clearWaypoints())); + } - - - + if(controlDockWidget && controlParameterWidget) + { + connect(controlDockWidget->widget(), SIGNAL(changedMode(int)), controlParameterWidget->widget(), SLOT(changedMode(int))); } //TODO temporaly debug @@ -1018,6 +1027,11 @@ void MainWindow::connectCommonWidgets() connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), slugsHilSimWidget->widget(), SLOT(activeUasSet(UASInterface*))); } + + if (controlParameterWidget && controlParameterWidget->widget()){ + connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), + controlParameterWidget->widget(), SLOT(activeUasSet(UASInterface*))); + } } void MainWindow::createCustomWidget() @@ -1064,6 +1078,8 @@ void MainWindow::connectSlugsWidgets() connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), slugsPIDControlWidget->widget(), SLOT(activeUasSet(UASInterface*))); } + + } void MainWindow::arrangeCommonCenterStack() diff --git a/src/ui/MainWindow.h b/src/ui/MainWindow.h index 036fd30f72d48adc035cd4979184aed35bdd57f8..b2e681ad6374877d94c16a4861ed9c4f5a36abb2 100644 --- a/src/ui/MainWindow.h +++ b/src/ui/MainWindow.h @@ -75,7 +75,7 @@ This file is part of the QGROUNDCONTROL project #include "SlugsHilSim.h" #include "SlugsVideoCamControl.h" - +#include "UASControlParameters.h" /** * @brief Main Application Window @@ -212,6 +212,7 @@ protected: // 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_PARAM, MENU_UAS_CONTROL, MENU_UAS_INFO, MENU_CAMERA, @@ -381,6 +382,7 @@ protected: #endif // Dock widgets QPointer controlDockWidget; + QPointer controlParameterWidget; QPointer infoDockWidget; QPointer cameraDockWidget; QPointer listDockWidget; diff --git a/src/ui/QGCRemoteControlView.cc b/src/ui/QGCRemoteControlView.cc index 410d34ab59f3430dd0967113b1c9f29d9c01d9ba..b288a32198e674808e712ef52717173ad64cb2ae 100644 --- a/src/ui/QGCRemoteControlView.cc +++ b/src/ui/QGCRemoteControlView.cc @@ -191,7 +191,11 @@ void QGCRemoteControlView::redraw() progressBars.at(i)->setValue(vv); } // Update RSSI - rssiBar->setValue(rssi*100); + if(rssi>0) + { + rssiBar->setValue(rssi*100); + } + updated = false; } } diff --git a/src/ui/SlugsDataSensorView.ui b/src/ui/SlugsDataSensorView.ui index c5749695089dd51056ed53688b29f3a05b6080e3..d8eed339cafe530838475e22bda25a21d70f9e31 100644 --- a/src/ui/SlugsDataSensorView.ui +++ b/src/ui/SlugsDataSensorView.ui @@ -6,7 +6,7 @@ 0 0 - 392 + 495 671 diff --git a/src/ui/UASControlParameters.ui b/src/ui/UASControlParameters.ui new file mode 100644 index 0000000000000000000000000000000000000000..da71391b74bc16ecf08348e64d0a237ccc28caa6 --- /dev/null +++ b/src/ui/UASControlParameters.ui @@ -0,0 +1,192 @@ + + + UASControlParameters + + + + 0 + 0 + 200 + 228 + + + + + 200 + 150 + + + + + 267 + 16777215 + + + + Form + + + + + + + + + 0 + + + + Tab 1 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 100 + 0 + + + + + 16777215 + 16777215 + + + + ---- + + + Qt::AlignCenter + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Height (m) + + + + + + + 1500.000000000000000 + + + + + + + + + + + Airspeed (m/s) + + + + + + + 500.000000000000000 + + + + + + + + + + + Turn Rate (rad/s) + + + + + + + 180.000000000000000 + + + + + + + + + + + Set + + + + + + + Get + + + + + + + + + Qt::Vertical + + + + 20 + 27 + + + + + + + + + Tab 2 + + + + + + + + + diff --git a/src/ui/uas/UASControlParameters.cpp b/src/ui/uas/UASControlParameters.cpp new file mode 100644 index 0000000000000000000000000000000000000000..742bffd4258da79eb59d6b6ea69dc3799de3b293 --- /dev/null +++ b/src/ui/uas/UASControlParameters.cpp @@ -0,0 +1,138 @@ +#include "src\ui\uas\UASControlParameters.h" +#include "ui_UASControlParameters.h" + +#define CONTROL_MODE_LOCKED "MODE LOCKED" +#define CONTROL_MODE_MANUAL "MODE MANUAL" +#define CONTROL_MODE_GUIDED "MODE GUIDED" +#define CONTROL_MODE_AUTO "MODE AUTO" +#define CONTROL_MODE_TEST1 "MODE TEST1" +#define CONTROL_MODE_TEST2 "MODE TEST2" +#define CONTROL_MODE_TEST3 "MODE TEST3" +#define CONTROL_MODE_READY "MODE TEST3" +#define CONTROL_MODE_RC_TRAINING "RC SIMULATION" + +#define CONTROL_MODE_LOCKED_INDEX 1 +#define CONTROL_MODE_MANUAL_INDEX 2 +#define CONTROL_MODE_GUIDED_INDEX 3 +#define CONTROL_MODE_AUTO_INDEX 4 +#define CONTROL_MODE_TEST1_INDEX 5 +#define CONTROL_MODE_TEST2_INDEX 6 +#define CONTROL_MODE_TEST3_INDEX 7 +#define CONTROL_MODE_READY_INDEX 8 +#define CONTROL_MODE_RC_TRAINING_INDEX 9 + +UASControlParameters::UASControlParameters(QWidget *parent) : + QWidget(parent), + ui(new Ui::UASControlParameters) +{ + ui->setupUi(this); + + //this->mode = "MAV_MODE_UNKNOWN"; + //connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(activeUasSet(UASInterface*))); + + connect(ui->btGetCommands, SIGNAL(clicked()), this, SLOT(getCommands())); + + //QColor groupColor = QColor(231,72,28); + //QString borderColor = "#FA4A4F"; + //groupColor = groupColor.darker(475); +} + +UASControlParameters::~UASControlParameters() +{ + delete ui; +} + +void UASControlParameters::changedMode(int mode) +{ + QString modeTemp; + + if (mode == CONTROL_MODE_LOCKED_INDEX) + { + modeTemp= CONTROL_MODE_LOCKED; + } + else if (mode == CONTROL_MODE_MANUAL_INDEX) + { + modeTemp= CONTROL_MODE_MANUAL; + } + else if (mode == CONTROL_MODE_GUIDED_INDEX) + { + modeTemp= CONTROL_MODE_GUIDED; + } + else if (mode == CONTROL_MODE_AUTO_INDEX) + { + modeTemp= CONTROL_MODE_AUTO; + } + else if (mode == CONTROL_MODE_TEST1_INDEX) + { + modeTemp= CONTROL_MODE_TEST1; + } + else if (mode == CONTROL_MODE_TEST2_INDEX) + { + modeTemp= CONTROL_MODE_TEST2; + } + else if (mode == CONTROL_MODE_TEST3_INDEX) + { + modeTemp= CONTROL_MODE_TEST3; + } + else if (mode == CONTROL_MODE_RC_TRAINING_INDEX) + { + modeTemp= CONTROL_MODE_RC_TRAINING; + } + + if( static_cast(modeTemp) != this->mode) + { + ui->lbMode->setStyleSheet("background-color: rgb(255, 0, 0)"); + } + else + { + ui->lbMode->setStyleSheet(""); + } +} + +void UASControlParameters::activeUasSet(UASInterface *uas) +{ + connect(uas, SIGNAL(globalPositionChanged(UASInterface*,double,double,double,quint64)), this, SLOT(updateGlobalPosition(UASInterface*,double,double,double,quint64))); + connect(uas, SIGNAL(speedChanged(UASInterface*,double,double,double,quint64)), this, SLOT(speedChanged(UASInterface*,double,double,double,quint64))); + connect(uas, SIGNAL(attitudeChanged(UASInterface*,double,double,double,quint64)), this, SLOT(updateAttitude(UASInterface*,double,double,double,quint64))); + connect(uas, SIGNAL(modeChanged(int,QString,QString)), this, SLOT(updateMode(int,QString,QString))); + + activeUAS= uas; +} + +void UASControlParameters::updateGlobalPosition(UASInterface * a, double b, double c, double aa, quint64 ab) +{ + //ui->sbHeight->setValue(aa); + this->altitude=aa; +} + +void UASControlParameters::speedChanged(UASInterface* uas, double vx, double vy, double vz, quint64 time) +{ + this->speed = sqrt(pow(vx, 2.0) + pow(vy, 2.0) + pow(vz, 2.0)); + //ui->sbAirSpeed->setValue(speed); +} + +void UASControlParameters::updateAttitude(UASInterface *uas, double roll, double pitch, double yaw, quint64 time) +{ + Q_UNUSED(uas); + Q_UNUSED(time); + //ui->sbTurnRate->setValue(roll); + this->roll = roll; +} + +void UASControlParameters::setCommands() +{} + +void UASControlParameters::getCommands() +{ + ui->sbAirSpeed->setValue(this->speed); + ui->sbHeight->setValue(this->altitude); + ui->sbTurnRate->setValue(this->roll); +} + +void UASControlParameters::updateMode(int uas,QString mode,QString description) +{ + Q_UNUSED(uas); + Q_UNUSED(description); + this->mode = mode; + ui->lbMode->setText(this->mode); +} diff --git a/src/ui/uas/UASControlParameters.h b/src/ui/uas/UASControlParameters.h new file mode 100644 index 0000000000000000000000000000000000000000..25cc456cc991e16af8d86ffbf2c12d6c1735010b --- /dev/null +++ b/src/ui/uas/UASControlParameters.h @@ -0,0 +1,43 @@ +#ifndef UASCONTROLPARAMETERS_H +#define UASCONTROLPARAMETERS_H + +#include +#include "UASManager.h" +#include "SlugsMAV.h" +#include +#include + +namespace Ui { + class UASControlParameters; +} + +class UASControlParameters : public QWidget +{ + Q_OBJECT + +public: + explicit UASControlParameters(QWidget *parent = 0); + ~UASControlParameters(); + +public slots: + void changedMode(int mode); + void activeUasSet(UASInterface* uas); + void updateGlobalPosition(UASInterface*,double,double,double,quint64); + void speedChanged(UASInterface*,double,double,double,quint64); + void updateAttitude(UASInterface* uas, double roll, double pitch, double yaw, quint64 time); + void setCommands(); + void getCommands(); + void updateMode(int uas,QString mode,QString description); + +private: + Ui::UASControlParameters *ui; + QTimer* refreshTimerGet; + UASInterface* activeUAS; + double speed; + double roll; + double altitude; + QString mode; + QString REDcolorStyle; +}; + +#endif // UASCONTROLPARAMETERS_H diff --git a/src/ui/uas/UASControlWidget.cc b/src/ui/uas/UASControlWidget.cc index 968e028f1c1dee72a6e38cbd3d0e61c988db283e..44ee272516cd5d717a5f62c4559e7c6970c2ceaa 100644 --- a/src/ui/uas/UASControlWidget.cc +++ b/src/ui/uas/UASControlWidget.cc @@ -249,6 +249,8 @@ void UASControlWidget::setMode(int mode) qDebug() << "SET MODE REQUESTED" << uasMode; + + emit changedMode(mode); } void UASControlWidget::transmitMode() diff --git a/src/ui/uas/UASControlWidget.h b/src/ui/uas/UASControlWidget.h index 003e25e7b30a26b68e8dca7d50a40bd9ec9198e5..4ec60f6930fefe0bbfc90369bdb708e92acec918 100644 --- a/src/ui/uas/UASControlWidget.h +++ b/src/ui/uas/UASControlWidget.h @@ -1,83 +1,87 @@ -/*===================================================================== - -QGroundControl Open Source Ground Control Station - -(c) 2009, 2010 QGROUNDCONTROL PROJECT - -This file is part of the QGROUNDCONTROL 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 . - -======================================================================*/ - -/** - * @file - * @brief Definition of class UASControlWidget - * - * @author Lorenz Meier - * - */ - -#ifndef _UASCONTROLWIDGET_H_ -#define _UASCONTROLWIDGET_H_ - -#include -#include -#include -#include -#include -#include - -/** - * @brief Widget controlling one MAV - */ -class UASControlWidget : public QWidget -{ - Q_OBJECT - -public: - UASControlWidget(QWidget *parent = 0); - ~UASControlWidget(); - -public slots: - /** @brief Set the system this widget controls */ - void setUAS(UASInterface* uas); - /** @brief Trigger next context action */ - void cycleContextButton(); - /** @brief Set the operation mode of the MAV */ - void setMode(int mode); - /** @brief Transmit the operation mode */ - void transmitMode(); - /** @brief Update the mode */ - void updateMode(int uas,QString mode,QString description); - /** @brief Update state */ - void updateState(int state); - /** @brief Update internal state machine */ - void updateStatemachine(); - -protected slots: - /** @brief Set the background color for the widget */ - void setBackgroundColor(QColor color); - -protected: - int uas; ///< Reference to the current uas - unsigned int uasMode; ///< Current uas mode - bool engineOn; ///< Engine state - -private: - Ui::uasControl ui; - -}; - -#endif // _UASCONTROLWIDGET_H_ +/*===================================================================== + +QGroundControl Open Source Ground Control Station + +(c) 2009, 2010 QGROUNDCONTROL PROJECT + +This file is part of the QGROUNDCONTROL 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 . + +======================================================================*/ + +/** + * @file + * @brief Definition of class UASControlWidget + * + * @author Lorenz Meier + * + */ + +#ifndef _UASCONTROLWIDGET_H_ +#define _UASCONTROLWIDGET_H_ + +#include +#include +#include +#include +#include +#include + +/** + * @brief Widget controlling one MAV + */ +class UASControlWidget : public QWidget +{ + Q_OBJECT + +public: + UASControlWidget(QWidget *parent = 0); + ~UASControlWidget(); + +public slots: + /** @brief Set the system this widget controls */ + void setUAS(UASInterface* uas); + /** @brief Trigger next context action */ + void cycleContextButton(); + /** @brief Set the operation mode of the MAV */ + void setMode(int mode); + /** @brief Transmit the operation mode */ + void transmitMode(); + /** @brief Update the mode */ + void updateMode(int uas,QString mode,QString description); + /** @brief Update state */ + void updateState(int state); + /** @brief Update internal state machine */ + void updateStatemachine(); + +signals: + void changedMode(int); + + +protected slots: + /** @brief Set the background color for the widget */ + void setBackgroundColor(QColor color); + +protected: + int uas; ///< Reference to the current uas + unsigned int uasMode; ///< Current uas mode + bool engineOn; ///< Engine state + +private: + Ui::uasControl ui; + +}; + +#endif // _UASCONTROLWIDGET_H_