DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
RawDataHandlerBase.hxx
Go to the documentation of this file.
1namespace dunedaq {
2namespace datahandlinglibs {
3
5 : m_configured(false)
6 , m_name(name)
7 , m_readout_impl(nullptr)
8 , m_run_marker{ false }
9{
10/*
11 register_command("conf", &RawDataHandlerBase::do_conf);
12 register_command("scrap", &RawDataHandlerBase::do_scrap);
13 register_command("start", &RawDataHandlerBase::do_start);
14 register_command("stop_trigger_sources", &RawDataHandlerBase::do_stop);
15 register_command("record", &RawDataHandlerBase::do_record);
16*/
17}
18
19
20void
21RawDataHandlerBase::init(std::shared_ptr<appfwk::ConfigurationManager> cfg)
22{
23
26 if(modconf == nullptr) {
27 throw dunedaq::datahandlinglibs::FailedReadoutInitialization(ERS_HERE, get_dlh_name(), "not a DataHandlerModule");
28 }
30 if (m_readout_impl == nullptr) {
31 TLOG() << get_dlh_name() << "Initialize readout implementation FAILED! "
32 << "Failed to find specialization for given queue setup!";
33 throw dunedaq::datahandlinglibs::FailedReadoutInitialization(ERS_HERE, get_dlh_name(), ""); // 4 json ident
34 }
36}
37
38// void
39// RawDataHandlerBase::get_info(opmonlib::InfoCollector& ci, int level)
40// {
41// m_readout_impl->get_info(ci, level);
42// }
43
44void
45RawDataHandlerBase::do_conf(const nlohmann::json& args)
46{
48 m_readout_impl->conf(args);
49 m_configured = true;
51}
52
53void
54RawDataHandlerBase::do_scrap(const nlohmann::json& args)
55{
57 m_readout_impl->scrap(args);
58 m_configured = false;
60}
61void
62RawDataHandlerBase::do_start(const nlohmann::json& args)
63{
65 m_run_marker.store(true);
66 m_readout_impl->start(args);
67 rcif::cmd::StartParams start_params = args.get<rcif::cmd::StartParams>();
68 m_run_number = start_params.run;
69 TLOG() << get_dlh_name() << " successfully started for run number " << m_run_number;
71}
72
73void
74RawDataHandlerBase::do_stop(const nlohmann::json& args)
75{
77 m_run_marker.store(false);
78 m_readout_impl->stop(args);
79 TLOG() << get_dlh_name() << " successfully stopped for run number " << m_run_number;
81}
82
83void
84RawDataHandlerBase::do_record(const nlohmann::json& args)
85{
86 TLOG_DEBUG(dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS) << get_dlh_name() << ": Entering do_issue_recording() method";
87 m_readout_impl->record(args);
88 TLOG_DEBUG(dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS) << get_dlh_name() << ": Exiting do_issue_recording() method";
89}
90
91} // namespace datahandlinglibs
92} // namespace dunedaq
93
#define ERS_HERE
virtual std::shared_ptr< dunedaq::datahandlinglibs::DataHandlingConcept > create_readout(const appmodel::DataHandlerModule *modconf, std::atomic< bool > &run_marker)=0
RawDataHandlerBase(const std::string &name)
RawDataHandlerBase Constructor.
void init(std::shared_ptr< appfwk::ConfigurationManager > cfg)
std::shared_ptr< datahandlinglibs::DataHandlingConcept > m_readout_impl
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112
#define TLOG(...)
Definition macro.hpp:22
Including Qt Headers.