Property: attributeList
Gets or sets the attribute list (i.e. the collection of all attribute values) associated with this object.
SPArray attributeList();
attributeList = SPArray
Returns or accepts an SPArray of DWAttribute objects
You can always get this property, but you cannot set it on a type that is already instantiated in a circuit, or was loaded from a library. This can only be set for a DWTypePin object that was created within the script.
Property: direction
Get or set the pin's visible direction on the symbol (north, south, east, west). This is also used to set invisible and bus internal pins.
char = direction
direction = char
A pin's direction is determined by a single character, which must be one of the following:
NORTH | N |
SOUTH | S |
EAST | E |
WEST | W |
INVISIBLE | I |
BUS INTERNAL | B |
See the example under func
Property: func
Get or set the pin's function (i.e. input, output, etc.).
char = func
func = char
A pin's function is determined by a single character, which must be one of the following:
IN | I |
OUT | O |
3STATE | 3 |
BIDIR | B |
PULLUP | U |
OC | C |
UNDEFINED | X |
BUS | S |
LOW | L |
HIGH | H |
LTCHIN | W |
LTCHOUT | Y |
CLKIN | K |
CLKOUT | Q |
CLOCK | R |
OE | E |
NC | N |
POWER | P |
DRIVER | D |
ANALOG | A |
// Creating a bus/bundle pin t = DWType(); numInternalPins = 4; t.numPins = numInternalPins +1; // Extra pin for the bus/bundle pin itself pins = t.pins; // Get the pin list so we can set info on each pin // Run through input pins and set position and name. // The crucial issue for bus/bundle pins is order. // The visible bus pin, must be first and its "func" must be "S". // The internal pins must follow and have a "direction" of "B". // Once any pin is added with a "direction" other than "B", that's // the end of the internal pins for this bus pin. x = 0; y = 140; pins[0].posX = x; pins[0].posY = y; pins[0].name = "P"; pins[0].func = 'S'; // S for buS pins[0].direction = 'W'; // W for West // The x/y position for the bus internal pins doesn't matter, never used for (p = 1; p <= numInternalPins; p++) { pins[p].name = "P"+(p-1); // Make a nice name, can be anything you want, // as long as there are no duplicates pins[p].func = 'P'; // I for Input, can be whatever you want pins[p].direction = 'B'; // B for Bus internal pin }
Method: getAttribute
Gets an attribute value from this object
String getAttribute(fieldName);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
fieldName | String | The name of the field to retrieve |
Returns a string representing the value of the specified attribute field. This string will be empty (zero length) if the field does not exist.
Method: getAttributeVis
Gets the visibility of an attribute on this object
bool getAttributeVis(fieldName);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
fieldName | String | The name of the field to retrieve |
Returns true if the field is displayed on the schematic, false otherwise
Property: isBundle
Returns true if this pin is a bundle.
bool = isBundle
This property is read-only.
Property: name
Get or set the pin's name.
String = name
name = String
A pin name is limited to 16 characters. No changes can be made to a type that is instantiated in a circuit.
Property: objType
Returns a string with the name of this object class "DWTypePin".
String = objType
Property: pinLength
Get or set the pin's length.
int = pinLength
pinLength = int
Length is measured in 1/1000" and must be a multiple of the grid size of 70 units.
Property: pinNum
Get or set the pin's default pin number.
String = pinNum
pinNum = String
Pin numbers can be any characters, but are limited to 8 characters length.
Property: posX
Get or set the pin's X position on the symbol.
int = posX
posX = int
Positions are measured in 1/1000"
See the example under func
Property: posY
Get or set the pin's Y position on the symbol.
int = posY
posY = int
Positions are measured in 1/1000"
See the example under func
Property: readOnly
Returns true if the type containing this pin is in use in a circuit. No changes can be made to a type definition that is in use.
bool = readOnly
Method: setAttribute
Sets an attribute value in this object
void setAttribute(fieldName, value);
void setAttribute(fieldName, value, visibility);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
value | String | The new value for the specified field |
fieldName | String | The name of the field to set |
visibility | int | How to set visibility of resulting attribute text. 0 (false) = hide, 1 (true) = show, 2 = use default setting in design's attribute table, -1 = leave current visibility If this parameter is not supplied, 2 is assumed. |
Null.
Method: setAttributeVis
Sets the visibility of an attribute value in this object
void setAttributeVis(fieldName, visibility);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
fieldName | String | The name of the field to set |
visibility | bool | true to make the attribute visible, false to hide it |