DABC (Data Acquisition Backbone Core)  2.9.9
MonitorModule.h
Go to the documentation of this file.
1 // $Id: MonitorModule.h 4595 2020-09-17 11:19:13Z 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 HADAQ_MonitorModule
17 #define HADAQ_MonitorModule
18 
19 #include "dabc/ModuleAsync.h"
20 
21 namespace hadaq {
22 
33  protected:
34 
35  double fInterval;
36  std::string fTopFolder;
37  unsigned fSubevId;
38  unsigned fTriggerType;
39  std::string fShellCmd;
40 
41  std::vector<uint64_t> fAddrs0;
42  std::vector<uint64_t> fAddrs;
43  uint32_t fEventId;
44 
45  void OnThreadAssigned() override;
46 
47  std::string GetItemName(unsigned addr);
48 
49  bool ReadAllVariables(dabc::Buffer &buf);
50 
51  uint32_t DoRead(uint32_t addr0, uint32_t addr);
52 
53  public:
54  MonitorModule(const std::string &name, dabc::Command cmd = nullptr);
55  virtual ~MonitorModule() = default;
56 
57  void ProcessTimerEvent(unsigned timer) override;
58 
59  void BeforeModuleStart() override;
60  };
61 }
62 
63 
64 #endif
Reference on memory from memory pool.
Definition: Buffer.h:135
Represents command with its arguments.
Definition: Command.h:99
Base class for user-derived code, implementing event-processing.
Definition: ModuleAsync.h:32
Monitor of TRB slow control data.
Definition: MonitorModule.h:32
uint32_t fEventId
event number
Definition: MonitorModule.h:43
double fInterval
Time interval for reading in seconds.
Definition: MonitorModule.h:35
std::string GetItemName(unsigned addr)
unsigned fTriggerType
trigger type
Definition: MonitorModule.h:38
std::string fTopFolder
name of top folder, which should exists also in every variable
Definition: MonitorModule.h:36
std::string fShellCmd
shell command with formats pattern
Definition: MonitorModule.h:39
std::vector< uint64_t > fAddrs
array of monitored address
Definition: MonitorModule.h:42
bool ReadAllVariables(dabc::Buffer &buf)
void ProcessTimerEvent(unsigned timer) override
Method called by framework when timer event is produced.
std::vector< uint64_t > fAddrs0
array of monitored address
Definition: MonitorModule.h:41
virtual ~MonitorModule()=default
uint32_t DoRead(uint32_t addr0, uint32_t addr)
MonitorModule(const std::string &name, dabc::Command cmd=nullptr)
void BeforeModuleStart() override
void OnThreadAssigned() override
unsigned fSubevId
subevent id
Definition: MonitorModule.h:37
Support for HADAQ - HADES DAQ
Definition: api.h:27