DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DAPHNEStreamFrameProcessor.cpp
Go to the documentation of this file.
1
11
12#include <atomic>
13#include <functional>
14#include <memory>
15#include <string>
16
19
20namespace dunedaq {
21namespace fdreadoutlibs {
22
23void
25{
27 std::bind(&DAPHNEStreamFrameProcessor::timestamp_check, this, std::placeholders::_1));
28 // m_tasklist.push_back( std::bind(&DAPHNEStreamFrameProcessor::frame_error_check, this, std::placeholders::_1) );
29 TaskRawDataProcessorModel<types::DAPHNEStreamSuperChunkTypeAdapter>::conf(conf);
30}
31
35void
37{
38/* Let Source Emulator deal with this
39 // If EMU data, emulate perfectly incrementing timestamp
40 if (inherited::m_emulator_mode) { // emulate perfectly incrementing timestamp
41 uint64_t ts_next = m_previous_ts + 64; // NOLINT(build/unsigned)
42 auto df = reinterpret_cast<daphneframeptr>(((uint8_t*)fp)); // NOLINT
43 for (unsigned int i = 0; i < fp->get_num_frames(); ++i) { // NOLINT(build/unsigned)
44 //auto wfh = const_cast<dunedaq::fddetdataformats::WIB2Header*>(wf->get_wib_header());
45 df->set_timestamp(ts_next);
46 ts_next += 64;
47 df++;
48 }
49 }
50*/
51 // Acquire timestamp
53 uint64_t k_clock_frequency = 62500000; // NOLINT(build/unsigned)
54 TLOG_DEBUG(TLVL_FRAME_RECEIVED) << "Received DAPHNEStream frame timestamp value of " << m_current_ts << " ticks (..." << std::fixed << std::setprecision(8) << (static_cast<double>(m_current_ts % (k_clock_frequency*1000)) / static_cast<double>(k_clock_frequency)) << " sec)"; // NOLINT
55
56 // Check timestamp
57 // RS warning : not fixed rate!
58 // if (m_current_ts - m_previous_ts != ???) {
59 // ++m_ts_error_ctr;
60 //}
61
62 if (m_ts_error_ctr > 1000) {
63 if (!m_problem_reported) {
64 TLOG() << "*** Data Integrity ERROR *** Timestamp continuity is completely broken! "
65 << "Something is wrong with the FE source or with the configuration!";
66 m_problem_reported = true;
67 }
68 }
69
72}
73
77void
79{
80 // check error fields
81}
82
83} // namespace fdreadoutlibs
84} // namespace dunedaq
void conf(const appmodel::DataHandlerModule *conf) override
Set the emulator mode, if active, timestamps of processed packets are overwritten with new ones.
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112
#define TLOG(...)
Definition macro.hpp:22
Including Qt Headers.