1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6 <link rel=
"stylesheet" media=
"screen" type=
"text/css" href=
"./style.css" />
7 <link rel=
"stylesheet" media=
"screen" type=
"text/css" href=
"./design.css" />
8 <link rel=
"stylesheet" media=
"print" type=
"text/css" href=
"./print.css" />
10 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8" />
15 <h1 class=
"sectionedit1439"><a name=
"part_manager_user_guide" id=
"part_manager_user_guide">Part Manager User Guide
</a></h1>
19 <!-- EDIT1439 SECTION "Part Manager User Guide" [1-39] -->
20 <h2 class=
"sectionedit1440"><a name=
"bulk_import" id=
"bulk_import">Bulk Import
</a></h2>
24 Currently, the part manager only provides a command line interface for bulk import of data.
<acronym title=
"Extensible Stylesheet Language Transformations">XSLT
</acronym> converts
<acronym title=
"Extensible Markup Language">XML
</acronym> data into
<acronym title=
"Structured Query Language">SQL
</acronym> using a stylesheet. Then, the
<acronym title=
"Structured Query Language">SQL
</acronym> can be read by a command line interface for the database. The following diagram shows the dataflow for a bulk import:
28 <a href=
"media/geda/gparts-bulk-import.png" class=
"media" target=
"_blank" title=
"geda:gparts-bulk-import.png"><img src=
"media/geda/gparts-bulk-import.png" class=
"media" title=
"Bulk Import Dataflow" alt=
"Bulk Import Dataflow" /></a>
32 The import can be accomplished with the following command line when in the gparts/sql/sqlite directory:
36 <pre STYLE=
"background : LightGreen;
37 margin-left : 2em"><font size=
"+0">$ xsltproc convert.xml ../../data/companies.xml | sqlite3 sample.db
</font></pre>
41 See the
<acronym title=
"Extensible Markup Language">XML
</acronym> files in the gparts/data directory for examples. Any combination of company, package, and part elements can be used within the data element.
45 Use the following as an example for specifying a company.
47 <pre class=
"file"> <company
>
48 <company-name
>Altera
</company-name
>
49 <website
>http://www.altera.com
</website
>
50 </company
></pre>
53 Use the following as an example for specifying a package.
56 <pre class=
"file"> <package
>
57 <package-name
>0201(
0603)
</package-name
>
58 <technology
>SMT
</technology
>
59 </package
></pre>
62 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…
64 <pre class=
"file"> <resistor
>
65 <company-name
>Bourns
</company-name
>
66 <part-number
>CR0603-FX-
10R0ELF
</part-number
>
67 <package-name
>0603(
1608)
</package-name
>
68 <device-name
>resistor
</device-name
>
69 <resistance
>10.000000</resistance
>
70 <tolerance
>0.010000</tolerance
>
71 <document category=
"Datasheet
">http://www.bourns.com/data/global/pdfs/CHPREZTR.pdf
</document
>
72 </resistor
></pre>
75 <!-- EDIT1440 SECTION "Bulk Import" [40-1774] -->
76 <h2 class=
"sectionedit1441"><a name=
"part_attributes" id=
"part_attributes">Part Attributes
</a></h2>
80 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:
84 <li class=
"level1"><div class=
"li"> loads the symbol drawing
</div>
86 <li class=
"level1"><div class=
"li"> instantiates a component from the symbol drawing
</div>
88 <li class=
"level1"><div class=
"li"> places inherited attributes in the component
</div>
90 <li class=
"level1"><div class=
"li"> performs macro expansion on inherited attributes
</div>
96 Currently, macros can only be used in attributes that get promoted. The logic for attribute promotion must match between gschem and the part manager.
100 The following gschem file snippet shows the macro used place the field from the database column
'Resistance
' into the
'VALUE
' attribute.
102 <pre class=
"file">T
195 200 8 10 1 1 0 0 1
103 VALUE=$(Resistance)
</pre>
106 <!-- EDIT1441 SECTION "Part Attributes" [1775-] --></body>