DABC (Data Acquisition Backbone Core)  2.9.9
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 
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;
61  char fNoLink[10];
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
Represents command with its arguments.
Definition: Command.h:99
Player of DIM data.
Definition: Monitor.h:39
virtual int ExecuteCommand(dabc::Command cmd)
Main method where commands are executed.
Definition: Monitor.cxx:176
virtual void ProcessTimerEvent(unsigned timer)
Method called by framework when timer event is produced.
Definition: Monitor.cxx:165
std::map< std::string, MyEntry > DimServicesMap
Definition: Monitor.h:53
virtual void infoHandler()
Definition: Monitor.cxx:205
bool fNeedDnsUpdate
if true, should update DNS structures
Definition: Monitor.h:62
Monitor(const std::string &name, dabc::Command cmd=nullptr)
Definition: Monitor.cxx:26
void ScanDimServices()
Definition: Monitor.cxx:83
std::string fDimMask
mask of DIM services
Definition: Monitor.h:56
virtual ~Monitor()
Definition: Monitor.cxx:54
virtual unsigned GetRecRawSize()
Definition: Monitor.cxx:360
virtual void OnThreadAssigned()
Definition: Monitor.cxx:66
::DimBrowser * fDimBr
dim browser
Definition: Monitor.h:58
DimServicesMap fDimInfos
all subscribed DIM services
Definition: Monitor.h:59
double fDimPeriod
how often DIM records will be checked, default 1 s
Definition: Monitor.h:57
std::string fDimDns
name of DNS server
Definition: Monitor.h:55
char fNoLink[10]
buffer used to detect nolink
Definition: Monitor.h:61
dabc::TimeStamp fLastScan
last time when DIM services were scanned
Definition: Monitor.h:60
Base class for monitoring of slow control data.
CERN DIM
Definition: Factory.h:25
Class for acquiring and holding timestamps.
Definition: timing.h:40
MyEntry(const MyEntry &src)
Definition: Monitor.h:50
double fDouble
buffer for double
Definition: Monitor.h:47
int fKind
kind of new data (0 - none, 1 - long, 2 - double )
Definition: Monitor.h:48
long fLong
buffer for long
Definition: Monitor.h:46
DimInfo * info
Definition: Monitor.h:44