Commit 0ce6d773 authored by Don Gagne's avatar Don Gagne
Browse files

Allows QGC plugins to be optional or custom

parent d662b4da
......@@ -31,7 +31,6 @@ class UASInterface;
class FirmwarePlugin;
class FirmwarePluginManager;
class AutoPilotPlugin;
class AutoPilotPluginManager;
class MissionManager;
class GeoFenceManager;
class RallyPointManager;
......@@ -214,7 +213,6 @@ public:
MAV_AUTOPILOT firmwareType,
MAV_TYPE vehicleType,
FirmwarePluginManager* firmwarePluginManager,
AutoPilotPluginManager* autopilotPluginManager,
JoystickManager* joystickManager);
// The following is used to create a disconnected Vehicle for use while offline editing.
......@@ -579,6 +577,13 @@ public:
/// @return true: X confiuration, false: Plus configuration
bool xConfigMotors(void);
/// @return Firmware plugin instance data associated with this Vehicle
QObject* firmwarePluginInstanceData(void) { return _firmwarePluginInstanceData; }
/// Sets the firmware plugin instance data associated with this Vehicle. This object will be parented to the Vehicle
/// and destroyed when the vehicle goes away.
void setFirmwarePluginInstanceData(QObject* firmwarePluginInstanceData);
public slots:
void setLatitude(double latitude);
void setLongitude(double longitude);
......@@ -717,6 +722,7 @@ private:
MAV_AUTOPILOT _firmwareType;
MAV_TYPE _vehicleType;
FirmwarePlugin* _firmwarePlugin;
QObject* _firmwarePluginInstanceData;
AutoPilotPlugin* _autopilotPlugin;
MAVLinkProtocol* _mavlink;
bool _soloFirmware;
......@@ -806,7 +812,6 @@ private:
// Toolbox references
FirmwarePluginManager* _firmwarePluginManager;
AutoPilotPluginManager* _autopilotPluginManager;
JoystickManager* _joystickManager;
int _flowImageIndex;
......
......@@ -11,8 +11,9 @@
#include "MockLink.h"
#include "QGCLoggingCategory.h"
#include "QGCApplication.h"
#ifndef __mobile__
#include "UnitTest.h"
#ifdef UNITTEST_BUILD
#include "UnitTest.h"
#endif
#include <QTimer>
......@@ -21,7 +22,8 @@
#include <string.h>
#include "px4_custom_mode.h"
// FIXME: Hack to work around clean headers
#include "FirmwarePlugin/PX4/px4_custom_mode.h"
QGC_LOGGING_CATEGORY(MockLinkLog, "MockLinkLog")
QGC_LOGGING_CATEGORY(MockLinkVerboseLog, "MockLinkVerboseLog")
......@@ -1159,7 +1161,7 @@ void MockLink::_handleLogRequestData(const mavlink_message_t& msg)
mavlink_msg_log_request_data_decode(&msg, &request);
if (_logDownloadFilename.isEmpty()) {
#ifndef __mobile__
#ifdef UNITTEST_BUILD
_logDownloadFilename = UnitTest::createRandomFile(_logDownloadFileSize);
#endif
}
......
......@@ -33,10 +33,11 @@
#include "QGCSerialPortInfo.h"
#endif
#ifdef QT_DEBUG
#ifndef __mobile__
#ifdef UNITTEST_BUILD
#include "UnitTest.h"
#endif
#endif
#ifdef QT_DEBUG
#include "CmdLineOptParser.h"
#ifdef Q_OS_WIN
#include <crtdbg.h>
......@@ -229,8 +230,7 @@ int main(int argc, char *argv[])
int exitCode = 0;
#ifndef __mobile__
#ifdef QT_DEBUG
#ifdef UNITTEST_BUILD
if (runUnitTests) {
for (int i=0; i < (stressUnitTests ? 20 : 1); i++) {
if (!app->_initForUnitTests()) {
......@@ -249,7 +249,6 @@ int main(int argc, char *argv[])
}
}
} else
#endif
#endif
{
if (!app->_initForNormalAppBoot()) {
......
Supports Markdown
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