pingspice.ngspice.stdio.LineMaker(object)
class documentation
Part of pingspice.ngspice.stdio
(View In Hierarchy)
NgspiceProtocol
uses an instance of me to make lines of text for Ngspice commands.
Instance Variable | lastLine | The line of text I produced most recently, or None if no line
ever produced yet. |
Method | __init__ | Undocumented |
Method | format | Formats x into a string in a way that Ngspice will like. |
Method | __call__ | Call my instance to get a line of text for an Ngspice command from a list of args and a dict of params. |
Method | last | Returns the last (i.e., most recent) line of text I've produced, with
the trailing stripped off, or None if I haven't produced any
lines yet. |
Formats x into a string in a way that Ngspice will like.
Floats are shown with all legit decimal digits to convey a double-precision value. Booleans are represented as "1" or "0". And of course strings remain strings.
Call my instance to get a line of text for an Ngspice command from a list of args and a dict of params.
The args are each formatted with format
and separated by spaces. Any params are converted to "x=y"
format, with "x" being the parameter name and "y" being
its string-formatted value.
The line is terminated with a newline.