HSIEventSender provides an interface to process and and send HSIEvents.
More...
#include <HSIEventSender.hpp>
HSIEventSender provides an interface to process and and send HSIEvents.
Definition at line 33 of file HSIEventSender.hpp.
◆ hsievent_sender_ct
◆ raw_sender_ct
◆ HSIEventSender() [1/3]
dunedaq::hsilibs::HSIEventSender::HSIEventSender |
( |
const std::string & | name | ) |
|
|
explicit |
HSIEventSender Constructor.
- Parameters
-
Definition at line 26 of file HSIEventSender.cpp.
27 : dunedaq::appfwk::DAQModule(name)
34{
35}
std::atomic< uint64_t > m_last_sent_timestamp
std::string m_hsievent_send_connection
std::atomic< uint64_t > m_failed_to_send_counter
std::atomic< uint64_t > m_sent_counter
std::shared_ptr< hsievent_sender_ct > m_hsievent_sender
std::chrono::milliseconds m_queue_timeout
◆ HSIEventSender() [2/3]
dunedaq::hsilibs::HSIEventSender::HSIEventSender |
( |
const HSIEventSender & | | ) |
|
|
delete |
◆ HSIEventSender() [3/3]
dunedaq::hsilibs::HSIEventSender::HSIEventSender |
( |
HSIEventSender && | | ) |
|
|
delete |
◆ do_configure()
virtual void dunedaq::hsilibs::HSIEventSender::do_configure |
( |
const nlohmann::json & | obj | ) |
|
|
protectedpure virtual |
◆ do_scrap()
virtual void dunedaq::hsilibs::HSIEventSender::do_scrap |
( |
const nlohmann::json & | obj | ) |
|
|
protectedpure virtual |
◆ do_start()
virtual void dunedaq::hsilibs::HSIEventSender::do_start |
( |
const nlohmann::json & | obj | ) |
|
|
protectedpure virtual |
◆ do_stop()
virtual void dunedaq::hsilibs::HSIEventSender::do_stop |
( |
const nlohmann::json & | obj | ) |
|
|
protectedpure virtual |
◆ init()
void dunedaq::hsilibs::HSIEventSender::init |
( |
std::shared_ptr< appfwk::ConfigurationManager > | mcfg | ) |
|
|
override |
Definition at line 38 of file HSIEventSender.cpp.
39{
40 auto mdal = mcfg->get_dal<confmodel::DaqModule>(get_name());
41
42 if (!mdal) {
43 throw appfwk::CommandFailed(
ERS_HERE,
"init", get_name(),
"Unable to retrieve configuration object");
44 }
45
46 for (auto con : mdal->get_outputs()) {
49 }
50 }
51
53}
static std::shared_ptr< iomanager::SenderConcept< Datatype > > get_iom_sender(iomanager::ConnectionId const &id)
Unknown serialization Cannot deserialize std::string datatype_to_string()
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ ready_to_send()
bool dunedaq::hsilibs::HSIEventSender::ready_to_send |
( |
std::chrono::milliseconds | timeout | ) |
|
|
protectedvirtual |
◆ send_hsi_event()
Definition at line 65 of file HSIEventSender.cpp.
66{
68 << event.header << ", " << std::bitset<32>(event.signal_map) << ", " << event.timestamp << ", "
69 << event.sequence_counter << "\n";
70
71 bool was_successfully_sent = false;
72 while (!was_successfully_sent) {
73 try {
74 dfmessages::HSIEvent event_copy(event);
78 was_successfully_sent = true;
79 } catch (const dunedaq::iomanager::TimeoutExpired& excpt) {
80 std::ostringstream oss_warn;
84 }
85 }
88}
#define TLOG_DEBUG(lvl,...)
void error(const Issue &issue)
◆ send_raw_hsi_data()
void dunedaq::hsilibs::HSIEventSender::send_raw_hsi_data |
( |
const std::array< uint32_t, 7 > & | raw_data, |
|
|
raw_sender_ct * | sender ) |
|
protectedvirtual |
Definition at line 91 of file HSIEventSender.cpp.
92{
94 ::memcpy(&payload, &raw_data[0], sizeof(HSI_FRAME_STRUCT));
95
96 TLOG_DEBUG(3) << get_name() <<
": Sending HSI_FRAME_STRUCT " << std::hex <<
"0x" <<
payload.frame.version <<
", 0x"
98
99 <<
"; 0x" <<
payload.frame.timestamp_low <<
"; 0x" <<
payload.frame.timestamp_high <<
"; 0x"
101 <<
"; 0x" <<
payload.frame.sequence << std::endl;
102
103 try {
104
105 if (!sender) {
106 throw(QueueIsNullFatalError(
ERS_HERE, get_name(),
"HSIEventSender output"));
107 }
109 } catch (const dunedaq::iomanager::TimeoutExpired& excpt) {
110 std::ostringstream oss_warn;
111 oss_warn << "push to output raw hsi data queue failed";
114 }
115}
◆ m_failed_to_send_counter
std::atomic<uint64_t> dunedaq::hsilibs::HSIEventSender::m_failed_to_send_counter |
|
protected |
◆ m_hsievent_send_connection
std::string dunedaq::hsilibs::HSIEventSender::m_hsievent_send_connection |
|
protected |
◆ m_hsievent_sender
◆ m_last_sent_timestamp
std::atomic<uint64_t> dunedaq::hsilibs::HSIEventSender::m_last_sent_timestamp |
|
protected |
◆ m_queue_timeout
std::chrono::milliseconds dunedaq::hsilibs::HSIEventSender::m_queue_timeout |
|
protected |
◆ m_sent_counter
std::atomic<uint64_t> dunedaq::hsilibs::HSIEventSender::m_sent_counter |
|
protected |
The documentation for this class was generated from the following files: