Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
4f784034
Commit
4f784034
authored
Sep 20, 2013
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BOM generators now report count of "interesting" components, rather than total components
parent
0ae31f3e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
12 deletions
+12
-12
bom_csv_by_ref.py
scripts/bom-in-python/bom_csv_by_ref.py
+3
-3
bom_csv_by_ref_v2.py
scripts/bom-in-python/bom_csv_by_ref_v2.py
+3
-3
bom_html_by_value.py
scripts/bom-in-python/bom_html_by_value.py
+3
-3
bom_html_grouped_by_value.py
scripts/bom-in-python/bom_html_grouped_by_value.py
+3
-3
No files found.
scripts/bom-in-python/bom_csv_by_ref.py
View file @
4f784034
...
@@ -34,15 +34,15 @@ def writerow( acsvwriter, columns ):
...
@@ -34,15 +34,15 @@ def writerow( acsvwriter, columns ):
utf8row
.
append
(
str
(
col
)
.
encode
(
'utf8'
)
)
utf8row
.
append
(
str
(
col
)
.
encode
(
'utf8'
)
)
acsvwriter
.
writerow
(
utf8row
)
acsvwriter
.
writerow
(
utf8row
)
components
=
net
.
getInterestingComponents
()
# Output a field delimited header line
# Output a field delimited header line
writerow
(
out
,
[
'Source:'
,
net
.
getSource
()]
)
writerow
(
out
,
[
'Source:'
,
net
.
getSource
()]
)
writerow
(
out
,
[
'Date:'
,
net
.
getDate
()]
)
writerow
(
out
,
[
'Date:'
,
net
.
getDate
()]
)
writerow
(
out
,
[
'Tool:'
,
net
.
getTool
()]
)
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'
]
)
writerow
(
out
,
[
'Ref'
,
'Value'
,
'Part'
,
'Documentation'
,
'Description'
,
'Vendor'
]
)
components
=
net
.
getInterestingComponents
()
# Output all of the component information
# Output all of the component information
for
c
in
components
:
for
c
in
components
:
writerow
(
out
,
[
c
.
getRef
(),
c
.
getValue
(),
c
.
getLibName
()
+
":"
+
c
.
getPartName
(),
writerow
(
out
,
[
c
.
getRef
(),
c
.
getValue
(),
c
.
getLibName
()
+
":"
+
c
.
getPartName
(),
...
...
scripts/bom-in-python/bom_csv_by_ref_v2.py
View file @
4f784034
...
@@ -33,15 +33,15 @@ def writerow( acsvwriter, columns ):
...
@@ -33,15 +33,15 @@ def writerow( acsvwriter, columns ):
utf8row
.
append
(
str
(
col
)
.
encode
(
'utf8'
)
)
utf8row
.
append
(
str
(
col
)
.
encode
(
'utf8'
)
)
acsvwriter
.
writerow
(
utf8row
)
acsvwriter
.
writerow
(
utf8row
)
components
=
net
.
getInterestingComponents
()
# Output a field delimited header line
# Output a field delimited header line
writerow
(
out
,
[
'Source:'
,
net
.
getSource
()]
)
writerow
(
out
,
[
'Source:'
,
net
.
getSource
()]
)
writerow
(
out
,
[
'Date:'
,
net
.
getDate
()]
)
writerow
(
out
,
[
'Date:'
,
net
.
getDate
()]
)
writerow
(
out
,
[
'Tool:'
,
net
.
getTool
()]
)
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'
]
)
writerow
(
out
,
[
'Ref'
,
'Value'
,
'Footprint'
,
'Datasheet'
,
'Manufacturer'
,
'Vendor'
]
)
components
=
net
.
getInterestingComponents
()
# Output all of the component information (One component per row)
# Output all of the component information (One component per row)
for
c
in
components
:
for
c
in
components
:
writerow
(
out
,
[
c
.
getRef
(),
c
.
getValue
(),
c
.
getFootprint
(),
c
.
getDatasheet
(),
writerow
(
out
,
[
c
.
getRef
(),
c
.
getValue
(),
c
.
getFootprint
(),
c
.
getDatasheet
(),
...
...
scripts/bom-in-python/bom_html_by_value.py
View file @
4f784034
...
@@ -77,12 +77,14 @@ except IOError:
...
@@ -77,12 +77,14 @@ except IOError:
print
(
__file__
,
":"
,
e
,
file
=
sys
.
stderr
)
print
(
__file__
,
":"
,
e
,
file
=
sys
.
stderr
)
f
=
stdout
f
=
stdout
components
=
net
.
getInterestingComponents
()
# Output a set of rows for a header providing general information
# Output a set of rows for a header providing general information
html
=
html
.
replace
(
'<!--SOURCE-->'
,
net
.
getSource
())
html
=
html
.
replace
(
'<!--SOURCE-->'
,
net
.
getSource
())
html
=
html
.
replace
(
'<!--DATE-->'
,
net
.
getDate
())
html
=
html
.
replace
(
'<!--DATE-->'
,
net
.
getDate
())
html
=
html
.
replace
(
'<!--TOOL-->'
,
net
.
getTool
())
html
=
html
.
replace
(
'<!--TOOL-->'
,
net
.
getTool
())
html
=
html
.
replace
(
'<!--COMPCOUNT-->'
,
"<b>Component Count:</b>"
+
\
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
=
"<tr><th style='width:640px'>Ref</th>"
+
"<th>Qnty</th>"
row
+=
"<th>Value</th>"
+
"<th>Part</th>"
row
+=
"<th>Value</th>"
+
"<th>Part</th>"
...
@@ -92,8 +94,6 @@ row += "<th>PartNumber</th>" + "<th>Vendor</th></tr>"
...
@@ -92,8 +94,6 @@ row += "<th>PartNumber</th>" + "<th>Vendor</th></tr>"
html
=
html
.
replace
(
'<!--TABLEROW-->'
,
row
+
"<!--TABLEROW-->"
)
html
=
html
.
replace
(
'<!--TABLEROW-->'
,
row
+
"<!--TABLEROW-->"
)
components
=
net
.
getInterestingComponents
()
# Get all of the components in groups of matching parts + values
# Get all of the components in groups of matching parts + values
# (see kicad_netlist_reader.py)
# (see kicad_netlist_reader.py)
grouped
=
net
.
groupComponents
(
components
)
grouped
=
net
.
groupComponents
(
components
)
...
...
scripts/bom-in-python/bom_html_grouped_by_value.py
View file @
4f784034
...
@@ -42,12 +42,14 @@ except IOError:
...
@@ -42,12 +42,14 @@ except IOError:
print
(
__file__
,
":"
,
e
,
file
=
sys
.
stderr
)
print
(
__file__
,
":"
,
e
,
file
=
sys
.
stderr
)
f
=
stdout
f
=
stdout
components
=
net
.
getInterestingComponents
()
# Output a set of rows for a header providing general information
# Output a set of rows for a header providing general information
html
=
html
.
replace
(
'<!--SOURCE-->'
,
net
.
getSource
())
html
=
html
.
replace
(
'<!--SOURCE-->'
,
net
.
getSource
())
html
=
html
.
replace
(
'<!--DATE-->'
,
net
.
getDate
())
html
=
html
.
replace
(
'<!--DATE-->'
,
net
.
getDate
())
html
=
html
.
replace
(
'<!--TOOL-->'
,
net
.
getTool
())
html
=
html
.
replace
(
'<!--TOOL-->'
,
net
.
getTool
())
html
=
html
.
replace
(
'<!--COMPCOUNT-->'
,
"<b>Component Count:</b>"
+
\
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
=
"<tr><th style='width:640px'>Ref</th>"
+
"<th>Qnty</th>"
row
+=
"<th>Value</th>"
+
"<th>Part</th>"
+
"<th>Datasheet</th>"
row
+=
"<th>Value</th>"
+
"<th>Part</th>"
+
"<th>Datasheet</th>"
...
@@ -55,8 +57,6 @@ row += "<th>Description</th>" + "<th>Vendor</th></tr>"
...
@@ -55,8 +57,6 @@ row += "<th>Description</th>" + "<th>Vendor</th></tr>"
html
=
html
.
replace
(
'<!--TABLEROW-->'
,
row
+
"<!--TABLEROW-->"
)
html
=
html
.
replace
(
'<!--TABLEROW-->'
,
row
+
"<!--TABLEROW-->"
)
components
=
net
.
getInterestingComponents
()
# Get all of the components in groups of matching parts + values
# Get all of the components in groups of matching parts + values
# (see kicad_netlist_reader.py)
# (see kicad_netlist_reader.py)
grouped
=
net
.
groupComponents
(
components
)
grouped
=
net
.
groupComponents
(
components
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment