gsch2pcb: Make --m4-file and -m4-pcbdir arguments work again.
[geda-gaf/peter-b.git] / docs / wiki / geda-gparts_ug.html
blob22bf6952bc4295e8c80c67b24617cb7bc8728dce
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html>
4 <head>
5 <title></title>
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" />
11 </head>
12 <body>
15 <h1 class="sectionedit1439"><a name="part_manager_user_guide" id="part_manager_user_guide">Part Manager User Guide</a></h1>
16 <div class="level1">
18 </div>
19 <!-- EDIT1439 SECTION "Part Manager User Guide" [1-39] -->
20 <h2 class="sectionedit1440"><a name="bulk_import" id="bulk_import">Bulk Import</a></h2>
21 <div class="level2">
23 <p>
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:
25 </p>
27 <p>
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>
29 </p>
31 <p>
32 The import can be accomplished with the following command line when in the gparts/sql/sqlite directory:
33 </p>
35 <p>
36 <pre STYLE="background : LightGreen;
37 margin-left : 2em"><font size="+0">$ xsltproc convert.xml ../../data/companies.xml | sqlite3 sample.db</font></pre>
38 </p>
40 <p>
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.
42 </p>
44 <p>
45 Use the following as an example for specifying a company.
46 </p>
47 <pre class="file"> &lt;company&gt;
48 &lt;company-name&gt;Altera&lt;/company-name&gt;
49 &lt;website&gt;http://www.altera.com&lt;/website&gt;
50 &lt;/company&gt;</pre>
52 <p>
53 Use the following as an example for specifying a package.
55 </p>
56 <pre class="file"> &lt;package&gt;
57 &lt;package-name&gt;0201(0603)&lt;/package-name&gt;
58 &lt;technology&gt;SMT&lt;/technology&gt;
59 &lt;/package&gt;</pre>
61 <p>
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…
63 </p>
64 <pre class="file"> &lt;resistor&gt;
65 &lt;company-name&gt;Bourns&lt;/company-name&gt;
66 &lt;part-number&gt;CR0603-FX-10R0ELF&lt;/part-number&gt;
67 &lt;package-name&gt;0603(1608)&lt;/package-name&gt;
68 &lt;device-name&gt;resistor&lt;/device-name&gt;
69 &lt;resistance&gt;10.000000&lt;/resistance&gt;
70 &lt;tolerance&gt;0.010000&lt;/tolerance&gt;
71 &lt;document category=&quot;Datasheet&quot;&gt;http://www.bourns.com/data/global/pdfs/CHPREZTR.pdf&lt;/document&gt;
72 &lt;/resistor&gt;</pre>
74 </div>
75 <!-- EDIT1440 SECTION "Bulk Import" [40-1774] -->
76 <h2 class="sectionedit1441"><a name="part_attributes" id="part_attributes">Part Attributes</a></h2>
77 <div class="level2">
79 <p>
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:
82 </p>
83 <ol>
84 <li class="level1"><div class="li"> loads the symbol drawing</div>
85 </li>
86 <li class="level1"><div class="li"> instantiates a component from the symbol drawing</div>
87 </li>
88 <li class="level1"><div class="li"> places inherited attributes in the component</div>
89 </li>
90 <li class="level1"><div class="li"> performs macro expansion on inherited attributes</div>
91 </li>
92 </ol>
94 <p>
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.
97 </p>
99 <p>
100 The following gschem file snippet shows the macro used place the field from the database column &#039;Resistance&#039; into the &#039;VALUE&#039; attribute.
101 </p>
102 <pre class="file">T 195 200 8 10 1 1 0 0 1
103 VALUE=$(Resistance)</pre>
105 </div>
106 <!-- EDIT1441 SECTION "Part Attributes" [1775-] --></body>
107 </html>