Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
a09fcba9
Commit
a09fcba9
authored
Apr 27, 2018
by
acfloria
Browse files
Do not change the priority link if it was commanded and is still active
parent
a7310e40
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Vehicle/Vehicle.cc
View file @
a09fcba9
...
...
@@ -168,6 +168,7 @@ Vehicle::Vehicle(LinkInterface* link,
,
_gitHash
(
versionNotSetValue
)
,
_uid
(
0
)
,
_lastAnnouncedLowBatteryPercent
(
100
)
,
_priorityLinkCommanded
(
false
)
,
_rollFact
(
0
,
_rollFactName
,
FactMetaData
::
valueTypeDouble
)
,
_pitchFact
(
0
,
_pitchFactName
,
FactMetaData
::
valueTypeDouble
)
,
_headingFact
(
0
,
_headingFactName
,
FactMetaData
::
valueTypeDouble
)
...
...
@@ -1681,6 +1682,16 @@ void Vehicle::_sendMessageOnLink(LinkInterface* link, mavlink_message_t message)
void
Vehicle
::
_updatePriorityLink
(
bool
updateActive
,
bool
sendCommand
)
{
emit
linkNamesChanged
();
// if the priority link is commanded and still active don't change anything
if
(
_priorityLinkCommanded
)
{
if
(
_priorityLink
.
data
()
->
active
(
_id
))
{
return
;
}
else
{
_priorityLinkCommanded
=
false
;
}
}
LinkInterface
*
newPriorityLink
=
NULL
;
// This routine specifically does not clear _priorityLink when there are no links remaining.
...
...
@@ -2149,6 +2160,7 @@ void Vehicle::setPriorityLinkByName(const QString& priorityLinkName)
}
if
(
newPriorityLink
)
{
_priorityLinkCommanded
=
true
;
_priorityLink
=
_toolbox
->
linkManager
()
->
sharedLinkInterfacePointerForLink
(
newPriorityLink
);
_updateHighLatencyLink
(
true
);
emit
priorityLinkNameChanged
(
_priorityLink
->
getName
());
...
...
src/Vehicle/Vehicle.h
View file @
a09fcba9
...
...
@@ -1271,6 +1271,7 @@ private:
int
_lastAnnouncedLowBatteryPercent
;
SharedLinkInterfacePointer
_priorityLink
;
// We always keep a reference to the priority link to manage shutdown ordering
bool
_priorityLinkCommanded
;
// FactGroup facts
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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