Andrei 2021-05-19 22:39:42 +03:00
parent 072f5bcf74
commit 30e11b4a1f
2 changed files with 7 additions and 1 deletions

View File

@ -112,7 +112,7 @@ with open(src_name + ".csv", 'rb') as src_f, open(dst_name + "-BOM.csv", 'w') as
# remove kicad library prefix from the footprint names (such as "hellen-one-common:") # remove kicad library prefix from the footprint names (such as "hellen-one-common:")
footprint = re.sub(r"[^\:]+\:", "", footprint) footprint = re.sub(r"[^\:]+\:", "", footprint)
bom[des] = footprint bom[des] = footprint
print ("* " + des) print ("* " + des + " " + footprint)
mod = pat_module.match(comment) mod = pat_module.match(comment)
if mod: if mod:
print ("*** Module detected!") print ("*** Module detected!")

View File

@ -294,6 +294,9 @@ def readFootprints(bomPath, cplPath, footprintsPath, yInvert):
fprint = readFootprint(fpname, footprintsPath, row[0]) fprint = readFootprint(fpname, footprintsPath, row[0])
# if the footprint is not found, we cannot add it to the iBOM # if the footprint is not found, we cannot add it to the iBOM
if not fprint: if not fprint:
if idx in bomlut:
bomlut.remove(idx)
del bom[row[0]]
continue continue
footprints[fpname] = fprint footprints[fpname] = fprint
fpr = copy.deepcopy(fprint) fpr = copy.deepcopy(fprint)
@ -324,6 +327,9 @@ def readFootprints(bomPath, cplPath, footprintsPath, yInvert):
for b in bomlut: for b in bomlut:
refs = b["refs"] refs = b["refs"]
if len(refs) < 1:
print ("* Skipping DNP component: " + b["value"])
continue
bomItem = [ bomItem = [
len(refs), len(refs),
b["value"], b["value"],