Table of Contents

Class PowerSwitch

Namespace
NominalSystems.Classes
Assembly
NominalSystems.Classes.dll

[Nominal] A power switch is able to control the circuit it is connected to based on user input.


public class PowerSwitch : PowerComponent, IPowerInterface
Inheritance
PowerSwitch
Implements

Constructors

PowerSwitch()

Default constructor

protected PowerSwitch()

Properties

IsOpen

A flag if the switch is currently open or closed

[ReadOnly]
[Metadata(ContainedIn = "PowerModel")]
public bool IsOpen { get; }

Property Value

bool

Methods

BuildPower(string, string)

Builds the power components based on the power bus reference. Here, the interfaced component will be able to assign its SPICE components to the power bus. This will return an array of IEntity objects that represent the SPICE components.

[Hidden]
public override IEntity[] BuildPower(string negative, string positive)

Parameters

negative string

The input node for the entity

positive string

The output node for the entity

Returns

IEntity[]

ConfigurePower(double)

Configures the power interface to its default state, which will include updating the variables of any SPICE power components to the correct state.

public override bool ConfigurePower(double step)

Parameters

step double

[s] The step time for the circuit run

Returns

bool

A success flag

SetClose()

Closes the circuit that the switch is on

public void SetClose()

SetOpen()

Opens the circuit that the switch is on

public void SetOpen()

SetState(bool)

Sets the open state of the switch if it is on

public void SetState(bool isOpen)

Parameters

isOpen bool

An open state of the switch

Toggle()

Toggles the state of the switch

public bool Toggle()

Returns

bool

A flag if the state is open