From 33242c70116353d1feb99f31be07f662a240776b Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Tue, 24 Dec 2013 17:24:16 -0800 Subject: [PATCH] Fix broken Windows build - NAN not available in windows headers, use cross platform friendly version - VS compiler does not allow initializing non-integral types in header files - ActiveQt libs are already installed by Win Qt4.8.5, no need to build. Plus this part of the makefile just loops without nmake.exe installed which is not part of a standard windows box --- qgroundcontrol.pro | 9 --------- src/uas/UAS.cc | 4 ++-- src/ui/DebugConsole.cc | 2 ++ src/ui/DebugConsole.h | 2 +- src/ui/PrimaryFlightDisplay.cc | 18 +++++++++--------- 5 files changed, 14 insertions(+), 21 deletions(-) diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index a7f731be5..e36ae2505 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -80,15 +80,6 @@ win32 { 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 ) - system( cd $$(QTDIR)\\src\\activeqt && nmake ) - } } macx { diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index 69ee6646c..f9d25f0e8 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -115,8 +115,8 @@ UAS::UAS(MAVLinkProtocol* protocol, int id) : UASInterface(), altitudeAMSL(0.0), altitudeRelative(0.0), - airSpeed(NAN), - groundSpeed(NAN), + airSpeed(std::numeric_limits::quiet_NaN()), + groundSpeed(std::numeric_limits::quiet_NaN()), speedX(0.0), speedY(0.0), diff --git a/src/ui/DebugConsole.cc b/src/ui/DebugConsole.cc index b687e998f..4fd14e42f 100644 --- a/src/ui/DebugConsole.cc +++ b/src/ui/DebugConsole.cc @@ -40,6 +40,8 @@ This file is part of the QGROUNDCONTROL project #include "protocol.h" #include "QGC.h" +const float DebugConsole::inDataRateThreshold = 0.4f; + DebugConsole::DebugConsole(QWidget *parent) : QWidget(parent), currLink(NULL), diff --git a/src/ui/DebugConsole.h b/src/ui/DebugConsole.h index 4d9dd648a..725886d07 100644 --- a/src/ui/DebugConsole.h +++ b/src/ui/DebugConsole.h @@ -139,7 +139,7 @@ protected: QTimer snapShotTimer; ///< Timer for measuring traffic snapshots static const int snapShotInterval = 500; ///< Set the time between UI updates for the data rate (ms) float lowpassInDataRate; ///< Lowpass filtered data rate (kilobytes/s) - static const float inDataRateThreshold = 0.4; ///< Threshold where to enable auto-hold (kilobytes/s) + static const float inDataRateThreshold; ///< Threshold where to enable auto-hold (kilobytes/s) float lowpassOutDataRate; ///< Low-pass filtered outgoing data rate (kilobytes/s) QStringList commandHistory; QString currCommand; diff --git a/src/ui/PrimaryFlightDisplay.cc b/src/ui/PrimaryFlightDisplay.cc index b963bde69..b50503fcd 100644 --- a/src/ui/PrimaryFlightDisplay.cc +++ b/src/ui/PrimaryFlightDisplay.cc @@ -125,15 +125,15 @@ PrimaryFlightDisplay::PrimaryFlightDisplay(int width, int height, QWidget *paren pitch(0), heading(0), - altitudeAMSL(NAN), - altitudeRelative(NAN), + altitudeAMSL(std::numeric_limits::quiet_NaN()), + altitudeRelative(std::numeric_limits::quiet_NaN()), - groundSpeed(NAN), - airSpeed(NAN), - climbRate(NAN), + groundSpeed(std::numeric_limits::quiet_NaN()), + airSpeed(std::numeric_limits::quiet_NaN()), + climbRate(std::numeric_limits::quiet_NaN()), navigationCrosstrackError(0), - navigationTargetBearing(NAN), + navigationTargetBearing(std::numeric_limits::quiet_NaN()), layout(COMPASS_INTEGRATED), style(OVERLAY_HSI), @@ -291,19 +291,19 @@ void PrimaryFlightDisplay::updateAttitude(UASInterface* uas, double roll, double Q_UNUSED(timestamp); // Called from UAS.cc l. 616 if (isinf(roll)) { - this->roll = NAN; + this->roll = std::numeric_limits::quiet_NaN(); } else { this->roll = roll * (180.0 / M_PI); } if (isinf(pitch)) { - this->pitch = NAN; + this->pitch = std::numeric_limits::quiet_NaN(); } else { this->pitch = pitch * (180.0 / M_PI); } if (isinf(yaw)) { - this->heading = NAN; + this->heading = std::numeric_limits::quiet_NaN(); } else { yaw = yaw * (180.0 / M_PI); if (yaw<0) yaw+=360; -- 2.22.0