1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5 <link rel=
"stylesheet" media=
"screen" type=
"text/css" href=
"./style.css" />
6 <link rel=
"stylesheet" media=
"screen" type=
"text/css" href=
"./design.css" />
7 <link rel=
"stylesheet" media=
"print" type=
"text/css" href=
"./print.css" />
9 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8" />
14 <a href=
"start.html" class=
"wikilink1" title=
"start.html">gEDA
</a> >> <a href=
"geda-developer.html" class=
"wikilink1" title=
"geda-developer.html">Development
</a> >> <a href=
"geda-gparts_tc.html" class=
"wikilink1" title=
"geda-gparts_tc.html">Parts Manager
</a> >> <a href=
"geda-gparts_ug.html" class=
"wikilink1" title=
"geda-gparts_ug.html">User Guide
</a>
17 <h1 id=
"partmanageruserguide">Part Manager User Guide
</h1>
22 <h2 id=
"bulkimport">Bulk Import
</h2>
26 Currently, the part manager only provides a command line interface for bulk import of data. XSLT converts XML data into SQL using a stylesheet. Then, the SQL can be read by a command line interface for the database. The following diagram shows the dataflow for a bulk import:
30 <a href=
"media/geda/gparts-bulk-import.png" class=
"media" target=
"_blank" title=
"geda:gparts-bulk-import.png">Bulk Import Dataflow
</a>
34 The import can be accomplished with the following command line when in the gparts/sql/sqlite directory:
36 <pre class=
"code">$ xsltproc convert.xml ../../data/companies.xml | sqlite3 sample.db
</pre>
39 See the XML files in the gparts/data directory for examples. Any combination of company, package, and part elements can be used within the data element.
43 Use the following as an example for specifying a company.
45 <pre class=
"file"> <company
>
46 <company-name
>Altera
</company-name
>
47 <website
>http://www.altera.com
</website
>
48 </company
></pre>
51 Use the following as an example for specifying a package.
53 <pre class=
"file"> <package
>
54 <package-name
>0201(
0603)
</package-name
>
55 <technology
>SMT
</technology
>
56 </package
></pre>
59 Use the following as an example for specifying a resistor. The resistor, as any part, can have multiple document elements associated with it. The category specifies the type of document, such as datasheet, user manual, errata, etc...
61 <pre class=
"file"> <resistor
>
62 <company-name
>Bourns
</company-name
>
63 <part-number
>CR0603-FX-
10R0ELF
</part-number
>
64 <package-name
>0603(
1608)
</package-name
>
65 <device-name
>resistor
</device-name
>
66 <resistance
>10.000000</resistance
>
67 <tolerance
>0.010000</tolerance
>
68 <document category=
"Datasheet
">http://www.bourns.com/data/global/pdfs/CHPREZTR.pdf
</document
>
69 </resistor
></pre>
73 <h2 id=
"partattributes">Part Attributes
</h2>
77 The part manager places database fields into component attributes using macros. The macros use the form $(column_name). Unfortunately, this mechanism requires modification of symbols in the library for use with the part manager. The part manager performs the operation in the following steps:
80 <li class=
"level1"><div class=
"li"> loads the symbol drawing
</div>
82 <li class=
"level1"><div class=
"li"> instantiates a component from the symbol drawing
</div>
84 <li class=
"level1"><div class=
"li"> places inherited attributes in the component
</div>
86 <li class=
"level1"><div class=
"li"> performs macro expansion on inherited attributes
</div>
91 Currently, macros can only be used in attributes that get promoted. The logic for attribute promotion must match between gschem and the part manager.
95 The following gschem file snippet shows the macro used place the field from the database column
'Resistance
' into the
'VALUE
' attribute.
97 <pre class=
"file">T
195 200 8 10 1 1 0 0 1
98 VALUE=$(Resistance)
</pre>