Utility Classes#

Vertex#

class mhi.xml.pscad.Vertex#

A <vertex/> node

Added in version 1.2.0.

property x: int#
property y: int#

XY#

class mhi.xml.pscad.XY(x: int, y: int)#

Two dimensional position or size, used to specify Component locations on a Schematic canvas.

property x: int#
property y: int#
mhi.xml.pscad.UP#

An XY vector representing one grid unit “up” on a Schematic canvas.

mhi.xml.pscad.DOWN#

An XY vector representing one grid unit “down” on a Schematic canvas.

mhi.xml.pscad.LEFT#

An XY vector representing one grid unit to the “left” on a Schematic canvas.

mhi.xml.pscad.RIGHT#

An XY vector representing one grid unit to the “right” on a Schematic canvas.

Unit Value#

class mhi.xml.pscad.types.UnitValue(value)#

Representation of a ‘Real’ value with a unit in a PSCAD parameter.

The unit is contained within square brackets.

Example:

"100.0 [km]"

Enum Types#

Resources#

class mhi.xml.pscad.ResourceType(*values)#

Types of Resource for a PSCAD Project

UNKNOWN = '0'#
TEXT = '1'#
BINARY = '2'#

IntBool#

class mhi.xml.pscad.types.IntBool(value)#

Representation of ‘Boolean’ values in a PSCAD parameter (‘1’ or ‘0’)

static encode_to_str(value)#

Encode the given (boolean) value to the PSCAD parameter (‘1’ or ‘0’)

BusType#

class mhi.xml.pscad.types.BusType(*values)#

Bus Types

AUTO = '0'#
LOAD_PQ = '1'#
GENERATOR_PV = '2'#
SWING = '3'#
LOAD = '1'#
PQ = '1'#
GENERATOR = '2'#
PV = '2'#

Choice#

class mhi.xml.pscad.types.Choice(choices: dict[str, Any])#

Representation of ‘Choice’ values in a PSCAD parameter

classmethod enum(*values, start: int = 0)#

Convert a list of values into an ‘enumeration’, by assigning each to a sequential integer value

classmethod ints(*values)#

Convert a list of integers into a PSCAD Choice parameter, by assigning each one to its string representation.

encode_to_str(value: Any) str#

Encode the given choice value to the PSCAD parameter string

Ports#

class mhi.xml.pscad.NodeType(*values)#

Node Input/Output/Electrical Type

UNKNOWN = '0'#
INPUT = '1'#
OUTPUT = '2'#
ELECTRICAL = '3'#
SHORT = '4'#
class mhi.xml.pscad.SignalType(*values)#

Signal Types

ELECTRICAL = '0'#
LOGICAL = '1'#
INTEGER = '2'#
REAL = '3'#
COMPLEX = '4'#
UNKNOWN = '15'#
class mhi.xml.pscad.ElectricalType(*values)#

Electrical Node Types

FIXED = '0'#
REMOVABLE = '1'#
SWITCHED = '2'#
GROUND = '3'#

Graphics#

class mhi.xml.pscad.Align(*values)#

Text Alignment

LEFT = '0'#
CENTER = '1'#
RIGHT = '2'#
class mhi.xml.pscad.LineStyle(*values)#

Line Styles

SOLID = '0'#
DASH = '1'#
DOT = '2'#
DASHDOT = '3'#
class mhi.xml.pscad.FillStyle(*values)#

Fill Styles

HOLLOW = '0'#
SOLID = '1'#
BACKWARD_DIAGONAL = '2'#
FORWARD_DIAGONAL = '3'#
CROSS = '4'#
DIAGONAL_CROSS = '5'#
HORIZONTAL = '6'#
VERTICAL = '7'#
GRADIENT_HORZ = '8'#
GRADIENT_VERT = '9'#
GRADIENT_BACK_DIAG = '10'#
GRADIENT_FORE_DIAG = '11'#
GRADIENT_RADIAL = '12'#