cisst-saw
Toggle main menu visibility
Loading...
Searching...
No Matches
tmp
cisst-saw
cisst
cisstMultiTask
mtsWatchdogClient.h
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3
4
/*
5
Author(s): Marcin Balicki
6
Created on: 2014
7
8
(C) Copyright 2014 Johns Hopkins University (JHU), All Rights Reserved.
9
10
--- begin cisst license - do not edit ---
11
12
This software is provided "as is" under an open source license, with
13
no warranty. The complete license can be found in license.txt and
14
http://www.cisst.org/cisst/license.txt.
15
16
--- end cisst license ---
17
*/
18
19
#ifndef _mtsWatchdogClient_h
20
#define _mtsWatchdogClient_h
21
22
#include <
cisstCommon/cmnGenericObject.h
>
23
#include <
cisstOSAbstraction/osaStopwatch.h
>
24
#include <
cisstMultiTask/mtsFunctionRead.h
>
25
#include <
cisstMultiTask/mtsFunctionWrite.h
>
26
#include <
cisstMultiTask/mtsFunctionVoid.h
>
27
28
class
mtsWatchdogClient
:
public
cmnGenericObject
{
29
// used to control the log level, "Run Error" by default
30
CMN_DECLARE_SERVICES(
CMN_NO_DYNAMIC_CREATION
,
CMN_LOG_LOD_RUN_ERROR
);
31
protected
:
32
osaStopwatch
StopWatch
;
33
double
Timeout
;
34
struct
{
35
mtsFunctionRead
ReadState;
36
mtsFunctionWrite
WriteState;
37
mtsFunctionVoid
ResetState;
38
}
Watchdog
;
39
40
bool
IsOK
;
41
public
:
42
inline
mtsWatchdogClient
():
43
Timeout
(0),
44
IsOK
(false)
45
{};
46
47
~mtsWatchdogClient
() {};
48
49
void
AddToRequiredInterface
(
mtsInterfaceRequired
& reqInt);
50
51
void
SetTimeoutPeriod
(
const
double
& seconds) {
52
Timeout
= seconds;
53
}
54
55
bool
Start
(
void
);
56
57
// true if everything is ok;
58
bool
CheckAndUpdate
(
void
);
59
bool
Reset
(
void
);
60
};
61
62
CMN_DECLARE_SERVICES_INSTANTIATION
(
mtsWatchdogClient
);
63
64
#endif
// _mtsWatchdogClient_h
cmnGenericObject
Base class for high level objects.
Definition
cmnGenericObject.h:53
mtsFunctionRead
Definition
mtsFunctionRead.h:37
mtsFunctionVoid
Definition
mtsFunctionVoid.h:36
mtsFunctionWrite
Definition
mtsFunctionWrite.h:37
mtsInterfaceRequired
Definition
mtsInterfaceRequired.h:83
mtsWatchdogClient
Definition
mtsWatchdogClient.h:28
mtsWatchdogClient::Timeout
double Timeout
Definition
mtsWatchdogClient.h:33
mtsWatchdogClient::AddToRequiredInterface
void AddToRequiredInterface(mtsInterfaceRequired &reqInt)
mtsWatchdogClient::SetTimeoutPeriod
void SetTimeoutPeriod(const double &seconds)
Definition
mtsWatchdogClient.h:51
mtsWatchdogClient::StopWatch
osaStopwatch StopWatch
Definition
mtsWatchdogClient.h:32
mtsWatchdogClient::mtsWatchdogClient
mtsWatchdogClient()
Definition
mtsWatchdogClient.h:42
mtsWatchdogClient::Start
bool Start(void)
mtsWatchdogClient::Reset
bool Reset(void)
mtsWatchdogClient::~mtsWatchdogClient
~mtsWatchdogClient()
Definition
mtsWatchdogClient.h:47
mtsWatchdogClient::Watchdog
struct mtsWatchdogClient::@176004150315221034161372343321057023106204354012 Watchdog
mtsWatchdogClient::IsOK
bool IsOK
Definition
mtsWatchdogClient.h:40
mtsWatchdogClient::CheckAndUpdate
bool CheckAndUpdate(void)
osaStopwatch
Definition
osaStopwatch.h:83
CMN_DECLARE_SERVICES_INSTANTIATION
#define CMN_DECLARE_SERVICES_INSTANTIATION(className)
Definition
cmnClassRegisterMacros.h:199
CMN_NO_DYNAMIC_CREATION
const int CMN_NO_DYNAMIC_CREATION
Definition
cmnClassRegisterMacros.h:325
cmnGenericObject.h
Defines cmnGenericObject.
CMN_LOG_LOD_RUN_ERROR
#define CMN_LOG_LOD_RUN_ERROR
Definition
cmnLogLoD.h:93
mtsFunctionRead.h
Defines the command interfaces.
mtsFunctionVoid.h
Defines a function object to use a void command (mtsCommandVoid).
mtsFunctionWrite.h
Defines the command interfaces.
osaStopwatch.h
Generated by
1.18.0