Commit 282aa15c authored by pixhawk's avatar pixhawk

Fixed MSVC2008 compilation issues

parent 6d91ce03
......@@ -41,7 +41,8 @@ This file is part of the QGROUNDCONTROL project
#endif
// Speech synthesis is only supported with MSVC compiler
#if _MSC_VER
#if _MSC_VER2
// Documentation: http://msdn.microsoft.com/en-us/library/ee125082%28v=VS.85%29.aspx
#include <sapi.h>
using System;
using System.Speech.Synthesis;
......@@ -111,7 +112,7 @@ bool GAudioOutput::say(QString text, int severity)
{
// Speech synthesis is only supported with MSVC compiler
#ifdef _MSC_VER
#ifdef _MSC_VER2
SpeechSynthesizer synth = new SpeechSynthesizer();
synth.SelectVoice("Microsoft Anna");
synth.SpeakText(text.toStdString().c_str());
......
......@@ -264,7 +264,7 @@ namespace MG
* @param screenDiameter The screen diameter in mm, e.g. 13.3" = 338 mm.
*/
static void setPixelSize(int horizontalResolution, int verticalResolution, double screenDiameter) {
pixelSize = screenDiameter / sqrt((horizontalResolution^(2)) + (verticalResolution^(2)));
pixelSize = screenDiameter / sqrt(static_cast<float>(horizontalResolution*horizontalResolution + verticalResolution*verticalResolution));
}
private:
......
......@@ -380,9 +380,9 @@ void MAVLinkSimulationLink::mainloop()
// Move X Position
x = x*0.93f + 0.07f*(x+sin(QGC::groundTimeUsecs()) * 0.08f);
y = y*0.93f + 0.07f*(y+sin(QGC::groundTimeUsecs()) * 0.5f);
z = z*0.93f + 0.07f*(z+sin(QGC::groundTimeUsecs()*100000) * 0.1f);
x = x*0.93f + 0.07f*(x+sin(static_cast<float>(QGC::groundTimeUsecs()) * 0.08f));
y = y*0.93f + 0.07f*(y+sin(static_cast<float>(QGC::groundTimeUsecs()) * 0.5f));
z = z*0.93f + 0.07f*(z+sin(static_cast<float>(QGC::groundTimeUsecs()*0.001f)) * 0.1f);
x = 5247273.0f;
y = 465955.0f;
// x = (x > 5.0f) ? 5.0f : x;
......
......@@ -729,7 +729,7 @@ quint64 UAS::getUnixTime(quint64 time)
// 60 seconds
// 1000 milliseconds
// 1000 microseconds
else if (time < 1261440000000000LLU)
else if (time < 1261440000000000)
{
if (onboardTimeOffset == 0)
{
......
......@@ -38,7 +38,9 @@ This file is part of the PIXHAWK project
#include "HDDisplay.h"
#include "ui_HDDisplay.h"
#include "MG.h"
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#include <QDebug>
HDDisplay::HDDisplay(QStringList* plotList, QWidget *parent) :
......
......@@ -478,7 +478,7 @@ void HSIDisplay::updateSpeed(UASInterface* uas, double vx, double vy, double vz,
this->vx = vx;
this->vy = vy;
this->vz = vz;
this->speed = sqrt(pow(vx, 2.0f) + pow(vy, 2.0f) + pow(vz, 2.0f));
this->speed = sqrt(pow(vx, 2.0) + pow(vy, 2.0) + pow(vz, 2.0));
}
void HSIDisplay::setBodySetpointCoordinateXY(double x, double y)
......
......@@ -31,6 +31,9 @@ This file is part of the QGROUNDCONTROL project
#include <QDebug>
#include <cmath>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#include <limits>
#include "UASManager.h"
......
......@@ -35,6 +35,9 @@ This file is part of the PIXHAWK project
#include <QDebug>
#include <cmath> //M_PI
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#include "WaypointView.h"
#include "ui_WaypointView.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment