<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title></title> <link rel="stylesheet" media="screen" type="text/css" href="./style.css" /> <link rel="stylesheet" media="screen" type="text/css" href="./design.css" /> <link rel="stylesheet" media="print" type="text/css" href="./print.css" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <h1 class="sectionedit962"><a name="part_manager_user_guide" id="part_manager_user_guide">Part Manager User Guide</a></h1> <div class="level1"> </div> <!-- EDIT962 SECTION "Part Manager User Guide" [1-39] --> <h2 class="sectionedit963"><a name="bulk_import" id="bulk_import">Bulk Import</a></h2> <div class="level2"> <p> 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: </p> <p> <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> </p> <p> The import can be accomplished with the following command line when in the gparts/sql/sqlite directory: </p> <pre class="code">$ xsltproc convert.xml ../../data/companies.xml | sqlite3 sample.db</pre> <p> 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. </p> <p> Use the following as an example for specifying a company. </p> <pre class="file"> <company> <company-name>Altera</company-name> <website>http://www.altera.com</website> </company></pre> <p> Use the following as an example for specifying a package. </p> <pre class="file"> <package> <package-name>0201(0603)</package-name> <technology>SMT</technology> </package></pre> <p> 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… </p> <pre class="file"> <resistor> <company-name>Bourns</company-name> <part-number>CR0603-FX-10R0ELF</part-number> <package-name>0603(1608)</package-name> <device-name>resistor</device-name> <resistance>10.000000</resistance> <tolerance>0.010000</tolerance> <document category="Datasheet">http://www.bourns.com/data/global/pdfs/CHPREZTR.pdf</document> </resistor></pre> </div> <!-- EDIT963 SECTION "Bulk Import" [40-1761] --> <h2 class="sectionedit964"><a name="part_attributes" id="part_attributes">Part Attributes</a></h2> <div class="level2"> <p> 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: </p> <ol> <li class="level1"><div class="li"> loads the symbol drawing</div> </li> <li class="level1"><div class="li"> instantiates a component from the symbol drawing</div> </li> <li class="level1"><div class="li"> places inherited attributes in the component</div> </li> <li class="level1"><div class="li"> performs macro expansion on inherited attributes</div> </li> </ol> <p> Currently, macros can only be used in attributes that get promoted. The logic for attribute promotion must match between gschem and the part manager. </p> <p> The following gschem file snippet shows the macro used place the field from the database column 'Resistance' into the 'VALUE' attribute. </p> <pre class="file">T 195 200 8 10 1 1 0 0 1 VALUE=$(Resistance)</pre> </div> <!-- EDIT964 SECTION "Part Attributes" [1762-] --></body> </html>