Commit 7a15f9e1 authored by dogmaphobic's avatar dogmaphobic

Missed a few places where Mock Link had references on Release builds.

parent cb41567d
...@@ -188,7 +188,6 @@ FORMS += \ ...@@ -188,7 +188,6 @@ FORMS += \
src/QGCQmlWidgetHolder.ui \ src/QGCQmlWidgetHolder.ui \
src/ui/MainWindow.ui \ src/ui/MainWindow.ui \
src/ui/MAVLinkSettingsWidget.ui \ src/ui/MAVLinkSettingsWidget.ui \
src/ui/MockLinkConfiguration.ui \
src/ui/QGCCommConfiguration.ui \ src/ui/QGCCommConfiguration.ui \
src/ui/QGCLinkConfiguration.ui \ src/ui/QGCLinkConfiguration.ui \
src/ui/QGCMapRCToParamDialog.ui \ src/ui/QGCMapRCToParamDialog.ui \
...@@ -199,6 +198,11 @@ FORMS += \ ...@@ -199,6 +198,11 @@ FORMS += \
src/ui/uas/QGCUnconnectedInfoWidget.ui \ src/ui/uas/QGCUnconnectedInfoWidget.ui \
src/ui/uas/UASMessageView.ui \ src/ui/uas/UASMessageView.ui \
DebugBuild {
FORMS += \
src/ui/MockLinkConfiguration.ui \
}
!iOSBuild { !iOSBuild {
FORMS += \ FORMS += \
src/ui/SerialSettings.ui \ src/ui/SerialSettings.ui \
...@@ -231,9 +235,6 @@ HEADERS += \ ...@@ -231,9 +235,6 @@ HEADERS += \
src/comm/LinkInterface.h \ src/comm/LinkInterface.h \
src/comm/LinkManager.h \ src/comm/LinkManager.h \
src/comm/MAVLinkProtocol.h \ src/comm/MAVLinkProtocol.h \
src/comm/MockLink.h \
src/comm/MockLinkFileServer.h \
src/comm/MockLinkMissionItemHandler.h \
src/comm/ProtocolInterface.h \ src/comm/ProtocolInterface.h \
src/comm/QGCMAVLink.h \ src/comm/QGCMAVLink.h \
src/comm/TCPLink.h \ src/comm/TCPLink.h \
...@@ -278,7 +279,6 @@ HEADERS += \ ...@@ -278,7 +279,6 @@ HEADERS += \
src/ui/MainWindow.h \ src/ui/MainWindow.h \
src/ui/MAVLinkDecoder.h \ src/ui/MAVLinkDecoder.h \
src/ui/MAVLinkSettingsWidget.h \ src/ui/MAVLinkSettingsWidget.h \
src/ui/MockLinkConfiguration.h \
src/ui/QGCCommConfiguration.h \ src/ui/QGCCommConfiguration.h \
src/ui/QGCLinkConfiguration.h \ src/ui/QGCLinkConfiguration.h \
src/ui/QGCMapRCToParamDialog.h \ src/ui/QGCMapRCToParamDialog.h \
...@@ -292,6 +292,14 @@ HEADERS += \ ...@@ -292,6 +292,14 @@ HEADERS += \
src/AutoPilotPlugins/PX4/PX4AirframeLoader.h \ src/AutoPilotPlugins/PX4/PX4AirframeLoader.h \
src/QmlControls/QGCImageProvider.h \ src/QmlControls/QGCImageProvider.h \
DebugBuild {
HEADERS += \
src/comm/MockLink.h \
src/comm/MockLinkFileServer.h \
src/comm/MockLinkMissionItemHandler.h \
src/ui/MockLinkConfiguration.h \
}
WindowsBuild { WindowsBuild {
PRECOMPILED_HEADER += src/stable_headers.h PRECOMPILED_HEADER += src/stable_headers.h
HEADERS += src/stable_headers.h HEADERS += src/stable_headers.h
...@@ -349,9 +357,6 @@ SOURCES += \ ...@@ -349,9 +357,6 @@ SOURCES += \
src/comm/LinkConfiguration.cc \ src/comm/LinkConfiguration.cc \
src/comm/LinkManager.cc \ src/comm/LinkManager.cc \
src/comm/MAVLinkProtocol.cc \ src/comm/MAVLinkProtocol.cc \
src/comm/MockLink.cc \
src/comm/MockLinkFileServer.cc \
src/comm/MockLinkMissionItemHandler.cc \
src/comm/TCPLink.cc \ src/comm/TCPLink.cc \
src/comm/UDPLink.cc \ src/comm/UDPLink.cc \
src/FlightDisplay/FlightDisplayViewController.cc \ src/FlightDisplay/FlightDisplayViewController.cc \
...@@ -390,7 +395,6 @@ SOURCES += \ ...@@ -390,7 +395,6 @@ SOURCES += \
src/ui/MainWindow.cc \ src/ui/MainWindow.cc \
src/ui/MAVLinkDecoder.cc \ src/ui/MAVLinkDecoder.cc \
src/ui/MAVLinkSettingsWidget.cc \ src/ui/MAVLinkSettingsWidget.cc \
src/ui/MockLinkConfiguration.cc \
src/ui/QGCCommConfiguration.cc \ src/ui/QGCCommConfiguration.cc \
src/ui/QGCLinkConfiguration.cc \ src/ui/QGCLinkConfiguration.cc \
src/ui/QGCMapRCToParamDialog.cpp \ src/ui/QGCMapRCToParamDialog.cpp \
...@@ -404,6 +408,14 @@ SOURCES += \ ...@@ -404,6 +408,14 @@ SOURCES += \
src/AutoPilotPlugins/PX4/PX4AirframeLoader.cc \ src/AutoPilotPlugins/PX4/PX4AirframeLoader.cc \
src/QmlControls/QGCImageProvider.cc \ src/QmlControls/QGCImageProvider.cc \
DebugBuild {
SOURCES += \
src/comm/MockLink.cc \
src/comm/MockLinkFileServer.cc \
src/comm/MockLinkMissionItemHandler.cc \
src/ui/MockLinkConfiguration.cc \
}
!iOSBuild { !iOSBuild {
SOURCES += \ SOURCES += \
src/comm/QGCSerialPortInfo.cc \ src/comm/QGCSerialPortInfo.cc \
......
/*===================================================================== /*=====================================================================
QGroundControl Open Source Ground Control Station QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org> (c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful, QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>. along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/ ======================================================================*/
/// @file /// @file
...@@ -26,7 +26,9 @@ ...@@ -26,7 +26,9 @@
#include "FactSystemTestBase.h" #include "FactSystemTestBase.h"
#include "LinkManager.h" #include "LinkManager.h"
#ifdef QT_DEBUG
#include "MockLink.h" #include "MockLink.h"
#endif
#include "MultiVehicleManager.h" #include "MultiVehicleManager.h"
#include "QGCApplication.h" #include "QGCApplication.h"
#include "QGCMessageBox.h" #include "QGCMessageBox.h"
...@@ -37,15 +39,15 @@ ...@@ -37,15 +39,15 @@
/// FactSystem Unit Test /// FactSystem Unit Test
FactSystemTestBase::FactSystemTestBase(void) FactSystemTestBase::FactSystemTestBase(void)
{ {
} }
void FactSystemTestBase::_init(MAV_AUTOPILOT autopilot) void FactSystemTestBase::_init(MAV_AUTOPILOT autopilot)
{ {
UnitTest::init(); UnitTest::init();
_connectMockLink(autopilot); _connectMockLink(autopilot);
_plugin = qgcApp()->toolbox()->multiVehicleManager()->activeVehicle()->autopilotPlugin(); _plugin = qgcApp()->toolbox()->multiVehicleManager()->activeVehicle()->autopilotPlugin();
Q_ASSERT(_plugin); Q_ASSERT(_plugin);
} }
...@@ -63,7 +65,7 @@ void FactSystemTestBase::_parameter_default_component_id_test(void) ...@@ -63,7 +65,7 @@ void FactSystemTestBase::_parameter_default_component_id_test(void)
QVERIFY(fact != NULL); QVERIFY(fact != NULL);
QVariant factValue = fact->rawValue(); QVariant factValue = fact->rawValue();
QCOMPARE(factValue.isValid(), true); QCOMPARE(factValue.isValid(), true);
QCOMPARE(factValue.toInt(), 3); QCOMPARE(factValue.toInt(), 3);
} }
...@@ -74,17 +76,17 @@ void FactSystemTestBase::_parameter_specific_component_id_test(void) ...@@ -74,17 +76,17 @@ void FactSystemTestBase::_parameter_specific_component_id_test(void)
QVERIFY(fact != NULL); QVERIFY(fact != NULL);
QVariant factValue = fact->rawValue(); QVariant factValue = fact->rawValue();
QCOMPARE(factValue.isValid(), true); QCOMPARE(factValue.isValid(), true);
QCOMPARE(factValue.toInt(), 3); QCOMPARE(factValue.toInt(), 3);
// Test another component id // Test another component id
QVERIFY(_plugin->factExists(FactSystem::ParameterProvider, 51, "COMPONENT_51")); QVERIFY(_plugin->factExists(FactSystem::ParameterProvider, 51, "COMPONENT_51"));
fact = _plugin->getFact(FactSystem::ParameterProvider, 51, "COMPONENT_51"); fact = _plugin->getFact(FactSystem::ParameterProvider, 51, "COMPONENT_51");
QVERIFY(fact != NULL); QVERIFY(fact != NULL);
factValue = fact->rawValue(); factValue = fact->rawValue();
QCOMPARE(factValue.isValid(), true); QCOMPARE(factValue.isValid(), true);
QCOMPARE(factValue.toInt(), 51); QCOMPARE(factValue.toInt(), 51);
} }
...@@ -92,18 +94,18 @@ void FactSystemTestBase::_parameter_specific_component_id_test(void) ...@@ -92,18 +94,18 @@ void FactSystemTestBase::_parameter_specific_component_id_test(void)
void FactSystemTestBase::_qml_test(void) void FactSystemTestBase::_qml_test(void)
{ {
QGCQuickWidget* widget = new QGCQuickWidget; QGCQuickWidget* widget = new QGCQuickWidget;
widget->setAutoPilot(_plugin); widget->setAutoPilot(_plugin);
widget->setSource(QUrl::fromUserInput("qrc:unittest/FactSystemTest.qml")); widget->setSource(QUrl::fromUserInput("qrc:unittest/FactSystemTest.qml"));
QQuickItem* rootObject = widget->rootObject(); QQuickItem* rootObject = widget->rootObject();
QObject* control = rootObject->findChild<QObject*>("testControl"); QObject* control = rootObject->findChild<QObject*>("testControl");
QVERIFY(control != NULL); QVERIFY(control != NULL);
QVariant qmlValue = control->property("text").toInt(); QVariant qmlValue = control->property("text").toInt();
QCOMPARE(qmlValue.toInt(), 3); QCOMPARE(qmlValue.toInt(), 3);
delete widget; delete widget;
} }
...@@ -111,25 +113,25 @@ void FactSystemTestBase::_qml_test(void) ...@@ -111,25 +113,25 @@ void FactSystemTestBase::_qml_test(void)
void FactSystemTestBase::_qmlUpdate_test(void) void FactSystemTestBase::_qmlUpdate_test(void)
{ {
QGCQuickWidget* widget = new QGCQuickWidget; QGCQuickWidget* widget = new QGCQuickWidget;
widget->setAutoPilot(_plugin); widget->setAutoPilot(_plugin);
widget->setSource(QUrl::fromUserInput("qrc:unittest/FactSystemTest.qml")); widget->setSource(QUrl::fromUserInput("qrc:unittest/FactSystemTest.qml"));
// Change the value // Change the value
QVariant paramValue = 12; QVariant paramValue = 12;
_plugin->getParameterFact(FactSystem::defaultComponentId, "RC_MAP_THROTTLE")->setRawValue(paramValue); _plugin->getParameterFact(FactSystem::defaultComponentId, "RC_MAP_THROTTLE")->setRawValue(paramValue);
QTest::qWait(500); // Let the signals flow through QTest::qWait(500); // Let the signals flow through
// Make sure the qml has the right value // Make sure the qml has the right value
QQuickItem* rootObject = widget->rootObject(); QQuickItem* rootObject = widget->rootObject();
QObject* control = rootObject->findChild<QObject*>("testControl"); QObject* control = rootObject->findChild<QObject*>("testControl");
QVERIFY(control != NULL); QVERIFY(control != NULL);
QCOMPARE(control->property("text").toInt(), 12); QCOMPARE(control->property("text").toInt(), 12);
delete widget; delete widget;
} }
...@@ -36,7 +36,9 @@ This file is part of the QGROUNDCONTROL project ...@@ -36,7 +36,9 @@ This file is part of the QGROUNDCONTROL project
#endif #endif
#include "QGCUDPLinkConfiguration.h" #include "QGCUDPLinkConfiguration.h"
#include "QGCTCPLinkConfiguration.h" #include "QGCTCPLinkConfiguration.h"
#ifdef QT_DEBUG
#include "MockLinkConfiguration.h" #include "MockLinkConfiguration.h"
#endif
#ifndef __mobile__ #ifndef __mobile__
#include "LogReplayLinkConfigurationWidget.h" #include "LogReplayLinkConfigurationWidget.h"
#endif #endif
......
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