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
e4dcf8fe
Commit
e4dcf8fe
authored
Feb 13, 2015
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Argh... Forgot to test release after adding Mock Link.
parent
0a313314
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
1 deletion
+21
-1
LinkConfiguration.cc
src/comm/LinkConfiguration.cc
+7
-0
LinkConfiguration.h
src/comm/LinkConfiguration.h
+3
-1
LinkManager.cc
src/comm/LinkManager.cc
+4
-0
LinkManager.h
src/comm/LinkManager.h
+3
-0
QGCCommConfiguration.cc
src/ui/QGCCommConfiguration.cc
+2
-0
QGCLinkConfiguration.cc
src/ui/QGCLinkConfiguration.cc
+2
-0
No files found.
src/comm/LinkConfiguration.cc
View file @
e4dcf8fe
...
...
@@ -30,7 +30,10 @@ This file is part of the QGROUNDCONTROL project
#include "LinkConfiguration.h"
#include "SerialLink.h"
#include "UDPLink.h"
#ifdef UNITTEST_BUILD
#include "MockLink.h"
#endif
#define LINK_SETTING_ROOT "LinkConfigurations"
...
...
@@ -81,9 +84,11 @@ LinkConfiguration* LinkConfiguration::createSettings(int type, const QString& na
case
LinkConfiguration
:
:
TypeUdp
:
config
=
new
UDPConfiguration
(
name
);
break
;
#ifdef UNITTEST_BUILD
case
LinkConfiguration
:
:
TypeMock
:
config
=
new
MockConfiguration
(
name
);
break
;
#endif
}
return
config
;
}
...
...
@@ -102,9 +107,11 @@ LinkConfiguration* LinkConfiguration::duplicateSettings(LinkConfiguration* sourc
case
TypeUdp
:
dupe
=
new
UDPConfiguration
(
dynamic_cast
<
UDPConfiguration
*>
(
source
));
break
;
#ifdef UNITTEST_BUILD
case
TypeMock
:
dupe
=
new
MockConfiguration
(
dynamic_cast
<
MockConfiguration
*>
(
source
));
break
;
#endif
}
return
dupe
;
}
src/comm/LinkConfiguration.h
View file @
e4dcf8fe
...
...
@@ -41,7 +41,6 @@ public:
enum
{
TypeSerial
,
///< Serial Link
TypeUdp
,
///< UDP Link
TypeMock
,
///< Mock Link for Unitesting
// TODO Below is not yet implemented
#if 0
TypeTcp, ///< TCP Link
...
...
@@ -49,6 +48,9 @@ public:
TypeForwarding, ///< Forwarding Link
TypeXbee, ///< XBee Proprietary Link
TypeOpal, ///< Opal-RT Link
#endif
#ifdef UNITTEST_BUILD
TypeMock
,
///< Mock Link for Unitesting
#endif
TypeLast
// Last type value (type >= TypeLast == invalid)
};
...
...
src/comm/LinkManager.cc
View file @
e4dcf8fe
...
...
@@ -79,9 +79,11 @@ LinkInterface* LinkManager::createLink(LinkConfiguration* config)
case
LinkConfiguration
:
:
TypeUdp
:
pLink
=
new
UDPLink
(
dynamic_cast
<
UDPConfiguration
*>
(
config
));
break
;
#ifdef UNITTEST_BUILD
case
LinkConfiguration
:
:
TypeMock
:
pLink
=
new
MockLink
(
dynamic_cast
<
MockConfiguration
*>
(
config
));
break
;
#endif
}
if
(
pLink
)
{
addLink
(
pLink
);
...
...
@@ -373,10 +375,12 @@ void LinkManager::loadLinkConfigurationList()
pLink
=
(
LinkConfiguration
*
)
new
UDPConfiguration
(
name
);
pLink
->
setPreferred
(
preferred
);
break
;
#ifdef UNITTEST_BUILD
case
LinkConfiguration
:
:
TypeMock
:
pLink
=
(
LinkConfiguration
*
)
new
MockConfiguration
(
name
);
pLink
->
setPreferred
(
false
);
break
;
#endif
}
if
(
pLink
)
{
// Have the instance load its own values
...
...
src/comm/LinkManager.h
View file @
e4dcf8fe
...
...
@@ -37,7 +37,10 @@ This file is part of the PIXHAWK project
// Links
#include "SerialLink.h"
#include "UDPLink.h"
#ifdef UNITTEST_BUILD
#include "MockLink.h"
#endif
#include "ProtocolInterface.h"
#include "QGCSingleton.h"
...
...
src/ui/QGCCommConfiguration.cc
View file @
e4dcf8fe
...
...
@@ -96,12 +96,14 @@ void QGCCommConfiguration::_loadTypeConfigWidget(int type)
_ui
->
typeCombo
->
setCurrentIndex
(
_ui
->
typeCombo
->
findData
(
LinkConfiguration
::
TypeUdp
));
}
break
;
#ifdef UNITTEST_BUILD
case
LinkConfiguration
:
:
TypeMock
:
{
_ui
->
linkScrollArea
->
setWidget
(
NULL
);
_ui
->
linkGroupBox
->
setTitle
(
tr
(
"Mock Link"
));
_ui
->
typeCombo
->
setCurrentIndex
(
_ui
->
typeCombo
->
findData
(
LinkConfiguration
::
TypeMock
));
}
break
;
#endif
// Cannot be the case, but in case it gets here, we cannot continue.
default:
reject
();
...
...
src/ui/QGCLinkConfiguration.cc
View file @
e4dcf8fe
...
...
@@ -142,10 +142,12 @@ void QGCLinkConfiguration::on_addLinkButton_clicked()
config
->
setName
(
QString
(
"UDP Link on Port %1"
).
arg
(
dynamic_cast
<
UDPConfiguration
*>
(
config
)
->
localPort
()));
break
;
#ifdef UNITTEST_BUILD
case
LinkConfiguration
:
:
TypeMock
:
config
->
setName
(
QString
(
"Mock Link"
));
break
;
#endif
}
}
_viewModel
->
beginChange
();
...
...
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