Tcl SpiceGenTcl package (v)

::SpiceGenTcl::Common::BasicDevicesTop, Main, Index

ClassesTop, Main, Index

C [::SpiceGenTcl::Common::BasicDevices]Top, Main, Index

Method summary
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -Name

Writable: -Name

Superclasses

Capacitor

Capacitor [::SpiceGenTcl::Common::BasicDevices]Top, Main, Index

Method summary
constructorConstructor for the class.
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -Name

Writable: -Name

Superclasses

::SpiceGenTcl::Device

Subclasses

C

constructor [::SpiceGenTcl::Common::BasicDevices::Capacitor]Capacitor, Top, Main, Index

Creates object of class Capacitor that describes capacitor.

Capacitor create OBJNAME name npNode nmNode ?args?
Capacitor new name npNode nmNode ?args?
Parameters
nameName of the device without first-letter designator C.
npNodeName of node connected to positive pin.
nmNodeName of node connected to negative pin.
-cCapacitance value.
-icInitial condition, optional.
-mMultiplier value, optional.
-tc1Linear thermal coefficient, optional.
-tc2Quadratic thermal coefficient, optional.
-tempDevice temperature, optional, optional.
Description

Simple capacitor:

CXXXXXXX n+ n- <value> <m=val> <temp=val> <tc1=val> <tc2=val>

Example of class initialization:

::SpiceGenTcl::Common::BasicDevices::Capacitor new 1 netp netm -c 1e3 -tc1 1 -temp {temp_amb -eq}
method constructor {name npNode nmNode args} {

    # Creates object of class `Capacitor` that describes capacitor.
    #  name - name of the device without first-letter designator C
    #  npNode - name of node connected to positive pin
    #  nmNode - name of node connected to negative pin
    #  -c - capacitance value
    #  -m - multiplier value, optional
    #  -temp - device temperature, optional, optional
    #  -tc1 - linear thermal coefficient, optional
    #  -tc2 - quadratic thermal coefficient, optional
    #  -ic - initial condition, optional
    # Simple capacitor:
    # ```
    # CXXXXXXX n+ n- <value> <m=val> <temp=val> <tc1=val> <tc2=val>
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Common::BasicDevices::Capacitor new 1 netp netm -c 1e3 -tc1 1 -temp {temp_amb -eq}
    # ```
    set arguments [argparse -inline {
        {-c= -required}
        -m=
        -temp=
        -tc1=
        -tc2=
        -ic=
    }]
    if {([llength $cVal]>1) && ([lindex $cVal 1]=="-eq")} {
        lappend params "c [lindex $cVal 0] -poseq"
    } else {
        lappend params "c $cVal -pos"
    }

    dict for {paramName value} $arguments {
        if {$paramName ni {c}} {
            lappend params "$paramName $value"
        }
    }
    next c$name [list "np $npNode" "nm $nmNode"] $params
}

CSwitch [::SpiceGenTcl::Common::BasicDevices]Top, Main, Index

Method summary
constructorConstructor for the class.
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -Name

Writable: -Name

Superclasses

::SpiceGenTcl::Device

Subclasses

W, ::SpiceGenTcl::Ngspice::BasicDevices::CSwitch, ::SpiceGenTcl::Xyce::BasicDevices::CSwitch

constructor [::SpiceGenTcl::Common::BasicDevices::CSwitch]CSwitch, Top, Main, Index

Creates object of class CSwitch that describes current controlled switch device.

CSwitch create OBJNAME name npNode nmNode ?args?
CSwitch new name npNode nmNode ?args?
Parameters
nameName of the device without first-letter designator W.
npNodeName of node connected to positive pin.
nmNodeName of node connected to negative pin.
-icntrlSource of control current.
-modelModel name.
-on/-offInitial state of switch.
Description
WYYYYYYY N+ N- VNAM MODEL <ON> <OFF>

Example of class initialization:

