Skip to content

Commit

Permalink
Merge pull request #731 from frmdstryr/symbol-rule-check-unused-junct…
Browse files Browse the repository at this point in the history
…ions

Check for unused junctions in symbol editor
  • Loading branch information
carrotIndustries committed Aug 29, 2023
2 parents f88c596 + 25179b0 commit 0ce0e68
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 0ce0e68

Please sign in to comment.