From 77a758d2bb1960f4a9cefeec2b356f6c4229ef90 Mon Sep 17 00:00:00 2001 From: Florian Dupuy <66690739+flo-dup@users.noreply.github.com> Date: Wed, 11 Dec 2024 10:06:20 +0100 Subject: [PATCH] CGMES: fictitious voltage levels marked as fictitious (#3249) * CGMES: fictitious voltage levels are marked as fictitious * Enrich existing unit test Signed-off-by: Florian Dupuy --- .../src/main/java/com/powsybl/cgmes/conversion/Conversion.java | 1 + .../cgmes/conversion/test/NodeContainerMappingTest.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/Conversion.java b/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/Conversion.java index 628f4a8d15d..757dd5787ac 100644 --- a/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/Conversion.java +++ b/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/Conversion.java @@ -639,6 +639,7 @@ private void createFictitiousVoltageLevelsForLineContainer(Context context, Stri .setLowVoltageLimit(vlref.getLowVoltageLimit()) .setHighVoltageLimit(vlref.getHighVoltageLimit()) .setId(fictitiousVoltageLevelId) + .setFictitious(true) .setName(containerName) .setEnsureIdUnicity(context.config().isEnsureIdAliasUnicity()) .add(); diff --git a/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/NodeContainerMappingTest.java b/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/NodeContainerMappingTest.java index 4563ba35e85..0cf36afb930 100644 --- a/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/NodeContainerMappingTest.java +++ b/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/NodeContainerMappingTest.java @@ -97,12 +97,15 @@ void chainedLineSegmentsTest() { assertNotNull(network); assertEquals(Set.of("VL_1", "VL_2", "LN_12_VL"), network.getVoltageLevelStream().map(Identifiable::getId).collect(Collectors.toSet())); + assertTrue(network.getVoltageLevel("LN_12_VL").isFictitious()); importParams.put(CgmesImport.CREATE_FICTITIOUS_VOLTAGE_LEVEL_FOR_EVERY_NODE, "true"); network = readCgmesResources(importParams, DIR, "chained_line_segments.xml"); assertNotNull(network); assertEquals(Set.of("VL_1", "VL_2", "CN_A_VL", "CN_B_VL"), network.getVoltageLevelStream().map(Identifiable::getId).collect(Collectors.toSet())); + assertTrue(network.getVoltageLevel("CN_A_VL").isFictitious()); + assertTrue(network.getVoltageLevel("CN_B_VL").isFictitious()); } @Test