Browse Source

Merged in stable branch

QGC4.4
pixhawk 15 years ago
parent
commit
66b03f3aaa
  1. 3
      .gitignore
  2. 11
      README
  3. BIN
      images/icons/macx.icns
  4. BIN
      images/splash.png
  5. 62
      mavground.pri
  6. 23
      src/AudioOutput.cc
  7. 24
      src/Core.cc
  8. 9
      src/GAudioOutput.cc
  9. 2
      src/lib/qwt/qwt.pri
  10. 13
      src/ui/MainWindow.cc

3
.gitignore vendored

@ -15,6 +15,5 @@ qrc_*.cpp
tmp tmp
debug debug
release release
opengroundcontrol.xcodeproj/** qgroundcontrol.xcodeproj/**
opengroundcontrol
qgroundcontrol qgroundcontrol

11
README

@ -2,4 +2,15 @@ PIXHAWK Open Source Groundstation
http://pixhawk.ethz.ch http://pixhawk.ethz.ch
To build on Mac OS X (10.5 or later):
1) Install http://www.libsdl.org/release/SDL-1.2.14.dmg
2) Install Qt 4.6.2 with Cocoa http://get.qt.nokia.com/qt/source/qt-mac-cocoa-opensource-4.6.2.dmg
3) Run "qmake"
4) Run "xcodebuild -configuration Release" or open "qgroundcontrol.xcodeproj" in Xcode and build.
To build on Linux:
<instructions to be written>
To build on Windows:
<instructions to be written>

BIN
images/icons/macx.icns

Binary file not shown.

BIN
images/splash.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 28 KiB

62
mavground.pri

@ -1,8 +1,8 @@
#------------------------------------------------- #-------------------------------------------------
# #
# MAVGround - Micro Air Vehicle Groundstation # QGroundControl - Micro Air Vehicle Groundstation
# #
# Please see our website at <http://pixhawk.ethz.ch> # Please see our website at <http://qgroundcontrol.org>
# #
# Original Author: # Original Author:
# Lorenz Meier <mavteam@student.ethz.ch> # Lorenz Meier <mavteam@student.ethz.ch>
@ -37,8 +37,6 @@ LANGUAGE = C++
#CONFIG += static debug #CONFIG += static debug
#CONFIG += static release console #CONFIG += static release console
CONFIG += static debug_and_release console CONFIG += static debug_and_release console
QMAKE_CFLAGS += -j8
QMAKE_CXXFLAGS += -j8
OBJECTS_DIR = $$BUILDDIR/obj OBJECTS_DIR = $$BUILDDIR/obj
MOC_DIR = $$BUILDDIR/moc MOC_DIR = $$BUILDDIR/moc
@ -46,29 +44,37 @@ UI_HEADERS_DIR = src/ui/generated
# Add external libraries # Add external libraries
INCLUDEPATH += $$BASEDIR/lib/SDL/include \ INCLUDEPATH += $$BASEDIR/lib/flite/include \
$$BASEDIR/lib/flite/include \
$$BASEDIR/lib/flite/lang $$BASEDIR/lib/flite/lang
#$$BASEDIR/lib/qextserialport/include #$$BASEDIR/lib/qextserialport/include
# $$BASEDIR/lib/openjaus/libjaus/include \ # $$BASEDIR/lib/openjaus/libjaus/include \
# $$BASEDIR/lib/openjaus/libopenJaus/include # $$BASEDIR/lib/openjaus/libopenJaus/include
message(Qt version> $$[QMAKESPEC]) message(Qt version $$[QT_VERSION])
# MAC OS X # MAC OS X
macx { macx {
message(Building for Mac OS X 32/64bit) HARDWARE_PLATFORM = $$system(uname -a)
contains( HARDWARE_PLATFORM, x86_64 ) {
# x64 Mac OS X Snow Leopard 10.6 and later
CONFIG += x86_64 cocoa
CONFIG -= x86 static phonon
message(Building for Mac OS X 64bit/Snow Leopard 10.6 and later)
} else {
# x86 Mac OS X Leopard 10.5 and earlier
CONFIG += x86 cocoa static phonon
message(Building for Mac OS X 32bit/Leopard 10.5 and earlier)
}
CONFIG += x86 cocoa #x86_64 cocoa QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5
CONFIG -= static
DESTDIR = $$BASEDIR/bin/mac DESTDIR = $$BASEDIR/bin/mac
INCLUDEPATH += -framework SDL \
INCLUDEPATH += -framework SDL $$BASEDIR/../mavlink/src
LIBS += -framework IOKit \ LIBS += -framework IOKit \
-framework SDL \ -framework SDL \
@ -82,13 +88,11 @@ macx {
LIBS += -lSaturn LIBS += -lSaturn
} }
#ICON = $$BASEDIR/img/icons/empty.png ICON = $$BASEDIR/images/icons/macx.icns
} }
# GNU/Linux # GNU/Linux
linux-g++ { linux-g++ {
message(Building for GNU/Linux)
debug { debug {
DESTDIR = $$BASEDIR DESTDIR = $$BASEDIR
@ -97,27 +101,21 @@ linux-g++ {
release { release {
DESTDIR = $$BASEDIR DESTDIR = $$BASEDIR
} }
INCLUDEPATH += /usr/include/SDL INCLUDEPATH += /usr/include
HARDWARE_PLATFORM = $$system(uname -a) HARDWARE_PLATFORM = $$system(uname -a)
contains( HARDWARE_PLATFORM, x86_64 ) { contains( HARDWARE_PLATFORM, x86_64 ) {
# 64-bit Linux # 64-bit Linux
LIBS += \ LIBS += \
-L$$BASEDIR/lib/flite/linux64 \ -L$$BASEDIR/lib/flite/linux64
-lm \ message(Building for GNU/Linux 64bit/x64)
-lflite_cmu_us_awb \
-lflite_cmu_us_rms \
-lflite_cmu_us_slt \
-lflite_usenglish \
-lflite_cmulex \
-lflite \
-lSDL \
-lSDLmain
} else { } else {
# 32-bit Linux # 32-bit Linux
LIBS += \ LIBS += \
-L$$BASEDIR/lib/flite/linux32 \ -L$$BASEDIR/lib/flite/linux32
-lm \ message(Building for GNU/Linux 32bit/i386)
}
LIBS += -lm \
-lflite_cmu_us_awb \ -lflite_cmu_us_awb \
-lflite_cmu_us_rms \ -lflite_cmu_us_rms \
-lflite_cmu_us_slt \ -lflite_cmu_us_slt \
@ -126,7 +124,6 @@ linux-g++ {
-lflite \ -lflite \
-lSDL \ -lSDL \
-lSDLmain -lSDLmain
}
} }
@ -140,7 +137,7 @@ win32 {
LIBS += -L$$BASEDIR\lib\sdl\win32 \ LIBS += -L$$BASEDIR\lib\sdl\win32 \
-lmingw32 -lSDLmain -lSDL -mwindows -lmingw32 -lSDLmain -lSDL -mwindows
INCLUDEPATH += $$BASEDIR/lib/sdl/include/SDL INCLUDEPATH += $$BASEDIR/lib/sdl/include
debug { debug {
DESTDIR = $$BASEDIR/bin DESTDIR = $$BASEDIR/bin
@ -152,3 +149,4 @@ win32 {
} }

23
src/AudioOutput.cc

@ -1,11 +1,11 @@
#include "AudioOutput.h" #include "AudioOutput.h"
#ifndef Q_OS_MAC #ifdef Q_OS_MAC
#include <ApplicationServices/ApplicationServices.h>
#else
#include <flite.h> #include <flite.h>
#include <phonon/mediaobject.h> #include <phonon/mediaobject.h>
#include <QTemporaryFile> #include <QTemporaryFile>
#else
#include <ApplicationServices/ApplicationServices.h>
#endif #endif
#include <QDebug> #include <QDebug>
@ -25,9 +25,10 @@ extern "C" {
}; };
#endif #endif
AudioOutput::AudioOutput(QString voice, QObject* parent) : QObject(parent), AudioOutput::AudioOutput(QString voice, QObject* parent)
voice(NULL), : QObject(parent),
voiceIndex(0) voice(NULL),
voiceIndex(0)
{ {
#if !defined(Q_OS_WIN32) && !defined(Q_OS_MAC) #if !defined(Q_OS_WIN32) && !defined(Q_OS_MAC)
flite_init(); flite_init();
@ -72,6 +73,7 @@ bool AudioOutput::say(QString text, int severity)
#if defined(Q_OS_WIN32) #if defined(Q_OS_WIN32)
qDebug() << "Synthesized: " << text << ", NO OUTPUT SUPPORT ON WINDOWS!"; qDebug() << "Synthesized: " << text << ", NO OUTPUT SUPPORT ON WINDOWS!";
#elif defined(Q_OS_MAC) #elif defined(Q_OS_MAC)
// FIXME, copy string, set callback to free the copy
SpeakString((const unsigned char*)text.toAscii().data()); SpeakString((const unsigned char*)text.toAscii().data());
qDebug() << "Synthesized: " << text; qDebug() << "Synthesized: " << text;
#else #else
@ -137,13 +139,11 @@ extern "C" {
#endif /* __cplusplus */ #endif /* __cplusplus */
QStringList AudioOutput::listVoices(void) QStringList AudioOutput::listVoices(void)
{ {
QStringList l;
#if !defined(Q_OS_WIN32) && !defined(Q_OS_MAC)
cst_voice *voice; cst_voice *voice;
const cst_val *v; const cst_val *v;
QStringList l;
#if !defined(Q_OS_WIN32) && !defined(Q_OS_MAC)
/* /*
printf("Voices available: "); printf("Voices available: ");
for (v=flite_voice_list; v; v=val_cdr(v)) for (v=flite_voice_list; v; v=val_cdr(v))
@ -157,8 +157,7 @@ extern "C" {
printf("\n"); printf("\n");
*/ */
#endif #endif
return l; return l;
} }
#ifdef __cplusplus #ifdef __cplusplus
} }

