Commit 4f784034 authored by Dick Hollenbeck's avatar Dick Hollenbeck

BOM generators now report count of "interesting" components, rather than total components

parent 0ae31f3e
......@@ -34,15 +34,15 @@ def writerow( acsvwriter, columns ):
utf8row.append( str(col).encode('utf8') )
acsvwriter.writerow( utf8row )
components = net.getInterestingComponents()
# Output a field delimited header line
writerow( out, ['Source:', net.getSource()] )
writerow( out, ['Date:', net.getDate()] )
writerow( out, ['Tool:', net.getTool()] )
writerow( out, ['Component Count:', len(net.components)] )
writerow( out, ['Component Count:', len(components)] )
writerow( out, ['Ref', 'Value', 'Part', 'Documentation', 'Description', 'Vendor'] )
components = net.getInterestingComponents()
# Output all of the component information
for c in components:
writerow( out, [c.getRef(), c.getValue(), c.getLibName() + ":" + c.getPartName(),
......
......@@ -33,15 +33,15 @@ def writerow( acsvwriter, columns ):
utf8row.append( str(col).encode('utf8') )
acsvwriter.writerow( utf8row )
components = net.getInterestingComponents()
# Output a field delimited header line
writerow( out, ['Source:', net.getSource()] )
writerow( out, ['Date:', net.getDate()] )
writerow( out, ['Tool:', net.getTool()] )
writerow( out, ['Component Count:', len(net.components)] )
writerow( out, ['Component Count:', len(components)] )
writerow( out, ['Ref', 'Value', 'Footprint', 'Datasheet', 'Manufacturer', 'Vendor'] )
components = net.getInterestingComponents()
# Output all of the component information (One component per row)
for c in components:
writerow( out, [c.getRef(), c.getValue(), c.getFootprint(), c.getDatasheet(),
......
......@@ -77,12 +77,14 @@ except IOError:
print(__file__, ":", e, file=sys.stderr)
f = stdout
components = net.getInterestingComponents()
# Output a set of rows for a header providing general information
html = html.replace('<!--SOURCE-->', net.getSource())
html = html.replace('<!--DATE-->', net.getDate())
html = html.replace('<!--TOOL-->', net.getTool())
html = html.replace('<!--COMPCOUNT-->', "<b>Component Count:</b>" + \
str(len(net.components)))
str(len(components)))
row = "<tr><th style='width:640px'>Ref</th>" + "<th>Qnty</th>"
row += "<th>Value</th>" + "<th>Part</th>"
......@@ -92,8 +94,6 @@ row += "<th>PartNumber</th>" + "<th>Vendor</th></tr>"
html = html.replace('<!--TABLEROW-->', row + "<!--TABLEROW-->")
components = net.getInterestingComponents()
# Get all of the components in groups of matching parts + values
# (see kicad_netlist_reader.py)
grouped = net.groupComponents(components)
......
......@@ -42,12 +42,14 @@ except IOError:
print(__file__, ":", e, file=sys.stderr)
f = stdout
components = net.getInterestingComponents()
# Output a set of rows for a header providing general information
html = html.replace('<!--SOURCE-->', net.getSource())
html = html.replace('<!--DATE-->', net.getDate())
html = html.replace('<!--TOOL-->', net.getTool())
html = html.replace('<!--COMPCOUNT-->', "<b>Component Count:</b>" + \
str(len(net.components)))
str(len(components)))
row = "<tr><th style='width:640px'>Ref</th>" + "<th>Qnty</th>"
row += "<th>Value</th>" + "<th>Part</th>" + "<th>Datasheet</th>"
......@@ -55,8 +57,6 @@ row += "<th>Description</th>" + "<th>Vendor</th></tr>"
html = html.replace('<!--TABLEROW-->', row + "<!--TABLEROW-->")
components = net.getInterestingComponents()
# Get all of the components in groups of matching parts + values
# (see kicad_netlist_reader.py)
grouped = net.groupComponents(components)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment