Skip to content

Commit adbbb54

Browse files
committed
review
Signed-off-by: Samir Romdhani <samir.romdhani_externe@rte-france.com>
1 parent 12faf78 commit adbbb54

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

single-line-diagram/single-line-diagram-core/src/main/java/com/powsybl/sld/svg/DefaultSVGLegendWriter.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,13 @@ public void drawLegend(VoltageLevelGraph graph, GraphMetadata metadata, StylePro
6060
protected List<BusLegendInfo> getBusLegendInfos(VoltageLevelGraph graph) {
6161
VoltageLevel vl = network.getVoltageLevel(graph.getVoltageLevelInfos().id());
6262
return vl.getBusView().getBusStream()
63-
.map(bus -> {
64-
List<BusLegendInfo.Caption> captions = new ArrayList<>(4);
65-
captions.add(new BusLegendInfo.Caption(valueFormatter.formatVoltage(bus.getV(), "kV"), "v"));
66-
captions.add(new BusLegendInfo.Caption(valueFormatter.formatAngleInDegrees(bus.getAngle()), "angle"));
67-
captions.add(new BusLegendInfo.Caption(valueFormatter.formatPower(bus.getFictitiousP0(), withDefaultUnit(svgParameters.getActivePowerUnit(), "MW")), "fictitiousP0"));
68-
captions.add(new BusLegendInfo.Caption(valueFormatter.formatPower(bus.getFictitiousQ0(), withDefaultUnit(svgParameters.getReactivePowerUnit(), "MVar")), "fictitiousQ0"));
69-
return new BusLegendInfo(bus.getId(), captions);
70-
}).toList();
63+
.map(bus -> new BusLegendInfo(bus.getId(), List.of(
64+
new BusLegendInfo.Caption(valueFormatter.formatVoltage(bus.getV(), "kV"), "v"),
65+
new BusLegendInfo.Caption(valueFormatter.formatAngleInDegrees(bus.getAngle()), "angle"),
66+
new BusLegendInfo.Caption(valueFormatter.formatPower(bus.getFictitiousP0(), withDefaultUnit(svgParameters.getActivePowerUnit(), "MW")), "fictitiousP0"),
67+
new BusLegendInfo.Caption(valueFormatter.formatPower(bus.getFictitiousQ0(), withDefaultUnit(svgParameters.getReactivePowerUnit(), "MVar")), "fictitiousQ0")
68+
)))
69+
.toList();
7170
}
7271

7372
private static String withDefaultUnit(String configuredUnit, String defaultUnit) {

0 commit comments

Comments
 (0)