DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
TimingMasterControllerBase.hpp
Go to the documentation of this file.
1
11
12#ifndef TIMINGLIBS_PLUGINS_TIMINGMASTERCONTROLLERBASE_HPP_
13#define TIMINGLIBS_PLUGINS_TIMINGMASTERCONTROLLERBASE_HPP_
14
17
20
21#include "appfwk/DAQModule.hpp"
22#include "ers/Issue.hpp"
23#include "logging/Logging.hpp" // NOTE: if ISSUES ARE DECLARED BEFORE include logging/Logging.hpp, TLOG_DEBUG<<issue wont work.
25
26#include <memory>
27#include <string>
28#include <vector>
29
30namespace dunedaq {
32 TimingMasterNotReady,
33 master << " timing master did not become ready in time.",
34 ((std::string)master))
35namespace timinglibs {
36
41class TimingMasterControllerBase : public dunedaq::timinglibs::TimingController
42{
43public:
48 explicit TimingMasterControllerBase(const std::string& name);
49
50 TimingMasterControllerBase(const TimingMasterControllerBase&) =
51 delete;
52 TimingMasterControllerBase& operator=(const TimingMasterControllerBase&) =
53 delete;
54 TimingMasterControllerBase(TimingMasterControllerBase&&) =
55 delete;
56 TimingMasterControllerBase& operator=(TimingMasterControllerBase&&) =
57 delete;
58 virtual ~TimingMasterControllerBase()
59 {
60 if (endpoint_scan_thread.thread_running())
61 endpoint_scan_thread.stop_working_thread();
62 }
63
64protected:
65 // Commands
66 void do_configure(const CommandData_t&) override;
67 void do_start(const CommandData_t& data) override;
68 void do_stop(const CommandData_t& data) override;
69 void send_configure_hardware_commands(const CommandData_t& data) override;
70
71 // timing master commands
72 void do_master_set_timestamp(const CommandData_t&);
73 void do_master_set_endpoint_delay(const CommandData_t& data);
74 void do_master_send_fl_command(const CommandData_t& data);
75 void do_master_measure_endpoint_rtt(const CommandData_t& data);
76 void do_master_endpoint_scan(const CommandData_t& data);
77
78 // pass op mon info
79 // void get_info(opmonlib::InfoCollector& ci, int level) override;
80
81 timingcmd::TimingEndpointLocations m_monitored_endpoint_locations;
82 uint m_endpoint_scan_period; // NOLINT(build/unsigned)
83 dunedaq::utilities::WorkerThread endpoint_scan_thread;
84 virtual void endpoint_scan(std::atomic<bool>&);
85};
86} // namespace timinglibs
87} // namespace dunedaq
88
89#endif // TIMINGLIBS_PLUGINS_TIMINGMASTERCONTROLLERBASE_HPP_
90
91// Local Variables:
92// c-basic-offset: 2
93// End:
WorkerThread contains a thread which runs the do_work() function.
The DUNE-DAQ namespace.
ERS_DECLARE_ISSUE(cibmodules, CIBCommunicationError, " CIB Hardware Communication Error: "<< descriptor,((std::string) descriptor)) ERS_DECLARE_ISSUE(cibmodules