Components#
Component#
- class mhi.xml.pscad.Component#
A Component
- property classid: str#
The classid of the component.
Typically “UserCmp” but other possibilities include “WireOthogonal”, “Sticky”, “GraphFrame”, “ControlFrame”, and so on.
- property scope_and_defn: tuple[str, str]#
Returns the component definitions’s scope and definition names.
- property name: str | None#
Returns the component’s assigned name value.
The name must be stored in a parameter called
name,NameorNAME.
- custom_state(state_name: str, state: CustomLayerState)#
Set a custom layer state for this component.
The component must already be part of a layer, and that layer must already have the named custom state
addedto it. This component will be set to the given state when the component’s layer is set to the given custom state name.Added in version 1.4.0.
- property params: ParamListNode | None#
The parameter list node of the component
Individual parameters can be set and retrieved using index notation:
name = cmp['Name'] cmp['BaseKV'] = '230.0 [kV]'
- property enabled: bool#
Is this component enabled.
Note
This does not check if the component is on a disabled layer.
UserCmp#
- class mhi.xml.pscad.UserCmp#
A component with a definition defined in a ‘.pslx’ file
Frames#
- class mhi.xml.pscad.GraphFrame#
A Graph Frame
Wires#
Orthogonal#
- class mhi.xml.pscad.WireOrthogonal#
An orthogonal wire
Added in version 1.2.0.
- static create_instance(canvas: Schematic, /, *vertices: tuple[int, int] | XY) WireOrthogonal#
Create an Orthogonal wire on the canvas.
If more than two vertices are given, a multi-vertex wire will be created. If any segment is neither horizontal or vertical, additional vertices will be inserted.
- Parameters:
*vertices – A series of (X, Y) pairs, in grid units
Diagonal#
- class mhi.xml.pscad.WireDiagonal#
A Sticky Wire
Added in version 1.2.0.
- static create_instance(canvas: Schematic, /, *vertices: tuple[int, int] | XY, lead_length: int = 1, lead_directions: list[XY] | None = None) WireDiagonal#
Create new sticky wire on the canvas.
- vertices() list[Vertex]#
The list <vertex> elements of a Sticky Wire
These are the raw <vertex> elements, relative to the component’s origin. Use Wire.vertex[i] to retrieve the actual canvas vertex locations.
- property vertex: VertexContainer#
Access an individual end-point vertex of a sticky wire
Vertex locations are absolute positions on the canvas. Setting a new vertex location will move the corresponding lead vertex by the same amount.
- leads() list[Vertex]#
The list <vertex> elements of the lead vertices of a Sticky Wire
These are the raw <vertex> elements, relative to the component’s origin. Use StickyWire.lead[i] to retrieve the actual canvas vertex locations.
- property lead: LeadContainer#
Access the sticky wire’s end-point lead’s vertex.
Vertex locations are absolute positions on the canvas. The lead vertex position must always share either the same x-value or the same y-value, but not both, to keep the lead horizontal or vertical.
Bus#
- class mhi.xml.pscad.Bus#
A Bus
Added in version 1.2.0.
- static create_instance(canvas: Schematic, /, *vertices: tuple[int, int] | XY, Name: str = '', BaseKV: float = 0.0, VM: float = 1.0, VA: float = 0.0, type: BusType = BusType.AUTO) Bus#
Create a Bus on the canvas.
If more than two vertices are given, a multi-vertex bus will be created. If any segment is neither horizontal or vertical, additional vertices will be inserted.
- property parameters: Parameters#
Retrieve the Bus’s Parameters
Bus Parameters#
Annotations#
Divider#
- class mhi.xml.pscad.Divider#
The PSCAD Divider <Line/> node class
- classmethod create_instance(canvas: Schematic, x: int = 1, y: int = 1, w: int = 0, h: int = 0, **kwargs) Divider#
Create a Divider on the canvas.
Added in version 1.2.0.
- property parameters: Parameters#
Retrieve the Divider’s Parameters
Group Box#
- class mhi.xml.pscad.GroupBox#
A PSCAD Group Box <Line/> node class
- classmethod create_instance(canvas: Schematic, x: int = 1, y: int = 1, w: int = 11, h: int = 6, *, name: str = 'Groupbox', **kwargs) GroupBox#
Create a Group Box on the canvas.
Added in version 1.2.0.
- property parameters: Parameters#
Retrieve the Group Box’s Parameters
Sticky#
- class mhi.xml.pscad.Sticky#
The PSCAD <Sticky/> node class
- static create_instance(canvas: Schematic, x: int = 1, y: int = 1, w: int = 6, h: int = 2, text: str = 'Sticky Note', **kwargs) Sticky#
Create a Sticky Note on the canvas.
Added in version 1.2.0.
- property parameters: Parameters#
Retrieve the Bus’s Parameters
TLine & Cables#
- class mhi.xml.pscad.TLine#
The PSCAD <TLine/> node class
- class mhi.xml.pscad.Cable#
The PSCAD <Cable/> node class