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
c2cd1ce7
Commit
c2cd1ce7
authored
Jun 27, 2015
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automatic UDP Link Configuration
parent
ddfd87b6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
4 deletions
+34
-4
LinkManager.cc
src/comm/LinkManager.cc
+24
-3
QGCCommConfiguration.cc
src/ui/QGCCommConfiguration.cc
+3
-0
QGCLinkConfiguration.cc
src/ui/QGCLinkConfiguration.cc
+6
-1
QGCUDPLinkConfiguration.cc
src/ui/QGCUDPLinkConfiguration.cc
+1
-0
No files found.
src/comm/LinkManager.cc
View file @
c2cd1ce7
...
...
@@ -357,6 +357,8 @@ void LinkManager::saveLinkConfigurationList()
void
LinkManager
::
loadLinkConfigurationList
()
{
bool
udpExists
=
false
;
bool
linksChanged
=
false
;
QSettings
settings
;
// Is the group even there?
if
(
settings
.
contains
(
LinkConfiguration
::
settingsRoot
()
+
"/count"
))
{
...
...
@@ -402,6 +404,14 @@ void LinkManager::loadLinkConfigurationList()
// Have the instance load its own values
pLink
->
loadSettings
(
settings
,
root
);
addLinkConfiguration
(
pLink
);
linksChanged
=
true
;
// Check for UDP links
if
(
pLink
->
type
()
==
LinkConfiguration
::
TypeUdp
)
{
UDPConfiguration
*
uLink
=
dynamic_cast
<
UDPConfiguration
*>
(
pLink
);
if
(
uLink
&&
uLink
->
localPort
()
==
QGC_UDP_LOCAL_PORT
)
{
udpExists
=
true
;
}
}
}
}
else
{
qWarning
()
<<
"Link Configuration "
<<
root
<<
" has an empty name."
;
...
...
@@ -416,7 +426,6 @@ void LinkManager::loadLinkConfigurationList()
qWarning
()
<<
"Link Configuration "
<<
root
<<
" has no type."
;
}
}
emit
linkConfigurationChanged
();
}
// Debug buids always add MockLink automatically
...
...
@@ -424,10 +433,22 @@ void LinkManager::loadLinkConfigurationList()
MockConfiguration
*
pMock
=
new
MockConfiguration
(
"Mock Link"
);
pMock
->
setDynamic
(
true
);
addLinkConfiguration
(
pMock
);
emit
linkConfigurationChanged
()
;
linksChanged
=
true
;
#endif
//-- If we don't have a configured UDP link, create a default one
if
(
!
udpExists
)
{
UDPConfiguration
*
uLink
=
new
UDPConfiguration
(
"Default UDP Link"
);
uLink
->
setLocalPort
(
QGC_UDP_LOCAL_PORT
);
uLink
->
setDynamic
();
addLinkConfiguration
(
uLink
);
linksChanged
=
true
;
}
// Enable automatic PX4 hunting
if
(
linksChanged
)
{
emit
linkConfigurationChanged
();
}
// Enable automatic Serial PX4/3DR Radio hunting
_configurationsLoaded
=
true
;
}
...
...
src/ui/QGCCommConfiguration.cc
View file @
c2cd1ce7
...
...
@@ -190,4 +190,7 @@ void QGCCommConfiguration::on_nameEdit_textEdited(const QString &arg1)
{
Q_UNUSED
(
arg1
);
_updateUI
();
if
(
_config
)
{
_config
->
setDynamic
(
false
);
}
}
src/ui/QGCLinkConfiguration.cc
View file @
c2cd1ce7
...
...
@@ -225,9 +225,14 @@ void QGCLinkConfiguration::_updateButtons()
LinkConfiguration
*
config
=
NULL
;
QModelIndex
index
=
_ui
->
linkView
->
currentIndex
();
bool
enabled
=
(
index
.
row
()
>=
0
);
bool
deleteEnabled
=
true
;
if
(
enabled
)
{
config
=
_viewModel
->
getConfiguration
(
index
.
row
());
if
(
config
)
{
// Can't delete a dynamic link
if
(
config
->
isDynamic
())
{
deleteEnabled
=
false
;
}
LinkInterface
*
link
=
config
->
getLink
();
if
(
link
)
{
_ui
->
connectLinkButton
->
setText
(
"Disconnect"
);
...
...
@@ -237,7 +242,7 @@ void QGCLinkConfiguration::_updateButtons()
}
}
_ui
->
connectLinkButton
->
setEnabled
(
enabled
);
_ui
->
delLinkButton
->
setEnabled
(
config
!=
NULL
);
_ui
->
delLinkButton
->
setEnabled
(
config
!=
NULL
&&
deleteEnabled
);
_ui
->
editLinkButton
->
setEnabled
(
config
!=
NULL
);
}
...
...
src/ui/QGCUDPLinkConfiguration.cc
View file @
c2cd1ce7
...
...
@@ -90,6 +90,7 @@ void QGCUDPLinkConfiguration::on_portNumber_valueChanged(int arg1)
{
if
(
!
_inConstructor
)
{
_config
->
setLocalPort
(
arg1
);
_config
->
setDynamic
(
false
);
}
}
...
...
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