diff --git a/.gitignore b/.gitignore index 26ae60a..7c993aa 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,5 @@ qrc_*.cpp tmp debug release -opengroundcontrol.xcodeproj/** -opengroundcontrol +qgroundcontrol.xcodeproj/** qgroundcontrol diff --git a/README b/README index 7ca3d3c..627c241 100644 --- a/README +++ b/README @@ -2,4 +2,15 @@ PIXHAWK Open Source Groundstation 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: + + +To build on Windows: + diff --git a/images/icons/macx.icns b/images/icons/macx.icns new file mode 100644 index 0000000..6111a01 Binary files /dev/null and b/images/icons/macx.icns differ diff --git a/images/splash.png b/images/splash.png index 5bd5cf0..8b20af7 100644 Binary files a/images/splash.png and b/images/splash.png differ diff --git a/mavground.pri b/mavground.pri index f804ef7..3ca7e54 100644 --- a/mavground.pri +++ b/mavground.pri @@ -1,8 +1,8 @@ #------------------------------------------------- # -# MAVGround - Micro Air Vehicle Groundstation +# QGroundControl - Micro Air Vehicle Groundstation # -# Please see our website at +# Please see our website at # # Original Author: # Lorenz Meier @@ -37,8 +37,6 @@ LANGUAGE = C++ #CONFIG += static debug #CONFIG += static release console CONFIG += static debug_and_release console -QMAKE_CFLAGS += -j8 -QMAKE_CXXFLAGS += -j8 OBJECTS_DIR = $$BUILDDIR/obj MOC_DIR = $$BUILDDIR/moc @@ -46,29 +44,37 @@ UI_HEADERS_DIR = src/ui/generated # Add external libraries -INCLUDEPATH += $$BASEDIR/lib/SDL/include \ - $$BASEDIR/lib/flite/include \ +INCLUDEPATH += $$BASEDIR/lib/flite/include \ $$BASEDIR/lib/flite/lang #$$BASEDIR/lib/qextserialport/include # $$BASEDIR/lib/openjaus/libjaus/include \ # $$BASEDIR/lib/openjaus/libopenJaus/include -message(Qt version> $$[QMAKESPEC]) +message(Qt version $$[QT_VERSION]) # MAC OS X 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 - CONFIG -= static + QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5 DESTDIR = $$BASEDIR/bin/mac - - INCLUDEPATH += -framework SDL + INCLUDEPATH += -framework SDL \ + $$BASEDIR/../mavlink/src LIBS += -framework IOKit \ -framework SDL \ @@ -82,13 +88,11 @@ macx { LIBS += -lSaturn } - #ICON = $$BASEDIR/img/icons/empty.png + ICON = $$BASEDIR/images/icons/macx.icns } # GNU/Linux linux-g++ { - - message(Building for GNU/Linux) debug { DESTDIR = $$BASEDIR @@ -97,27 +101,21 @@ linux-g++ { release { DESTDIR = $$BASEDIR } - INCLUDEPATH += /usr/include/SDL + INCLUDEPATH += /usr/include HARDWARE_PLATFORM = $$system(uname -a) contains( HARDWARE_PLATFORM, x86_64 ) { # 64-bit Linux - LIBS += \ - -L$$BASEDIR/lib/flite/linux64 \ - -lm \ - -lflite_cmu_us_awb \ - -lflite_cmu_us_rms \ - -lflite_cmu_us_slt \ - -lflite_usenglish \ - -lflite_cmulex \ - -lflite \ - -lSDL \ - -lSDLmain + LIBS += \ + -L$$BASEDIR/lib/flite/linux64 + message(Building for GNU/Linux 64bit/x64) } else { # 32-bit Linux - LIBS += \ - -L$$BASEDIR/lib/flite/linux32 \ - -lm \ + LIBS += \ + -L$$BASEDIR/lib/flite/linux32 + message(Building for GNU/Linux 32bit/i386) + } + LIBS += -lm \ -lflite_cmu_us_awb \ -lflite_cmu_us_rms \ -lflite_cmu_us_slt \ @@ -126,7 +124,6 @@ linux-g++ { -lflite \ -lSDL \ -lSDLmain - } } @@ -140,7 +137,7 @@ win32 { LIBS += -L$$BASEDIR\lib\sdl\win32 \ -lmingw32 -lSDLmain -lSDL -mwindows - INCLUDEPATH += $$BASEDIR/lib/sdl/include/SDL + INCLUDEPATH += $$BASEDIR/lib/sdl/include debug { DESTDIR = $$BASEDIR/bin @@ -152,3 +149,4 @@ win32 { } + diff --git a/src/AudioOutput.cc b/src/AudioOutput.cc index 7f0630b..8d30cea 100644 --- a/src/AudioOutput.cc +++ b/src/AudioOutput.cc @@ -1,11 +1,11 @@ #include "AudioOutput.h" -#ifndef Q_OS_MAC +#ifdef Q_OS_MAC + #include +#else #include #include #include -#else - #include #endif #include @@ -25,9 +25,10 @@ extern "C" { }; #endif -AudioOutput::AudioOutput(QString voice, QObject* parent) : QObject(parent), -voice(NULL), -voiceIndex(0) +AudioOutput::AudioOutput(QString voice, QObject* parent) + : QObject(parent), + voice(NULL), + voiceIndex(0) { #if !defined(Q_OS_WIN32) && !defined(Q_OS_MAC) flite_init(); @@ -72,6 +73,7 @@ bool AudioOutput::say(QString text, int severity) #if defined(Q_OS_WIN32) qDebug() << "Synthesized: " << text << ", NO OUTPUT SUPPORT ON WINDOWS!"; #elif defined(Q_OS_MAC) + // FIXME, copy string, set callback to free the copy SpeakString((const unsigned char*)text.toAscii().data()); qDebug() << "Synthesized: " << text; #else @@ -137,13 +139,11 @@ extern "C" { #endif /* __cplusplus */ QStringList AudioOutput::listVoices(void) { - - + QStringList l; +#if !defined(Q_OS_WIN32) && !defined(Q_OS_MAC) cst_voice *voice; const cst_val *v; - QStringList l; -#if !defined(Q_OS_WIN32) && !defined(Q_OS_MAC) /* printf("Voices available: "); for (v=flite_voice_list; v; v=val_cdr(v)) @@ -157,8 +157,7 @@ extern "C" { printf("\n"); */ #endif - return l; - + return l; } #ifdef __cplusplus } diff --git a/src/Core.cc b/src/Core.cc index 27f69a9..7ffa5c8 100644 --- a/src/Core.cc +++ b/src/Core.cc @@ -60,8 +60,15 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv) { this->setApplicationName("QGroundControl"); this->setApplicationVersion("v. 0.0.5"); - this->setOrganizationName(QLatin1String("PIXHAWK Project")); - this->setOrganizationDomain("http://pixhawk.ethz.ch"); + this->setOrganizationName(QLatin1String("OpenMAV Association")); + 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); // Exit main application when last window is closed connect(this, SIGNAL(lastWindowClosed()), this, SLOT(quit())); @@ -70,26 +77,23 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv) QFontDatabase fontDatabase = QFontDatabase(); 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"; - //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); 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 - 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(); // Start the UAS Manager + splashScreen->showMessage(tr("Starting UAS Manager"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141)); startUASManager(); //tarsus = new ViconTarsusProtocol(); //tarsus->start(); // Start the user interface + splashScreen->showMessage(tr("Starting User Interface"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141)); startUI(); // Remove splash screen @@ -136,7 +140,5 @@ void Core::startUI() { // Start UI mainWindow = new MainWindow(); - // Make UI visible - mainWindow->show(); } diff --git a/src/GAudioOutput.cc b/src/GAudioOutput.cc index 5dc61e7..a2059e8 100644 --- a/src/GAudioOutput.cc +++ b/src/GAudioOutput.cc @@ -48,7 +48,8 @@ using System.Speech.Synthesis; #ifdef Q_OS_LINUX extern "C" { -#include + #include + #include //#include //cst_voice *REGISTER_VOX(const char *voxdir); //void UNREGISTER_VOX(cst_voice *vox); @@ -222,14 +223,14 @@ void GAudioOutput::beep() void GAudioOutput::selectFemaleVoice() { #ifdef Q_OS_LINUX - this->voice = register_cmu_us_slt(NULL); + //this->voice = register_cmu_us_slt(NULL); #endif } void GAudioOutput::selectMaleVoice() { #ifdef Q_OS_LINUX - this->voice = register_cmu_us_rms(NULL); + //this->voice = register_cmu_us_rms(NULL); #endif } @@ -237,7 +238,7 @@ void GAudioOutput::selectMaleVoice() void GAudioOutput::selectNeutralVoice() { #ifdef Q_OS_LINUX - this->voice = register_cmu_us_awb(NULL); + //this->voice = register_cmu_us_awb(NULL); #endif } diff --git a/src/lib/qwt/qwt.pri b/src/lib/qwt/qwt.pri index 84dc432..34739fb 100644 --- a/src/lib/qwt/qwt.pri +++ b/src/lib/qwt/qwt.pri @@ -77,7 +77,7 @@ HEADERS += $$QWTSRCDIR/qwt.h \ $$QWTSRCDIR/qwt_thermo.h \ $$QWTSRCDIR/qwt_valuelist.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_slider.cpp \ $$QWTSRCDIR/qwt_analog_clock.cpp \ diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index 4da7172..8c7e67e 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -60,6 +60,9 @@ This file is part of the PIXHAWK project MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { + this->hide(); + this->setVisible(false); + // Quick hack //comp = new LogCompressor("/home/pixhawk/Desktop/test.txt"); @@ -142,10 +145,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) // Add status bar setStatusBar(createStatusBar()); - // Load widgets - loadWidgets(); - // Adjust the size - adjustSize(); // Create actions connectActions(); @@ -173,6 +172,12 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) //CommConfigurationWindow* simulationWidget = new CommConfigurationWindow(simulationLink, mavlink, this); //ui.menuNetwork->addAction(commWidget->getAction()); simulationLink->connect(); + + // Load widgets and show application window + loadWidgets(); + + // Adjust the size + adjustSize(); } MainWindow::~MainWindow()