summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnuradio-runtime/include/gnuradio/flowgraph.h14
-rw-r--r--gnuradio-runtime/include/gnuradio/top_block.h6
-rw-r--r--gnuradio-runtime/lib/flat_flowgraph.cc9
-rw-r--r--gnuradio-runtime/lib/flat_flowgraph.h3
-rw-r--r--gnuradio-runtime/lib/top_block.cc16
-rw-r--r--gnuradio-runtime/lib/top_block_impl.cc9
-rw-r--r--gnuradio-runtime/lib/top_block_impl.h3
7 files changed, 60 insertions, 0 deletions
diff --git a/gnuradio-runtime/include/gnuradio/flowgraph.h b/gnuradio-runtime/include/gnuradio/flowgraph.h
index cfa451f11b..1271c2d60e 100644
--- a/gnuradio-runtime/include/gnuradio/flowgraph.h
+++ b/gnuradio-runtime/include/gnuradio/flowgraph.h
@@ -251,6 +251,20 @@ namespace gr {
return os;
}
+ inline std::ostream&
+ operator <<(std::ostream &os, const msg_endpoint endp)
+ {
+ os << endp.block()->alias() << ":" << pmt::symbol_to_string(endp.port());
+ return os;
+ }
+
+ inline std::ostream&
+ operator <<(std::ostream &os, const msg_edge edge)
+ {
+ os << edge.src() << "->" << edge.dst();
+ return os;
+ }
+
} /* namespace gr */
#endif /* INCLUDED_GR_RUNTIME_FLOWGRAPH_H */
diff --git a/gnuradio-runtime/include/gnuradio/top_block.h b/gnuradio-runtime/include/gnuradio/top_block.h
index b3692e09e2..7f3556a546 100644
--- a/gnuradio-runtime/include/gnuradio/top_block.h
+++ b/gnuradio-runtime/include/gnuradio/top_block.h
@@ -122,6 +122,12 @@ namespace gr {
std::string edge_list();
/*!
+ * Returns a string that lists the msg edge connections in the
+ * flattened flowgraph.
+ */
+ std::string msg_edge_list();
+
+ /*!
* Displays flattened flowgraph edges and block connectivity
*/
void dump();
diff --git a/gnuradio-runtime/lib/flat_flowgraph.cc b/gnuradio-runtime/lib/flat_flowgraph.cc
index 8b188799a5..b8a1a67bc7 100644
--- a/gnuradio-runtime/lib/flat_flowgraph.cc
+++ b/gnuradio-runtime/lib/flat_flowgraph.cc
@@ -335,6 +335,15 @@ namespace gr {
return s.str();
}
+ std::string
+ flat_flowgraph::msg_edge_list()
+ {
+ std::stringstream s;
+ for(msg_edge_viter_t e = d_msg_edges.begin(); e != d_msg_edges.end(); e++)
+ s << (*e) << std::endl;
+ return s.str();
+ }
+
void flat_flowgraph::dump()
{
for(edge_viter_t e = d_edges.begin(); e != d_edges.end(); e++)
diff --git a/gnuradio-runtime/lib/flat_flowgraph.h b/gnuradio-runtime/lib/flat_flowgraph.h
index fe43969b6f..f740299fa7 100644
--- a/gnuradio-runtime/lib/flat_flowgraph.h
+++ b/gnuradio-runtime/lib/flat_flowgraph.h
@@ -55,6 +55,9 @@ namespace gr {
// Return a string list of edges
std::string edge_list();
+ // Return a string list of msg edges
+ std::string msg_edge_list();
+
void dump();
/*!
diff --git a/gnuradio-runtime/lib/top_block.cc b/gnuradio-runtime/lib/top_block.cc
index 0cffbcadee..99f8330add 100644
--- a/gnuradio-runtime/lib/top_block.cc
+++ b/gnuradio-runtime/lib/top_block.cc
@@ -103,6 +103,12 @@ namespace gr {
return d_impl->edge_list();
}
+ std::string
+ top_block::msg_edge_list()
+ {
+ return d_impl->msg_edge_list();
+ }
+
void
top_block::dump()
{
@@ -153,6 +159,16 @@ namespace gr {
RPC_PRIVLVL_MIN, DISPNULL)));
}
+ if(prefs::singleton()->get_bool("ControlPort", "edges_list", false)) {
+ add_rpc_variable(
+ rpcbasic_sptr(new rpcbasic_register_get<top_block, std::string>(
+ alias(), "msg edges list",
+ &top_block::msg_edge_list,
+ pmt::mp(""), pmt::mp(""), pmt::mp(""),
+ "msg_edges", "List of msg edges in the graph",
+ RPC_PRIVLVL_MIN, DISPNULL)));
+ }
+
#ifdef GNURADIO_HRT_USE_CLOCK_GETTIME
std::string initial_clock = prefs::singleton()->get_string("PerfCounters", "clock", "thread");
if(initial_clock.compare("thread") == 0){
diff --git a/gnuradio-runtime/lib/top_block_impl.cc b/gnuradio-runtime/lib/top_block_impl.cc
index 9d377f469f..b7322c8e2a 100644
--- a/gnuradio-runtime/lib/top_block_impl.cc
+++ b/gnuradio-runtime/lib/top_block_impl.cc
@@ -190,6 +190,15 @@ namespace gr {
return "";
}
+ std::string
+ top_block_impl::msg_edge_list()
+ {
+ if(d_ffg)
+ return d_ffg->msg_edge_list();
+ else
+ return "";
+ }
+
void
top_block_impl::dump()
{
diff --git a/gnuradio-runtime/lib/top_block_impl.h b/gnuradio-runtime/lib/top_block_impl.h
index 9e0e661a02..67395e0c35 100644
--- a/gnuradio-runtime/lib/top_block_impl.h
+++ b/gnuradio-runtime/lib/top_block_impl.h
@@ -60,6 +60,9 @@ namespace gr {
// Return a string list of edges
std::string edge_list();
+ // Return a string list of msg edges
+ std::string msg_edge_list();
+
// Dump the flowgraph to stdout
void dump();