Commit 1e004938 authored by pixhawk's avatar pixhawk

Ardupilot support, builds now cleanly on Windows. Fixed a bug where the...

Ardupilot support, builds now cleanly on Windows. Fixed a bug where the application could crash if no system was connected.
parent 2406510c
......@@ -72,7 +72,7 @@ macx {
ICON = $$BASEDIR/images/icons/macx.icns
# Copy audio files if needed
QMAKE_PRE_LINK += cp -r $$BASEDIR/audio $$DESTDIR/qgroundcontrol.app/Contents/MacOs/.
QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/qgroundcontrol.app/Contents/MacOs/.
exists(/opt/local/lib/osg):exists("/opt/local/lib/osgEarth") {
message("Building support for OSGEARTH")
......@@ -94,12 +94,15 @@ linux-g++ {
CONFIG += debug
debug {
DESTDIR = $$BASEDIR
DESTDIR = $$BUILDDIR/debug
}
release {
DESTDIR = $$BASEDIR
DESTDIR = $$BUILDDIR/release
}
QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
INCLUDEPATH += /usr/include \
/usr/include/qt4/phonon
# $$BASEDIR/lib/flite/include \
......@@ -149,12 +152,14 @@ linux-g++-64 {
CONFIG += debug
debug {
DESTDIR = $$BASEDIR
DESTDIR = $$BUILDDIR/debug
}
release {
DESTDIR = $$BASEDIR
DESTDIR = $$BUILDDIR/release
}
QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
INCLUDEPATH += /usr/include \
/usr/include/qt4/phonon
# $$BASEDIR/lib/flite/include \
......@@ -196,40 +201,41 @@ DEFINES += QGC_OSG_ENABLED
# Windows (32bit)
win32 {
win32-g++ {
message(Building for Windows Platform (32bit))
# Special settings for debug
#CONFIG += CONSOLE
INCLUDEPATH += $$BASEDIR\lib\sdl\include \
$$BASEDIR\lib\opal\include #\ #\
INCLUDEPATH += $$BASEDIR/lib/sdl/include \
$$BASEDIR/lib/opal/include #\ #\
#"C:\Program Files\Microsoft SDKs\Windows\v7.0\Include"
LIBS += -L$$BASEDIR\lib\sdl\win32 \
LIBS += -L$$BASEDIR/lib/sdl/win32 \
-lmingw32 -lSDLmain -lSDL -mwindows
debug {
DESTDIR = $$BASEDIR/bin
DESTDIR = $$BUILDDIR/debug
}
release {
DESTDIR = $$BASEDIR/bin
DESTDIR = $$BUILDDIR/release
}
RC_FILE = $$BASEDIR/qgroundcontrol.rc
# Copy dependencies
QMAKE_PRE_LINK += copy /Y $$BASEDIR/lib/sdl/SDL.dll $$BUILDDIR/debug/ & copy /Y $$BASEDIR/lib/sdl/SDL.dll $$BUILDDIR/release/
QMAKE_PRE_LINK += copy /Y $$BASEDIR/lib/sdl/SDL.dll $$BUILDDIR/debug/ & copy /Y $$BASEDIR/lib/sdl/SDL.dll $$BUILDDIR/release/
QMAKE_PRE_LINK += copy /Y audio $$BUILDDIR\debug\
QMAKE_PRE_LINK += cp -f $$BASEDIR/lib/sdl/win32/SDL.dll $$BUILDDIR/debug/. &&
QMAKE_PRE_LINK += cp -f $$BASEDIR/lib/sdl/win32/SDL.dll $$BUILDDIR/release/. &&
QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$BUILDDIR/debug/. &&
QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$BUILDDIR/release/.
}
# Windows (64bit)
win64 {
win64-g++ {
message(Building for Windows Platform (64bit))
......@@ -256,8 +262,9 @@ win64 {
RC_FILE = $$BASEDIR/qgroundcontrol.rc
# Copy dependencies
QMAKE_PRE_LINK += copy /Y $$BASEDIR/lib/sdl/SDL.dll $$BUILDDIR/debug/ & copy /Y $$BASEDIR/lib/sdl/SDL.dll $$BUILDDIR/release/
QMAKE_PRE_LINK += copy /Y $$BASEDIR/lib/sdl/SDL.dll $$BUILDDIR/debug/ & copy /Y $$BASEDIR/lib/sdl/SDL.dll $$BUILDDIR/release/
QMAKE_PRE_LINK += copy /Y audio $$BUILDDIR\debug\
QMAKE_PRE_LINK += cp -f $$BASEDIR/lib/sdl/win32/SDL.dll $$BUILDDIR/debug/. &&
QMAKE_PRE_LINK += cp -f $$BASEDIR/lib/sdl/win32/SDL.dll $$BUILDDIR/release/. &&
QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$BUILDDIR/debug/. &&
QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$BUILDDIR/release/.
}
......@@ -237,8 +237,12 @@ void UASControlWidget::transmitMode()
{
if (uasMode != 0)
{
UASManager::instance()->getUASForId(this->uas)->setMode(uasMode);
ui.lastActionLabel->setText(QString("Set new mode for system %1").arg(UASManager::instance()->getUASForId(uas)->getUASName()));
UASInterface* mav = UASManager::instance()->getUASForId(this->uas);
if (mav)
{
mav->setMode(uasMode);
ui.lastActionLabel->setText(QString("Set new mode for system %1").arg(mav->getUASName()));
}
}
}
......
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