Main Page
Namespaces
Classes
Files
File List
File Members
src
tools
WatchdogTimer.cpp
Go to the documentation of this file.
1
// WatchdogTimer.cpp
2
// Copyright (c) SICK AG
3
// created: 06.06.2011, Willhoeft
4
5
#include "
WatchdogTimer.hpp
"
6
#include "
Timer.hpp
"
7
8
14
WatchdogTimer::WatchdogTimer
()
15
{
16
m_timeoutInterval
.
m_duration
= 0.0;
17
m_nextElapseTime
=
Time::now
() +
m_timeoutInterval
;
18
}
19
20
WatchdogTimer::~WatchdogTimer
()
21
{
22
}
23
24
28
void
WatchdogTimer::start
(
const
TimeDuration
interval)
29
{
30
m_timeoutInterval
= interval;
31
reset
();
32
}
33
37
bool
WatchdogTimer::isElapsed
()
38
{
39
if
(
Time::now
() >=
m_nextElapseTime
)
40
{
41
// Timer ist abgelaufen
42
return
true
;
43
}
44
45
// Timer ist noch nicht abgelaufen
46
return
false
;
47
}
48
52
void
WatchdogTimer::reset
()
53
{
54
// Naechste Ablaufzeit setzen
55
m_nextElapseTime
=
Time::now
() +
m_timeoutInterval
;
56
}
57
WatchdogTimer::isElapsed
bool isElapsed()
Definition:
WatchdogTimer.cpp:37
TimeDuration
Definition:
Time.hpp:16
WatchdogTimer::reset
void reset()
Definition:
WatchdogTimer.cpp:52
WatchdogTimer::~WatchdogTimer
virtual ~WatchdogTimer()
Destructor.
Definition:
WatchdogTimer.cpp:20
WatchdogTimer::start
void start(UINT32 seconds)
Restarts the timer. Call this as "ok" signal.
TimeDuration::m_duration
double m_duration
Definition:
Time.hpp:26
WatchdogTimer.hpp
WatchdogTimer::m_nextElapseTime
Time m_nextElapseTime
Definition:
WatchdogTimer.hpp:35
WatchdogTimer::WatchdogTimer
WatchdogTimer()
Constructor.
Definition:
WatchdogTimer.cpp:14
Timer.hpp
Time::now
static Time now()
Definition:
Time.cpp:168
WatchdogTimer::m_timeoutInterval
TimeDuration m_timeoutInterval
Definition:
WatchdogTimer.hpp:36
libsick_ldmrs
Author(s): SICK AG
, Martin Günther
, Jochen Sprickerhof
autogenerated on Sat Jun 8 2019 17:57:33