Skip to content

Commit

Permalink
Fix #440
Browse files Browse the repository at this point in the history
  • Loading branch information
Bouni committed Jun 7, 2024
1 parent 8845133 commit 36423ef
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions fabrication.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,10 @@ def generate_cpl(self):
writer.writerow(
["Designator", "Val", "Package", "Mid X", "Mid Y", "Rotation", "Layer"]
)
for part in self.parent.store.read_pos_parts():
fp = self.board.FindFootprintByReference(part[0])
if get_exclude_from_pos(fp):
footprints = sorted(self.board.Footprints(), key = lambda x: x.GetReference())
for fp in footprints:
part = self.parent.store.get_part(fp.GetReference())
if part[6] == 1: # Exclude from POS
continue
if not add_without_lcsc and not part[3]:
continue
Expand All @@ -276,7 +277,7 @@ def generate_cpl(self):
"top" if fp.GetLayer() == 0 else "bottom",
]
)
self.logger.info("Finished generating CPL file")
self.logger.info("Finished generating CPL file %s", os.path.join(self.outputdir, cplname))

def generate_bom(self):
"""Generate BOM file."""
Expand All @@ -289,7 +290,12 @@ def generate_bom(self):
) as csvfile:
writer = csv.writer(csvfile, delimiter=",")
writer.writerow(["Comment", "Designator", "Footprint", "LCSC"])
for part in self.parent.store.read_bom_parts():
footprints = sorted(self.board.Footprints(), key = lambda x: x.GetReference())
for fp in footprints:
# for part in self.parent.store.read_bom_parts():
part = self.parent.store.get_part(fp.GetReference())
if part[5] == 1: # Exclude from BOM
continue
if not add_without_lcsc and not part[3]:
continue
writer.writerow(part)
Expand Down

0 comments on commit 36423ef

Please sign in to comment.