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
4000820b
Commit
4000820b
authored
Feb 28, 2015
by
Wayne Stambaugh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed coding policy violations in last commit.
parent
534ed58f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
29 deletions
+29
-29
netform.cpp
eeschema/netform.cpp
+8
-8
bom_with_title_block_2_csv.xsl
eeschema/plugins/bom_with_title_block_2_csv.xsl
+21
-21
No files found.
eeschema/netform.cpp
View file @
4000820b
...
@@ -665,23 +665,23 @@ XNODE* NETLIST_EXPORT_TOOL::makeGenericDesignHeader()
...
@@ -665,23 +665,23 @@ XNODE* NETLIST_EXPORT_TOOL::makeGenericDesignHeader()
for
(
SCH_SHEET_PATH
*
sheet
=
sheetList
.
GetFirst
();
sheet
;
sheet
=
sheetList
.
GetNext
()
)
for
(
SCH_SHEET_PATH
*
sheet
=
sheetList
.
GetFirst
();
sheet
;
sheet
=
sheetList
.
GetNext
()
)
{
{
screen
=
sheet
->
LastScreen
();
screen
=
sheet
->
LastScreen
();
xdesign
->
AddChild
(
xsheet
=
node
(
wxT
(
"sheet"
)
)
);
xdesign
->
AddChild
(
xsheet
=
node
(
wxT
(
"sheet"
)
)
);
// get the string representation of the sheet index number.
// get the string representation of the sheet index number.
// Note that sheet->GetIndex() is zero index base and we need to increment the number by one to make
// Note that sheet->GetIndex() is zero index base and we need to increment the number by one to make
// human readable
// human readable
sheetTxt
.
Printf
(
wxT
(
"%d"
),
(
sheetList
.
GetIndex
()
+
1
)
);
sheetTxt
.
Printf
(
wxT
(
"%d"
),
(
sheetList
.
GetIndex
()
+
1
)
);
xsheet
->
AddAttribute
(
wxT
(
"number"
),
sheetTxt
);
xsheet
->
AddAttribute
(
wxT
(
"number"
),
sheetTxt
);
xsheet
->
AddAttribute
(
wxT
(
"name"
),
sheet
->
PathHumanReadable
()
);
xsheet
->
AddAttribute
(
wxT
(
"name"
),
sheet
->
PathHumanReadable
()
);
xsheet
->
AddAttribute
(
wxT
(
"tstamps"
),
sheet
->
Path
()
);
xsheet
->
AddAttribute
(
wxT
(
"tstamps"
),
sheet
->
Path
()
);
TITLE_BLOCK
tb
=
screen
->
GetTitleBlock
();
TITLE_BLOCK
tb
=
screen
->
GetTitleBlock
();
xsheet
->
AddChild
(
xtitleBlock
=
node
(
wxT
(
"title_block"
)
)
);
xsheet
->
AddChild
(
xtitleBlock
=
node
(
wxT
(
"title_block"
)
)
);
xtitleBlock
->
AddChild
(
node
(
wxT
(
"title"
),
tb
.
GetTitle
()
)
);
xtitleBlock
->
AddChild
(
node
(
wxT
(
"title"
),
tb
.
GetTitle
()
)
);
xtitleBlock
->
AddChild
(
node
(
wxT
(
"company"
),
tb
.
GetCompany
()
)
);
xtitleBlock
->
AddChild
(
node
(
wxT
(
"company"
),
tb
.
GetCompany
()
)
);
xtitleBlock
->
AddChild
(
node
(
wxT
(
"rev"
),
tb
.
GetRevision
()
)
);
xtitleBlock
->
AddChild
(
node
(
wxT
(
"rev"
),
tb
.
GetRevision
()
)
);
...
@@ -690,7 +690,7 @@ XNODE* NETLIST_EXPORT_TOOL::makeGenericDesignHeader()
...
@@ -690,7 +690,7 @@ XNODE* NETLIST_EXPORT_TOOL::makeGenericDesignHeader()
// We are going to remove the fileName directories.
// We are going to remove the fileName directories.
sourceFileName
=
wxFileName
(
screen
->
GetFileName
()
);
sourceFileName
=
wxFileName
(
screen
->
GetFileName
()
);
xtitleBlock
->
AddChild
(
node
(
wxT
(
"source"
),
sourceFileName
.
GetFullName
()
)
);
xtitleBlock
->
AddChild
(
node
(
wxT
(
"source"
),
sourceFileName
.
GetFullName
()
)
);
xtitleBlock
->
AddChild
(
xcomment
=
node
(
wxT
(
"comment"
)
)
);
xtitleBlock
->
AddChild
(
xcomment
=
node
(
wxT
(
"comment"
)
)
);
xcomment
->
AddAttribute
(
wxT
(
"number"
),
wxT
(
"1"
)
);
xcomment
->
AddAttribute
(
wxT
(
"number"
),
wxT
(
"1"
)
);
xcomment
->
AddAttribute
(
wxT
(
"value"
),
tb
.
GetComment1
()
);
xcomment
->
AddAttribute
(
wxT
(
"value"
),
tb
.
GetComment1
()
);
...
@@ -706,7 +706,7 @@ XNODE* NETLIST_EXPORT_TOOL::makeGenericDesignHeader()
...
@@ -706,7 +706,7 @@ XNODE* NETLIST_EXPORT_TOOL::makeGenericDesignHeader()
xtitleBlock
->
AddChild
(
xcomment
=
node
(
wxT
(
"comment"
)
)
);
xtitleBlock
->
AddChild
(
xcomment
=
node
(
wxT
(
"comment"
)
)
);
xcomment
->
AddAttribute
(
wxT
(
"number"
),
wxT
(
"4"
)
);
xcomment
->
AddAttribute
(
wxT
(
"number"
),
wxT
(
"4"
)
);
xcomment
->
AddAttribute
(
wxT
(
"value"
),
tb
.
GetComment4
()
);
xcomment
->
AddAttribute
(
wxT
(
"value"
),
tb
.
GetComment4
()
);
}
}
return
xdesign
;
return
xdesign
;
}
}
...
...
eeschema/plugins/bom_with_title_block_2_csv.xsl
View file @
4000820b
...
@@ -2,24 +2,24 @@
...
@@ -2,24 +2,24 @@
@package
@package
EESCHEMA BOM plugin. Creates BOM CSV files from the project net file.
EESCHEMA BOM plugin. Creates BOM CSV files from the project net file.
Based on Stefan Helmert bom2csv.xsl
Based on Stefan Helmert bom2csv.xsl
Note:
Note:
The project infomation (i.e title, company and revision) is taken from and the root sheet.
The project infomation (i.e title, company and revision) is taken from and the root sheet.
Arthur:
Arthur:
Ronald Sousa HashDefineElectronics.com
Ronald Sousa HashDefineElectronics.com
Usage:
Usage:
on Windows:
on Windows:
xsltproc -o "%O.csv" "C:\Program Files (x86)\KiCad\bin\plugins\bom2csv.xsl" "%I"
xsltproc -o "%O.csv" "C:\Program Files (x86)\KiCad\bin\plugins\bom2csv.xsl" "%I"
on Linux:
on Linux:
xsltproc -o "%O.csv" /usr/local/lib/kicad/plugins/bom2csv.xsl "%I"
xsltproc -o "%O.csv" /usr/local/lib/kicad/plugins/bom2csv.xsl "%I"
Ouput Example:
Ouput Example:
Source,
Source,
Kicad Rev, working director and file source
Kicad Rev, working director and file source
Generated Date, date this file was generated
Generated Date, date this file was generated
Title, the project's tile
Title, the project's tile
Company, the project's company
Company, the project's company
Rev, the project's revision
Rev, the project's revision
...
@@ -48,15 +48,15 @@
...
@@ -48,15 +48,15 @@
<xsl:text>
Source,
</xsl:text><xsl:value-of
select=
"design/source"
/><xsl:text>
&nl;
</xsl:text>
<xsl:text>
Source,
</xsl:text><xsl:value-of
select=
"design/source"
/><xsl:text>
&nl;
</xsl:text>
<xsl:text>
Kicad Rev,
</xsl:text><xsl:value-of
select=
"design/tool"
/><xsl:text>
&nl;
</xsl:text>
<xsl:text>
Kicad Rev,
</xsl:text><xsl:value-of
select=
"design/tool"
/><xsl:text>
&nl;
</xsl:text>
<xsl:text>
Generated Date,
</xsl:text><xsl:value-of
select=
"design/date"
/><xsl:text>
&nl;
</xsl:text>
<xsl:text>
Generated Date,
</xsl:text><xsl:value-of
select=
"design/date"
/><xsl:text>
&nl;
</xsl:text>
<xsl:text>
&nl;
</xsl:text>
<xsl:text>
&nl;
</xsl:text>
<!-- Ouput Root sheet project information -->
<!-- Ouput Root sheet project information -->
<xsl:apply-templates
select=
"/export/design/sheet[1]"
/>
<xsl:apply-templates
select=
"/export/design/sheet[1]"
/>
<xsl:text>
&nl;
</xsl:text>
<xsl:text>
&nl;
</xsl:text>
<!-- Output table header -->
<!-- Output table header -->
<xsl:text>
Reference,Value,
</xsl:text>
<xsl:text>
Reference,Value,
</xsl:text>
<xsl:for-each
select=
"components/comp/fields/field[generate-id(.) = generate-id(key('headentr',@name)[1])]"
>
<xsl:for-each
select=
"components/comp/fields/field[generate-id(.) = generate-id(key('headentr',@name)[1])]"
>
<xsl:value-of
select=
"@name"
/>
<xsl:value-of
select=
"@name"
/>
...
@@ -68,10 +68,10 @@
...
@@ -68,10 +68,10 @@
<!-- all table entries -->
<!-- all table entries -->
<xsl:apply-templates
select=
"components/comp"
/>
<xsl:apply-templates
select=
"components/comp"
/>
</xsl:template>
</xsl:template>
<!-- generate the Root sheet project information -->
<!-- generate the Root sheet project information -->
<xsl:template
match=
"/export/design/sheet[1]"
>
<xsl:template
match=
"/export/design/sheet[1]"
>
<xsl:choose>
<xsl:choose>
<xsl:when
test=
"title_block/title !=''"
>
<xsl:when
test=
"title_block/title !=''"
>
<xsl:text>
Title,
</xsl:text><xsl:value-of
select=
"title_block/title"
/><xsl:text>
&nl;
</xsl:text>
<xsl:text>
Title,
</xsl:text><xsl:value-of
select=
"title_block/title"
/><xsl:text>
&nl;
</xsl:text>
...
@@ -80,8 +80,8 @@
...
@@ -80,8 +80,8 @@
<xsl:text>
Title,Not Set
</xsl:text><xsl:text>
&nl;
</xsl:text>
<xsl:text>
Title,Not Set
</xsl:text><xsl:text>
&nl;
</xsl:text>
</xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:choose>
<xsl:choose>
<xsl:choose>
<xsl:when
test=
"title_block/company !=''"
>
<xsl:when
test=
"title_block/company !=''"
>
<xsl:text>
Company,
</xsl:text><xsl:value-of
select=
"title_block/company"
/><xsl:text>
&nl;
</xsl:text>
<xsl:text>
Company,
</xsl:text><xsl:value-of
select=
"title_block/company"
/><xsl:text>
&nl;
</xsl:text>
...
@@ -90,7 +90,7 @@
...
@@ -90,7 +90,7 @@
<xsl:text>
Company,Not Set
</xsl:text><xsl:text>
&nl;
</xsl:text>
<xsl:text>
Company,Not Set
</xsl:text><xsl:text>
&nl;
</xsl:text>
</xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:choose>
<xsl:choose>
<xsl:choose>
<xsl:when
test=
"title_block/rev !=''"
>
<xsl:when
test=
"title_block/rev !=''"
>
<xsl:text>
Revision,
</xsl:text><xsl:value-of
select=
"title_block/rev"
/><xsl:text>
&nl;
</xsl:text>
<xsl:text>
Revision,
</xsl:text><xsl:value-of
select=
"title_block/rev"
/><xsl:text>
&nl;
</xsl:text>
...
@@ -99,7 +99,7 @@
...
@@ -99,7 +99,7 @@
<xsl:text>
Revision,Not Set
</xsl:text><xsl:text>
&nl;
</xsl:text>
<xsl:text>
Revision,Not Set
</xsl:text><xsl:text>
&nl;
</xsl:text>
</xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:choose>
<xsl:choose>
<xsl:choose>
<xsl:when
test=
"title_block/date !=''"
>
<xsl:when
test=
"title_block/date !=''"
>
<xsl:text>
Date Issue,
</xsl:text><xsl:value-of
select=
"title_block/date"
/><xsl:text>
&nl;
</xsl:text>
<xsl:text>
Date Issue,
</xsl:text><xsl:value-of
select=
"title_block/date"
/><xsl:text>
&nl;
</xsl:text>
...
@@ -110,9 +110,9 @@
...
@@ -110,9 +110,9 @@
</xsl:choose>
</xsl:choose>
<xsl:apply-templates
select=
"title_block/comment"
/>
<xsl:apply-templates
select=
"title_block/comment"
/>
</xsl:template>
</xsl:template>
<xsl:template
match=
"title_block/comment"
>
<xsl:template
match=
"title_block/comment"
>
<xsl:choose>
<xsl:choose>
<xsl:when
test=
"@value !=''"
>
<xsl:when
test=
"@value !=''"
>
...
@@ -120,9 +120,9 @@
...
@@ -120,9 +120,9 @@
</xsl:when>
</xsl:when>
</xsl:choose>
</xsl:choose>
</xsl:template>
</xsl:template>
<!-- the table entries -->
<!-- the table entries -->
<xsl:template
match=
"components/comp"
>
<xsl:template
match=
"components/comp"
>
<xsl:value-of
select=
"@ref"
/><xsl:text>
,
</xsl:text>
<xsl:value-of
select=
"@ref"
/><xsl:text>
,
</xsl:text>
...
...
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