aboutsummaryrefslogtreecommitdiff
path: root/src/ee/bom.py
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-05-28 14:47:24 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2019-05-28 14:47:24 +0200
commit79ee5e3c64c0140a61324914d24049478a9cf7f5 (patch)
treee149c918cbf19881b7c05a3f5b29e303a4b529f8 /src/ee/bom.py
parentb4ba5e8385965a8b6ec7decd83ff7f07c9b364ec (diff)
downloadee-python-79ee5e3c64c0140a61324914d24049478a9cf7f5.tar.gz
ee-python-79ee5e3c64c0140a61324914d24049478a9cf7f5.tar.bz2
ee-python-79ee5e3c64c0140a61324914d24049478a9cf7f5.tar.xz
ee-python-79ee5e3c64c0140a61324914d24049478a9cf7f5.zip
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.
Diffstat (limited to 'src/ee/bom.py')
-rw-r--r--src/ee/bom.py14
1 files changed, 10 insertions, 4 deletions
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)