Skip to content

Commit

Permalink
Work on QGC plugin support
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmaphobic committed Nov 27, 2016
1 parent c54482a commit dce4379
Show file tree
Hide file tree
Showing 13 changed files with 579 additions and 298 deletions.
26 changes: 26 additions & 0 deletions android.pri
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
include($$PWD/libs/qtandroidserialport/src/qtandroidserialport.pri)
message("Adding Serial Java Classes")
QT += androidextras
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
OTHER_FILES += \
$$PWD/android/AndroidManifest.xml \
$$PWD/android/res/xml/device_filter.xml \
$$PWD/android/src/com/hoho/android/usbserial/driver/CdcAcmSerialDriver.java \
$$PWD/android/src/com/hoho/android/usbserial/driver/CommonUsbSerialDriver.java \
$$PWD/android/src/com/hoho/android/usbserial/driver/Cp2102SerialDriver.java \
$$PWD/android/src/com/hoho/android/usbserial/driver/FtdiSerialDriver.java \
$$PWD/android/src/com/hoho/android/usbserial/driver/ProlificSerialDriver.java \
$$PWD/android/src/com/hoho/android/usbserial/driver/UsbId.java \
$$PWD/android/src/com/hoho/android/usbserial/driver/UsbSerialDriver.java \
$$PWD/android/src/com/hoho/android/usbserial/driver/UsbSerialProber.java \
$$PWD/android/src/com/hoho/android/usbserial/driver/UsbSerialRuntimeException.java \
$$PWD/android/src/org/qgroundcontrol/qgchelper/UsbDeviceJNI.java \
$$PWD/android/src/org/qgroundcontrol/qgchelper/UsbIoManager.java

DISTFILES += \
$$PWD/android/gradle/wrapper/gradle-wrapper.jar \
$$PWD/android/gradlew \
$$PWD/android/res/values/libs.xml \
$$PWD/android/build.gradle \
$$PWD/android/gradle/wrapper/gradle-wrapper.properties \
$$PWD/android/gradlew.bat
24 changes: 24 additions & 0 deletions api/IQGCApplication.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/


/**
* @brief QGC Main Application Interface (used for Dynamic Loaded plugins)
* @author Gus Grubba <[email protected]>
*/

#pragma once

class IQGCApplication
{
public:
IQGCApplication() {}
virtual ~IQGCApplication() {}
//-- Not yet implemented
};
33 changes: 33 additions & 0 deletions api/IQGCCorePlugin.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#pragma once

#include <QObject>

/// @file
/// @brief Core Plugin Interface for QGroundControl
/// @author Gus Grubba <[email protected]>

// Work In Progress

class QGCApplication;
class IQGCApplication;
class IQGCOptions;
class IQGCQMLSource;

class IQGCCorePlugin
{
public:
IQGCCorePlugin(QObject*) {}
virtual ~IQGCCorePlugin() {}

#if defined (QGC_DYNAMIC_PLUGIN)
virtual bool init (IQGCApplication* pApp) = 0;
#else
virtual bool init (QGCApplication* pApp) = 0;
#endif
virtual IQGCOptions* uiOptions () { return NULL; }
virtual IQGCQMLSource* settingsQML () { return NULL; }
};

#if defined (QGC_DYNAMIC_PLUGIN)
Q_DECLARE_INTERFACE(IQGCCorePlugin, "org.qgroundcontrol.qgccoreplugin")
#endif
52 changes: 52 additions & 0 deletions api/IQGCOptions.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#pragma once

/// @file
/// @brief Core Plugin Interface for QGroundControl
/// @author Gus Grubba <[email protected]>

