Skip to content

Migration guide v4.6.0

Sophie Frasnedo edited this page Oct 17, 2024 · 5 revisions

Single Line Diagram

PR #643

Changes in animations.css

Following:

.sld-arrow-animation-high-speed { --sld-arrow-animation-parameters: 1s infinite linear }

Add:

@keyframes sld-overload-blink-animation {
  0%,
  80%,
  100% {
    stroke-width: 1;
  }
  40% {
    stroke: #ffeb3b; /* Yellow for overload */
    stroke-width: 2;
  }
}
@keyframes sld-overvoltage-blink-animation {
  0%,
  80%,
  100% {
    stroke-width: 1;
  }
  40% {
    stroke: #ff5722;
    stroke-width: 2;
  }
}
@keyframes sld-undervoltage-blink-animation {
  0%,
  80%,
  100% {
    stroke-width: 1;
  }
  40% {
    stroke: #00BCD4; /* Blue for undervoltage */
    stroke-width: 2;
  }
}
.sld-overload {
  animation: sld-overload-blink-animation 3s infinite;
}
.sld-vl-overvoltage {
  animation: sld-overvoltage-blink-animation 3s infinite;
}
.sld-vl-undervoltage {
  animation: sld-undervoltage-blink-animation 3s infinite;
}

PR #633

The StyleProviderFactory interface was changed:

Before:

@FunctionalInterface
public interface StyleProviderFactory {
    StyleProvider create(Network network);
}

After:

@FunctionalInterface
public interface StyleProviderFactory {
    StyleProvider create(Network network, SvgParameters svgParameters);
}

PR #638

ElectricalNodeInfo deleted

The ElectricalNodeInfo class has been deleted. BusLegendInfo is used instead.

It causes some changes in the LabelProvider interface.

Before:

List<ElectricalNodeInfo> getElectricalNodesInfos(VoltageLevelGraph graph);

After:

List<BusLegendInfo> getBusLegendInfos(VoltageLevelGraph graph);

Classes implementing the LabelProvider interface have to be fixed to fit with the new function.

NB : BusLegendInfo is a record, containing itself a new Caption record class.

In SvgParameters, some renaming has been done to be consistent with the new BusLegendInfo class:

isAddNodesInfos() --> isBusesLegendAdded()
setAddNodesInfos --> setBusesLegendAdded()

In GraphMetadata, some renaming has been done to be consistent with the new BusLegendInfo class:
ElectricalNodeInfoMetadata --> BusLegendInfoMetadata
addElectricalNodeInfoMetadata(ElectricalNodeInfoMetadata metadata) --> addBusLegendInfoMetadata(BusLegendInfoMetadata metadata) ElectricalNodeInfoMetadata getElectricalNodeInfoMetadata(String id) --> BusLegendInfoMetadata getBusLegendInfoMetadata(String id)

And

@JsonProperty("electricalNodeInfos")
    public List<ElectricalNodeInfoMetadata> getElectricalNodeInfoMetadata()

becomes

@JsonProperty("busLegendInfos")
    public List<BusLegendInfoMetadata> getBusLegendInfoMetadata()

Changes in css files

In ConvergenceLibrary/components.css

Before:

.sld-angle, .sld-voltage {font: 10px serif}

After:

.sld-bus-legend-info {font: 10px serif}

In FlatDesignLibrary/components.css

Before:

.sld-angle, .sld-voltage {font: 10px serif}

After:

.sld-bus-legend-info {font: 10px serif}

Network-Area Diagram

PR #637

In the Layout interface, there is a new function to implement:

void setTextNodeFixedPosition(String voltageLevelId, Point topLeft, Point edgeConnection);

PR #646

Changes in the API

In NetworkAreaDiagram, there are changes in the API.

The draw functions using the Writer have now a new Writer (for metadata) as an argument:

public static void draw(Network network, Writer writer, Writer metadataWriter)
public static void draw(Network network, Writer writer, Writer metadataWriter, String voltageLevelId, int depth)
public static void draw(Network network, Writer writer, Writer metadataWriter, List<String> voltageLevelIds)
public static void draw(Network network, Writer writer, Writer metadataWriter, Predicate<VoltageLevel> voltageLevelFilter)
public static void draw(Network network, Writer writer, Writer metadataWriter, NadParameters param, Predicate<VoltageLevel> voltageLevelFilter)\

The drawToString method is now static.

Changes in SvgParameters

The edgesForkAperture attribute is now in degrees.

The loopEdgesAperture attribute is now in degrees.