24
src/Core.cc

@ -60,8 +60,15 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv)
{ {
this->setApplicationName("QGroundControl"); this->setApplicationName("QGroundControl");
this->setApplicationVersion("v. 0.0.5"); this->setApplicationVersion("v. 0.0.5");
this->setOrganizationName(QLatin1String("PIXHAWK Project")); this->setOrganizationName(QLatin1String("OpenMAV Association"));
this->setOrganizationDomain("http://pixhawk.ethz.ch"); this->setOrganizationDomain("http://qgroundcontrol.org");
// Show splash screen
QPixmap splashImage(":images/splash.png");
QSplashScreen* splashScreen = new QSplashScreen(splashImage, Qt::WindowStaysOnTopHint);
splashScreen->show();
splashScreen->showMessage(tr("Loading application fonts"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141));
QSettings::setDefaultFormat(QSettings::IniFormat); QSettings::setDefaultFormat(QSettings::IniFormat);
// Exit main application when last window is closed // Exit main application when last window is closed
connect(this, SIGNAL(lastWindowClosed()), this, SLOT(quit())); connect(this, SIGNAL(lastWindowClosed()), this, SLOT(quit()));
@ -70,26 +77,23 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv)
QFontDatabase fontDatabase = QFontDatabase(); QFontDatabase fontDatabase = QFontDatabase();
const QString fontFileName = ":/general/vera.ttf"; ///< Font file is part of the QRC file and compiled into the app const QString fontFileName = ":/general/vera.ttf"; ///< Font file is part of the QRC file and compiled into the app
const QString fontFamilyName = "Bitstream Vera Sans"; const QString fontFamilyName = "Bitstream Vera Sans";
//if(!QFile::exists(fontFileName)) //printf("ERROR! font file: %s DOES NOT EXIST!", fontFileName); if(!QFile::exists(fontFileName)) printf("ERROR! font file: %s DOES NOT EXIST!\n", fontFileName.toStdString().c_str());
fontDatabase.addApplicationFont(fontFileName); fontDatabase.addApplicationFont(fontFileName);
setFont(fontDatabase.font(fontFamilyName, "Roman", 12)); setFont(fontDatabase.font(fontFamilyName, "Roman", 12));
// Show splash screen
QPixmap splashImage(":images/splash.png");
QSplashScreen* splashScreen = new QSplashScreen(splashImage, Qt::WindowStaysOnTopHint);
splashScreen->show();
// Start the comm link manager // Start the comm link manager
splashScreen->showMessage(tr("QGroundControl (c) 2009-") + QString(QDate::currentDate().year()) + "PIXHAWK PROJECT", Qt::AlignLeft | Qt::AlignBottom); splashScreen->showMessage(tr("Starting Communication Links"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141));
startLinkManager(); startLinkManager();
// Start the UAS Manager // Start the UAS Manager
splashScreen->showMessage(tr("Starting UAS Manager"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141));
startUASManager(); startUASManager();
//tarsus = new ViconTarsusProtocol(); //tarsus = new ViconTarsusProtocol();
//tarsus->start(); //tarsus->start();
// Start the user interface // Start the user interface
splashScreen->showMessage(tr("Starting User Interface"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141));
startUI(); startUI();
// Remove splash screen // Remove splash screen
@ -136,7 +140,5 @@ void Core::startUI()
{ {
// Start UI // Start UI
mainWindow = new MainWindow(); mainWindow = new MainWindow();
// Make UI visible
mainWindow->show();
} }

9
src/GAudioOutput.cc

@ -48,7 +48,8 @@ using System.Speech.Synthesis;
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
extern "C" { extern "C" {
#include <cmu_us_awb/voxdefs.h> #include <flite.h>
#include <cmu_us_awb/voxdefs.h>
//#include <cmu_us_slt/voxdefs.h> //#include <cmu_us_slt/voxdefs.h>
//cst_voice *REGISTER_VOX(const char *voxdir); //cst_voice *REGISTER_VOX(const char *voxdir);
//void UNREGISTER_VOX(cst_voice *vox); //void UNREGISTER_VOX(cst_voice *vox);
@ -222,14 +223,14 @@ void GAudioOutput::beep()
void GAudioOutput::selectFemaleVoice() void GAudioOutput::selectFemaleVoice()
{ {
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
this->voice = register_cmu_us_slt(NULL); //this->voice = register_cmu_us_slt(NULL);
#endif #endif
} }
void GAudioOutput::selectMaleVoice() void GAudioOutput::selectMaleVoice()
{ {
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
this->voice = register_cmu_us_rms(NULL); //this->voice = register_cmu_us_rms(NULL);
#endif #endif
} }
@ -237,7 +238,7 @@ void GAudioOutput::selectMaleVoice()
void GAudioOutput::selectNeutralVoice() void GAudioOutput::selectNeutralVoice()
{ {
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
this->voice = register_cmu_us_awb(NULL); //this->voice = register_cmu_us_awb(NULL);
#endif #endif
} }

2
src/lib/qwt/qwt.pri

@ -77,7 +77,7 @@ HEADERS += $$QWTSRCDIR/qwt.h \
$$QWTSRCDIR/qwt_thermo.h \ $$QWTSRCDIR/qwt_thermo.h \
$$QWTSRCDIR/qwt_valuelist.h \ $$QWTSRCDIR/qwt_valuelist.h \
$$QWTSRCDIR/qwt_wheel.h $$QWTSRCDIR/qwt_wheel.h
SOURCES += qwt_abstract_scale.cpp \ SOURCES += $$QWTSRCDIR/qwt_abstract_scale.cpp \
$$QWTSRCDIR/qwt_abstract_scale_draw.cpp \ $$QWTSRCDIR/qwt_abstract_scale_draw.cpp \
$$QWTSRCDIR/qwt_abstract_slider.cpp \ $$QWTSRCDIR/qwt_abstract_slider.cpp \
$$QWTSRCDIR/qwt_analog_clock.cpp \ $$QWTSRCDIR/qwt_analog_clock.cpp \

13
src/ui/MainWindow.cc

@ -60,6 +60,9 @@ This file is part of the PIXHAWK project
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
{ {
this->hide();
this->setVisible(false);
// Quick hack // Quick hack
//comp = new LogCompressor("/home/pixhawk/Desktop/test.txt"); //comp = new LogCompressor("/home/pixhawk/Desktop/test.txt");
@ -142,10 +145,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
// Add status bar // Add status bar
setStatusBar(createStatusBar()); setStatusBar(createStatusBar());
// Load widgets
loadWidgets();
// Adjust the size
adjustSize();
// Create actions // Create actions
connectActions(); connectActions();
@ -173,6 +172,12 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
//CommConfigurationWindow* simulationWidget = new CommConfigurationWindow(simulationLink, mavlink, this); //CommConfigurationWindow* simulationWidget = new CommConfigurationWindow(simulationLink, mavlink, this);
//ui.menuNetwork->addAction(commWidget->getAction()); //ui.menuNetwork->addAction(commWidget->getAction());
simulationLink->connect(); simulationLink->connect();
// Load widgets and show application window
loadWidgets();
// Adjust the size
adjustSize();
} }
MainWindow::~MainWindow() MainWindow::~MainWindow()

Loading…
Cancel
Save