Drop xsl/xslt files
Users may still use xsltproc with kicad as the invocation of third party tools remains. We simply are not maintaining these xsl sample scripts anymore nor bundling xsltproc. Fix https://gitlab.com/kicad/code/kicad/-/issues/9074
This commit is contained in:
parent
f48ed79039
commit
9b0531db54
|
@ -1,17 +1,4 @@
|
|||
# Install the *.xsl file(s), user will need to install 'xsltproc' and setup
|
||||
# EESCHEMA's netlist plugins
|
||||
# See chapter 14 of eeschema.pdf
|
||||
|
||||
|
||||
set( XSL_SCRIPTS_LIST
|
||||
xsl_scripts/bom2csv.xsl
|
||||
xsl_scripts/bom2grouped_csv.xsl
|
||||
xsl_scripts/netlist_form_cadstar-RINF.xsl
|
||||
xsl_scripts/netlist_form_cadstar.xsl
|
||||
xsl_scripts/netlist_form_OrcadPcb2.xsl
|
||||
xsl_scripts/netlist_form_pads-pcb.asc.xsl
|
||||
xsl_scripts/bom_with_title_block_2_csv.xsl
|
||||
)
|
||||
# EESCHEMA's netlist and bom sample scripts
|
||||
|
||||
set( PYTHON_SCRIPTS_LIST
|
||||
python_scripts/README-bom.txt
|
||||
|
@ -25,7 +12,7 @@ set( PYTHON_SCRIPTS_LIST
|
|||
python_scripts/bom_txt_sorted_by_ref.py
|
||||
)
|
||||
|
||||
install( FILES ${XSL_SCRIPTS_LIST} ${PYTHON_SCRIPTS_LIST}
|
||||
install( FILES ${PYTHON_SCRIPTS_LIST}
|
||||
DESTINATION ${KICAD_PLUGINS}
|
||||
COMPONENT binary
|
||||
)
|
||||
|
|
|
@ -1,89 +0,0 @@
|
|||
<!--XSL style sheet to convert EESCHEMA XML Partlist Format to CSV BOM Format
|
||||
Copyright (C) 2013, Stefan Helmert.
|
||||
GPL v2.
|
||||
|
||||
Functionality:
|
||||
Generation of csv table with table head of all existing field names
|
||||
and correct assigned cell entries
|
||||
|
||||
How to use this is explained in eeschema.pdf chapter 14.
|
||||
-->
|
||||
|
||||
<!--
|
||||
@package
|
||||
Output: CSV (comma-separated)
|
||||
Grouped By: ungrouped, one component per line
|
||||
Sorted By: Ref
|
||||
Fields: Reference, Value, Footprint, Datasheet, all additional symbol fields
|
||||
|
||||
Command line:
|
||||
xsltproc -o "%O.csv" "pathToFile/bom2csv.xsl" "%I"
|
||||
-->
|
||||
|
||||
<!DOCTYPE xsl:stylesheet [
|
||||
<!ENTITY nl "
"> <!--new line CR, LF, or LF, your choice -->
|
||||
]>
|
||||
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
<xsl:output method="text"/>
|
||||
|
||||
<!-- for table head and empty table fields-->
|
||||
<xsl:key name="headentr" match="field" use="@name"/>
|
||||
|
||||
<!-- main part -->
|
||||
<xsl:template match="/export">
|
||||
<xsl:text>Reference, Value, Footprint, Datasheet</xsl:text>
|
||||
|
||||
<!-- find all existing table head entries and list each one once -->
|
||||
<xsl:for-each select="components/comp/fields/field[generate-id(.) = generate-id(key('headentr',@name)[1])]">
|
||||
<xsl:text>, </xsl:text>
|
||||
<xsl:value-of select="@name"/>
|
||||
</xsl:for-each>
|
||||
<xsl:text>&nl;</xsl:text>
|
||||
|
||||
<!-- all table entries -->
|
||||
<xsl:apply-templates select="components/comp"/>
|
||||
</xsl:template>
|
||||
|
||||
<!-- the table entries -->
|
||||
<xsl:template match="components/comp">
|
||||
<xsl:text>"</xsl:text>
|
||||
<xsl:value-of select="@ref"/><xsl:text>","</xsl:text>
|
||||
<xsl:value-of select="value"/><xsl:text>","</xsl:text>
|
||||
<xsl:value-of select="footprint"/><xsl:text>","</xsl:text>
|
||||
<xsl:value-of select="datasheet"/><xsl:text>"</xsl:text>
|
||||
<xsl:apply-templates select="fields"/>
|
||||
<xsl:text>&nl;</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<!-- table entries with dynamic table head -->
|
||||
<xsl:template match="fields">
|
||||
|
||||
<!-- remember current fields section -->
|
||||
<xsl:variable name="fieldvar" select="field"/>
|
||||
|
||||
<!-- for all existing head entries -->
|
||||
<xsl:for-each select="/export/components/comp/fields/field[generate-id(.) = generate-id(key('headentr',@name)[1])]">
|
||||
<xsl:variable name="allnames" select="@name"/>
|
||||
<xsl:text>,"</xsl:text>
|
||||
|
||||
<!-- for all field entries in the remembered fields section -->
|
||||
<xsl:for-each select="$fieldvar">
|
||||
|
||||
<!-- only if this field entry exists in this fields section -->
|
||||
<xsl:if test="@name=$allnames">
|
||||
<!-- content of the field -->
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:if>
|
||||
<!--
|
||||
If it does not exist, use an empty cell in output for this row.
|
||||
Every non-blank entry is assigned to its proper column.
|
||||
-->
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:text>"</xsl:text>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -1,104 +0,0 @@
|
|||
<!--XSL style sheet to convert EESCHEMA XML Partlist Format to grouped CSV BOM Format
|
||||
Copyright (C) 2014, Wolf Walter.
|
||||
Copyright (C) 2013, Stefan Helmert.
|
||||
Copyright (C) 2018, Kicad developers.
|
||||
GPL v2.
|
||||
|
||||
Functionality:
|
||||
Generation of Digi-Key ordering system compatible BOM
|
||||
|
||||
How to use this is explained in eeschema.pdf chapter 14.
|
||||
-->
|
||||
<!--
|
||||
@package
|
||||
Output: CSV (comma-separated)
|
||||
Grouped By: Value, Footprint
|
||||
Sorted By: Ref
|
||||
Fields: Reference, Quantity, Value, Footprint, Datasheet, all additional symbol fields
|
||||
|
||||
Command line:
|
||||
xsltproc -o "%O.csv" "pathToFile/bom2grouped_csv.xsl" "%I"
|
||||
-->
|
||||
|
||||
|
||||
<!DOCTYPE xsl:stylesheet [
|
||||
<!ENTITY nl "
"> <!--new line CR, LF, or LF, your choice -->
|
||||
]>
|
||||
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
<xsl:output method="text"/>
|
||||
|
||||
<xsl:variable name="digits" select="'1234567890'" />
|
||||
|
||||
<!-- for matching grouping of footprint and value combination -->
|
||||
<xsl:key name="partTypeByValueAndFootprint" match="comp" use="concat(footprint, '-', value)" />
|
||||
|
||||
<!-- for table head and empty table fields-->
|
||||
<xsl:key name="headentr" match="field" use="@name"/>
|
||||
|
||||
<!-- main part -->
|
||||
<xsl:template match="/export">
|
||||
<xsl:text>Reference, Quantity, Value, Footprint, Datasheet</xsl:text>
|
||||
|
||||
<!-- find all existing table head entries and list each one once -->
|
||||
<xsl:for-each select="components/comp/fields/field[generate-id(.) = generate-id(key('headentr',@name)[1])]">
|
||||
<xsl:text>, </xsl:text>
|
||||
<xsl:value-of select="@name"/>
|
||||
</xsl:for-each>
|
||||
|
||||
<!-- all table entries -->
|
||||
<xsl:apply-templates select="components"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="components">
|
||||
<!-- for Muenchian grouping of footprint and value combination -->
|
||||
<xsl:for-each select="comp[count(. | key('partTypeByValueAndFootprint', concat(footprint, '-', value))[1]) = 1]">
|
||||
<xsl:sort select="@ref" />
|
||||
<xsl:text>&nl;</xsl:text>
|
||||
<!-- list of all references -->
|
||||
<xsl:for-each select="key('partTypeByValueAndFootprint', concat(footprint, '-', value))">
|
||||
<!-- strip non-digits from reference and sort based on remaining number -->
|
||||
<xsl:sort select="translate(@ref, translate(@ref, $digits, ''), '')" data-type="number" />
|
||||
<xsl:value-of select="@ref"/><xsl:text> </xsl:text>
|
||||
</xsl:for-each><xsl:text>,</xsl:text>
|
||||
<!-- quantity of parts with same footprint and value -->
|
||||
<xsl:value-of select="count(key('partTypeByValueAndFootprint', concat(footprint, '-', value)))"/><xsl:text>,</xsl:text>
|
||||
<xsl:text>"</xsl:text>
|
||||
<xsl:value-of select="value"/><xsl:text>","</xsl:text>
|
||||
<xsl:value-of select="footprint"/><xsl:text>","</xsl:text>
|
||||
<xsl:value-of select="datasheet"/><xsl:text>"</xsl:text>
|
||||
<xsl:apply-templates select="fields"/>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
<!-- table entries with dynamic table head -->
|
||||
<xsl:template match="fields">
|
||||
|
||||
<!-- remember current fields section -->
|
||||
<xsl:variable name="fieldvar" select="field"/>
|
||||
|
||||
<!-- for all existing head entries -->
|
||||
<xsl:for-each select="/export/components/comp/fields/field[generate-id(.) = generate-id(key('headentr',@name)[1])]">
|
||||
<xsl:variable name="allnames" select="@name"/>
|
||||
<xsl:text>,"</xsl:text>
|
||||
|
||||
<!-- for all field entries in the remembered fields section -->
|
||||
<xsl:for-each select="$fieldvar">
|
||||
|
||||
<!-- only if this field entry exists in this fields section -->
|
||||
<xsl:if test="@name=$allnames">
|
||||
<!-- content of the field -->
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:if>
|
||||
<!--
|
||||
If it does not exist, use an empty cell in output for this row.
|
||||
Every non-blank entry is assigned to its proper column.
|
||||
-->
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:text>"</xsl:text>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -1,170 +0,0 @@
|
|||
<!--
|
||||
EESCHEMA BOM plugin. Creates BOM CSV files from the project net file.
|
||||
Based on Stefan Helmert bom2csv.xsl
|
||||
|
||||
Note:
|
||||
The project information (i.e title, company and revision) is taken from the root sheet.
|
||||
|
||||
Arthur:
|
||||
Ronald Sousa HashDefineElectronics.com
|
||||
|
||||
Output Example:
|
||||
Source,
|
||||
Kicad Rev, working director and file source
|
||||
Generated Date, date this file was generated
|
||||
|
||||
Title, the project's title
|
||||
Company, the project's company
|
||||
Rev, the project's revision
|
||||
Date Source, project's issue date
|
||||
Comment, This is comment 1
|
||||
Comment, This is comment 2
|
||||
Comment, This is comment 3
|
||||
Comment, This is comment 4
|
||||
-->
|
||||
<!--
|
||||
@package
|
||||
Output: CSV (comma-separated)
|
||||
Grouped By: ungrouped, one component per line
|
||||
Sorted By: Ref
|
||||
Fields: Reference, Value, any additional symbol fields, Library, Library Ref
|
||||
|
||||
Includes a title block at the top of the BOM.
|
||||
|
||||
Command line:
|
||||
xsltproc -o "%O.csv" "pathToFile/bom_with_title_block_2_csv.xsl" "%I"
|
||||
-->
|
||||
|
||||
<!DOCTYPE xsl:stylesheet [
|
||||
<!ENTITY nl "
"> <!--new line CR, LF, or LF, your choice -->
|
||||
]>
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
<xsl:output method="text"/>
|
||||
|
||||
<!-- for table head and empty table fields-->
|
||||
<xsl:key name="headentr" match="field" use="@name"/>
|
||||
|
||||
<!-- main part -->
|
||||
<xsl:template match="/export">
|
||||
<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>Generated Date,</xsl:text><xsl:value-of select="design/date"/><xsl:text>&nl;</xsl:text>
|
||||
|
||||
<xsl:text>&nl;</xsl:text>
|
||||
|
||||
<!-- Output Root sheet project information -->
|
||||
<xsl:apply-templates select="/export/design/sheet[1]"/>
|
||||
|
||||
<xsl:text>&nl;</xsl:text>
|
||||
|
||||
<!-- Output table header -->
|
||||
<xsl:text>Reference,Value,</xsl:text>
|
||||
<xsl:for-each select="components/comp/fields/field[generate-id(.) = generate-id(key('headentr',@name)[1])]">
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:text>,</xsl:text>
|
||||
</xsl:for-each>
|
||||
<xsl:text>Library,Library Ref</xsl:text>
|
||||
<xsl:text>&nl;</xsl:text>
|
||||
|
||||
<!-- all table entries -->
|
||||
<xsl:apply-templates select="components/comp"/>
|
||||
</xsl:template>
|
||||
|
||||
<!-- generate the Root sheet project information -->
|
||||
<xsl:template match="/export/design/sheet[1]">
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="title_block/title !=''">
|
||||
<xsl:text>Title,</xsl:text><xsl:value-of select="title_block/title"/><xsl:text>&nl;</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>Title,Not Set</xsl:text><xsl:text>&nl;</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="title_block/company !=''">
|
||||
<xsl:text>Company,</xsl:text><xsl:value-of select="title_block/company"/><xsl:text>&nl;</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>Company,Not Set</xsl:text><xsl:text>&nl;</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="title_block/rev !=''">
|
||||
<xsl:text>Revision,</xsl:text><xsl:value-of select="title_block/rev"/><xsl:text>&nl;</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>Revision,Not Set</xsl:text><xsl:text>&nl;</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<xsl:choose>
|
||||
<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:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>Date Issue,Not Set</xsl:text><xsl:text>&nl;</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<xsl:apply-templates select="title_block/comment"/>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="title_block/comment">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@value !=''">
|
||||
<xsl:text>Comment,</xsl:text><xsl:value-of select="@value"/><xsl:text>&nl;</xsl:text>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
<!-- the table entries -->
|
||||
<xsl:template match="components/comp">
|
||||
<xsl:value-of select="@ref"/><xsl:text>,</xsl:text>
|
||||
<xsl:value-of select="value"/><xsl:text>,</xsl:text>
|
||||
<xsl:apply-templates select="fields"/>
|
||||
<xsl:apply-templates select="libsource"/>
|
||||
<xsl:text>&nl;</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<!-- the library selection -->
|
||||
<xsl:template match="libsource">
|
||||
<xsl:value-of select="@lib"/><xsl:text>,</xsl:text>
|
||||
<xsl:value-of select="@part"/>
|
||||
</xsl:template>
|
||||
|
||||
<!-- table entries with dynamic table head -->
|
||||
<xsl:template match="fields">
|
||||
|
||||
<!-- remember current fields section -->
|
||||
<xsl:variable name="fieldvar" select="field"/>
|
||||
|
||||
<!-- for all existing head entries -->
|
||||
<xsl:for-each select="/export/components/comp/fields/field[generate-id(.) = generate-id(key('headentr',@name)[1])]">
|
||||
<xsl:variable name="allnames" select="@name"/>
|
||||
|
||||
<!-- for all field entries in the remembered fields section -->
|
||||
<xsl:for-each select="$fieldvar">
|
||||
|
||||
<!-- only if this field entry exists in this fields section -->
|
||||
<xsl:if test="@name=$allnames">
|
||||
<!-- content of the field -->
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:if>
|
||||
<!--
|
||||
If it does not exist, use an empty cell in output for this row.
|
||||
Every non-blank entry is assigned to its proper column.
|
||||
-->
|
||||
</xsl:for-each>
|
||||
<xsl:text>,</xsl:text>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -1,210 +0,0 @@
|
|||
<?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:
|
||||
see eeschema.pdf, chapter 14
|
||||
-->
|
||||
|
||||
<!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
|
||||
Creates the entire netlist
|
||||
(can be seen as equivalent to main function in C
|
||||
-->
|
||||
<xsl:template match="/export">
|
||||
<xsl:text>( { EESchema Netlist Version 1.1 </xsl:text>
|
||||
<!-- Generate line .TIM <time> -->
|
||||
<xsl:apply-templates select="design/date"/>
|
||||
<!-- Generate line eeschema version ... -->
|
||||
<xsl:apply-templates select="design/tool"/>
|
||||
<xsl:text>}&nl;</xsl:text>
|
||||
|
||||
<!-- Generate the list of components -->
|
||||
<xsl:apply-templates select="components/comp"/> <!-- Generate list of components -->
|
||||
|
||||
<!-- end of file -->
|
||||
<xsl:text>)&nl;*&nl;</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<!--
|
||||
Generate id in header like "eeschema (2010-08-17 BZR 2450)-unstable"
|
||||
-->
|
||||
<xsl:template match="tool">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<!--
|
||||
Generate date in header like "20/08/2010 10:45:33"
|
||||
-->
|
||||
<xsl:template match="date">
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>&nl;</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<!--
|
||||
This template read each component
|
||||
(path = /export/components/comp)
|
||||
creates lines:
|
||||
( 3EBF7DBD $noname U1 74LS125
|
||||
... pin list ...
|
||||
)
|
||||
and calls "create_pin_list" template to build the pin list
|
||||
-->
|
||||
<xsl:template match="comp">
|
||||
<xsl:text> ( </xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test = "tstamp != '' ">
|
||||
<xsl:apply-templates select="tstamp"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>00000000</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test = "footprint != '' ">
|
||||
<xsl:apply-templates select="footprint"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>$noname</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="@ref"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test = "value != '' ">
|
||||
<xsl:apply-templates select="value"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>"~"</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:text>&nl;</xsl:text>
|
||||
<xsl:call-template name="Search_pin_list" >
|
||||
<xsl:with-param name="cmplib_id" select="libsource/@part"/>
|
||||
<xsl:with-param name="cmp_ref" select="@ref"/>
|
||||
</xsl:call-template>
|
||||
<xsl:text> )&nl;</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<!--
|
||||
This template search for a given lib component description in list
|
||||
lib component descriptions are in /export/libparts,
|
||||
and each description start at ./libpart
|
||||
We search here for the list of pins of the given component
|
||||
This template has 2 parameters:
|
||||
"cmplib_id" (reference in libparts)
|
||||
"cmp_ref" (schematic reference of the given component)
|
||||
-->
|
||||
<xsl:template name="Search_pin_list" >
|
||||
<xsl:param name="cmplib_id" select="0" />
|
||||
<xsl:param name="cmp_ref" select="0" />
|
||||
<xsl:for-each select="/export/libparts/libpart">
|
||||
<xsl:if test = "@part = $cmplib_id ">
|
||||
<xsl:apply-templates name="build_pin_list" select="pins/pin">
|
||||
<xsl:with-param name="cmp_ref" select="$cmp_ref"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!--
|
||||
This template writes the pin list of a component
|
||||
from the pin list of the library description
|
||||
The pin list from library description is something like
|
||||
<pins>
|
||||
<pin num="1" type="passive"/>
|
||||
<pin num="2" type="passive"/>
|
||||
</pins>
|
||||
Output pin list is ( <pin num> <net name> )
|
||||
something like
|
||||
( 1 VCC )
|
||||
( 2 GND )
|
||||
-->
|
||||
<xsl:template name="build_pin_list" match="pin">
|
||||
<xsl:param name="cmp_ref" select="0" />
|
||||
|
||||
<!-- write pin number and separator -->
|
||||
<xsl:text> ( </xsl:text>
|
||||
<xsl:value-of select="@num"/>
|
||||
<xsl:text> </xsl:text>
|
||||
|
||||
<!-- search net name in nets section and write it: -->
|
||||
<xsl:variable name="pinNum" select="@num" />
|
||||
<xsl:for-each select="/export/nets/net">
|
||||
<!-- net name is output only if there is more than one pin in net
|
||||
else use "?" as net name, so count items in this net
|
||||
-->
|
||||
<xsl:variable name="pinCnt" select="count(node)" />
|
||||
<xsl:apply-templates name="Search_pin_netname" select="node">
|
||||
<xsl:with-param name="cmp_ref" select="$cmp_ref"/>
|
||||
<xsl:with-param name="pin_cnt_in_net" select="$pinCnt"/>
|
||||
<xsl:with-param name="pin_num"> <xsl:value-of select="$pinNum"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:for-each>
|
||||
|
||||
<!-- close line -->
|
||||
<xsl:text> )&nl;</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<!--
|
||||
This template writes the pin netname of a given pin of a given component
|
||||
from the nets list
|
||||
The nets list description is something like
|
||||
<nets>
|
||||
<net code="1" name="GND">
|
||||
<node ref="J1" pin="20"/>
|
||||
<node ref="C2" pin="2"/>
|
||||
</net>
|
||||
<net code="2" name="">
|
||||
<node ref="U2" pin="11"/>
|
||||
</net>
|
||||
</nets>
|
||||
This template has 2 parameters:
|
||||
"cmp_ref" (schematic reference of the given component)
|
||||
"pin_num" (pin number)
|
||||
-->
|
||||
|
||||
<xsl:template name="Search_pin_netname" match="node">
|
||||
<xsl:param name="cmp_ref" select="0" />
|
||||
<xsl:param name="pin_num" select="0" />
|
||||
<xsl:param name="pin_cnt_in_net" select="0" />
|
||||
|
||||
<xsl:if test = "@ref = $cmp_ref ">
|
||||
<xsl:if test = "@pin = $pin_num">
|
||||
<!-- net name is output only if there is more than one pin in net
|
||||
else use "?" as net name
|
||||
-->
|
||||
<xsl:if test = "$pin_cnt_in_net>1">
|
||||
<xsl:choose>
|
||||
<!-- if a net has a name, use it,
|
||||
else build a name from its net code
|
||||
-->
|
||||
<xsl:when test = "../@name != '' ">
|
||||
<xsl:value-of select="../@name"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>$N-0</xsl:text><xsl:value-of select="../@code"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:if>
|
||||
<xsl:if test = "$pin_cnt_in_net <2">
|
||||
<xsl:text>?</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -1,131 +0,0 @@
|
|||
<?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:
|
||||
see eeschema.pdf, chapter 14
|
||||
-->
|
||||
|
||||
<!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:text>&nl;</xsl:text>
|
||||
<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 .APP "eeschema (2010-08-17 BZR 2450)-unstable" -->
|
||||
<xsl:template match="tool">
|
||||
<xsl:text>.APP "</xsl:text>
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>"&nl;</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Generate line .TIM 20/08/2010 10:45:33 -->
|
||||
<xsl:template match="date">
|
||||
<xsl:text>.TIM </xsl:text>
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>&nl;</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<!-- for each component -->
|
||||
<!-- create lines like
|
||||
.ADD_COM U3 74LS541 (when no footprint name specified)
|
||||
.ADD_COM JP1 CONN_8X2 pin_array_8x2 pin_array_8x2 (with a specified footprint name)
|
||||
-->
|
||||
<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:apply-templates select="value"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>?</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:choose>
|
||||
<xsl:when test = "footprint != '' ">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:apply-templates select="footprint"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:text>&nl;</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<!-- for each net -->
|
||||
<!-- create lines like
|
||||
.ADD_TER U3.9 /PC-RST
|
||||
.TER U3.8
|
||||
BUS1.2
|
||||
.ADD_TER BUS1.14 /PC-IOR
|
||||
.TER U3.7
|
||||
-->
|
||||
<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>
|
|
@ -1,123 +0,0 @@
|
|||
<?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:
|
||||
see eeschema.pdf, chapter 14
|
||||
-->
|
||||
|
||||
<!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:text>&nl;</xsl:text>
|
||||
<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 .APP "eeschema (2010-08-17 BZR 2450)-unstable" -->
|
||||
<xsl:template match="tool">
|
||||
<xsl:text>.APP "</xsl:text>
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>"&nl;</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Generate line .TIM 20/08/2010 10:45:33 -->
|
||||
<xsl:template match="date">
|
||||
<xsl:text>.TIM </xsl:text>
|
||||
<xsl:apply-templates/>
|
||||
<xsl:text>&nl;</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<!-- for each component -->
|
||||
<!-- create lines like
|
||||
.ADD_COM U3 "74LS541" (when no footprint name specified)
|
||||
.ADD_COM JP1 "CONN_8X2" "pin_array_8x2" "pin_array_8x2" (with a specified footprint name)
|
||||
-->
|
||||
<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 -->
|
||||
<!-- create lines like
|
||||
.ADD_TER U3.9 "/PC-RST"
|
||||
.TER U3.8
|
||||
BUS1.2
|
||||
.ADD_TER BUS1.14 "/PC-IOR"
|
||||
.TER U3.7
|
||||
-->
|
||||
<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>
|
|
@ -1,69 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--XSL style sheet to EESCHEMA Generic Netlist Format to PADS netlist format
|
||||
Copyright (C) 2010, SoftPLC Corporation.
|
||||
GPL v2.
|
||||
|
||||
How to use:
|
||||
see eeschema.pdf, chapter 14
|
||||
-->
|
||||
|
||||
<!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"/>
|
||||
|
||||
<xsl:template match="/export">
|
||||
<xsl:text>!PADS-POWERPCB-V2.0-MILS!&nl;*PART*&nl;</xsl:text>
|
||||
<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 -->
|
||||
<xsl:template match="comp">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="@ref"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test = "footprint != '' ">
|
||||
<xsl:apply-templates select="footprint"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>unknown</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:text>*SIGNAL* </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:apply-templates select="node"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<!-- for each node -->
|
||||
<xsl:template match="node">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="@ref"/>
|
||||
<xsl:text>.</xsl:text>
|
||||
<xsl:value-of select="@pin"/>
|
||||
<xsl:text>&nl;</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -12,7 +12,6 @@
|
|||
"gettext",
|
||||
"harfbuzz",
|
||||
"glm",
|
||||
"libxslt",
|
||||
"opencascade",
|
||||
"opengl",
|
||||
"python3",
|
||||
|
|
Loading…
Reference in New Issue