DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
HSIFrameProcessor.cpp
Go to the documentation of this file.
1
10#include "hsilibs/Types.hpp"
11
12#include <atomic>
13#include <functional>
14#include <memory>
15#include <string>
16
18
19namespace dunedaq {
20namespace hsilibs {
21
22void
24{
25 inherited::add_preprocess_task(std::bind(&HSIFrameProcessor::timestamp_check, this, std::placeholders::_1));
26 // m_tasklist.push_back( std::bind(&HSIFrameProcessor::frame_error_check, this, std::placeholders::_1) );
28}
29
30void
32{
33 // Acquire timestamp
34 timestamp_t current_ts = fp->get_timestamp();
35 uint64_t k_clock_frequency = 62500000; // NOLINT(build/unsigned)
36 TLOG_DEBUG(TLVL_FRAME_RECEIVED) << "Received HSI frame timestamp value of " << current_ts << " ticks (..."
37 << std::fixed << std::setprecision(8)
38 << (static_cast<double>(current_ts % (k_clock_frequency * 1000)) /
39 static_cast<double>(k_clock_frequency))
40 << " sec)"; // NOLINT
41
42 if (current_ts < m_previous_ts) {
43 TLOG() << "*** Data Integrity ERROR *** Current HSIFrame timestamp " << current_ts
44 << " is before previous timestamp " << m_previous_ts;
45 }
46
47 if (current_ts == 0) {
48 TLOG() << "*** Data Integrity ERROR *** Current HSIFrame timestamp " << current_ts << " is 0";
49 }
50
51 m_previous_ts = current_ts;
52 m_last_processed_daq_ts = current_ts;
53}
54
58void
60{
61 // check error fields
62}
63
64} // namespace hsilibs
65} // namespace dunedaq
@ TLVL_FRAME_RECEIVED
void conf(const appmodel::DataHandlerModule *conf) override
hsilibs::HSI_FRAME_STRUCT * frameptr
void conf(const appmodel::DataHandlerModule *conf) override
Set the emulator mode, if active, timestamps of processed packets are overwritten with new ones.
uint64_t get_timestamp() const
Definition Types.hpp:45
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:116
#define TLOG(...)
Definition macro.hpp:21
The DUNE-DAQ namespace.