class IQGCOptions
{
public:
IQGCOptions() {}
virtual ~IQGCOptions() {}
//! Should QGC colapse its settings menu into one single menu (Settings and Vehicle Setup)?
/*!
@return true if QGC should consolidate both menus into one.
*/
virtual bool colapseSettings () { return false; }
//! Should QGC use Maps as its default main view?
/*!
@return true if QGC should use Maps by default or false to show Video by default.
*/
virtual bool mainViewIsMap () { return true; }
//! Should QGC use virtual Joysticks?
/*!
@return false to disable Virtual Joysticks.
*/
virtual bool enableVirtualJoystick () { return true; }
//! Should QGC allow setting auto-connect options?
/*!
@return false to disable auto-connect options.
*/
virtual bool enableAutoConnectOptions () { return true; }
//! Should QGC allow setting video source options?
/*!
@return false to disable video source options.
*/
virtual bool enableVideoSourceOptions () { return true; }
//! Does your plugin defines its on video source?
/*!
@return true to define your own video source.
*/
virtual bool definesVideo () { return false; }
//! UDP port to use for (RTP) video source.
/*!
@return UDP Port to use. Return 0 to disable UDP RTP.
*/
virtual uint16_t videoUDPPort () { return 0; }
//! RTSP URL to use for video source.
/*!
@return RTSP url to use. Return "" to disable RTSP.
*/
virtual QString videoRSTPUrl () { return QString(); }
};
17 changes: 17 additions & 0 deletions api/IQGCQMLSource.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once

#include <QString>

/// @file
/// @brief Core Plugin Interface for QGroundControl
/// @author Gus Grubba <[email protected]>

class IQGCQMLSource
{
public:
IQGCQMLSource() {}
virtual ~IQGCQMLSource() {}
virtual QString pageUrl () { return QString(); }
virtual QString pageTitle () { return QString(); }
virtual QString pageIconUrl () { return QString(); }
};
40 changes: 40 additions & 0 deletions apmresources.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<RCC>
<qresource prefix="/unittest">
<file alias="APMArduCopterMockLink.params">src/comm/APMArduCopterMockLink.params</file>
<file alias="APMArduPlaneMockLink.params">src/comm/APMArduPlaneMockLink.params</file>
<file alias="APMArduSubMockLink.params">src/comm/APMArduSubMockLink.params</file>
</qresource>
<qresource prefix="/qml">
<file alias="APMAirframeComponent.qml">src/AutoPilotPlugins/APM/APMAirframeComponent.qml</file>
<file alias="APMAirframeComponentSummary.qml">src/AutoPilotPlugins/APM/APMAirframeComponentSummary.qml</file>
<file alias="APMCameraComponent.qml">src/AutoPilotPlugins/APM/APMCameraComponent.qml</file>
<file alias="APMCameraComponentSummary.qml">src/AutoPilotPlugins/APM/APMCameraComponentSummary.qml</file>
<file alias="APMFlightModesComponent.qml">src/AutoPilotPlugins/APM/APMFlightModesComponent.qml</file>
<file alias="APMFlightModesComponentSummary.qml">src/AutoPilotPlugins/APM/APMFlightModesComponentSummary.qml</file>
<file alias="APMLightsComponent.qml">src/AutoPilotPlugins/APM/APMLightsComponent.qml</file>
<file alias="APMLightsComponentSummary.qml">src/AutoPilotPlugins/APM/APMLightsComponentSummary.qml</file>
<file alias="APMNotSupported.qml">src/AutoPilotPlugins/APM/APMNotSupported.qml</file>
<file alias="APMPowerComponent.qml">src/AutoPilotPlugins/APM/APMPowerComponent.qml</file>
<file alias="APMPowerComponentSummary.qml">src/AutoPilotPlugins/APM/APMPowerComponentSummary.qml</file>
<file alias="APMRadioComponentSummary.qml">src/AutoPilotPlugins/APM/APMRadioComponentSummary.qml</file>
<file alias="APMSafetyComponentCopter.qml">src/AutoPilotPlugins/APM/APMSafetyComponentCopter.qml</file>
<file alias="APMSafetyComponentPlane.qml">src/AutoPilotPlugins/APM/APMSafetyComponentPlane.qml</file>
<file alias="APMSafetyComponentRover.qml">src/AutoPilotPlugins/APM/APMSafetyComponentRover.qml</file>
<file alias="APMSafetyComponentSub.qml">src/AutoPilotPlugins/APM/APMSafetyComponentSub.qml</file>
<file alias="APMSafetyComponentSummaryCopter.qml">src/AutoPilotPlugins/APM/APMSafetyComponentSummaryCopter.qml</file>
<file alias="APMSafetyComponentSummaryPlane.qml">src/AutoPilotPlugins/APM/APMSafetyComponentSummaryPlane.qml</file>
<file alias="APMSafetyComponentSummaryRover.qml">src/AutoPilotPlugins/APM/APMSafetyComponentSummaryRover.qml</file>
<file alias="APMSafetyComponentSummarySub.qml">src/AutoPilotPlugins/APM/APMSafetyComponentSummarySub.qml</file>
<file alias="APMSensorsComponent.qml">src/AutoPilotPlugins/APM/APMSensorsComponent.qml</file>
<file alias="APMSensorsComponentSummary.qml">src/AutoPilotPlugins/APM/APMSensorsComponentSummary.qml</file>
<file alias="APMTuningComponentCopter.qml">src/AutoPilotPlugins/APM/APMTuningComponentCopter.qml</file>
</qresource>
<qresource prefix="/json">
<file alias="APM/MavCmdInfoCommon.json">src/FirmwarePlugin/APM/MavCmdInfoCommon.json</file>
<file alias="APM/MavCmdInfoFixedWing.json">src/FirmwarePlugin/APM/MavCmdInfoFixedWing.json</file>
<file alias="APM/MavCmdInfoMultiRotor.json">src/FirmwarePlugin/APM/MavCmdInfoMultiRotor.json</file>
<file alias="APM/MavCmdInfoRover.json">src/FirmwarePlugin/APM/MavCmdInfoRover.json</file>
<file alias="APM/MavCmdInfoSub.json">src/FirmwarePlugin/APM/MavCmdInfoSub.json</file>
<file alias="APM/MavCmdInfoVTOL.json">src/FirmwarePlugin/APM/MavCmdInfoVTOL.json</file>
</qresource>
</RCC>
23 changes: 23 additions & 0 deletions px4resources.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<RCC>
<qresource prefix="/unittest">
<file alias="PX4MockLink.params">src/comm/PX4MockLink.params</file>
</qresource>
<qresource prefix="/qml">
<file alias="PX4AdvancedFlightModes.qml">src/AutoPilotPlugins/PX4/PX4AdvancedFlightModes.qml</file>
<file alias="PX4FlightModes.qml">src/AutoPilotPlugins/PX4/PX4FlightModes.qml</file>
<file alias="PX4FlowSensor.qml">src/VehicleSetup/PX4FlowSensor.qml</file>
<file alias="PX4RadioComponentSummary.qml">src/AutoPilotPlugins/PX4/PX4RadioComponentSummary.qml</file>
<file alias="PX4SimpleFlightModes.qml">src/AutoPilotPlugins/PX4/PX4SimpleFlightModes.qml</file>
<file alias="PX4TuningComponentCopter.qml">src/AutoPilotPlugins/PX4/PX4TuningComponentCopter.qml</file>
<file alias="PX4TuningComponentPlane.qml">src/AutoPilotPlugins/PX4/PX4TuningComponentPlane.qml</file>
<file alias="PX4TuningComponentVTOL.qml">src/AutoPilotPlugins/PX4/PX4TuningComponentVTOL.qml</file>
</qresource>
<qresource prefix="/json">
<file alias="PX4/MavCmdInfoCommon.json">src/FirmwarePlugin/PX4/MavCmdInfoCommon.json</file>
<file alias="PX4/MavCmdInfoFixedWing.json">src/FirmwarePlugin/PX4/MavCmdInfoFixedWing.json</file>
<file alias="PX4/MavCmdInfoMultiRotor.json">src/FirmwarePlugin/PX4/MavCmdInfoMultiRotor.json</file>
<file alias="PX4/MavCmdInfoRover.json">src/FirmwarePlugin/PX4/MavCmdInfoRover.json</file>
<file alias="PX4/MavCmdInfoSub.json">src/FirmwarePlugin/PX4/MavCmdInfoSub.json</file>
<file alias="PX4/MavCmdInfoVTOL.json">src/FirmwarePlugin/PX4/MavCmdInfoVTOL.json</file>
</qresource>
</RCC>
Loading

0 comments on commit dce4379

Please sign in to comment.