Commit 97a07325 authored by dogmaphobic's avatar dogmaphobic

Merge remote-tracking branch 'mavlink/master' into toolbarWork

* mavlink/master: (30 commits)
  android lower minSdkVersion to 16
  Update README.md
  Fix G constant, emit updates more regularly
  QGC: Fix excessive noise terms
  check for new and old flightgear path
  set correct path to flightgear executable on osx
  fix android auto versionName update
  travis-ci try installing PyOpenSSL with pip
  travis-ci add python-openssl for google play publish
  travis-ci run doxygen config last
  travis-ci pip install --user
  travis-ci install google-api-python-client
  fix travis decrypt google play credentials
  android auto version and deploy to google play
  update android version
  Remove Flightgear and JSBSim and only leave the option which actually works.
  Wait after window close to prevent qml warnings
  Restructure to prevent shutdown warnings
  QT_FATAL_WARNINGS back on
  Remove remaining singletons
  ...

Conflicts:
	src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc
parents da8d8bb5 a120ffe7
......@@ -17,12 +17,9 @@ matrix:
- os: linux
env: SPEC=linux-g++-64 CONFIG=installer
sudo: false
- os: linux
env: CONFIG=doxygen
sudo: false
- os: osx
osx_image: xcode7
env: SPEC=macx-clang CONFIG=debug
env: SPEC=macx-clang CONFIG=debug QT_FATAL_WARNINGS=1
- os: osx
osx_image: xcode7
env: SPEC=macx-clang CONFIG=installer
......@@ -34,6 +31,9 @@ matrix:
language: android
env: SPEC=android-g++ CONFIG=installer
sudo: false
- os: linux
env: CONFIG=doxygen
sudo: false
android:
components:
......@@ -111,6 +111,7 @@ before_script:
- if [ "${CONFIG}" != "doxygen" ]; then qmake -r qgroundcontrol.pro CONFIG+=${CONFIG} CONFIG+=WarningsAsErrorsOn -spec ${SPEC}; fi
script:
- ./tools/update_android_version.sh
- echo 'Building QGroundControl' && echo -en 'travis_fold:start:script.1\\r'
- if [ "${CONFIG}" != "doxygen" ]; then make -j4; fi
- if [ "${CONFIG}" = "doxygen" ]; then cd src && doxygen documentation.dox; fi
......@@ -118,6 +119,14 @@ script:
- if [[ "${TRAVIS_OS_NAME}" = "linux" && "${CONFIG}" = "debug" ]]; then ./debug/qgroundcontrol --unittest; fi
- if [[ "${TRAVIS_OS_NAME}" = "osx" && "${CONFIG}" = "debug" ]]; then ./debug/qgroundcontrol.app/Contents/MacOS/qgroundcontrol --unittest; fi
after_success:
- if [[ "${TRAVIS_OS_NAME}" = "android" && "${TRAVIS_PULL_REQUEST}" = "false" && "${TRAVIS_BRANCH}" = "master" ]]; then
pip install --user google-api-python-client PyOpenSSL
&& openssl aes-256-cbc -K $encrypted_25db6eb7c3fd_key -iv $encrypted_25db6eb7c3fd_iv -in Google_Play_Android_Developer-bb93ae7d61ca.p12.enc -out android/Google_Play_Android_Developer-bb93ae7d61ca.p12 -d
&& ./tools/google_play_upload.py org.mavlink.qgroundcontrol release/package/qgroundcontrol.apk
;
fi
deploy:
- provider: s3
access_key_id: AKIAIVORNALE7NHD3T6Q
......
......@@ -200,7 +200,6 @@ FORMS += \
src/ui/uas/UASQuickView.ui \
src/ui/uas/UASQuickViewItemSelect.ui \
src/ui/UASInfo.ui \
src/ui/UASRawStatusView.ui \
}
HEADERS += \
......@@ -240,7 +239,6 @@ HEADERS += \
src/QGCPalette.h \
src/QGCQmlWidgetHolder.h \
src/QGCQuickWidget.h \
src/QGCSingleton.h \
src/QGCTemporaryFile.h \
src/QGCToolbox.h \
src/QmlControls/CoordinateVector.h \
......@@ -317,7 +315,6 @@ HEADERS += \
src/ui/uas/UASQuickViewItem.h \
src/ui/uas/UASQuickViewItemSelect.h \
src/ui/uas/UASQuickViewTextItem.h \
src/ui/UASRawStatusView.h \
src/VehicleSetup/JoystickConfigController.h \
src/ViewWidgets/CustomCommandWidget.h \
src/ViewWidgets/CustomCommandWidgetController.h \
......@@ -355,7 +352,6 @@ SOURCES += \
src/QGCPalette.cc \
src/QGCQmlWidgetHolder.cpp \
src/QGCQuickWidget.cc \
src/QGCSingleton.cc \
src/QGCTemporaryFile.cc \
src/QGCToolbox.cc \
src/QGCGeo.cc \
......@@ -423,7 +419,6 @@ SOURCES += \
src/ui/uas/UASQuickViewItem.cc \
src/ui/uas/UASQuickViewItemSelect.cc \
src/ui/uas/UASQuickViewTextItem.cc \
src/ui/UASRawStatusView.cpp \
src/VehicleSetup/JoystickConfigController.cc \
src/ViewWidgets/CustomCommandWidget.cc \
src/ViewWidgets/CustomCommandWidgetController.cc \
......
......@@ -20,12 +20,9 @@
## Obtaining source code
Source code for QGroundControl is kept on GitHub: https://github.com/mavlink/qgroundcontrol.
```
git clone https://github.com/mavlink/qgroundcontrol.git
cd qgroundcontrol
git submodule init
git submodule update
git clone --recursive https://github.com/mavlink/qgroundcontrol.git
```
Each time you pull new source to your repository you should re-run "git submodule update" to get the latest submodules as well.
Each time you pull new source to your repository you should run `git submodule update` to get the latest submodules as well.
### Supported Builds
QGroundControl builds are supported for OSX, Linux, Windows and Android. QGroundControl uses [Qt](http://www.qt.io) as it's cross-platform support library and uses [QtCreator](http://doc.qt.io/qtcreator/index.html) as it's default build environment.
......
<?xml version="1.0"?>
<manifest package="org.mavlink.qgroundcontrol" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.7.1-668-g4ad2975" android:versionCode="8" android:installLocation="auto">
<manifest package="org.mavlink.qgroundcontrol" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.7.1-801-g075d5af" android:versionCode="2109" android:installLocation="auto">
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --" android:icon="@drawable/icon">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qgroundcontrol.qgchelper.UsbDeviceJNI" android:label="-- %%INSERT_APP_NAME%% --" android:screenOrientation="sensorLandscape" android:launchMode="singleTask">
<intent-filter>
......@@ -48,7 +48,7 @@
<!-- Background running -->
</activity>
</application>
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="22"/>
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="22"/>
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
<!-- Needed to keep working while 'asleep' -->
......
......@@ -27,8 +27,8 @@
#include "APMAirframeComponent.h"
#include "QGCQmlWidgetHolder.h"
APMAirframeComponent::APMAirframeComponent(UASInterface* uas, AutoPilotPlugin* autopilot, QObject* parent) :
APMComponent(uas, autopilot, parent),
APMAirframeComponent::APMAirframeComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent) :
APMComponent(vehicle, autopilot, parent),
_name(tr("Airframe"))
{
......
......@@ -31,7 +31,7 @@ class APMAirframeComponent : public APMComponent
Q_OBJECT
public:
APMAirframeComponent(UASInterface* uas, AutoPilotPlugin* autopilot, QObject* parent = NULL);
APMAirframeComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
// Virtuals from APMComponent
virtual QStringList setupCompleteChangedTriggerList(void) const;
......
......@@ -48,7 +48,7 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void)
Q_ASSERT(_vehicle);
if (parametersReady()) {
_airframeComponent = new APMAirframeComponent(_vehicle->uas(), this);
_airframeComponent = new APMAirframeComponent(_vehicle, this);
Q_CHECK_PTR(_airframeComponent);
_airframeComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_airframeComponent));
......
......@@ -28,10 +28,10 @@
#include "Fact.h"
#include "AutoPilotPlugin.h"
APMComponent::APMComponent(UASInterface* uas, AutoPilotPlugin* autopilot, QObject* parent) :
VehicleComponent(uas, autopilot, parent)
APMComponent::APMComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent) :
VehicleComponent(vehicle, autopilot, parent)
{
Q_ASSERT(uas);
Q_ASSERT(vehicle);
Q_ASSERT(autopilot);
}
......
......@@ -37,7 +37,7 @@ class APMComponent : public VehicleComponent
Q_OBJECT
public:
APMComponent(UASInterface* uas, AutoPilotPlugin* autopilot, QObject* parent = NULL);
APMComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
/// @brief Returns an list of parameter names for which a change should cause the setupCompleteChanged
/// signal to be emitted. Last element is signalled by NULL.
......
......@@ -170,7 +170,7 @@ const QMap<int, QMap<QString, QStringList> >& AutoPilotPlugin::getGroupMap(void)
void AutoPilotPlugin::writeParametersToStream(QTextStream &stream)
{
_vehicle->getParameterLoader()->writeParametersToStream(stream, _vehicle->uas()->getUASName());
_vehicle->getParameterLoader()->writeParametersToStream(stream);
}
QString AutoPilotPlugin::readParametersFromStream(QTextStream &stream)
......
......@@ -68,8 +68,8 @@ static const struct mavType mavTypeInfo[] = {
static size_t cMavTypes = sizeof(mavTypeInfo) / sizeof(mavTypeInfo[0]);
#endif
AirframeComponent::AirframeComponent(UASInterface* uas, AutoPilotPlugin* autopilot, QObject* parent) :
PX4Component(uas, autopilot, parent),
AirframeComponent::AirframeComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent) :
PX4Component(vehicle, autopilot, parent),
_name(tr("Airframe"))
{
#if 0
......
......@@ -35,7 +35,7 @@ class AirframeComponent : public PX4Component
Q_OBJECT
public:
AirframeComponent(UASInterface* uas, AutoPilotPlugin* autopilot, QObject* parent = NULL);
AirframeComponent(Vehicle* vehicles, AutoPilotPlugin* autopilot, QObject* parent = NULL);
// Virtuals from PX4Component
virtual QStringList setupCompleteChangedTriggerList(void) const;
......
......@@ -43,8 +43,8 @@ static const SwitchListItem switchList[] = {
};
static const size_t cSwitchList = sizeof(switchList) / sizeof(switchList[0]);
FlightModesComponent::FlightModesComponent(UASInterface* uas, AutoPilotPlugin* autopilot, QObject* parent) :
PX4Component(uas, autopilot, parent),
FlightModesComponent::FlightModesComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent) :
PX4Component(vehicle, autopilot, parent),
_name(tr("Flight Modes"))
{
}
......
......@@ -35,7 +35,7 @@ class FlightModesComponent : public PX4Component
Q_OBJECT
public:
FlightModesComponent(UASInterface* uas, AutoPilotPlugin* autopilot, QObject* parent = NULL);
FlightModesComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
// Virtuals from PX4Component
virtual QStringList setupCompleteChangedTriggerList(void) const;
......
......@@ -66,7 +66,7 @@ FlightModesComponentController::~FlightModesComponentController()
void FlightModesComponentController::_init(void)
{
// FIXME: What about VTOL? That confuses the whole Flight Mode naming scheme
_fixedWing = _uas->getSystemType() == MAV_TYPE_FIXED_WING;
_fixedWing = _vehicle->vehicleType() == MAV_TYPE_FIXED_WING;
// We need to know min and max for channel in order to calculate percentage range
for (int channel=0; channel<_chanMax; channel++) {
......
......@@ -94,32 +94,32 @@ const QVariantList& PX4AutoPilotPlugin::vehicleComponents(void)
Q_ASSERT(_vehicle);
if (parametersReady()) {
_airframeComponent = new AirframeComponent(_vehicle->uas(), this);
_airframeComponent = new AirframeComponent(_vehicle, this);
Q_CHECK_PTR(_airframeComponent);
_airframeComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_airframeComponent));
_radioComponent = new RadioComponent(_vehicle->uas(), this);
_radioComponent = new RadioComponent(_vehicle, this);
Q_CHECK_PTR(_radioComponent);
_radioComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_radioComponent));
_flightModesComponent = new FlightModesComponent(_vehicle->uas(), this);
_flightModesComponent = new FlightModesComponent(_vehicle, this);
Q_CHECK_PTR(_flightModesComponent);
_flightModesComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_flightModesComponent));
_sensorsComponent = new SensorsComponent(_vehicle->uas(), this);
_sensorsComponent = new SensorsComponent(_vehicle, this);
Q_CHECK_PTR(_sensorsComponent);
_sensorsComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_sensorsComponent));
_powerComponent = new PowerComponent(_vehicle->uas(), this);
_powerComponent = new PowerComponent(_vehicle, this);
Q_CHECK_PTR(_powerComponent);
_powerComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_powerComponent));
_safetyComponent = new SafetyComponent(_vehicle->uas(), this);
_safetyComponent = new SafetyComponent(_vehicle, this);
Q_CHECK_PTR(_safetyComponent);
_safetyComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_safetyComponent));
......
......@@ -28,10 +28,10 @@
#include "Fact.h"
#include "AutoPilotPlugin.h"
PX4Component::PX4Component(UASInterface* uas, AutoPilotPlugin* autopilot, QObject* parent) :
VehicleComponent(uas, autopilot, parent)
PX4Component::PX4Component(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent) :
VehicleComponent(vehicle, autopilot, parent)
{
Q_ASSERT(uas);
Q_ASSERT(vehicle);
Q_ASSERT(autopilot);
}
......
......@@ -37,7 +37,7 @@ class PX4Component : public VehicleComponent
Q_OBJECT
public:
PX4Component(UASInterface* uas, AutoPilotPlugin* autopilot, QObject* parent = NULL);
PX4Component(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
/// @brief Returns an list of parameter names for which a change should cause the setupCompleteChanged
/// signal to be emitted. Last element is signalled by NULL.
......
......@@ -28,8 +28,8 @@
#include "QGCQmlWidgetHolder.h"
#include "PX4AutoPilotPlugin.h"
PowerComponent::PowerComponent(UASInterface* uas, AutoPilotPlugin* autopilot, QObject* parent) :
PX4Component(uas, autopilot, parent),
PowerComponent::PowerComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent) :
PX4Component(vehicle, autopilot, parent),
_name(tr("Power"))
{
}
......
......@@ -35,7 +35,7 @@ class PowerComponent : public PX4Component
Q_OBJECT
public:
PowerComponent(UASInterface* uas, AutoPilotPlugin* autopilot, QObject* parent = NULL);
PowerComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
// Virtuals from PX4Component
virtual QStringList setupCompleteChangedTriggerList(void) const;
......
......@@ -28,8 +28,8 @@
#include "QGCQmlWidgetHolder.h"
#include "PX4AutoPilotPlugin.h"
RadioComponent::RadioComponent(UASInterface* uas, AutoPilotPlugin* autopilot, QObject* parent) :
PX4Component(uas, autopilot, parent),
RadioComponent::RadioComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent) :
PX4Component(vehicle, autopilot, parent),
_name(tr("Radio"))
{
}
......
......@@ -36,7 +36,7 @@ class RadioComponent : public PX4Component
Q_OBJECT
public:
RadioComponent(UASInterface* uas, AutoPilotPlugin* autopilot, QObject* parent = NULL);
RadioComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
// Virtuals from PX4Component
virtual QStringList setupCompleteChangedTriggerList(void) const;
......
......@@ -28,8 +28,8 @@
#include "QGCQmlWidgetHolder.h"
#include "PX4AutoPilotPlugin.h"
SafetyComponent::SafetyComponent(UASInterface* uas, AutoPilotPlugin* autopilot, QObject* parent) :
PX4Component(uas, autopilot, parent),
SafetyComponent::SafetyComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent) :
PX4Component(vehicle, autopilot, parent),
_name(tr("Safety"))
{
}
......
......@@ -36,7 +36,7 @@ class SafetyComponent : public PX4Component
Q_OBJECT
public:
SafetyComponent(UASInterface* uas, AutoPilotPlugin* autopilot, QObject* parent = NULL);
SafetyComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
// Virtuals from PX4Component
virtual QStringList setupCompleteChangedTriggerList(void) const;
......
......@@ -31,8 +31,8 @@
// These two list must be kept in sync
SensorsComponent::SensorsComponent(UASInterface* uas, AutoPilotPlugin* autopilot, QObject* parent) :
PX4Component(uas, autopilot, parent),
SensorsComponent::SensorsComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent) :
PX4Component(vehicle, autopilot, parent),
_name(tr("Sensors"))
{
......@@ -87,11 +87,15 @@ QStringList SensorsComponent::setupCompleteChangedTriggerList(void) const
QStringList triggers;
triggers << "CAL_MAG0_ID" << "CAL_GYRO0_ID" << "CAL_ACC0_ID";
if (_uas->getSystemType() == MAV_TYPE_FIXED_WING ||
_uas->getSystemType() == MAV_TYPE_VTOL_DUOROTOR ||
_uas->getSystemType() == MAV_TYPE_VTOL_QUADROTOR ||
_uas->getSystemType() == MAV_TYPE_VTOL_TILTROTOR) {
triggers << "SENS_DPRES_OFF";
switch (_vehicle->vehicleType()) {
case MAV_TYPE_FIXED_WING:
case MAV_TYPE_VTOL_DUOROTOR:
case MAV_TYPE_VTOL_QUADROTOR:
case MAV_TYPE_VTOL_TILTROTOR:
triggers << "SENS_DPRES_OFF";
break;
default:
break;
}
return triggers;
......@@ -115,13 +119,16 @@ QUrl SensorsComponent::summaryQmlSource(void) const
{
QString summaryQml;
if (_uas->getSystemType() == MAV_TYPE_FIXED_WING ||
_uas->getSystemType() == MAV_TYPE_VTOL_DUOROTOR ||
_uas->getSystemType() == MAV_TYPE_VTOL_QUADROTOR ||
_uas->getSystemType() == MAV_TYPE_VTOL_TILTROTOR) {
summaryQml = "qrc:/qml/SensorsComponentSummaryFixedWing.qml";
} else {
summaryQml = "qrc:/qml/SensorsComponentSummary.qml";
switch (_vehicle->vehicleType()) {
case MAV_TYPE_FIXED_WING:
case MAV_TYPE_VTOL_DUOROTOR:
case MAV_TYPE_VTOL_QUADROTOR:
case MAV_TYPE_VTOL_TILTROTOR:
summaryQml = "qrc:/qml/SensorsComponentSummaryFixedWing.qml";
break;
default:
summaryQml = "qrc:/qml/SensorsComponentSummary.qml";
break;
}
return QUrl::fromUserInput(summaryQml);
......
......@@ -35,7 +35,7 @@ class SensorsComponent : public PX4Component
Q_OBJECT
public:
SensorsComponent(UASInterface* uas, AutoPilotPlugin* autopilot, QObject* parent = NULL);
SensorsComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
// Virtuals from PX4Component
virtual QStringList setupCompleteChangedTriggerList(void) const;
......
......@@ -445,12 +445,15 @@ void SensorsComponentController::_refreshParams(void)
bool SensorsComponentController::fixedWing(void)
{
UASInterface* uas = _autopilot->vehicle()->uas();
Q_ASSERT(uas);
return uas->getSystemType() == MAV_TYPE_FIXED_WING ||
uas->getSystemType() == MAV_TYPE_VTOL_DUOROTOR ||
uas->getSystemType() == MAV_TYPE_VTOL_QUADROTOR ||
uas->getSystemType() == MAV_TYPE_VTOL_TILTROTOR;
switch (_vehicle->vehicleType()) {
case MAV_TYPE_FIXED_WING:
case MAV_TYPE_VTOL_DUOROTOR:
case MAV_TYPE_VTOL_QUADROTOR:
case MAV_TYPE_VTOL_TILTROTOR:
return true;
default:
return false;
}
}
void SensorsComponentController::_updateAndEmitShowOrientationCalArea(bool show)
......
......@@ -708,9 +708,9 @@ QString ParameterLoader::readParametersFromStream(QTextStream& stream)
return errors;
}
void ParameterLoader::writeParametersToStream(QTextStream &stream, const QString& name)
void ParameterLoader::writeParametersToStream(QTextStream &stream)
{
stream << "# Onboard parameters for system " << name << "\n";
stream << "# Onboard parameters for vehicle " << _vehicle->id() << "\n";
stream << "#\n";
stream << "# MAV ID COMPONENT ID PARAM NAME VALUE (FLOAT)\n";
......
......@@ -85,7 +85,7 @@ public:
/// Returns error messages from loading
QString readParametersFromStream(QTextStream& stream);
void writeParametersToStream(QTextStream &stream, const QString& name);
void writeParametersToStream(QTextStream &stream);
signals:
/// Signalled when the full set of facts are ready
......
......@@ -97,6 +97,8 @@ void APMParameterMetaData::_loadParameterFactMetaData(void)
/// Override from FactLoad which connects the meta data to the fact
void APMParameterMetaData::addMetaDataToFact(Fact* fact)
{
_loadParameterFactMetaData();
// FIXME: Will need to switch here based on _vehicle->firmwareType() to pull right set of meta data
FactMetaData* metaData = new FactMetaData(fact->type(), fact);
......
......@@ -27,9 +27,8 @@
#include "ArduCopterFirmwarePlugin.h"
#include "Generic/GenericFirmwarePlugin.h"
IMPLEMENT_QGC_SINGLETON(ArduCopterFirmwarePlugin, ArduCopterFirmwarePlugin)
APMCopterMode::APMCopterMode(uint32_t mode, bool settable) : APMCustomMode(mode, settable)
APMCopterMode::APMCopterMode(uint32_t mode, bool settable) :
APMCustomMode(mode, settable)
{
QMap<uint32_t,QString> enumToString;
enumToString.insert(STABILIZE, "Stabilize");
......
......@@ -61,16 +61,9 @@ public:
class ArduCopterFirmwarePlugin : public APMFirmwarePlugin
{
Q_OBJECT
DECLARE_QGC_SINGLETON(ArduCopterFirmwarePlugin, ArduCopterFirmwarePlugin)
public:
protected:
/// All access to singleton is through instance()
ArduCopterFirmwarePlugin(void);
private:
};
#endif
......@@ -27,9 +27,8 @@
#include "ArduPlaneFirmwarePlugin.h"
#include "Generic/GenericFirmwarePlugin.h"
IMPLEMENT_QGC_SINGLETON(ArduPlaneFirmwarePlugin, ArduPlaneFirmwarePlugin)
APMPlaneMode::APMPlaneMode(uint32_t mode, bool settable) : APMCustomMode(mode, settable)
APMPlaneMode::APMPlaneMode(uint32_t mode, bool settable)
: APMCustomMode(mode, settable)
{
QMap<uint32_t,QString> enumToString;
enumToString.insert(MANUAL, "Manual");
......
......@@ -59,16 +59,9 @@ public:
class ArduPlaneFirmwarePlugin : public APMFirmwarePlugin
{
Q_OBJECT
DECLARE_QGC_SINGLETON(ArduPlaneFirmwarePlugin, ArduPlaneFirmwarePlugin)
public:
protected:
/// All access to singleton is through instance()
ArduPlaneFirmwarePlugin(void);
private:
};
#endif
......@@ -27,9 +27,8 @@
#include "ArduRoverFirmwarePlugin.h"
#include "Generic/GenericFirmwarePlugin.h"
IMPLEMENT_QGC_SINGLETON(ArduRoverFirmwarePlugin, ArduRoverFirmwarePlugin)
APMRoverMode::APMRoverMode(uint32_t mode, bool settable) : APMCustomMode(mode, settable)
APMRoverMode::APMRoverMode(uint32_t mode, bool settable)
: APMCustomMode(mode, settable)
{
QMap<uint32_t,QString> enumToString;
enumToString.insert(MANUAL, "Manual");
......
......@@ -59,16 +59,9 @@ public:
class ArduRoverFirmwarePlugin : public APMFirmwarePlugin
{
Q_OBJECT
DECLARE_QGC_SINGLETON(ArduRoverFirmwarePlugin, ArduRoverFirmwarePlugin)
public:
protected:
/// All access to singleton is through instance()
ArduRoverFirmwarePlugin(void);
private:
};
#endif
......@@ -27,7 +27,6 @@
#ifndef FirmwarePlugin_H
#define FirmwarePlugin_H
#include "QGCSingleton.h"
#include "QGCMAVLink.h"
#include "VehicleComponent.h"
#include "AutoPilotPlugin.h"
......@@ -46,7 +45,7 @@ class Vehicle;
/// in the base class supports mavlink generic firmware. Override the base clase virtuals
/// to create you firmware specific plugin.
class FirmwarePlugin : public QGCSingleton
class FirmwarePlugin : public QObject
{
Q_OBJECT
......@@ -110,9 +109,6 @@ public:
/// Adds the parameter meta data to the Fact
virtual void addMetaDataToFact(Fact* fact) = 0;
protected:
FirmwarePlugin(void) { };
};
#endif
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
......@@ -31,51 +31,67 @@
#include "APM/ArduRoverFirmwarePlugin.h"
#include "PX4/PX4FirmwarePlugin.h"
FirmwarePluginManager::FirmwarePluginManager(QGCApplication* app)
: QGCTool(app)
, _arduCopterFirmwarePlugin(NULL)
, _arduPlaneFirmwarePlugin(NULL)
, _arduRoverFirmwarePlugin(NULL)
, _genericFirmwarePlugin(NULL)
, _px4FirmwarePlugin(NULL)
{
}
FirmwarePluginManager::~FirmwarePluginManager()
{
delete _arduCopterFirmwarePlugin;
delete _arduPlaneFirmwarePlugin;
delete _arduRoverFirmwarePlugin;
delete _genericFirmwarePlugin;
delete _px4FirmwarePlugin;
}
FirmwarePlugin* FirmwarePluginManager::firmwarePluginForAutopilot(MAV_AUTOPILOT autopilotType, MAV_TYPE vehicleType)
{
switch (autopilotType) {
case MAV_AUTOPILOT_ARDUPILOTMEGA:
switch (vehicleType) {
case MAV_TYPE_QUADROTOR:
case MAV_TYPE_HEXAROTOR:
case MAV_TYPE_OCTOROTOR:
case MAV_TYPE_TRICOPTER:
case MAV_TYPE_COAXIAL:
case MAV_TYPE_HELICOPTER:
return ArduCopterFirmwarePlugin::instance();
break;
case MAV_TYPE_FIXED_WING:
return ArduPlaneFirmwarePlugin::instance();
break;
case MAV_TYPE_GROUND_ROVER:
case MAV_TYPE_SURFACE_BOAT:
case MAV_TYPE_SUBMARINE:
return ArduRoverFirmwarePlugin::instance();
break;
case MAV_TYPE_GENERIC:
case MAV_TYPE_ANTENNA_TRACKER:
case MAV_TYPE_GCS:
case MAV_TYPE_AIRSHIP:
case MAV_TYPE_FREE_BALLOON:
case MAV_TYPE_ROCKET:
case MAV_TYPE_FLAPPING_WING:
case MAV_TYPE_KITE:
case MAV_TYPE_ONBOARD_CONTROLLER:
case MAV_TYPE_VTOL_DUOROTOR:
case MAV_TYPE_VTOL_QUADROTOR:
case MAV_TYPE_VTOL_TILTROTOR:
case MAV_TYPE_VTOL_RESERVED2:
case MAV_TYPE_VTOL_RESERVED3:
case MAV_TYPE_VTOL_RESERVED4:
case MAV_TYPE_VTOL_RESERVED5:
case MAV_TYPE_GIMBAL:
default:
return GenericFirmwarePlugin::instance();
break;