DABC (Data Acquisition Backbone Core)  2.9.9
Definitions.h
Go to the documentation of this file.
1 // $Id: Definitions.h 2216 2014-04-03 13:59:28Z 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 SAFT_DEFINITIONS_H
17 #define SAFT_DEFINITIONS_H
18 
19 
21 #define ECA_EVENT_ID_LATCH UINT64_C(0xfffe000000000000) /* FID=MAX & GRPID=MAX-1 */
22 #define ECA_EVENT_MASK_LATCH UINT64_C(0xfffe000000000000)
23 #define IO_CONDITION_OFFSET 5000
24 
25 
27 #define NON_IO_CONDITION_LABEL "WR_Event"
28 
30 #define ECA_LATE 0
31 #define ECA_EARLY 1
32 #define ECA_CONFLICT 2
33 #define ECA_DELAYED 3
34 #define ECA_VALID 4
35 #define ECA_OVERFLOW 5
36 #define ECA_MAX_FULL 6
37 
38 #define ECA_LINUX 0
39 #define ECA_WBM 1
40 #define ECA_EMBEDDED_CPU 2
41 #define ECA_SCUBUS 3
42 
44 #define SAFT_DABC_ACCEPT_LATE (1 << ECA_LATE)
45 #define SAFT_DABC_ACCEPT_EARLY (1 << ECA_EARLY)
46 #define SAFT_DABC_ACCEPT_CONFLICT (1 << ECA_CONFLICT)
47 #define SAFT_DABC_ACCEPT_DELAYED (1 << ECA_DELAYED)
48 
50 #define SAFT_DABC_DESCRLEN 16
51 
53 #define SAFT_DABC_TRIGTYPE 0xA
54 
55 
56 
57 namespace saftdabc {
58 
59 /*
60  * Common definition of string constants to be used in factory/application.
61  * Implemented in Factory.cxx
62  * */
63 
65 extern const char* xmlDeviceName;
66 
68 extern const char* xmlInputs;
69 
71 extern const char* xmlMasks;
72 
74 extern const char* xmlEventIds;
75 
77 extern const char* xmlOffsets;
78 
80 extern const char* xmlAcceptFlags;
81 
82 
84 extern const char* xmlTimeout;
85 
87 extern const char* xmlCallbackMode;
88 
90 extern const char* xmlSaftVerbose;
91 
92  /* full subevent id for timestamp data*/
93  extern const char* xmlSaftSubeventId;
94 
95 
96  /* switch to fill single timing event for each (MBS or hadaq) Event container*/
97  extern const char* xmlSaftSingleEvent;
98 
99  /* specify output event format: mbs, hadaq, or raw*/
100  extern const char* xmlEventFormat;
101 
102 
103 
104 
106  extern const char* commandRunMainloop;
107 
109  extern const char* parEventRate;
110 
111 
115  {
116 
117  public:
118 
119  uint64_t fEvent;
120  uint64_t fParam;
121  uint64_t fDeadline;
122  uint64_t fExecuted;
123  uint64_t fFlags;
124  uint64_t fOverflows;
125  char fDescription[SAFT_DABC_DESCRLEN]; //< specifies input type. we use simple char field for mbs buffers etc.
126 
127  Timing_Event (uint64_t event = 0, uint64_t param = 0, uint64_t deadline = 0, uint64_t executed = 0,
128  uint64_t flags = 0, uint64_t overflows = 0,const char* description=0) :
129  fEvent (event), fParam (param), fDeadline (deadline), fExecuted (executed), fFlags (flags), fOverflows(overflows)
130  {
131  if(description)
132  snprintf(fDescription, SAFT_DABC_DESCRLEN-2, "%s",description);
133  }
134 
135 
136  int InfoMessage(char* str, size_t len)
137  {
138  if(str==0) return -1;
139  return snprintf(str, len, "saftdabc::Timing_Event - event=0x%lx, param=0x%lx , deadline=0x%lx, executed=0x%lx, flags=0x%lx, overflows=0x%lx, description:%s",
141 
142  }
143 
144  };
145 
146 }
147 
148 
149 
150 
151 
152 
153 
154 #endif
The saftlib input event data structure.
Definition: Definitions.h:115
Timing_Event(uint64_t event=0, uint64_t param=0, uint64_t deadline=0, uint64_t executed=0, uint64_t flags=0, uint64_t overflows=0, const char *description=0)
Definition: Definitions.h:127
char fDescription[SAFT_DABC_DESCRLEN]
Definition: Definitions.h:125
int InfoMessage(char *str, size_t len)
Definition: Definitions.h:136
GSI Simplified API for Timing Library (saftlib) plug-in for dabc.
Definition: Definitions.h:57
const char * parEventRate
Name of event rate parameter.
Definition: Factory.cxx:66
const char * xmlCallbackMode
switch between polling for data or callback mode
Definition: Factory.cxx:60
const char * xmlOffsets
WR event offsets to snoop.
Definition: Factory.cxx:41
const char * xmlSaftVerbose
switch between silent or verbose event receiver mode
Definition: Factory.cxx:48
const char * xmlInputs
EXPLODER input name items that should be latched with timestamp.
Definition: Factory.cxx:32
const char * xmlAcceptFlags
WR event accept flags to snoop.
Definition: Factory.cxx:45
const char * xmlEventIds
WR event ids to snoop.
Definition: Factory.cxx:39
const char * xmlTimeout
time out for polling mode
Definition: Factory.cxx:62
const char * xmlSaftSubeventId
Definition: Factory.cxx:53
const char * xmlDeviceName
name of the saft device, e.g.
Definition: Factory.cxx:29
const char * xmlMasks
WR event masks to snoop.
Definition: Factory.cxx:35
const char * xmlSaftSingleEvent
Definition: Factory.cxx:55
const char * xmlEventFormat
Definition: Factory.cxx:57
const char * commandRunMainloop
Command to invoke the glib/dbus mainloop.
Definition: Factory.cxx:64
#define SAFT_DABC_DESCRLEN
length of descriptor text field in timing event structure
Definition: Definitions.h:50