Skip to content

Commit

Permalink
Check for unused junctions for #730
Browse files Browse the repository at this point in the history
  • Loading branch information
frmdstryr committed Aug 28, 2023
1 parent bd91a8d commit 25179b0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/symbol/symbol_rules_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,19 @@ RulesCheckResult SymbolRules::check_symbol(const Symbol &sym) const
}
}

{
// Check unused junctions
for (const auto &[uu, junction] : sym.junctions) {
if (junction.connected_lines.size() == 0 && junction.connected_arcs.size() == 0) {
r.errors.emplace_back(RulesCheckErrorLevel::WARN);
auto &x = r.errors.back();
x.comment = "Junction has no connections";
x.has_location = true;
x.location = junction.position;
}
}
}

r.update();
return r;
}
Expand Down

0 comments on commit 25179b0

Please sign in to comment.