diff --git a/lib/QMapControl/QMapControl.pri b/lib/QMapControl/QMapControl.pri index 4fbac6897676768f56c34bae1b2b2a7a2a29db6a..f03639792dfc8fa4de8d83fc54e1a439ccb02d56 100644 --- a/lib/QMapControl/QMapControl.pri +++ b/lib/QMapControl/QMapControl.pri @@ -1,7 +1,5 @@ DEPENDPATH += src INCLUDEPATH += src -MOC_DIR = tmp -OBJECTS_DIR = obj # Input HEADERS += curve.h \ @@ -52,5 +50,3 @@ SOURCES += curve.cpp \ openaerialmapadapter.cpp \ fixedimageoverlay.cpp \ emptymapadapter.cpp - -QT += network diff --git a/mavground.pri b/mavground.pri index 34e261000ed1358fe87ed3a5afd45f6bc727cbba..fd432999b6a3b0adb04586a251f405431f6cf8f0 100644 --- a/mavground.pri +++ b/mavground.pri @@ -28,7 +28,7 @@ QT += network opengl svg xml phonon TEMPLATE = app -TARGET = opengroundcontrol +TARGET = qgroundcontrol BASEDIR = . BUILDDIR = build @@ -38,6 +38,7 @@ LANGUAGE = C++ #CONFIG += static release console CONFIG += static debug_and_release console QMAKE_CFLAGS += -j8 +QMAKE_CXXFLAGS += -j8 OBJECTS_DIR = $$BUILDDIR/obj MOC_DIR = $$BUILDDIR/moc @@ -60,14 +61,11 @@ message(Qt version> $$[QMAKESPEC]) # MAC OS X macx { - message(Building for Mac OS X) + message(Building for Mac OS X 32/64bit) - CONFIG += x86 - - contains ( DEFINES, QT_MAC_USE_COCOA ) { - CONFIG += x86_64 cocoa - CONFIG -= static - } + #CONFIG += x86 + CONFIG += x86_64 cocoa + CONFIG -= static DESTDIR = $$BASEDIR/bin/mac @@ -79,7 +77,11 @@ macx { -framework ApplicationServices \ -lm - DEFINES += _TTY_POSIX_ + # Enable function-profiling with the OS X saturn tool + debug { + #QMAKE_CXXFLAGS += -finstrument-functions + #LIBS += -lSaturn + } #ICON = $$BASEDIR/img/icons/empty.png } @@ -98,8 +100,6 @@ linux-g++ { } INCLUDEPATH += /usr/include/SDL - DEFINES += _TTY_POSIX_ - HARDWARE_PLATFORM = $$system(uname -a) contains( HARDWARE_PLATFORM, x86_64 ) { # 64-bit Linux @@ -142,8 +142,6 @@ win32 { -lmingw32 -lSDLmain -lSDL -mwindows INCLUDEPATH += $$BASEDIR/lib/sdl/include/SDL - - DEFINES += _TTY_WIN_ debug { DESTDIR = $$BASEDIR/bin diff --git a/mavground.pro b/mavground.pro index e474ae2429a00cf309cd853d793a0a494a7e9eec..4dba7bdf915abbcb450b3ffccfdc9ea2ea8f97b9 100644 --- a/mavground.pro +++ b/mavground.pro @@ -11,7 +11,9 @@ include(src/lib/qwt/qwt.pri) #include(src/lib/flite/flite.pri) # Include QMapControl map library -include(lib/QMapControl/QMapControl.pri) +include(src/lib/qmapcontrol/qmapcontrol.pri) +#include(lib/QMapControl/QMapControl.pri) + DEPENDPATH += . \ lib/QMapControl \ lib/QMapControl/src diff --git a/src/GAudioOutput.cc b/src/GAudioOutput.cc index 01723fffbf77eb9ca3fd361ba8bc2ee3c083a16c..2f899085f01a0c7a579e269bd79d9b05a5319111 100644 --- a/src/GAudioOutput.cc +++ b/src/GAudioOutput.cc @@ -30,16 +30,21 @@ This file is part of the PIXHAWK project */ #include +#include #include "GAudioOutput.h" #include "MG.h" +#include + #ifdef Q_OS_MAC #include #endif -#include - -#include +#ifdef Q_OS_WINDOWS +#include +using System; +using System.Speech.Synthesis; +#endif #ifndef Q_OS_MAC extern "C" { @@ -110,7 +115,13 @@ bool GAudioOutput::say(QString text, int severity) bool res = false; if (!emergency) { - // Only give speech output on Linux and MacOS + +#ifdef Q_OS_WINDOWS + SpeechSynthesizer synth = new SpeechSynthesizer(); + synth.SelectVoice("Microsoft Anna"); + synth.SpeakText("Hello, world!"); +#endif + #ifdef Q_OS_LINUX QTemporaryFile file; file.setFileTemplate("XXXXXX.wav"); diff --git a/src/lib/qmapcontrol/qmapcontrol.pri b/src/lib/qmapcontrol/qmapcontrol.pri new file mode 100644 index 0000000000000000000000000000000000000000..f03639792dfc8fa4de8d83fc54e1a439ccb02d56 --- /dev/null +++ b/src/lib/qmapcontrol/qmapcontrol.pri @@ -0,0 +1,52 @@ +DEPENDPATH += src +INCLUDEPATH += src + +# Input +HEADERS += curve.h \ + geometry.h \ + imagemanager.h \ + layer.h \ + layermanager.h \ + linestring.h \ + mapadapter.h \ + mapcontrol.h \ + mapnetwork.h \ + point.h \ + tilemapadapter.h \ + wmsmapadapter.h \ + circlepoint.h \ + imagepoint.h \ + gps_position.h \ + osmmapadapter.h \ + maplayer.h \ + geometrylayer.h \ + yahoomapadapter.h \ + googlemapadapter.h \ + googlesatmapadapter.h \ + openaerialmapadapter.h \ + fixedimageoverlay.h \ + emptymapadapter.h +SOURCES += curve.cpp \ + geometry.cpp \ + imagemanager.cpp \ + layer.cpp \ + layermanager.cpp \ + linestring.cpp \ + mapadapter.cpp \ + mapcontrol.cpp \ + mapnetwork.cpp \ + point.cpp \ + tilemapadapter.cpp \ + wmsmapadapter.cpp \ + circlepoint.cpp \ + imagepoint.cpp \ + gps_position.cpp \ + osmmapadapter.cpp \ + maplayer.cpp \ + geometrylayer.cpp \ + yahoomapadapter.cpp \ + googlemapadapter.cpp \ + googlesatmapadapter.cpp \ + openaerialmapadapter.cpp \ + fixedimageoverlay.cpp \ + emptymapadapter.cpp diff --git a/src/ui/JoystickWidget.cc b/src/ui/JoystickWidget.cc index 582bfbc353bd54e8d0ba30e6cacfbf35b4541cdf..ae4c577739cfea44ee9eb428dbb0ffd9467d724a 100644 --- a/src/ui/JoystickWidget.cc +++ b/src/ui/JoystickWidget.cc @@ -27,7 +27,9 @@ void JoystickWidget::updateJoystick(double roll, double pitch, double yaw, doubl { setX(roll); setY(pitch); + setZ(yaw); setThrottle(thrust); + setHat(xHat, yHat); } void JoystickWidget::changeEvent(QEvent *e) @@ -46,16 +48,29 @@ void JoystickWidget::setThrottle(float thrust) { m_ui->thrust->setValue(thrust*100); } + void JoystickWidget::setX(float x) { m_ui->xSlider->setValue(x*100); m_ui->xValue->display(x*100); } + void JoystickWidget::setY(float y) { m_ui->ySlider->setValue(y*100); m_ui->yValue->display(y*100); } + +void JoystickWidget::setZ(float z) +{ + m_ui->dial->setValue(z*100); +} + +void JoystickWidget::setHat(float x, float y) +{ + qDebug() << __FILE__ << __LINE__ << "HAT X:" << x << "HAT Y:" << y; +} + void JoystickWidget::pressKey(int key) { QString colorstyle; @@ -64,5 +79,5 @@ void JoystickWidget::pressKey(int key) heartbeatColor.red(), heartbeatColor.green(), heartbeatColor.blue()); m_ui->button0Label->setStyleSheet(colorstyle); m_ui->button0Label->setAutoFillBackground(true); - qDebug() << "KEY" << key << " pressed on joystick"; + qDebug() << __FILE__ << __LINE__ << "KEY" << key << " pressed on joystick"; } diff --git a/src/ui/JoystickWidget.h b/src/ui/JoystickWidget.h index 49d67d3a36e8fd7b4c264ef0013776d4b741984a..87bd1e5a9ffed4413be82fd48760a3c5b1815fab 100644 --- a/src/ui/JoystickWidget.h +++ b/src/ui/JoystickWidget.h @@ -23,7 +23,7 @@ This file is part of the PIXHAWK project /** * @file - * @brief Definition of joystick interface + * @brief Definition of joystick widget * @author Lorenz Meier * */ @@ -57,14 +57,23 @@ public: * @param yHat hat vector in left-right direction, -1 left, 0 center, +1 right */ void updateJoystick(double roll, double pitch, double yaw, double thrust, int xHat, int yHat); + /** @brief Throttle lever */ void setThrottle(float thrust); + /** @brief Back/forth movement */ void setX(float x); + /** @brief Left/right movement */ void setY(float y); + /** @brief Wrist rotation */ + void setZ(float z); + /** @brief Hat switch position */ + void setHat(float x, float y); + /** @brief Joystick keys, as labeled on the joystick */ void pressKey(int key); protected: + /** @brief UI change event */ virtual void changeEvent(QEvent *e); - JoystickInput* joystick; + JoystickInput* joystick; ///< Reference to the joystick private: Ui::JoystickWidget *m_ui;