cisst-saw
Toggle main menu visibility
Loading...
Searching...
No Matches
tmp
cisst-saw
cisst
cisstMultiTask
mtsWatchdogServer.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
#ifndef _mtsWatchdogServer_h
19
#define _mtsWatchdogServer_h
20
21
#include <
cisstCommon/cmnGenericObject.h
>
22
#include <
cisstOSAbstraction/osaStopwatch.h
>
23
#include <
cisstMultiTask/mtsForwardDeclarations.h
>
24
27
28
class
mtsWatchdogServer
:
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
35
mtsFunctionWrite
*
WatchdogReadBool
;
36
mtsFunctionWrite
*
WatchdogWriteBool
;
37
38
bool
IsOK
;
39
40
//if false then it was remotely updated
41
//set to true locally as an acknowledgment
42
bool
WatchdogState
;
43
44
public
:
45
mtsWatchdogServer
(
void
):
46
Timeout
(0),
47
IsOK
(false),
48
WatchdogState
(true)
49
{};
50
51
~mtsWatchdogServer
(){};
52
53
void
AddToProvidedInterface
(
mtsInterfaceProvided
& provInt,
mtsStateTable
& stateTable);
54
55
void
SetTimeoutPeriod
(
const
double
& seconds) {
56
Timeout
= seconds;
57
}
58
59
void
Start
(
void
);
60
61
//true if everything is ok;
62
bool
CheckAndUpdate
(
void
);
63
void
Reset
(
void
);
64
};
65
66
CMN_DECLARE_SERVICES_INSTANTIATION
(
mtsWatchdogServer
);
67
68
#endif
// _mtsWatchdogServer_h
cmnGenericObject
Base class for high level objects.
Definition
cmnGenericObject.h:53
mtsFunctionWrite
Definition
mtsFunctionWrite.h:37
mtsInterfaceProvided
Definition
mtsInterfaceProvided.h:98
mtsStateTable
Definition
mtsStateTable.h:67
mtsWatchdogServer
Definition
mtsWatchdogServer.h:28
mtsWatchdogServer::~mtsWatchdogServer
~mtsWatchdogServer()
Definition
mtsWatchdogServer.h:51
mtsWatchdogServer::StopWatch
osaStopwatch StopWatch
Definition
mtsWatchdogServer.h:32
mtsWatchdogServer::CheckAndUpdate
bool CheckAndUpdate(void)
mtsWatchdogServer::AddToProvidedInterface
void AddToProvidedInterface(mtsInterfaceProvided &provInt, mtsStateTable &stateTable)
mtsWatchdogServer::SetTimeoutPeriod
void SetTimeoutPeriod(const double &seconds)
Definition
mtsWatchdogServer.h:55
mtsWatchdogServer::Timeout
double Timeout
Definition
mtsWatchdogServer.h:33
mtsWatchdogServer::Reset
void Reset(void)
mtsWatchdogServer::WatchdogReadBool
mtsFunctionWrite * WatchdogReadBool
Definition
mtsWatchdogServer.h:35
mtsWatchdogServer::WatchdogWriteBool
mtsFunctionWrite * WatchdogWriteBool
Definition
mtsWatchdogServer.h:36
mtsWatchdogServer::Start
void Start(void)
mtsWatchdogServer::mtsWatchdogServer
mtsWatchdogServer(void)
Definition
mtsWatchdogServer.h:45
mtsWatchdogServer::WatchdogState
bool WatchdogState
Definition
mtsWatchdogServer.h:42
mtsWatchdogServer::IsOK
bool IsOK
Definition
mtsWatchdogServer.h:38
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
mtsForwardDeclarations.h
Forward declarations and #define for cisstMultiTask.
osaStopwatch.h
Generated by
1.18.0