-
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.
CGMES 3.0: cim:Jumper support (#3235)
* Add cim:Jumper support for CGMES 3.0 * Fix duplicate in groundTest * Add unit test Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
- Loading branch information
Showing
5 changed files
with
151 additions
and
4 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
37 changes: 37 additions & 0 deletions
37
...gmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/SwitchConversionTest.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,37 @@ | ||
/** | ||
* 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.test; | ||
|
||
import com.powsybl.cgmes.conversion.Conversion; | ||
import com.powsybl.commons.test.AbstractSerDeTest; | ||
import com.powsybl.iidm.network.Network; | ||
import com.powsybl.iidm.network.Switch; | ||
import com.powsybl.iidm.network.SwitchKind; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
/** | ||
* @author Florian Dupuy {@literal <florian.dupuy at rte-france.com>} | ||
*/ | ||
|
||
class SwitchConversionTest extends AbstractSerDeTest { | ||
|
||
@Test | ||
void jumperImportTest() { | ||
Network network = Network.read("jumperTest.xml", getClass().getResourceAsStream("/jumperTest.xml")); | ||
|
||
Switch aswitch = network.getSwitch("Jumper"); | ||
assertEquals(SwitchKind.DISCONNECTOR, aswitch.getKind()); | ||
assertEquals("Jumper", aswitch.getProperty(Conversion.CGMES_PREFIX_ALIAS_PROPERTIES + "switchType")); | ||
assertEquals("opened jumper", aswitch.getNameOrId()); | ||
assertTrue(aswitch.isOpen()); | ||
assertFalse(aswitch.isRetained()); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<rdf:RDF xmlns:base="urn:uuid:" xmlns:cim="http://iec.ch/TC57/CIM100#" xmlns:md="http://iec.ch/TC57/61970-552/ModelDescription/1#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> | ||
<md:FullModel rdf:about="urn:uuid:test"> | ||
<md:Model.scenarioTime>2023-01-01T00:00:00Z</md:Model.scenarioTime> | ||
<md:Model.created>2023-01-01T00:00:00Z</md:Model.created> | ||
<md:Model.description>Test Jumper import</md:Model.description> | ||
<md:Model.version>1</md:Model.version> | ||
<md:Model.profile>http://iec.ch/TC57/ns/CIM/CoreEquipment-EU/3.0</md:Model.profile> | ||
<md:Model.profile>http://iec.ch/TC57/ns/CIM/Operation-EU/3.0</md:Model.profile> | ||
<md:Model.modelingAuthoritySet>http://powsybl.org</md:Model.modelingAuthoritySet> | ||
</md:FullModel> | ||
<cim:GeographicalRegion rdf:ID="_Region"> | ||
<cim:IdentifiedObject.name>Region</cim:IdentifiedObject.name> | ||
</cim:GeographicalRegion> | ||
<cim:SubGeographicalRegion rdf:ID="_SubRegion"> | ||
<cim:SubGeographicalRegion.Region rdf:resource="#_Region"/> | ||
<cim:IdentifiedObject.name>SubRegion</cim:IdentifiedObject.name> | ||
</cim:SubGeographicalRegion> | ||
<cim:BaseVoltage rdf:ID="_BaseVoltage67"> | ||
<cim:BaseVoltage.nominalVoltage>67.5</cim:BaseVoltage.nominalVoltage> | ||
<cim:IdentifiedObject.name>67.5</cim:IdentifiedObject.name> | ||
</cim:BaseVoltage> | ||
<cim:Substation rdf:ID="_Substation"> | ||
<cim:Substation.Region rdf:resource="#_SubRegion"/> | ||
<cim:IdentifiedObject.name>Substation</cim:IdentifiedObject.name> | ||
</cim:Substation> | ||
<cim:VoltageLevel rdf:ID="_VoltageLevel"> | ||
<cim:VoltageLevel.BaseVoltage rdf:resource="#_BaseVoltage67"/> | ||
<cim:VoltageLevel.Substation rdf:resource="#_Substation"/> | ||
<cim:IdentifiedObject.name>VoltageLevel</cim:IdentifiedObject.name> | ||
</cim:VoltageLevel> | ||
<cim:BusbarSection rdf:ID="_BBS"> | ||
<cim:Equipment.EquipmentContainer rdf:resource="#_VoltageLevel"/> | ||
<cim:IdentifiedObject.name>BBS</cim:IdentifiedObject.name> | ||
</cim:BusbarSection> | ||
<cim:Terminal rdf:ID="_BBS_T"> | ||
<cim:Terminal.ConnectivityNode rdf:resource="#_BBS_CN"/> | ||
<cim:Terminal.ConductingEquipment rdf:resource="#_BBS"/> | ||
<cim:ACDCTerminal.sequenceNumber>1</cim:ACDCTerminal.sequenceNumber> | ||
<cim:IdentifiedObject.name>BBS Terminal</cim:IdentifiedObject.name> | ||
</cim:Terminal> | ||
<cim:ConnectivityNode rdf:ID="_BBS_CN"> | ||
<cim:ConnectivityNode.ConnectivityNodeContainer rdf:resource="#_VoltageLevel"/> | ||
<cim:IdentifiedObject.name>BBS ConnectivityNode</cim:IdentifiedObject.name> | ||
</cim:ConnectivityNode> | ||
<cim:EnergyConsumer rdf:ID="_Load"> | ||
<cim:IdentifiedObject.name>Load</cim:IdentifiedObject.name> | ||
<cim:Equipment.EquipmentContainer rdf:resource="#_VoltageLevel"/> | ||
</cim:EnergyConsumer> | ||
<cim:Terminal rdf:ID="_Load_T"> | ||
<cim:Terminal.ConnectivityNode rdf:resource="#_Load_CN"/> | ||
<cim:Terminal.ConductingEquipment rdf:resource="#_Load"/> | ||
<cim:ACDCTerminal.sequenceNumber>1</cim:ACDCTerminal.sequenceNumber> | ||
<cim:IdentifiedObject.name>Load Terminal</cim:IdentifiedObject.name> | ||
</cim:Terminal> | ||
<cim:ConnectivityNode rdf:ID="_Load_CN"> | ||
<cim:ConnectivityNode.ConnectivityNodeContainer rdf:resource="#_VoltageLevel"/> | ||
<cim:IdentifiedObject.name>Load ConnectivityNode</cim:IdentifiedObject.name> | ||
</cim:ConnectivityNode> | ||
<cim:Jumper rdf:ID="_Jumper"> | ||
<cim:Switch.normalOpen>true</cim:Switch.normalOpen> | ||
<cim:Switch.retained>false</cim:Switch.retained> | ||
<cim:Equipment.EquipmentContainer rdf:resource="#_VoltageLevel"/> | ||
<cim:IdentifiedObject.name>opened jumper</cim:IdentifiedObject.name> | ||
</cim:Jumper> | ||
<cim:Terminal rdf:ID="_Jumper_T1"> | ||
<cim:Terminal.ConnectivityNode rdf:resource="#_BBS_CN"/> | ||
<cim:Terminal.ConductingEquipment rdf:resource="#_Jumper"/> | ||
<cim:ACDCTerminal.sequenceNumber>1</cim:ACDCTerminal.sequenceNumber> | ||
<cim:IdentifiedObject.name>Jumper Terminal1</cim:IdentifiedObject.name> | ||
</cim:Terminal> | ||
<cim:Terminal rdf:ID="_Jumper_T2"> | ||
<cim:Terminal.ConnectivityNode rdf:resource="#_Load_CN"/> | ||
<cim:Terminal.ConductingEquipment rdf:resource="#_Jumper"/> | ||
<cim:ACDCTerminal.sequenceNumber>2</cim:ACDCTerminal.sequenceNumber> | ||
<cim:IdentifiedObject.name>Jumper Terminal2</cim:IdentifiedObject.name> | ||
</cim:Terminal> | ||
</rdf:RDF> |
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