DABC (Data Acquisition Backbone Core)
2.9.9
plugins
dim
dim
Monitor.h
Go to the documentation of this file.
1
// $Id: Monitor.h 3862 2018-05-11 10:06:18Z linev $
2
3
/************************************************************
4
* The Data Acquisition Backbone Core (DABC) *
5
************************************************************
6
* Copyright (C) 2009 - *
7
* GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
8
* Planckstr. 1, 64291 Darmstadt, Germany *
9
* Contact: http://dabc.gsi.de *
10
************************************************************
11
* This software can be used under the GPL license *
12
* agreements as stated in LICENSE.txt file *
13
* which is part of the distribution. *
14
************************************************************/
15
16
#ifndef DIM_Monitor
17
#define DIM_Monitor
18
19
#ifndef MBS_MonitorSlowControl
20
#include "
mbs/MonitorSlowControl.h
"
21
#endif
22
23
#include <map>
24
25
#include <dic.hxx>
26
27
class
DimBrowser;
28
class
DimInfo;
29
30
namespace
dim
{
31
38
class
Monitor
:
public
mbs::MonitorSlowControl
,
39
public
DimInfoHandler {
40
41
protected
:
42
43
struct
MyEntry
{
44
DimInfo*
info
;
45
int
flag
;
46
long
fLong
;
47
double
fDouble
;
48
int
fKind
;
49
MyEntry
() :
info
(0),
flag
(0),
fLong
(0),
fDouble
(0.),
fKind
(0) {}
50
MyEntry
(
const
MyEntry
& src) :
info
(src.
info
),
flag
(src.
flag
),
fLong
(src.
fLong
),
fDouble
(src.
fDouble
),
fKind
(src.
fKind
) {}
51
};
52
53
typedef
std::map<std::string, MyEntry>
DimServicesMap
;
54
55
std::string
fDimDns
;
56
std::string
fDimMask
;
57
double
fDimPeriod
;
58
::DimBrowser*
fDimBr
;
59
DimServicesMap
fDimInfos
;
60
dabc::TimeStamp
fLastScan
;
61
char
fNoLink
[10];
62
bool
fNeedDnsUpdate
;
63
64
virtual
void
OnThreadAssigned
();
65
66
void
ScanDimServices
();
67
68
virtual
unsigned
GetRecRawSize
();
69
70
71
public
:
72
Monitor
(
const
std::string &name,
dabc::Command
cmd =
nullptr
);
73
virtual
~Monitor
();
74
75
virtual
void
ProcessTimerEvent
(
unsigned
timer);
76
77
virtual
int
ExecuteCommand
(
dabc::Command
cmd);
78
79
virtual
void
infoHandler
();
80
81
};
82
}
83
84
85
#endif
MonitorSlowControl.h
dabc::Command
Represents command with its arguments.
Definition:
Command.h:99
dim::Monitor
Player of DIM data.
Definition:
Monitor.h:39
dim::Monitor::ExecuteCommand
virtual int ExecuteCommand(dabc::Command cmd)
Main method where commands are executed.
Definition:
Monitor.cxx:176
dim::Monitor::ProcessTimerEvent
virtual void ProcessTimerEvent(unsigned timer)
Method called by framework when timer event is produced.
Definition:
Monitor.cxx:165
dim::Monitor::DimServicesMap
std::map< std::string, MyEntry > DimServicesMap
Definition:
Monitor.h:53
dim::Monitor::infoHandler
virtual void infoHandler()
Definition:
Monitor.cxx:205
dim::Monitor::fNeedDnsUpdate
bool fNeedDnsUpdate
if true, should update DNS structures
Definition:
Monitor.h:62
dim::Monitor::Monitor
Monitor(const std::string &name, dabc::Command cmd=nullptr)
Definition:
Monitor.cxx:26
dim::Monitor::ScanDimServices
void ScanDimServices()
Definition:
Monitor.cxx:83
dim::Monitor::fDimMask
std::string fDimMask
mask of DIM services
Definition:
Monitor.h:56
dim::Monitor::~Monitor
virtual ~Monitor()
Definition:
Monitor.cxx:54
dim::Monitor::GetRecRawSize
virtual unsigned GetRecRawSize()
Definition:
Monitor.cxx:360
dim::Monitor::OnThreadAssigned
virtual void OnThreadAssigned()
Definition:
Monitor.cxx:66
dim::Monitor::fDimBr
::DimBrowser * fDimBr
dim browser
Definition:
Monitor.h:58
dim::Monitor::fDimInfos
DimServicesMap fDimInfos
all subscribed DIM services
Definition:
Monitor.h:59
dim::Monitor::fDimPeriod
double fDimPeriod
how often DIM records will be checked, default 1 s
Definition:
Monitor.h:57
dim::Monitor::fDimDns
std::string fDimDns
name of DNS server
Definition:
Monitor.h:55
dim::Monitor::fNoLink
char fNoLink[10]
buffer used to detect nolink
Definition:
Monitor.h:61
dim::Monitor::fLastScan
dabc::TimeStamp fLastScan
last time when DIM services were scanned
Definition:
Monitor.h:60
mbs::MonitorSlowControl
Base class for monitoring of slow control data.
Definition:
MonitorSlowControl.h:39
dim
CERN DIM
Definition:
Factory.h:25
dabc::TimeStamp
Class for acquiring and holding timestamps.
Definition:
timing.h:40
dim::Monitor::MyEntry
Definition:
Monitor.h:43
dim::Monitor::MyEntry::MyEntry
MyEntry(const MyEntry &src)
Definition:
Monitor.h:50
dim::Monitor::MyEntry::fDouble
double fDouble
buffer for double
Definition:
Monitor.h:47
dim::Monitor::MyEntry::fKind
int fKind
kind of new data (0 - none, 1 - long, 2 - double )
Definition:
Monitor.h:48
dim::Monitor::MyEntry::fLong
long fLong
buffer for long
Definition:
Monitor.h:46
dim::Monitor::MyEntry::flag
int flag
Definition:
Monitor.h:45
dim::Monitor::MyEntry::MyEntry
MyEntry()
Definition:
Monitor.h:49
dim::Monitor::MyEntry::info
DimInfo * info
Definition:
Monitor.h:44
Generated by
1.9.1