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
bcb80ddb
Commit
bcb80ddb
authored
Aug 20, 2010
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Plain Diff
Added a plugin to create cadstar netlist, using the new intermediate file.
fixed issues in pads-pcb xsl converter
parents
d979a35d
c108af98
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
127 additions
and
12 deletions
+127
-12
netlist_form_cadstar.xsl
eeschema/plugins/netlist_form_cadstar.xsl
+111
-0
netlist_form_pads-pcb.xsl
eeschema/plugins/netlist_form_pads-pcb.xsl
+16
-12
No files found.
eeschema/plugins/netlist_form_cadstar.xsl
0 → 100644
View file @
bcb80ddb
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--XSL style sheet to EESCHEMA Generic Netlist Format to CADSTAR netlist format
Copyright (C) 2010, SoftPLC Corporation.
GPL v2.
How to use:
https://lists.launchpad.net/kicad-developers/msg05157.html
-->
<!DOCTYPE xsl:stylesheet [
<!ENTITY nl "
">
<!--new line CR, LF -->
]>
<xsl:stylesheet
version=
"1.0"
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
>
<xsl:output
method=
"text"
omit-xml-declaration=
"yes"
indent=
"no"
/>
<!-- Netlist header -->
<xsl:template
match=
"/export"
>
<xsl:text>
.HEA
&nl;
</xsl:text>
<xsl:apply-templates
select=
"design/date"
/>
<!-- Generate line .TIM <time> -->
<xsl:apply-templates
select=
"design/tool"
/>
<!-- Generate line .APP <eeschema version> -->
<xsl:apply-templates
select=
"components/comp"
/>
<!-- Generate list of components -->
<xsl:text>
&nl;&nl;
</xsl:text>
<xsl:apply-templates
select=
"nets/net"
/>
<!-- Generate list of nets and connections -->
<xsl:text>
&nl;
.END
&nl;
</xsl:text>
</xsl:template>
<!-- Generate line .TIM 20/08/2010 10:45:33 -->
<xsl:template
match=
"tool"
>
<xsl:text>
.APP "
</xsl:text>
<xsl:apply-templates/>
<xsl:text>
"
&nl;
</xsl:text>
</xsl:template>
<!-- Generate line .APP "eeschema (2010-08-17 BZR 2450)-unstable" -->
<xsl:template
match=
"date"
>
<xsl:text>
.TIM
</xsl:text>
<xsl:apply-templates/>
<xsl:text>
&nl;
</xsl:text>
</xsl:template>
<!-- for each component -->
<xsl:template
match=
"comp"
>
<xsl:text>
.ADD_COM
</xsl:text>
<xsl:value-of
select=
"@ref"
/>
<xsl:text>
</xsl:text>
<xsl:choose>
<xsl:when
test =
"value != '' "
>
<xsl:text>
"
</xsl:text>
<xsl:apply-templates
select=
"value"
/>
<xsl:text>
"
</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>
""
</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:text>
&nl;
</xsl:text>
</xsl:template>
<!-- for each net -->
<xsl:template
match=
"net"
>
<!-- nets are output only if there is more than one pin in net -->
<xsl:if
test=
"count(node)>1"
>
<xsl:variable
name=
"netname"
>
<xsl:text>
"
</xsl:text>
<xsl:choose>
<xsl:when
test =
"@name != '' "
>
<xsl:value-of
select=
"@name"
/>
</xsl:when>
<xsl:otherwise>
<xsl:text>
N-
</xsl:text>
<xsl:value-of
select=
"@code"
/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>
"
&nl;
</xsl:text>
</xsl:variable>
<xsl:apply-templates
select=
"node"
mode=
"first"
/>
<xsl:value-of
select=
"$netname"
/>
<xsl:apply-templates
select=
"node"
mode=
"others"
/>
</xsl:if>
</xsl:template>
<!-- for each node -->
<xsl:template
match=
"node"
mode=
"first"
>
<xsl:if
test=
"position()=1"
>
<xsl:text>
.ADD_TER
</xsl:text>
<xsl:value-of
select=
"@ref"
/>
<xsl:text>
.
</xsl:text>
<xsl:value-of
select=
"@pin"
/>
<xsl:text>
</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template
match=
"node"
mode=
"others"
>
<xsl:choose>
<xsl:when
test=
'position()=1'
>
</xsl:when>
<xsl:when
test=
'position()=2'
>
<xsl:text>
.TER
</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>
</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:if
test=
"position()>1"
>
<xsl:value-of
select=
"@ref"
/>
<xsl:text>
.
</xsl:text>
<xsl:value-of
select=
"@pin"
/>
<xsl:text>
&nl;
</xsl:text>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
eeschema/plugins/netlist_form_pads-pcb.xsl
View file @
bcb80ddb
...
...
@@ -19,6 +19,7 @@
<xsl:apply-templates
select=
"components/comp"
/>
<xsl:text>
&nl;
*NET*
&nl;
</xsl:text>
<xsl:apply-templates
select=
"nets/net"
/>
<xsl:text>
*END*
&nl;
</xsl:text>
</xsl:template>
<!-- for each component -->
...
...
@@ -39,6 +40,8 @@
<!-- for each net -->
<xsl:template
match=
"net"
>
<!-- nets are output only if there is more than one pin in net -->
<xsl:if
test=
"count(node)>1"
>
<xsl:text>
*SIGNAL*
</xsl:text>
<xsl:choose>
<xsl:when
test =
"@name != '' "
>
...
...
@@ -51,6 +54,7 @@
</xsl:choose>
<xsl:text>
&nl;
</xsl:text>
<xsl:apply-templates
select=
"node"
/>
</xsl:if>
</xsl:template>
<!-- for each node -->
...
...
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