::SpiceGenTcl::Ngspice::BasicDevices::CSwitch new 1 net1 0 -icntrl v1 -model sw1 -on
method constructor {name npNode nmNode args} {

    # Creates object of class `CSwitch` that describes current controlled switch device.
    #  name - name of the device without first-letter designator W
    #  npNode - name of node connected to positive pin
    #  nmNode - name of node connected to negative pin
    #  -icntrl - source of control current
    #  -model - model name
    #  -on/-off - initial state of switch
    # ```
    # WYYYYYYY N+ N- VNAM MODEL <ON> <OFF>
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Ngspice::BasicDevices::CSwitch new 1 net1 0 -icntrl v1 -model sw1 -on
    # ```
    set arguments [argparse -inline {
        {-icntrl= -required}
        {-model= -required}
        {-on -forbid {off}}
        {-off -forbid {on}}
    }]
    lappend params "icntrl [dict get $arguments icntrl] -posnocheck"
    lappend params "model [dict get $arguments model] -posnocheck"
    if {[dict exists $arguments on]} {
        lappend params {on -sw}
    } elseif {[dict exists $arguments off]} {
        lappend params {off -sw}
    }
    next w$name [list "np $npNode" "nm $nmNode"] $params
}

Inductor [::SpiceGenTcl::Common::BasicDevices]Top, Main, Index

Method summary
constructorConstructor for the class.
addParamSee ::SpiceGenTcl::Device.addParam
argsPreprocessSee ::SpiceGenTcl::KeyArgsBuilder.argsPreprocess
buildArgStrSee ::SpiceGenTcl::KeyArgsBuilder.buildArgStr
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -Name

Writable: -Name

Superclasses

::SpiceGenTcl::Device

Mixins

::SpiceGenTcl::KeyArgsBuilder

Subclasses

L

constructor [::SpiceGenTcl::Common::BasicDevices::Inductor]Inductor, Top, Main, Index

Creates object of class Inductor that describes inductor.

Inductor create OBJNAME name npNode nmNode ?args?
Inductor new name npNode nmNode ?args?
Parameters
nameName of the device without first-letter designator L.
npNodeName of node connected to positive pin.
nmNodeName of node connected to negative pin.
-lInductance value.
-mMultiplier value, optional.
-tc1Linear thermal coefficient, optional.
-tc2Quadratic thermal coefficient, optional.
-tempDevice temperature, optional, optional.
Description

Simple inductor:

LXXXXXXX n+ n- <value> <m=val> <temp=val> <tc1=val> <tc2=val>

Example of class initialization:

::SpiceGenTcl::Common::BasicDevices::Inductor new 1 netp netm -l 1e3 -tc1 1 -temp {temp_amb -eq}
method constructor {name npNode nmNode args} {

    # Creates object of class `Inductor` that describes inductor.
    #  name - name of the device without first-letter designator L
    #  npNode - name of node connected to positive pin
    #  nmNode - name of node connected to negative pin
    #  -l - inductance value
    #  -m - multiplier value, optional
    #  -temp - device temperature, optional, optional
    #  -tc1 - linear thermal coefficient, optional
    #  -tc2 - quadratic thermal coefficient, optional
    # Simple inductor:
    # ```
    # LXXXXXXX n+ n- <value> <m=val> <temp=val> <tc1=val> <tc2=val>
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Common::BasicDevices::Inductor new 1 netp netm -l 1e3 -tc1 1 -temp {temp_amb -eq}
    # ```
    set arguments [argparse -inline {
        {-l= -required}
        -m=
        -temp=
        -tc1=
        -tc2=
    }]
    set lVal [dict get $arguments l]
    if {([llength $lVal]>1) && ([lindex $lVal 1]=="-eq")} {
        lappend params "l [lindex $lVal 0] -poseq"
    } else {
        lappend params "l $lVal -pos"
    }
    dict for {paramName value} $arguments {
        if {$paramName ni {l}} {
            lappend params "$paramName $value"
        }
    }
    next l$name [list "np $npNode" "nm $nmNode"] $params
}

L [::SpiceGenTcl::Common::BasicDevices]Top, Main, Index

