Skip to content
This repository was archived by the owner on Jul 19, 2022. It is now read-only.

Commit 529c718

Browse files
committed
gr: be more generous of unconnected ports
Signed-off-by: Josh Morman <jmorman@gnuradio.org>
1 parent 83e69c9 commit 529c718

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

gr/lib/buffer_management.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ void buffer_manager::initialize_buffers(flat_graph_sptr fg,
6060
for (auto p : input_ports) {
6161
edge_vector_t ed = fg->find_edge(p);
6262
if (ed.empty()) {
63-
throw std::runtime_error("Edge associated with input port not found");
63+
///throw std::runtime_error("Edge associated with input port not found");
64+
continue;
6465
}
6566

6667
// TODO: more robust way of ensuring readers don't get double-added

gr/lib/flowgraph.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ void flowgraph::check_connections(const graph_sptr& g)
3939
// Are all non-optional ports connected to something
4040
for (auto& node : g->calc_used_nodes()) {
4141
for (auto& port : node->output_ports()) {
42-
if (!port->optional() && port->connected_ports().empty()) {
42+
if (!port->optional() && port->connected_ports().empty() &&
43+
node->get_message_port("pdus_out")->connected_ports().empty()) {
4344
throw std::runtime_error("Nothing connected to " + node->name() + ": " +
4445
port->name());
4546
}
@@ -49,7 +50,8 @@ void flowgraph::check_connections(const graph_sptr& g)
4950

5051
if (port->type() == port_type_t::STREAM) {
5152

52-
if (port->connected_ports().empty()) {
53+
if (port->connected_ports().empty() &&
54+
node->get_message_port("pdus_in")->connected_ports().empty()) {
5355
throw std::runtime_error("Nothing connected to " + node->name() +
5456
": " + port->name());
5557
}

schedulers/nbt/lib/graph_executor.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ graph_executor::run_one_iteration(std::vector<block_sptr> blocks)
1919
blocks = d_blocks;
2020
}
2121

22+
// This is only for streaming blocks
2223
for (auto const& b : blocks) { // TODO - order the blocks
24+
if (b->work_mode() != block_work_mode_t::DEFAULT) {
25+
continue;
26+
}
2327

2428
std::vector<block_work_input_sptr> work_input; //(num_input_ports);
2529
std::vector<block_work_output_sptr> work_output; //(num_output_ports);

0 commit comments

Comments
 (0)