Skip to content

Commit

Permalink
Add warning about unconnected components
Browse files Browse the repository at this point in the history
  • Loading branch information
17o2 committed Apr 16, 2024
1 parent 9cb9ede commit 8ba9131
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/wireviz/wireviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,19 @@ def alternate_type(): # flip between connector and cable/arrow
# mate two connectors as a whole
harness.add_mate_component(from_name, to_name, designator)

# warn about unused templates

proposed_components = list(template_connectors.keys()) + list(
template_cables.keys()
)
used_components = set(designators_and_templates.values())
forgotten_components = [c for c in proposed_components if not c in used_components]
if len(forgotten_components) > 0:
print(
"Warning: The following components are not referenced in any connection set:"
)
print(", ".join(forgotten_components))

# harness population completed =============================================

if "additional_bom_items" in yaml_data:
Expand Down

0 comments on commit 8ba9131

Please sign in to comment.