From bbf60178737542fa73fd134334d8113bae9afdcb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Dec 2021 17:23:51 +0000 Subject: [PATCH 01/20] Bump compas.core.version from 0.6.0 to 0.7.0 Bumps `compas.core.version` from 0.6.0 to 0.7.0. Updates `commons` from 0.6.0 to 0.7.0 Updates `jaxrs-commons` from 0.6.0 to 0.7.0 --- updated-dependencies: - dependency-name: org.lfenergy.compas.core:commons dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.lfenergy.compas.core:jaxrs-commons dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0c0deba..7fa3286 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ SPDX-License-Identifier: Apache-2.0 3.0.0-M5 3.2.0 - 0.6.0 + 0.7.0 2.4.2.Final 1.7.32 From 65705a2496d867a9d9063a97990076a809822b88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Dec 2021 17:21:20 +0000 Subject: [PATCH 02/20] Bump powsybl-single-line-diagram-core from 2.5.1 to 2.6.0 Bumps [powsybl-single-line-diagram-core](https://github.com/powsybl/powsybl-single-line-diagram) from 2.5.1 to 2.6.0. - [Release notes](https://github.com/powsybl/powsybl-single-line-diagram/releases) - [Commits](https://github.com/powsybl/powsybl-single-line-diagram/compare/v2.5.1...v2.6.0) --- updated-dependencies: - dependency-name: com.powsybl:powsybl-single-line-diagram-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7fa3286..2b9e12a 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ SPDX-License-Identifier: Apache-2.0 2.4.2.Final 1.7.32 - 2.5.1 + 2.6.0 2.8.9 0.9.1 From 8be931f616dceebe552d4a5ff7dbe937e1f6326a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Dec 2021 17:22:13 +0000 Subject: [PATCH 03/20] Bump actions/setup-java from 2.4.0 to 2.5.0 Bumps [actions/setup-java](https://github.com/actions/setup-java) from 2.4.0 to 2.5.0. - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](https://github.com/actions/setup-java/compare/v2.4.0...v2.5.0) --- updated-dependencies: - dependency-name: actions/setup-java dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/build-project.yml | 2 +- .github/workflows/release-project.yml | 2 +- .github/workflows/sonarcloud-analysis.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-project.yml b/.github/workflows/build-project.yml index 2942f99..0985812 100644 --- a/.github/workflows/build-project.yml +++ b/.github/workflows/build-project.yml @@ -38,7 +38,7 @@ jobs: restore-keys: ${{ runner.os }}-m2 - name: Set up JDK 1.11 - uses: actions/setup-java@v2.4.0 + uses: actions/setup-java@v2.5.0 with: distribution: 'zulu' java-version: '11' diff --git a/.github/workflows/release-project.yml b/.github/workflows/release-project.yml index e6aa05a..4cc66f7 100644 --- a/.github/workflows/release-project.yml +++ b/.github/workflows/release-project.yml @@ -42,7 +42,7 @@ jobs: # Extra the tagname form the git reference, value of GITHUB_REF will be something like refs/tags/. run: echo "##[set-output name=tagname;]$(echo ${GITHUB_REF##*/})" - name: Set up JDK 1.11 - uses: actions/setup-java@v2.4.0 + uses: actions/setup-java@v2.5.0 with: distribution: 'zulu' java-version: '11' diff --git a/.github/workflows/sonarcloud-analysis.yml b/.github/workflows/sonarcloud-analysis.yml index df03647..46f5c66 100644 --- a/.github/workflows/sonarcloud-analysis.yml +++ b/.github/workflows/sonarcloud-analysis.yml @@ -26,7 +26,7 @@ jobs: fetch-depth: 0 - name: Set up JDK 1.11 - uses: actions/setup-java@v2.4.0 + uses: actions/setup-java@v2.5.0 with: distribution: 'zulu' java-version: '11' From a9ddbfd9264b09511b1dd5bae8abf2090cabdfc4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Dec 2021 17:23:42 +0000 Subject: [PATCH 04/20] Bump quarkus.platform.version from 2.4.2.Final to 2.6.0.Final Bumps `quarkus.platform.version` from 2.4.2.Final to 2.6.0.Final. Updates `quarkus-universe-bom` from 2.4.2.Final to 2.6.0.Final - [Release notes](https://github.com/quarkusio/quarkus-platform/releases) - [Commits](https://github.com/quarkusio/quarkus-platform/compare/2.4.2.Final...2.6.0.Final) Updates `quarkus-maven-plugin` from 2.4.2.Final to 2.6.0.Final --- updated-dependencies: - dependency-name: io.quarkus:quarkus-universe-bom dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.quarkus:quarkus-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7fa3286..36a75cc 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ SPDX-License-Identifier: Apache-2.0 0.7.0 - 2.4.2.Final + 2.6.0.Final 1.7.32 2.5.1 2.8.9 From 53cfc516738835a212762576183aeab447d2e47f Mon Sep 17 00:00:00 2001 From: Dennis Labordus Date: Thu, 23 Dec 2021 10:35:30 +0100 Subject: [PATCH 05/20] Fixed test for Upgrade to 2.6.0 Signed-off-by: Dennis Labordus --- .../SclAutoAlignmentDiagramLabelProvider.java | 17 +- service/src/test/resources/json/scl-1.json | 460 ++++++------------ service/src/test/resources/json/scl-2.json | 20 - 3 files changed, 166 insertions(+), 331 deletions(-) diff --git a/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/service/SclAutoAlignmentDiagramLabelProvider.java b/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/service/SclAutoAlignmentDiagramLabelProvider.java index c456bb0..cb0008d 100644 --- a/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/service/SclAutoAlignmentDiagramLabelProvider.java +++ b/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/service/SclAutoAlignmentDiagramLabelProvider.java @@ -19,14 +19,17 @@ public class SclAutoAlignmentDiagramLabelProvider implements DiagramLabelProvide public SclAutoAlignmentDiagramLabelProvider(SubstationGraph graph) { this.busLabels = new HashMap<>(); - LabelPosition labelPosition = new LabelPosition("default", 0, -5, true, 0); - graph.getNodes().forEach(v -> - v.getNodes().forEach(n -> { - List labels = new ArrayList<>(); - labels.add(new NodeLabel(stripLabel(n.getId()), labelPosition, null)); - busLabels.put(n, labels); - }) + graph.getNodes().forEach(voltageLevelGraph -> + voltageLevelGraph.getNodes().forEach(this::addNode) ); + graph.getMultiTermNodes().forEach(this::addNode); + } + + private void addNode(Node node) { + LabelPosition labelPosition = new LabelPosition("default", 0, -5, true, 0); + List labels = new ArrayList<>(); + labels.add(new NodeLabel(stripLabel(node.getId()), labelPosition, null)); + busLabels.put(node, labels); } @Override diff --git a/service/src/test/resources/json/scl-1.json b/service/src/test/resources/json/scl-1.json index edcfd98..cd2d883 100644 --- a/service/src/test/resources/json/scl-1.json +++ b/service/src/test/resources/json/scl-1.json @@ -16,7 +16,7 @@ "componentType" : "BREAKER", "fictitious" : false, "x" : 250.0, - "y" : 197.0, + "y" : 170.0, "open" : false, "kind" : "BREAKER" }, { @@ -27,7 +27,7 @@ "componentType" : "BREAKER", "fictitious" : false, "x" : 225.0, - "y" : 251.0, + "y" : 224.0, "open" : false, "kind" : "BREAKER" }, { @@ -38,7 +38,7 @@ "componentType" : "BREAKER", "fictitious" : false, "x" : 275.0, - "y" : 251.0, + "y" : 224.0, "open" : false, "kind" : "BREAKER" }, { @@ -64,7 +64,6 @@ "open" : false, "label" : "AA1/J1/Bay A/QB9/Grounded", "feederType" : "INJECTION", - "order" : -1, "direction" : "TOP" }, { "type" : "SWITCH", @@ -100,7 +99,6 @@ "open" : false, "label" : "AA1/J1/Bay A/T5/Grounded", "feederType" : "INJECTION", - "order" : -1, "direction" : "TOP" }, { "type" : "SWITCH", @@ -110,7 +108,7 @@ "componentType" : "BREAKER", "fictitious" : false, "x" : 350.0, - "y" : 197.0, + "y" : 170.0, "open" : false, "kind" : "BREAKER" }, { @@ -121,7 +119,7 @@ "componentType" : "BREAKER", "fictitious" : false, "x" : 325.0, - "y" : 251.0, + "y" : 224.0, "open" : false, "kind" : "BREAKER" }, { @@ -132,7 +130,7 @@ "componentType" : "BREAKER", "fictitious" : false, "x" : 375.0, - "y" : 251.0, + "y" : 224.0, "open" : false, "kind" : "BREAKER" }, { @@ -158,7 +156,6 @@ "open" : false, "label" : "AA1/J1/Bay B/QB9/Grounded", "feederType" : "INJECTION", - "order" : -1, "direction" : "TOP" }, { "type" : "SWITCH", @@ -194,7 +191,6 @@ "open" : false, "label" : "AA1/J1/Bay B/T5/Grounded", "feederType" : "INJECTION", - "order" : -1, "direction" : "TOP" }, { "type" : "SWITCH", @@ -204,7 +200,7 @@ "componentType" : "BREAKER", "fictitious" : false, "x" : 450.0, - "y" : 197.0, + "y" : 170.0, "open" : false, "kind" : "BREAKER" }, { @@ -215,7 +211,7 @@ "componentType" : "BREAKER", "fictitious" : false, "x" : 425.0, - "y" : 251.0, + "y" : 224.0, "open" : false, "kind" : "BREAKER" }, { @@ -226,7 +222,7 @@ "componentType" : "BREAKER", "fictitious" : false, "x" : 475.0, - "y" : 251.0, + "y" : 224.0, "open" : false, "kind" : "BREAKER" }, { @@ -252,7 +248,6 @@ "open" : false, "label" : "AA1/J1/Bay C/QB9/Grounded", "feederType" : "INJECTION", - "order" : -1, "direction" : "TOP" }, { "type" : "SWITCH", @@ -288,7 +283,6 @@ "open" : false, "label" : "AA1/J1/Bay C/T5/Grounded", "feederType" : "INJECTION", - "order" : -1, "direction" : "TOP" }, { "type" : "SWITCH", @@ -298,7 +292,7 @@ "componentType" : "BREAKER", "fictitious" : false, "x" : 550.0, - "y" : 197.0, + "y" : 170.0, "open" : false, "kind" : "BREAKER" }, { @@ -309,7 +303,7 @@ "componentType" : "BREAKER", "fictitious" : false, "x" : 525.0, - "y" : 251.0, + "y" : 224.0, "open" : false, "kind" : "BREAKER" }, { @@ -320,7 +314,7 @@ "componentType" : "BREAKER", "fictitious" : false, "x" : 575.0, - "y" : 251.0, + "y" : 224.0, "open" : false, "kind" : "BREAKER" }, { @@ -346,7 +340,6 @@ "open" : false, "label" : "AA1/J1/Bay D/QB9/Grounded", "feederType" : "INJECTION", - "order" : -1, "direction" : "TOP" }, { "type" : "SWITCH", @@ -382,7 +375,6 @@ "open" : false, "label" : "AA1/J1/Bay D/T5/Grounded", "feederType" : "INJECTION", - "order" : -1, "direction" : "TOP" }, { "type" : "BUS", @@ -392,7 +384,7 @@ "componentType" : "BUSBAR_SECTION", "fictitious" : false, "x" : 12.5, - "y" : 308.0, + "y" : 281.0, "open" : false, "pxWidth" : 675.0, "busbarIndex" : 1, @@ -411,7 +403,7 @@ "componentType" : "BUSBAR_SECTION", "fictitious" : false, "x" : 12.5, - "y" : 333.0, + "y" : 306.0, "open" : false, "pxWidth" : 675.0, "busbarIndex" : 2, @@ -430,7 +422,7 @@ "componentType" : "BREAKER", "fictitious" : false, "x" : 100.0, - "y" : 268.0, + "y" : 241.0, "rotationAngle" : 90.0, "open" : false, "kind" : "BREAKER" @@ -442,7 +434,7 @@ "componentType" : "BREAKER", "fictitious" : false, "x" : 50.0, - "y" : 268.0, + "y" : 241.0, "rotationAngle" : 90.0, "open" : false, "kind" : "BREAKER" @@ -454,7 +446,7 @@ "componentType" : "BREAKER", "fictitious" : false, "x" : 150.0, - "y" : 268.0, + "y" : 241.0, "rotationAngle" : 90.0, "open" : false, "kind" : "BREAKER" @@ -466,7 +458,7 @@ "componentType" : "BREAKER", "fictitious" : false, "x" : 675.0, - "y" : 170.0, + "y" : 156.5, "open" : false, "kind" : "BREAKER" }, { @@ -477,7 +469,7 @@ "componentType" : "BREAKER", "fictitious" : false, "x" : 625.0, - "y" : 170.0, + "y" : 156.5, "open" : false, "kind" : "BREAKER" }, { @@ -487,7 +479,7 @@ "componentType" : "BUS_CONNECTION", "fictitious" : true, "x" : 225.0, - "y" : 333.0, + "y" : 306.0, "open" : false }, { "type" : "FICTITIOUS", @@ -496,7 +488,7 @@ "componentType" : "BUS_CONNECTION", "fictitious" : true, "x" : 275.0, - "y" : 308.0, + "y" : 281.0, "open" : false }, { "type" : "FICTITIOUS", @@ -505,7 +497,7 @@ "componentType" : "BUS_CONNECTION", "fictitious" : true, "x" : 325.0, - "y" : 333.0, + "y" : 306.0, "open" : false }, { "type" : "FICTITIOUS", @@ -514,7 +506,7 @@ "componentType" : "BUS_CONNECTION", "fictitious" : true, "x" : 375.0, - "y" : 308.0, + "y" : 281.0, "open" : false }, { "type" : "FICTITIOUS", @@ -523,7 +515,7 @@ "componentType" : "BUS_CONNECTION", "fictitious" : true, "x" : 425.0, - "y" : 333.0, + "y" : 306.0, "open" : false }, { "type" : "FICTITIOUS", @@ -532,7 +524,7 @@ "componentType" : "BUS_CONNECTION", "fictitious" : true, "x" : 475.0, - "y" : 308.0, + "y" : 281.0, "open" : false }, { "type" : "FICTITIOUS", @@ -541,7 +533,7 @@ "componentType" : "BUS_CONNECTION", "fictitious" : true, "x" : 525.0, - "y" : 333.0, + "y" : 306.0, "open" : false }, { "type" : "FICTITIOUS", @@ -550,7 +542,7 @@ "componentType" : "BUS_CONNECTION", "fictitious" : true, "x" : 575.0, - "y" : 308.0, + "y" : 281.0, "open" : false }, { "type" : "FICTITIOUS", @@ -559,7 +551,7 @@ "componentType" : "BUS_CONNECTION", "fictitious" : true, "x" : 25.0, - "y" : 333.0, + "y" : 306.0, "open" : false }, { "type" : "FICTITIOUS", @@ -568,7 +560,7 @@ "componentType" : "BUS_CONNECTION", "fictitious" : true, "x" : 175.0, - "y" : 308.0, + "y" : 281.0, "open" : false }, { "type" : "FICTITIOUS", @@ -577,7 +569,7 @@ "componentType" : "BUS_CONNECTION", "fictitious" : true, "x" : 675.0, - "y" : 333.0, + "y" : 306.0, "open" : false }, { "type" : "FICTITIOUS", @@ -586,7 +578,7 @@ "componentType" : "BUS_CONNECTION", "fictitious" : true, "x" : 625.0, - "y" : 308.0, + "y" : 281.0, "open" : false }, { "type" : "FICTITIOUS", @@ -595,16 +587,7 @@ "componentType" : "NODE", "fictitious" : true, "x" : 250.0, - "y" : 224.0, - "open" : false - }, { - "type" : "FICTITIOUS", - "id" : "INTERNAL_AA1/J1_AA1/J1/Bay A/L2", - "equipmentId" : null, - "componentType" : "NODE", - "fictitious" : true, - "x" : 250.0, - "y" : 170.0, + "y" : 197.0, "open" : false }, { "type" : "FICTITIOUS", @@ -622,7 +605,7 @@ "componentType" : "NODE", "fictitious" : true, "x" : 225.0, - "y" : 278.0, + "y" : 251.0, "open" : false }, { "type" : "FICTITIOUS", @@ -631,7 +614,7 @@ "componentType" : "NODE", "fictitious" : true, "x" : 275.0, - "y" : 278.0, + "y" : 251.0, "open" : false }, { "type" : "FICTITIOUS", @@ -658,16 +641,7 @@ "componentType" : "NODE", "fictitious" : true, "x" : 350.0, - "y" : 224.0, - "open" : false - }, { - "type" : "FICTITIOUS", - "id" : "INTERNAL_AA1/J1_AA1/J1/Bay B/L2", - "equipmentId" : null, - "componentType" : "NODE", - "fictitious" : true, - "x" : 350.0, - "y" : 170.0, + "y" : 197.0, "open" : false }, { "type" : "FICTITIOUS", @@ -685,7 +659,7 @@ "componentType" : "NODE", "fictitious" : true, "x" : 325.0, - "y" : 278.0, + "y" : 251.0, "open" : false }, { "type" : "FICTITIOUS", @@ -694,7 +668,7 @@ "componentType" : "NODE", "fictitious" : true, "x" : 375.0, - "y" : 278.0, + "y" : 251.0, "open" : false }, { "type" : "FICTITIOUS", @@ -721,16 +695,7 @@ "componentType" : "NODE", "fictitious" : true, "x" : 450.0, - "y" : 224.0, - "open" : false - }, { - "type" : "FICTITIOUS", - "id" : "INTERNAL_AA1/J1_AA1/J1/Bay C/L2", - "equipmentId" : null, - "componentType" : "NODE", - "fictitious" : true, - "x" : 450.0, - "y" : 170.0, + "y" : 197.0, "open" : false }, { "type" : "FICTITIOUS", @@ -748,7 +713,7 @@ "componentType" : "NODE", "fictitious" : true, "x" : 425.0, - "y" : 278.0, + "y" : 251.0, "open" : false }, { "type" : "FICTITIOUS", @@ -757,7 +722,7 @@ "componentType" : "NODE", "fictitious" : true, "x" : 475.0, - "y" : 278.0, + "y" : 251.0, "open" : false }, { "type" : "FICTITIOUS", @@ -784,16 +749,7 @@ "componentType" : "NODE", "fictitious" : true, "x" : 550.0, - "y" : 224.0, - "open" : false - }, { - "type" : "FICTITIOUS", - "id" : "INTERNAL_AA1/J1_AA1/J1/Bay D/L2", - "equipmentId" : null, - "componentType" : "NODE", - "fictitious" : true, - "x" : 550.0, - "y" : 170.0, + "y" : 197.0, "open" : false }, { "type" : "FICTITIOUS", @@ -811,7 +767,7 @@ "componentType" : "NODE", "fictitious" : true, "x" : 525.0, - "y" : 278.0, + "y" : 251.0, "open" : false }, { "type" : "FICTITIOUS", @@ -820,7 +776,7 @@ "componentType" : "NODE", "fictitious" : true, "x" : 575.0, - "y" : 278.0, + "y" : 251.0, "open" : false }, { "type" : "FICTITIOUS", @@ -842,32 +798,32 @@ "open" : false }, { "type" : "FICTITIOUS", - "id" : "INTERNAL_AA1/J1_AA1/J1/CoupField/L1", + "id" : "INTERNAL_AA1/J1_AA1/J1/CoupField/QB1", "equipmentId" : null, "componentType" : "NODE", "fictitious" : true, "x" : 75.0, - "y" : 268.0, + "y" : 241.0, "rotationAngle" : 90.0, "open" : false }, { "type" : "FICTITIOUS", - "id" : "INTERNAL_AA1/J1_AA1/J1/CoupField/L2", + "id" : "INTERNAL_AA1/J1_AA1/J1/CoupField/QB1", "equipmentId" : null, "componentType" : "NODE", "fictitious" : true, - "x" : 125.0, - "y" : 268.0, + "x" : 25.0, + "y" : 241.0, "rotationAngle" : 90.0, "open" : false }, { "type" : "FICTITIOUS", - "id" : "INTERNAL_AA1/J1_AA1/J1/CoupField/QB1", + "id" : "INTERNAL_AA1/J1_AA1/J1/CoupField/QB2", "equipmentId" : null, "componentType" : "NODE", "fictitious" : true, - "x" : 25.0, - "y" : 268.0, + "x" : 125.0, + "y" : 241.0, "rotationAngle" : 90.0, "open" : false }, { @@ -877,7 +833,7 @@ "componentType" : "NODE", "fictitious" : true, "x" : 175.0, - "y" : 268.0, + "y" : 241.0, "rotationAngle" : 90.0, "open" : false }, { @@ -887,7 +843,7 @@ "componentType" : "NODE", "fictitious" : true, "x" : 675.0, - "y" : 278.0, + "y" : 251.0, "open" : false }, { "type" : "FICTITIOUS", @@ -896,7 +852,7 @@ "componentType" : "NODE", "fictitious" : true, "x" : 625.0, - "y" : 278.0, + "y" : 251.0, "open" : false }, { "type" : "FICTITIOUS", @@ -928,7 +884,6 @@ "open" : false, "label" : "grounded", "feederType" : "INJECTION", - "order" : -1, "direction" : "TOP" }, { "type" : "FEEDER", @@ -942,7 +897,6 @@ "open" : false, "label" : "grounded", "feederType" : "INJECTION", - "order" : -1, "direction" : "TOP" } ], "cells" : [ { @@ -984,7 +938,7 @@ }, "coord" : { "x" : 25.0, - "y" : 308.0, + "y" : 281.0, "xSpan" : 50.0, "ySpan" : 0.0 }, @@ -1005,11 +959,11 @@ }, "coord" : { "x" : 25.0, - "y" : 268.0, + "y" : 241.0, "xSpan" : 50.0, "ySpan" : 40.0 }, - "nodes" : [ "INTERNAL_AA1/J1_AA1/J1/CoupField/QB1", "AA1/J1/CoupField/QB1", "INTERNAL_AA1/J1_AA1/J1/CoupField/L1" ] + "nodes" : [ "INTERNAL_AA1/J1_AA1/J1/CoupField/QB1", "AA1/J1/CoupField/QB1", "INTERNAL_AA1/J1_AA1/J1/CoupField/QB1" ] }, { "type" : "BODYPRIMARY", "cardinalities" : [ { @@ -1026,11 +980,11 @@ }, "coord" : { "x" : 75.0, - "y" : 268.0, + "y" : 241.0, "xSpan" : 50.0, "ySpan" : 40.0 }, - "nodes" : [ "INTERNAL_AA1/J1_AA1/J1/CoupField/L1", "AA1/J1/CoupField/QA1", "INTERNAL_AA1/J1_AA1/J1/CoupField/L2" ] + "nodes" : [ "INTERNAL_AA1/J1_AA1/J1/CoupField/QB1", "AA1/J1/CoupField/QA1", "INTERNAL_AA1/J1_AA1/J1/CoupField/QB2" ] }, { "type" : "BODYPRIMARY", "cardinalities" : [ { @@ -1047,11 +1001,11 @@ }, "coord" : { "x" : 125.0, - "y" : 268.0, + "y" : 241.0, "xSpan" : 50.0, "ySpan" : 40.0 }, - "nodes" : [ "INTERNAL_AA1/J1_AA1/J1/CoupField/L2", "AA1/J1/CoupField/QB2", "INTERNAL_AA1/J1_AA1/J1/CoupField/QB2" ] + "nodes" : [ "INTERNAL_AA1/J1_AA1/J1/CoupField/QB2", "AA1/J1/CoupField/QB2", "INTERNAL_AA1/J1_AA1/J1/CoupField/QB2" ] }, { "type" : "LEGPRIMARY", "cardinalities" : [ { @@ -1068,7 +1022,7 @@ }, "coord" : { "x" : 175.0, - "y" : 308.0, + "y" : 281.0, "xSpan" : 50.0, "ySpan" : 0.0 }, @@ -1079,7 +1033,6 @@ "type" : "EXTERN", "number" : 1, "direction" : "TOP", - "order" : -1, "rootBlock" : { "type" : "SERIAL", "cardinalities" : [ { @@ -1091,14 +1044,14 @@ "h" : 8, "v" : 0, "hSpan" : 4, - "vSpan" : 16, + "vSpan" : 14, "orientation" : "UP" }, "coord" : { "x" : 250.0, - "y" : 170.0, + "y" : 156.5, "xSpan" : 100.0, - "ySpan" : 216.0 + "ySpan" : 189.0 }, "subBlocks" : [ { "type" : "BODYPARALLEL", @@ -1116,7 +1069,7 @@ }, "coord" : { "x" : 250.0, - "y" : 251.0, + "y" : 224.0, "xSpan" : 100.0, "ySpan" : 54.0 }, @@ -1136,7 +1089,7 @@ }, "coord" : { "x" : 225.0, - "y" : 251.0, + "y" : 224.0, "xSpan" : 50.0, "ySpan" : 54.0 }, @@ -1156,7 +1109,7 @@ }, "coord" : { "x" : 225.0, - "y" : 278.0, + "y" : 251.0, "xSpan" : 50.0, "ySpan" : 0.0 }, @@ -1177,7 +1130,7 @@ }, "coord" : { "x" : 225.0, - "y" : 251.0, + "y" : 224.0, "xSpan" : 50.0, "ySpan" : 54.0 }, @@ -1199,7 +1152,7 @@ }, "coord" : { "x" : 275.0, - "y" : 251.0, + "y" : 224.0, "xSpan" : 50.0, "ySpan" : 54.0 }, @@ -1219,7 +1172,7 @@ }, "coord" : { "x" : 275.0, - "y" : 278.0, + "y" : 251.0, "xSpan" : 50.0, "ySpan" : 0.0 }, @@ -1240,7 +1193,7 @@ }, "coord" : { "x" : 275.0, - "y" : 251.0, + "y" : 224.0, "xSpan" : 50.0, "ySpan" : 54.0 }, @@ -1258,37 +1211,16 @@ "h" : 0, "v" : 4, "hSpan" : 2, - "vSpan" : 4, - "orientation" : "UP" - }, - "coord" : { - "x" : 250.0, - "y" : 197.0, - "xSpan" : 100.0, - "ySpan" : 54.0 - }, - "nodes" : [ "INTERNAL_AA1/J1_AA1/J1/Bay A/L1", "AA1/J1/Bay A/QA1", "INTERNAL_AA1/J1_AA1/J1/Bay A/L2" ] - }, { - "type" : "BODYPRIMARY", - "cardinalities" : [ { - "START" : 1 - }, { - "END" : 1 - } ], - "position" : { - "h" : 0, - "v" : 8, - "hSpan" : 2, - "vSpan" : 4, + "vSpan" : 6, "orientation" : "UP" }, "coord" : { "x" : 250.0, - "y" : 143.0, + "y" : 156.5, "xSpan" : 100.0, - "ySpan" : 54.0 + "ySpan" : 81.0 }, - "nodes" : [ "INTERNAL_AA1/J1_AA1/J1/Bay A/L2", "AA1/J1/Bay A/T1", "INTERNAL_AA1/J1_AA1/J1/Bay A/L3" ] + "nodes" : [ "INTERNAL_AA1/J1_AA1/J1/Bay A/L1", "AA1/J1/Bay A/QA1", "AA1/J1/Bay A/T1", "INTERNAL_AA1/J1_AA1/J1/Bay A/L3" ] }, { "type" : "BODYPARALLEL", "cardinalities" : [ { @@ -1298,7 +1230,7 @@ } ], "position" : { "h" : 0, - "v" : 12, + "v" : 10, "hSpan" : 4, "vSpan" : 4, "orientation" : "UP" @@ -1442,7 +1374,6 @@ "type" : "EXTERN", "number" : 2, "direction" : "TOP", - "order" : -1, "rootBlock" : { "type" : "SERIAL", "cardinalities" : [ { @@ -1454,14 +1385,14 @@ "h" : 12, "v" : 0, "hSpan" : 4, - "vSpan" : 16, + "vSpan" : 14, "orientation" : "UP" }, "coord" : { "x" : 350.0, - "y" : 170.0, + "y" : 156.5, "xSpan" : 100.0, - "ySpan" : 216.0 + "ySpan" : 189.0 }, "subBlocks" : [ { "type" : "BODYPARALLEL", @@ -1479,7 +1410,7 @@ }, "coord" : { "x" : 350.0, - "y" : 251.0, + "y" : 224.0, "xSpan" : 100.0, "ySpan" : 54.0 }, @@ -1499,7 +1430,7 @@ }, "coord" : { "x" : 325.0, - "y" : 251.0, + "y" : 224.0, "xSpan" : 50.0, "ySpan" : 54.0 }, @@ -1519,7 +1450,7 @@ }, "coord" : { "x" : 325.0, - "y" : 278.0, + "y" : 251.0, "xSpan" : 50.0, "ySpan" : 0.0 }, @@ -1540,7 +1471,7 @@ }, "coord" : { "x" : 325.0, - "y" : 251.0, + "y" : 224.0, "xSpan" : 50.0, "ySpan" : 54.0 }, @@ -1562,7 +1493,7 @@ }, "coord" : { "x" : 375.0, - "y" : 251.0, + "y" : 224.0, "xSpan" : 50.0, "ySpan" : 54.0 }, @@ -1582,7 +1513,7 @@ }, "coord" : { "x" : 375.0, - "y" : 278.0, + "y" : 251.0, "xSpan" : 50.0, "ySpan" : 0.0 }, @@ -1603,7 +1534,7 @@ }, "coord" : { "x" : 375.0, - "y" : 251.0, + "y" : 224.0, "xSpan" : 50.0, "ySpan" : 54.0 }, @@ -1621,37 +1552,16 @@ "h" : 0, "v" : 4, "hSpan" : 2, - "vSpan" : 4, - "orientation" : "UP" - }, - "coord" : { - "x" : 350.0, - "y" : 197.0, - "xSpan" : 100.0, - "ySpan" : 54.0 - }, - "nodes" : [ "INTERNAL_AA1/J1_AA1/J1/Bay B/L1", "AA1/J1/Bay B/QA1", "INTERNAL_AA1/J1_AA1/J1/Bay B/L2" ] - }, { - "type" : "BODYPRIMARY", - "cardinalities" : [ { - "START" : 1 - }, { - "END" : 1 - } ], - "position" : { - "h" : 0, - "v" : 8, - "hSpan" : 2, - "vSpan" : 4, + "vSpan" : 6, "orientation" : "UP" }, "coord" : { "x" : 350.0, - "y" : 143.0, + "y" : 156.5, "xSpan" : 100.0, - "ySpan" : 54.0 + "ySpan" : 81.0 }, - "nodes" : [ "INTERNAL_AA1/J1_AA1/J1/Bay B/L2", "AA1/J1/Bay B/T1", "INTERNAL_AA1/J1_AA1/J1/Bay B/L3" ] + "nodes" : [ "INTERNAL_AA1/J1_AA1/J1/Bay B/L1", "AA1/J1/Bay B/QA1", "AA1/J1/Bay B/T1", "INTERNAL_AA1/J1_AA1/J1/Bay B/L3" ] }, { "type" : "BODYPARALLEL", "cardinalities" : [ { @@ -1661,7 +1571,7 @@ } ], "position" : { "h" : 0, - "v" : 12, + "v" : 10, "hSpan" : 4, "vSpan" : 4, "orientation" : "UP" @@ -1805,7 +1715,6 @@ "type" : "EXTERN", "number" : 3, "direction" : "TOP", - "order" : -1, "rootBlock" : { "type" : "SERIAL", "cardinalities" : [ { @@ -1822,9 +1731,9 @@ }, "coord" : { "x" : 625.0, - "y" : 170.0, + "y" : 156.5, "xSpan" : 50.0, - "ySpan" : 216.0 + "ySpan" : 189.0 }, "subBlocks" : [ { "type" : "LEGPRIMARY", @@ -1842,7 +1751,7 @@ }, "coord" : { "x" : 625.0, - "y" : 278.0, + "y" : 251.0, "xSpan" : 50.0, "ySpan" : 0.0 }, @@ -1863,9 +1772,9 @@ }, "coord" : { "x" : 625.0, - "y" : 170.0, + "y" : 156.5, "xSpan" : 50.0, - "ySpan" : 216.0 + "ySpan" : 189.0 }, "nodes" : [ "INTERNAL_AA1/J1_AA1/J1/CoupField/QC12", "AA1/J1/CoupField/QC12", "INTERNAL_AA1/J1_grounded" ] }, { @@ -1895,7 +1804,6 @@ "type" : "EXTERN", "number" : 4, "direction" : "TOP", - "order" : -1, "rootBlock" : { "type" : "SERIAL", "cardinalities" : [ { @@ -1907,14 +1815,14 @@ "h" : 16, "v" : 0, "hSpan" : 4, - "vSpan" : 16, + "vSpan" : 14, "orientation" : "UP" }, "coord" : { "x" : 450.0, - "y" : 170.0, + "y" : 156.5, "xSpan" : 100.0, - "ySpan" : 216.0 + "ySpan" : 189.0 }, "subBlocks" : [ { "type" : "BODYPARALLEL", @@ -1932,7 +1840,7 @@ }, "coord" : { "x" : 450.0, - "y" : 251.0, + "y" : 224.0, "xSpan" : 100.0, "ySpan" : 54.0 }, @@ -1952,7 +1860,7 @@ }, "coord" : { "x" : 425.0, - "y" : 251.0, + "y" : 224.0, "xSpan" : 50.0, "ySpan" : 54.0 }, @@ -1972,7 +1880,7 @@ }, "coord" : { "x" : 425.0, - "y" : 278.0, + "y" : 251.0, "xSpan" : 50.0, "ySpan" : 0.0 }, @@ -1993,7 +1901,7 @@ }, "coord" : { "x" : 425.0, - "y" : 251.0, + "y" : 224.0, "xSpan" : 50.0, "ySpan" : 54.0 }, @@ -2015,7 +1923,7 @@ }, "coord" : { "x" : 475.0, - "y" : 251.0, + "y" : 224.0, "xSpan" : 50.0, "ySpan" : 54.0 }, @@ -2035,7 +1943,7 @@ }, "coord" : { "x" : 475.0, - "y" : 278.0, + "y" : 251.0, "xSpan" : 50.0, "ySpan" : 0.0 }, @@ -2056,7 +1964,7 @@ }, "coord" : { "x" : 475.0, - "y" : 251.0, + "y" : 224.0, "xSpan" : 50.0, "ySpan" : 54.0 }, @@ -2074,37 +1982,16 @@ "h" : 0, "v" : 4, "hSpan" : 2, - "vSpan" : 4, - "orientation" : "UP" - }, - "coord" : { - "x" : 450.0, - "y" : 197.0, - "xSpan" : 100.0, - "ySpan" : 54.0 - }, - "nodes" : [ "INTERNAL_AA1/J1_AA1/J1/Bay C/L1", "AA1/J1/Bay C/QA1", "INTERNAL_AA1/J1_AA1/J1/Bay C/L2" ] - }, { - "type" : "BODYPRIMARY", - "cardinalities" : [ { - "START" : 1 - }, { - "END" : 1 - } ], - "position" : { - "h" : 0, - "v" : 8, - "hSpan" : 2, - "vSpan" : 4, + "vSpan" : 6, "orientation" : "UP" }, "coord" : { "x" : 450.0, - "y" : 143.0, + "y" : 156.5, "xSpan" : 100.0, - "ySpan" : 54.0 + "ySpan" : 81.0 }, - "nodes" : [ "INTERNAL_AA1/J1_AA1/J1/Bay C/L2", "AA1/J1/Bay C/T1", "INTERNAL_AA1/J1_AA1/J1/Bay C/L3" ] + "nodes" : [ "INTERNAL_AA1/J1_AA1/J1/Bay C/L1", "AA1/J1/Bay C/QA1", "AA1/J1/Bay C/T1", "INTERNAL_AA1/J1_AA1/J1/Bay C/L3" ] }, { "type" : "BODYPARALLEL", "cardinalities" : [ { @@ -2114,7 +2001,7 @@ } ], "position" : { "h" : 0, - "v" : 12, + "v" : 10, "hSpan" : 4, "vSpan" : 4, "orientation" : "UP" @@ -2258,7 +2145,6 @@ "type" : "EXTERN", "number" : 5, "direction" : "TOP", - "order" : -1, "rootBlock" : { "type" : "SERIAL", "cardinalities" : [ { @@ -2270,14 +2156,14 @@ "h" : 20, "v" : 0, "hSpan" : 4, - "vSpan" : 16, + "vSpan" : 14, "orientation" : "UP" }, "coord" : { "x" : 550.0, - "y" : 170.0, + "y" : 156.5, "xSpan" : 100.0, - "ySpan" : 216.0 + "ySpan" : 189.0 }, "subBlocks" : [ { "type" : "BODYPARALLEL", @@ -2295,7 +2181,7 @@ }, "coord" : { "x" : 550.0, - "y" : 251.0, + "y" : 224.0, "xSpan" : 100.0, "ySpan" : 54.0 }, @@ -2315,7 +2201,7 @@ }, "coord" : { "x" : 525.0, - "y" : 251.0, + "y" : 224.0, "xSpan" : 50.0, "ySpan" : 54.0 }, @@ -2335,7 +2221,7 @@ }, "coord" : { "x" : 525.0, - "y" : 278.0, + "y" : 251.0, "xSpan" : 50.0, "ySpan" : 0.0 }, @@ -2356,7 +2242,7 @@ }, "coord" : { "x" : 525.0, - "y" : 251.0, + "y" : 224.0, "xSpan" : 50.0, "ySpan" : 54.0 }, @@ -2378,7 +2264,7 @@ }, "coord" : { "x" : 575.0, - "y" : 251.0, + "y" : 224.0, "xSpan" : 50.0, "ySpan" : 54.0 }, @@ -2398,7 +2284,7 @@ }, "coord" : { "x" : 575.0, - "y" : 278.0, + "y" : 251.0, "xSpan" : 50.0, "ySpan" : 0.0 }, @@ -2419,7 +2305,7 @@ }, "coord" : { "x" : 575.0, - "y" : 251.0, + "y" : 224.0, "xSpan" : 50.0, "ySpan" : 54.0 }, @@ -2437,37 +2323,16 @@ "h" : 0, "v" : 4, "hSpan" : 2, - "vSpan" : 4, + "vSpan" : 6, "orientation" : "UP" }, "coord" : { "x" : 550.0, - "y" : 197.0, + "y" : 156.5, "xSpan" : 100.0, - "ySpan" : 54.0 + "ySpan" : 81.0 }, - "nodes" : [ "INTERNAL_AA1/J1_AA1/J1/Bay D/L1", "AA1/J1/Bay D/QA1", "INTERNAL_AA1/J1_AA1/J1/Bay D/L2" ] - }, { - "type" : "BODYPRIMARY", - "cardinalities" : [ { - "START" : 1 - }, { - "END" : 1 - } ], - "position" : { - "h" : 0, - "v" : 8, - "hSpan" : 2, - "vSpan" : 4, - "orientation" : "UP" - }, - "coord" : { - "x" : 550.0, - "y" : 143.0, - "xSpan" : 100.0, - "ySpan" : 54.0 - }, - "nodes" : [ "INTERNAL_AA1/J1_AA1/J1/Bay D/L2", "AA1/J1/Bay D/T1", "INTERNAL_AA1/J1_AA1/J1/Bay D/L3" ] + "nodes" : [ "INTERNAL_AA1/J1_AA1/J1/Bay D/L1", "AA1/J1/Bay D/QA1", "AA1/J1/Bay D/T1", "INTERNAL_AA1/J1_AA1/J1/Bay D/L3" ] }, { "type" : "BODYPARALLEL", "cardinalities" : [ { @@ -2477,7 +2342,7 @@ } ], "position" : { "h" : 0, - "v" : 12, + "v" : 10, "hSpan" : 4, "vSpan" : 4, "orientation" : "UP" @@ -2621,7 +2486,6 @@ "type" : "EXTERN", "number" : 6, "direction" : "TOP", - "order" : -1, "rootBlock" : { "type" : "SERIAL", "cardinalities" : [ { @@ -2638,9 +2502,9 @@ }, "coord" : { "x" : 675.0, - "y" : 170.0, + "y" : 156.5, "xSpan" : 50.0, - "ySpan" : 216.0 + "ySpan" : 189.0 }, "subBlocks" : [ { "type" : "LEGPRIMARY", @@ -2658,7 +2522,7 @@ }, "coord" : { "x" : 675.0, - "y" : 278.0, + "y" : 251.0, "xSpan" : 50.0, "ySpan" : 0.0 }, @@ -2679,9 +2543,9 @@ }, "coord" : { "x" : 675.0, - "y" : 170.0, + "y" : 156.5, "xSpan" : 50.0, - "ySpan" : 216.0 + "ySpan" : 189.0 }, "nodes" : [ "INTERNAL_AA1/J1_AA1/J1/CoupField/QC11", "AA1/J1/CoupField/QC11", "INTERNAL_AA1/J1_grounded" ] }, { @@ -2717,12 +2581,6 @@ }, { "node1" : "AA1/J1/Bay A/QA1", "node2" : "INTERNAL_AA1/J1_AA1/J1/Bay A/L1" - }, { - "node1" : "AA1/J1/Bay A/QA1", - "node2" : "INTERNAL_AA1/J1_AA1/J1/Bay A/L2" - }, { - "node1" : "AA1/J1/Bay A/T1", - "node2" : "INTERNAL_AA1/J1_AA1/J1/Bay A/L2" }, { "node1" : "AA1/J1/Bay A/T1", "node2" : "INTERNAL_AA1/J1_AA1/J1/Bay A/L3" @@ -2741,12 +2599,6 @@ }, { "node1" : "AA1/J1/Bay B/QA1", "node2" : "INTERNAL_AA1/J1_AA1/J1/Bay B/L1" - }, { - "node1" : "AA1/J1/Bay B/QA1", - "node2" : "INTERNAL_AA1/J1_AA1/J1/Bay B/L2" - }, { - "node1" : "AA1/J1/Bay B/T1", - "node2" : "INTERNAL_AA1/J1_AA1/J1/Bay B/L2" }, { "node1" : "AA1/J1/Bay B/T1", "node2" : "INTERNAL_AA1/J1_AA1/J1/Bay B/L3" @@ -2756,18 +2608,6 @@ }, { "node1" : "AA1/J1/Bay B/QB9", "node2" : "INTERNAL_AA1/J1_AA1/J1/Bay B/L3" - }, { - "node1" : "AA1/J1/CoupField/QB1", - "node2" : "INTERNAL_AA1/J1_AA1/J1/CoupField/L1" - }, { - "node1" : "AA1/J1/CoupField/QA1", - "node2" : "INTERNAL_AA1/J1_AA1/J1/CoupField/L1" - }, { - "node1" : "AA1/J1/CoupField/QA1", - "node2" : "INTERNAL_AA1/J1_AA1/J1/CoupField/L2" - }, { - "node1" : "AA1/J1/CoupField/QB2", - "node2" : "INTERNAL_AA1/J1_AA1/J1/CoupField/L2" }, { "node1" : "AA1/J1/Bay C/QB1", "node2" : "INTERNAL_AA1/J1_AA1/J1/Bay C/L1" @@ -2777,12 +2617,6 @@ }, { "node1" : "AA1/J1/Bay C/QA1", "node2" : "INTERNAL_AA1/J1_AA1/J1/Bay C/L1" - }, { - "node1" : "AA1/J1/Bay C/QA1", - "node2" : "INTERNAL_AA1/J1_AA1/J1/Bay C/L2" - }, { - "node1" : "AA1/J1/Bay C/T1", - "node2" : "INTERNAL_AA1/J1_AA1/J1/Bay C/L2" }, { "node1" : "AA1/J1/Bay C/T1", "node2" : "INTERNAL_AA1/J1_AA1/J1/Bay C/L3" @@ -2801,12 +2635,6 @@ }, { "node1" : "AA1/J1/Bay D/QA1", "node2" : "INTERNAL_AA1/J1_AA1/J1/Bay D/L1" - }, { - "node1" : "AA1/J1/Bay D/QA1", - "node2" : "INTERNAL_AA1/J1_AA1/J1/Bay D/L2" - }, { - "node1" : "AA1/J1/Bay D/T1", - "node2" : "INTERNAL_AA1/J1_AA1/J1/Bay D/L2" }, { "node1" : "AA1/J1/Bay D/T1", "node2" : "INTERNAL_AA1/J1_AA1/J1/Bay D/L3" @@ -2816,6 +2644,18 @@ }, { "node1" : "AA1/J1/Bay D/T5", "node2" : "INTERNAL_AA1/J1_AA1/J1/Bay D/L3" + }, { + "node1" : "AA1/J1/Bay A/QA1", + "node2" : "AA1/J1/Bay A/T1" + }, { + "node1" : "AA1/J1/Bay B/QA1", + "node2" : "AA1/J1/Bay B/T1" + }, { + "node1" : "AA1/J1/Bay C/QA1", + "node2" : "AA1/J1/Bay C/T1" + }, { + "node1" : "AA1/J1/Bay D/QA1", + "node2" : "AA1/J1/Bay D/T1" }, { "node1" : "AA1/J1/Bay A/T5", "node2" : "INTERNAL_AA1/J1_AA1/J1/Bay A/T5/Grounded" @@ -2876,6 +2716,18 @@ }, { "node1" : "INTERNAL_AA1/J1_AA1/J1/Bay D/T5/Grounded", "node2" : "AA1/J1/Bay D/T5/Grounded" + }, { + "node1" : "AA1/J1/CoupField/QA1", + "node2" : "INTERNAL_AA1/J1_AA1/J1/CoupField/QB2" + }, { + "node1" : "AA1/J1/CoupField/QB2", + "node2" : "INTERNAL_AA1/J1_AA1/J1/CoupField/QB2" + }, { + "node1" : "AA1/J1/CoupField/QA1", + "node2" : "INTERNAL_AA1/J1_AA1/J1/CoupField/QB1" + }, { + "node1" : "AA1/J1/CoupField/QB1", + "node2" : "INTERNAL_AA1/J1_AA1/J1/CoupField/QB1" }, { "node1" : "AA1/J1/BusBar A", "node2" : "BUSCO_AA1/J1/Bay A/QB2" diff --git a/service/src/test/resources/json/scl-2.json b/service/src/test/resources/json/scl-2.json index 570bb35..bb6422b 100644 --- a/service/src/test/resources/json/scl-2.json +++ b/service/src/test/resources/json/scl-2.json @@ -55,7 +55,6 @@ "y" : 0.0, "open" : false, "feederType" : "FICTITIOUS", - "order" : -1, "direction" : "TOP" }, { "type" : "FICTITIOUS", @@ -185,7 +184,6 @@ "open" : false, "label" : "_af9a4ae3-ba2e-4c34-8e47-5af894ee20f4/S1 380kV/BAY_T3_0/CONNECTIVITY_NODE881", "feederType" : "THREE_WINDINGS_TRANSFORMER_LEG", - "order" : -1, "direction" : "TOP", "side" : "ONE", "otherSideVoltageLevelInfos" : { @@ -238,7 +236,6 @@ "open" : false, "label" : "_af9a4ae3-ba2e-4c34-8e47-5af894ee20f4/S1 380kV/BAY_T4_2/CONNECTIVITY_NODE853", "feederType" : "THREE_WINDINGS_TRANSFORMER_LEG", - "order" : -1, "direction" : "TOP", "side" : "THREE", "otherSideVoltageLevelInfos" : { @@ -292,7 +289,6 @@ "type" : "EXTERN", "number" : 0, "direction" : "TOP", - "order" : -1, "rootBlock" : { "type" : "SERIAL", "cardinalities" : [ { @@ -403,7 +399,6 @@ "type" : "EXTERN", "number" : 1, "direction" : "TOP", - "order" : -1, "rootBlock" : { "type" : "SERIAL", "cardinalities" : [ { @@ -514,7 +509,6 @@ "type" : "EXTERN", "number" : 2, "direction" : "TOP", - "order" : -1, "rootBlock" : { "type" : "SERIAL", "cardinalities" : [ { @@ -801,7 +795,6 @@ "open" : false, "label" : "_af9a4ae3-ba2e-4c34-8e47-5af894ee20f4/S1 30kV/BAY_T3_2/CONNECTIVITY_NODE953", "feederType" : "THREE_WINDINGS_TRANSFORMER_LEG", - "order" : -1, "direction" : "TOP", "side" : "THREE", "otherSideVoltageLevelInfos" : { @@ -854,7 +847,6 @@ "open" : false, "label" : "_af9a4ae3-ba2e-4c34-8e47-5af894ee20f4/S1 30kV/BAY_T4_0/CONNECTIVITY_NODE781", "feederType" : "THREE_WINDINGS_TRANSFORMER_LEG", - "order" : -1, "direction" : "TOP", "side" : "ONE", "otherSideVoltageLevelInfos" : { @@ -927,7 +919,6 @@ "type" : "EXTERN", "number" : 0, "direction" : "TOP", - "order" : -1, "rootBlock" : { "type" : "SERIAL", "cardinalities" : [ { @@ -1038,7 +1029,6 @@ "type" : "EXTERN", "number" : 1, "direction" : "TOP", - "order" : -1, "rootBlock" : { "type" : "SERIAL", "cardinalities" : [ { @@ -1289,7 +1279,6 @@ "y" : 0.0, "open" : false, "feederType" : "FICTITIOUS", - "order" : -1, "direction" : "TOP" }, { "type" : "FICTITIOUS", @@ -1320,7 +1309,6 @@ "y" : 0.0, "open" : false, "feederType" : "FICTITIOUS", - "order" : -1, "direction" : "TOP" }, { "type" : "FICTITIOUS", @@ -1351,7 +1339,6 @@ "y" : 0.0, "open" : false, "feederType" : "FICTITIOUS", - "order" : -1, "direction" : "TOP" }, { "type" : "FICTITIOUS", @@ -1547,7 +1534,6 @@ "open" : false, "label" : "_af9a4ae3-ba2e-4c34-8e47-5af894ee20f4/S1 110kV/BAY_T3_1/CONNECTIVITY_NODE912", "feederType" : "THREE_WINDINGS_TRANSFORMER_LEG", - "order" : -1, "direction" : "TOP", "side" : "TWO", "otherSideVoltageLevelInfos" : { @@ -1600,7 +1586,6 @@ "open" : false, "label" : "_af9a4ae3-ba2e-4c34-8e47-5af894ee20f4/S1 110kV/BAY_T4_1/CONNECTIVITY_NODE812", "feederType" : "THREE_WINDINGS_TRANSFORMER_LEG", - "order" : -1, "direction" : "TOP", "side" : "TWO", "otherSideVoltageLevelInfos" : { @@ -1654,7 +1639,6 @@ "type" : "EXTERN", "number" : 0, "direction" : "TOP", - "order" : -1, "rootBlock" : { "type" : "SERIAL", "cardinalities" : [ { @@ -1765,7 +1749,6 @@ "type" : "EXTERN", "number" : 1, "direction" : "TOP", - "order" : -1, "rootBlock" : { "type" : "SERIAL", "cardinalities" : [ { @@ -1876,7 +1859,6 @@ "type" : "EXTERN", "number" : 2, "direction" : "TOP", - "order" : -1, "rootBlock" : { "type" : "SERIAL", "cardinalities" : [ { @@ -1987,7 +1969,6 @@ "type" : "EXTERN", "number" : 3, "direction" : "TOP", - "order" : -1, "rootBlock" : { "type" : "SERIAL", "cardinalities" : [ { @@ -2098,7 +2079,6 @@ "type" : "EXTERN", "number" : 4, "direction" : "TOP", - "order" : -1, "rootBlock" : { "type" : "SERIAL", "cardinalities" : [ { From 1e1571300e102f3fb913b95abbc6e9b001311107 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Dec 2021 17:18:25 +0000 Subject: [PATCH 06/20] Bump quarkus.platform.version from 2.6.0.Final to 2.6.1.Final Bumps `quarkus.platform.version` from 2.6.0.Final to 2.6.1.Final. Updates `quarkus-universe-bom` from 2.6.0.Final to 2.6.1.Final - [Release notes](https://github.com/quarkusio/quarkus-platform/releases) - [Commits](https://github.com/quarkusio/quarkus-platform/compare/2.6.0.Final...2.6.1.Final) Updates `quarkus-maven-plugin` from 2.6.0.Final to 2.6.1.Final --- updated-dependencies: - dependency-name: io.quarkus:quarkus-universe-bom dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.quarkus:quarkus-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4ce11f2..f284e52 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ SPDX-License-Identifier: Apache-2.0 0.7.0 - 2.6.0.Final + 2.6.1.Final 1.7.32 2.6.0 2.8.9 From 1a4c8f414ab0ddf4ee8ea8e2bb3619d9084dc8f0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Jan 2022 17:23:59 +0000 Subject: [PATCH 07/20] Bump powsybl-single-line-diagram-core from 2.6.0 to 2.7.0 Bumps [powsybl-single-line-diagram-core](https://github.com/powsybl/powsybl-single-line-diagram) from 2.6.0 to 2.7.0. - [Release notes](https://github.com/powsybl/powsybl-single-line-diagram/releases) - [Commits](https://github.com/powsybl/powsybl-single-line-diagram/compare/v2.6.0...v2.7.0) --- updated-dependencies: - dependency-name: com.powsybl:powsybl-single-line-diagram-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f284e52..92d27f0 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ SPDX-License-Identifier: Apache-2.0 2.6.1.Final 1.7.32 - 2.6.0 + 2.7.0 2.8.9 0.9.1 From 1c699026e9f020e10cf6a95344efd6e0c7337f74 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Jan 2022 17:22:50 +0000 Subject: [PATCH 08/20] Bump jandex-maven-plugin from 1.2.1 to 1.2.2 Bumps [jandex-maven-plugin](https://github.com/wildfly/jandex-maven-plugin) from 1.2.1 to 1.2.2. - [Release notes](https://github.com/wildfly/jandex-maven-plugin/releases) - [Commits](https://github.com/wildfly/jandex-maven-plugin/compare/1.2.1...1.2.2) --- updated-dependencies: - dependency-name: org.jboss.jandex:jandex-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f284e52..a82ef76 100644 --- a/pom.xml +++ b/pom.xml @@ -134,7 +134,7 @@ SPDX-License-Identifier: Apache-2.0 org.jboss.jandex jandex-maven-plugin - 1.2.1 + 1.2.2 make-index From d51dceae3501fd313e1629a2c69a30e0ebcb18a6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jan 2022 17:26:15 +0000 Subject: [PATCH 09/20] Bump quarkus.platform.version from 2.6.1.Final to 2.6.2.Final Bumps `quarkus.platform.version` from 2.6.1.Final to 2.6.2.Final. Updates `quarkus-universe-bom` from 2.6.1.Final to 2.6.2.Final - [Release notes](https://github.com/quarkusio/quarkus-platform/releases) - [Commits](https://github.com/quarkusio/quarkus-platform/compare/2.6.1.Final...2.6.2.Final) Updates `quarkus-maven-plugin` from 2.6.1.Final to 2.6.2.Final --- updated-dependencies: - dependency-name: io.quarkus:quarkus-universe-bom dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.quarkus:quarkus-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a82ef76..9171f31 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ SPDX-License-Identifier: Apache-2.0 0.7.0 - 2.6.1.Final + 2.6.2.Final 1.7.32 2.6.0 2.8.9 From 9a67d7591dd505ae7eae5f728ee179e06887e7be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jan 2022 17:26:30 +0000 Subject: [PATCH 10/20] Bump maven-jar-plugin from 3.2.0 to 3.2.1 Bumps [maven-jar-plugin](https://github.com/apache/maven-jar-plugin) from 3.2.0 to 3.2.1. - [Release notes](https://github.com/apache/maven-jar-plugin/releases) - [Commits](https://github.com/apache/maven-jar-plugin/compare/maven-jar-plugin-3.2.0...maven-jar-plugin-3.2.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-jar-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a82ef76..aa0c64e 100644 --- a/pom.xml +++ b/pom.xml @@ -148,7 +148,7 @@ SPDX-License-Identifier: Apache-2.0 org.apache.maven.plugins maven-jar-plugin - 3.2.0 + 3.2.1 From 5b0549415bcdc74b0450bab001bd8fcc19913d53 Mon Sep 17 00:00:00 2001 From: Dennis Labordus Date: Tue, 11 Jan 2022 11:53:32 +0100 Subject: [PATCH 11/20] Refactor GraphBuilder to work with 2.7.0 Signed-off-by: Dennis Labordus --- .../builder/AbstractGraphBuilder.java | 43 +++++ .../builder/SubstationGraphBuilder.java | 98 ++++++++++ .../builder/VoltageLevelGraphBuilder.java | 173 ++++++++++++++++++ .../exception/SclAutoAlignmentErrorCode.java | 1 + .../SclAutoAlignmentDiagramLabelProvider.java | 5 +- .../service/SclAutoAlignmentGraphBuilder.java | 170 ----------------- .../service/SclAutoAlignmentService.java | 40 ++-- .../service/SclAutoAlignmentServiceTest.java | 6 +- 8 files changed, 338 insertions(+), 198 deletions(-) create mode 100644 service/src/main/java/org/lfenergy/compas/scl/auto/alignment/builder/AbstractGraphBuilder.java create mode 100644 service/src/main/java/org/lfenergy/compas/scl/auto/alignment/builder/SubstationGraphBuilder.java create mode 100644 service/src/main/java/org/lfenergy/compas/scl/auto/alignment/builder/VoltageLevelGraphBuilder.java delete mode 100644 service/src/main/java/org/lfenergy/compas/scl/auto/alignment/service/SclAutoAlignmentGraphBuilder.java diff --git a/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/builder/AbstractGraphBuilder.java b/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/builder/AbstractGraphBuilder.java new file mode 100644 index 0000000..0544959 --- /dev/null +++ b/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/builder/AbstractGraphBuilder.java @@ -0,0 +1,43 @@ +// SPDX-FileCopyrightText: 2021 Alliander N.V. +// +// SPDX-License-Identifier: Apache-2.0 +package org.lfenergy.compas.scl.auto.alignment.builder; + +import com.powsybl.sld.model.BaseGraph; +import com.powsybl.sld.model.Node; + +import java.util.HashMap; +import java.util.Map; + +public abstract class AbstractGraphBuilder { + private G graph; + private final Map path2Node; + + public AbstractGraphBuilder() { + this(new HashMap<>()); + } + + public AbstractGraphBuilder(Map path2Node) { + this.path2Node = path2Node; + } + + public G getGraph() { + return graph; + } + + protected void setGraph(G graph) { + this.graph = graph; + } + + protected void addNode(String path, Node node) { + path2Node.put(path, node); + } + + protected Node getNodeByPath(String path) { + return path2Node.get(path); + } + + protected Map getPath2Node() { + return path2Node; + } +} diff --git a/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/builder/SubstationGraphBuilder.java b/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/builder/SubstationGraphBuilder.java new file mode 100644 index 0000000..f0c3611 --- /dev/null +++ b/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/builder/SubstationGraphBuilder.java @@ -0,0 +1,98 @@ +// SPDX-FileCopyrightText: 2021 Alliander N.V. +// +// SPDX-License-Identifier: Apache-2.0 +package org.lfenergy.compas.scl.auto.alignment.builder; + +import com.powsybl.sld.model.*; +import org.lfenergy.compas.scl.auto.alignment.exception.SclAutoAlignmentException; +import org.lfenergy.compas.scl.auto.alignment.model.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.lfenergy.compas.scl.auto.alignment.exception.SclAutoAlignmentErrorCode.VOLTAGELEVEL_NOT_FOUND_ERROR_CODE; + +public class SubstationGraphBuilder extends AbstractGraphBuilder { + private final GenericSubstation substation; + + private final Map voltageLevelGraphBuilderMap = new HashMap<>(); + + public SubstationGraphBuilder(GenericSubstation substation) { + this(substation, new HashMap<>()); + } + + public SubstationGraphBuilder(GenericSubstation substation, + Map path2Node) { + super(path2Node); + this.substation = substation; + + setGraph(SubstationGraph.create(substation.getFullName())); + + createSubstation(); + } + + private void createSubstation() { + substation.getVoltageLevels().forEach(this::createVoltageLevelGraph); + substation.getPowerTransformers().forEach(this::createPowerTransformer); + } + + private void createVoltageLevelGraph(GenericVoltageLevel voltageLevel) { + var voltageLevelBuilder = new VoltageLevelGraphBuilder(voltageLevel, substation, getPath2Node()); + getGraph().addVoltageLevel(voltageLevelBuilder.getGraph()); + voltageLevelGraphBuilderMap.put(voltageLevel.getFullName(), voltageLevelBuilder); + } + + private VoltageLevelGraphBuilder getVoltageLevelBuilder(GenericTransformerWinding transformerWinding) { + var connectivityNode = transformerWinding.getTerminals().get(0).getConnectivityNode(); + return substation.getVoltageLevels().stream() + .map(GenericVoltageLevel::getBays) + .flatMap(List::stream) + .map(GenericBay::getConductingEquipments) + .flatMap(List::stream) + .map(GenericConductingEquipment::getTerminals) + .flatMap(List::stream) + .filter(terminal -> connectivityNode.equals(terminal.getConnectivityNode())) + .findFirst() + .map(terminal -> ((GenericConductingEquipment) terminal.getParent()).getParent().getParent()) + .map(genericVoltageLevel -> voltageLevelGraphBuilderMap.get(genericVoltageLevel.getFullName())) + .orElseThrow(() -> new SclAutoAlignmentException(VOLTAGELEVEL_NOT_FOUND_ERROR_CODE, "No voltage level found.")); + } + + private void createPowerTransformer(GenericPowerTransformer powerTransformer) { + if (powerTransformer.isFeeder2WT()) { + var tws = powerTransformer.getTransformerWindings(); + getGraph().addMultiTermNode( + Middle2WTNode.create(powerTransformer.getFullName(), + powerTransformer.getFullName(), + getGraph(), + getFeeder2WTLegNode(tws.get(0)), + getFeeder2WTLegNode(tws.get(1)), + getVoltageLevelBuilder(tws.get(0)).getGraph().getVoltageLevelInfos(), + getVoltageLevelBuilder(tws.get(1)).getGraph().getVoltageLevelInfos(), + false)); + } else if (powerTransformer.isFeeder3WT()) { + var tws = powerTransformer.getTransformerWindings(); + getGraph().addMultiTermNode( + Middle3WTNode.create(powerTransformer.getFullName(), + powerTransformer.getFullName(), + getGraph(), + getFeeder3WTLegNode(tws.get(0)), + getFeeder3WTLegNode(tws.get(1)), + getFeeder3WTLegNode(tws.get(2)), + getVoltageLevelBuilder(tws.get(0)).getGraph().getVoltageLevelInfos(), + getVoltageLevelBuilder(tws.get(1)).getGraph().getVoltageLevelInfos(), + getVoltageLevelBuilder(tws.get(2)).getGraph().getVoltageLevelInfos())); + } + } + + private Feeder2WTLegNode getFeeder2WTLegNode(GenericTransformerWinding transformerWinding) { + var connectivityNode = transformerWinding.getTerminals().get(0).getConnectivityNode(); + return (Feeder2WTLegNode) getNodeByPath(connectivityNode); + } + + private Feeder3WTLegNode getFeeder3WTLegNode(GenericTransformerWinding transformerWinding) { + var connectivityNode = transformerWinding.getTerminals().get(0).getConnectivityNode(); + return (Feeder3WTLegNode) getNodeByPath(connectivityNode); + } +} diff --git a/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/builder/VoltageLevelGraphBuilder.java b/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/builder/VoltageLevelGraphBuilder.java new file mode 100644 index 0000000..dc8bf10 --- /dev/null +++ b/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/builder/VoltageLevelGraphBuilder.java @@ -0,0 +1,173 @@ +// SPDX-FileCopyrightText: 2021 Alliander N.V. +// +// SPDX-License-Identifier: Apache-2.0 +package org.lfenergy.compas.scl.auto.alignment.builder; + +import com.powsybl.sld.model.*; +import org.lfenergy.compas.scl.auto.alignment.model.*; + +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.atomic.AtomicInteger; + +public class VoltageLevelGraphBuilder extends AbstractGraphBuilder { + private final GenericVoltageLevel voltageLevel; + private final GenericSubstation substation; + + public VoltageLevelGraphBuilder(GenericVoltageLevel voltageLevel) { + this(voltageLevel, null, new HashMap<>(), true); + } + + public VoltageLevelGraphBuilder(GenericVoltageLevel voltageLevel, + GenericSubstation substation, + Map path2Node) { + this(voltageLevel, substation, path2Node, false); + } + + private VoltageLevelGraphBuilder(GenericVoltageLevel voltageLevel, + GenericSubstation substation, + Map path2Node, + boolean forVoltageLevelDiagram) { + super(path2Node); + this.voltageLevel = voltageLevel; + this.substation = substation; + + var voltageLevelInfos = new VoltageLevelInfos(voltageLevel.getFullName(), + voltageLevel.getFullName(), + voltageLevel.getVoltage()); + setGraph(VoltageLevelGraph.create(voltageLevelInfos, forVoltageLevelDiagram)); + + createVoltageLevel(); + } + + private void createVoltageLevel() { + // First process the Busbars. + var busbarIndex = new AtomicInteger(1); + voltageLevel.getBays().stream() + .filter(GenericBay::isBusbar) + .forEach(busbar -> processBusbarNode(busbar, busbarIndex)); + + // Next process the other bays. + voltageLevel.getBays().stream() + .filter(bay -> !bay.isBusbar()) + .forEach(this::processBayNode); + } + + private void processBusbarNode(GenericBay busbar, + AtomicInteger busbarIndex) { + busbar.getConnectivityNodes() + .forEach(connectivityNode -> + addNode(connectivityNode.getPathName(), + createBusbarNode(busbar.getFullName(), busbarIndex.getAndIncrement(), 1))); + } + + public BusNode createBusbarNode(String id, int busbarIndex, int sectionIndex) { + BusNode busNode = BusNode.create(getGraph(), id, id); + getGraph().addNode(busNode); + busNode.setBusBarIndexSectionIndex(busbarIndex, sectionIndex); + return busNode; + } + + private void processBayNode(GenericBay bay) { + bay.getConnectivityNodes().forEach(this::createConnectivityNode); + bay.getConductingEquipments().forEach(this::processConductingEquipment); + } + + private void createConnectivityNode(GenericConnectivityNode connectivityNode) { + getPowerTransformer(connectivityNode.getPathName()) + .ifPresentOrElse(powerTransformer -> { + if (powerTransformer.isFeeder2WT()) { + addNode(connectivityNode.getPathName(), + createFeeder2WTLegNode(connectivityNode.getPathName(), + powerTransformer.getSide(connectivityNode.getPathName()), 0, null)); + } else if (powerTransformer.isFeeder3WT()) { + addNode(connectivityNode.getPathName(), + createFeeder3WTLegNode(connectivityNode.getPathName(), + powerTransformer.getSide(connectivityNode.getPathName()), 0, null)); + } + }, () -> + addNode(connectivityNode.getPathName(), + createFictitiousNode(connectivityNode.getPathName())) + ); + } + + private Optional getPowerTransformer(String pathName) { + if (substation != null) { + return substation.getPowerTransformerByConnectivityNode(pathName); + } + return Optional.empty(); + } + + private void processConductingEquipment(GenericConductingEquipment conductingEquipment) { + var terminals = conductingEquipment.getTerminals(); + var fullName = conductingEquipment.getFullName(); + var node = createSwitchNode(fullName); + + Node node1 = terminalToNode(terminals.get(0)); + Node node2 = null; + var termNb = terminals.size(); + if (termNb == 1) { + node2 = createLoad(fullName + "/Grounded"); + } else if (termNb == 2) { + node2 = terminalToNode(terminals.get(1)); + } + connectNode(node, node1); + connectNode(node, node2); + } + + private Node terminalToNode(GenericTerminal terminal) { + var pathName = terminal.getConnectivityNode(); + if (pathName != null) { + return getNodeByPath(pathName); + } + return createLoad(terminal.getCNodeName()); + } + + private SwitchNode createSwitchNode(String id) { + SwitchNode sw = new SwitchNode(id, id, SwitchNode.SwitchKind.BREAKER.name(), false, + getGraph(), SwitchNode.SwitchKind.BREAKER, false); + getGraph().addNode(sw); + return sw; + } + + private void connectNode(Node node1, Node node2) { + getGraph().addEdge(node1, node2); + } + + private FictitiousNode createFictitiousNode(String id) { + InternalNode fictitiousNode = new InternalNode(id, getGraph()); + getGraph().addNode(fictitiousNode); + return fictitiousNode; + } + + private FeederNode createLoad(String id) { + FeederInjectionNode fn = FeederInjectionNode.createLoad(getGraph(), id, id); + commonFeederSetting(fn, id, 0, null); + return fn; + } + + public Feeder2WTLegNode createFeeder2WTLegNode(String id, FeederWithSideNode.Side side, int order, + BusCell.Direction direction) { + Feeder2WTLegNode f2WTe = Feeder2WTLegNode.create(getGraph(), id + "_" + side, id, id, side); + commonFeederSetting(f2WTe, id, order, direction); + return f2WTe; + } + + public Feeder3WTLegNode createFeeder3WTLegNode(String id, FeederWithSideNode.Side side, int order, + BusCell.Direction direction) { + Feeder3WTLegNode f3WTe = Feeder3WTLegNode.createForSubstationDiagram(getGraph(), id + "_" + side, id, id, side); + commonFeederSetting(f3WTe, id + side.getIntValue(), order, direction); + return f3WTe; + } + + private void commonFeederSetting(FeederNode node, String id, int order, BusCell.Direction direction) { + node.setLabel(id); + getGraph().addNode(node); + + if (direction != null) { + node.setOrder(order); + node.setDirection(direction); + } + } +} diff --git a/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/exception/SclAutoAlignmentErrorCode.java b/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/exception/SclAutoAlignmentErrorCode.java index 8e587f3..369aa34 100644 --- a/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/exception/SclAutoAlignmentErrorCode.java +++ b/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/exception/SclAutoAlignmentErrorCode.java @@ -12,4 +12,5 @@ public class SclAutoAlignmentErrorCode { public static final String SUBSTATION_NOT_FOUND_ERROR_CODE = "SAA-0002"; public static final String NO_VOLTAGE_FOUND_ERROR_CODE = "SAA-0003"; public static final String VOLTAGELEVEL_NOT_FOUND_ERROR_CODE = "SAA-0004"; + public static final String ZONE_NOT_SUPPORTED_ERROR_CODE = "SAA-0005"; } diff --git a/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/service/SclAutoAlignmentDiagramLabelProvider.java b/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/service/SclAutoAlignmentDiagramLabelProvider.java index cb0008d..cc60163 100644 --- a/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/service/SclAutoAlignmentDiagramLabelProvider.java +++ b/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/service/SclAutoAlignmentDiagramLabelProvider.java @@ -15,11 +15,10 @@ import java.util.*; public class SclAutoAlignmentDiagramLabelProvider implements DiagramLabelProvider { - private final Map> busLabels; + private final Map> busLabels = new HashMap<>(); public SclAutoAlignmentDiagramLabelProvider(SubstationGraph graph) { - this.busLabels = new HashMap<>(); - graph.getNodes().forEach(voltageLevelGraph -> + graph.getVoltageLevels().forEach(voltageLevelGraph -> voltageLevelGraph.getNodes().forEach(this::addNode) ); graph.getMultiTermNodes().forEach(this::addNode); diff --git a/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/service/SclAutoAlignmentGraphBuilder.java b/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/service/SclAutoAlignmentGraphBuilder.java deleted file mode 100644 index 3b690e5..0000000 --- a/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/service/SclAutoAlignmentGraphBuilder.java +++ /dev/null @@ -1,170 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Alliander N.V. -// -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2021 Alliander N.V. -// -// SPDX-License-Identifier: Apache-2.0 -package org.lfenergy.compas.scl.auto.alignment.service; - -import com.powsybl.sld.RawGraphBuilder; -import com.powsybl.sld.model.*; -import com.powsybl.sld.model.SwitchNode.SwitchKind; -import org.lfenergy.compas.scl.auto.alignment.exception.SclAutoAlignmentException; -import org.lfenergy.compas.scl.auto.alignment.model.*; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.atomic.AtomicInteger; - -import static org.lfenergy.compas.scl.auto.alignment.exception.SclAutoAlignmentErrorCode.VOLTAGELEVEL_NOT_FOUND_ERROR_CODE; - -public class SclAutoAlignmentGraphBuilder { - private RawGraphBuilder rawGraphBuilder; - private RawGraphBuilder.SubstationBuilder substationBuilder; - - private Map path2VoltageLevelBuilder = new HashMap<>(); - private Map path2Node = new HashMap<>(); - - public RawGraphBuilder.SubstationBuilder getSubstationBuilder() { - return substationBuilder; - } - - public SclAutoAlignmentGraphBuilder(GenericSubstation substation) { - rawGraphBuilder = new RawGraphBuilder(); - substationBuilder = rawGraphBuilder.createSubstationBuilder(substation.getFullName()); - substation.getVoltageLevels() - .forEach(voltageLevel -> createVoltageLevelGraph(substation, voltageLevel)); - substation.getPowerTransformers() - .forEach(powerTransformer -> createPowerTransformer(substation, powerTransformer)); - } - - private void createPowerTransformer(GenericSubstation substation, GenericPowerTransformer powerTransformer) { - if (powerTransformer.isFeeder2WT()) { - var tws = powerTransformer.getTransformerWindings(); - substationBuilder.getSsGraph().addMultiTermNode( - Middle2WTNode.create(powerTransformer.getFullName(), - powerTransformer.getFullName(), - substationBuilder.getSsGraph(), - getFeeder2WTLegNode(tws.get(0)), - getFeeder2WTLegNode(tws.get(1)), - getVoltageLevelBuilder(substation, tws.get(0)).getGraph().getVoltageLevelInfos(), - getVoltageLevelBuilder(substation, tws.get(1)).getGraph().getVoltageLevelInfos())); - } else if (powerTransformer.isFeeder3WT()) { - var tws = powerTransformer.getTransformerWindings(); - substationBuilder.getSsGraph().addMultiTermNode( - Middle3WTNode.create(powerTransformer.getFullName(), - powerTransformer.getFullName(), - substationBuilder.getSsGraph(), - getFeeder3WTLegNode(tws.get(0)), - getFeeder3WTLegNode(tws.get(1)), - getFeeder3WTLegNode(tws.get(2)), - getVoltageLevelBuilder(substation, tws.get(0)).getGraph().getVoltageLevelInfos(), - getVoltageLevelBuilder(substation, tws.get(1)).getGraph().getVoltageLevelInfos(), - getVoltageLevelBuilder(substation, tws.get(2)).getGraph().getVoltageLevelInfos())); - } - } - - private Feeder2WTLegNode getFeeder2WTLegNode(GenericTransformerWinding transformerWinding) { - var connectivityNode = transformerWinding.getTerminals().get(0).getConnectivityNode(); - return (Feeder2WTLegNode) path2Node.get(connectivityNode); - } - - private Feeder3WTLegNode getFeeder3WTLegNode(GenericTransformerWinding transformerWinding) { - var connectivityNode = transformerWinding.getTerminals().get(0).getConnectivityNode(); - return (Feeder3WTLegNode) path2Node.get(connectivityNode); - } - - private RawGraphBuilder.VoltageLevelBuilder getVoltageLevelBuilder(GenericSubstation substation, - GenericTransformerWinding transformerWinding) { - var connectivityNode = transformerWinding.getTerminals().get(0).getConnectivityNode(); - return substation.getVoltageLevels().stream() - .map(GenericVoltageLevel::getBays) - .flatMap(List::stream) - .map(GenericBay::getConductingEquipments) - .flatMap(List::stream) - .map(GenericConductingEquipment::getTerminals) - .flatMap(List::stream) - .filter(terminal -> connectivityNode.equals(terminal.getConnectivityNode())) - .findFirst() - .map(terminal -> ((GenericConductingEquipment) terminal.getParent()).getParent().getParent()) - .map(genericVoltageLevel -> path2VoltageLevelBuilder.get(genericVoltageLevel.getFullName())) - .orElseThrow(() -> new SclAutoAlignmentException(VOLTAGELEVEL_NOT_FOUND_ERROR_CODE, "No voltage level found.")); - } - - private void createVoltageLevelGraph(GenericSubstation substation, - GenericVoltageLevel voltageLevel) { - var voltageLevelBuilder = - rawGraphBuilder.createVoltageLevelBuilder(voltageLevel.getFullName(), voltageLevel.getVoltage(), false); - - // First process the Busbars. - var busbarIndex = new AtomicInteger(1); - voltageLevel.getBays().stream() - .filter(GenericBay::isBusbar) - .forEach(bay -> createBusbarNode(voltageLevelBuilder, bay, busbarIndex)); - - // Next process the other bays. - voltageLevel.getBays().stream() - .filter(bay -> !bay.isBusbar()) - .forEach(bay -> createBayNode(voltageLevelBuilder, substation, bay)); - - substationBuilder.addVlBuilder(voltageLevelBuilder); - path2VoltageLevelBuilder.put(voltageLevel.getFullName(), voltageLevelBuilder); - } - - private void createBusbarNode(RawGraphBuilder.VoltageLevelBuilder voltageLevelBuilder, - GenericBay bay, - AtomicInteger busbarIndex) { - bay.getConnectivityNodes() - .forEach(connectivityNode -> path2Node.put(connectivityNode.getPathName(), - voltageLevelBuilder.createBusBarSection(bay.getFullName(), busbarIndex.getAndIncrement(), 1))); - } - - private void createBayNode(RawGraphBuilder.VoltageLevelBuilder voltageLevelBuilder, - GenericSubstation substation, - GenericBay bay) { - bay.getConnectivityNodes() - .forEach(connectivityNode -> { - var genericPowerTransformer = substation.getPowerTransformerByConnectivityNode(connectivityNode.getPathName()); - genericPowerTransformer.ifPresentOrElse(powerTransformer -> { - if (powerTransformer.isFeeder2WT()) { - path2Node.put(connectivityNode.getPathName(), - voltageLevelBuilder.createFeeder2wtLegNode(connectivityNode.getPathName(), - powerTransformer.getSide(connectivityNode.getPathName()), 0, null)); - } else if (powerTransformer.isFeeder3WT()) { - path2Node.put(connectivityNode.getPathName(), - voltageLevelBuilder.createFeeder3wtLegNode(connectivityNode.getPathName(), - powerTransformer.getSide(connectivityNode.getPathName()), 0, null)); - } - }, () -> path2Node.put(connectivityNode.getPathName(), - voltageLevelBuilder.createFictitiousNode(connectivityNode.getPathName())) - ); - }); - - bay.getConductingEquipments().forEach(ce -> { - var terminals = ce.getTerminals(); - var fullName = ce.getFullName(); - var node = voltageLevelBuilder.createSwitchNode(SwitchKind.BREAKER, fullName, false, false); - - Node node1 = terminalToNode(voltageLevelBuilder, terminals.get(0)); - Node node2 = null; - var termNb = terminals.size(); - if (termNb == 1) { - node2 = voltageLevelBuilder.createLoad(fullName + "/Grounded"); - } else if (termNb == 2) { - node2 = terminalToNode(voltageLevelBuilder, terminals.get(1)); - } - voltageLevelBuilder.connectNode(node, node1); - voltageLevelBuilder.connectNode(node, node2); - }); - } - - private Node terminalToNode(RawGraphBuilder.VoltageLevelBuilder voltageLevelBuilder, - GenericTerminal terminal) { - var pathName = terminal.getConnectivityNode(); - if (pathName != null) { - return path2Node.get(pathName); - } - return voltageLevelBuilder.createLoad(terminal.getCNodeName()); - } -} diff --git a/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/service/SclAutoAlignmentService.java b/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/service/SclAutoAlignmentService.java index 5ba2817..7cf578b 100644 --- a/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/service/SclAutoAlignmentService.java +++ b/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/service/SclAutoAlignmentService.java @@ -3,18 +3,17 @@ // SPDX-License-Identifier: Apache-2.0 package org.lfenergy.compas.scl.auto.alignment.service; -import com.powsybl.sld.RawGraphBuilder; import com.powsybl.sld.layout.HorizontalSubstationLayoutFactory; import com.powsybl.sld.layout.LayoutParameters; import com.powsybl.sld.layout.PositionVoltageLevelLayoutFactory; import com.powsybl.sld.library.ConvergenceComponentLibrary; import com.powsybl.sld.model.SubstationGraph; -import com.powsybl.sld.svg.DefaultDiagramStyleProvider; +import com.powsybl.sld.svg.BasicStyleProvider; import com.powsybl.sld.svg.DefaultSVGWriter; import org.lfenergy.compas.core.commons.ElementConverter; +import org.lfenergy.compas.scl.auto.alignment.builder.SubstationGraphBuilder; import org.lfenergy.compas.scl.auto.alignment.exception.SclAutoAlignmentException; import org.lfenergy.compas.scl.auto.alignment.model.GenericSCL; -import org.lfenergy.compas.scl.auto.alignment.model.GenericSubstation; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; @@ -23,7 +22,6 @@ import java.io.StringWriter; import java.nio.charset.StandardCharsets; import java.util.List; -import java.util.Optional; import static org.lfenergy.compas.scl.auto.alignment.SclAutoAlignmentConstants.SCL_ELEMENT_NAME; import static org.lfenergy.compas.scl.auto.alignment.SclAutoAlignmentConstants.SCL_NS_URI; @@ -43,7 +41,7 @@ public String updateSCL(String sclData, List substationNames, String who var scl = readSCL(sclData); substationNames.forEach(substationName -> { - var substationBuilder = createSubstationBuilder(scl.getSubstation(substationName), substationName); + var substationBuilder = createSubstationGraphBuilder(scl, substationName); // Create the JSON With all X/Y Coordinate information. var jsonGraphInfo = createJson(substationBuilder); @@ -61,7 +59,7 @@ public String updateSCL(String sclData, List substationNames, String who public String getSVG(String sclData, String substationName) { var scl = readSCL(sclData); - var substationBuilder = createSubstationBuilder(scl.getSubstation(substationName), substationName); + var substationBuilder = createSubstationGraphBuilder(scl, substationName); return createSVG(substationBuilder); } @@ -77,19 +75,18 @@ GenericSCL readSCL(String sclData) { return new GenericSCL(sclElement); } - RawGraphBuilder.SubstationBuilder createSubstationBuilder(Optional substation, - String substationName) { - return substation.map(value -> { - var builder = new SclAutoAlignmentGraphBuilder(value); - return builder.getSubstationBuilder(); - }).orElseThrow(() -> { - throw new SclAutoAlignmentException(SUBSTATION_NOT_FOUND_ERROR_CODE, - "No substation found with name '" + substationName + "'."); - }); + SubstationGraphBuilder createSubstationGraphBuilder(GenericSCL scl, + String substationName) { + return scl.getSubstation(substationName) + .map(SubstationGraphBuilder::new) + .orElseThrow(() -> { + throw new SclAutoAlignmentException(SUBSTATION_NOT_FOUND_ERROR_CODE, + "No substation found with name '" + substationName + "'."); + }); } - String createJson(RawGraphBuilder.SubstationBuilder substationBuilder) { - var graph = substationBuilder.getSsGraph(); + String createJson(SubstationGraphBuilder substationGraphBuilder) { + var graph = substationGraphBuilder.getGraph(); var layoutParameters = getLayoutParameters(); configureLayout(graph, layoutParameters); @@ -99,14 +96,14 @@ String createJson(RawGraphBuilder.SubstationBuilder substationBuilder) { } - String createSVG(RawGraphBuilder.SubstationBuilder substationBuilder) { - var graph = substationBuilder.getSsGraph(); + String createSVG(SubstationGraphBuilder substationGraphBuilder) { + var graph = substationGraphBuilder.getGraph(); var layoutParameters = getLayoutParameters(); configureLayout(graph, layoutParameters); var writer = new StringWriter(); var svgWriter = new DefaultSVGWriter(new ConvergenceComponentLibrary(), layoutParameters); - svgWriter.write("", graph, new SclAutoAlignmentDiagramLabelProvider(graph), new DefaultDiagramStyleProvider(), writer); + svgWriter.write("", graph, new SclAutoAlignmentDiagramLabelProvider(graph), new BasicStyleProvider(), writer); return writer.toString(); } @@ -114,7 +111,8 @@ private LayoutParameters getLayoutParameters() { return new LayoutParameters() .setAdaptCellHeightToContent(true) .setShowInternalNodes(true) - .setCssLocation(LayoutParameters.CssLocation.INSERTED_IN_SVG); + .setCssLocation(LayoutParameters.CssLocation.INSERTED_IN_SVG) + .setShowInternalNodes(true); } private void configureLayout(SubstationGraph graph, LayoutParameters layoutParameters) { diff --git a/service/src/test/java/org/lfenergy/compas/scl/auto/alignment/service/SclAutoAlignmentServiceTest.java b/service/src/test/java/org/lfenergy/compas/scl/auto/alignment/service/SclAutoAlignmentServiceTest.java index 3baf2d5..bf78e57 100644 --- a/service/src/test/java/org/lfenergy/compas/scl/auto/alignment/service/SclAutoAlignmentServiceTest.java +++ b/service/src/test/java/org/lfenergy/compas/scl/auto/alignment/service/SclAutoAlignmentServiceTest.java @@ -74,8 +74,7 @@ void createJson_WhenPassingCase1_ThenJsonReturned() throws IOException { var substationName = "AA1"; var sclData = readSCL(filename + ".scd"); var scl = sclAutoAlignmentService.readSCL(sclData); - var substationBuilder = sclAutoAlignmentService.createSubstationBuilder( - scl.getSubstation(substationName), substationName); + var substationBuilder = sclAutoAlignmentService.createSubstationGraphBuilder(scl, substationName); var result = sclAutoAlignmentService.createJson(substationBuilder); assertNotNull(result); @@ -88,8 +87,7 @@ void createJson_WhenPassingCase2_ThenJsonReturned() throws IOException { var substationName = "_af9a4ae3-ba2e-4c34-8e47-5af894ee20f4"; var sclData = readSCL(filename + ".scd"); var scl = sclAutoAlignmentService.readSCL(sclData); - var substationBuilder = sclAutoAlignmentService.createSubstationBuilder( - scl.getSubstation(substationName), substationName); + var substationBuilder = sclAutoAlignmentService.createSubstationGraphBuilder(scl, substationName); var result = sclAutoAlignmentService.createJson(substationBuilder); assertNotNull(result); From afbaf2a8df970905a38d24c148a64949ab9fbeaa Mon Sep 17 00:00:00 2001 From: Dennis Labordus Date: Tue, 11 Jan 2022 11:59:45 +0100 Subject: [PATCH 12/20] Small sonar issues fixed. Signed-off-by: Dennis Labordus --- .../scl/auto/alignment/builder/AbstractGraphBuilder.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/builder/AbstractGraphBuilder.java b/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/builder/AbstractGraphBuilder.java index 0544959..4d5be5c 100644 --- a/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/builder/AbstractGraphBuilder.java +++ b/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/builder/AbstractGraphBuilder.java @@ -6,18 +6,13 @@ import com.powsybl.sld.model.BaseGraph; import com.powsybl.sld.model.Node; -import java.util.HashMap; import java.util.Map; public abstract class AbstractGraphBuilder { private G graph; private final Map path2Node; - public AbstractGraphBuilder() { - this(new HashMap<>()); - } - - public AbstractGraphBuilder(Map path2Node) { + protected AbstractGraphBuilder(Map path2Node) { this.path2Node = path2Node; } From 4e21c1f59baeb023e2459894a0cdb7f72abc46b0 Mon Sep 17 00:00:00 2001 From: Dennis Labordus Date: Tue, 11 Jan 2022 12:17:37 +0100 Subject: [PATCH 13/20] Small sonar issues fixed. Signed-off-by: Dennis Labordus --- .../scl/auto/alignment/exception/SclAutoAlignmentErrorCode.java | 1 - 1 file changed, 1 deletion(-) diff --git a/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/exception/SclAutoAlignmentErrorCode.java b/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/exception/SclAutoAlignmentErrorCode.java index 369aa34..8e587f3 100644 --- a/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/exception/SclAutoAlignmentErrorCode.java +++ b/service/src/main/java/org/lfenergy/compas/scl/auto/alignment/exception/SclAutoAlignmentErrorCode.java @@ -12,5 +12,4 @@ public class SclAutoAlignmentErrorCode { public static final String SUBSTATION_NOT_FOUND_ERROR_CODE = "SAA-0002"; public static final String NO_VOLTAGE_FOUND_ERROR_CODE = "SAA-0003"; public static final String VOLTAGELEVEL_NOT_FOUND_ERROR_CODE = "SAA-0004"; - public static final String ZONE_NOT_SUPPORTED_ERROR_CODE = "SAA-0005"; } From 3982d125812abe196a60a4a358e592337188864c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Jan 2022 17:24:40 +0000 Subject: [PATCH 14/20] Bump maven-jar-plugin from 3.2.1 to 3.2.2 Bumps [maven-jar-plugin](https://github.com/apache/maven-jar-plugin) from 3.2.1 to 3.2.2. - [Release notes](https://github.com/apache/maven-jar-plugin/releases) - [Commits](https://github.com/apache/maven-jar-plugin/compare/maven-jar-plugin-3.2.1...maven-jar-plugin-3.2.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-jar-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5027ca1..8550513 100644 --- a/pom.xml +++ b/pom.xml @@ -148,7 +148,7 @@ SPDX-License-Identifier: Apache-2.0 org.apache.maven.plugins maven-jar-plugin - 3.2.1 + 3.2.2 From d72273d0caa08ced174401117b252039a7514d1b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Jan 2022 17:24:45 +0000 Subject: [PATCH 15/20] Bump maven-compiler-plugin from 3.8.1 to 3.9.0 Bumps [maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.8.1 to 3.9.0. - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.8.1...maven-compiler-plugin-3.9.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-compiler-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5027ca1..d589844 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ SPDX-License-Identifier: Apache-2.0 UTF-8 UTF-8 - 3.8.1 + 3.9.0 3.0.0-M5 3.2.0 From ed77c380c0e205364e4d80963c0aac1f11f64bbb Mon Sep 17 00:00:00 2001 From: Dennis Labordus Date: Thu, 13 Jan 2022 09:27:10 +0100 Subject: [PATCH 16/20] Configure release note generation. Signed-off-by: Dennis Labordus --- .github/release.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/release.yml diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..f22bd30 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,23 @@ +# SPDX-FileCopyrightText: 2021 Alliander N.V. +# +# SPDX-License-Identifier: Apache-2.0 + +changelog: + exclude: + labels: + - wontfix + - duplicate + - invalid + categories: + - title: New Features + labels: + - enhancement + - title: Bugfixes + labels: + - bug + - title: Dependency updates + labels: + - dependencies + - title: Other Changes + labels: + - "*" From fc813c58e8dddad63680c38d4c52350d9c323a5b Mon Sep 17 00:00:00 2001 From: Dennis Labordus Date: Thu, 13 Jan 2022 09:31:01 +0100 Subject: [PATCH 17/20] Configure release note generation. Signed-off-by: Dennis Labordus --- .github/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/release.yml b/.github/release.yml index f22bd30..1f90e22 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -15,6 +15,9 @@ changelog: - title: Bugfixes labels: - bug + - title: Tooling changes + labels: + - tooling - title: Dependency updates labels: - dependencies From c939d2c681dfd418331ad6df3e982f4cb24d7fca Mon Sep 17 00:00:00 2001 From: Dennis Labordus Date: Thu, 13 Jan 2022 10:59:29 +0100 Subject: [PATCH 18/20] Configure release note generation. Signed-off-by: Dennis Labordus --- .github/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/release.yml b/.github/release.yml index 1f90e22..334fc8d 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2021 Alliander N.V. +# SPDX-FileCopyrightText: 2022 Alliander N.V. # # SPDX-License-Identifier: Apache-2.0 From 426e280b9b20d218422d57ba7716ec555c7543d1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Jan 2022 17:29:47 +0000 Subject: [PATCH 19/20] Bump slf4j-simple from 1.7.32 to 1.7.33 Bumps [slf4j-simple](https://github.com/qos-ch/slf4j) from 1.7.32 to 1.7.33. - [Release notes](https://github.com/qos-ch/slf4j/releases) - [Commits](https://github.com/qos-ch/slf4j/compare/v_1.7.32...v_1.7.33) --- updated-dependencies: - dependency-name: org.slf4j:slf4j-simple dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0a37770..79d851d 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ SPDX-License-Identifier: Apache-2.0 0.7.0 2.6.2.Final - 1.7.32 + 1.7.33 2.7.0 2.8.9 0.9.1 From 1090583aa2f72f752206ce5aedc7c2f474692356 Mon Sep 17 00:00:00 2001 From: Flurb Date: Sun, 16 Jan 2022 23:57:34 +0100 Subject: [PATCH 20/20] Added Dependabot PR fix Signed-off-by: Flurb --- .github/workflows/automate-projects.yml | 8 +++++--- .github/workflows/sonarcloud-analysis.yml | 6 ++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/automate-projects.yml b/.github/workflows/automate-projects.yml index d1418c3..a34159b 100644 --- a/.github/workflows/automate-projects.yml +++ b/.github/workflows/automate-projects.yml @@ -4,11 +4,13 @@ name: Add issues and pull request to project boards -on: [ issues, pull_request ] +on: [ issues, pull_request, pull_request_target ] jobs: github-actions-automate-projects: runs-on: ubuntu-latest + + if: ${{ (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }} steps: - name: add-new-issues-to-repository-based-project-column uses: docker://takanabe/github-actions-automate-projects:v0.0.1 @@ -19,7 +21,7 @@ jobs: GITHUB_PROJECT_COLUMN_NAME: To do - name: add-new-pull-request-to-repository-based-project-column uses: docker://takanabe/github-actions-automate-projects:v0.0.1 - if: github.event_name == 'pull_request' && github.event.action == 'opened' + if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action == 'opened' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_PROJECT_URL: https://github.com/com-pas/compas-scl-auto-alignment/projects/1 @@ -33,7 +35,7 @@ jobs: GITHUB_PROJECT_COLUMN_NAME: To do - name: add-new-pull-request-to-organization-based-project-column uses: docker://takanabe/github-actions-automate-projects:v0.0.1 - if: github.event_name == 'pull_request' && github.event.action == 'opened' + if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action == 'opened' env: GITHUB_TOKEN: ${{ secrets.ORG_GITHUB_ACTION_SECRET }} GITHUB_PROJECT_URL: https://github.com/orgs/com-pas/projects/2 diff --git a/.github/workflows/sonarcloud-analysis.yml b/.github/workflows/sonarcloud-analysis.yml index 46f5c66..eb77c5a 100644 --- a/.github/workflows/sonarcloud-analysis.yml +++ b/.github/workflows/sonarcloud-analysis.yml @@ -12,6 +12,10 @@ on: branches: - 'main' - 'develop' + pull_request_target: + branches: + - 'main' + - 'develop' jobs: build: @@ -19,6 +23,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 + if: ${{ (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }} steps: - name: Checkout uses: actions/checkout@v2 @@ -58,4 +63,5 @@ jobs: -Dsonar.projectKey=com-pas_compas-scl-auto-alignment \ -Dsonar.organization=com-pas \ -Dsonar.host.url=https://sonarcloud.io \ + -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar