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 EZCA_Monitor
17 #define EZCA_Monitor
18 
19 #ifndef MBS_MonitorSlowControl
20 #include "mbs/MonitorSlowControl.h"
21 #endif
22 
23 namespace ezca {
24 
35  protected:
36 
37  double fEzcaTimeout;
39  bool fEzcaDebug;
41  double fTimeout;
42  std::string fNameSepar;
43  std::string fTopFolder;
44 
45  std::vector<std::string> fLongRecords;
46  std::vector<long> fLongValues;
47  std::vector<bool> fLongRes;
48 
49  std::vector<std::string> fDoubleRecords;
50  std::vector<double> fDoubleValues;
51  std::vector<bool> fDoubleRes;
52 
54  virtual void OnThreadAssigned();
55 
56  /* Wrapper for ezca get with long values. Contains error message handling.
57  * Returns ezca error code.*/
58  int CA_GetLong(const std::string &name, long& val);
59 
60  /* Wrapper for ezca get with double values. Contains error message handling
61  * Returns ezca error code.*/
62  int CA_GetDouble(const std::string &name, double& val);
63 
65  std::string CA_ErrorString();
66 
67  const char* CA_RetCode(int ret);
68 
70  bool DoEpicsReadout();
71 
72  virtual unsigned GetRecRawSize();
73 
74  std::string GetItemName(const std::string &ezcaname);
75 
76  public:
77  Monitor(const std::string &name, dabc::Command cmd = nullptr);
78 
79  virtual void ProcessTimerEvent(unsigned timer);
80  };
81 }
82 
83 
84 #endif
Represents command with its arguments.
Definition: Command.h:99
Monitor of EPICS data.
Definition: Monitor.h:34
virtual void OnThreadAssigned()
Initialize some EZCA settings, do it from worker thread.
Definition: Monitor.cxx:112
double fEzcaTimeout
Timeout for ezca readout.
Definition: Monitor.h:37
std::vector< bool > fDoubleRes
results of record readout
Definition: Monitor.h:51
bool fEzcaDebug
Switch on/off epics debug messages.
Definition: Monitor.h:39
virtual void ProcessTimerEvent(unsigned timer)
Method called by framework when timer event is produced.
Definition: Monitor.cxx:129
int CA_GetDouble(const std::string &name, double &val)
Definition: Monitor.cxx:229
virtual unsigned GetRecRawSize()
Definition: Monitor.cxx:149
bool fEzcaAutoError
Automatic error printing.
Definition: Monitor.h:40
std::vector< bool > fLongRes
results of record readout
Definition: Monitor.h:47
std::vector< double > fDoubleValues
values of double records
Definition: Monitor.h:50
double fTimeout
timeout for readout
Definition: Monitor.h:41
std::string fTopFolder
name of top folder, which should exists also in every variable
Definition: Monitor.h:43
std::string CA_ErrorString()
Return error string with error description.
Definition: Monitor.cxx:239
std::vector< std::string > fDoubleRecords
names of double records
Definition: Monitor.h:49
std::vector< std::string > fLongRecords
names of long records
Definition: Monitor.h:45
int CA_GetLong(const std::string &name, long &val)
Definition: Monitor.cxx:219
std::vector< long > fLongValues
values of long records
Definition: Monitor.h:46
int fEzcaRetryCnt
Number of retry in ezca readout.
Definition: Monitor.h:38
Monitor(const std::string &name, dabc::Command cmd=nullptr)
Definition: Monitor.cxx:31
std::string fNameSepar
separator symbol(s), which defines subfolder in epcis names
Definition: Monitor.h:42
const char * CA_RetCode(int ret)
Definition: Monitor.cxx:251
bool DoEpicsReadout()
Perform readout of all variables.
Definition: Monitor.cxx:162
std::string GetItemName(const std::string &ezcaname)
Definition: Monitor.cxx:91
Base class for monitoring of slow control data.
EPICS E-Z (easy) channel access.
Definition: Definitions.h:26