A single schematic element. More...
| void | addParameter(string parameter , string value) |
| double | getDoubleParameter(string parameter) |
| component* | getComponent() |
| int | getIntParameter(string parameter) |
| string | getParameter(string parameter) |
| stringList | getParameterList() |
| string | getParsedParameter(string parameter) |
| point | getPoint() |
| pointArray | getPoints() |
| point | getPortPos(string portname) |
| bool | isGlobal() |
| bool | isPortOrBusport() |
| bool | isArc() |
| bool | isBus() |
| bool | isBusport() |
| bool | isCircle() |
| bool | isDevice() |
| bool | isGround() |
| bool | isPolyline() |
| bool | isPolygon() |
| bool | isPort() |
| bool | isRect() |
| bool | isText() |
| bool | isWire() |
| bool | isWireLabel() |
| void | setColor(int red,int green, int blue) |
| void | setGlobal(bool global) |
| void | setParameter(string parameter, string value, bool triggerCallback=false) |
An sElement is one object on a schematic sheet: a device, a wire, a port, a ground, a label, or a drawing shape such as a polygon. You never construct it; addWire, addPlacement and the other add… methods on sheet return the new element. Walk firstElement on the sheet and use the is… tests before you read geometry or parameters. Devices hold a component from getComponent and a list of parameters; addParameter creates or overwrites a value, while setParameter only changes a name that already exists. Colour of non-functional shapes is setColor; wires, devices and ports take their colour from setup. A missing port position is the sentinel point (-123456789, -123456789).
Example:
sElementList *el = schematic->drawing->currentSheet->firstElement;
while (el != NULL) {
sElement *e = el->thisElement;
if (e != NULL && e->isDevice()) {
component *c = e->getComponent();
string w = e->getParameter("width");
e->setParameter("width", "1.2u", false);
}
el = el->nextElement;
}
Adds parameter and sets it to value. If the name already exists, only the value is replaced.
| Parameter: | |
|---|---|
| parameter | parameter |
| value | value |
Returns: the value of parameter as a double. If the parameter is missing or is not a double, 0 is returned.
Returns: the component of a device, or NULL for every other element type. (introduced with release 20211005)
Returns: the value of parameter as an integer. If the parameter is missing or is not an integer, -1 is returned.
Returns: the value of parameter as a string. Numerical parameters are converted to text.
Returns: a stringList of all device parameter names. The device name itself is not in this list.
Returns: the value of parameter after iPDK parsing.
Returns: the origin of a single-point element such as a port, a text or a ground.
Returns: the vertices of a multi-point element such as a wire, a bus or a polygon.
Returns: the position of the port portname on a device. If the element is not a device or the name is unknown, point(-123456789, -123456789) is returned.
Returns: true if this port is global, otherwise false.
Returns: true if the element is a port or a bus port.
Returns: true if the element is an arc.
Returns: true if the element is a bus.
Returns: true if the element is a bus port.
Returns: true if the element is a circle.
Returns: true if the element is a device placement.
Returns: true if the element is a ground.
Returns: true if the element is a polyline.
Returns: true if the element is a polygon.
Returns: true if the element is a port.
Returns: true if the element is a rectangle.
Returns: true if the element is a text.
Returns: true if the element is a wire.
Returns: true if the element is a wire label.
Sets the colour of a non-functional shape such as a polygon, a polyline or a circle. Functional elements (wires, devices, ports) take their colour from setup.
| Parameter: | |
|---|---|
| red | red colour channel |
| green | green colour channel |
| blue | blue colour channel |
Marks a port as global when global is true, or as a local port when false. (introduced with release 20260628)
Sets an existing parameter to value. Unlike addParameter, this method never creates a new name. If triggerCallback is true, the component callback runs after the change.
| Parameter: | |
|---|---|
| parameter | name of an existing parameter |
| value | new value |
| triggerCallback | if true, run the component callback |