Commit fe015311 authored by dogmaphobic's avatar dogmaphobic

First stab at iOS builds

parent 87b5ffaa
......@@ -20,6 +20,7 @@
include(QGCCommon.pri)
TARGET = qgroundcontrol
TEMPLATE = app
# Load additional config flags from user_config.pri
exists(user_config.pri):infile(user_config.pri, CONFIG) {
......@@ -31,19 +32,15 @@ LinuxBuild {
CONFIG += link_pkgconfig
}
message(BASEDIR $$BASEDIR DESTDIR $$DESTDIR TARGET $$TARGET)
# QGC QtLocation plugin
LIBS += -L$${LOCATION_PLUGIN_DESTDIR}
LIBS += -l$${LOCATION_PLUGIN_NAME}
LinuxBuild|MacBuild|AndroidBuild {
PRE_TARGETDEPS += $${LOCATION_PLUGIN_DESTDIR}/lib$${LOCATION_PLUGIN_NAME}.a
}
WindowsBuild {
PRE_TARGETDEPS += $${LOCATION_PLUGIN_DESTDIR}/$${LOCATION_PLUGIN_NAME}.lib
} else {
PRE_TARGETDEPS += $${LOCATION_PLUGIN_DESTDIR}/lib$${LOCATION_PLUGIN_NAME}.a
}
# Qt configuration
......@@ -51,13 +48,13 @@ WindowsBuild {
CONFIG += qt \
thread
QT += network \
QT += \
network \
concurrent \
gui \
location \
opengl \
positioning \
printsupport \
qml \
quick \
quickwidgets \
......@@ -66,8 +63,10 @@ QT += network \
widgets \
xml \
!AndroidBuild {
QT += serialport
!MobileBuild {
QT += \
printsupport \
serialport \
}
contains(DEFINES, QGC_NOTIFY_TUNES_ENABLED) {
......@@ -83,8 +82,14 @@ QT += testlib
MacBuild {
QMAKE_INFO_PLIST = Custom-Info.plist
ICON = $$BASEDIR/resources/icons/macx.icns
QT += quickwidgets
ICON = $${BASEDIR}/resources/icons/macx.icns
OTHER_FILES += Custom-Info.plist
}
iOSBuild {
QMAKE_INFO_PLIST = $${BASEDIR}/ios/iOS-Info.plist
ICON = $${BASEDIR}/resources/icons/macx.icns
OTHER_FILES += $${BASEDIR}/iOS-Info.plist
}
LinuxBuild {
......@@ -92,7 +97,7 @@ LinuxBuild {
}
WindowsBuild {
RC_FILE = $$BASEDIR/qgroundcontrol.rc
RC_FILE = $${BASEDIR}/qgroundcontrol.rc
}
#
......@@ -100,10 +105,12 @@ WindowsBuild {
#
DebugBuild {
!iOSBuild {
CONFIG += console
}
}
!AndroidBuild {
!MobileBuild {
# qextserialport should not be used by general QGroundControl code. Use QSerialPort instead. This is only
# here to support special case Firmware Upgrade code.
include(libs/qextserialport/src/qextserialport.pri)
......@@ -186,10 +193,6 @@ FORMS += \
src/ui/mission/QGCMissionOther.ui \
src/ui/QGCCommConfiguration.ui \
src/ui/QGCDataPlot2D.ui \
src/ui/QGCHilConfiguration.ui \
src/ui/QGCHilFlightGearConfiguration.ui \
src/ui/QGCHilJSBSimConfiguration.ui \
src/ui/QGCHilXPlaneConfiguration.ui \
src/ui/QGCLinkConfiguration.ui \
src/ui/QGCMapRCToParamDialog.ui \
src/ui/QGCMAVLinkInspector.ui \
......@@ -201,7 +204,6 @@ FORMS += \
src/ui/QGCUASFileViewMulti.ui \
src/ui/QGCUDPLinkConfiguration.ui \
src/ui/QGCWaypointListMulti.ui \
src/ui/SerialSettings.ui \
src/ui/SettingsDialog.ui \
src/ui/uas/QGCUnconnectedInfoWidget.ui \
src/ui/uas/UASMessageView.ui \
......@@ -216,11 +218,20 @@ FORMS += \
src/ui/WaypointList.ui \
src/ui/WaypointViewOnlyView.ui \
!AndroidBuild {
!iOSBuild {
FORMS += \
src/ui/SerialSettings.ui \
}
!MobileBuild {
FORMS += \
src/ui/JoystickButton.ui \
src/ui/JoystickAxis.ui \
src/ui/JoystickWidget.ui
src/ui/JoystickWidget.ui \
src/ui/QGCHilConfiguration.ui \
src/ui/QGCHilFlightGearConfiguration.ui \
src/ui/QGCHilJSBSimConfiguration.ui \
src/ui/QGCHilXPlaneConfiguration.ui \
}
HEADERS += \
......@@ -234,12 +245,7 @@ HEADERS += \
src/comm/MockLinkFileServer.h \
src/comm/MockLinkMissionItemHandler.h \
src/comm/ProtocolInterface.h \
src/comm/QGCFlightGearLink.h \
src/comm/QGCHilLink.h \
src/comm/QGCJSBSimLink.h \
src/comm/QGCMAVLink.h \
src/comm/QGCXPlaneLink.h \
src/comm/SerialLink.h \
src/comm/TCPLink.h \
src/comm/UDPLink.h \
src/GAudioOutput.h \
......@@ -306,10 +312,6 @@ HEADERS += \
src/ui/mission/QGCMissionOther.h \
src/ui/QGCCommConfiguration.h \
src/ui/QGCDataPlot2D.h \
src/ui/QGCHilConfiguration.h \
src/ui/QGCHilFlightGearConfiguration.h \
src/ui/QGCHilJSBSimConfiguration.h \
src/ui/QGCHilXPlaneConfiguration.h \
src/ui/QGCLinkConfiguration.h \
src/ui/QGCMainWindowAPConfigurator.h \
src/ui/QGCMapRCToParamDialog.h \
......@@ -323,7 +325,6 @@ HEADERS += \
src/ui/QGCUASFileViewMulti.h \
src/ui/QGCUDPLinkConfiguration.h \
src/ui/QGCWaypointListMulti.h \
src/ui/SerialConfigurationWindow.h \
src/ui/SettingsDialog.h \
src/ui/toolbar/MainToolBar.h \
src/ui/uas/QGCUnconnectedInfoWidget.h \
......@@ -347,13 +348,27 @@ HEADERS += \
src/ViewWidgets/ViewWidgetController.h \
src/Waypoint.h \
!AndroidBuild {
!iOSBuild {
HEADERS += \
src/comm/SerialLink.h \
src/ui/SerialConfigurationWindow.h \
}
!MobileBuild {
HEADERS += \
src/comm/QGCFlightGearLink.h \
src/comm/QGCHilLink.h \
src/comm/QGCJSBSimLink.h \
src/comm/QGCXPlaneLink.h \
src/input/JoystickInput.h \
src/ui/CameraView.h \
src/ui/JoystickAxis.h \
src/ui/JoystickButton.h \
src/ui/JoystickWidget.h \
src/ui/CameraView.h \
src/ui/QGCHilConfiguration.h \
src/ui/QGCHilFlightGearConfiguration.h \
src/ui/QGCHilJSBSimConfiguration.h \
src/ui/QGCHilXPlaneConfiguration.h \
}
SOURCES += \
......@@ -365,10 +380,6 @@ SOURCES += \
src/comm/MockLink.cc \
src/comm/MockLinkFileServer.cc \
src/comm/MockLinkMissionItemHandler.cc \
src/comm/QGCFlightGearLink.cc \
src/comm/QGCJSBSimLink.cc \
src/comm/QGCXPlaneLink.cc \
src/comm/SerialLink.cc \
src/comm/TCPLink.cc \
src/comm/UDPLink.cc \
src/GAudioOutput.cc \
......@@ -430,10 +441,6 @@ SOURCES += \
src/ui/mission/QGCMissionOther.cc \
src/ui/QGCCommConfiguration.cc \
src/ui/QGCDataPlot2D.cc \
src/ui/QGCHilConfiguration.cc \
src/ui/QGCHilFlightGearConfiguration.cc \
src/ui/QGCHilJSBSimConfiguration.cc \
src/ui/QGCHilXPlaneConfiguration.cc \
src/ui/QGCLinkConfiguration.cc \
src/ui/QGCMainWindowAPConfigurator.cc \
src/ui/QGCMapRCToParamDialog.cpp \
......@@ -447,7 +454,6 @@ SOURCES += \
src/ui/QGCUASFileViewMulti.cc \
src/ui/QGCUDPLinkConfiguration.cc \
src/ui/QGCWaypointListMulti.cc \
src/ui/SerialConfigurationWindow.cc \
src/ui/SettingsDialog.cc \
src/ui/toolbar/MainToolBar.cc \
src/ui/uas/QGCUnconnectedInfoWidget.cc \
......@@ -471,13 +477,26 @@ SOURCES += \
src/ViewWidgets/ViewWidgetController.cc \
src/Waypoint.cc \
!AndroidBuild {
!iOSBuild {
SOURCES += \
src/comm/SerialLink.cc \
src/ui/SerialConfigurationWindow.cc \
}
!MobileBuild {
SOURCES += \
src/comm/QGCFlightGearLink.cc \
src/comm/QGCJSBSimLink.cc \
src/comm/QGCXPlaneLink.cc \
src/input/JoystickInput.cc \
src/ui/CameraView.cc \
src/ui/JoystickAxis.cc \
src/ui/JoystickButton.cc \
src/ui/JoystickWidget.cc \
src/ui/CameraView.cc
src/ui/QGCHilConfiguration.cc \
src/ui/QGCHilFlightGearConfiguration.cc \
src/ui/QGCHilJSBSimConfiguration.cc \
src/ui/QGCHilXPlaneConfiguration.cc \
}
#
......@@ -494,7 +513,7 @@ DebugBuild|WindowsDebugAndRelease {
HEADERS += src/QmlControls/QmlTestWidget.h
SOURCES += src/QmlControls/QmlTestWidget.cc
!AndroidBuild {
!MobileBuild {
INCLUDEPATH += \
src/qgcunittest
......@@ -536,7 +555,7 @@ SOURCES += \
src/qgcunittest/PX4RCCalibrationTest.cc \
} # DebugBuild|WindowsDebugAndRelease
} # AndroidBuild
} # MobileBuild
#
# AutoPilot Plugin Support
......@@ -569,7 +588,7 @@ HEADERS+= \
src/VehicleSetup/SetupView.h \
src/VehicleSetup/VehicleComponent.h \
!AndroidBuild {
!MobileBuild {
HEADERS += \
src/VehicleSetup/FirmwareUpgradeController.h \
src/VehicleSetup/PX4Bootloader.h \
......@@ -599,7 +618,7 @@ SOURCES += \
src/VehicleSetup/SetupView.cc \
src/VehicleSetup/VehicleComponent.cc \
!AndroidBuild {
!MobileBuild {
SOURCES += \
src/VehicleSetup/FirmwareUpgradeController.cc \
src/VehicleSetup/PX4Bootloader.cc \
......
......@@ -32,8 +32,7 @@ linux {
CONFIG += LinuxBuild
} else : android-g++ {
message("Android build")
CONFIG += AndroidBuild
DEFINES += __mobile__
CONFIG += AndroidBuild MobileBuild
DEFINES += __android__
warning("Android build is experimental and not fully functional")
} else {
......@@ -54,8 +53,17 @@ linux {
} else {
error("Unsupported Mac toolchain, only 64-bit LLVM+clang is supported")
}
} else : ios {
message("iOS build")
CONFIG += iOSBuild MobileBuild app_bundle
DEFINES += __ios__
warning("iOS build is experimental and not yet functional")
} else {
error("Unsupported build platform, only Linux, Windows, and Mac are supported")
error("Unsupported build platform, only Linux, Windows, Android and Mac (Mac OS and iOS) are supported")
}
MobileBuild {
DEFINES += __mobile__
}
# Installer configuration
......@@ -86,29 +94,46 @@ win32:debug_and_release {
# Setup our build directories
BASEDIR = $${IN_PWD}
DebugBuild {
DESTDIR = $${OUT_PWD}/debug
BUILDDIR = $${OUT_PWD}/build-debug
}
BASEDIR = $$IN_PWD
DESTDIR = $${OUT_PWD}/debug
BUILDDIR = $${OUT_PWD}/build-debug
ReleaseBuild {
DESTDIR = $${OUT_PWD}/release
BUILDDIR = $${OUT_PWD}/build-release
}
OBJECTS_DIR = $${BUILDDIR}/obj
MOC_DIR = $${BUILDDIR}/moc
UI_DIR = $${BUILDDIR}/ui
RCC_DIR = $${BUILDDIR}/rcc
LANGUAGE = C++
iOSBuild {
# For whatever reason, the iOS build fails with these set. Some files have the full,
# properly concatenaded path and file name while others have only the second portion,
# as if BUILDDIR was empty.
OBJECTS_DIR = ~/tmp/qgcfoo
MOC_DIR = ~/tmp/qgcfoo
UI_DIR = ~/tmp/qgcfoo
RCC_DIR = ~/tmp/qgcfoo
} else {
OBJECTS_DIR = $${BUILDDIR}/obj
MOC_DIR = $${BUILDDIR}/moc
UI_DIR = $${BUILDDIR}/ui
RCC_DIR = $${BUILDDIR}/rcc
}
LANGUAGE = C++
AndroidBuild {
target.path = $$DESTDIR
}
# We place the created plugin lib into the objects dir so that make clean will clean it as well
LOCATION_PLUGIN_DESTDIR = $${OBJECTS_DIR}
LOCATION_PLUGIN_NAME = QGeoServiceProviderFactoryQGC
iOSBuild {
LOCATION_PLUGIN_DESTDIR = ~/tmp/qgcfoo
} else {
LOCATION_PLUGIN_DESTDIR = $$OBJECTS_DIR
}
LOCATION_PLUGIN_NAME = QGeoServiceProviderFactoryQGC
message(BASEDIR $$BASEDIR DESTDIR $$DESTDIR TARGET $$TARGET)
message(BASEDIR $$BASEDIR DESTDIR $$DESTDIR TARGET $$TARGET OUTPUT $$OUT_PWD)
# Turn off serial port warnings
DEFINES += _TTY_NOWARN_
......@@ -121,6 +146,10 @@ AndroidBuild {
DEFINES += __STDC_LIMIT_MACROS
}
iOSBuild {
QMAKE_IOS_DEPLOYMENT_TARGET = 7.0
}
MacBuild {
CONFIG += x86_64
CONFIG -= x86
......@@ -134,7 +163,6 @@ LinuxBuild {
WindowsBuild {
DEFINES += __STDC_LIMIT_MACROS
# Specify multi-process compilation within Visual Studio.
# (drastically improves compilation times for multi-core computers)
QMAKE_CXXFLAGS_DEBUG += -MP
......@@ -173,7 +201,6 @@ WindowsBuild {
ReleaseBuild {
DEFINES += QT_NO_DEBUG
WindowsBuild {
# Use link time code generation for better optimization (I believe this is supported in MSVC Express, but not 100% sure)
QMAKE_LFLAGS_LTCG = /LTCG
......
......@@ -6,7 +6,7 @@ CONFIG += plugin static
QT += location-private positioning-private network
PLUGIN_TYPE = geoservices
DESTDIR = $${LOCATION_PLUGIN_DESTDIR}
DESTDIR = $${LOCATION_PLUGIN_DESTDIR}
INCLUDEPATH += $$QT.location.includes
......@@ -30,4 +30,3 @@ SOURCES += \
OTHER_FILES += \
src/QtLocationPlugin/qgc_maps_plugin.json
......@@ -44,7 +44,7 @@ WindowsBuild {
BASEDIR_COPY_RESOURCE_LIST = $$replace(BASEDIR,"/","\\")
QMAKE_POST_LINK += $$escape_expand(\\n) $$QMAKE_COPY_DIR \"$$BASEDIR_COPY_RESOURCE_LIST\\flightgear\" \"$$DESTDIR_COPY_RESOURCE_LIST\\flightgear\"
} else {
!AndroidBuild {
!MobileBuild {
# Make sure to keep both sides of this if using the same set of directories
QMAKE_POST_LINK += && $$QMAKE_COPY_DIR $$BASEDIR/flightgear $$DESTDIR_COPY_RESOURCE_LIST
}
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleExecutable</key>
<string>qgroundcontrol</string>
<key>CFBundleIdentifier</key>
<string>org.qgroundcontrol.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>NOTE</key>
<string>This file was generated by Qt/QMake.</string>
</dict>
</plist>
......@@ -79,8 +79,8 @@ EIGEN_DONT_INLINE void selfadjoint_matrix_vector_product<Scalar,Index,StorageOrd
for (Index j=FirstTriangular ? bound : 0;
j<(FirstTriangular ? size : bound);j+=2)
{
register const Scalar* EIGEN_RESTRICT A0 = lhs + j*lhsStride;
register const Scalar* EIGEN_RESTRICT A1 = lhs + (j+1)*lhsStride;
const Scalar* EIGEN_RESTRICT A0 = lhs + j*lhsStride;
const Scalar* EIGEN_RESTRICT A1 = lhs + (j+1)*lhsStride;
Scalar t0 = cjAlpha * rhs[j];
Packet ptmp0 = pset1<Packet>(t0);
......@@ -147,7 +147,7 @@ EIGEN_DONT_INLINE void selfadjoint_matrix_vector_product<Scalar,Index,StorageOrd
}
for (Index j=FirstTriangular ? 0 : bound;j<(FirstTriangular ? bound : size);j++)
{
register const Scalar* EIGEN_RESTRICT A0 = lhs + j*lhsStride;
const Scalar* EIGEN_RESTRICT A0 = lhs + j*lhsStride;
Scalar t1 = cjAlpha * rhs[j];
Scalar t2(0);
......
This diff is collapsed.
......@@ -49,7 +49,9 @@
#include "QGCMessageBox.h"
#include "MainWindow.h"
#include "UDPLink.h"
#ifndef __ios__
#include "SerialLink.h"
#endif
#include "QGCSingleton.h"
#include "LinkManager.h"
#include "UASManager.h"
......@@ -67,7 +69,7 @@
#include "SensorsComponentController.h"
#include "PowerComponentController.h"
#include "RadioComponentController.h"
#ifndef __android__
#ifndef __mobile__
#include "FirmwareUpgradeController.h"
#endif
#include "AutoPilotPlugin.h"
......@@ -144,11 +146,11 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting) :
setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
#endif
#ifdef __android__
#ifdef __mobile__
QLoggingCategory::setFilterRules(QStringLiteral("*Log.debug=false"));
#endif
#ifndef __android__
#ifndef __mobile__
// First thing we want to do is set up the qtlogging.ini file. If it doesn't already exist we copy
// it to the correct location. This way default debug builds will have logging turned off.
......@@ -332,7 +334,7 @@ void QGCApplication::_initCommon(void)
qmlRegisterType<SensorsComponentController>("QGroundControl.Controllers", 1, 0, "SensorsComponentController");
qmlRegisterType<PowerComponentController>("QGroundControl.Controllers", 1, 0, "PowerComponentController");
qmlRegisterType<RadioComponentController>("QGroundControl.Controllers", 1, 0, "RadioComponentController");
#ifndef __android__
#ifndef __mobile__
qmlRegisterType<FirmwareUpgradeController>("QGroundControl.Controllers", 1, 0, "FirmwareUpgradeController");
#endif
......@@ -710,4 +712,4 @@ void QGCApplication::_missingParamsDisplay(void)
QGCMessageBox::critical("Missing Parameters",
QString("Parameters missing from firmware: %1.\n\n"
"You should quit QGroundControl immediately and update your firmware.").arg(params));
}
\ No newline at end of file
}
......@@ -26,7 +26,7 @@
#include <QRegularExpression>
#include "MainWindow.h"
#ifdef QT_DEBUG
#ifndef __android__
#ifndef __mobile__
#include "UnitTest.h"
#endif
#endif
......@@ -40,7 +40,7 @@ QString QGCFileDialog::getExistingDirectory(
_validate(options);
#ifdef QT_DEBUG
#ifndef __android__
#ifndef __mobile__
if (qgcApp()->runningUnitTests()) {
return UnitTest::_getExistingDirectory(parent, caption, dir, options);
} else
......@@ -61,7 +61,7 @@ QString QGCFileDialog::getOpenFileName(
_validate(options);
#ifdef QT_DEBUG
#ifndef __android__
#ifndef __mobile__
if (qgcApp()->runningUnitTests()) {
return UnitTest::_getOpenFileName(parent, caption, dir, filter, options);
} else
......@@ -82,7 +82,7 @@ QStringList QGCFileDialog::getOpenFileNames(
_validate(options);
#ifdef QT_DEBUG
#ifndef __android__
#ifndef __mobile__
if (qgcApp()->runningUnitTests()) {
return UnitTest::_getOpenFileNames(parent, caption, dir, filter, options);
} else
......@@ -105,7 +105,7 @@ QString QGCFileDialog::getSaveFileName(
_validate(options);
#ifdef QT_DEBUG
#ifndef __android__
#ifndef __mobile__
if (qgcApp()->runningUnitTests()) {
return UnitTest::_getSaveFileName(parent, caption, dir, filter, defaultSuffix, options);
} else
......@@ -217,7 +217,7 @@ void QGCFileDialog::_validate(Options& options)
Q_ASSERT(qgcApp());
Q_ASSERT_X(QThread::currentThread() == qgcApp()->thread(), "Threading issue", "QGCFileDialog can only be called from main thread");
#ifdef __android__
#ifdef __mobile__
Q_UNUSED(options)
#else
// On OSX native dialog can hang so we always use Qt dialogs
......
......@@ -29,7 +29,7 @@
#include "MainWindow.h"
#include "QGCApplication.h"
#ifdef QT_DEBUG
#ifndef __android__
#ifndef __mobile__
#include "UnitTest.h"
#endif
#endif
......@@ -106,7 +106,7 @@ private:
}
#ifdef QT_DEBUG
#ifndef __android__
#ifndef __mobile__
if (qgcApp()->runningUnitTests()) {
qDebug() << "QGCMessageBox (unit testing)" << title << text;
return UnitTest::_messageBox(icon, title, text, buttons, defaultButton);
......
......@@ -27,6 +27,7 @@ This file is part of the QGROUNDCONTROL project
* @author Gus Grubba <mavlink@grubba.com>
*/
#include "UAS.h"
#include "MainWindow.h"
#include "UASManager.h"
#include "Waypoint.h"
......
......@@ -125,6 +125,10 @@ public:
bool isAndroid () { return true; }
bool isiOS () { return false; }
bool isMobile () { return true; }
#elif defined(__ios__)
bool isAndroid () { return false; }
bool isiOS () { return true; }
bool isMobile () { return true; }
#else
bool isAndroid () { return false; }
bool isiOS () { return false; }
......
......@@ -48,6 +48,7 @@
#include <QtCore/QUrl>
#include <QtCore/QUrlQuery>
#include <QtCore/QLocale>
#include <QDebug>
#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkRequest>
#include <QtPositioning/QGeoCoordinate>
......
......@@ -28,11 +28,7 @@
#include "PX4Bootloader.h"
#include <QFile>
#ifdef __android__
#include "qserialportinfo.h"
#else
#include <QSerialPortInfo>
#endif
#include <QDebug>
#include <QTime>
......
......@@ -29,11 +29,7 @@
#include "PX4Bootloader.h"
#include <QTimer>
#ifdef __android__
#include "qserialportinfo.h"
#else
#include <QSerialPortInfo>
#endif
#include <QDebug>
PX4FirmwareUpgradeThreadWorker::PX4FirmwareUpgradeThreadWorker(QObject* parent) :
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/// @file
......@@ -32,7 +32,7 @@
#include "QGCQmlWidgetHolder.h"
#include "MainWindow.h"
#include "QGCMessageBox.h"
#ifndef __android__
#ifndef __mobile__
#include "FirmwareUpgradeController.h"
#endif
#include "ParameterEditorController.h"
......@@ -45,19 +45,19 @@ SetupView::SetupView(QWidget* parent) :
QGCQmlWidgetHolder(parent),
_uasCurrent(NULL),
_initComplete(false),
_readyAutopilot(NULL)
_readyAutopilot(NULL)
{
#ifdef __android__
#ifdef __mobile__
_showFirmware = false;
#else
_showFirmware = true;
#endif
connect(UASManager::instance(), &UASManager::activeUASSet, this, &SetupView::_setActiveUAS);
getRootContext()->setContextProperty("controller", this);
setSource(QUrl::fromUserInput("qrc:/qml/SetupView.qml"));
_setActiveUAS(UASManager::instance()->getActiveUAS());
}
......@@ -73,9 +73,9 @@ void SetupView::_setActiveUAS(UASInterface* uas)
}
_pluginReadyChanged(false);
_uasCurrent = uas;
if (_uasCurrent) {
_autopilot = AutoPilotPluginManager::instance()->getInstanceForAutoPilotPlugin(_uasCurrent);
if (_autopilot.data()->pluginReady()) {
......@@ -100,7 +100,7 @@ void SetupView::_pluginReadyChanged(bool pluginReady)
#ifdef UNITTEST_BUILD
void SetupView::showFirmware(void)
{
#ifndef __android__
#ifndef __mobile__
QVariant returnedValue;
bool success = QMetaObject::invokeMethod(getRootObject(),
"showFirmwarePanel",
......@@ -141,4 +141,4 @@ void SetupView::showVehicleComponentSetup(VehicleComponent* vehicleComponent)
AutoPilotPlugin* SetupView::autopilot(void)
{
return _readyAutopilot;
}
\ No newline at end of file
}
......@@ -28,7 +28,9 @@ This file is part of the QGROUNDCONTROL project
*/
#include "LinkConfiguration.h"
#ifndef __ios__
#include "SerialLink.h"
#endif
#include "UDPLink.h"
#include "TCPLink.h"
......@@ -82,9 +84,11 @@ LinkConfiguration* LinkConfiguration::createSettings(int type, const QString& na
{
LinkConfiguration* config = NULL;
switch(type) {
#ifndef __ios__
case LinkConfiguration::TypeSerial:
config = new SerialConfiguration(name);
break;
#endif
case LinkConfiguration::TypeUdp:
config = new UDPConfiguration(name);
break;
......@@ -108,9 +112,11 @@ LinkConfiguration* LinkConfiguration::duplicateSettings(LinkConfiguration* sourc
{
LinkConfiguration* dupe = NULL;
switch(source->type()) {
#ifndef __ios__
case TypeSerial:
dupe = new SerialConfiguration(dynamic_cast<SerialConfiguration*>(source));
break;
#endif
case TypeUdp:
dupe = new UDPConfiguration(dynamic_cast<UDPConfiguration*>(source));
break;
......
......@@ -39,7 +39,9 @@ public:
/// The link types supported by QGC
enum {
#ifndef __ios__
TypeSerial, ///< Serial Link
#endif
TypeUdp, ///< UDP Link
TypeTcp, ///< TCP Link
// TODO Below is not yet implemented
......
......@@ -32,11 +32,14 @@ This file is part of the QGROUNDCONTROL project
#include <QList>
#include <QApplication>
#include <QDebug>
#ifndef __ios__
#ifdef __android__
#include "qserialportinfo.h"
#else
#include <QSerialPortInfo>
#endif
#endif
#include "LinkManager.h"
#include "MainWindow.h"
......@@ -59,8 +62,10 @@ LinkManager::LinkManager(QObject* parent)
, _mavlinkChannelsUsedBitMask(0)
, _nullSharedLink(NULL)
{
#ifndef __ios__
connect(&_portListTimer, &QTimer::timeout, this, &LinkManager::_updateConfigurationList);
_portListTimer.start(1000);
#endif
}
LinkManager::~LinkManager()
......@@ -79,9 +84,11 @@ LinkInterface* LinkManager::createConnectedLink(LinkConfiguration* config)
Q_ASSERT(config);
LinkInterface* pLink = NULL;
switch(config->type()) {
#ifndef __ios__
case LinkConfiguration::TypeSerial:
pLink = new SerialLink(dynamic_cast<SerialConfiguration*>(config));
break;
#endif
case LinkConfiguration::TypeUdp:
pLink = new UDPLink(dynamic_cast<UDPConfiguration*>(config));
break;
......@@ -370,10 +377,12 @@ void LinkManager::loadLinkConfigurationList()
}
LinkConfiguration* pLink = NULL;
switch(type) {
#ifndef __ios__
case LinkConfiguration::TypeSerial:
pLink = (LinkConfiguration*)new SerialConfiguration(name);
pLink->setPreferred(preferred);
break;
#endif
case LinkConfiguration::TypeUdp:
pLink = (LinkConfiguration*)new UDPConfiguration(name);
pLink->setPreferred(preferred);
......@@ -422,6 +431,7 @@ void LinkManager::loadLinkConfigurationList()
_configurationsLoaded = true;
}
#ifndef __ios__
SerialConfiguration* LinkManager::_findSerialConfiguration(const QString& portName)
{
QString searchPort = portName.trimmed();
......@@ -436,7 +446,9 @@ SerialConfiguration* LinkManager::_findSerialConfiguration(const QString& portNa
}
return NULL;
}
#endif
#ifndef __ios__
void LinkManager::_updateConfigurationList(void)
{
if (_configUpdateSuspended || !_configurationsLoaded) {
......@@ -526,6 +538,7 @@ void LinkManager::_updateConfigurationList(void)
saveLinkConfigurationList();
}
}
#endif
bool LinkManager::containsLink(LinkInterface* link)
{
......
......@@ -35,7 +35,9 @@ This file is part of the PIXHAWK project
#include "LinkInterface.h"
// Links
#ifndef __ios__
#include "SerialLink.h"
#endif
#include "UDPLink.h"
#include "TCPLink.h"
......@@ -94,8 +96,9 @@ public:
const QList<LinkInterface*> getLinks();
// Returns list of all serial links
#ifndef __ios__
const QList<SerialLink*> getSerialLinks();
#endif
/// Sets the flag to suspend the all new connections
/// @param reason User visible reason to suspend connections
void setConnectionsSuspended(QString reason);
......@@ -156,8 +159,9 @@ private:
bool _connectionsSuspendedMsg(void);
void _updateConfigurationList(void);
#ifndef __ios__
SerialConfiguration* _findSerialConfiguration(const QString& portName);
#endif
QList<LinkConfiguration*> _linkConfigurations; ///< List of configured links
/// List of available links kept as QSharedPointers. We use QSharedPointer since
......@@ -171,8 +175,9 @@ private:
bool _configurationsLoaded; ///< true: Link configurations have been loaded
bool _connectionsSuspended; ///< true: all new connections should not be allowed
QString _connectionsSuspendedReason; ///< User visible reason for suspension
#ifndef __ios__
QTimer _portListTimer;
#endif
uint32_t _mavlinkChannelsUsedBitMask;
SharedLinkInterface _nullSharedLink;
......
......@@ -36,6 +36,7 @@ This file is part of the QGROUNDCONTROL project
#include <iostream>
#include "UAS.h"
#include "QGCJSBSimLink.h"
#include "QGC.h"
#include "QGCMessageBox.h"
......
......@@ -40,6 +40,7 @@ class SerialLink;
#include <QThread>
#include <QMutex>
#include <QString>
#ifdef __android__
#include "qserialport.h"
#else
......
......@@ -35,7 +35,7 @@ This file is part of the QGROUNDCONTROL project
#include "MainWindow.h"
#include "configuration.h"
#ifdef QT_DEBUG
#ifndef __android__
#ifndef __mobile__
#include "UnitTest.h"
#endif
#include "CmdLineOptParser.h"
......@@ -101,7 +101,9 @@ int main(int argc, char *argv[])
// that we use these types in signals, and without calling qRegisterMetaType we can't queue
// these signals. In general we don't queue these signals, but we do what the warning says
// anyway to silence the debug output.
#ifndef __ios__
qRegisterMetaType<QSerialPort::SerialPortError>();
#endif
qRegisterMetaType<QAbstractSocket::SocketError>();
// We statically link to the google QtLocation plugin
......@@ -158,7 +160,7 @@ int main(int argc, char *argv[])
int exitCode;
#ifndef __android__
#ifndef __mobile__
#ifdef QT_DEBUG
if (runUnitTests) {
if (!app->_initForUnitTests()) {
......
......@@ -28,7 +28,7 @@
#ifndef UNITTEST_H
#define UNITTEST_H
#ifndef __android__
#ifndef __mobile__
#include <QObject>
#include <QtTest>
......
......@@ -26,7 +26,9 @@
#include "MAVLinkProtocol.h"
#include "QGCMAVLink.h"
#include "LinkManager.h"
#ifndef __ios__
#include "SerialLink.h"
#endif
#include <Eigen/Geometry>
#include "AutoPilotPluginManager.h"
#include "QGCMessageBox.h"
......@@ -141,8 +143,9 @@ UAS::UAS(MAVLinkProtocol* protocol, int id) : UASInterface(),
blockHomePositionChanges(false),
receivedMode(false),
#ifndef __mobile__
simulation(0),
#endif
// The protected members.
connectionLost(false),
......@@ -2401,6 +2404,7 @@ void UAS::toggleAutonomy()
* Set the manual control commands.
* This can only be done if the system has manual inputs enabled and is armed.
*/
#ifndef __mobile__
void UAS::setExternalControlSetpoint(float roll, float pitch, float yaw, float thrust, qint8 xHat, qint8 yHat, quint16 buttons, quint8 joystickMode)
{
Q_UNUSED(xHat);
......@@ -2580,7 +2584,9 @@ void UAS::setExternalControlSetpoint(float roll, float pitch, float yaw, float t
}
}
}
#endif
#ifndef __mobile__
void UAS::setManual6DOFControlCommands(double x, double y, double z, double roll, double pitch, double yaw)
{
// If system has manual inputs enabled and is armed
......@@ -2614,6 +2620,7 @@ void UAS::setManual6DOFControlCommands(double x, double y, double z, double roll
qDebug() << "3DMOUSE/MANUAL CONTROL: IGNORING COMMANDS: Set mode to MANUAL to send 3DMouse commands first";
}
}
#endif
/**
* @return the type of the system
......@@ -2747,6 +2754,7 @@ bool UAS::emergencyKILL()
/**
* If enabled, connect the flight gear link.
*/
#ifndef __mobile__
void UAS::enableHilFlightGear(bool enable, QString options, bool sensorHil, QObject * configuration)
{
Q_UNUSED(configuration);
......@@ -2775,10 +2783,12 @@ void UAS::enableHilFlightGear(bool enable, QString options, bool sensorHil, QObj
stopHil();
}
}
#endif
/**
* If enabled, connect the JSBSim link.
*/
#ifndef __mobile__
void UAS::enableHilJSBSim(bool enable, QString options)
{
QGCJSBSimLink* link = dynamic_cast<QGCJSBSimLink*>(simulation);
......@@ -2802,10 +2812,12 @@ void UAS::enableHilJSBSim(bool enable, QString options)
stopHil();
}
}
#endif
/**
* If enabled, connect the X-plane gear link.
*/
#ifndef __mobile__
void UAS::enableHilXPlane(bool enable)
{
QGCXPlaneLink* link = dynamic_cast<QGCXPlaneLink*>(simulation);
......@@ -2827,6 +2839,7 @@ void UAS::enableHilXPlane(bool enable)
stopHil();
}
}
#endif
/**
* @param time_us Timestamp (microseconds since UNIX epoch or microseconds since system boot)
......@@ -2846,6 +2859,7 @@ void UAS::enableHilXPlane(bool enable)
* @param yacc Y acceleration (mg)
* @param zacc Z acceleration (mg)
*/
#ifndef __mobile__
void UAS::sendHilGroundTruth(quint64 time_us, float roll, float pitch, float yaw, float rollspeed,
float pitchspeed, float yawspeed, double lat, double lon, double alt,
float vx, float vy, float vz, float ind_airspeed, float true_airspeed, float xacc, float yacc, float zacc)
......@@ -2875,6 +2889,7 @@ void UAS::sendHilGroundTruth(quint64 time_us, float roll, float pitch, float yaw
emit valueChanged(uasId, "IAS sim", "m/s", ind_airspeed, getUnixTime());
emit valueChanged(uasId, "TAS sim", "m/s", true_airspeed, getUnixTime());
}
#endif
/**
* @param time_us Timestamp (microseconds since UNIX epoch or microseconds since system boot)
......@@ -2894,6 +2909,7 @@ void UAS::sendHilGroundTruth(quint64 time_us, float roll, float pitch, float yaw
* @param yacc Y acceleration (mg)
* @param zacc Z acceleration (mg)
*/
#ifndef __mobile__
void UAS::sendHilState(quint64 time_us, float roll, float pitch, float yaw, float rollspeed,
float pitchspeed, float yawspeed, double lat, double lon, double alt,
float vx, float vy, float vz, float ind_airspeed, float true_airspeed, float xacc, float yacc, float zacc)
......@@ -2930,11 +2946,13 @@ void UAS::sendHilState(quint64 time_us, float roll, float pitch, float yaw, floa
qDebug() << __FILE__ << __LINE__ << "HIL is onboard not enabled, trying to enable.";
}
}
#endif
/*
* @param abs_pressure Absolute Pressure (hPa)
* @param diff_pressure Differential Pressure (hPa)
*/
#ifndef __mobile__
void UAS::sendHilSensors(quint64 time_us, float xacc, float yacc, float zacc, float rollspeed, float pitchspeed, float yawspeed,
float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, quint32 fields_changed)
{
......@@ -2955,7 +2973,9 @@ void UAS::sendHilSensors(quint64 time_us, float xacc, float yacc, float zacc, fl
qDebug() << __FILE__ << __LINE__ << "HIL is onboard not enabled, trying to enable.";
}
}
#endif
#ifndef __mobile__
void UAS::sendHilOpticalFlow(quint64 time_us, qint16 flow_x, qint16 flow_y, float flow_comp_m_x,
float flow_comp_m_y, quint8 quality, float ground_distance)
{
......@@ -2988,7 +3008,9 @@ void UAS::sendHilOpticalFlow(quint64 time_us, qint16 flow_x, qint16 flow_y, floa
}
}
#endif
#ifndef __mobile__
void UAS::sendHilGps(quint64 time_us, double lat, double lon, double alt, int fix_type, float eph, float epv, float vel, float vn, float ve, float vd, float cog, int satellites)
{
// Only send at 10 Hz max rate
......@@ -3017,11 +3039,12 @@ void UAS::sendHilGps(quint64 time_us, double lat, double lon, double alt, int fi
qDebug() << __FILE__ << __LINE__ << "HIL is onboard not enabled, trying to enable.";
}
}
#endif
/**
* Connect flight gear link.
**/
#ifndef __mobile__
void UAS::startHil()
{
if (hilEnabled) return;
......@@ -3032,10 +3055,12 @@ void UAS::startHil()
// Connect HIL simulation link
simulation->connectSimulation();
}
#endif
/**
* disable flight gear link.
*/
#ifndef __mobile__
void UAS::stopHil()
{
if (simulation && simulation->isConnected()) {
......@@ -3046,6 +3071,7 @@ void UAS::stopHil()
hilEnabled = false;
sensorHil = false;
}
#endif
void UAS::shutdown()
{
......
......@@ -36,12 +36,14 @@ This file is part of the QGROUNDCONTROL project
#include <MAVLinkProtocol.h>
#include <QVector3D>
#include "QGCMAVLink.h"
#include "FileManager.h"
#ifndef __mobile__
#include "JoystickInput.h"
#include "QGCHilLink.h"
#include "QGCFlightGearLink.h"
#include "QGCJSBSimLink.h"
#include "QGCXPlaneLink.h"
#include "FileManager.h"
#include "JoystickInput.h"
#endif
Q_DECLARE_LOGGING_CATEGORY(UASLog)
......@@ -463,7 +465,9 @@ protected: //COMMENTS FOR TEST UNIT
bool receivedMode; ///< True if mode was retrieved from current conenction to UAS
/// SIMULATION
#ifndef __mobile__
QGCHilLink* simulation; ///< Hardware in the loop simulation link
#endif
public:
/** @brief Set the current battery type */
......@@ -493,10 +497,11 @@ public:
}
/** @brief Get the HIL simulation */
#ifndef __mobile__
QGCHilLink* getHILSimulation() const {
return simulation;
}
#endif
int getSystemType();
bool isAirplane();
......@@ -703,6 +708,7 @@ public slots:
void go();
/** @brief Enable / disable HIL */
#ifndef __mobile__
void enableHilFlightGear(bool enable, QString options, bool sensorHil, QObject * configuration);
void enableHilJSBSim(bool enable, QString options);
void enableHilXPlane(bool enable);
......@@ -744,7 +750,7 @@ public slots:
/** @brief Stops the UAV's Hardware-in-the-Loop simulation status **/
void stopHil();
#endif
/** @brief Stops the robot system. If it is an MAV, the robot starts the emergency landing procedure **/
void emergencySTOP();
......@@ -781,10 +787,14 @@ public slots:
void toggleAutonomy();
/** @brief Set the values for the manual control of the vehicle */
#ifndef __mobile__
void setExternalControlSetpoint(float roll, float pitch, float yaw, float thrust, qint8 xHat, qint8 yHat, quint16 buttons, quint8);
#endif
/** @brief Set the values for the 6dof manual control of the vehicle */
#ifndef __mobile__
void setManual6DOFControlCommands(double x, double y, double z, double roll, double pitch, double yaw);
#endif
/** @brief Add a link associated with this robot */
void addLink(LinkInterface* link);
......
......@@ -353,6 +353,7 @@ public slots:
virtual QString getBatterySpecs() = 0;
/** @brief Send the full HIL state to the MAV */
#ifndef __mobile__
virtual void sendHilState(quint64 time_us, float roll, float pitch, float yaw, float rollspeed,
float pitchspeed, float yawspeed, double lat, double lon, double alt,
float vx, float vy, float vz, float ind_airspeed, float true_airspeed, float xacc, float yacc, float zacc) = 0;
......@@ -367,6 +368,7 @@ public slots:
/** @brief Send Optical Flow sensor message for HIL, (arguments and units accoding to mavlink documentation*/
virtual void sendHilOpticalFlow(quint64 time_us, qint16 flow_x, qint16 flow_y, float flow_comp_m_x,
float flow_comp_m_y, quint8 quality, float ground_distance) = 0;
#endif
/** @brief Send command to map a RC channel to a parameter */
virtual void sendMapRCToParam(QString param_id, float scale, float value0, quint8 param_rc_channel_index, float valueMin, float valueMax) = 0;
......
......@@ -33,18 +33,22 @@ This file is part of the QGROUNDCONTROL project
#include <QTimer>
#include <QHostInfo>
#include <QSplashScreen>
#ifndef __mobile__
#include <QGCHilLink.h>
#include <QGCHilConfiguration.h>
#include <QGCHilFlightGearConfiguration.h>
#endif
#include <QQuickView>
#include <QDesktopWidget>
#include "QGC.h"
#ifndef __ios__
#include "SerialLink.h"
#endif
#include "MAVLinkProtocol.h"
#include "QGCWaypointListMulti.h"
#include "MainWindow.h"
#ifndef __android__
#ifndef __mobile__
#include "JoystickWidget.h"
#endif
#include "GAudioOutput.h"
......@@ -88,6 +92,9 @@ This file is part of the QGROUNDCONTROL project
#if defined(Q_OS_OSX)
double MainWindow::_pixelFactor = 1.0;
double MainWindow::_fontFactor = 1.0;
#elif defined(__ios__)
double MainWindow::_pixelFactor = 1.0;
double MainWindow::_fontFactor = 1.0;
#elif defined(Q_OS_WIN)
double MainWindow::_pixelFactor = 0.86;
double MainWindow::_fontFactor = 0.63;
......@@ -217,7 +224,7 @@ MainWindow::MainWindow(QSplashScreen* splashScreen)
connectCommonActions();
// Connect user interface devices
emit initStatusChanged(tr("Initializing joystick interface"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141));
#ifndef __android__
#ifndef __mobile__
joystick = new JoystickInput();
#endif
#ifdef QGC_MOUSE_ENABLED_WIN
......@@ -248,7 +255,7 @@ MainWindow::MainWindow(QSplashScreen* splashScreen)
emit initStatusChanged(tr("Restoring last view state"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141));
// Restore the window setup
_loadCurrentViewState();
#ifndef __android__
#ifndef __mobile__
// Restore the window position and size
emit initStatusChanged(tr("Restoring last window size"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141));
......@@ -317,7 +324,7 @@ MainWindow::MainWindow(QSplashScreen* splashScreen)
if (!qgcApp()->runningUnitTests()) {
_ui.actionStatusBar->setChecked(_showStatusBar);
showStatusBarCallback(_showStatusBar);
#ifdef __android__
#ifdef __mobile__
menuBar()->hide();
#endif
show();
......@@ -341,7 +348,7 @@ MainWindow::MainWindow(QSplashScreen* splashScreen)
MainWindow::~MainWindow()
{
#ifndef __android__
#ifndef __mobile__
if (joystick)
{
joystick->shutdown();
......@@ -585,6 +592,7 @@ void MainWindow::_createInnerDockWidget(const QString& widgetName)
}
}
#ifndef __mobile__
void MainWindow::_showHILConfigurationWidgets(void)
{
UASInterface* uas = UASManager::instance()->getActiveUAS();
......@@ -624,6 +632,7 @@ void MainWindow::_showHILConfigurationWidgets(void)
}
}
}
#endif
void MainWindow::fullScreenActionItemCallback(bool)
{
......@@ -852,7 +861,7 @@ void MainWindow::showRoadMap()
void MainWindow::showSettings()
{
#ifndef __android__
#ifndef __mobile__
SettingsDialog settings(joystick, this);
#else
SettingsDialog settings(this);
......@@ -883,7 +892,9 @@ void MainWindow::UASCreated(UASInterface* uas)
connect(uas, SIGNAL(misconfigurationDetected(UASInterface*)), this, SLOT(handleMisconfiguration(UASInterface*)));
// HIL
#ifndef __mobile__
_showHILConfigurationWidgets();
#endif
if (!linechartWidget)
{
......@@ -1004,7 +1015,9 @@ void MainWindow::_loadCurrentViewState(void)
// HIL dock widget are dynamic and don't take part in the saved window state, so this
// need to happen after we restore state
#ifndef __mobile__
_showHILConfigurationWidgets();
#endif
// There is a bug in Qt where a Canvas element inside a QQuickWidget does not
// receive update requests. Here we emit a signal for them to get repainted.
......@@ -1138,7 +1151,7 @@ void MainWindow::hideSplashScreen(void)
void MainWindow::manageLinks()
{
#ifndef __android__
#ifndef __mobile__
SettingsDialog settings(joystick, this, SettingsDialog::ShowCommLinks);
#else
SettingsDialog settings(this, SettingsDialog::ShowCommLinks);
......
......@@ -47,7 +47,7 @@ This file is part of the QGROUNDCONTROL project
#include "WaypointList.h"
#include "CameraView.h"
#include "UASListWidget.h"
#ifndef __android__
#ifndef __mobile__
#include "input/JoystickInput.h"
#endif
#if (defined QGC_MOUSE_ENABLED_WIN) | (defined QGC_MOUSE_ENABLED_LINUX)
......@@ -65,7 +65,6 @@ This file is part of the QGROUNDCONTROL project
#include "QGCMAVLinkLogPlayer.h"
#include "MAVLinkDecoder.h"
#include "QGCUASFileViewMulti.h"
#include "QGCFlightGearLink.h"
class QGCMapTool;
class QGCMAVLinkMessageSender;
......@@ -263,7 +262,7 @@ protected:
QPointer<QGCUASFileViewMulti> fileWidget;
#ifndef __android__
#ifndef __mobile__
JoystickInput* joystick; ///< The joystick manager for QGC
#endif
......@@ -290,7 +289,6 @@ protected:
LogCompressor* comp;
QTimer* videoTimer;
QGCFlightGearLink* fgLink;
QTimer windowNameUpdateTimer;
private slots:
......@@ -353,7 +351,9 @@ private:
void _hideAllHilDockWidgets(void);
void _hideAllDockWidgets(void);
void _showDockWidget(const QString &name, bool show);
#ifndef __mobile__
void _showHILConfigurationWidgets(void);
#endif
bool _autoReconnect;
bool _lowPowerMode; ///< If enabled, QGC reduces the update rates of all widgets
......
......@@ -30,8 +30,10 @@ This file is part of the QGROUNDCONTROL project
#include <QPushButton>
#ifndef __ios__
#include "SerialLink.h"
#include "SerialConfigurationWindow.h"
#endif
#include "QGCUDPLinkConfiguration.h"
#include "QGCTCPLinkConfiguration.h"
#include "QGCCommConfiguration.h"
......@@ -45,7 +47,9 @@ QGCCommConfiguration::QGCCommConfiguration(QWidget *parent, LinkConfiguration *c
// Add link types
_config = config;
_ui->typeCombo->addItem(tr("Select Type"), LinkConfiguration::TypeLast);
#ifndef __ios__
_ui->typeCombo->addItem(tr("Serial"), LinkConfiguration::TypeSerial);
#endif
_ui->typeCombo->addItem(tr("UDP"), LinkConfiguration::TypeUdp);
_ui->typeCombo->addItem(tr("TCP"), LinkConfiguration::TypeTcp);
#ifdef QT_DEBUG
......@@ -113,6 +117,7 @@ void QGCCommConfiguration::_loadTypeConfigWidget(int type)
{
Q_ASSERT(_config != NULL);
switch(type) {
#ifndef __ios__
case LinkConfiguration::TypeSerial: {
QWidget* conf = new SerialConfigurationWindow((SerialConfiguration*)_config, this);
_ui->linkScrollArea->setWidget(conf);
......@@ -120,6 +125,7 @@ void QGCCommConfiguration::_loadTypeConfigWidget(int type)
_ui->typeCombo->setCurrentIndex(_ui->typeCombo->findData(LinkConfiguration::TypeSerial));
}
break;
#endif
case LinkConfiguration::TypeUdp: {
QWidget* conf = new QGCUDPLinkConfiguration((UDPConfiguration*)_config, this);
_ui->linkScrollArea->setWidget(conf);
......
......@@ -29,11 +29,13 @@ This file is part of the QGROUNDCONTROL project
*/
#include <QTemporaryFile>
#ifndef __mobile__
#include <QPrintDialog>
#include <QPrinter>
#endif
#include <QProgressDialog>
#include <QHBoxLayout>
#include <QSvgGenerator>
#include <QPrinter>
#include <QStandardPaths>
#include <QDebug>
......@@ -161,6 +163,7 @@ void QGCDataPlot2D::savePlot()
void QGCDataPlot2D::print()
{
#ifndef __mobile__
QPrinter printer(QPrinter::HighResolution);
// printer.setOutputFormat(QPrinter::PdfFormat);
// //QPrinter printer(QPrinter::HighResolution);
......@@ -196,10 +199,14 @@ void QGCDataPlot2D::print()
plot->setStyleSheet("QWidget { background-color: #050508; color: #DDDDDF; background-clip: border; font-size: 11pt;}");
//plot->setCanvasBackground(QColor(5, 5, 8));
}
#endif
}
void QGCDataPlot2D::exportPDF(QString fileName)
{
#ifdef __mobile__
Q_UNUSED(fileName)
#else
QPrinter printer;
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setOutputFileName(fileName);
......@@ -235,10 +242,14 @@ void QGCDataPlot2D::exportPDF(QString fileName)
//plot->print(printer);
plot->setStyleSheet("QWidget { background-color: #050508; color: #DDDDDF; background-clip: border; font-size: 11pt;}");
//plot->setCanvasBackground(QColor(5, 5, 8));
#endif
}
void QGCDataPlot2D::exportSVG(QString fileName)
{
#ifdef __mobile__
Q_UNUSED(fileName)
#else
if ( !fileName.isEmpty() ) {
plot->setStyleSheet("QWidget { background-color: #FFFFFF; color: #000000; background-clip: border; font-size: 10pt;}");
//plot->setCanvasBackground(Qt::white);
......@@ -257,6 +268,7 @@ void QGCDataPlot2D::exportSVG(QString fileName)
//plot->print(generator);
plot->setStyleSheet("QWidget { background-color: #050508; color: #DDDDDF; background-clip: border; font-size: 11pt;}");
}
#endif
}
/**
......
......@@ -135,6 +135,7 @@ void QGCLinkConfiguration::_fixUnnamed(LinkConfiguration* config)
//-- Check for "Unnamed"
if (config->name() == tr("Unnamed")) {
switch(config->type()) {
#ifndef __ios__
case LinkConfiguration::TypeSerial: {
QString tname = dynamic_cast<SerialConfiguration*>(config)->portName();
#ifdef Q_OS_WIN32
......@@ -146,6 +147,7 @@ void QGCLinkConfiguration::_fixUnnamed(LinkConfiguration* config)
config->setName(QString("Serial Device on %1").arg(tname));
break;
}
#endif
case LinkConfiguration::TypeUdp:
config->setName(
QString("UDP Link on Port %1").arg(dynamic_cast<UDPConfiguration*>(config)->localPort()));
......
......@@ -2,7 +2,9 @@
#include <QtEndian>
#include "MainWindow.h"
#ifndef __ios__
#include "SerialLink.h"
#endif
#include "QGCMAVLinkLogPlayer.h"
#include "QGC.h"
#include "ui_QGCMAVLinkLogPlayer.h"
......
......@@ -28,7 +28,7 @@
#include "MainWindow.h"
#include "ui_SettingsDialog.h"
#ifndef __android__
#ifndef __mobile__
#include "JoystickWidget.h"
#endif
#include "LinkManager.h"
......@@ -41,7 +41,7 @@
#include "QGCMessageBox.h"
#include "MainToolBar.h"
#ifndef __android__
#ifndef __mobile__
SettingsDialog::SettingsDialog(JoystickInput *joystick, QWidget *parent, int showTab, Qt::WindowFlags flags) :
#else
SettingsDialog::SettingsDialog(QWidget *parent, int showTab, Qt::WindowFlags flags) :
......@@ -58,14 +58,14 @@ _ui(new Ui::SettingsDialog)
move(position.topLeft());
QGCLinkConfiguration* pLinkConf = new QGCLinkConfiguration(this);
#ifndef __android__
#ifndef __mobile__
JoystickWidget* pJoystickConf = new JoystickWidget(joystick, this);
#endif
MAVLinkSettingsWidget* pMavsettings = new MAVLinkSettingsWidget(MAVLinkProtocol::instance(), this);
// Add the link settings pane
_ui->tabWidget->addTab(pLinkConf, "Comm Links");
#ifndef __android__
#ifndef __mobile__
// Add the joystick settings pane
_ui->tabWidget->addTab(pJoystickConf, "Controllers");
#endif
......@@ -113,7 +113,7 @@ _ui(new Ui::SettingsDialog)
case ShowCommLinks:
_ui->tabWidget->setCurrentWidget(pLinkConf);
break;
#ifndef __android__
#ifndef __mobile__
case ShowControllers:
_ui->tabWidget->setCurrentWidget(pJoystickConf);
break;
......
......@@ -45,7 +45,7 @@ public:
ShowMavlink
};
#ifdef __android__
#ifdef __mobile__
SettingsDialog(QWidget *parent = 0, int showTab = ShowDefault, Qt::WindowFlags flags = Qt::Sheet);
#else
SettingsDialog(JoystickInput *joystick, QWidget *parent = 0, int showTab = ShowDefault, Qt::WindowFlags flags = Qt::Sheet);
......
......@@ -56,7 +56,7 @@ void CurveData::append(double *x, double *y, int count)
d_y.resize(newSize);
}
for ( register int i = 0; i < count; i++ ) {
for ( int i = 0; i < count; i++ ) {
d_x[d_count + i] = x[i];
d_y[d_count + i] = y[i];
}
......
......@@ -40,7 +40,10 @@ This file is part of the PIXHAWK project
#include "UASWaypointManager.h"
#include "MainWindow.h"
#include "ui_UASView.h"
#ifndef __mobile__
#include <QGCHilFlightGearConfiguration.h>
#endif
UASView::UASView(UASInterface* uas, QWidget *parent) :
QWidget(parent),
......
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