Class Subcircuit
A subcircuit that can contain a collection of entities.
Implements
Inherited Members
Namespace: SpiceSharp.Components
Assembly: SpiceSharp.dll
Syntax
public class Subcircuit : Entity, IParameterized<Parameters>, IComponent, IEntity, IParameterSetCollection, IParameterSet, ICloneable<IEntity>, IRuleSubject
Constructors
Subcircuit(string, ISubcircuitDefinition, params string[])
Initializes a new instance of the Subcircuit class.
Declaration
public Subcircuit(string name, ISubcircuitDefinition definition, params string[] nodes)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the subcircuit. |
ISubcircuitDefinition | definition | The subcircuit definition. |
string[] | nodes | The nodes that the subcircuit is connected to. |
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. |
Parameters
Gets the parameter set.
Declaration
public Parameters Parameters { get; }
Property Value
Type | Description |
---|---|
Parameters | The parameter set. |
Methods
Apply(IRules)
Applies the subject to any rules in the validation provider.
Declaration
public void Apply(IRules rules)
Parameters
Type | Name | Description |
---|---|---|
IRules | rules | The provider. |
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. |
CreateBehaviors(ISimulation)
Creates the behaviors and stores them in the specified container.
Declaration
public override void CreateBehaviors(ISimulation simulation)
Parameters
Type | Name | Description |
---|---|---|
ISimulation | simulation | The simulation. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
ArgumentException | Thrown if the simulation does not use an IComplexSimulationState. |
TypeNotFoundException | Thrown if a required behavior or parameter set could not be found. |
AmbiguousTypeException | Thrown if a behavior or parameter set could not be resolved unambiguously. |