Method summary
addParamSee ::SpiceGenTcl::Device.addParam
argsPreprocessSee ::SpiceGenTcl::KeyArgsBuilder.argsPreprocess
buildArgStrSee ::SpiceGenTcl::KeyArgsBuilder.buildArgStr
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -Name

Writable: -Name

Superclasses

Inductor

R [::SpiceGenTcl::Common::BasicDevices]Top, Main, Index

Method summary
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -Name

Writable: -Name

Superclasses

Resistor

Resistor [::SpiceGenTcl::Common::BasicDevices]Top, Main, Index

Method summary
constructorConstructor for the class.
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -Name

Writable: -Name

Superclasses

::SpiceGenTcl::Device

Subclasses

R

constructor [::SpiceGenTcl::Common::BasicDevices::Resistor]Resistor, Top, Main, Index

Creates object of class Resistor that describes resistor.

Resistor create OBJNAME name npNode nmNode ?args?
Resistor new name npNode nmNode ?args?
Parameters
nameName of the device without first-letter designator R.
npNodeName of node connected to positive pin.
nmNodeName of node connected to negative pin.
-mMultiplier value, optional.
-rResistance value.
-tc1Linear thermal coefficient, optional.
-tc2Quadratic thermal coefficient, optional.
-tempDevice temperature, optional, optional.
Description

Simple resistor:

RXXXXXXX n+ n- <value> <m=val> <temp=val> <tc1=val> <tc2=val>

Example of class initialization:

::SpiceGenTcl::Common::BasicDevices::Resistor new 1 netp netm -r 1e3 -tc1 1 -temp {temp_amb -eq}
method constructor {name npNode nmNode args} {

    # Creates object of class `Resistor` that describes resistor.
    #  name - name of the device without first-letter designator R
    #  npNode - name of node connected to positive pin
    #  nmNode - name of node connected to negative pin
    #  -r - resistance value
    #  -m - multiplier value, optional
    #  -temp - device temperature, optional, optional
    #  -tc1 - linear thermal coefficient, optional
    #  -tc2 - quadratic thermal coefficient, optional
    # Simple resistor:
    # ```
    # RXXXXXXX n+ n- <value> <m=val> <temp=val> <tc1=val> <tc2=val>
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Common::BasicDevices::Resistor new 1 netp netm -r 1e3 -tc1 1 -temp {temp_amb -eq}
    # ```
    set arguments [argparse -inline {
        {-r= -required}
        -m=
        -temp=
        -tc1=
        -tc2=
    }]
    set rVal [dict get $arguments r]
    if {([llength $rVal]>1) && ([lindex $rVal 1]=="-eq")} {
        lappend params "r [lindex $rVal 0] -poseq"
    } else {
        lappend params "r $rVal -pos"
    }
    dict for {paramName value} $arguments {
        if {$paramName ni {r}} {
            lappend params "$paramName $value"
        }
    }
    next r$name [list "np $npNode" "nm $nmNode"] $params
}

SubcircuitInstance [::SpiceGenTcl::Common::BasicDevices]Top, Main, Index

Method summary
constructorConstructor for the class.
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -Name

Writable: -Name

Superclasses

::SpiceGenTcl::Device

Subclasses

X

constructor [::SpiceGenTcl::Common::BasicDevices::SubcircuitInstance]SubcircuitInstance, Top, Main, Index

Creates object of class SubcircuitInstance that describes subcircuit instance.

SubcircuitInstance create OBJNAME name pins subName params
SubcircuitInstance new name pins subName params
Parameters
nameName of the device without first-letter designator X.
pinsList of pins {{pinName nodeName} {pinName nodeName} ...}
subNameName of subcircuit definition.
params{{paramName paramValue ?-eq?} {paramName paramValue ?-eq?}}
Description
XYYYYYYY N1 <N2 N3 ...> SUBNAM

Example of class initialization:

