Skip to content

Commit

Permalink
Fixes #528 Feature/component count (#529)
Browse files Browse the repository at this point in the history
* Feature - Component quantity

Added Quantity column to the generated BOM CSV. This helps when using the BOM tool on LCSC website to avoid manually entering required quantity of each component

* Minor fix - populate the length inside the row func without creating a new variable for it

---------

Co-authored-by: lilindian14 <jaime@astutesmartlocks.com>
  • Loading branch information
lilindian16 and lilindian14 committed Sep 20, 2024
1 parent 321dad5 commit 8f56a92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fabrication.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def generate_bom(self):
os.path.join(self.outputdir, bomname), "w", newline="", encoding="utf-8"
) as csvfile:
writer = csv.writer(csvfile, delimiter=",")
writer.writerow(["Comment", "Designator", "Footprint", "LCSC"])
writer.writerow(["Comment", "Designator", "Footprint", "LCSC", "Quantity"])
for part in self.parent.store.read_bom_parts():
components = part["refs"].split(",")
for component in components:
Expand All @@ -327,7 +327,7 @@ def generate_bom(self):
)
continue
writer.writerow(
[part["value"], part["refs"], part["footprint"], part["lcsc"]]
[part["value"], part["refs"], part["footprint"], part["lcsc"], len(components)]
)
self.logger.info(
"Finished generating BOM file %s", os.path.join(self.outputdir, bomname)
Expand Down

0 comments on commit 8f56a92

Please sign in to comment.