-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Luma <zamarrenolm@aia.es> Co-authored-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
- Loading branch information
1 parent
3a1881c
commit e72bdde
Showing
10 changed files
with
563 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
32 changes: 32 additions & 0 deletions
32
...gmes-conversion/src/main/java/com/powsybl/cgmes/conversion/elements/GroundConversion.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,32 @@ | ||
/** | ||
Copyright (c) 2024, 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.cgmes.conversion.elements; | ||
|
||
import com.powsybl.cgmes.conversion.Context; | ||
import com.powsybl.iidm.network.*; | ||
import com.powsybl.triplestore.api.PropertyBag; | ||
|
||
/** | ||
* @author Luma Zamarreño {@literal <zamarrenolm at aia.es>} | ||
*/ | ||
public class GroundConversion extends AbstractConductingEquipmentConversion { | ||
|
||
public GroundConversion(PropertyBag ec, Context context) { | ||
super("Ground", ec, context); | ||
} | ||
|
||
@Override | ||
public void convert() { | ||
GroundAdder adder = voltageLevel().newGround(); | ||
identify(adder); | ||
connect(adder); | ||
Ground g = adder.add(); | ||
addAliasesAndProperties(g); | ||
convertedTerminals(g.getTerminal()); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
...gmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/GroundConversionTest.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,38 @@ | ||
/** | ||
* 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.cgmes.conversion.test; | ||
|
||
import com.powsybl.iidm.network.Ground; | ||
import com.powsybl.iidm.network.Network; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
/** | ||
* @author Sophie Frasnedo {@literal <sophie.frasnedo at rte-france.com>} | ||
*/ | ||
|
||
class GroundConversionTest { | ||
|
||
@Test | ||
void groundConversionTest() { | ||
Network network = Network.read("groundTest.xml", getClass().getResourceAsStream("/groundTest.xml")); | ||
|
||
assertEquals(2, network.getGroundCount()); | ||
|
||
assertNotNull(network.getGround("OU")); | ||
|
||
Ground groundCV = network.getGround("CV"); | ||
assertNotNull(groundCV); | ||
assertEquals("CW", groundCV.getNameOrId()); | ||
assertNotNull(groundCV.getTerminal()); | ||
assertFalse(groundCV.getTerminal().isConnected()); | ||
assertEquals("S", groundCV.getTerminal().getVoltageLevel().getId()); | ||
} | ||
} |
466 changes: 466 additions & 0 deletions
466
cgmes/cgmes-conversion/src/test/resources/groundTest.xml
Large diffs are not rendered by default.
Oops, something went wrong.
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
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