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
c5aa2ab6
Unverified
Commit
c5aa2ab6
authored
Jun 15, 2018
by
Don Gagne
Committed by
GitHub
Jun 15, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6586 from acfloria/fix/link_active
Split constructor of HeartbeatTimer up in two functions
parents
bb40dd6c
c89404d9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
HeartbeatTimer.cc
src/comm/HeartbeatTimer.cc
+8
-2
HeartbeatTimer.h
src/comm/HeartbeatTimer.h
+7
-0
LinkInterface.cc
src/comm/LinkInterface.cc
+1
-0
No files found.
src/comm/HeartbeatTimer.cc
View file @
c5aa2ab6
...
...
@@ -17,7 +17,11 @@ HeartbeatTimer::HeartbeatTimer(int vehicle_id, bool high_latency) :
_vehicleID
(
vehicle_id
),
_high_latency
(
high_latency
)
{
if
(
!
high_latency
)
{
}
void
HeartbeatTimer
::
init
()
{
if
(
!
_high_latency
)
{
_timer
->
setInterval
(
_heartbeatReceivedTimeoutMSecs
);
_timer
->
setSingleShot
(
true
);
_timer
->
start
();
...
...
@@ -26,7 +30,9 @@ HeartbeatTimer::HeartbeatTimer(int vehicle_id, bool high_latency) :
QObject
::
connect
(
_timer
,
&
QTimer
::
timeout
,
this
,
&
HeartbeatTimer
::
timerTimeout
);
}
HeartbeatTimer
::~
HeartbeatTimer
()
{
HeartbeatTimer
::~
HeartbeatTimer
()
{
if
(
_timer
)
{
QObject
::
disconnect
(
_timer
,
&
QTimer
::
timeout
,
this
,
&
HeartbeatTimer
::
timerTimeout
);
_timer
->
stop
();
...
...
src/comm/HeartbeatTimer.h
View file @
c5aa2ab6
...
...
@@ -36,6 +36,13 @@ public:
*/
HeartbeatTimer
(
int
vehicle_id
,
bool
high_latency
);
/**
* @brief init
*
* Starts the timer and emits the signal that the link is active for this vehicle ID
*/
void
init
();
~
HeartbeatTimer
();
/**
...
...
src/comm/LinkInterface.cc
View file @
c5aa2ab6
...
...
@@ -195,6 +195,7 @@ void LinkInterface::startHeartbeatTimer(int vehicle_id) {
}
else
{
_heartbeatTimers
.
insert
(
vehicle_id
,
new
HeartbeatTimer
(
vehicle_id
,
_highLatency
));
QObject
::
connect
(
_heartbeatTimers
.
value
(
vehicle_id
),
&
HeartbeatTimer
::
activeChanged
,
this
,
&
LinkInterface
::
_activeChanged
);
_heartbeatTimers
.
value
(
vehicle_id
)
->
init
();
}
}
...
...
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