Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
ba0b0faf
Commit
ba0b0faf
authored
9 years ago
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MockLink is part of all debug builds
parent
5c4d513d
master
dev1
merge_branch_alt
original
phil
rc1
No related merge requests found
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
24 additions
and
28 deletions
+24
-28
QGCApplication.pro
QGCApplication.pro
+12
-4
qgroundcontrol.qrc
qgroundcontrol.qrc
+1
-1
LinkConfiguration.cc
src/comm/LinkConfiguration.cc
+3
-9
LinkConfiguration.h
src/comm/LinkConfiguration.h
+1
-1
LinkManager.cc
src/comm/LinkManager.cc
+2
-6
LinkManager.h
src/comm/LinkManager.h
+1
-3
MockLink.cc
src/comm/MockLink.cc
+0
-0
MockLink.h
src/comm/MockLink.h
+0
-0
MockLink.params
src/comm/MockLink.params
+0
-0
MockLinkMissionItemHandler.cc
src/comm/MockLinkMissionItemHandler.cc
+0
-0
MockLinkMissionItemHandler.h
src/comm/MockLinkMissionItemHandler.h
+0
-0
QGCCommConfiguration.cc
src/ui/QGCCommConfiguration.cc
+2
-2
QGCCommConfiguration.h
src/ui/QGCCommConfiguration.h
+1
-1
QGCLinkConfiguration.cc
src/ui/QGCLinkConfiguration.cc
+1
-1
No files found.
QGCApplication.pro
View file @
ba0b0faf
...
...
@@ -357,6 +357,12 @@ HEADERS += \
src
/
ViewWidgets
/
ViewWidgetController
.
h
\
src
/
Waypoint
.
h
\
DebugBuild
{
HEADERS
+=
\
src
/
comm
/
MockLink
.
h
\
src
/
comm
/
MockLinkMissionItemHandler
.
h
}
!
AndroidBuild
{
HEADERS
+=
\
src
/
input
/
JoystickInput
.
h
\
...
...
@@ -486,6 +492,12 @@ SOURCES += \
src
/
ViewWidgets
/
ViewWidgetController
.
cc
\
src
/
Waypoint
.
cc
\
DebugBuild
{
SOURCES
+=
\
src
/
comm
/
MockLink
.
cc
\
src
/
comm
/
MockLinkMissionItemHandler
.
cc
}
!
AndroidBuild
{
SOURCES
+=
\
src
/
input
/
JoystickInput
.
cc
\
...
...
@@ -529,8 +541,6 @@ HEADERS += \
src
/
qgcunittest
/
MainWindowTest
.
h
\
src
/
qgcunittest
/
MavlinkLogTest
.
h
\
src
/
qgcunittest
/
MessageBoxTest
.
h
\
src
/
qgcunittest
/
MockLink
.
h
\
src
/
qgcunittest
/
MockLinkMissionItemHandler
.
h
\
src
/
qgcunittest
/
PX4RCCalibrationTest
.
h
\
src
/
qgcunittest
/
UnitTest
.
h
\
src
/
VehicleSetup
/
SetupViewTest
.
h
\
...
...
@@ -549,8 +559,6 @@ SOURCES += \
src
/
qgcunittest
/
MainWindowTest
.
cc
\
src
/
qgcunittest
/
MavlinkLogTest
.
cc
\
src
/
qgcunittest
/
MessageBoxTest
.
cc
\
src
/
qgcunittest
/
MockLink
.
cc
\
src
/
qgcunittest
/
MockLinkMissionItemHandler
.
cc
\
src
/
qgcunittest
/
PX4RCCalibrationTest
.
cc
\
src
/
qgcunittest
/
UnitTest
.
cc
\
src
/
VehicleSetup
/
SetupViewTest
.
cc
\
...
...
This diff is collapsed.
Click to expand it.
qgroundcontrol.qrc
View file @
ba0b0faf
<RCC>
<qresource prefix="/unittest">
<file alias="MockLink.params">src/
qgcunittest
/MockLink.params</file>
<file alias="MockLink.params">src/
comm
/MockLink.params</file>
<file alias="FactSystemTest.qml">src/FactSystem/FactSystemTest.qml</file>
</qresource>
...
...
This diff is collapsed.
Click to expand it.
src/comm/LinkConfiguration.cc
View file @
ba0b0faf
...
...
@@ -32,11 +32,9 @@ This file is part of the QGROUNDCONTROL project
#include "UDPLink.h"
#include "TCPLink.h"
#ifdef UNITTEST_BUILD
#ifndef __android__
#ifdef QT_DEBUG
#include "MockLink.h"
#endif
#endif
#define LINK_SETTING_ROOT "LinkConfigurations"
...
...
@@ -93,12 +91,10 @@ LinkConfiguration* LinkConfiguration::createSettings(int type, const QString& na
case
LinkConfiguration
:
:
TypeTcp
:
config
=
new
TCPConfiguration
(
name
);
break
;
#ifdef UNITTEST_BUILD
#ifndef __android__
#ifdef QT_DEBUG
case
LinkConfiguration
:
:
TypeMock
:
config
=
new
MockConfiguration
(
name
);
break
;
#endif
#endif
}
return
config
;
...
...
@@ -121,12 +117,10 @@ LinkConfiguration* LinkConfiguration::duplicateSettings(LinkConfiguration* sourc
case
TypeTcp
:
dupe
=
new
TCPConfiguration
(
dynamic_cast
<
TCPConfiguration
*>
(
source
));
break
;
#ifdef UNITTEST_BUILD
#ifndef __android__
#ifdef QT_DEBUG
case
TypeMock
:
dupe
=
new
MockConfiguration
(
dynamic_cast
<
MockConfiguration
*>
(
source
));
break
;
#endif
#endif
}
return
dupe
;
...
...
This diff is collapsed.
Click to expand it.
src/comm/LinkConfiguration.h
View file @
ba0b0faf
...
...
@@ -49,7 +49,7 @@ public:
TypeXbee, ///< XBee Proprietary Link
TypeOpal, ///< Opal-RT Link
#endif
#ifdef
UNITTEST_BUILD
#ifdef
QT_DEBUG
TypeMock
,
///< Mock Link for Unitesting
#endif
TypeLast
// Last type value (type >= TypeLast == invalid)
...
...
This diff is collapsed.
Click to expand it.
src/comm/LinkManager.cc
View file @
ba0b0faf
...
...
@@ -88,12 +88,10 @@ LinkInterface* LinkManager::createConnectedLink(LinkConfiguration* config)
case
LinkConfiguration
:
:
TypeTcp
:
pLink
=
new
TCPLink
(
dynamic_cast
<
TCPConfiguration
*>
(
config
));
break
;
#ifdef UNITTEST_BUILD
#ifndef __android__
#ifdef QT_DEBUG
case
LinkConfiguration
:
:
TypeMock
:
pLink
=
new
MockLink
(
dynamic_cast
<
MockConfiguration
*>
(
config
));
break
;
#endif
#endif
}
if
(
pLink
)
{
...
...
@@ -384,13 +382,11 @@ void LinkManager::loadLinkConfigurationList()
pLink
=
(
LinkConfiguration
*
)
new
TCPConfiguration
(
name
);
pLink
->
setPreferred
(
preferred
);
break
;
#ifdef UNITTEST_BUILD
#ifndef __android__
#ifdef QT_DEBUG
case
LinkConfiguration
:
:
TypeMock
:
pLink
=
(
LinkConfiguration
*
)
new
MockConfiguration
(
name
);
pLink
->
setPreferred
(
false
);
break
;
#endif
#endif
}
if
(
pLink
)
{
...
...
This diff is collapsed.
Click to expand it.
src/comm/LinkManager.h
View file @
ba0b0faf
...
...
@@ -39,11 +39,9 @@ This file is part of the PIXHAWK project
#include "UDPLink.h"
#include "TCPLink.h"
#ifdef UNITTEST_BUILD
#ifndef __android__
#ifdef QT_DEBUG
#include "MockLink.h"
#endif
#endif
#include "ProtocolInterface.h"
#include "QGCSingleton.h"
...
...
This diff is collapsed.
Click to expand it.
src/
qgcunittest
/MockLink.cc
→
src/
comm
/MockLink.cc
View file @
ba0b0faf
File moved
This diff is collapsed.
Click to expand it.
src/
qgcunittest
/MockLink.h
→
src/
comm
/MockLink.h
View file @
ba0b0faf
File moved
This diff is collapsed.
Click to expand it.
src/
qgcunittest
/MockLink.params
→
src/
comm
/MockLink.params
View file @
ba0b0faf
File moved
This diff is collapsed.
Click to expand it.
src/
qgcunittest
/MockLinkMissionItemHandler.cc
→
src/
comm
/MockLinkMissionItemHandler.cc
View file @
ba0b0faf
File moved
This diff is collapsed.
Click to expand it.
src/
qgcunittest
/MockLinkMissionItemHandler.h
→
src/
comm
/MockLinkMissionItemHandler.h
View file @
ba0b0faf
File moved
This diff is collapsed.
Click to expand it.
src/ui/QGCCommConfiguration.cc
View file @
ba0b0faf
...
...
@@ -48,7 +48,7 @@ QGCCommConfiguration::QGCCommConfiguration(QWidget *parent, LinkConfiguration *c
_ui
->
typeCombo
->
addItem
(
tr
(
"Serial"
),
LinkConfiguration
::
TypeSerial
);
_ui
->
typeCombo
->
addItem
(
tr
(
"UDP"
),
LinkConfiguration
::
TypeUdp
);
_ui
->
typeCombo
->
addItem
(
tr
(
"TCP"
),
LinkConfiguration
::
TypeTcp
);
#ifdef
UNITTEST_BUILD
#ifdef
QT_DEBUG
_ui
->
typeCombo
->
addItem
(
tr
(
"Mock"
),
LinkConfiguration
::
TypeMock
);
#endif
...
...
@@ -134,7 +134,7 @@ void QGCCommConfiguration::_loadTypeConfigWidget(int type)
_ui
->
typeCombo
->
setCurrentIndex
(
_ui
->
typeCombo
->
findData
(
LinkConfiguration
::
TypeTcp
));
}
break
;
#ifdef
UNITTEST_BUILD
#ifdef
QT_DEBUG
case
LinkConfiguration
:
:
TypeMock
:
{
_ui
->
linkScrollArea
->
setWidget
(
NULL
);
_ui
->
linkGroupBox
->
setTitle
(
tr
(
"Mock Link"
));
...
...
This diff is collapsed.
Click to expand it.
src/ui/QGCCommConfiguration.h
View file @
ba0b0faf
...
...
@@ -54,7 +54,7 @@ public:
QGC_LINK_TCP
,
QGC_LINK_SIMULATION
,
QGC_LINK_FORWARDING
,
#ifdef
UNITTEST_BUILD
#ifdef
QT_DEBUG
QGC_LINK_MOCK
,
#endif
#ifdef QGC_XBEE_ENABLED
...
...
This diff is collapsed.
Click to expand it.
src/ui/QGCLinkConfiguration.cc
View file @
ba0b0faf
...
...
@@ -158,7 +158,7 @@ void QGCLinkConfiguration::_fixUnnamed(LinkConfiguration* config)
}
}
break
;
#ifdef
UNITTEST_BUILD
#ifdef
QT_DEBUG
case
LinkConfiguration
:
:
TypeMock
:
config
->
setName
(
QString
(
"Mock Link"
));
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment