From 79ee5e3c64c0140a61324914d24049478a9cf7f5 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Tue, 28 May 2019 14:47:24 +0200 Subject: create-bom: Don't skip unmatched parts from the BOM. part-validate-parts: Read parts from the schematic, BOM and supplier's parts for even better rules. Enhancing footprint rule to check that the BOM part has the same footprint. --- src/ee/bom.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/ee/bom.py') diff --git a/src/ee/bom.py b/src/ee/bom.py index 0a0225d..dd1c016 100644 --- a/src/ee/bom.py +++ b/src/ee/bom.py @@ -139,13 +139,19 @@ def create_bom(project: Project, schematic_path: Path, out_path: Path, part_dbs: for bom_part in bom_parts: if not bom_part.selected_part: log.info("No part selected for {}".format(bom_part.part.printable_reference)) - continue + supplier_part = None + else: + supplier_part = bom_part.selected_part - supplier_part = bom_part.selected_part + uri = None # TODO: generate - part = Part(types.Part(supplier=supplier_part.supplier)) + part = Part(types.Part(uri=uri)) + # TODO: this should use the part's uri instead of schematic reference. However, right now there is no way to + # differentiate between two part-reference objects. part.add_schematic_reference(bom_part.part.get_exactly_one_schematic_reference().referenceProp) - part.add_part_reference(supplier_part.uri) + + if supplier_part: + part.add_part_reference(supplier_part.uri) out_parts.add_entry(part, True) -- cgit v1.2.3