DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DaphneV2AFE.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _DaphneV2AFE_0_dunedaq__appmodel_0_appmodel_H_
4#define _DaphneV2AFE_0_dunedaq__appmodel_0_appmodel_H_
5
6#include <stdint.h> // to define 64 bits types
7#include <iostream>
8#include <sstream>
9#include <string>
10#include <map>
11#include <vector>
12
14#include "conffwk/DalObject.hpp"
15
16
17 // forward declaration for classes used in relationships and algorithms
18
19namespace dunedaq {
20 namespace appmodel {
21 class DaphneV2ADC;
22 class DaphneV2LNA;
23 class DaphneV2PGA;
24 }
25}
26
27
28namespace dunedaq {
29 namespace appmodel {
30
32
33 friend class conffwk::Configuration;
34 friend class conffwk::DalObject;
35 friend class conffwk::DalFactory;
36 friend class conffwk::DalRegistry;
37
38 protected:
39
41 virtual ~DaphneV2AFE() noexcept;
42 virtual void init(bool init_children);
43
44 public:
45
48 static const std::string& s_class_name;
49
50
60 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
61
62
72 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
73
74
75 protected:
76
77 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
78
79
80 private:
81
82 uint8_t m_afe_id;
83 uint16_t m_attenuator;
84 uint16_t m_v_bias;
88
89
90 public:
91
92 // attribute names
93
94 inline static const std::string s_afe_id = "afe_id";
95 inline static const std::string s_attenuator = "attenuator";
96 inline static const std::string s_v_bias = "v_bias";
97
98 static const std::string& __get_afe_id_str() noexcept { return s_afe_id; }
99 static const std::string& __get_attenuator_str() noexcept { return s_attenuator; }
100 static const std::string& __get_v_bias_str() noexcept { return s_v_bias; }
101
102
110 uint8_t
112 {
113 std::lock_guard scoped_lock(m_mutex);
114 check();
115 check_init();
116 return m_afe_id;
117 }
118
126 void
127 set_afe_id(uint8_t value)
128 {
129 std::lock_guard scoped_lock(m_mutex);
130 check();
131 clear();
132 p_obj.set_by_val(s_afe_id, value);
133 }
134
135
142 uint16_t
144 {
145 std::lock_guard scoped_lock(m_mutex);
146 check();
147 check_init();
148 return m_attenuator;
149 }
150
157 void
158 set_attenuator(uint16_t value)
159 {
160 std::lock_guard scoped_lock(m_mutex);
161 check();
162 clear();
164 }
165
166
175 uint16_t
177 {
178 std::lock_guard scoped_lock(m_mutex);
179 check();
180 check_init();
181 return m_v_bias;
182 }
183
192 void
193 set_v_bias(uint16_t value)
194 {
195 std::lock_guard scoped_lock(m_mutex);
196 check();
197 clear();
198 p_obj.set_by_val(s_v_bias, value);
199 }
200
201
202 // relationship names
203
204 inline static const std::string s_adc = "adc";
205 inline static const std::string s_pga = "pga";
206 inline static const std::string s_lna = "lna";
207
208 static const std::string& __get_adc_str() noexcept { return s_adc; }
209 static const std::string& __get_pga_str() noexcept { return s_pga; }
210 static const std::string& __get_lna_str() noexcept { return s_lna; }
211
212
220 get_adc() const
221 {
222 std::lock_guard scoped_lock(m_mutex);
223 check();
224 check_init();
225 if (!m_adc)
226 {
227 std::ostringstream text;
228 text << "relationship \"" << s_adc << "\" of object " << this << " is not set";
229 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
230 }
231 return m_adc;
232 }
233
234
241 void
243
251 get_pga() const
252 {
253 std::lock_guard scoped_lock(m_mutex);
254 check();
255 check_init();
256 if (!m_pga)
257 {
258 std::ostringstream text;
259 text << "relationship \"" << s_pga << "\" of object " << this << " is not set";
260 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
261 }
262 return m_pga;
263 }
264
265
272 void
274
282 get_lna() const
283 {
284 std::lock_guard scoped_lock(m_mutex);
285 check();
286 check_init();
287 if (!m_lna)
288 {
289 std::ostringstream text;
290 text << "relationship \"" << s_lna << "\" of object " << this << " is not set";
291 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
292 }
293 return m_lna;
294 }
295
296
303 void
305
306 };
307
308 // out stream operator
309
310 inline std::ostream& operator<<(std::ostream& s, const DaphneV2AFE& obj)
311 {
312 return obj.print_object(s);
313 }
314
315 typedef std::vector<const DaphneV2AFE*>::const_iterator DaphneV2AFEIterator;
316
317 }
318}
319
320#endif
#define ERS_HERE
void set_attenuator(uint16_t value)
Set "attenuator" attribute value.
void set_pga(const dunedaq::appmodel::DaphneV2PGA *value)
Set "pga" relationship value.
static const std::string s_afe_id
static const std::string s_attenuator
static const std::string & __get_attenuator_str() noexcept
static const std::string & __get_v_bias_str() noexcept
const dunedaq::appmodel::DaphneV2LNA * get_lna() const
Get "lna" relationship value.
const dunedaq::appmodel::DaphneV2ADC * m_adc
void set_afe_id(uint8_t value)
Set "afe_id" attribute value. id in the [0,5) range.
static const std::string s_lna
static const std::string s_adc
virtual ~DaphneV2AFE() noexcept
void set_adc(const dunedaq::appmodel::DaphneV2ADC *value)
Set "adc" relationship value.
uint16_t get_attenuator() const
Get "attenuator" attribute value.
uint16_t get_v_bias() const
Get "v_bias" attribute value. Value for V gain of the AFE, 12 bit register. The bias have to be under...
const dunedaq::appmodel::DaphneV2PGA * m_pga
DaphneV2AFE(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
void set_lna(const dunedaq::appmodel::DaphneV2LNA *value)
Set "lna" relationship value.
friend class conffwk::DalFactory
const dunedaq::appmodel::DaphneV2PGA * get_pga() const
Get "pga" relationship value.
static const std::string & __get_adc_str() noexcept
static const std::string & s_class_name
const dunedaq::appmodel::DaphneV2ADC * get_adc() const
Get "adc" relationship value.
virtual void init(bool init_children)
static const std::string & __get_afe_id_str() noexcept
static const std::string s_pga
friend class conffwk::DalObject
const dunedaq::appmodel::DaphneV2LNA * m_lna
uint8_t get_afe_id() const
Get "afe_id" attribute value. id in the [0,5) range.
static const std::string & __get_lna_str() noexcept
virtual std::vector< const dunedaq::conffwk::DalObject * > get(const std::string &name, bool upcast_unregistered=true) const
Get values of relationships and results of some algorithms as a vector of dunedaq::conffwk::DalObject...
void set_v_bias(uint16_t value)
Set "v_bias" attribute value. Value for V gain of the AFE, 12 bit register. The bias have to be under...
static const std::string s_v_bias
static const std::string & __get_pga_str() noexcept
void set_by_val(const std::string &name, T value)
Set attribute value.
The base class for any generated DAL object.
Definition DalObject.hpp:45
std::mutex m_mutex
Used to protect changes of DAL object.
ConfigObject p_obj
Config object used by given template object.
void check_init() const
Check and initialize object if necessary.
DalRegistry: A registry of DalObjects It provides a single interface to create, cache and manage DalO...
Generic configuration exception.
conffwk entry point
double offset
std::ostream & operator<<(std::ostream &s, const AVXAbsRunSumProcessor &obj)
std::vector< constDaphneV2AFE * >::const_iterator DaphneV2AFEIterator
Including Qt Headers.