Constructor
new Transistor(tikzComponentName, instanceNameopt, pins, anchorNames, anchorNr, coordopt, nodeNameopt, angleopt, mirrorXopt, mirrorYopt)
Generate a TikZ transistor (-stencil).
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
tikzComponentName |
string | the tikz component name, e.g. "R" |
||
instanceName |
string |
<optional> |
"" | the instance name, e.g. "R1" |
pins |
Array.<Pin> | top, bottom and tap pin |
||
anchorNames |
Array.<string> | top, bottom and tap pin name |
||
anchorNr |
0 | 1 | 2 | null | the selected anchor; 0=top, 1=bottom, 2=tap; null=use mid/bulk |
||
coord |
Coordinate |
<optional> |
null | position if selected anchor == null |
nodeName |
string |
<optional> |
"" | the name of the node |
angle |
number |
<optional> |
0 | the angle to rotate the component |
mirrorX |
boolean |
<optional> |
false | true to mirror on x axis |
mirrorY |
boolean |
<optional> |
false | true to mirror on y axis |
Properties:
Name | Type | Description |
---|---|---|
instanceName |
string | the instance name, e.g. "R1" |
pins |
Array.<Pin> | top, bottom and tap pin |
anchorNames |
Array.<string> | top, bottom and tap pin name |
anchorNr |
0 | 1 | 2 | null | the selected anchor; 0=top, 1=bottom, 2=tap; null=use mid |
nodeName |
string | the name of the node |
- Source:
Extends
Members
coord
- Source:
lineCrossingCoord
Calculates the coordinate where the top-bottom line crosses the orthogonal tap line. This can but does not need to be the center point.
- Source:
nodeText
- Source:
tikzComponentName
- Source:
Methods
deepClone() → {Transistor}
Deep clone of the object.
- Source:
Returns:
the cloned transistor
- Type
- Transistor
mirror(mirrorX, mirrorY)
Mirror coords/pins around the anchor.
Parameters:
Name | Type | Description |
---|---|---|
mirrorX |
boolean | true to mirror |
mirrorY |
boolean | true to mirror |
- Source:
rotate(angle)
Rotate every coord around the anchor. The rotation is counter clockwise, like the default mathematical rotation.
Parameters:
Name | Type | Description |
---|---|---|
angle |
number |
- Source:
serialize(indentopt) → {string}
Serializes a component. The TikZ "source code" is returned.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
indent |
number |
<optional> |
0 | the indention (= amount of tabs) to use |
- Overrides:
- Source:
Returns:
the serialized component
- Type
- string
translate(vector)
Move all pins/coordinates using a vector.
Parameters:
Name | Type | Description |
---|---|---|
vector |
Coordinate | vector to add to all coordinates |
- Source:
(static) fromStruct(tikzComponentName, pins, options, nodeNameopt) → {Transistor}
Creates a new stencil from a TikZ pgfkeys alike object
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
tikzComponentName |
string | |||
pins |
Array.<Pin> | top, bottom and tap pin |
||
options |
tikzTripolOptions | |||
nodeName |
string |
<optional> |
"" |
- Source:
Returns:
the created stencil
- Type
- Transistor