Include part number info in BOM table

This commit is contained in:
Daniel Rojas 2022-08-05 13:38:51 +02:00 committed by KV
parent 3b048ba77f
commit af230a4a5c

View File

@ -68,7 +68,7 @@ def pn_info_string(
def print_bom_debug(bom): def print_bom_debug(bom):
headers = "# qty unit description amount unit designators category".split(" ") headers = "# qty unit description amount unit designators category pn manufacturer mpn supplier spn".split(" ")
rows = [] rows = []
rows.append(headers) rows.append(headers)
# fill rows # fill rows
@ -83,6 +83,16 @@ def print_bom_debug(bom):
", ".join(sorted(entry["designators"])), ", ".join(sorted(entry["designators"])),
f"{entry['category']} ({entry['category'].name})", f"{entry['category']} ({entry['category'].name})",
] ]
if hash.partnumbers:
cells.extend([
hash.partnumbers.pn,
hash.partnumbers.manufacturer,
hash.partnumbers.mpn,
hash.partnumbers.supplier,
hash.partnumbers.spn,
])
else:
cells.extend([None,None,None,None,None])
rows.append(cells) rows.append(cells)
# remove empty columns # remove empty columns
transposed = list(map(list, zip(*rows))) transposed = list(map(list, zip(*rows)))