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
54107e96
Commit
54107e96
authored
Apr 05, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hack fix for multi-vehicle disconnect on same link
parent
1cde874b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
1 deletion
+27
-1
MultiVehicleManager.cc
src/Vehicle/MultiVehicleManager.cc
+15
-0
MultiVehicleManager.h
src/Vehicle/MultiVehicleManager.h
+6
-0
Vehicle.cc
src/Vehicle/Vehicle.cc
+6
-1
No files found.
src/Vehicle/MultiVehicleManager.cc
View file @
54107e96
...
...
@@ -326,3 +326,18 @@ void MultiVehicleManager::_sendGCSHeartbeat(void)
vehicle
->
sendMessage
(
message
);
}
}
bool
MultiVehicleManager
::
linkInUse
(
LinkInterface
*
link
,
Vehicle
*
skipVehicle
)
{
for
(
int
i
=
0
;
i
<
_vehicles
.
count
();
i
++
)
{
Vehicle
*
vehicle
=
qobject_cast
<
Vehicle
*>
(
_vehicles
[
i
]);
if
(
vehicle
!=
skipVehicle
)
{
if
(
vehicle
->
containsLink
(
link
))
{
return
true
;
}
}
}
return
false
;
}
src/Vehicle/MultiVehicleManager.h
View file @
54107e96
...
...
@@ -81,6 +81,12 @@ public:
bool
gcsHeartbeatEnabled
(
void
)
const
{
return
_gcsHeartbeatEnabled
;
}
void
setGcsHeartbeatEnabled
(
bool
gcsHeartBeatEnabled
);
/// Determines if the link is in use by a Vehicle
/// @param link Link to test against
/// @param skipVehicle Don't consider this Vehicle as part of the test
/// @return true: link is in use by one or more Vehicles
bool
linkInUse
(
LinkInterface
*
link
,
Vehicle
*
skipVehicle
);
// Override from QGCTool
virtual
void
setToolbox
(
QGCToolbox
*
toolbox
);
...
...
src/Vehicle/Vehicle.cc
View file @
54107e96
...
...
@@ -1262,9 +1262,14 @@ void Vehicle::disconnectInactiveVehicle(void)
{
// Vehicle is no longer communicating with us, disconnect all links
LinkManager
*
linkMgr
=
qgcApp
()
->
toolbox
()
->
linkManager
();
for
(
int
i
=
0
;
i
<
_links
.
count
();
i
++
)
{
linkMgr
->
disconnectLink
(
_links
[
i
]);
// FIXME: This linkInUse check is a hack fix for multiple vehicles on the same link.
// The real fix requires significant restructuring which will come later.
if
(
!
qgcApp
()
->
toolbox
()
->
multiVehicleManager
()
->
linkInUse
(
_links
[
i
],
this
))
{
linkMgr
->
disconnectLink
(
_links
[
i
]);
}
}
}
...
...
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