Requirements for implementing a custom GraphBuilder¶
Implementing a GraphBuilder is the way to build the graph to be rendered by SingleLineDiagram.
This shall implement builder for VoltageLevelGraph, SubstationGraph and ZoneGraph.
Here are some hints that are to be considered.
VoltageLevelGraph¶
A VoltageLevelGraph is made of nodes that extend the model.nodes.Node class.
The Node holds an NodeType enum that can take the following values:
BUS: representing the BusBar, rendered as one straight horizontal line. TheBusNodeclass extendingNodeis initialized with this valueFEEDER: representing what connect the VoltageLevel to the outside, rendered on top or bottom of the voltageLevel. TheFeederNodeclass extendingNodeis initialized with this valueINTERNALandSWITCH: representing nodes that constitute the graph connecting the Buses and the Feeders. Note that only theSwitchNodeclass should be initialized withSWITCH.
The graph shall be built:
using
graph.NodeFactoryclass for creating nodes. There are factories for each kind of nodes. If new nodes are needed, ensure to add the created node to the graph appropriately.connecting them with
VoltageLevelGraph.addEdge
Components¶
Each node has a componentTypeName that is related to a ComponentLibrary.
an easy way to add nodes with components that are not in the NodeFactory is to create a Node with
NodeFactory.createNode.
Seetest.raw.TestAddExternalComponent.Nodes that are to be drawn connected to a BusBar shall have this ability. No need to care about that rule as an adapted node (a
NodewithBUS_CONNECTIONcomponent) will be inserted between the bus and the node if the node is not directly connected to the bus.
Note that:This ability is given to some components in
layout.LayoutParameters.componentsOnBusbars. By default, this is set withDISCONNECTOR(BUS_CONNECTIONis implicit as it is necessary for the algorithm to work).The
BUS_CONNECTIONcomponent is the one that will be inserted if the component connected to the bus doesn’t have this ability. Therefore, ensure theComponentLibrarycontains theBUS_CONNECTIONcomponent.
SubstationGraph¶
A SubstationGraph is made of the VoltageLevelGraph of each VoltageLevel of the substation, plus the edges
(the future “snake lines”) that connect nodes belonging to different VoltageLevelGraph.
The graph shall be built:
using
SubstationGraph.createto create the graph, thenSubstationGraph.addVoltageLevelto add eachVoltageLevelGraph(built as described in VoltageLevelGraph, giving theSubstationGraphasparentGraph);connecting the
VoltageLevelGraphtogether:a
Lineor aTieLineinternal to the substation but crossing twoVoltageLevelis represented by connecting, withSubstationGraph.addLineEdge, the twoFeederNode(one per side) already created in their respectiveVoltageLevelGraph;a two-winding or three-winding transformer crossing two (resp. three)
VoltageLevelof the substation is represented by creating, withNodeFactory.createMiddle2WTNode(resp.NodeFactory.createMiddle3WTNode), a middle node connected to theFeederNodeof each side, already created in their respectiveVoltageLevelGraph.
ZoneGraph¶
A ZoneGraph is made of the SubstationGraph of each substation of the zone, plus the edges that connect nodes
belonging to different SubstationGraph (lines and HVDC lines between substations of the zone).
The graph shall be built:
using
ZoneGraph.createto create the graph, thenZoneGraph.addSubstationto add eachSubstationGraph(built as described in SubstationGraph, giving theZoneGraphasparentGraph);connecting the
SubstationGraphtogether:a
Lineor aTieLinebetween two substations of the zone is represented by connecting, withZoneGraph.addLineEdge, the twoFeederNode(one per side) already created in their respectiveVoltageLevelGraph;an HVDC line between two substations of the zone is represented similarly, connecting the two converter station
FeederNode.