A component (=device) which can be placed in the schematic window. More...
| void | createSymbol(netList *nl) |
| string | description |
| string | extractionMethod |
| string | extractionParameter |
| string | extractionDeviceParameter |
| string | label |
| string | prefix |
| string | layout |
| void | setName(string name) |
| void | setLibrary(string library) |
| string | getLibrary() |
| string | getName() |
| symbol * | getSymbol(int pos=0) |
| void | setModel(string type,string value) |
| void | setNameLibrary(string name,string library) |
| void | setNetlist(string type,string value) |
| void | setSymbol(sheet *symbol) |
A component is a library device: the symbol you place, the parameters, the netlist and model text for simulation, and the layout or macro used for schematic-driven layout. You do not construct one with new; components findComponent or newComponent returns the pointer. A placement on a sheet points back through sElement getComponent. getSymbol returns the drawing of the device as a symbol; if several symbols exist, pos selects which one. setNetlist and setModel store the text used when a netlist of that type is generated. Extraction fields (extractionMethod, extractionParameter, extractionDeviceParameter) describe how the same device is recognised in a layout; they match the Edit Component dialog and device extraction.
Example:
component *c = components::findComponent("nmos", "analog");
if (c == NULL)
c = components::newComponent("nmos", "analog");
c->prefix = "M";
c->setNetlist("ngspice", "M%d %d %d %d %d nmos w=%d l=%d");
symbol *sy = c->getSymbol();
if (sy != NULL && sy->firstElement != NULL) {
sElement *e = sy->firstElement->thisElement;
}
Builds a simple black-box symbol from the ports of nl. (introduced with release 20210103)
Text description of the component.
Method used to extract this component from a layout. See Edit Component and device extraction.
Parameters of the extraction method. See Edit Component and device extraction.
Component parameters filled on devices extracted from layout. See Edit Component and device extraction.
Text used for the component label.
Prefix used when a new device name is generated, for example R or M.
Layout cell or macro used for this component in schematic-driven layout.
Sets the name of the component in its library.
Sets the library this component belongs to.
Returns: the library name.
Returns: the component name.
Returns: a pointer to a symbol of this component. If several symbols exist, pos selects which one. The pointer can be used to edit the symbol.
Stores model text value for netlist format type. (introduced with release 20210103)
| Parameter: | |
|---|---|
| type | mode selector |
| value | value |
Sets both the name and the library of the component.
| Parameter: | |
|---|---|
| name | name |
| library | library |
Stores netlist text value for netlist format type. (introduced with release 20210103)
| Parameter: | |
|---|---|
| type | mode selector |
| value | value |
Takes the drawing of symbol (a sheet) and stores it as the symbol of this component.