Add warning about unconnected components
This commit is contained in:
parent
a7e667e9b7
commit
d8c6230b85
@ -363,6 +363,19 @@ def parse(
|
||||
# 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))
|
||||
|
||||
if "additional_bom_items" in yaml_data:
|
||||
for line in yaml_data["additional_bom_items"]:
|
||||
harness.add_additional_bom_item(line)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user