DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
SwitchyardNode.cpp
Go to the documentation of this file.
1
10
11#include "timing/toolbox.hpp"
12#include "logging/Logging.hpp"
13
14#include <string>
15
16namespace dunedaq {
17namespace timing {
18
19UHAL_REGISTER_DERIVED_NODE(SwitchyardNode)
20
21//-----------------------------------------------------------------------------
23 : TimingNode(node)
24{}
25//-----------------------------------------------------------------------------
26
27//-----------------------------------------------------------------------------
29//-----------------------------------------------------------------------------
30
31//-----------------------------------------------------------------------------
32std::string
33SwitchyardNode::get_status(bool print_out) const
34{
35 std::stringstream status;
36 auto subnodes = read_sub_nodes(getNode("csr.ctrl"));
37 status << format_reg_table(subnodes, "Switchyard state");
38
39 if (print_out)
40 TLOG() << status.str();
41 return status.str();
42}
43//-----------------------------------------------------------------------------
44
45//-----------------------------------------------------------------------------
46void
47SwitchyardNode::configure_master_source(uint8_t master_source, bool dispatch) const // NOLINT(build/unsigned)
48{
49 getNode("csr.ctrl.master_src").write(master_source);
50 if (dispatch)
51 getClient().dispatch();
52}
53//-----------------------------------------------------------------------------
54
55//-----------------------------------------------------------------------------
56void
57SwitchyardNode::configure_endpoint_source(uint8_t endpoint_source, bool dispatch) const // NOLINT(build/unsigned)
58{
59 getNode("csr.ctrl.ep_src").write(endpoint_source);
60 if (dispatch)
61 getClient().dispatch();
62}
63//-----------------------------------------------------------------------------
64
65} // namespace timing
66} // namespace dunedaq
Class for master global node.
void configure_endpoint_source(uint8_t endpoint_source, bool dispatch=true) const
Configure endpoint source.
void configure_master_source(uint8_t master_source, bool dispatch=true) const
Configure master source.
std::string get_status(bool print_out=false) const override
Print the status of the timing node.
Base class for timing nodes.
std::map< std::string, uhal::ValWord< uint32_t > > read_sub_nodes(const uhal::Node &node, bool dispatch=true) const
Read subnodes.
#define TLOG(...)
Definition macro.hpp:22
std::string format_reg_table(T data, std::string title, std::vector< std::string > headers)
Format reg-value table.
Definition toolbox.hxx:166
Including Qt Headers.