Skip to content

Migration guide v2.4.0

Florian Dupuy edited this page Sep 30, 2021 · 4 revisions

Migrate powsybl-core version to v4.4.0

In this release, powsybl-core version has been updated from version 4.3.1 to 4.4.0. This does not create any migration issue with powsybl-line-diagram, but if you are also using powsybl-core directly, please refer to powsybl-core migration guide to fix any issue due to that migration.

SVG size / viewbox

Size of the diagram is now computed. The computed size is added in the SVG root tag either:

  • solely as a viewbox parameter (default behaviour)
  • both as a viewbox parameter and as width/height parameters if LayoutParameters::isSvgWidthAndHeightAdded

If the SVG is inlined in a html file, width and height parameters should in most cases not be specified, as they are html tags and will therefore not allow resizing within the page.

Explaining new paddings in LayoutParameters: margins

Layout parameters cleanup

Some parameters have been removed / replaced following the size computation.

  • translateX: if still needed, the diagram left padding can be used instead
  • translateY: if still needed, the diagram top padding can be used instead
  • initialXBus: the abscissa of the first bus is now calculated based on the voltage level and diagram left paddings
  • initialYBus: the ordinate of the first bus is now calculated based on the voltage level and diagram top paddings, together with the snake lines height at the top of the diagram and the cell height
  • horizontalSubstationPadding: the horizontal padding between voltage levels in a substation for HorizontalSubstationLayout is now calculated to exactly match the width needed by the snake lines
  • verticalSubstationPadding: the vertical padding between voltage levels in a substation for VerticalSubstationLayout is now calculated to exactly match the height needed by the snake lines

Bus connection nodes

Bus connection nodes (class BusConnectionNode) have been introduced in this release. They replace two kind of nodes which were handling the same case (buses connected directly to components without a disconnector) in two topologies:

  • bus breaker connection nodes for bus breaker topology
  • fictitious disconnectors for node breaker topology

Components description file

To remove the JAXB dependency, the file describing the components is now a JSON file instead of a XML file.

Snakelines refactor

Coordinates of two-windings/three-windings transformer snakelines are defined through List<Point> instead of List<Double>, similarly to Line snakelines. The classes TwtEdge and LineEdge classes are then exactly the same, and were therefore merged into a BranchEdge class.

Id and name changes

The following node ids and edges ids have been changed in this release, going towards a standardized id:

  • The id of two-windings and three-windings transformers node (Middle3WTNode, Middle2WTNode, Feeder2WTNode) is now equal to the corresponding equipment id.
  • The id of internal nodes is now prefixed with "FICT_" and the voltage level id, instead of various suffixes.
  • The id of bus connection nodes is prefixed with "BUSCO_".
  • The name and the equipment id of internal nodes and bus connections are now null. One exception: the equipment id of internal nodes corresponding to iidm nodes at each side of switches/internal connections is equal to the number of that iidm node, like it was before.
  • Two-windings and three-windings transformer edges get their id prefixed with "EDGE_" instead of suffixed with "_EDGE" or "_edge".