::SpiceGenTcl::Common::BasicDevices::SubcircuitInstance new 1 {{plus net1} {minus net2}} rcnet {{r 1} {c cpar -eq}}
method constructor {name pins subName params} {

    # Creates object of class `SubcircuitInstance` that describes subcircuit instance.
    #  name - name of the device without first-letter designator X
    #  pins - list of pins {{pinName nodeName} {pinName nodeName} ...}
    #  subName - name of subcircuit definition
    #  params - {{paramName paramValue ?-eq?} {paramName paramValue ?-eq?}}
    # ```
    # XYYYYYYY N1 <N2 N3 ...> SUBNAM
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Common::BasicDevices::SubcircuitInstance new 1 {{plus net1} {minus net2}} rcnet {{r 1} {c cpar -eq}}
    # ```
    set params [linsert $params 0 "model $subName -posnocheck"]
    next x$name $pins $params
}

SubcircuitInstanceAuto [::SpiceGenTcl::Common::BasicDevices]Top, Main, Index

Method summary
constructorConstructor for the class.
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -Name

Writable: -Name

Superclasses

::SpiceGenTcl::Device

Subclasses

XAuto

constructor [::SpiceGenTcl::Common::BasicDevices::SubcircuitInstanceAuto]SubcircuitInstanceAuto, Top, Main, Index

Creates object of class SubcircuitInstanceAuto that describes subcircuit instance with already created subcircuit definition object.

SubcircuitInstanceAuto create OBJNAME subcktObj name nodes ?args?
SubcircuitInstanceAuto new subcktObj name nodes ?args?
Parameters
subcktObjObject of subcircuit that defines it's pins, subName and parameters.
nameNot documented.
nodesList of nodes connected to pins in the same order as pins in subcircuit definition {nodeName1 nodeName2 ...}
argsParameters as argument in form : -paramName {paramValue ?-eq?} -paramName {paramValue ?-eq?}
Description
XYYYYYYY N1 <N2 N3 ...> SUBNAM

Example of class initialization:

