DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
TimingMasterControllerBase.hpp
Go to the documentation of this file.
1
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&) = delete;
51 TimingMasterControllerBase& operator=(const TimingMasterControllerBase&) =
52 delete;
53 TimingMasterControllerBase(TimingMasterControllerBase&&) = delete;
54 TimingMasterControllerBase& operator=(TimingMasterControllerBase&&) =
55 delete;
56 virtual ~TimingMasterControllerBase()
57 {
58 if (endpoint_scan_thread.thread_running())
59 endpoint_scan_thread.stop_working_thread();
60 }
61
62protected:
63 // Commands
64 void do_configure(const nlohmann::json&) override;
65 void do_start(const nlohmann::json& data) override;
66 void do_stop(const nlohmann::json& data) override;
67 void send_configure_hardware_commands(const nlohmann::json& data) override;
68
69 // timing master commands
70 void do_master_set_timestamp(const nlohmann::json&);
71 void do_master_set_endpoint_delay(const nlohmann::json& data);
72 void do_master_send_fl_command(const nlohmann::json& data);
73 void do_master_measure_endpoint_rtt(const nlohmann::json& data);
74 void do_master_endpoint_scan(const nlohmann::json& data);
75
76 // pass op mon info
77 // void get_info(opmonlib::InfoCollector& ci, int level) override;
78
79 timingcmd::TimingEndpointLocations m_monitored_endpoint_locations;
80 uint m_endpoint_scan_period; // NOLINT(build/unsigned)
81 dunedaq::utilities::WorkerThread endpoint_scan_thread;
82 virtual void endpoint_scan(std::atomic<bool>&);
83};
84} // namespace timinglibs
85} // namespace dunedaq
86
87#endif // TIMINGLIBS_PLUGINS_TIMINGMASTERCONTROLLERBASE_HPP_
88
89// Local Variables:
90// c-basic-offset: 2
91// End:
#define ERS_DECLARE_ISSUE(namespace_name, class_name, message, attributes)
Including Qt Headers.