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
0ce1bd4d
Commit
0ce1bd4d
authored
Jun 12, 2015
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1666 from dogmaphobic/udpLinkFixes
Fixed a few issues with target UDP hosts.
parents
21d48a5b
07239b0e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
UDPLink.cc
src/comm/UDPLink.cc
+2
-1
QGCUDPLinkConfiguration.cc
src/ui/QGCUDPLinkConfiguration.cc
+6
-1
No files found.
src/comm/UDPLink.cc
View file @
0ce1bd4d
...
...
@@ -368,6 +368,7 @@ void UDPConfiguration::copyFrom(LinkConfiguration *source)
UDPConfiguration
*
usource
=
dynamic_cast
<
UDPConfiguration
*>
(
source
);
Q_ASSERT
(
usource
!=
NULL
);
_localPort
=
usource
->
localPort
();
_hosts
.
clear
();
QString
host
;
int
port
;
if
(
usource
->
firstHost
(
host
,
port
))
{
...
...
@@ -407,7 +408,7 @@ void UDPConfiguration::addHost(const QString& host, int port)
qWarning
()
<<
"UDP:"
<<
"Could not resolve host:"
<<
host
<<
"port:"
<<
port
;
}
else
{
_hosts
[
ipAdd
]
=
port
;
qDebug
()
<<
"UDP:"
<<
"Adding Host:"
<<
ipAdd
<<
":"
<<
port
;
//
qDebug() << "UDP:" << "Adding Host:" << ipAdd << ":" << port;
}
}
}
...
...
src/ui/QGCUDPLinkConfiguration.cc
View file @
0ce1bd4d
...
...
@@ -72,13 +72,16 @@ void QGCUDPLinkConfiguration::_editHost(int row)
{
if
(
row
<
_viewModel
->
hosts
.
count
())
{
bool
ok
;
QString
oldName
=
_viewModel
->
hosts
.
at
(
row
);
QString
hostName
=
QInputDialog
::
getText
(
this
,
tr
(
"Edit a MAVLink host target"
),
tr
(
"Host (hostname:port): "
),
QLineEdit
::
Normal
,
_viewModel
->
hosts
.
at
(
row
)
,
&
ok
);
tr
(
"Host (hostname:port): "
),
QLineEdit
::
Normal
,
oldName
,
&
ok
);
if
(
ok
&&
!
hostName
.
isEmpty
())
{
_viewModel
->
beginChange
();
_viewModel
->
hosts
.
replace
(
row
,
hostName
);
_viewModel
->
endChange
();
_config
->
removeHost
(
oldName
);
_config
->
addHost
(
hostName
);
}
}
}
...
...
@@ -119,7 +122,9 @@ void QGCUDPLinkConfiguration::on_removeHost_clicked()
{
QModelIndex
index
=
_ui
->
listView
->
currentIndex
();
if
(
index
.
row
()
<
_viewModel
->
hosts
.
count
())
{
QString
oldName
=
_viewModel
->
hosts
.
at
(
index
.
row
());
_viewModel
->
hosts
.
removeAt
(
index
.
row
());
_config
->
removeHost
(
oldName
);
_reloadList
();
}
}
...
...
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