::SpiceGenTcl::Common::BasicDevices::SubcircuitInstanceAuto new $subcktObj 1 {net1 net2} -r 1 -c {cpar -eq}
method constructor {subcktObj name nodes args} {

    # Creates object of class `SubcircuitInstanceAuto` that describes subcircuit instance with already created subcircuit definition object.
    #  subcktObj - object of subcircuit that defines it's pins, subName and parameters
    #  nodes - list of nodes connected to pins in the same order as pins in subcircuit definition {nodeName1 nodeName2 ...}
    #  args - parameters as argument in form : -paramName {paramValue ?-eq?} -paramName {paramValue ?-eq?}
    # ```
    # XYYYYYYY N1 <N2 N3 ...> SUBNAM
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Common::BasicDevices::SubcircuitInstanceAuto new $subcktObj 1 {net1 net2} -r 1 -c {cpar -eq}
    # ```

    # check that inputs object class is Subcircuit
    if {[info object class $subcktObj "::SpiceGenTcl::Subcircuit"]!=1} {
        set objClass [info object class $subcktObj]
        error "Wrong object class '$objClass' is passed as subcktObj, should be '::SpiceGenTcl::Subcircuit'"
    }
    # get name of subcircuit
    set subName [$subcktObj configure -Name]
    # get pins names of subcircuit
    set pinsNames [dict keys [$subcktObj getPins]]
    # check if number of pins in subcircuit definition matchs the number of supplied nodes
    if {[llength $pinsNames]!=[llength $nodes]} {
        error "Wrong number of nodes '[llength $nodes]' in definition, should be '[llength $pinsNames]'"
    }
    # create list of pins and connected nodes
    foreach pinName $pinsNames node $nodes {
        lappend pinsList "$pinName $node"
    }
    # get parameters names of subcircuit
    set paramsNames [dict keys [$subcktObj getParams]]
    foreach paramName $paramsNames {
        lappend paramDefList "-${paramName}="
    }
    if {[info exists paramDefList]} {
        # create definition for argparse module for passing parameters as optional arguments
        set arguments [argparse -inline "
            [join $paramDefList \n]
        "]
        # create list of parameters and values from which were supplied by args
        dict for {paramName value} $arguments {
            lappend params "$paramName $value"
        }
    } else {
        set params ""
    }
    set params [linsert $params 0 "model $subName -posnocheck"]
    next x$name $pinsList $params
}

VSw [::SpiceGenTcl::Common::BasicDevices]Top, Main, Index

Method summary
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -Name

Writable: -Name

Superclasses

VSwitch

VSwitch [::SpiceGenTcl::Common::BasicDevices]Top, Main, Index

Method summary
constructorConstructor for the class.
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -Name

Writable: -Name

Superclasses

::SpiceGenTcl::Device

Subclasses

VSw, ::SpiceGenTcl::Ngspice::BasicDevices::VSwitch, ::SpiceGenTcl::Xyce::BasicDevices::VSwitch

constructor [::SpiceGenTcl::Common::BasicDevices::VSwitch]VSwitch, Top, Main, Index

Creates object of class VSwitch that describes voltage controlled switch device.

VSwitch create OBJNAME name npNode nmNode ncpNode ncmNode ?args?
VSwitch new name npNode nmNode ncpNode ncmNode ?args?
Parameters
nameName of the device without first-letter designator S.
npNodeName of node connected to positive pin.
nmNodeName of node connected to negative pin.
ncpNodeName of node connected to positive controlling pin.
ncmNodeName of node connected to negative controlling pin.
-modelModel name.
-on/-offInitial state of switch.
Description
SXXXXXXX N+ N- NC+ NC- MODEL <ON> <OFF>

Example of class initialization:

::SpiceGenTcl::Ngspice::BasicDevices::VSwitch new 1 net1 0 netc 0 -model sw1 -on
method constructor {name npNode nmNode ncpNode ncmNode args} {

    # Creates object of class `VSwitch` that describes voltage controlled switch device.
    #  name - name of the device without first-letter designator S
    #  npNode - name of node connected to positive pin
    #  nmNode - name of node connected to negative pin
    #  ncpNode - name of node connected to positive controlling pin
    #  ncmNode - name of node connected to negative controlling pin
    #  -model - model name
    #  -on/-off - initial state of switch
    # ```
    # SXXXXXXX N+ N- NC+ NC- MODEL <ON> <OFF>
    # ```
    # Example of class initialization:
    # ```
    # ::SpiceGenTcl::Ngspice::BasicDevices::VSwitch new 1 net1 0 netc 0 -model sw1 -on
    # ```
    set arguments [argparse -inline {
        {-model= -required}
        {-on -forbid {off}}
        {-off -forbid {on}}
    }]
    lappend params "model [dict get $arguments model] -posnocheck"
    if {[dict exists $arguments on]} {
        lappend params {on -sw}
    } elseif {[dict exists $arguments off]} {
        lappend params {off -sw}
    }
    next s$name [list "np $npNode" "nm $nmNode" "ncp $ncpNode" "ncm $ncmNode"] $params
}

W [::SpiceGenTcl::Common::BasicDevices]Top, Main, Index

Method summary
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -Name

Writable: -Name

Superclasses

CSwitch

X [::SpiceGenTcl::Common::BasicDevices]Top, Main, Index

Method summary
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -Name

Writable: -Name

Superclasses

SubcircuitInstance

XAuto [::SpiceGenTcl::Common::BasicDevices]Top, Main, Index

Method summary
addParamSee ::SpiceGenTcl::Device.addParam
checkFloatingPinsSee ::SpiceGenTcl::Device.checkFloatingPins
configureConfigure properties.
deleteParamSee ::SpiceGenTcl::Device.deleteParam
duplListCheckSee ::SpiceGenTcl::DuplChecker.duplListCheck
genSPICEStringSee ::SpiceGenTcl::Device.genSPICEString
getParamsSee ::SpiceGenTcl::Device.getParams
getPinsSee ::SpiceGenTcl::Device.getPins
setParamValueSee ::SpiceGenTcl::Device.setParamValue
setPinNodeNameSee ::SpiceGenTcl::Device.setPinNodeName
Properties

Readable: -Name

Writable: -Name

Superclasses

SubcircuitInstanceAuto