-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SLD] Detect inconsistent busNodes positions (#573)
* Add unit test * Detect conflicting BusNodes when creating Subsections * Problematic externCell detected beforehand, laid out at x=0 as squashed Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
- Loading branch information
Showing
5 changed files
with
339 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...line-diagram-core/src/test/java/com/powsybl/sld/iidm/TestCaseExternCellOnTwoSections.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/** | ||
* Copyright (c) 2023, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
* SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
package com.powsybl.sld.iidm; | ||
|
||
import com.powsybl.diagram.test.Networks; | ||
import com.powsybl.iidm.network.Country; | ||
import com.powsybl.iidm.network.Network; | ||
import com.powsybl.iidm.network.SwitchKind; | ||
import com.powsybl.iidm.network.TopologyKind; | ||
import com.powsybl.iidm.network.extensions.ConnectablePosition; | ||
import com.powsybl.sld.builders.NetworkGraphBuilder; | ||
import com.powsybl.sld.model.graphs.VoltageLevelGraph; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
/** | ||
* <PRE> | ||
* l | ||
* | | ||
* ___ b ____ | ||
* | | | ||
* | | | ||
* --d1-- x --d2-- | ||
* bbs1 dc bbs2 | ||
* </PRE> | ||
* | ||
* @author Florian Dupuy {@literal <florian.dupuy at rte-france.com>} | ||
*/ | ||
class TestCaseExternCellOnTwoSections extends AbstractTestCaseIidm { | ||
|
||
@BeforeEach | ||
public void setUp() { | ||
network = Network.create("test", "test"); | ||
graphBuilder = new NetworkGraphBuilder(network); | ||
substation = Networks.createSubstation(network, "s", "s", Country.FR); | ||
vl = Networks.createVoltageLevel(substation, "vl", "vl", TopologyKind.NODE_BREAKER, 225); | ||
Networks.createBusBarSection(vl, "bbs1", "bbs1", 0, 1, 1); | ||
Networks.createBusBarSection(vl, "bbs2", "bbs2", 1, 1, 2); | ||
Networks.createLoad(vl, "l", "l", "l", 0, ConnectablePosition.Direction.TOP, 2, 10, 10); | ||
Networks.createSwitch(vl, "d1", "d1", SwitchKind.DISCONNECTOR, false, false, false, 0, 3); | ||
Networks.createSwitch(vl, "d2", "d2", SwitchKind.DISCONNECTOR, false, false, false, 1, 3); | ||
Networks.createSwitch(vl, "dc", "dc", SwitchKind.DISCONNECTOR, false, false, false, 0, 1); | ||
Networks.createSwitch(vl, "b", "b", SwitchKind.BREAKER, false, false, false, 3, 2); | ||
} | ||
|
||
@Test | ||
void test() { | ||
VoltageLevelGraph g = graphBuilder.buildVoltageLevelGraph(vl.getId()); | ||
voltageLevelGraphLayout(g); | ||
assertEquals(toString("/TestCaseExternCellOnTwoSections.svg"), toSVG(g, "/TestCaseExternCellOnTwoSections.svg")); | ||
} | ||
} |
237 changes: 237 additions & 0 deletions
237
...single-line-diagram-core/src/test/resources/TestCaseExternCellOnTwoSections.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.