Skip to content

Commit

Permalink
fix: PR remarks, renamings
Browse files Browse the repository at this point in the history
Signed-off-by: LE SAULNIER Kevin <[email protected]>
  • Loading branch information
LE SAULNIER Kevin committed Oct 9, 2024
1 parent efa4760 commit 12cd2c8
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private double getDiagramWidth(Graph graph, LayoutParameters layoutParameters) {

private double getDiagramHeight(Graph graph, LayoutParameters layoutParameters) {
double height = graph.getHeight() + layoutParameters.getDiagramPadding().getTop() + layoutParameters.getDiagramPadding().getBottom();
if (graph instanceof VoltageLevelGraph && svgParameters.isAddNodesInfos()) {
if (graph instanceof VoltageLevelGraph && svgParameters.isBusesLegendAdded()) {
height += 6 * CIRCLE_RADIUS_NODE_INFOS_SIZE;
}
return height;
Expand Down Expand Up @@ -263,7 +263,7 @@ protected void drawVoltageLevel(VoltageLevelGraph graph,
// Drawing the nodes outside the voltageLevel graphs (multi-terminal nodes)
drawNodes(root, graph, new Point(0, 0), metadata, initProvider, styleProvider, graph.getMultiTermNodes());

if (graph.isForVoltageLevelDiagram() && svgParameters.isAddNodesInfos()) {
if (graph.isForVoltageLevelDiagram() && svgParameters.isBusesLegendAdded()) {
drawBusesLegend(root, graph, metadata, initProvider, styleProvider);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ public String getId() {

private final Map<String, FeederInfoMetadata> feederInfoMetadataMap = new HashMap<>();

private final Map<String, BusLegendInfoMetadata> electricalNodeInfoMetadataMap = new HashMap<>();
private final Map<String, BusLegendInfoMetadata> busLegendInfoMetadataMap = new HashMap<>();

private final Map<String, BusInfoMetadata> busInfoMetadataMap = new HashMap<>();

Expand Down Expand Up @@ -537,17 +537,17 @@ public List<BusInfoMetadata> getBusInfoMetadata() {

public void addBusLegendInfoMetadata(BusLegendInfoMetadata metadata) {
Objects.requireNonNull(metadata);
electricalNodeInfoMetadataMap.put(metadata.getId(), metadata);
busLegendInfoMetadataMap.put(metadata.getId(), metadata);
}

public BusLegendInfoMetadata getElectricalNodeInfoMetadata(String id) {
public BusLegendInfoMetadata getBusLegendInfoMetadata(String id) {
Objects.requireNonNull(id);
return electricalNodeInfoMetadataMap.get(id);
return busLegendInfoMetadataMap.get(id);
}

@JsonProperty("busLegendInfos")
public List<BusLegendInfoMetadata> getElectricalNodeInfoMetadata() {
return ImmutableList.copyOf(electricalNodeInfoMetadataMap.values());
public List<BusLegendInfoMetadata> getBusLegendInfoMetadata() {
return ImmutableList.copyOf(busLegendInfoMetadataMap.values());
}

@JsonProperty("layoutParams")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class SvgParameters {
private double feederInfosIntraMargin = 10;
private double feederInfosOuterMargin = 20;
private boolean feederInfoSymmetry = false;
private boolean addNodesInfos = false;
private boolean busesLegendAdded = false;
private boolean useName = false;
private double angleLabelShift = 15.;
private boolean labelCentered = false;
Expand Down Expand Up @@ -72,7 +72,7 @@ public SvgParameters(SvgParameters other) {
this.feederInfosIntraMargin = other.feederInfosIntraMargin;
this.feederInfosOuterMargin = other.feederInfosOuterMargin;
this.feederInfoSymmetry = other.feederInfoSymmetry;
this.addNodesInfos = other.addNodesInfos;
this.busesLegendAdded = other.busesLegendAdded;
this.useName = other.useName;
this.angleLabelShift = other.angleLabelShift;
this.labelCentered = other.labelCentered;
Expand Down Expand Up @@ -227,12 +227,12 @@ public SvgParameters setFeederInfoSymmetry(boolean feederInfoSymmetry) {
return this;
}

public boolean isAddNodesInfos() {
return addNodesInfos;
public boolean isBusesLegendAdded() {
return busesLegendAdded;
}

public SvgParameters setAddNodesInfos(boolean addNodesInfos) {
this.addNodesInfos = addNodesInfos;
public SvgParameters setBusesLegendAdded(boolean busesLegendAdded) {
this.busesLegendAdded = busesLegendAdded;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ void testMetadata() {

// Optimize SVG by avoiding duplication
svgParameters.setAvoidSVGComponentsDuplication(true)
.setAddNodesInfos(true);
.setBusesLegendAdded(true);

// compare metadata of voltage level diagram with reference
VoltageLevelGraph graph = graphBuilder.buildVoltageLevelGraph(vl1.getId());
Expand All @@ -270,7 +270,7 @@ void testMetadata() {
void testNodesInfosNominalVoltageStyle() {
separateBusVoltages();

svgParameters.setAddNodesInfos(true);
svgParameters.setBusesLegendAdded(true);

// build voltage level 1 graph
VoltageLevelGraph g1 = graphBuilder.buildVoltageLevelGraph(vl1.getId());
Expand All @@ -287,7 +287,7 @@ void testNodesInfosTopologicalStyle() {
separateBusVoltages();

//parametrize diagram
svgParameters.setAddNodesInfos(true);
svgParameters.setBusesLegendAdded(true);

VoltageLevelGraph g1 = graphBuilder.buildVoltageLevelGraph(vl1.getId());
voltageLevelGraphLayout(g1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected ResourcesComponentLibrary getResourcesComponentLibrary() {

@Test
void test() {
svgParameters.setAddNodesInfos(true);
svgParameters.setBusesLegendAdded(true);

// build voltage level 1 graph
VoltageLevelGraph g1 = graphBuilder.buildVoltageLevelGraph("vl1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void test() throws IOException {
assertEquals("user_id", metadata2.getFeederInfoMetadata("id1").getUserDefinedId());
assertEquals("COMPONENT_TYPE", metadata2.getFeederInfoMetadata("id1").getComponentType());

assertNotNull(metadata2.getElectricalNodeInfoMetadata("id1"));
assertNotNull(metadata2.getBusLegendInfoMetadata("id1"));

assertNotNull(metadata2.getBusInfoMetadata("id6"));
assertEquals("busNodeId1", metadata2.getBusInfoMetadata("id6").getBusNodeId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void test() {
.setFeederInfosIntraMargin(21)
.setFeederInfosOuterMargin(25)
.setFeederInfoSymmetry(true)
.setAddNodesInfos(true)
.setBusesLegendAdded(true)
.setUseName(true)
.setAngleLabelShift(42)
.setLabelCentered(true)
Expand Down Expand Up @@ -66,7 +66,7 @@ void test() {
assertEquals(svgParameters0.getFeederInfosIntraMargin(), svgParameters1.getFeederInfosIntraMargin(), 0);
assertEquals(svgParameters0.getFeederInfosOuterMargin(), svgParameters1.getFeederInfosOuterMargin(), 0);
assertEquals(svgParameters0.isFeederInfoSymmetry(), svgParameters1.isFeederInfoSymmetry());
assertEquals(svgParameters0.isAddNodesInfos(), svgParameters1.isAddNodesInfos());
assertEquals(svgParameters0.isBusesLegendAdded(), svgParameters1.isBusesLegendAdded());
assertEquals(svgParameters0.isUseName(), svgParameters1.isUseName());
assertEquals(svgParameters0.getAngleLabelShift(), svgParameters1.getAngleLabelShift(), 0);
assertEquals(svgParameters0.isLabelCentered(), svgParameters1.isLabelCentered());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@
"feederInfosIntraMargin" : 10.0,
"feederInfosOuterMargin" : 20.0,
"feederInfoSymmetry" : false,
"addNodesInfos" : false,
"busesLegendAdded" : false,
"useName" : false,
"angleLabelShift" : 15.0,
"labelCentered" : false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@
"feederInfosIntraMargin" : 10.0,
"feederInfosOuterMargin" : 20.0,
"feederInfoSymmetry" : false,
"addNodesInfos" : false,
"busesLegendAdded" : false,
"useName" : false,
"angleLabelShift" : 15.0,
"labelCentered" : false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2966,7 +2966,7 @@
"feederInfosIntraMargin" : 10.0,
"feederInfosOuterMargin" : 20.0,
"feederInfoSymmetry" : false,
"addNodesInfos" : false,
"busesLegendAdded" : false,
"useName" : true,
"angleLabelShift" : 15.0,
"labelCentered" : false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@
"feederInfosIntraMargin" : 10.0,
"feederInfosOuterMargin" : 20.0,
"feederInfoSymmetry" : false,
"addNodesInfos" : false,
"busesLegendAdded" : false,
"useName" : true,
"angleLabelShift" : 15.0,
"labelCentered" : false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,7 @@
"feederInfosIntraMargin" : 10.0,
"feederInfosOuterMargin" : 20.0,
"feederInfoSymmetry" : false,
"addNodesInfos" : true,
"busesLegendAdded" : true,
"useName" : true,
"angleLabelShift" : 15.0,
"labelCentered" : false,
Expand Down

0 comments on commit 12cd2c8

Please sign in to comment.