LCOV - code coverage report
Current view: top level - timinglibs/src - TimingMasterControllerBase.hpp (source / functions) Coverage Total Hit
Test: code.result Lines: 16.7 % 6 1
Test Date: 2026-10-11 15:05:20 Functions: 11.1 % 9 1

            Line data    Source code
       1              : /**
       2              :  * @file TimingMasterControllerBase.hpp
       3              :  *
       4              :  * TimingMasterControllerBase is a DAQModule implementation that
       5              :  * provides a control interface for timing master hardware.
       6              :  *
       7              :  * This is part of the DUNE DAQ Software Suite, copyright 2020.
       8              :  * Licensing/copyright details are in the COPYING file that you should have
       9              :  * received with this code.
      10              :  */
      11              : 
      12              : #ifndef TIMINGLIBS_PLUGINS_TIMINGMASTERCONTROLLERBASE_HPP_
      13              : #define TIMINGLIBS_PLUGINS_TIMINGMASTERCONTROLLERBASE_HPP_
      14              : 
      15              : #include "timinglibs/TimingController.hpp"
      16              : #include "timinglibs/dal/TimingMasterControllerConf.hpp"
      17              : 
      18              : #include "timinglibs/timingcmd/Nljs.hpp"
      19              : #include "timinglibs/timingcmd/Structs.hpp"
      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.
      24              : #include "utilities/WorkerThread.hpp"
      25              : 
      26              : #include <memory>
      27              : #include <string>
      28              : #include <vector>
      29              : 
      30              : namespace dunedaq {
      31            1 : ERS_DECLARE_ISSUE(timinglibs,                                               ///< Namespace
      32              :                   TimingMasterNotReady,                                     ///< Issue class name
      33              :                   master << " timing master did not become ready in time.", ///< Message
      34              :                   ((std::string)master))                                    ///< Message parameters
      35              : namespace timinglibs {
      36              : 
      37              : /**
      38              :  * @brief TimingMasterControllerBase is a DAQModule implementation that
      39              :  * provides a control interface for timing master hardware.
      40              :  */
      41              : class TimingMasterControllerBase : public dunedaq::timinglibs::TimingController
      42              : {
      43              : public:
      44              :   /**
      45              :    * @brief TimingMasterControllerBase Constructor
      46              :    * @param name Instance name for this TimingMasterControllerBase instance
      47              :    */
      48              :   explicit TimingMasterControllerBase(const std::string& name);
      49              : 
      50              :   TimingMasterControllerBase(const TimingMasterControllerBase&) =
      51              :     delete; ///< TimingMasterControllerBase is not copy-constructible
      52              :   TimingMasterControllerBase& operator=(const TimingMasterControllerBase&) =
      53              :     delete; ///< TimingMasterControllerBase is not copy-assignable
      54              :   TimingMasterControllerBase(TimingMasterControllerBase&&) =
      55              :     delete; ///< TimingMasterControllerBase is not move-constructible
      56              :   TimingMasterControllerBase& operator=(TimingMasterControllerBase&&) =
      57              :     delete; ///< TimingMasterControllerBase is not move-assignable
      58            0 :   virtual ~TimingMasterControllerBase()
      59            0 :   {
      60            0 :     if (endpoint_scan_thread.thread_running())
      61            0 :       endpoint_scan_thread.stop_working_thread();
      62            0 :   }
      63              : 
      64              : protected:
      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:
        

Generated by: LCOV version 2.0-1