Class Component
A class that represents a (Spice) component/device.
Implements
Inherited Members
Namespace: SpiceSharp.Components
Assembly: SpiceSharp.dll
Syntax
public abstract class Component : Entity, IComponent, IEntity, IParameterSetCollection, IParameterSet, ICloneable<IEntity>, IRuleSubject
Constructors
Component(string, int)
Initializes a new instance of the Component class.
Declaration
protected Component(string name, int nodeCount)
Parameters
Type | Name | Description |
---|---|---|
string | name | The string of the entity. |
int | nodeCount | The node count. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
Properties
Model
Gets or sets the name of the component model.
Declaration
public string Model { get; set; }
Property Value
Type | Description |
---|---|
string | The name of the component model. |
Nodes
Gets a list of all the nodes that the component is connected to.
Declaration
public IReadOnlyList<string> Nodes { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<string> | The nodes. |
Methods
Clone()
Clones the instance.
Declaration
public override IEntity Clone()
Returns
Type | Description |
---|---|
IEntity | The cloned instance. |
Overrides
Connect(params string[])
Connects the component in the circuit.
Declaration
public IComponent Connect(params string[] nodes)
Parameters
Type | Name | Description |
---|---|---|
string[] | nodes | The node indices. |
Returns
Type | Description |
---|---|
IComponent | The instance calling the method for chaining. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
NodeMismatchException | Thrown if the number of nodes does not match the pin count of the component. |
ToString()
Returns a string that represents the current entity.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents the current object. |