diff --git a/apmplanner_core.pro b/apmplanner_core.pro new file mode 100644 index 0000000000..caed53bb55 --- /dev/null +++ b/apmplanner_core.pro @@ -0,0 +1,897 @@ +# ------------------------------------------------- +# APM Planner - Micro Air Vehicle Groundstation +# Please see our website at +# Maintainer: +# Bill Bonney +# Based of QGroundControl by Lorenz Meier +# +# (c) 2009-2011 QGroundControl Developers +# (c) 2013 Bill Bonney +# (c) 2013 Michael Carpenter +# +# This file is part of the open groundstation project +# APM Planner 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. +# APM Planner 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 . +# ------------------------------------------------- + + +message(Qt version $$[QT_VERSION]) + +# Setup our supported build types. We do this once here and then use the defined config scopes +# to allow us to easily modify suported build types in one place instead of duplicated throughout +# the project file. + +linux-g++-64 { + message(Linux build x64_86) + CONFIG += LinuxBuild + DEFINES += Q_LINUX_64 + DISTRO = $$system(lsb_release -i) + contains( DISTRO, "Ubuntu" ) { + DEFINES += Q_UBUNTU + } +} else: linux-g++ { + message(Linux build x86) + CONFIG += LinuxBuild + DEFINES += Q_LINUX_32 + DISTRO = $$system(lsb_release -i) + contains( DISTRO, "Ubuntu" ) { + DEFINES += Q_UBUNTU + } + +} else : win32-msvc2008 | win32-msvc2010 | win32-msvc2012 { + message(Windows build) + CONFIG += WindowsBuild +} else : win32-x-g++|win64-x-g++ { + message(Windows Cross Build) + CONFIG += WindowsCrossBuild +} else : macx-clang | macx-g++ { + message(Mac build) + CONFIG += MacBuild +} else { + error(Unsupported build type) +} + +# Setup our supported build flavors + +CONFIG(debug, debug|release) { + message(Debug flavor) + CONFIG += DebugBuild +} else:CONFIG(release, debug|release) { + message(Release flavor) + CONFIG += ReleaseBuild +} else { + error(Unsupported build flavor) +} + +# Setup our build directories + +BASEDIR = $${IN_PWD} +DebugBuild { + DESTDIR = $${OUT_PWD}/debug + BUILDDIR = $${OUT_PWD}/build-debug +} +ReleaseBuild { + DESTDIR = $${OUT_PWD}/release + BUILDDIR = $${OUT_PWD}/build-release +} +OBJECTS_DIR = $${BUILDDIR}/obj +MOC_DIR = $${BUILDDIR}/moc +UI_DIR = $${BUILDDIR}/ui +RCC_DIR = $${BUILDDIR}/rcc +LANGUAGE = C++ + +TEMPLATE = lib +TARGET = apmplanner-core + +message(BASEDIR $$BASEDIR DESTDIR $$DESTDIR TARGET $$TARGET) + +# Qt configuration +CONFIG += qt \ + thread + +QT += network \ + opengl \ + svg \ + xml \ + webkit \ + sql \ + widgets \ + serialport \ + webkitwidgets \ + script\ + quick \ + printsupport + +## testlib is needed even in release flavor for QSignalSpy support +QT += testlib + +!NOTOUCH { + gittouch.commands = touch qgroundcontrol.pro + QMAKE_EXTRA_TARGETS += gittouch + POST_TARGETDEPS += gittouch +} + +# Turn off serial port warnings +DEFINES += _TTY_NOWARN_ + +#Turn on camera view +#DEFINES += AMERAVIEW +# +# Logging Library +# +include (QsLog/QsLog.pri) +#include (libs/mavlink/include/mavlink/v1.0-qt/mavlink.pri) +# +# OS Specific settings +# + +RaspberryPiBuild { + DEFINES -= CAMERAVIEW +} + +MacBuild { + QT += multimedia + + QMAKE_INFO_PLIST = Custom-Info.plist + CONFIG += x86_64 + CONFIG -= x86 + QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6 + ICON = $$BASEDIR/files/APMIcons/icon.icns + QMAKE_INFO_PLIST = APMPlanner.plist # Sets the pretty name for the build + + DEFINES += GIT_COMMIT=$$system(git describe --dirty=-DEV --always) + DEFINES += GIT_HASH=$$system(git log -n 1 --pretty=format:%H) + + LIBS += -lz + LIBS += -lssl -lcrypto + LIBS += -framework ApplicationServices +} + +LinuxBuild { + DEFINES += __STDC_LIMIT_MACROS + + DEFINES += GIT_COMMIT=$$system(git describe --dirty=-DEV --always) + DEFINES += GIT_HASH=$$system(git log -n 1 --pretty=format:%H) + + LIBS += -lsndfile -lasound + LIBS += -lz + LIBS += -lssl -lcrypto +} + +WindowsBuild { + DEFINES += __STDC_LIMIT_MACROS + + # Specify multi-process compilation within Visual Studio. + # (drastically improves compilation times for multi-core computers) + QMAKE_CXXFLAGS_DEBUG += -MP + QMAKE_CXXFLAGS_RELEASE += -MP + + # QWebkit is not needed on MS-Windows compilation environment + CONFIG -= webkit + + RC_FILE = $$BASEDIR/qgroundcontrol.rc + + DEFINES += GIT_COMMIT=$$system(\"c:/program files (x86)/git/bin/git.exe\" describe --dirty=-DEV --always) + DEFINES += GIT_HASH=$$system(\"c:/program files (x86)/git/bin/git.exe\" log -n 1 --pretty=format:%H) +} + +WindowsCrossBuild { + QT += script + # Windows version cross compiled on linux using + DEFINES += __STDC_LIMIT_MACROS + + # QWebkit is not needed on MS-Windows compilation environment + CONFIG -= webkit + + RC_FILE = $$BASEDIR/qgroundcontrol.rc + LIBS += -lz + CONFIG += exceptions rtti + + DEFINES += GIT_COMMIT=$$system(git describe --dirty=-DEV --always) + DEFINES += GIT_HASH=$$system(git log -n 1 --pretty=format:%H) +} + +# +# Build flavor specific settings +# + +DebugBuild { +#Let console be defined by the IDE/Build process. + #CONFIG += console +} + +ReleaseBuild { + DEFINES += QT_NO_DEBUG + + WindowsBuild { + # Use link time code generation for beteer optimization (I believe this is supported in msvc express, but not 100% sure) + QMAKE_LFLAGS_LTCG = /LTCG + QMAKE_CFLAGS_LTCG = -GL + } +} + +# +# External library configuration +# + +include(QGCExternalLibs.pri) + +# +# Post link configuration +# + +include(QGCSetup.pri) + +# +# Main QGroundControl portion of project file +# + +RESOURCES += qgroundcontrol.qrc + +TRANSLATIONS += \ + es-MX.ts \ + en-US.ts + +DEPENDPATH += \ + . \ + plugins + +INCLUDEPATH += . + +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/mission \ + src/ui/designer \ + src/ui/configuration \ + src/output + +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/UASView.ui \ + src/ui/ParameterInterface.ui \ + src/ui/WaypointList.ui \ + src/ui/ObjectDetectionView.ui \ + src/ui/JoystickWidget.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/QMap3D.ui \ + src/ui/SlugsDataSensorView.ui \ + src/ui/SlugsHilSim.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/designer/QGCCommandButton.ui \ + src/ui/QGCMAVLinkLogPlayer.ui \ + src/ui/QGCWaypointListMulti.ui \ + src/ui/QGCUDPLinkConfiguration.ui \ + src/ui/QGCUDPClientLinkConfiguration.ui \ + src/ui/QGCTCPLinkConfiguration.ui \ + src/ui/QGCSettingsWidget.ui \ + src/ui/map/QGCMapTool.ui \ + src/ui/map/QGCMapToolBar.ui \ + src/ui/QGCMAVLinkInspector.ui \ + src/ui/WaypointViewOnlyView.ui \ + src/ui/WaypointEditableView.ui \ + src/ui/UnconnectedUASInfoWidget.ui \ + src/ui/mavlink/QGCMAVLinkMessageSender.ui \ + src/ui/firmwareupdate/QGCFirmwareUpdateWidget.ui \ + src/ui/QGCPluginHost.ui \ + src/ui/firmwareupdate/QGCPX4FirmwareUpdate.ui \ + src/ui/mission/QGCMissionOther.ui \ + src/ui/mission/QGCMissionNavWaypoint.ui \ + src/ui/mission/QGCMissionDoJump.ui \ + src/ui/mission/QGCMissionDoSetServo.ui \ + src/ui/mission/QGCMissionDoRepeatServo.ui \ + src/ui/mission/QGCMissionDoDigicamControl.ui \ + src/ui/mission/QGCMissionDoChangeSpeed.ui \ + src/ui/mission/QGCMissionDoSetCamTriggDist.ui \ + src/ui/mission/QGCMissionDoSetHome.ui \ + src/ui/mission/QGCMissionDoSetRelay.ui \ + src/ui/mission/QGCMissionDoSetROI.ui \ + src/ui/mission/QGCMissionDoMountControl.ui \ + src/ui/mission/QGCMissionDoRepeatRelay.ui \ + src/ui/mission/QGCMissionConditionDelay.ui \ + src/ui/mission/QGCMissionConditionYaw.ui \ + src/ui/mission/QGCMissionConditionDistance.ui \ + src/ui/mission/QGCMissionNavLoiterUnlim.ui \ + src/ui/mission/QGCMissionNavLoiterTurns.ui \ + src/ui/mission/QGCMissionNavLoiterTime.ui \ + src/ui/mission/QGCMissionNavReturnToLaunch.ui \ + src/ui/mission/QGCMissionNavLand.ui \ + src/ui/mission/QGCMissionNavTakeoff.ui \ + src/ui/mission/QGCMissionNavSweep.ui \ + src/ui/mission/QGCMissionNavContinueChangeAlt.ui \ + src/ui/mission/QGCMissionDoStartSearch.ui \ + src/ui/mission/QGCMissionDoFinishSearch.ui \ + src/ui/QGCVehicleConfig.ui \ + src/ui/QGCHilConfiguration.ui \ + src/ui/QGCHilFlightGearConfiguration.ui \ + src/ui/QGCHilJSBSimConfiguration.ui \ +# src/ui/QGCHilXPlaneConfiguration.ui \ + src/ui/designer/QGCComboBox.ui \ + src/ui/designer/QGCTextLabel.ui \ + src/ui/uas/UASQuickView.ui \ + src/ui/uas/UASQuickViewItemSelect.ui \ + src/ui/uas/UASActionsWidget.ui \ + src/ui/QGCTabbedInfoView.ui \ + src/ui/UASRawStatusView.ui \ + src/ui/uas/QGCMessageView.ui \ + src/ui/configuration/ApmHardwareConfig.ui \ + src/ui/configuration/ApmSoftwareConfig.ui \ + src/ui/configuration/FrameTypeConfig.ui \ + src/ui/configuration/CompassConfig.ui \ + src/ui/configuration/AccelCalibrationConfig.ui \ + src/ui/configuration/RadioCalibrationConfig.ui \ + src/ui/configuration/FlightModeConfig.ui \ + src/ui/configuration/Radio3DRConfig.ui \ + src/ui/configuration/BatteryMonitorConfig.ui \ + src/ui/configuration/RangeFinderConfig.ui \ + src/ui/configuration/AirspeedConfig.ui \ + src/ui/configuration/OpticalFlowConfig.ui \ + src/ui/configuration/OsdConfig.ui \ + src/ui/configuration/AntennaTrackerConfig.ui \ + src/ui/configuration/CameraGimbalConfig.ui \ + src/ui/configuration/BasicPidConfig.ui \ + src/ui/configuration/StandardParamConfig.ui \ + src/ui/configuration/GeoFenceConfig.ui \ + src/ui/configuration/FailSafeConfig.ui \ + src/ui/configuration/AdvancedParamConfig.ui \ + src/ui/configuration/ArduCopterPidConfig.ui \ + src/ui/configuration/CopterPidConfig.ui \ + src/ui/configuration/ApmPlaneLevel.ui \ + src/ui/configuration/ParamWidget.ui \ + src/ui/configuration/ArduPlanePidConfig.ui \ + src/ui/configuration/AdvParameterList.ui \ + src/ui/configuration/ArduRoverPidConfig.ui \ + src/ui/configuration/TerminalConsole.ui \ + src/ui/configuration/LogConsole.ui \ + src/ui/configuration/SerialSettingsDialog.ui \ + src/ui/configuration/ApmFirmwareConfig.ui \ + src/ui/DebugOutput.ui \ + src/ui/configuration/SetupWarningMessage.ui \ + src/ui/uas/APMShortcutModesDialog.ui \ + src/ui/configuration/DownloadRemoteParamsDialog.ui \ + src/ui/configuration/ParamCompareDialog.ui \ + src/ui/AP2DataPlot2D.ui \ + src/ui/dataselectionscreen.ui \ + src/ui/AboutDialog.ui \ + src/ui/AP2DataPlotAxisDialog.ui \ + src/ui/AutoUpdateDialog.ui \ + src/uas/LogDownloadDialog.ui \ + src/ui/configuration/CompassMotorCalibrationDialog.ui \ + src/ui/MissionElevationDisplay.ui \ + src/ui/DroneshareUploadDialog.ui \ + src/ui/DroneshareDialog.ui \ + src/ui/uas/PreFlightCalibrationDialog.ui \ + src/ui/configuration/RadioFlashWizard.ui + +HEADERS += \ + src/MG.h \ + src/QGCCore.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/ProtocolInterface.h \ + src/comm/QGCFlightGearLink.h \ + src/comm/QGCJSBSimLink.h \ +# src/comm/QGCXPlaneLink.h \ + src/comm/serialconnection.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/configuration.h \ + src/ui/uas/UASView.h \ +#ifdef CAMERAVIEW + src/ui/CameraView.h \ +#endif + src/comm/MAVLinkSimulationLink.h \ + src/comm/UDPLink.h \ + src/comm/UDPClientLink.h \ + src/comm/TCPLink.h \ + src/ui/ParameterInterface.h \ + src/ui/WaypointList.h \ + src/ui/WaypointNavigation.h \ + src/Waypoint.h \ + src/ui/ObjectDetectionView.h \ + src/input/JoystickInput.h \ + src/ui/JoystickWidget.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/uas/SlugsMAV.h \ + src/uas/PxQuadMAV.h \ + src/uas/ArduPilotMegaMAV.h \ + src/uas/senseSoarMAV.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/RadioCalibration/RadioCalibrationData.h \ + src/comm/QGCMAVLink.h \ + src/ui/map3D/QGCWebPage.h \ + src/ui/SlugsDataSensorView.h \ + src/ui/SlugsHilSim.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/QGCCommandButton.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/QGCUDPClientLinkConfiguration.h \ + src/ui/QGCTCPLinkConfiguration.h \ + src/ui/QGCSettingsWidget.h \ + src/uas/QGCUASParamManager.h \ + src/ui/map/QGCMapWidget.h \ + src/ui/map/MAV2DIcon.h \ + src/ui/map/Waypoint2DIcon.h \ + src/ui/map/QGCMapTool.h \ + src/ui/map/QGCMapToolBar.h \ + src/QGCGeo.h \ + src/ui/QGCToolBar.h \ + src/ui/QGCStatusBar.h \ + src/ui/QGCMAVLinkInspector.h \ + src/ui/WaypointViewOnlyView.h \ + src/ui/WaypointEditableView.h \ + src/ui/UnconnectedUASInfoWidget.h \ + src/ui/QGCRGBDView.h \ + src/ui/mavlink/QGCMAVLinkMessageSender.h \ + src/ui/firmwareupdate/QGCFirmwareUpdateWidget.h \ + src/ui/QGCPluginHost.h \ + src/ui/firmwareupdate/QGCPX4FirmwareUpdate.h \ + src/ui/mission/QGCMissionOther.h \ + src/ui/mission/QGCMissionNavWaypoint.h \ + src/ui/mission/QGCMissionDoJump.h \ + src/ui/mission/QGCMissionDoSetServo.h \ + src/ui/mission/QGCMissionDoRepeatServo.h \ + src/ui/mission/QGCMissionDoDigicamControl.h \ + src/ui/mission/QGCMissionDoChangeSpeed.h \ + src/ui/mission/QGCMissionDoSetCamTriggDist.h \ + src/ui/mission/QGCMissionDoSetHome.h \ + src/ui/mission/QGCMissionDoSetRelay.h \ + src/ui/mission/QGCMissionDoSetROI.h \ + src/ui/mission/QGCMissionDoMountControl.h \ + src/ui/mission/QGCMissionDoRepeatRelay.h \ + src/ui/mission/QGCMissionConditionDelay.h \ + src/ui/mission/QGCMissionConditionYaw.h \ + src/ui/mission/QGCMissionConditionDistance.h \ + src/ui/mission/QGCMissionNavLoiterUnlim.h \ + src/ui/mission/QGCMissionNavLoiterTurns.h \ + src/ui/mission/QGCMissionNavLoiterTime.h \ + src/ui/mission/QGCMissionNavReturnToLaunch.h \ + src/ui/mission/QGCMissionNavLand.h \ + src/ui/mission/QGCMissionNavTakeoff.h \ + src/ui/mission/QGCMissionNavSweep.h \ + src/ui/mission/QGCMissionNavContinueChangeAlt.h \ + src/ui/mission/QGCMissionDoStartSearch.h \ + src/ui/mission/QGCMissionDoFinishSearch.h \ + src/ui/QGCVehicleConfig.h \ + src/comm/QGCHilLink.h \ + src/ui/QGCHilConfiguration.h \ + src/ui/QGCHilFlightGearConfiguration.h \ + src/ui/QGCHilJSBSimConfiguration.h \ +# src/ui/QGCHilXPlaneConfiguration.h \ + src/ui/designer/QGCComboBox.h \ + src/ui/designer/QGCTextLabel.h \ + src/ui/submainwindow.h \ + src/ui/dockwidgettitlebareventfilter.h \ + src/ui/uas/UASQuickView.h \ + src/ui/uas/UASQuickViewItem.h \ + src/ui/uas/UASQuickViewItemSelect.h \ + src/ui/uas/UASQuickViewTextItem.h \ + src/ui/uas/UASQuickViewGaugeItem.h \ + src/ui/uas/UASActionsWidget.h \ + src/ui/designer/QGCRadioChannelDisplay.h \ + src/ui/QGCTabbedInfoView.h \ + src/ui/UASRawStatusView.h \ + src/ui/PrimaryFlightDisplay.h \ + src/ui/uas/QGCMessageView.h \ + src/ui/configuration/ApmHardwareConfig.h \ + src/ui/configuration/ApmSoftwareConfig.h \ + src/ui/configuration/FrameTypeConfig.h \ + src/ui/configuration/CompassConfig.h \ + src/ui/configuration/AccelCalibrationConfig.h \ + src/ui/configuration/RadioCalibrationConfig.h \ + src/ui/configuration/FlightModeConfig.h \ + src/ui/configuration/Radio3DRConfig.h \ + src/ui/configuration/BatteryMonitorConfig.h \ + src/ui/configuration/RangeFinderConfig.h \ + src/ui/configuration/AirspeedConfig.h \ + src/ui/configuration/OpticalFlowConfig.h \ + src/ui/configuration/OsdConfig.h \ + src/ui/configuration/AntennaTrackerConfig.h \ + src/ui/configuration/CameraGimbalConfig.h \ + src/ui/configuration/AP2ConfigWidget.h \ + src/ui/configuration/BasicPidConfig.h \ + src/ui/configuration/StandardParamConfig.h \ + src/ui/configuration/GeoFenceConfig.h \ + src/ui/configuration/FailSafeConfig.h \ + src/ui/configuration/AdvancedParamConfig.h \ + src/ui/configuration/ArduCopterPidConfig.h \ + src/ui/configuration/CopterPidConfig.h \ + src/ui/ApmToolBar.h \ + src/ui/configuration/PX4FirmwareUploader.h \ + src/ui/configuration/ApmPlaneLevel.h \ + src/ui/configuration/ParamWidget.h \ + src/ui/configuration/ArduPlanePidConfig.h \ + src/ui/configuration/AdvParameterList.h \ + src/ui/configuration/ArduRoverPidConfig.h \ + src/ui/configuration/Console.h \ + src/ui/configuration/SerialSettingsDialog.h \ + src/ui/configuration/TerminalConsole.h \ + src/ui/configuration/LogConsole.h \ + src/ui/configuration/ApmHighlighter.h \ + src/ui/configuration/ApmFirmwareConfig.h \ + src/ui/designer/QGCMouseWheelEventFilter.h \ + src/ui/DebugOutput.h \ + src/ui/configuration/APDoubleSpinBox.h \ + src/ui/configuration/APSpinBox.h \ + src/ui/configuration/Radio3DRSettings.h \ + src/ui/configuration/SetupWarningMessage.h \ + src/ui/uas/APMShortcutModesDialog.h \ + src/ui/configuration/DownloadRemoteParamsDialog.h \ + src/ui/configuration/ParamCompareDialog.h \ + src/uas/UASParameter.h \ + src/output/kmlcreator.h \ + src/output/logdata.h \ + src/ui/AP2DataPlot2D.h \ + src/ui/AP2DataPlotThread.h \ + src/ui/dataselectionscreen.h \ + src/ui/qcustomplot.h \ + src/globalobject.h \ + src/ui/AboutDialog.h \ + src/ui/uas/UASQuickViewTextLabel.h \ + src/uas/ApmUiHelpers.h \ + src/ui/AP2DataPlotAxisDialog.h \ + src/comm/arduino_intelhex.h \ + src/comm/arduinoflash.h \ + src/audio/AlsaAudio.h \ + src/ui/AutoUpdateCheck.h \ + src/ui/AutoUpdateDialog.h \ + src/uas/LogDownloadDialog.h \ + src/comm/TLogReplayLink.h \ + src/ui/PrimaryFlightDisplayQML.h \ + src/ui/configuration/CompassMotorCalibrationDialog.h \ + src/comm/MAVLinkDecoder.h \ + src/comm/MAVLinkProtocol.h \ + src/ui/MissionElevationDisplay.h \ + src/ui/GoogleElevationData.h \ + src/ui/DroneshareUploadDialog.h \ + src/ui/DroneshareUpload.h \ + src/ui/DroneshareDialog.h \ + src/ui/LoginDialog.h \ + src/ui/DroneshareAPIBroker.h \ + src/comm/UASObject.h \ + src/comm/VehicleOverview.h \ + src/comm/RelPositionOverview.h \ + src/comm/AbsPositionOverview.h \ + src/comm/MissionOverview.h \ + src/ui/AP2DataPlot2DModel.h \ + src/ui/uas/PreFlightCalibrationDialog.h \ + src/ui/configuration/RadioFlashWizard.h \ + src/ui/GraphTreeWidgetItem.h \ + src/comm/LinkManagerFactory.h \ + src/versioncomparator.h + +SOURCES += \ + src/QGCCore.cc \ + src/uas/UASManager.cc \ + src/uas/UAS.cc \ + src/comm/LinkManager.cc \ + src/comm/LinkInterface.cpp \ + src/comm/QGCFlightGearLink.cc \ + src/comm/QGCJSBSimLink.cc \ +# src/comm/QGCXPlaneLink.cc \ + src/comm/serialconnection.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/uas/UASView.cc \ +#ifdef CAMERAVIEW + src/ui/CameraView.cc \ +#endif + src/comm/MAVLinkSimulationLink.cc \ + src/comm/UDPLink.cc \ + src/comm/UDPClientLink.cc \ + src/comm/TCPLink.cc \ + src/ui/ParameterInterface.cc \ + src/ui/WaypointList.cc \ + src/ui/WaypointNavigation.cc \ + src/Waypoint.cc \ + src/ui/ObjectDetectionView.cc \ + src/input/JoystickInput.cc \ + src/ui/JoystickWidget.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/uas/SlugsMAV.cc \ + src/uas/PxQuadMAV.cc \ + src/uas/ArduPilotMegaMAV.cc \ + src/uas/senseSoarMAV.cpp \ + 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/RadioCalibration/RadioCalibrationData.cc \ + src/ui/map3D/QGCWebPage.cc \ + src/ui/SlugsDataSensorView.cc \ + src/ui/SlugsHilSim.cc \ + 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/QGCCommandButton.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/QGCUDPClientLinkConfiguration.cc \ + src/ui/QGCTCPLinkConfiguration.cc \ + src/ui/QGCSettingsWidget.cc \ + src/uas/QGCUASParamManager.cc \ + src/ui/map/QGCMapWidget.cc \ + src/ui/map/MAV2DIcon.cc \ + src/ui/map/Waypoint2DIcon.cc \ + src/ui/map/QGCMapTool.cc \ + src/ui/map/QGCMapToolBar.cc \ + src/QGCGeo.cc \ + src/ui/QGCToolBar.cc \ + src/ui/QGCStatusBar.cc \ + src/ui/QGCMAVLinkInspector.cc \ + src/ui/WaypointViewOnlyView.cc \ + src/ui/WaypointEditableView.cc \ + src/ui/UnconnectedUASInfoWidget.cc \ + src/ui/QGCRGBDView.cc \ + src/ui/mavlink/QGCMAVLinkMessageSender.cc \ + src/ui/firmwareupdate/QGCFirmwareUpdateWidget.cc \ + src/ui/QGCPluginHost.cc \ + src/ui/firmwareupdate/QGCPX4FirmwareUpdate.cc \ + src/ui/mission/QGCMissionOther.cc \ + src/ui/mission/QGCMissionNavWaypoint.cc \ + src/ui/mission/QGCMissionDoJump.cc \ + src/ui/mission/QGCMissionDoSetServo.cc \ + src/ui/mission/QGCMissionDoRepeatServo.cc \ + src/ui/mission/QGCMissionDoDigicamControl.cc \ + src/ui/mission/QGCMissionDoChangeSpeed.cc \ + src/ui/mission/QGCMissionDoSetCamTriggDist.cc \ + src/ui/mission/QGCMissionDoSetHome.cc \ + src/ui/mission/QGCMissionDoSetRelay.cc \ + src/ui/mission/QGCMissionDoSetROI.cc \ + src/ui/mission/QGCMissionDoMountControl.cc \ + src/ui/mission/QGCMissionDoRepeatRelay.cc \ + src/ui/mission/QGCMissionConditionDelay.cc \ + src/ui/mission/QGCMissionConditionYaw.cc \ + src/ui/mission/QGCMissionConditionDistance.cc \ + src/ui/mission/QGCMissionNavLoiterUnlim.cc \ + src/ui/mission/QGCMissionNavLoiterTurns.cc \ + src/ui/mission/QGCMissionNavLoiterTime.cc \ + src/ui/mission/QGCMissionNavReturnToLaunch.cc \ + src/ui/mission/QGCMissionNavLand.cc \ + src/ui/mission/QGCMissionNavTakeoff.cc \ + src/ui/mission/QGCMissionNavSweep.cc \ + src/ui/mission/QGCMissionNavContinueChangeAlt.cc \ + src/ui/mission/QGCMissionDoStartSearch.cc \ + src/ui/mission/QGCMissionDoFinishSearch.cc \ + src/ui/QGCVehicleConfig.cc \ + src/ui/QGCHilConfiguration.cc \ + src/ui/QGCHilFlightGearConfiguration.cc \ + src/ui/QGCHilJSBSimConfiguration.cc \ +# src/ui/QGCHilXPlaneConfiguration.cc \ + src/ui/designer/QGCComboBox.cc \ + src/ui/designer/QGCTextLabel.cc \ + src/ui/submainwindow.cpp \ + src/ui/dockwidgettitlebareventfilter.cpp \ + src/ui/uas/UASQuickViewItem.cc \ + src/ui/uas/UASQuickView.cc \ + src/ui/uas/UASQuickViewTextItem.cc \ + src/ui/uas/UASQuickViewGaugeItem.cc \ + src/ui/uas/UASQuickViewItemSelect.cc \ + src/ui/uas/UASActionsWidget.cpp \ + src/ui/designer/QGCRadioChannelDisplay.cpp \ + src/ui/QGCTabbedInfoView.cpp \ + src/ui/UASRawStatusView.cpp \ + src/ui/PrimaryFlightDisplay.cc \ + src/ui/uas/QGCMessageView.cc \ + src/ui/configuration/ApmHardwareConfig.cc \ + src/ui/configuration/ApmSoftwareConfig.cc \ + src/ui/configuration/FrameTypeConfig.cc \ + src/ui/configuration/CompassConfig.cc \ + src/ui/configuration/AccelCalibrationConfig.cc \ + src/ui/configuration/RadioCalibrationConfig.cc \ + src/ui/configuration/FlightModeConfig.cc \ + src/ui/configuration/Radio3DRConfig.cc \ + src/ui/configuration/BatteryMonitorConfig.cc \ + src/ui/configuration/RangeFinderConfig.cc \ + src/ui/configuration/AirspeedConfig.cc \ + src/ui/configuration/OpticalFlowConfig.cc \ + src/ui/configuration/OsdConfig.cc \ + src/ui/configuration/AntennaTrackerConfig.cc \ + src/ui/configuration/CameraGimbalConfig.cc \ + src/ui/configuration/AP2ConfigWidget.cc \ + src/ui/configuration/BasicPidConfig.cc \ + src/ui/configuration/StandardParamConfig.cc \ + src/ui/configuration/GeoFenceConfig.cc \ + src/ui/configuration/FailSafeConfig.cc \ + src/ui/configuration/AdvancedParamConfig.cc \ + src/ui/configuration/ArduCopterPidConfig.cc \ + src/ui/configuration/CopterPidConfig.cc \ + src/ui/ApmToolBar.cc \ + src/ui/configuration/PX4FirmwareUploader.cc \ + src/ui/configuration/ApmPlaneLevel.cc \ + src/ui/configuration/ParamWidget.cc \ + src/ui/configuration/ArduPlanePidConfig.cc \ + src/ui/configuration/AdvParameterList.cc \ + src/ui/configuration/ArduRoverPidConfig.cc \ + src/ui/configuration/TerminalConsole.cc \ + src/ui/configuration/LogConsole.cc \ + src/ui/configuration/Console.cc \ + src/ui/configuration/SerialSettingsDialog.cc \ + src/ui/configuration/ApmHighlighter.cc \ + src/ui/configuration/ApmFirmwareConfig.cc \ + src/ui/designer/QGCMouseWheelEventFilter.cc \ + src/ui/DebugOutput.cc \ + src/ui/configuration/APDoubleSpinBox.cc \ + src/ui/configuration/APSpinBox.cc \ + src/ui/configuration/Radio3DRSettings.cc \ + src/ui/configuration/SetupWarningMessage.cc \ + src/ui/uas/APMShortcutModesDialog.cpp \ + src/ui/configuration/DownloadRemoteParamsDialog.cc \ + src/ui/configuration/ParamCompareDialog.cpp \ + src/uas/UASParameter.cpp \ + src/output/kmlcreator.cc \ + src/output/logdata.cc \ + src/ui/AP2DataPlot2D.cpp \ + src/ui/AP2DataPlotThread.cc \ + src/ui/dataselectionscreen.cpp \ + src/ui/qcustomplot.cpp \ + src/globalobject.cc \ + src/ui/AboutDialog.cc \ + src/ui/uas/UASQuickViewTextLabel.cc \ + src/uas/ApmUiHelpers.cc \ + src/ui/AP2DataPlotAxisDialog.cc \ + src/comm/arduino_intelhex.cpp \ + src/comm/arduinoflash.cc \ + src/audio/AlsaAudio.cc \ + src/ui/AutoUpdateCheck.cc \ + src/ui/AutoUpdateDialog.cc \ + src/uas/LogDownloadDialog.cc \ + src/comm/TLogReplayLink.cc \ + src/ui/PrimaryFlightDisplayQML.cpp \ + src/ui/configuration/CompassMotorCalibrationDialog.cpp \ + src/comm/MAVLinkDecoder.cc \ + src/comm/MAVLinkProtocol.cc \ + src/ui/MissionElevationDisplay.cpp \ + src/ui/GoogleElevationData.cpp \ + src/ui/DroneshareUploadDialog.cpp \ + src/ui/DroneshareUpload.cpp \ + src/ui/DroneshareDialog.cc \ + src/ui/LoginDialog.cpp \ + src/ui/DroneshareAPIBroker.cpp \ + src/comm/UASObject.cc \ + src/comm/VehicleOverview.cc \ + src/comm/RelPositionOverview.cc \ + src/comm/AbsPositionOverview.cc \ + src/comm/MissionOverview.cc \ + src/ui/AP2DataPlot2DModel.cc \ + src/ui/uas/PreFlightCalibrationDialog.cpp \ + src/ui/configuration/RadioFlashWizard.cpp \ + src/ui/GraphTreeWidgetItem.cc \ + src/comm/LinkManagerFactory.cpp \ + src/versioncomparator.cc + +OTHER_FILES += \ + qml/components/DigitalDisplay.qml \ + qml/components/StatusDisplay.qml \ + qml/components/ModeDisplay.qml \ + qml/components/HeartbeatDisplay.qml \ + qml/PrimaryFlightDisplayQML.qml \ + qml/components/RollPitchIndicator.qml \ + qml/components/AltitudeIndicator.qml \ + qml/components/SpeedIndicator.qml \ + qml/components/CompassIndicator.qml \ + qml/components/PitchIndicator.qml \ + qml/components/StatusMessageIndicator.qml \ + qml/components/InformationOverlayIndicator.qml + +OTHER_FILES += \ + qml/ApmToolBar.qml \ + qml/components/Button.qml \ + qml/components/TextButton.qml \ + qml/resources/apmplanner/toolbar/connect.png \ + qml/resources/apmplanner/toolbar/flightplanner.png \ + qml/resources/apmplanner/toolbar/helpwizard.png \ + qml/resources/apmplanner/toolbar/light_initialsetup_icon.png \ + qml/resources/apmplanner/toolbar/terminal.png \ + qml/resources/apmplanner/toolbar/simulation.png \ + qml/resources/apmplanner/toolbar/light_tuningconfig_icon.png \ + qml/resources/apmplanner/toolbar/flightdata.png \ + qml/resources/apmplanner/toolbar/disconnect.png \ + qml/resources/apmplanner/toolbar/donate.png \ + +# Command Line Tools +OTHER_FILES += \ + libs/sik_uploader/sik_uploader.py + +#qmlcomponents.path += $${DESTDIR}$${TARGET}/components +#qmlcomponents.files += ./components/Button.qml + +#sources.files += ApmToolBar.qml +#sources.path += $$DESTDIR/qml +#target.path += apmplanner2 +#INSTALLS += sources target + + diff --git a/qgcunittest.pro b/qgcunittest.pro index b8b8a5d564..3de4034eb3 100644 --- a/qgcunittest.pro +++ b/qgcunittest.pro @@ -17,608 +17,19 @@ # along with QGroundControl. If not, see . # ------------------------------------------------- - # Qt configuration CONFIG += qt \ thread \ console -QT += network \ - opengl \ - svg \ - xml \ - phonon \ - webkit \ - sql \ - testlib \ +QT += testlib -TEMPLATE = app -TARGET = qgcunittest BASEDIR = $${IN_PWD} TESTDIR = $$BASEDIR/src/qgcunittest -linux-g++|linux-g++-64{ - debug { - TARGETDIR = $${OUT_PWD}/debug - BUILDDIR = $${OUT_PWD}/build-debug - } - release { - TARGETDIR = $${OUT_PWD}/release - BUILDDIR = $${OUT_PWD}/build-release - } -} else { - TARGETDIR = $${OUT_PWD} - BUILDDIR = $${OUT_PWD}/build -} -LANGUAGE = C++ -OBJECTS_DIR = $${BUILDDIR}/obj -MOC_DIR = $${BUILDDIR}/moc -UI_DIR = $${BUILDDIR}/ui -RCC_DIR = $${BUILDDIR}/rcc -MAVLINK_CONF = "" -MAVLINKPATH = $$BASEDIR/libs/mavlink/include/mavlink/v1.0 -DEFINES += MAVLINK_NO_DATA - -win32 { - QMAKE_INCDIR_QT = $$(QTDIR)/include - QMAKE_LIBDIR_QT = $$(QTDIR)/lib - QMAKE_UIC = "$$(QTDIR)/bin/uic.exe" - QMAKE_MOC = "$$(QTDIR)/bin/moc.exe" - QMAKE_RCC = "$$(QTDIR)/bin/rcc.exe" - QMAKE_QMAKE = "$$(QTDIR)/bin/qmake.exe" - # Build QAX for GoogleEarth API access - !exists( $(QTDIR)/src/activeqt/Makefile ) { - message( Making QAx (ONE TIME) ) - system( cd $$(QTDIR)\\src\\activeqt && $$(QTDIR)\\bin\\qmake.exe ) - system( cd $$(QTDIR)\\src\\activeqt\\container && $$(QTDIR)\\bin\\qmake.exe ) - system( cd $$(QTDIR)\\src\\activeqt\\control && $$(QTDIR)\\bin\\qmake.exe ) - } -} - - - -################################################################# -# EXTERNAL LIBRARY CONFIGURATION - -# EIGEN matrix library (header-only) -INCLUDEPATH += libs/eigen - -# OPMapControl library (from OpenPilot) -include(libs/utils/utils_external.pri) -include(libs/opmapcontrol/opmapcontrol_external.pri) -DEPENDPATH += \ - libs/utils \ - libs/utils/src \ - libs/opmapcontrol \ - libs/opmapcontrol/src \ - libs/opmapcontrol/src/mapwidget - -INCLUDEPATH += \ - libs/utils \ - libs \ - libs/opmapcontrol - -# 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 += $$MAVLINKPATH -isEmpty(MAVLINK_CONF) { - INCLUDEPATH += $$MAVLINKPATH/common -} else { - INCLUDEPATH += $$MAVLINKPATH/$$MAVLINK_CONF - #DEFINES += 'MAVLINK_CONF="$${MAVLINK_CONF}.h"' - DEFINES += $$sprintf('QGC_USE_%1_MESSAGES', $$upper($$MAVLINK_CONF)) -} - -# Include general settings for QGroundControl -# necessary as last include to override any non-acceptable settings -# done by the plugins above -include(qgroundcontrol.pri) -# Reset QMAKE_POST_LINK to prevent file copy operations -QMAKE_POST_LINK = "" - -# Include MAVLink generator -# has been deprecated -DEPENDPATH += \ - src/apps/mavlinkgen - -INCLUDEPATH += \ - src/apps/mavlinkgen \ - src/apps/mavlinkgen/ui \ - src/apps/mavlinkgen/generator - -include(src/apps/mavlinkgen/mavlinkgen.pri) - - - -# Include QWT plotting library -include(libs/qwt/qwt.pri) -DEPENDPATH += . \ - plugins \ - libs/thirdParty/qserialport/include \ - libs/thirdParty/qserialport/include/QtSerialPort \ - libs/thirdParty/qserialport \ - libs/qextserialport - -INCLUDEPATH += . \ - libs/thirdParty/qserialport/include \ - libs/thirdParty/qserialport/include/QtSerialPort \ - libs/thirdParty/qserialport/src \ - libs/qextserialport - -# Include serial port library (QSerial) -include(qserialport.pri) - -# Serial port detection (ripped-off from qextserialport library) -macx|macx-g++|macx-g++42::SOURCES += libs/qextserialport/qextserialenumerator_osx.cpp -linux-g++::SOURCES += libs/qextserialport/qextserialenumerator_unix.cpp -linux-g++-64::SOURCES += libs/qextserialport/qextserialenumerator_unix.cpp -win32::SOURCES += libs/qextserialport/qextserialenumerator_win.cpp -win32-msvc2008|win32-msvc2010::SOURCES += libs/qextserialport/qextserialenumerator_win.cpp - -# 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/ObjectDetectionView.ui \ - src/ui/JoystickWidget.ui \ - src/ui/DebugConsole.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/SlugsPadCameraControl.ui \ - src/ui/uas/QGCUnconnectedInfoWidget.ui \ - src/ui/designer/QGCToolWidget.ui \ - src/ui/designer/QGCParamSlider.ui \ - src/ui/designer/QGCActionButton.ui \ - src/ui/designer/QGCCommandButton.ui \ - src/ui/QGCMAVLinkLogPlayer.ui \ - src/ui/QGCWaypointListMulti.ui \ - src/ui/QGCUDPLinkConfiguration.ui \ - src/ui/QGCTCPLinkConfiguration.ui \ - src/ui/QGCSettingsWidget.ui \ - src/ui/UASControlParameters.ui \ - src/ui/map/QGCMapTool.ui \ - src/ui/map/QGCMapToolBar.ui \ - src/ui/QGCMAVLinkInspector.ui \ - src/ui/WaypointViewOnlyView.ui \ - src/ui/WaypointEditableView.ui \ - src/ui/UnconnectedUASInfoWidget.ui \ - src/ui/mavlink/QGCMAVLinkMessageSender.ui \ - src/ui/firmwareupdate/QGCFirmwareUpdateWidget.ui \ - src/ui/QGCPluginHost.ui \ - src/ui/firmwareupdate/QGCPX4FirmwareUpdate.ui \ - src/ui/mission/QGCMissionOther.ui \ - src/ui/mission/QGCMissionNavWaypoint.ui \ - src/ui/mission/QGCMissionDoJump.ui \ - src/ui/mission/QGCMissionConditionDelay.ui \ - src/ui/mission/QGCMissionNavLoiterUnlim.ui \ - src/ui/mission/QGCMissionNavLoiterTurns.ui \ - src/ui/mission/QGCMissionNavLoiterTime.ui \ - src/ui/mission/QGCMissionNavReturnToLaunch.ui \ - src/ui/mission/QGCMissionNavLand.ui \ - src/ui/mission/QGCMissionNavTakeoff.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/mission \ - src/ui/designer -HEADERS += src/MG.h \ - src/QGCCore.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/ProtocolInterface.h \ - src/comm/MAVLinkProtocol.h \ - src/comm/QGCFlightGearLink.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/ObjectDetectionView.h \ - src/input/JoystickInput.h \ - src/ui/JoystickWidget.h \ - src/ui/DebugConsole.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/uas/senseSoarMAV.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/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/map3D/PixhawkCheetahNode.cc \ - src/ui/SlugsDataSensorView.h \ - src/ui/SlugsHilSim.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/QGCCommandButton.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/QGCTCPLinkConfiguration.h \ - src/ui/QGCSettingsWidget.h \ - src/ui/uas/UASControlParameters.h \ - src/uas/QGCUASParamManager.h \ - src/ui/map/QGCMapWidget.h \ - src/ui/map/MAV2DIcon.h \ - src/ui/map/Waypoint2DIcon.h \ - src/ui/map/QGCMapTool.h \ - src/ui/map/QGCMapToolBar.h \ - src/ui/mission/QGCMissionOther.h \ - src/ui/mission/QGCMissionConditionDelay.h \ - src/ui/mission/QGCMissionDoJump.h \ - src/ui/mission/QGCMissionNavReturnToLaunch.h \ - src/ui/mission/QGCMissionNavLoiterUnlim.h \ - src/ui/mission/QGCMissionNavLoiterTurns.h \ - src/ui/mission/QGCMissionNavTakeoff.h \ - src/ui/mission/QGCMissionNavLand.h \ - src/ui/mission/QGCMissionNavWaypoint.h \ - src/ui/mission/QGCMissionNavLoiterTime.h \ - libs/qextserialport/qextserialenumerator.h \ - src/QGCGeo.h \ - src/ui/QGCToolBar.h \ - src/ui/QGCMAVLinkInspector.h \ - src/ui/MAVLinkDecoder.h \ - src/ui/WaypointViewOnlyView.h \ - src/ui/WaypointViewOnlyView.h \ - src/ui/WaypointEditableView.h \ - src/ui/UnconnectedUASInfoWidget.h \ - src/ui/QGCRGBDView.h \ - src/ui/mavlink/QGCMAVLinkMessageSender.h \ - src/ui/firmwareupdate/QGCFirmwareUpdateWidget.h \ - src/ui/QGCPluginHost.h \ - src/ui/firmwareupdate/QGCPX4FirmwareUpdate.h \ - src/ui/mission/QGCMissionOther.h \ - src/ui/mission/QGCMissionNavWaypoint.h \ - src/ui/mission/QGCMissionDoJump.h \ - src/ui/mission/QGCMissionConditionDelay.h \ - src/ui/mission/QGCMissionNavLoiterUnlim.h \ - src/ui/mission/QGCMissionNavLoiterTurns.h \ - src/ui/mission/QGCMissionNavLoiterTime.h \ - src/ui/mission/QGCMissionNavReturnToLaunch.h \ - src/ui/mission/QGCMissionNavLand.h \ - src/ui/mission/QGCMissionNavTakeoff.h \ - $$TESTDIR/AutoTest.h \ - $$TESTDIR/UASUnitTest.h \ - -# Google Earth is only supported on Mac OS and Windows with Visual Studio Compiler -macx|macx-g++|macx-g++42|win32-msvc2008|win32-msvc2010::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/gpl.h \ - src/ui/map3D/CameraParams.h \ - src/ui/map3D/ViewParamWidget.h \ - src/ui/map3D/SystemContainer.h \ - src/ui/map3D/SystemViewParams.h \ - src/ui/map3D/GlobalViewParams.h \ - src/ui/map3D/SystemGroupNode.h \ - src/ui/map3D/Q3DWidget.h \ - src/ui/map3D/GCManipulator.h \ - src/ui/map3D/ImageWindowGeode.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 \ - src/ui/map3D/TerrainParamDialog.h \ - src/ui/map3D/ImageryParamDialog.h -} -contains(DEPENDENCIES_PRESENT, protobuf):contains(MAVLINK_CONF, pixhawk) { - message("Including headers for Protocol Buffers") - - # Enable only if protobuf is available - HEADERS += libs/mavlink/include/v1.0/pixhawk/pixhawk.pb.h \ - src/ui/map3D/ObstacleGroupNode.h \ - src/ui/map3D/GLOverlayGeode.h -} -contains(DEPENDENCIES_PRESENT, libfreenect) { - message("Including headers for libfreenect") - - # Enable only if libfreenect is available - HEADERS += src/input/Freenect.h -} - -SOURCES += src/QGCCore.cc \ - src/uas/UASManager.cc \ - src/uas/UAS.cc \ - src/comm/LinkManager.cc \ - src/comm/LinkInterface.cpp \ - src/comm/SerialLink.cc \ - src/comm/MAVLinkProtocol.cc \ - src/comm/QGCFlightGearLink.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/ObjectDetectionView.cc \ - src/input/JoystickInput.cc \ - src/ui/JoystickWidget.cc \ - src/ui/DebugConsole.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/uas/senseSoarMAV.cpp \ - 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/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/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/QGCCommandButton.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/QGCTCPLinkConfiguration.cc \ - src/ui/QGCSettingsWidget.cc \ - src/ui/uas/UASControlParameters.cpp \ - src/uas/QGCUASParamManager.cc \ - src/ui/map/QGCMapWidget.cc \ - src/ui/map/MAV2DIcon.cc \ - src/ui/map/Waypoint2DIcon.cc \ - src/ui/map/QGCMapTool.cc \ - src/ui/map/QGCMapToolBar.cc \ - src/ui/mission/QGCMissionOther.cc \ - src/ui/mission/QGCMissionConditionDelay.cc \ - src/ui/mission/QGCMissionDoJump.cc \ - src/ui/mission/QGCMissionNavReturnToLaunch.cc \ - src/ui/mission/QGCMissionNavLoiterUnlim.cc \ - src/ui/mission/QGCMissionNavLoiterTurns.cc \ - src/ui/mission/QGCMissionNavTakeoff.cc \ - src/ui/mission/QGCMissionNavLand.cc \ - src/ui/mission/QGCMissionNavWaypoint.cc \ - src/ui/mission/QGCMissionNavLoiterTime.cc \ - src/ui/QGCToolBar.cc \ - src/ui/QGCMAVLinkInspector.cc \ - src/ui/MAVLinkDecoder.cc \ - src/ui/WaypointViewOnlyView.cc \ - src/ui/WaypointEditableView.cc \ - src/ui/UnconnectedUASInfoWidget.cc \ - src/ui/QGCRGBDView.cc \ - src/ui/mavlink/QGCMAVLinkMessageSender.cc \ - src/ui/firmwareupdate/QGCFirmwareUpdateWidget.cc \ - src/ui/QGCPluginHost.cc \ - src/ui/firmwareupdate/QGCPX4FirmwareUpdate.cc \ - $$TESTDIR/testSuite.cc \ - $$TESTDIR/UASUnitTest.cc - -# Enable Google Earth only on Mac OS and Windows with Visual Studio compiler -macx|macx-g++|macx-g++42|win32-msvc2008|win32-msvc2010::SOURCES += src/ui/map3D/QGCGoogleEarthView.cc - -# Enable OSG only if it has been found -contains(DEPENDENCIES_PRESENT, osg) { - message("Including sources for OpenSceneGraph") - - # Enable only if OpenSceneGraph is available - SOURCES += src/ui/map3D/gpl.cc \ - src/ui/map3D/CameraParams.cc \ - src/ui/map3D/ViewParamWidget.cc \ - src/ui/map3D/SystemContainer.cc \ - src/ui/map3D/SystemViewParams.cc \ - src/ui/map3D/GlobalViewParams.cc \ - src/ui/map3D/SystemGroupNode.cc \ - src/ui/map3D/Q3DWidget.cc \ - src/ui/map3D/ImageWindowGeode.cc \ - src/ui/map3D/GCManipulator.cc \ - src/ui/map3D/PixhawkCheetahNode.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 \ - src/ui/map3D/TerrainParamDialog.cc \ - src/ui/map3D/ImageryParamDialog.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, protobuf):contains(MAVLINK_CONF, pixhawk) { - message("Including sources for Protocol Buffers") - - # Enable only if protobuf is available - SOURCES += libs/mavlink/share/mavlink/src/v1.0/pixhawk/pixhawk.pb.cc \ - src/ui/map3D/ObstacleGroupNode.cc \ - src/ui/map3D/GLOverlayGeode.cc -} -contains(DEPENDENCIES_PRESENT, libfreenect) { - message("Including sources for libfreenect") - - # Enable only if libfreenect is available - SOURCES += src/input/Freenect.cc -} - -# Add icons and other resources -RESOURCES += qgroundcontrol.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 +HEADERS += $$TESTDIR/AutoTest.h \ + $$TESTDIR/TestFrameworkTest.h \ + $$TESTDIR/versioncomparatortest.h -# xbee support -# libxbee only supported by linux and windows systems -win32-msvc2008|win32-msvc2010|linux { - HEADERS += src/comm/XbeeLinkInterface.h \ - src/comm/XbeeLink.h \ - src/comm/HexSpinBox.h \ - src/ui/XbeeConfigurationWindow.h \ - src/comm/CallConv.h - SOURCES += src/comm/XbeeLink.cpp \ - src/comm/HexSpinBox.cpp \ - src/ui/XbeeConfigurationWindow.cpp - DEFINES += XBEELINK - INCLUDEPATH += libs/thirdParty/libxbee -# TO DO: build library when it does not exist already - LIBS += -Llibs/thirdParty/libxbee/lib \ - -llibxbee -} +SOURCES += $$TESTDIR/testSuite.cc \ + $$TESTDIR/TestFrameworkTest.cc \ + $$TESTDIR/versioncomparatortest.cc diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index 2ab758f226..b0787d47b8 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -22,902 +22,20 @@ # along with QGroundControl. If not, see . # ------------------------------------------------- +include(apmplanner_core.pro) -message(Qt version $$[QT_VERSION]) +test { + message("Building unit tests") -# Setup our supported build types. We do this once here and then use the defined config scopes -# to allow us to easily modify suported build types in one place instead of duplicated throughout -# the project file. + TEMPLATE = app + TARGET = apmplanner2_test -linux-g++-64 { - message(Linux build x64_86) - CONFIG += LinuxBuild - DEFINES += Q_LINUX_64 - DISTRO = $$system(lsb_release -i) - contains( DISTRO, "Ubuntu" ) { - DEFINES += Q_UBUNTU - } -} else: linux-g++ { - message(Linux build x86) - CONFIG += LinuxBuild - DEFINES += Q_LINUX_32 - DISTRO = $$system(lsb_release -i) - contains( DISTRO, "Ubuntu" ) { - DEFINES += Q_UBUNTU - } + include(qgcunittest.pro) +} else: { + message("Building main application") -} else : win32-msvc2008 | win32-msvc2010 | win32-msvc2012 { - message(Windows build) - CONFIG += WindowsBuild -} else : win32-x-g++|win64-x-g++ { - message(Windows Cross Build) - CONFIG += WindowsCrossBuild -} else : macx-clang | macx-g++ { - message(Mac build) - CONFIG += MacBuild -} else { - error(Unsupported build type) -} - -# Setup our supported build flavors - -CONFIG(debug, debug|release) { - message(Debug flavor) - CONFIG += DebugBuild -} else:CONFIG(release, debug|release) { - message(Release flavor) - CONFIG += ReleaseBuild -} else { - error(Unsupported build flavor) -} - -# Setup our build directories - -BASEDIR = $${IN_PWD} -DebugBuild { - DESTDIR = $${OUT_PWD}/debug - BUILDDIR = $${OUT_PWD}/build-debug -} -ReleaseBuild { - DESTDIR = $${OUT_PWD}/release - BUILDDIR = $${OUT_PWD}/build-release -} -OBJECTS_DIR = $${BUILDDIR}/obj -MOC_DIR = $${BUILDDIR}/moc -UI_DIR = $${BUILDDIR}/ui -RCC_DIR = $${BUILDDIR}/rcc -LANGUAGE = C++ - -TEMPLATE = app -TARGET = apmplanner2 - -message(BASEDIR $$BASEDIR DESTDIR $$DESTDIR TARGET $$TARGET) - -# Qt configuration -CONFIG += qt \ - thread - -QT += network \ - opengl \ - svg \ - xml \ - webkit \ - sql \ - widgets \ - serialport \ - webkitwidgets \ - script\ - quick \ - printsupport - -## testlib is needed even in release flavor for QSignalSpy support -QT += testlib - -!NOTOUCH { - gittouch.commands = touch qgroundcontrol.pro - QMAKE_EXTRA_TARGETS += gittouch - POST_TARGETDEPS += gittouch -} - -# Turn off serial port warnings -DEFINES += _TTY_NOWARN_ - -#Turn on camera view -#DEFINES += AMERAVIEW -# -# Logging Library -# -include (QsLog/QsLog.pri) -#include (libs/mavlink/include/mavlink/v1.0-qt/mavlink.pri) -# -# OS Specific settings -# - -RaspberryPiBuild { - DEFINES -= CAMERAVIEW -} - -MacBuild { - QT += multimedia - - QMAKE_INFO_PLIST = Custom-Info.plist - CONFIG += x86_64 - CONFIG -= x86 - QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6 - ICON = $$BASEDIR/files/APMIcons/icon.icns - QMAKE_INFO_PLIST = APMPlanner.plist # Sets the pretty name for the build - - DEFINES += GIT_COMMIT=$$system(git describe --dirty=-DEV --always) - DEFINES += GIT_HASH=$$system(git log -n 1 --pretty=format:%H) - - LIBS += -lz - LIBS += -lssl -lcrypto - LIBS += -framework ApplicationServices -} - -LinuxBuild { - DEFINES += __STDC_LIMIT_MACROS - - DEFINES += GIT_COMMIT=$$system(git describe --dirty=-DEV --always) - DEFINES += GIT_HASH=$$system(git log -n 1 --pretty=format:%H) - - LIBS += -lsndfile -lasound - LIBS += -lz - LIBS += -lssl -lcrypto -} - -WindowsBuild { - DEFINES += __STDC_LIMIT_MACROS - - # Specify multi-process compilation within Visual Studio. - # (drastically improves compilation times for multi-core computers) - QMAKE_CXXFLAGS_DEBUG += -MP - QMAKE_CXXFLAGS_RELEASE += -MP - - # QWebkit is not needed on MS-Windows compilation environment - CONFIG -= webkit - - RC_FILE = $$BASEDIR/qgroundcontrol.rc - - DEFINES += GIT_COMMIT=$$system(\"c:/program files (x86)/git/bin/git.exe\" describe --dirty=-DEV --always) - DEFINES += GIT_HASH=$$system(\"c:/program files (x86)/git/bin/git.exe\" log -n 1 --pretty=format:%H) -} - -WindowsCrossBuild { - QT += script - # Windows version cross compiled on linux using - DEFINES += __STDC_LIMIT_MACROS - - # QWebkit is not needed on MS-Windows compilation environment - CONFIG -= webkit - - RC_FILE = $$BASEDIR/qgroundcontrol.rc - LIBS += -lz - CONFIG += exceptions rtti + TEMPLATE = app + TARGET = apmplanner2 - DEFINES += GIT_COMMIT=$$system(git describe --dirty=-DEV --always) - DEFINES += GIT_HASH=$$system(git log -n 1 --pretty=format:%H) + SOURCES += src/main.cc } - -# -# Build flavor specific settings -# - -DebugBuild { -#Let console be defined by the IDE/Build process. - #CONFIG += console -} - -ReleaseBuild { - DEFINES += QT_NO_DEBUG - - WindowsBuild { - # Use link time code generation for beteer optimization (I believe this is supported in msvc express, but not 100% sure) - QMAKE_LFLAGS_LTCG = /LTCG - QMAKE_CFLAGS_LTCG = -GL - } -} - -# -# Unit Test specific configuration goes here (debug only) -# - -#DebugBuild { -# INCLUDEPATH += \ -# src/qgcunittest - -# HEADERS += \ -# src/qgcunittest/AutoTest.h \ -# src/qgcunittest/UASUnitTest.h \ -# src/qgcunittest/MockUASManager.h \ -# src/qgcunittest/MockUAS.h \ -# src/qgcunittest/MockQGCUASParamManager.h \ -# src/qgcunittest/MultiSignalSpy.h \ -# src/qgcunittest/TCPLinkTest.h \ -# src/qgcunittest/FlightModeConfigTest.h - -# SOURCES += \ -# src/qgcunittest/UASUnitTest.cc \ -# src/qgcunittest/MockUASManager.cc \ -# src/qgcunittest/MockUAS.cc \ -# src/qgcunittest/MockQGCUASParamManager.cc \ -# src/qgcunittest/MultiSignalSpy.cc \ -# src/qgcunittest/TCPLinkTest.cc \ -# src/qgcunittest/FlightModeConfigTest.cc -#} - -# -# External library configuration -# - -include(QGCExternalLibs.pri) - -# -# Post link configuration -# - -include(QGCSetup.pri) - -# -# Main QGroundControl portion of project file -# - -RESOURCES += qgroundcontrol.qrc - -TRANSLATIONS += \ - es-MX.ts \ - en-US.ts - -DEPENDPATH += \ - . \ - plugins - -INCLUDEPATH += . - -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/mission \ - src/ui/designer \ - src/ui/configuration \ - src/output - -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/UASView.ui \ - src/ui/ParameterInterface.ui \ - src/ui/WaypointList.ui \ - src/ui/ObjectDetectionView.ui \ - src/ui/JoystickWidget.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/QMap3D.ui \ - src/ui/SlugsDataSensorView.ui \ - src/ui/SlugsHilSim.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/designer/QGCCommandButton.ui \ - src/ui/QGCMAVLinkLogPlayer.ui \ - src/ui/QGCWaypointListMulti.ui \ - src/ui/QGCUDPLinkConfiguration.ui \ - src/ui/QGCUDPClientLinkConfiguration.ui \ - src/ui/QGCTCPLinkConfiguration.ui \ - src/ui/QGCSettingsWidget.ui \ - src/ui/map/QGCMapTool.ui \ - src/ui/map/QGCMapToolBar.ui \ - src/ui/QGCMAVLinkInspector.ui \ - src/ui/WaypointViewOnlyView.ui \ - src/ui/WaypointEditableView.ui \ - src/ui/UnconnectedUASInfoWidget.ui \ - src/ui/mavlink/QGCMAVLinkMessageSender.ui \ - src/ui/firmwareupdate/QGCFirmwareUpdateWidget.ui \ - src/ui/QGCPluginHost.ui \ - src/ui/firmwareupdate/QGCPX4FirmwareUpdate.ui \ - src/ui/mission/QGCMissionOther.ui \ - src/ui/mission/QGCMissionNavWaypoint.ui \ - src/ui/mission/QGCMissionDoJump.ui \ - src/ui/mission/QGCMissionDoSetServo.ui \ - src/ui/mission/QGCMissionDoRepeatServo.ui \ - src/ui/mission/QGCMissionDoDigicamControl.ui \ - src/ui/mission/QGCMissionDoChangeSpeed.ui \ - src/ui/mission/QGCMissionDoSetCamTriggDist.ui \ - src/ui/mission/QGCMissionDoSetHome.ui \ - src/ui/mission/QGCMissionDoSetRelay.ui \ - src/ui/mission/QGCMissionDoSetROI.ui \ - src/ui/mission/QGCMissionDoMountControl.ui \ - src/ui/mission/QGCMissionDoRepeatRelay.ui \ - src/ui/mission/QGCMissionConditionDelay.ui \ - src/ui/mission/QGCMissionConditionYaw.ui \ - src/ui/mission/QGCMissionConditionDistance.ui \ - src/ui/mission/QGCMissionNavLoiterUnlim.ui \ - src/ui/mission/QGCMissionNavLoiterTurns.ui \ - src/ui/mission/QGCMissionNavLoiterTime.ui \ - src/ui/mission/QGCMissionNavReturnToLaunch.ui \ - src/ui/mission/QGCMissionNavLand.ui \ - src/ui/mission/QGCMissionNavTakeoff.ui \ - src/ui/mission/QGCMissionNavSweep.ui \ - src/ui/mission/QGCMissionNavContinueChangeAlt.ui \ - src/ui/mission/QGCMissionDoStartSearch.ui \ - src/ui/mission/QGCMissionDoFinishSearch.ui \ - src/ui/QGCVehicleConfig.ui \ - src/ui/QGCHilConfiguration.ui \ - src/ui/QGCHilFlightGearConfiguration.ui \ - src/ui/QGCHilJSBSimConfiguration.ui \ -# src/ui/QGCHilXPlaneConfiguration.ui \ - src/ui/designer/QGCComboBox.ui \ - src/ui/designer/QGCTextLabel.ui \ - src/ui/uas/UASQuickView.ui \ - src/ui/uas/UASQuickViewItemSelect.ui \ - src/ui/uas/UASActionsWidget.ui \ - src/ui/QGCTabbedInfoView.ui \ - src/ui/UASRawStatusView.ui \ - src/ui/uas/QGCMessageView.ui \ - src/ui/configuration/ApmHardwareConfig.ui \ - src/ui/configuration/ApmSoftwareConfig.ui \ - src/ui/configuration/FrameTypeConfig.ui \ - src/ui/configuration/CompassConfig.ui \ - src/ui/configuration/AccelCalibrationConfig.ui \ - src/ui/configuration/RadioCalibrationConfig.ui \ - src/ui/configuration/FlightModeConfig.ui \ - src/ui/configuration/Radio3DRConfig.ui \ - src/ui/configuration/BatteryMonitorConfig.ui \ - src/ui/configuration/RangeFinderConfig.ui \ - src/ui/configuration/AirspeedConfig.ui \ - src/ui/configuration/OpticalFlowConfig.ui \ - src/ui/configuration/OsdConfig.ui \ - src/ui/configuration/AntennaTrackerConfig.ui \ - src/ui/configuration/CameraGimbalConfig.ui \ - src/ui/configuration/BasicPidConfig.ui \ - src/ui/configuration/StandardParamConfig.ui \ - src/ui/configuration/GeoFenceConfig.ui \ - src/ui/configuration/FailSafeConfig.ui \ - src/ui/configuration/AdvancedParamConfig.ui \ - src/ui/configuration/ArduCopterPidConfig.ui \ - src/ui/configuration/CopterPidConfig.ui \ - src/ui/configuration/ApmPlaneLevel.ui \ - src/ui/configuration/ParamWidget.ui \ - src/ui/configuration/ArduPlanePidConfig.ui \ - src/ui/configuration/AdvParameterList.ui \ - src/ui/configuration/ArduRoverPidConfig.ui \ - src/ui/configuration/TerminalConsole.ui \ - src/ui/configuration/LogConsole.ui \ - src/ui/configuration/SerialSettingsDialog.ui \ - src/ui/configuration/ApmFirmwareConfig.ui \ - src/ui/DebugOutput.ui \ - src/ui/configuration/SetupWarningMessage.ui \ - src/ui/uas/APMShortcutModesDialog.ui \ - src/ui/configuration/DownloadRemoteParamsDialog.ui \ - src/ui/configuration/ParamCompareDialog.ui \ - src/ui/AP2DataPlot2D.ui \ - src/ui/dataselectionscreen.ui \ - src/ui/AboutDialog.ui \ - src/ui/AP2DataPlotAxisDialog.ui \ - src/ui/AutoUpdateDialog.ui \ - src/uas/LogDownloadDialog.ui \ - src/ui/configuration/CompassMotorCalibrationDialog.ui \ - src/ui/MissionElevationDisplay.ui \ - src/ui/DroneshareUploadDialog.ui \ - src/ui/DroneshareDialog.ui \ - src/ui/uas/PreFlightCalibrationDialog.ui \ - src/ui/configuration/RadioFlashWizard.ui - -HEADERS += \ - src/MG.h \ - src/QGCCore.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/ProtocolInterface.h \ - src/comm/QGCFlightGearLink.h \ - src/comm/QGCJSBSimLink.h \ -# src/comm/QGCXPlaneLink.h \ - src/comm/serialconnection.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/configuration.h \ - src/ui/uas/UASView.h \ -#ifdef CAMERAVIEW - src/ui/CameraView.h \ -#endif - src/comm/MAVLinkSimulationLink.h \ - src/comm/UDPLink.h \ - src/comm/UDPClientLink.h \ - src/comm/TCPLink.h \ - src/ui/ParameterInterface.h \ - src/ui/WaypointList.h \ - src/ui/WaypointNavigation.h \ - src/Waypoint.h \ - src/ui/ObjectDetectionView.h \ - src/input/JoystickInput.h \ - src/ui/JoystickWidget.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/uas/SlugsMAV.h \ - src/uas/PxQuadMAV.h \ - src/uas/ArduPilotMegaMAV.h \ - src/uas/senseSoarMAV.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/RadioCalibration/RadioCalibrationData.h \ - src/comm/QGCMAVLink.h \ - src/ui/map3D/QGCWebPage.h \ - src/ui/SlugsDataSensorView.h \ - src/ui/SlugsHilSim.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/QGCCommandButton.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/QGCUDPClientLinkConfiguration.h \ - src/ui/QGCTCPLinkConfiguration.h \ - src/ui/QGCSettingsWidget.h \ - src/uas/QGCUASParamManager.h \ - src/ui/map/QGCMapWidget.h \ - src/ui/map/MAV2DIcon.h \ - src/ui/map/Waypoint2DIcon.h \ - src/ui/map/QGCMapTool.h \ - src/ui/map/QGCMapToolBar.h \ - src/QGCGeo.h \ - src/ui/QGCToolBar.h \ - src/ui/QGCStatusBar.h \ - src/ui/QGCMAVLinkInspector.h \ - src/ui/WaypointViewOnlyView.h \ - src/ui/WaypointEditableView.h \ - src/ui/UnconnectedUASInfoWidget.h \ - src/ui/QGCRGBDView.h \ - src/ui/mavlink/QGCMAVLinkMessageSender.h \ - src/ui/firmwareupdate/QGCFirmwareUpdateWidget.h \ - src/ui/QGCPluginHost.h \ - src/ui/firmwareupdate/QGCPX4FirmwareUpdate.h \ - src/ui/mission/QGCMissionOther.h \ - src/ui/mission/QGCMissionNavWaypoint.h \ - src/ui/mission/QGCMissionDoJump.h \ - src/ui/mission/QGCMissionDoSetServo.h \ - src/ui/mission/QGCMissionDoRepeatServo.h \ - src/ui/mission/QGCMissionDoDigicamControl.h \ - src/ui/mission/QGCMissionDoChangeSpeed.h \ - src/ui/mission/QGCMissionDoSetCamTriggDist.h \ - src/ui/mission/QGCMissionDoSetHome.h \ - src/ui/mission/QGCMissionDoSetRelay.h \ - src/ui/mission/QGCMissionDoSetROI.h \ - src/ui/mission/QGCMissionDoMountControl.h \ - src/ui/mission/QGCMissionDoRepeatRelay.h \ - src/ui/mission/QGCMissionConditionDelay.h \ - src/ui/mission/QGCMissionConditionYaw.h \ - src/ui/mission/QGCMissionConditionDistance.h \ - src/ui/mission/QGCMissionNavLoiterUnlim.h \ - src/ui/mission/QGCMissionNavLoiterTurns.h \ - src/ui/mission/QGCMissionNavLoiterTime.h \ - src/ui/mission/QGCMissionNavReturnToLaunch.h \ - src/ui/mission/QGCMissionNavLand.h \ - src/ui/mission/QGCMissionNavTakeoff.h \ - src/ui/mission/QGCMissionNavSweep.h \ - src/ui/mission/QGCMissionNavContinueChangeAlt.h \ - src/ui/mission/QGCMissionDoStartSearch.h \ - src/ui/mission/QGCMissionDoFinishSearch.h \ - src/ui/QGCVehicleConfig.h \ - src/comm/QGCHilLink.h \ - src/ui/QGCHilConfiguration.h \ - src/ui/QGCHilFlightGearConfiguration.h \ - src/ui/QGCHilJSBSimConfiguration.h \ -# src/ui/QGCHilXPlaneConfiguration.h \ - src/ui/designer/QGCComboBox.h \ - src/ui/designer/QGCTextLabel.h \ - src/ui/submainwindow.h \ - src/ui/dockwidgettitlebareventfilter.h \ - src/ui/uas/UASQuickView.h \ - src/ui/uas/UASQuickViewItem.h \ - src/ui/uas/UASQuickViewItemSelect.h \ - src/ui/uas/UASQuickViewTextItem.h \ - src/ui/uas/UASQuickViewGaugeItem.h \ - src/ui/uas/UASActionsWidget.h \ - src/ui/designer/QGCRadioChannelDisplay.h \ - src/ui/QGCTabbedInfoView.h \ - src/ui/UASRawStatusView.h \ - src/ui/PrimaryFlightDisplay.h \ - src/ui/uas/QGCMessageView.h \ - src/ui/configuration/ApmHardwareConfig.h \ - src/ui/configuration/ApmSoftwareConfig.h \ - src/ui/configuration/FrameTypeConfig.h \ - src/ui/configuration/CompassConfig.h \ - src/ui/configuration/AccelCalibrationConfig.h \ - src/ui/configuration/RadioCalibrationConfig.h \ - src/ui/configuration/FlightModeConfig.h \ - src/ui/configuration/Radio3DRConfig.h \ - src/ui/configuration/BatteryMonitorConfig.h \ - src/ui/configuration/RangeFinderConfig.h \ - src/ui/configuration/AirspeedConfig.h \ - src/ui/configuration/OpticalFlowConfig.h \ - src/ui/configuration/OsdConfig.h \ - src/ui/configuration/AntennaTrackerConfig.h \ - src/ui/configuration/CameraGimbalConfig.h \ - src/ui/configuration/AP2ConfigWidget.h \ - src/ui/configuration/BasicPidConfig.h \ - src/ui/configuration/StandardParamConfig.h \ - src/ui/configuration/GeoFenceConfig.h \ - src/ui/configuration/FailSafeConfig.h \ - src/ui/configuration/AdvancedParamConfig.h \ - src/ui/configuration/ArduCopterPidConfig.h \ - src/ui/configuration/CopterPidConfig.h \ - src/ui/ApmToolBar.h \ - src/ui/configuration/PX4FirmwareUploader.h \ - src/ui/configuration/ApmPlaneLevel.h \ - src/ui/configuration/ParamWidget.h \ - src/ui/configuration/ArduPlanePidConfig.h \ - src/ui/configuration/AdvParameterList.h \ - src/ui/configuration/ArduRoverPidConfig.h \ - src/ui/configuration/Console.h \ - src/ui/configuration/SerialSettingsDialog.h \ - src/ui/configuration/TerminalConsole.h \ - src/ui/configuration/LogConsole.h \ - src/ui/configuration/ApmHighlighter.h \ - src/ui/configuration/ApmFirmwareConfig.h \ - src/ui/designer/QGCMouseWheelEventFilter.h \ - src/ui/DebugOutput.h \ - src/ui/configuration/APDoubleSpinBox.h \ - src/ui/configuration/APSpinBox.h \ - src/ui/configuration/Radio3DRSettings.h \ - src/ui/configuration/SetupWarningMessage.h \ - src/ui/uas/APMShortcutModesDialog.h \ - src/ui/configuration/DownloadRemoteParamsDialog.h \ - src/ui/configuration/ParamCompareDialog.h \ - src/uas/UASParameter.h \ - src/output/kmlcreator.h \ - src/output/logdata.h \ - src/ui/AP2DataPlot2D.h \ - src/ui/AP2DataPlotThread.h \ - src/ui/dataselectionscreen.h \ - src/ui/qcustomplot.h \ - src/globalobject.h \ - src/ui/AboutDialog.h \ - src/ui/uas/UASQuickViewTextLabel.h \ - src/uas/ApmUiHelpers.h \ - src/ui/AP2DataPlotAxisDialog.h \ - src/comm/arduino_intelhex.h \ - src/comm/arduinoflash.h \ - src/audio/AlsaAudio.h \ - src/ui/AutoUpdateCheck.h \ - src/ui/AutoUpdateDialog.h \ - src/uas/LogDownloadDialog.h \ - src/comm/TLogReplayLink.h \ - src/ui/PrimaryFlightDisplayQML.h \ - src/ui/configuration/CompassMotorCalibrationDialog.h \ - src/comm/MAVLinkDecoder.h \ - src/comm/MAVLinkProtocol.h \ - src/ui/MissionElevationDisplay.h \ - src/ui/GoogleElevationData.h \ - src/ui/DroneshareUploadDialog.h \ - src/ui/DroneshareUpload.h \ - src/ui/DroneshareDialog.h \ - src/ui/LoginDialog.h \ - src/ui/DroneshareAPIBroker.h \ - src/comm/UASObject.h \ - src/comm/VehicleOverview.h \ - src/comm/RelPositionOverview.h \ - src/comm/AbsPositionOverview.h \ - src/comm/MissionOverview.h \ - src/ui/AP2DataPlot2DModel.h \ - src/ui/uas/PreFlightCalibrationDialog.h \ - src/ui/configuration/RadioFlashWizard.h \ - src/ui/GraphTreeWidgetItem.h \ - src/comm/LinkManagerFactory.h - -SOURCES += src/main.cc \ - src/QGCCore.cc \ - src/uas/UASManager.cc \ - src/uas/UAS.cc \ - src/comm/LinkManager.cc \ - src/comm/LinkInterface.cpp \ - src/comm/QGCFlightGearLink.cc \ - src/comm/QGCJSBSimLink.cc \ -# src/comm/QGCXPlaneLink.cc \ - src/comm/serialconnection.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/uas/UASView.cc \ -#ifdef CAMERAVIEW - src/ui/CameraView.cc \ -#endif - src/comm/MAVLinkSimulationLink.cc \ - src/comm/UDPLink.cc \ - src/comm/UDPClientLink.cc \ - src/comm/TCPLink.cc \ - src/ui/ParameterInterface.cc \ - src/ui/WaypointList.cc \ - src/ui/WaypointNavigation.cc \ - src/Waypoint.cc \ - src/ui/ObjectDetectionView.cc \ - src/input/JoystickInput.cc \ - src/ui/JoystickWidget.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/uas/SlugsMAV.cc \ - src/uas/PxQuadMAV.cc \ - src/uas/ArduPilotMegaMAV.cc \ - src/uas/senseSoarMAV.cpp \ - 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/RadioCalibration/RadioCalibrationData.cc \ - src/ui/map3D/QGCWebPage.cc \ - src/ui/SlugsDataSensorView.cc \ - src/ui/SlugsHilSim.cc \ - 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/QGCCommandButton.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/QGCUDPClientLinkConfiguration.cc \ - src/ui/QGCTCPLinkConfiguration.cc \ - src/ui/QGCSettingsWidget.cc \ - src/uas/QGCUASParamManager.cc \ - src/ui/map/QGCMapWidget.cc \ - src/ui/map/MAV2DIcon.cc \ - src/ui/map/Waypoint2DIcon.cc \ - src/ui/map/QGCMapTool.cc \ - src/ui/map/QGCMapToolBar.cc \ - src/QGCGeo.cc \ - src/ui/QGCToolBar.cc \ - src/ui/QGCStatusBar.cc \ - src/ui/QGCMAVLinkInspector.cc \ - src/ui/WaypointViewOnlyView.cc \ - src/ui/WaypointEditableView.cc \ - src/ui/UnconnectedUASInfoWidget.cc \ - src/ui/QGCRGBDView.cc \ - src/ui/mavlink/QGCMAVLinkMessageSender.cc \ - src/ui/firmwareupdate/QGCFirmwareUpdateWidget.cc \ - src/ui/QGCPluginHost.cc \ - src/ui/firmwareupdate/QGCPX4FirmwareUpdate.cc \ - src/ui/mission/QGCMissionOther.cc \ - src/ui/mission/QGCMissionNavWaypoint.cc \ - src/ui/mission/QGCMissionDoJump.cc \ - src/ui/mission/QGCMissionDoSetServo.cc \ - src/ui/mission/QGCMissionDoRepeatServo.cc \ - src/ui/mission/QGCMissionDoDigicamControl.cc \ - src/ui/mission/QGCMissionDoChangeSpeed.cc \ - src/ui/mission/QGCMissionDoSetCamTriggDist.cc \ - src/ui/mission/QGCMissionDoSetHome.cc \ - src/ui/mission/QGCMissionDoSetRelay.cc \ - src/ui/mission/QGCMissionDoSetROI.cc \ - src/ui/mission/QGCMissionDoMountControl.cc \ - src/ui/mission/QGCMissionDoRepeatRelay.cc \ - src/ui/mission/QGCMissionConditionDelay.cc \ - src/ui/mission/QGCMissionConditionYaw.cc \ - src/ui/mission/QGCMissionConditionDistance.cc \ - src/ui/mission/QGCMissionNavLoiterUnlim.cc \ - src/ui/mission/QGCMissionNavLoiterTurns.cc \ - src/ui/mission/QGCMissionNavLoiterTime.cc \ - src/ui/mission/QGCMissionNavReturnToLaunch.cc \ - src/ui/mission/QGCMissionNavLand.cc \ - src/ui/mission/QGCMissionNavTakeoff.cc \ - src/ui/mission/QGCMissionNavSweep.cc \ - src/ui/mission/QGCMissionNavContinueChangeAlt.cc \ - src/ui/mission/QGCMissionDoStartSearch.cc \ - src/ui/mission/QGCMissionDoFinishSearch.cc \ - src/ui/QGCVehicleConfig.cc \ - src/ui/QGCHilConfiguration.cc \ - src/ui/QGCHilFlightGearConfiguration.cc \ - src/ui/QGCHilJSBSimConfiguration.cc \ -# src/ui/QGCHilXPlaneConfiguration.cc \ - src/ui/designer/QGCComboBox.cc \ - src/ui/designer/QGCTextLabel.cc \ - src/ui/submainwindow.cpp \ - src/ui/dockwidgettitlebareventfilter.cpp \ - src/ui/uas/UASQuickViewItem.cc \ - src/ui/uas/UASQuickView.cc \ - src/ui/uas/UASQuickViewTextItem.cc \ - src/ui/uas/UASQuickViewGaugeItem.cc \ - src/ui/uas/UASQuickViewItemSelect.cc \ - src/ui/uas/UASActionsWidget.cpp \ - src/ui/designer/QGCRadioChannelDisplay.cpp \ - src/ui/QGCTabbedInfoView.cpp \ - src/ui/UASRawStatusView.cpp \ - src/ui/PrimaryFlightDisplay.cc \ - src/ui/uas/QGCMessageView.cc \ - src/ui/configuration/ApmHardwareConfig.cc \ - src/ui/configuration/ApmSoftwareConfig.cc \ - src/ui/configuration/FrameTypeConfig.cc \ - src/ui/configuration/CompassConfig.cc \ - src/ui/configuration/AccelCalibrationConfig.cc \ - src/ui/configuration/RadioCalibrationConfig.cc \ - src/ui/configuration/FlightModeConfig.cc \ - src/ui/configuration/Radio3DRConfig.cc \ - src/ui/configuration/BatteryMonitorConfig.cc \ - src/ui/configuration/RangeFinderConfig.cc \ - src/ui/configuration/AirspeedConfig.cc \ - src/ui/configuration/OpticalFlowConfig.cc \ - src/ui/configuration/OsdConfig.cc \ - src/ui/configuration/AntennaTrackerConfig.cc \ - src/ui/configuration/CameraGimbalConfig.cc \ - src/ui/configuration/AP2ConfigWidget.cc \ - src/ui/configuration/BasicPidConfig.cc \ - src/ui/configuration/StandardParamConfig.cc \ - src/ui/configuration/GeoFenceConfig.cc \ - src/ui/configuration/FailSafeConfig.cc \ - src/ui/configuration/AdvancedParamConfig.cc \ - src/ui/configuration/ArduCopterPidConfig.cc \ - src/ui/configuration/CopterPidConfig.cc \ - src/ui/ApmToolBar.cc \ - src/ui/configuration/PX4FirmwareUploader.cc \ - src/ui/configuration/ApmPlaneLevel.cc \ - src/ui/configuration/ParamWidget.cc \ - src/ui/configuration/ArduPlanePidConfig.cc \ - src/ui/configuration/AdvParameterList.cc \ - src/ui/configuration/ArduRoverPidConfig.cc \ - src/ui/configuration/TerminalConsole.cc \ - src/ui/configuration/LogConsole.cc \ - src/ui/configuration/Console.cc \ - src/ui/configuration/SerialSettingsDialog.cc \ - src/ui/configuration/ApmHighlighter.cc \ - src/ui/configuration/ApmFirmwareConfig.cc \ - src/ui/designer/QGCMouseWheelEventFilter.cc \ - src/ui/DebugOutput.cc \ - src/ui/configuration/APDoubleSpinBox.cc \ - src/ui/configuration/APSpinBox.cc \ - src/ui/configuration/Radio3DRSettings.cc \ - src/ui/configuration/SetupWarningMessage.cc \ - src/ui/uas/APMShortcutModesDialog.cpp \ - src/ui/configuration/DownloadRemoteParamsDialog.cc \ - src/ui/configuration/ParamCompareDialog.cpp \ - src/uas/UASParameter.cpp \ - src/output/kmlcreator.cc \ - src/output/logdata.cc \ - src/ui/AP2DataPlot2D.cpp \ - src/ui/AP2DataPlotThread.cc \ - src/ui/dataselectionscreen.cpp \ - src/ui/qcustomplot.cpp \ - src/globalobject.cc \ - src/ui/AboutDialog.cc \ - src/ui/uas/UASQuickViewTextLabel.cc \ - src/uas/ApmUiHelpers.cc \ - src/ui/AP2DataPlotAxisDialog.cc \ - src/comm/arduino_intelhex.cpp \ - src/comm/arduinoflash.cc \ - src/audio/AlsaAudio.cc \ - src/ui/AutoUpdateCheck.cc \ - src/ui/AutoUpdateDialog.cc \ - src/uas/LogDownloadDialog.cc \ - src/comm/TLogReplayLink.cc \ - src/ui/PrimaryFlightDisplayQML.cpp \ - src/ui/configuration/CompassMotorCalibrationDialog.cpp \ - src/comm/MAVLinkDecoder.cc \ - src/comm/MAVLinkProtocol.cc \ - src/ui/MissionElevationDisplay.cpp \ - src/ui/GoogleElevationData.cpp \ - src/ui/DroneshareUploadDialog.cpp \ - src/ui/DroneshareUpload.cpp \ - src/ui/DroneshareDialog.cc \ - src/ui/LoginDialog.cpp \ - src/ui/DroneshareAPIBroker.cpp \ - src/comm/UASObject.cc \ - src/comm/VehicleOverview.cc \ - src/comm/RelPositionOverview.cc \ - src/comm/AbsPositionOverview.cc \ - src/comm/MissionOverview.cc \ - src/ui/AP2DataPlot2DModel.cc \ - src/ui/uas/PreFlightCalibrationDialog.cpp \ - src/ui/configuration/RadioFlashWizard.cpp \ - src/ui/GraphTreeWidgetItem.cc \ - src/comm/LinkManagerFactory.cpp - -OTHER_FILES += \ - qml/components/DigitalDisplay.qml \ - qml/components/StatusDisplay.qml \ - qml/components/ModeDisplay.qml \ - qml/components/HeartbeatDisplay.qml \ - qml/PrimaryFlightDisplayQML.qml \ - qml/components/RollPitchIndicator.qml \ - qml/components/AltitudeIndicator.qml \ - qml/components/SpeedIndicator.qml \ - qml/components/CompassIndicator.qml \ - qml/components/PitchIndicator.qml \ - qml/components/StatusMessageIndicator.qml \ - qml/components/InformationOverlayIndicator.qml - -OTHER_FILES += \ - qml/ApmToolBar.qml \ - qml/components/Button.qml \ - qml/components/TextButton.qml \ - qml/resources/apmplanner/toolbar/connect.png \ - qml/resources/apmplanner/toolbar/flightplanner.png \ - qml/resources/apmplanner/toolbar/helpwizard.png \ - qml/resources/apmplanner/toolbar/light_initialsetup_icon.png \ - qml/resources/apmplanner/toolbar/terminal.png \ - qml/resources/apmplanner/toolbar/simulation.png \ - qml/resources/apmplanner/toolbar/light_tuningconfig_icon.png \ - qml/resources/apmplanner/toolbar/flightdata.png \ - qml/resources/apmplanner/toolbar/disconnect.png \ - qml/resources/apmplanner/toolbar/donate.png \ - -# Command Line Tools -OTHER_FILES += \ - libs/sik_uploader/sik_uploader.py - -#qmlcomponents.path += $${DESTDIR}$${TARGET}/components -#qmlcomponents.files += ./components/Button.qml - -#sources.files += ApmToolBar.qml -#sources.path += $$DESTDIR/qml -#target.path += apmplanner2 -#INSTALLS += sources target - - diff --git a/src/qgcunittest/TestFrameworkTest.cc b/src/qgcunittest/TestFrameworkTest.cc new file mode 100644 index 0000000000..9a2a5f95bf --- /dev/null +++ b/src/qgcunittest/TestFrameworkTest.cc @@ -0,0 +1,25 @@ +#include + +#include "TestFrameworkTest.h" + +//This function is called before every test +void TestFrameworkTest::init() +{ +} + +//this function is called after every test +void TestFrameworkTest::cleanup() +{ +} + +void TestFrameworkTest::testStringComparison() +{ + QString test("test"); + QVERIFY(test == "test"); +} + +void TestFrameworkTest::testIntComparison() +{ + int x = 5; + QVERIFY(x == 5); +} diff --git a/src/qgcunittest/TestFrameworkTest.h b/src/qgcunittest/TestFrameworkTest.h new file mode 100644 index 0000000000..c149a2a5c0 --- /dev/null +++ b/src/qgcunittest/TestFrameworkTest.h @@ -0,0 +1,23 @@ +#ifndef TESTFRAMEWORKTEST_H +#define TESTFRAMEWORKTEST_H + +#include + +#include "AutoTest.h" + +class TestFrameworkTest : public QObject +{ + Q_OBJECT + +private slots: + void init(); + void cleanup(); + +private slots: + void testStringComparison(); + + void testIntComparison(); +}; + +DECLARE_TEST(TestFrameworkTest) +#endif // TESTFRAMEWORKTEST_H diff --git a/src/qgcunittest/versioncomparatortest.cc b/src/qgcunittest/versioncomparatortest.cc new file mode 100644 index 0000000000..a2f621e11b --- /dev/null +++ b/src/qgcunittest/versioncomparatortest.cc @@ -0,0 +1,116 @@ +#include "versioncomparatortest.h" + +#include + +#include "versioncomparator.h" + + +VersionComparatorTest::VersionComparatorTest() +{ +} + +void VersionComparatorTest::testHigherMajorNumberIsNewer() +{ + const QString newVersion("v2.3.2-rc1"); + const QString currentVersion("v1.2.4"); + + QCOMPARE(VersionComparator::isVersionNewer(newVersion, currentVersion), true); + QCOMPARE(VersionComparator::isVersionNewer(currentVersion, newVersion), false); +} + +void VersionComparatorTest::testHigherMajorNumberWithoutBuildNumberIsNewer() +{ + const QString newVersion("v2.1"); + const QString currentVersion("v1.2"); + + QCOMPARE(VersionComparator::isVersionNewer(newVersion, currentVersion), true); + QCOMPARE(VersionComparator::isVersionNewer(currentVersion, newVersion), false); +} + +void VersionComparatorTest::testEqualMajorNumberIsNotNewer() +{ + const QString newVersion("v1.0.0"); + const QString currentVersion("1.0.0"); + + QCOMPARE(VersionComparator::isVersionNewer(newVersion, currentVersion), false); +} + +void VersionComparatorTest::testHigherMinorNumberIsNewer() +{ + const QString newVersion("v1.32.24-rc1"); + const QString currentVersion("1.31.4"); + + QCOMPARE(VersionComparator::isVersionNewer(newVersion, currentVersion), true); + QCOMPARE(VersionComparator::isVersionNewer(currentVersion, newVersion), false); +} + +void VersionComparatorTest::testHigherMinorNumberWithoutBuildNumberIsHigher() +{ + const QString newVersion("1.1"); + const QString currentVersion("1.0"); + + QCOMPARE(VersionComparator::isVersionNewer(newVersion, currentVersion), true); + QCOMPARE(VersionComparator::isVersionNewer(currentVersion, newVersion), false); +} + +void VersionComparatorTest::testEqualMinorNumberIsNotNewer() +{ + const QString newVersion("v1.3.0"); + const QString currentVersion("1.3.0"); + + QCOMPARE(VersionComparator::isVersionNewer(newVersion, currentVersion), false); +} + + +void VersionComparatorTest::testHigherBuildNumberIsNewer() +{ + const QString newVersion("v2.3.24"); + const QString currentVersion("v2.3.20-rc1"); + + QCOMPARE(VersionComparator::isVersionNewer(newVersion, currentVersion), true); + QCOMPARE(VersionComparator::isVersionNewer(currentVersion, newVersion), false); +} + +void VersionComparatorTest::testEqualBuildNumberIsNotNewer() +{ + const QString newVersion("2.3.3"); + const QString currentVersion("v2.3.3"); + + QCOMPARE(VersionComparator::isVersionNewer(newVersion, currentVersion), false); +} + +void VersionComparatorTest::testExistingBuildNumberIsNewerThanNoBuildNumber() +{ + const QString newVersion("2.3.2"); + const QString currentVersion("v2.3"); + + QCOMPARE(VersionComparator::isVersionNewer(newVersion, currentVersion), true); + QCOMPARE(VersionComparator::isVersionNewer(currentVersion, newVersion), false); +} + +void VersionComparatorTest::testNoReleaseCandidateIsNewerThanExistingReleaseCandidate() +{ + const QString newVersion("2.3.2"); + const QString currentVersion("2.3.2-rc1"); + + QCOMPARE(VersionComparator::isVersionNewer(newVersion, currentVersion), true); + QCOMPARE(VersionComparator::isVersionNewer(currentVersion, newVersion), false); +} + +void VersionComparatorTest::testHigherReleaseCandidateIsNewer() +{ + const QString newVersion("2.3.2-rc3"); + const QString currentVersion("2.3.2-rc1"); + + QCOMPARE(VersionComparator::isVersionNewer(newVersion, currentVersion), true); + QCOMPARE(VersionComparator::isVersionNewer(currentVersion, newVersion), false); +} + +void VersionComparatorTest::testInvalidNewVersionReturnsFalse() +{ + const QString newVersion("abcdef"); + const QString currentVersion("2.3.2-rc1"); + + QCOMPARE(VersionComparator::isVersionNewer(newVersion, currentVersion), false); +} + diff --git a/src/qgcunittest/versioncomparatortest.h b/src/qgcunittest/versioncomparatortest.h new file mode 100644 index 0000000000..35a66ef7b5 --- /dev/null +++ b/src/qgcunittest/versioncomparatortest.h @@ -0,0 +1,41 @@ +#ifndef VERSIONCOMPARATORTEST_H +#define VERSIONCOMPARATORTEST_H + +#include + +#include "AutoTest.h" + +class VersionComparatorTest : public QObject +{ + Q_OBJECT +public: + VersionComparatorTest(); + +private slots: + void testHigherMajorNumberIsNewer(); + + void testHigherMajorNumberWithoutBuildNumberIsNewer(); + + void testEqualMajorNumberIsNotNewer(); + + void testHigherMinorNumberIsNewer(); + + void testHigherMinorNumberWithoutBuildNumberIsHigher(); + + void testEqualMinorNumberIsNotNewer(); + + void testHigherBuildNumberIsNewer(); + + void testEqualBuildNumberIsNotNewer(); + + void testExistingBuildNumberIsNewerThanNoBuildNumber(); + + void testNoReleaseCandidateIsNewerThanExistingReleaseCandidate(); + + void testHigherReleaseCandidateIsNewer(); + + void testInvalidNewVersionReturnsFalse(); +}; + +DECLARE_TEST(VersionComparatorTest) +#endif // VERSIONCOMPARATORTEST_H diff --git a/src/ui/AutoUpdateCheck.cc b/src/ui/AutoUpdateCheck.cc index 03f42d71c3..050a603861 100644 --- a/src/ui/AutoUpdateCheck.cc +++ b/src/ui/AutoUpdateCheck.cc @@ -34,8 +34,7 @@ This file is part of the APM_PLANNER project #include #include #include "QGC.h" - -static const QString VersionCompareRegEx = "(\\d*\\.\\d+\\.?\\d+)-?(rc\\d)?"; +#include "versioncomparator.h" AutoUpdateCheck::AutoUpdateCheck(QObject *parent) : QObject(parent), @@ -170,100 +169,7 @@ void AutoUpdateCheck::updateDataReadProgress(qint64 bytesRead, qint64 totalBytes bool AutoUpdateCheck::compareVersionStrings(const QString& newVersion, const QString& currentVersion) { - // [TODO] DRY this out by creating global function for use in APM Firmware as well - int newMajor = 0,newMinor = 0,newBuild = 0; - int currentMajor = 0, currentMinor = 0,currentBuild = 0; - - QString newBuildSubMoniker, oldBuildSubMoniker; // holds if the build is a rc or dev build - - - QRegExp versionEx(VersionCompareRegEx); - QString versionstr = ""; - int pos = versionEx.indexIn(newVersion); - if (pos > -1) { - // Split first sub-element to get numercal major.minor.build version - QLOG_DEBUG() << "Detected newVersion:" << versionEx.capturedTexts()<< " count:" - << versionEx.captureCount(); - versionstr = versionEx.cap(1); - QStringList versionList = versionstr.split("."); - newMajor = versionList[0].toInt(); - newMinor = versionList[1].toInt(); - if (versionList.size() > 2){ - newBuild = versionList[2].toInt(); - } - // second subelement is either rcX candidate or developement build - if (versionEx.captureCount() == 2) - newBuildSubMoniker = versionEx.cap(2); - } - - QRegExp versionEx2(VersionCompareRegEx); - versionstr = ""; - pos = versionEx2.indexIn(currentVersion); - if (pos > -1) { - QLOG_DEBUG() << "Detected currentVersion:" << versionEx2.capturedTexts() << " count:" - << versionEx2.captureCount(); - versionstr = versionEx2.cap(1); - QStringList versionList = versionstr.split("."); - currentMajor = versionList[0].toInt(); - currentMinor = versionList[1].toInt(); - if (versionList.size() > 2){ - currentBuild = versionList[2].toInt(); - } - // second subelement is either rcX candidate or developement build - if (versionEx2.captureCount() == 2) - oldBuildSubMoniker = versionEx2.cap(2); - } - - QLOG_DEBUG() << "Verison Compare:" <currentMajor){ - // A Major release - return true; - } else if (newMajor == currentMajor){ - if (newMinor > currentMinor){ - // A minor release - return true; - } else if (newMinor == currentMinor){ - if (newBuild > currentBuild) - // new build (or tiny release) - return true; - else if (newBuild == currentBuild) { - // Check if RC is newer - // If the version isn't newer, it might be a new release candidate - int newRc = 0, oldRc = 0; - - if (newBuildSubMoniker.startsWith("RC", Qt::CaseInsensitive) - && oldBuildSubMoniker.startsWith("RC", Qt::CaseInsensitive)) { - QRegExp releaseNumber("\\d+"); - pos = releaseNumber.indexIn(newBuildSubMoniker); - if (pos > -1) { - QLOG_DEBUG() << "Detected newRc:" << versionEx.capturedTexts(); - newRc = releaseNumber.cap(0).toInt(); - } - - QRegExp releaseNumber2("\\d+"); - pos = releaseNumber2.indexIn(oldBuildSubMoniker); - if (pos > -1) { - QLOG_DEBUG() << "Detected oldRc:" << versionEx2.capturedTexts(); - oldRc = releaseNumber2.cap(0).toInt(); - } - - if (newRc > oldRc) - return true; - } - - if (newBuildSubMoniker.length() == 0 - && oldBuildSubMoniker.startsWith("RC", Qt::CaseInsensitive)) { - QLOG_DEBUG() << "Stable build newer that last unstable release candidate "; - return true; // this means a new stable build of the unstable rc is available - } - } - } - } - - - - return false; + return VersionComparator::isVersionNewer(newVersion, currentVersion); } void AutoUpdateCheck::setSkipVersion(const QString& version) diff --git a/src/ui/configuration/ApmFirmwareConfig.cc b/src/ui/configuration/ApmFirmwareConfig.cc index f57d93e440..3a18c1ece7 100644 --- a/src/ui/configuration/ApmFirmwareConfig.cc +++ b/src/ui/configuration/ApmFirmwareConfig.cc @@ -30,6 +30,7 @@ This file is part of the APM_PLANNER project #include "PX4FirmwareUploader.h" #include #include "arduino_intelhex.h" +#include "versioncomparator.h" #define ATMEGA2560CHIPID QByteArray().append(0x1E).append(0x98).append(0x01) @@ -1059,98 +1060,7 @@ bool ApmFirmwareConfig::versionIsGreaterThan(QString verstr,double version) bool ApmFirmwareConfig::compareVersionStrings(const QString& newVersion, const QString& currentVersion) { - int newMajor,newMinor,newBuild = 0; - int currentMajor, currentMinor,currentBuild = 0; - - QString newBuildSubMoniker, oldBuildSubMoniker; // holds if the build is a rc or dev build - - QRegExp versionEx("(\\d*\\.\\d+\\.?\\d?)-?(rc\\d)?"); - QString versionstr = ""; - int pos = versionEx.indexIn(newVersion); - if (pos > -1) { - // Split first sub-element to get numercal major.minor.build version - QLOG_DEBUG() << "Detected newVersion:" << versionEx.capturedTexts()<< " count:" - << versionEx.captureCount(); - versionstr = versionEx.cap(1); - QStringList versionList = versionstr.split("."); - newMajor = versionList[0].toInt(); - newMinor = versionList[1].toInt(); - if (versionList.size() > 2){ - newBuild = versionList[2].toInt(); - } - // second subelement is either rcX candidate or developement build - if (versionEx.captureCount() == 2) - newBuildSubMoniker = versionEx.cap(2); - } - - QRegExp versionEx2("(\\d*\\.\\d+\\.?\\d?)-?(rc\\d)?"); - versionstr = ""; - pos = versionEx2.indexIn(currentVersion); - if (pos > -1) { - QLOG_DEBUG() << "Detected currentVersion:" << versionEx2.capturedTexts() << " count:" - << versionEx2.captureCount(); - versionstr = versionEx2.cap(1); - QStringList versionList = versionstr.split("."); - currentMajor = versionList[0].toInt(); - currentMinor = versionList[1].toInt(); - if (versionList.size() > 2){ - currentBuild = versionList[2].toInt(); - } - // second subelement is either rcX candidate or developement build - if (versionEx2.captureCount() == 2) - oldBuildSubMoniker = versionEx2.cap(2); - } - - QLOG_DEBUG() << "Verison Compare:" < Old Version %d.%d.%d", - newMajor,newMinor,newBuild,currentMajor, currentMinor,currentBuild); - if (newMajor>currentMajor){ - // A Major release - return true; - } else if (newMajor == currentMajor){ - if (newMinor > currentMinor){ - // A minor release - return true; - } else if (newMinor == currentMinor){ - if (newBuild > currentBuild) - // new build (or tiny release) - return true; - else if (newBuild == currentBuild) { - // Check if RC is newer - // If the version isn't newer, it might be a new release candidate - int newRc = 0, oldRc = 0; - - if (newBuildSubMoniker.startsWith("RC", Qt::CaseInsensitive) - && oldBuildSubMoniker.startsWith("RC", Qt::CaseInsensitive)) { - QRegExp releaseNumber("\\d+"); - pos = releaseNumber.indexIn(newBuildSubMoniker); - if (pos > -1) { - QLOG_DEBUG() << "Detected newRc:" << versionEx.capturedTexts(); - newRc = releaseNumber.cap(0).toInt(); - } - - QRegExp releaseNumber2("\\d+"); - pos = releaseNumber2.indexIn(oldBuildSubMoniker); - if (pos > -1) { - QLOG_DEBUG() << "Detected oldRc:" << versionEx.capturedTexts(); - oldRc = releaseNumber.cap(0).toInt(); - } - - if (newRc > oldRc) - return true; - } - - if (newBuildSubMoniker.length() == 0 - && oldBuildSubMoniker.startsWith("RC", Qt::CaseInsensitive)) { - QLOG_DEBUG() << "Stable build newer that last unstable release candidate "; - return true; // this means a new stable build of the unstable rc is available - } - } - } - } - - - - return false; + return VersionComparator::isVersionNewer(newVersion, currentVersion); } void ApmFirmwareConfig::flashCustomFirmware() diff --git a/src/versioncomparator.cc b/src/versioncomparator.cc new file mode 100644 index 0000000000..d3950ddfc6 --- /dev/null +++ b/src/versioncomparator.cc @@ -0,0 +1,78 @@ +#include "versioncomparator.h" + +#include + +#include "QsLog.h" + +bool VersionComparator::isVersionNewer(const QString& newVersion, + const QString& currentVersion) +{ + int newMajor = 0,newMinor = 0,newBuild = 0, newRc = 0; + int currentMajor = 0, currentMinor = 0,currentBuild = 0, oldRc = 0; + + QString newBuildSubMoniker, oldBuildSubMoniker; // holds if the build is a rc or dev build + + splitVersionString(newVersion, newMajor, newMinor, newBuild, + newBuildSubMoniker, newRc); + + splitVersionString(currentVersion, currentMajor, currentMinor, currentBuild, + oldBuildSubMoniker, oldRc); + + QLOG_DEBUG() << "Verison Compare:" < Old Version %d.%d.%d", + newMajor,newMinor,newBuild,currentMajor, currentMinor,currentBuild); + if (newMajor>currentMajor){ + // A Major release + return true; + } else if (newMajor == currentMajor){ + if (newMinor > currentMinor){ + // A minor release + return true; + } else if (newMinor == currentMinor){ + if (newBuild > currentBuild) + // new build (or tiny release) + return true; + else if (newBuild == currentBuild) { + // Check if RC is newer + // If the version isn't newer, it might be a new release candidate + + if (newBuildSubMoniker.startsWith("RC", Qt::CaseInsensitive) + && oldBuildSubMoniker.startsWith("RC", Qt::CaseInsensitive)) { + + if (newRc > oldRc) + return true; + } + + if (newBuildSubMoniker.length() == 0 + && oldBuildSubMoniker.startsWith("RC", Qt::CaseInsensitive)) { + QLOG_DEBUG() << "Stable build newer that last unstable release candidate "; + return true; // this means a new stable build of the unstable rc is available + } + } + } + } + + return false; +} + +void VersionComparator::splitVersionString(const QString& versionString, + int& majorNumber, int& minorNumber, + int& buildNumber, QString& buildSubMoniker, + int& rcVersion) +{ + const QRegExp versionEx("((\\d*)\\.(\\d+)\\.?(\\d+)?)-?(rc(\\d))?"); + + const int pos = versionEx.indexIn(versionString); + if (pos > -1) { + + QLOG_DEBUG() << "Detected version:" << versionEx.capturedTexts()<< " count:" + << versionEx.captureCount(); + + majorNumber = versionEx.cap(2).toInt(); + minorNumber = versionEx.cap(3).toInt(); + buildNumber = versionEx.cap(4).toInt(); + + // fifth subelement is either rcX candidate or developement build + buildSubMoniker = versionEx.cap(5); + rcVersion = versionEx.cap(6).toInt(); + } +} diff --git a/src/versioncomparator.h b/src/versioncomparator.h new file mode 100644 index 0000000000..bbc96a5b06 --- /dev/null +++ b/src/versioncomparator.h @@ -0,0 +1,37 @@ +#ifndef VERSIONCOMPARATOR_H +#define VERSIONCOMPARATOR_H + +#include + +/** + * @brief Compares two version strings. + * + * This class can be used to compare two version strings. + * The strings need to contain a version number in the follwing format: + * MAJOR.MINOR[.BUILD][-RELEASE_CANDIDATE] + * e.g. 2.0.18-rc2 or 2.1 + * + **/ +class VersionComparator +{ +public: + + /** + * @brief compares two version strings + * @param newVersion: this version is checked if it is newer, + * it is probably fetched from the internet + * @param currentVersion: this is the current version installed on the system + * @return returns true if newVersion is newer than currentVersion + */ + static bool isVersionNewer(const QString& newVersion, + const QString& currentVersion); + +private: + + static void splitVersionString(const QString& versionString, + int& majorNumber, int& minorNumber, + int& buildNumber, QString& buildSubMoniker, + int& rcVersion); +}; + +#endif // VERSIONCOMPARATOR_H