DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DaphneV2BoardConf.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _DaphneV2BoardConf_0_dunedaq__appmodel_0_appmodel_H_
4#define _DaphneV2BoardConf_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 DaphneV2AFE;
22 class DaphneV2Channel;
23 }
24}
25
26
27namespace dunedaq {
28 namespace appmodel {
29
34 class DaphneV2BoardConf : public virtual dunedaq::conffwk::DalObject {
35
37 friend class conffwk::DalObject;
38 friend class conffwk::DalFactory;
40
41 protected:
42
44 virtual ~DaphneV2BoardConf() noexcept;
45 virtual void init(bool init_children);
46
47 public:
48
51 static const std::string& s_class_name;
52
53
63 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
64
65
75 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
76
77
78 protected:
79
80 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
81
82
83 private:
84
85 uint16_t m_bias_ctrl;
87 std::vector<uint8_t> m_full_stream_channels;
89 uint32_t m_tp_conf;
90 uint64_t m_compensator;
91 uint64_t m_inverter;
92 std::string m_address;
93 uint16_t m_slot_id;
94 uint16_t m_crate_id;
95 uint16_t m_detector_id;
96 std::vector<const dunedaq::appmodel::DaphneV2Channel*> m_active_channels;
97 std::vector<const dunedaq::appmodel::DaphneV2AFE*> m_active_afes;
100
101
102 public:
103
104 // attribute names
105
106 inline static const std::string s_bias_ctrl = "bias_ctrl";
107 inline static const std::string s_self_trigger_threshold = "self_trigger_threshold";
108 inline static const std::string s_full_stream_channels = "full_stream_channels";
109 inline static const std::string s_self_trigger_xcorr = "self_trigger_xcorr";
110 inline static const std::string s_tp_conf = "tp_conf";
111 inline static const std::string s_compensator = "compensator";
112 inline static const std::string s_inverter = "inverter";
113 inline static const std::string s_address = "address";
114 inline static const std::string s_slot_id = "slot_id";
115 inline static const std::string s_crate_id = "crate_id";
116 inline static const std::string s_detector_id = "detector_id";
117
118 static const std::string& __get_bias_ctrl_str() noexcept { return s_bias_ctrl; }
119 static const std::string& __get_self_trigger_threshold_str() noexcept { return s_self_trigger_threshold; }
120 static const std::string& __get_full_stream_channels_str() noexcept { return s_full_stream_channels; }
121 static const std::string& __get_self_trigger_xcorr_str() noexcept { return s_self_trigger_xcorr; }
122 static const std::string& __get_tp_conf_str() noexcept { return s_tp_conf; }
123 static const std::string& __get_compensator_str() noexcept { return s_compensator; }
124 static const std::string& __get_inverter_str() noexcept { return s_inverter; }
125 static const std::string& __get_address_str() noexcept { return s_address; }
126 static const std::string& __get_slot_id_str() noexcept { return s_slot_id; }
127 static const std::string& __get_crate_id_str() noexcept { return s_crate_id; }
128 static const std::string& __get_detector_id_str() noexcept { return s_detector_id; }
129
130
138 uint16_t
140 {
141 std::lock_guard scoped_lock(m_mutex);
142 check();
143 check_init();
144 return m_bias_ctrl;
145 }
146
154 void
155 set_bias_ctrl(uint16_t value)
156 {
157 std::lock_guard scoped_lock(m_mutex);
158 check();
159 clear();
161 }
162
163
171 uint64_t
173 {
174 std::lock_guard scoped_lock(m_mutex);
175 check();
176 check_init();
178 }
179
187 void
189 {
190 std::lock_guard scoped_lock(m_mutex);
191 check();
192 clear();
194 }
195
196
204 const std::vector<uint8_t>&
206 {
207 std::lock_guard scoped_lock(m_mutex);
208 check();
209 check_init();
211 }
212
220 void
221 set_full_stream_channels(const std::vector<uint8_t>& value)
222 {
223 std::lock_guard scoped_lock(m_mutex);
224 check();
225 clear();
227 }
228
229
236 uint64_t
238 {
239 std::lock_guard scoped_lock(m_mutex);
240 check();
241 check_init();
243 }
244
251 void
253 {
254 std::lock_guard scoped_lock(m_mutex);
255 check();
256 clear();
258 }
259
260
267 uint32_t
269 {
270 std::lock_guard scoped_lock(m_mutex);
271 check();
272 check_init();
273 return m_tp_conf;
274 }
275
282 void
283 set_tp_conf(uint32_t value)
284 {
285 std::lock_guard scoped_lock(m_mutex);
286 check();
287 clear();
288 p_obj.set_by_val(s_tp_conf, value);
289 }
290
291
298 uint64_t
300 {
301 std::lock_guard scoped_lock(m_mutex);
302 check();
303 check_init();
304 return m_compensator;
305 }
306
313 void
314 set_compensator(uint64_t value)
315 {
316 std::lock_guard scoped_lock(m_mutex);
317 check();
318 clear();
320 }
321
322
329 uint64_t
331 {
332 std::lock_guard scoped_lock(m_mutex);
333 check();
334 check_init();
335 return m_inverter;
336 }
337
344 void
345 set_inverter(uint64_t value)
346 {
347 std::lock_guard scoped_lock(m_mutex);
348 check();
349 clear();
351 }
352
353
361 const std::string&
363 {
364 std::lock_guard scoped_lock(m_mutex);
365 check();
366 check_init();
367 return m_address;
368 }
369
377 void
378 set_address(const std::string& value)
379 {
380 std::lock_guard scoped_lock(m_mutex);
381 check();
382 clear();
383 p_obj.set_by_ref(s_address, value);
384 }
385
386
393 uint16_t
395 {
396 std::lock_guard scoped_lock(m_mutex);
397 check();
398 check_init();
399 return m_slot_id;
400 }
401
408 void
409 set_slot_id(uint16_t value)
410 {
411 std::lock_guard scoped_lock(m_mutex);
412 check();
413 clear();
414 p_obj.set_by_val(s_slot_id, value);
415 }
416
417
424 uint16_t
426 {
427 std::lock_guard scoped_lock(m_mutex);
428 check();
429 check_init();
430 return m_crate_id;
431 }
432
439 void
440 set_crate_id(uint16_t value)
441 {
442 std::lock_guard scoped_lock(m_mutex);
443 check();
444 clear();
446 }
447
448
455 uint16_t
457 {
458 std::lock_guard scoped_lock(m_mutex);
459 check();
460 check_init();
461 return m_detector_id;
462 }
463
470 void
471 set_detector_id(uint16_t value)
472 {
473 std::lock_guard scoped_lock(m_mutex);
474 check();
475 clear();
477 }
478
479
480 // relationship names
481
482 inline static const std::string s_active_channels = "active_channels";
483 inline static const std::string s_active_afes = "active_afes";
484 inline static const std::string s_default_channel = "default_channel";
485 inline static const std::string s_default_afe = "default_afe";
486
487 static const std::string& __get_active_channels_str() noexcept { return s_active_channels; }
488 static const std::string& __get_active_afes_str() noexcept { return s_active_afes; }
489 static const std::string& __get_default_channel_str() noexcept { return s_default_channel; }
490 static const std::string& __get_default_afe_str() noexcept { return s_default_afe; }
491
492
499 const std::vector<const dunedaq::appmodel::DaphneV2Channel*>&
501 {
502 std::lock_guard scoped_lock(m_mutex);
503 check();
504 check_init();
505 return m_active_channels;
506 }
507
508
515 void
516 set_active_channels(const std::vector<const dunedaq::appmodel::DaphneV2Channel*>& value);
517
524 const std::vector<const dunedaq::appmodel::DaphneV2AFE*>&
526 {
527 std::lock_guard scoped_lock(m_mutex);
528 check();
529 check_init();
530 return m_active_afes;
531 }
532
533
540 void
541 set_active_afes(const std::vector<const dunedaq::appmodel::DaphneV2AFE*>& value);
542
551 {
552 std::lock_guard scoped_lock(m_mutex);
553 check();
554 check_init();
556 {
557 std::ostringstream text;
558 text << "relationship \"" << s_default_channel << "\" of object " << this << " is not set";
559 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
560 }
561 return m_default_channel;
562 }
563
564
571 void
573
582 {
583 std::lock_guard scoped_lock(m_mutex);
584 check();
585 check_init();
586 if (!m_default_afe)
587 {
588 std::ostringstream text;
589 text << "relationship \"" << s_default_afe << "\" of object " << this << " is not set";
590 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
591 }
592 return m_default_afe;
593 }
594
595
602 void
604
605
606 public:
607
608 // user-defined algorithms
609
614 const DaphneV2Channel & get_channel(size_t ch) const ;
615
616
621 const DaphneV2AFE & get_afe( size_t id) const ;
622
623
628 bool is_channel_used(size_t ch) const;
629
630
635 bool is_afe_used(size_t ch) const;
636 };
637
638 // out stream operator
639
640 inline std::ostream& operator<<(std::ostream& s, const DaphneV2BoardConf& obj)
641 {
642 return obj.print_object(s);
643 }
644
645 typedef std::vector<const DaphneV2BoardConf*>::const_iterator DaphneV2BoardConfIterator;
646
647 }
648}
649
650#endif
#define ERS_HERE
static const std::string & __get_active_channels_str() noexcept
const std::vector< const dunedaq::appmodel::DaphneV2AFE * > & get_active_afes() const
Get "active_afes" relationship value.
static const std::string & __get_compensator_str() noexcept
void set_default_channel(const dunedaq::appmodel::DaphneV2Channel *value)
Set "default_channel" relationship value.
static const std::string & __get_default_afe_str() noexcept
const DaphneV2AFE & get_afe(size_t id) const
uint16_t get_slot_id() const
Get "slot_id" attribute value.
const DaphneV2Channel & get_channel(size_t ch) const
std::vector< uint8_t > m_full_stream_channels
const dunedaq::appmodel::DaphneV2Channel * m_default_channel
static const std::string & __get_default_channel_str() noexcept
void set_default_afe(const dunedaq::appmodel::DaphneV2AFE *value)
Set "default_afe" relationship value.
static const std::string & __get_detector_id_str() noexcept
static const std::string & __get_slot_id_str() noexcept
uint64_t get_self_trigger_threshold() const
Get "self_trigger_threshold" attribute value. Configuration for full stream case. If it is 0,...
uint16_t get_crate_id() const
Get "crate_id" attribute value.
static const std::string & __get_tp_conf_str() noexcept
static const std::string s_self_trigger_threshold
std::vector< const dunedaq::appmodel::DaphneV2AFE * > m_active_afes
const dunedaq::appmodel::DaphneV2AFE * m_default_afe
const dunedaq::appmodel::DaphneV2Channel * get_default_channel() const
Get "default_channel" relationship value.
const std::string & get_address() const
Get "address" attribute value. ip address of the board.
static const std::string s_self_trigger_xcorr
static const std::string s_full_stream_channels
static const std::string & s_class_name
static const std::string & __get_bias_ctrl_str() noexcept
void set_inverter(uint64_t value)
Set "inverter" attribute value.
void set_detector_id(uint16_t value)
Set "detector_id" attribute value.
static const std::string & __get_address_str() noexcept
static const std::string & __get_crate_id_str() noexcept
uint16_t get_bias_ctrl() const
Get "bias_ctrl" attribute value. V bias control.
void set_self_trigger_threshold(uint64_t value)
Set "self_trigger_threshold" attribute value. Configuration for full stream case. If it is 0,...
static const std::string & __get_active_afes_str() noexcept
uint64_t get_self_trigger_xcorr() const
Get "self_trigger_xcorr" attribute value.
DaphneV2BoardConf(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
static const std::string & __get_self_trigger_threshold_str() noexcept
void set_tp_conf(uint32_t value)
Set "tp_conf" attribute value.
std::vector< const dunedaq::appmodel::DaphneV2Channel * > m_active_channels
static const std::string & __get_full_stream_channels_str() noexcept
void set_full_stream_channels(const std::vector< uint8_t > &value)
Set "full_stream_channels" attribute value. list of channels to be used in full stream.
uint64_t get_inverter() const
Get "inverter" attribute value.
static const std::string & __get_inverter_str() noexcept
virtual void init(bool init_children)
const std::vector< const dunedaq::appmodel::DaphneV2Channel * > & get_active_channels() const
Get "active_channels" relationship value.
void set_active_channels(const std::vector< const dunedaq::appmodel::DaphneV2Channel * > &value)
Set "active_channels" relationship value.
uint16_t get_detector_id() const
Get "detector_id" attribute value.
const std::vector< uint8_t > & get_full_stream_channels() const
Get "full_stream_channels" attribute value. list of channels to be used in full stream.
uint32_t get_tp_conf() const
Get "tp_conf" attribute value.
static const std::string & __get_self_trigger_xcorr_str() noexcept
void set_self_trigger_xcorr(uint64_t value)
Set "self_trigger_xcorr" attribute value.
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_bias_ctrl(uint16_t value)
Set "bias_ctrl" attribute value. V bias control.
void set_crate_id(uint16_t value)
Set "crate_id" attribute value.
void set_slot_id(uint16_t value)
Set "slot_id" attribute value.
void set_address(const std::string &value)
Set "address" attribute value. ip address of the board.
uint64_t get_compensator() const
Get "compensator" attribute value.
void set_compensator(uint64_t value)
Set "compensator" attribute value.
void set_active_afes(const std::vector< const dunedaq::appmodel::DaphneV2AFE * > &value)
Set "active_afes" relationship value.
const dunedaq::appmodel::DaphneV2AFE * get_default_afe() const
Get "default_afe" relationship value.
void set_by_val(const std::string &name, T value)
Set attribute value.
void set_by_ref(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< constDaphneV2BoardConf * >::const_iterator DaphneV2BoardConfIterator
The DUNE-DAQ namespace.
msgpack::object obj
Invalid address