From cad89040019bef215b066cdceda0f64e35dc150a Mon Sep 17 00:00:00 2001 From: Joris Mancini Date: Tue, 2 Sep 2025 13:11:39 +0200 Subject: [PATCH 1/5] feat: allow partial loading for branches and generators Signed-off-by: Joris Mancini --- .../network/map/NetworkMapController.java | 10 +- .../network/map/NetworkMapService.java | 36 +- .../network/map/dto/InfoTypeParameters.java | 2 + .../map/dto/mapper/BranchInfosMapper.java | 24 +- .../map/dto/mapper/GeneratorInfosMapper.java | 24 +- .../map/dto/mapper/LineInfosMapper.java | 11 +- .../TwoWindingsTransformerInfosMapper.java | 9 +- .../map/ListHandlingControllerTest.java | 2 +- .../network/map/NetworkMapControllerTest.java | 44 +- ...ansformers-tab-data-without-optionals.json | 235 ++ .../resources/all-data-without-optionals.json | 2146 +++++++++++++++++ ...generators-tab-data-without-optionals.json | 144 ++ 12 files changed, 2635 insertions(+), 52 deletions(-) create mode 100644 src/test/resources/2-windings-transformers-tab-data-without-optionals.json create mode 100644 src/test/resources/all-data-without-optionals.json create mode 100644 src/test/resources/generators-tab-data-without-optionals.json diff --git a/src/main/java/org/gridsuite/network/map/NetworkMapController.java b/src/main/java/org/gridsuite/network/map/NetworkMapController.java index 598ac8c4..b797ba67 100644 --- a/src/main/java/org/gridsuite/network/map/NetworkMapController.java +++ b/src/main/java/org/gridsuite/network/map/NetworkMapController.java @@ -19,10 +19,7 @@ import org.springframework.context.annotation.ComponentScan; import org.springframework.web.bind.annotation.*; -import java.util.Comparator; -import java.util.List; -import java.util.Optional; -import java.util.UUID; +import java.util.*; import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE; @@ -57,8 +54,9 @@ public List getElementsIds(@Parameter(description = "Network UUID") @Pat @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "all equipments descriptions")}) public AllElementsInfos getAll(@Parameter(description = "Network UUID") @PathVariable("networkUuid") UUID networkUuid, @Parameter(description = "Variant Id") @RequestParam(name = "variantId", required = false) String variantId, - @Parameter(description = "Substations id") @RequestParam(name = "substationId", defaultValue = "") List substationsIds) { - return networkMapService.getAllElementsInfos(networkUuid, variantId, substationsIds); + @Parameter(description = "Substations id") @RequestParam(name = "substationId", defaultValue = "") List substationsIds, + @Parameter(description = "Info type parameters") InfoTypeParameters infoTypeParameters) { + return networkMapService.getAllElementsInfos(networkUuid, variantId, substationsIds, infoTypeParameters); } @PostMapping(value = "/networks/{networkUuid}/elements", produces = APPLICATION_JSON_VALUE) diff --git a/src/main/java/org/gridsuite/network/map/NetworkMapService.java b/src/main/java/org/gridsuite/network/map/NetworkMapService.java index 12bb7b5f..6b756007 100644 --- a/src/main/java/org/gridsuite/network/map/NetworkMapService.java +++ b/src/main/java/org/gridsuite/network/map/NetworkMapService.java @@ -61,26 +61,26 @@ private List getSubstationsIds(UUID networkUuid, String variantId, List< .map(Substation::getId).toList(); } - public AllElementsInfos getAllElementsInfos(UUID networkUuid, String variantId, @NonNull List substationsId) { + public AllElementsInfos getAllElementsInfos(UUID networkUuid, String variantId, @NonNull List substationsId, InfoTypeParameters infoTypeParameters) { Network network = getNetwork(networkUuid, PreloadingStrategy.ALL_COLLECTIONS_NEEDED_FOR_BUS_VIEW, variantId); return AllElementsInfos.builder() - .substations(getSubstationsInfos(network, substationsId, InfoTypeParameters.TAB, null)) - .voltageLevels(getVoltageLevelsInfos(network, substationsId, InfoTypeParameters.TAB, null)) - .hvdcLines(getHvdcLinesInfos(network, substationsId, InfoTypeParameters.TAB, null)) - .lines(getElementsInfos(network, substationsId, ElementType.LINE, InfoTypeParameters.TAB, null)) - .loads(getElementsInfos(network, substationsId, ElementType.LOAD, InfoTypeParameters.TAB, null)) - .generators(getElementsInfos(network, substationsId, ElementType.GENERATOR, InfoTypeParameters.TAB, null)) - .twoWindingsTransformers(getElementsInfos(network, substationsId, ElementType.TWO_WINDINGS_TRANSFORMER, InfoTypeParameters.TAB, null)) - .threeWindingsTransformers(getElementsInfos(network, substationsId, ElementType.THREE_WINDINGS_TRANSFORMER, InfoTypeParameters.TAB, null)) - .batteries(getElementsInfos(network, substationsId, ElementType.BATTERY, InfoTypeParameters.TAB, null)) - .danglingLines(getElementsInfos(network, substationsId, ElementType.DANGLING_LINE, InfoTypeParameters.TAB, null)) - .tieLines(getTieLinesInfos(network, substationsId, InfoTypeParameters.TAB, null)) - .lccConverterStations(getElementsInfos(network, substationsId, ElementType.LCC_CONVERTER_STATION, InfoTypeParameters.TAB, null)) - .shuntCompensators(getElementsInfos(network, substationsId, ElementType.SHUNT_COMPENSATOR, InfoTypeParameters.TAB, null)) - .staticVarCompensators(getElementsInfos(network, substationsId, ElementType.STATIC_VAR_COMPENSATOR, InfoTypeParameters.TAB, null)) - .vscConverterStations(getElementsInfos(network, substationsId, ElementType.VSC_CONVERTER_STATION, InfoTypeParameters.TAB, null)) - .buses(getBusesInfos(network, substationsId, InfoTypeParameters.TAB)) - .busbarSections(getElementsInfos(network, substationsId, ElementType.BUSBAR_SECTION, InfoTypeParameters.TAB, null)) + .substations(getSubstationsInfos(network, substationsId, infoTypeParameters, null)) + .voltageLevels(getVoltageLevelsInfos(network, substationsId, infoTypeParameters, null)) + .hvdcLines(getHvdcLinesInfos(network, substationsId, infoTypeParameters, null)) + .lines(getElementsInfos(network, substationsId, ElementType.LINE, infoTypeParameters, null)) + .loads(getElementsInfos(network, substationsId, ElementType.LOAD, infoTypeParameters, null)) + .generators(getElementsInfos(network, substationsId, ElementType.GENERATOR, infoTypeParameters, null)) + .twoWindingsTransformers(getElementsInfos(network, substationsId, ElementType.TWO_WINDINGS_TRANSFORMER, infoTypeParameters, null)) + .threeWindingsTransformers(getElementsInfos(network, substationsId, ElementType.THREE_WINDINGS_TRANSFORMER, infoTypeParameters, null)) + .batteries(getElementsInfos(network, substationsId, ElementType.BATTERY, infoTypeParameters, null)) + .danglingLines(getElementsInfos(network, substationsId, ElementType.DANGLING_LINE, infoTypeParameters, null)) + .tieLines(getTieLinesInfos(network, substationsId, infoTypeParameters, null)) + .lccConverterStations(getElementsInfos(network, substationsId, ElementType.LCC_CONVERTER_STATION, infoTypeParameters, null)) + .shuntCompensators(getElementsInfos(network, substationsId, ElementType.SHUNT_COMPENSATOR, infoTypeParameters, null)) + .staticVarCompensators(getElementsInfos(network, substationsId, ElementType.STATIC_VAR_COMPENSATOR, infoTypeParameters, null)) + .vscConverterStations(getElementsInfos(network, substationsId, ElementType.VSC_CONVERTER_STATION, infoTypeParameters, null)) + .buses(getBusesInfos(network, substationsId, infoTypeParameters)) + .busbarSections(getElementsInfos(network, substationsId, ElementType.BUSBAR_SECTION, infoTypeParameters, null)) .build(); } diff --git a/src/main/java/org/gridsuite/network/map/dto/InfoTypeParameters.java b/src/main/java/org/gridsuite/network/map/dto/InfoTypeParameters.java index 300424f1..30bf4d7d 100644 --- a/src/main/java/org/gridsuite/network/map/dto/InfoTypeParameters.java +++ b/src/main/java/org/gridsuite/network/map/dto/InfoTypeParameters.java @@ -14,6 +14,8 @@ @Data public class InfoTypeParameters { public static final String QUERY_PARAM_DC_POWERFACTOR = "dcPowerFactor"; + public static final String QUERY_PARAM_LOAD_OPERATIONAL_LIMIT_GROUPS = "loadOperationalLimitGroups"; + public static final String QUERY_PARAM_LOAD_REGULATING_TERMINALS = "loadRegulatingTerminals"; public static final InfoTypeParameters TAB = new InfoTypeParameters(ElementInfos.InfoType.TAB, null); diff --git a/src/main/java/org/gridsuite/network/map/dto/mapper/BranchInfosMapper.java b/src/main/java/org/gridsuite/network/map/dto/mapper/BranchInfosMapper.java index 940fe143..1d07eb05 100644 --- a/src/main/java/org/gridsuite/network/map/dto/mapper/BranchInfosMapper.java +++ b/src/main/java/org/gridsuite/network/map/dto/mapper/BranchInfosMapper.java @@ -26,6 +26,7 @@ import java.util.stream.Stream; import static org.gridsuite.network.map.dto.InfoTypeParameters.QUERY_PARAM_DC_POWERFACTOR; +import static org.gridsuite.network.map.dto.InfoTypeParameters.QUERY_PARAM_LOAD_OPERATIONAL_LIMIT_GROUPS; import static org.gridsuite.network.map.dto.common.CurrentLimitsData.Applicability.SIDE1; import static org.gridsuite.network.map.dto.common.CurrentLimitsData.Applicability.SIDE2; import static org.gridsuite.network.map.dto.utils.ElementUtils.mapCountry; @@ -39,14 +40,19 @@ public static ElementInfos toData(@NonNull final Identifiable identifiable, final Branch branch = (Branch) identifiable; final Double dcPowerFactor = Optional.ofNullable(infoTypeParameters.getOptionalParameters().get(QUERY_PARAM_DC_POWERFACTOR)) .map(Double::valueOf).orElse(null); + final Boolean loadOperationalLimitGroups = Optional.ofNullable(infoTypeParameters.getOptionalParameters().get(QUERY_PARAM_LOAD_OPERATIONAL_LIMIT_GROUPS)) + .map(Boolean::valueOf).orElse(false); return switch (infoTypeParameters.getInfoType()) { - case TAB -> toTabInfos(branch, dcPowerFactor); + case TAB -> toTabInfos(branch, dcPowerFactor, loadOperationalLimitGroups); default -> throw new UnsupportedOperationException("TODO"); }; } protected static> B toTabBuilder( - @NonNull final B builder, @NonNull final Branch branch, @Nullable final Double dcPowerFactor + @NonNull final B builder, + @NonNull final Branch branch, + @Nullable final Double dcPowerFactor, + @NonNull final Boolean loadOperationalLimitGroups ) { /* even if x & r properties are in branch properties doc, it is not in branch getter but each impls... */ //TODO https://github.com/powsybl/powsybl-core/issues/3521 tagged for release 09/2025 @@ -66,14 +72,16 @@ public static ElementInfos toData(@NonNull final Identifiable identifiable, // common properties final Terminal terminal1 = branch.getTerminal1(); final Terminal terminal2 = branch.getTerminal2(); - final Map mapOperationalLimitsGroup1 = buildCurrentLimitsMap(branch.getOperationalLimitsGroups1()); - builder.operationalLimitsGroup1(mapOperationalLimitsGroup1) + if (loadOperationalLimitGroups) { + final Map mapOperationalLimitsGroup1 = buildCurrentLimitsMap(branch.getOperationalLimitsGroups1()); + builder.operationalLimitsGroup1(mapOperationalLimitsGroup1) .operationalLimitsGroup1Names(List.copyOf(mapOperationalLimitsGroup1.keySet())) .selectedOperationalLimitsGroup1(branch.getSelectedOperationalLimitsGroupId1().orElse(null)); - final Map mapOperationalLimitsGroup2 = buildCurrentLimitsMap(branch.getOperationalLimitsGroups2()); - builder.operationalLimitsGroup2(mapOperationalLimitsGroup2) + final Map mapOperationalLimitsGroup2 = buildCurrentLimitsMap(branch.getOperationalLimitsGroups2()); + builder.operationalLimitsGroup2(mapOperationalLimitsGroup2) .operationalLimitsGroup2Names(List.copyOf(mapOperationalLimitsGroup2.keySet())) .selectedOperationalLimitsGroup2(branch.getSelectedOperationalLimitsGroupId2().orElse(null)); + } //noinspection unchecked return (B) builder .type(branch.getType().name()) @@ -106,9 +114,9 @@ public static ElementInfos toData(@NonNull final Identifiable identifiable, .operatingStatus(ExtensionUtils.toOperatingStatus(branch)); } - private static BranchTabInfos toTabInfos(@NonNull final Branch branch, @Nullable final Double dcPowerFactor) { + private static BranchTabInfos toTabInfos(@NonNull final Branch branch, @Nullable final Double dcPowerFactor, @NonNull final Boolean loadOperationalLimitGroups) { /// Why is {@link BranchTabInfos#builder()} return wildcards in return type {@code BranchTabInfosBuilder} - return toTabBuilder((BranchTabInfosBuilder) BranchTabInfos.builder(), branch, dcPowerFactor).build(); + return toTabBuilder((BranchTabInfosBuilder) BranchTabInfos.builder(), branch, dcPowerFactor, loadOperationalLimitGroups).build(); } private static Map buildCurrentLimitsMap(@NonNull final Collection operationalLimitsGroups) { diff --git a/src/main/java/org/gridsuite/network/map/dto/mapper/GeneratorInfosMapper.java b/src/main/java/org/gridsuite/network/map/dto/mapper/GeneratorInfosMapper.java index ab006395..b6e5c0c2 100644 --- a/src/main/java/org/gridsuite/network/map/dto/mapper/GeneratorInfosMapper.java +++ b/src/main/java/org/gridsuite/network/map/dto/mapper/GeneratorInfosMapper.java @@ -30,6 +30,7 @@ import java.util.Optional; import java.util.stream.Collectors; +import static org.gridsuite.network.map.dto.InfoTypeParameters.QUERY_PARAM_LOAD_REGULATING_TERMINALS; import static org.gridsuite.network.map.dto.utils.ElementUtils.*; /** @@ -42,8 +43,10 @@ private GeneratorInfosMapper() { } public static ElementInfos toData(Identifiable identifiable, InfoTypeParameters infoTypeParameters) { + Boolean loadRegulatingTerminals = Optional.ofNullable(infoTypeParameters.getOptionalParameters().get(QUERY_PARAM_LOAD_REGULATING_TERMINALS)) + .map(Boolean::valueOf).orElse(false); return switch (infoTypeParameters.getInfoType()) { - case TAB -> toTabInfos(identifiable); + case TAB -> toTabInfos(identifiable, loadRegulatingTerminals); case FORM -> toFormInfos(identifiable); case LIST -> ElementInfosMapper.toInfosWithType(identifiable); default -> throw new UnsupportedOperationException("TODO"); @@ -60,7 +63,7 @@ private static List getReactiveCapabilityCurvePo .collect(Collectors.toList()); } - private static GeneratorTabInfos toTabInfos(Identifiable identifiable) { + private static GeneratorTabInfos toTabInfos(Identifiable identifiable, Boolean loadRegulatingTerminals) { Generator generator = (Generator) identifiable; Terminal terminal = generator.getTerminal(); GeneratorTabInfos.GeneratorTabInfosBuilder builder = GeneratorTabInfos.builder() @@ -87,14 +90,17 @@ private static GeneratorTabInfos toTabInfos(Identifiable identifiable) { .generatorShortCircuit(toGeneratorShortCircuit(generator)) .generatorStartup(toGeneratorStartup(generator)); - Terminal regulatingTerminal = generator.getRegulatingTerminal(); - //If there is no regulating terminal in file, regulating terminal voltage level is equal to generator voltage level - if (regulatingTerminal != null && !regulatingTerminal.getVoltageLevel().equals(terminal.getVoltageLevel())) { - builder.regulatingTerminalVlName(regulatingTerminal.getVoltageLevel().getOptionalName().orElse(null)); - builder.regulatingTerminalConnectableId(regulatingTerminal.getConnectable().getId()); - builder.regulatingTerminalConnectableType(regulatingTerminal.getConnectable().getType().name()); - builder.regulatingTerminalVlId(regulatingTerminal.getVoltageLevel().getId()); + if (loadRegulatingTerminals) { + Terminal regulatingTerminal = generator.getRegulatingTerminal(); + //If there is no regulating terminal in file, regulating terminal voltage level is equal to generator voltage level + if (regulatingTerminal != null && !regulatingTerminal.getVoltageLevel().equals(terminal.getVoltageLevel())) { + builder.regulatingTerminalVlName(regulatingTerminal.getVoltageLevel().getOptionalName().orElse(null)); + builder.regulatingTerminalConnectableId(regulatingTerminal.getConnectable().getId()); + builder.regulatingTerminalConnectableType(regulatingTerminal.getConnectable().getType().name()); + builder.regulatingTerminalVlId(regulatingTerminal.getVoltageLevel().getId()); + } } + ReactiveLimits reactiveLimits = generator.getReactiveLimits(); if (reactiveLimits != null) { ReactiveLimitsKind limitsKind = reactiveLimits.getKind(); diff --git a/src/main/java/org/gridsuite/network/map/dto/mapper/LineInfosMapper.java b/src/main/java/org/gridsuite/network/map/dto/mapper/LineInfosMapper.java index 5a07e51e..2bc1ae9b 100644 --- a/src/main/java/org/gridsuite/network/map/dto/mapper/LineInfosMapper.java +++ b/src/main/java/org/gridsuite/network/map/dto/mapper/LineInfosMapper.java @@ -16,7 +16,10 @@ import org.gridsuite.network.map.dto.definition.branch.line.LineTabInfos.LineTabInfosBuilder; import org.gridsuite.network.map.dto.utils.ExtensionUtils; +import java.util.Optional; + import static org.gridsuite.network.map.dto.InfoTypeParameters.QUERY_PARAM_DC_POWERFACTOR; +import static org.gridsuite.network.map.dto.InfoTypeParameters.QUERY_PARAM_LOAD_OPERATIONAL_LIMIT_GROUPS; import static org.gridsuite.network.map.dto.utils.ElementUtils.*; /** @@ -30,8 +33,10 @@ private LineInfosMapper() { public static ElementInfos toData(Identifiable identifiable, InfoTypeParameters infoTypeParameters) { String dcPowerFactorStr = infoTypeParameters.getOptionalParameters().getOrDefault(QUERY_PARAM_DC_POWERFACTOR, null); Double dcPowerFactor = dcPowerFactorStr == null ? null : Double.valueOf(dcPowerFactorStr); + Boolean loadOperationalLimitGroups = Optional.ofNullable(infoTypeParameters.getOptionalParameters().get(QUERY_PARAM_LOAD_OPERATIONAL_LIMIT_GROUPS)) + .map(Boolean::valueOf).orElse(false); return switch (infoTypeParameters.getInfoType()) { - case TAB -> toTabInfos(identifiable, dcPowerFactor); + case TAB -> toTabInfos(identifiable, dcPowerFactor, loadOperationalLimitGroups); case FORM -> toFormInfos(identifiable); case MAP -> toMapInfos(identifiable, dcPowerFactor); case LIST -> ElementInfosMapper.toListInfos(identifiable); @@ -131,9 +136,9 @@ private static LineMapInfos toMapInfos(Identifiable identifiable, Double dcPo return builder.build(); } - private static LineTabInfos toTabInfos(Identifiable identifiable, Double dcPowerFactor) { + private static LineTabInfos toTabInfos(Identifiable identifiable, Double dcPowerFactor, Boolean loadOperationalLimitGroups) { final Line line = (Line) identifiable; - return toTabBuilder((LineTabInfosBuilder) LineTabInfos.builder(), line, dcPowerFactor) + return toTabBuilder((LineTabInfosBuilder) LineTabInfos.builder(), line, dcPowerFactor, loadOperationalLimitGroups) .g1(line.getG1()) .b1(line.getB1()) .g2(line.getG2()) diff --git a/src/main/java/org/gridsuite/network/map/dto/mapper/TwoWindingsTransformerInfosMapper.java b/src/main/java/org/gridsuite/network/map/dto/mapper/TwoWindingsTransformerInfosMapper.java index eb4d6c65..b4039e56 100644 --- a/src/main/java/org/gridsuite/network/map/dto/mapper/TwoWindingsTransformerInfosMapper.java +++ b/src/main/java/org/gridsuite/network/map/dto/mapper/TwoWindingsTransformerInfosMapper.java @@ -28,6 +28,7 @@ import java.util.Optional; import static org.gridsuite.network.map.dto.InfoTypeParameters.QUERY_PARAM_DC_POWERFACTOR; +import static org.gridsuite.network.map.dto.InfoTypeParameters.QUERY_PARAM_LOAD_OPERATIONAL_LIMIT_GROUPS; import static org.gridsuite.network.map.dto.utils.ElementUtils.*; /** @@ -41,11 +42,13 @@ private TwoWindingsTransformerInfosMapper() { public static ElementInfos toData(Identifiable identifiable, InfoTypeParameters infoTypeParameters) { String dcPowerFactorStr = infoTypeParameters.getOptionalParameters().getOrDefault(QUERY_PARAM_DC_POWERFACTOR, null); Double dcPowerFactor = dcPowerFactorStr == null ? null : Double.valueOf(dcPowerFactorStr); + Boolean loadOperationalLimitGroups = Optional.ofNullable(infoTypeParameters.getOptionalParameters().get(QUERY_PARAM_LOAD_OPERATIONAL_LIMIT_GROUPS)) + .map(Boolean::valueOf).orElse(false); return switch (infoTypeParameters.getInfoType()) { case LIST -> ElementInfosMapper.toListInfos(identifiable); case OPERATING_STATUS -> toOperatingStatusInfos(identifiable); case TOOLTIP -> toTooltipInfos(identifiable, dcPowerFactor); - case TAB -> toTabInfos(identifiable, dcPowerFactor); + case TAB -> toTabInfos(identifiable, dcPowerFactor, loadOperationalLimitGroups); case FORM -> toFormInfos(identifiable); default -> throw new UnsupportedOperationException("TODO"); }; @@ -105,9 +108,9 @@ private static TwoWindingsTransformerFormInfos toFormInfos(Identifiable ident return builder.build(); } - private static TwoWindingsTransformerTabInfos toTabInfos(Identifiable identifiable, Double dcPowerFactor) { + private static TwoWindingsTransformerTabInfos toTabInfos(Identifiable identifiable, Double dcPowerFactor, Boolean loadOperationalLimitGroups) { final TwoWindingsTransformer twoWT = (TwoWindingsTransformer) identifiable; - return toTabBuilder((TwoWindingsTransformerTabInfosBuilder) TwoWindingsTransformerTabInfos.builder(), twoWT, dcPowerFactor) + return toTabBuilder((TwoWindingsTransformerTabInfosBuilder) TwoWindingsTransformerTabInfos.builder(), twoWT, dcPowerFactor, loadOperationalLimitGroups) .country(ElementUtils.mapCountry(ElementUtils.findFirstSubstation(List.of(twoWT.getTerminal1(), twoWT.getTerminal2())))) .phaseTapChanger(toMapData(twoWT.getPhaseTapChanger())) .ratioTapChanger(toMapData(twoWT.getRatioTapChanger())) diff --git a/src/test/java/org/gridsuite/network/map/ListHandlingControllerTest.java b/src/test/java/org/gridsuite/network/map/ListHandlingControllerTest.java index cd890dda..83d89aa5 100644 --- a/src/test/java/org/gridsuite/network/map/ListHandlingControllerTest.java +++ b/src/test/java/org/gridsuite/network/map/ListHandlingControllerTest.java @@ -80,7 +80,7 @@ void getVoltageLevelEquipmentsSubstationsIds(final Optional parameter) t void getAllSubstationsIds(final Optional parameter) throws Exception { mvc.perform(requestWithOptionalSubstationId(get("/v1/networks/{networkUuid}/all", NETWORK_ID), parameter)) .andExpect(status().is2xxSuccessful()); - verify(networkMapService).getAllElementsInfos(eq(NETWORK_ID), isNull(), eq(Collections.emptyList())); + verify(networkMapService).getAllElementsInfos(eq(NETWORK_ID), isNull(), eq(Collections.emptyList()), eq(new InfoTypeParameters(null, Map.of()))); } /** Case of {@code substationsIds} for {@link NetworkMapController#getElementsInfos(UUID, String, List, ElementType, InfoTypeParameters, Optional)} */ diff --git a/src/test/java/org/gridsuite/network/map/NetworkMapControllerTest.java b/src/test/java/org/gridsuite/network/map/NetworkMapControllerTest.java index 97cdb86c..2ecc53d7 100644 --- a/src/test/java/org/gridsuite/network/map/NetworkMapControllerTest.java +++ b/src/test/java/org/gridsuite/network/map/NetworkMapControllerTest.java @@ -73,6 +73,8 @@ class NetworkMapControllerTest { public static final String QUERY_PARAM_ADDITIONAL_PARAMS = "optionalParameters"; public static final String QUERY_FORMAT_ADDITIONAL_PARAMS = QUERY_PARAM_ADDITIONAL_PARAMS + "[%s]"; public static final String QUERY_PARAM_DC_POWER_FACTOR = "dcPowerFactor"; + public static final String QUERY_PARAM_LOAD_OPERATIONAL_LIMIT_GROUPS = "loadOperationalLimitGroups"; + public static final String QUERY_PARAM_LOAD_REGULATING_TERMINALS = "loadRegulatingTerminals"; public static final String QUERY_PARAM_NOMINAL_VOLTAGES = "nominalVoltages"; @Autowired @@ -1419,10 +1421,14 @@ private void notFoundTestForElementInfos(UUID networkUuid, String variantId, Ele } private void succeedingTestForElementsInfos(UUID networkUuid, String variantId, ElementType elementType, InfoType infoType, List substationsIds, String expectedJson) throws Exception { - succeedingTestForElementsInfos(networkUuid, variantId, elementType, infoType, substationsIds, expectedJson, null); + succeedingTestForElementsInfos(networkUuid, variantId, elementType, infoType, substationsIds, expectedJson, null, true); } private void succeedingTestForElementsInfos(UUID networkUuid, String variantId, ElementType elementType, InfoType infoType, List substationsIds, String expectedJson, List nominalVoltages) throws Exception { + succeedingTestForElementsInfos(networkUuid, variantId, elementType, infoType, substationsIds, expectedJson, nominalVoltages, true); + } + + private void succeedingTestForElementsInfos(UUID networkUuid, String variantId, ElementType elementType, InfoType infoType, List substationsIds, String expectedJson, List nominalVoltages, boolean withOptionalLoading) throws Exception { LinkedMultiValueMap queryParams = new LinkedMultiValueMap<>(); queryParams.add(QUERY_PARAM_VARIANT_ID, variantId); queryParams.add(QUERY_PARAM_INFO_TYPE, infoType.name()); @@ -1433,6 +1439,10 @@ private void succeedingTestForElementsInfos(UUID networkUuid, String variantId, .toList(); queryParams.addAll(QUERY_PARAM_NOMINAL_VOLTAGES, nominalVoltageStrings); } + if (withOptionalLoading) { + queryParams.add(String.format(QUERY_FORMAT_ADDITIONAL_PARAMS, QUERY_PARAM_LOAD_OPERATIONAL_LIMIT_GROUPS), String.valueOf(true)); + queryParams.add(String.format(QUERY_FORMAT_ADDITIONAL_PARAMS, QUERY_PARAM_LOAD_REGULATING_TERMINALS), String.valueOf(true)); + } MvcResult mvcResult = mvc.perform(post("/v1/networks/{networkUuid}/elements", networkUuid) .queryParams(queryParams) .contentType(MediaType.APPLICATION_JSON) @@ -1505,19 +1515,28 @@ private void notFoundTestForElementsIds(UUID networkUuid, String variantId, Elem .andExpect(status().isNotFound()); } - private void succeedingTestForEquipmentsInfos(UUID networkUuid, String variantId, String equipmentPath, List substationsIds, String expectedJson) throws Exception { + private void succeedingTestForEquipmentsInfos(UUID networkUuid, String variantId, String equipmentPath, List substationsIds, String expectedJson, boolean withOptionalLoading) throws Exception { LinkedMultiValueMap queryParams = new LinkedMultiValueMap<>(); queryParams.add(QUERY_PARAM_VARIANT_ID, variantId); if (substationsIds != null) { queryParams.addAll(QUERY_PARAM_SUBSTATION_ID, substationsIds); } + queryParams.add(QUERY_PARAM_INFO_TYPE, InfoType.TAB.toString()); + if (withOptionalLoading) { + queryParams.add(String.format("optionalParameters[%s]", QUERY_PARAM_LOAD_OPERATIONAL_LIMIT_GROUPS), String.valueOf(true)); + queryParams.add(String.format("optionalParameters[%s]", QUERY_PARAM_LOAD_REGULATING_TERMINALS), String.valueOf(true)); + } MvcResult mvcResult = mvc.perform(get("/v1/networks/{networkUuid}/{equipmentPath}", networkUuid, equipmentPath).queryParams(queryParams)) - .andExpect(status().isOk()) - .andReturn(); + .andExpect(status().isOk()) + .andReturn(); JSONAssert.assertEquals(expectedJson, mvcResult.getResponse().getContentAsString(), JSONCompareMode.NON_EXTENSIBLE); } + private void succeedingTestForEquipmentsInfos(UUID networkUuid, String variantId, String equipmentPath, List substationsIds, String expectedJson) throws Exception { + succeedingTestForEquipmentsInfos(networkUuid, variantId, equipmentPath, substationsIds, expectedJson, true); + } + private void notFoundTestForEquipmentsInfos(UUID networkUuid, String variantId, String infosPath, List substationsIds) throws Exception { LinkedMultiValueMap queryParams = new LinkedMultiValueMap<>(); queryParams.add(QUERY_PARAM_VARIANT_ID, variantId); @@ -1832,6 +1851,11 @@ void shouldReturnAllData() throws Exception { succeedingTestForEquipmentsInfos(NETWORK_UUID, null, "all", List.of("P3", "P6"), resourceToString("/partial-all-map-data-no-redundant-lines.json")); } + @Test + void shouldReturnAllDataWithoutOptionals() throws Exception { + succeedingTestForEquipmentsInfos(NETWORK_UUID, null, "all", null, resourceToString("/all-data-without-optionals.json"), false); + } + @Test void shouldReturnNotFoundInsteadOfAllData() throws Exception { notFoundTestForEquipmentsInfos(NOT_FOUND_NETWORK_ID, null, "all", List.of()); @@ -2428,6 +2452,12 @@ void shouldReturnGeneratorsTabData() throws Exception { succeedingTestForElementsInfos(NETWORK_UUID, VARIANT_ID, ElementType.GENERATOR, InfoType.TAB, null, resourceToString("/generators-tab-data.json")); } + @Test + void shouldReturnGeneratorsTabDataWithoutOptionals() throws Exception { + succeedingTestForElementsInfos(NETWORK_UUID, null, ElementType.GENERATOR, InfoType.TAB, null, resourceToString("/generators-tab-data-without-optionals.json"), null, false); + succeedingTestForElementsInfos(NETWORK_UUID, VARIANT_ID, ElementType.GENERATOR, InfoType.TAB, null, resourceToString("/generators-tab-data-without-optionals.json"), null, false); + } + @Test void shouldReturnBatteryTabData() throws Exception { succeedingTestForElementsInfos(NETWORK_UUID, null, ElementType.BATTERY, InfoType.TAB, null, resourceToString("/batteries-tab-data.json")); @@ -2486,6 +2516,12 @@ void shouldReturnTwoWindingsTransformerTabData() throws Exception { succeedingTestForElementsInfos(NETWORK_UUID, VARIANT_ID, ElementType.TWO_WINDINGS_TRANSFORMER, InfoType.TAB, null, resourceToString("/2-windings-transformers-tab-data.json")); } + @Test + void shouldReturnTwoWindingsTransformerTabDataWithoutOptionals() throws Exception { + succeedingTestForElementsInfos(NETWORK_UUID, null, ElementType.TWO_WINDINGS_TRANSFORMER, InfoType.TAB, null, resourceToString("/2-windings-transformers-tab-data-without-optionals.json"), null, false); + succeedingTestForElementsInfos(NETWORK_UUID, VARIANT_ID, ElementType.TWO_WINDINGS_TRANSFORMER, InfoType.TAB, null, resourceToString("/2-windings-transformers-tab-data-without-optionals.json"), null, false); + } + @Test void shouldReturnTwoWindingsTransformerFormData() throws Exception { succeedingTestForElementInfosWithElementId(NETWORK_UUID, null, ElementType.TWO_WINDINGS_TRANSFORMER, InfoType.FORM, "NGEN_NHV1", resourceToString("/2-windings-transformer-map-data.json")); diff --git a/src/test/resources/2-windings-transformers-tab-data-without-optionals.json b/src/test/resources/2-windings-transformers-tab-data-without-optionals.json new file mode 100644 index 00000000..352fcce7 --- /dev/null +++ b/src/test/resources/2-windings-transformers-tab-data-without-optionals.json @@ -0,0 +1,235 @@ +[ + { + "id": "NGEN_NHV1", + "type": "TWO_WINDINGS_TRANSFORMER", + "voltageLevelId1": "VLGEN", + "voltageLevelId2": "VLHV1", + "voltageLevelName1": "VLGEN_Name", + "nominalVoltage1": 24.0, + "nominalVoltage2": 380.0, + "substationId1": "P1", + "substationId2": "P1", + "country1": "FR", + "country2": "FR", + "terminal1Connected": true, + "terminal2Connected": true, + "p1": 11.1, + "q1": 12.2, + "p2": 13.33, + "q2": 14.44, + "r": 0.26658461538461536, + "x": 11.104492831516762, + "substationProperties1": { + "Country": "FR" + }, + "voltageLevelProperties1": { + "Country": "FR" + }, + "substationProperties2": { + "Country": "FR" + }, + "operatingStatus": "PLANNED_OUTAGE", + "country": "FR", + "phaseTapChanger": { + "lowTapPosition": 0, + "tapPosition": 1, + "highTapPosition": 1, + "isRegulating": true, + "targetDeadband": 0.0, + "regulationMode": "CURRENT_LIMITER", + "regulationValue": 10.0, + "regulatingTerminalConnectableId": "NGEN_NHV1", + "regulatingTerminalConnectableType": "TWO_WINDINGS_TRANSFORMER", + "regulatingTerminalVlId": "VLGEN", + "steps": [ + { + "index": 0, + "rho": 0.8500000238418579, + "r": 0.0, + "x": 0.0, + "g": 0.0, + "b": 0.0, + "alpha": 1.0 + }, + { + "index": 1, + "rho": 0.8999999761581421, + "r": 0.0, + "x": 0.0, + "g": 0.0, + "b": 0.0, + "alpha": 1.0 + } + ] + }, + "g": 0.0, + "b": 0.0, + "ratedU1": 24.0, + "ratedU2": 400.0, + "connectablePosition1": { + "connectionDirection": "TOP", + "connectionPosition": 0, + "connectionName": "feederName1" + }, + "connectablePosition2": { + "connectionDirection": "BOTTOM", + "connectionPosition": 0, + "connectionName": "feederName2" + } + }, + { + "id": "NHV2_NLOAD", + "type": "TWO_WINDINGS_TRANSFORMER", + "voltageLevelId1": "VLHV2", + "voltageLevelId2": "VLLOAD", + "nominalVoltage1": 380.0, + "nominalVoltage2": 150.0, + "substationId1": "P2", + "substationId2": "P2", + "terminal1Connected": true, + "terminal2Connected": true, + "p1": 5.5, + "q1": 6.6, + "p2": 7.77, + "q2": 8.88, + "r": 0.04724999999999999, + "x": 4.049724365620455, + "operatingStatus": "PLANNED_OUTAGE", + "ratioTapChanger": { + "lowTapPosition": 0, + "tapPosition": 2, + "highTapPosition": 2, + "isRegulating": true, + "hasLoadTapChangingCapabilities": true, + "targetV": 158.0, + "targetDeadband": 0.0, + "regulatingTerminalConnectableId": "NHV2_NLOAD", + "regulatingTerminalConnectableType": "TWO_WINDINGS_TRANSFORMER", + "regulatingTerminalVlId": "VLLOAD", + "steps": [ + { + "index": 0, + "rho": 0.8505666905244191, + "r": 0.0, + "x": 0.0, + "g": 0.0, + "b": 0.0 + }, + { + "index": 1, + "rho": 1.0006666666666666, + "r": 0.0, + "x": 0.0, + "g": 0.0, + "b": 0.0 + }, + { + "index": 2, + "rho": 1.150766642808914, + "r": 0.0, + "x": 0.0, + "g": 0.0, + "b": 0.0 + } + ] + }, + "g": 0.0, + "b": 0.0, + "ratedU1": 400.0, + "ratedU2": 158.0, + "connectablePosition1": { + "connectionDirection": "TOP", + "connectionPosition": 0, + "connectionName": "feederName1" + }, + "connectablePosition2": { + "connectionDirection": "BOTTOM", + "connectionPosition": 0, + "connectionName": "feederName2" + } + }, + { + "id": "NGEN_NHV2", + "type": "TWO_WINDINGS_TRANSFORMER", + "voltageLevelId1": "VLGEN", + "voltageLevelId2": "VLHV1", + "voltageLevelName1": "VLGEN_Name", + "nominalVoltage1": 24.0, + "nominalVoltage2": 380.0, + "substationId1": "P1", + "substationId2": "P1", + "country1": "FR", + "country2": "FR", + "terminal1Connected": true, + "terminal2Connected": true, + "r": 47.0, + "x": 23.0, + "branchObservability": { + "qualityP1": { + "standardDeviation": 23.31, + "isRedundant": true + }, + "qualityQ1": { + "standardDeviation": 23.25, + "isRedundant": true + }, + "qualityP2": { + "standardDeviation": 23.31, + "isRedundant": true + }, + "qualityQ2": { + "standardDeviation": 23.25, + "isRedundant": true + }, + "observable": true + }, + "substationProperties1": { + "Country": "FR" + }, + "voltageLevelProperties1": { + "Country": "FR" + }, + "substationProperties2": { + "Country": "FR" + }, + "measurementP1": { + "value": 27.0, + "validity": true + }, + "measurementQ1": { + "value": 13.0, + "validity": true + }, + "measurementP2": { + "value": 68.0, + "validity": false + }, + "measurementQ2": { + "value": 53.0, + "validity": false + }, + "country": "FR", + "g": 27.0, + "b": 17.0, + "ratedU1": 400.0, + "ratedU2": 158.0, + "connectablePosition1": { + "connectionDirection": null + }, + "connectablePosition2": { + "connectionDirection": null + }, + "measurementRatioTap": { + "value": 11, + "validity": true + }, + "measurementPhaseTap": { + "value": 7, + "validity": false + }, + "toBeEstimated": { + "ratioTapChangerStatus": false, + "phaseTapChangerStatus": true + } + } +] \ No newline at end of file diff --git a/src/test/resources/all-data-without-optionals.json b/src/test/resources/all-data-without-optionals.json new file mode 100644 index 00000000..4a5842f4 --- /dev/null +++ b/src/test/resources/all-data-without-optionals.json @@ -0,0 +1,2146 @@ +{ + "substations": [ + { + "id": "P1", + "name": "P1_Name", + "properties": { + "Country": "FR" + }, + "voltageLevels": [ + { + "id": "VLGEN", + "name": "VLGEN_Name", + "properties": { + "Country": "FR" + }, + "substationId": "P1", + "nominalV": 24.0, + "country": "FR", + "lowVoltageLimit": 200.0, + "highVoltageLimit": 400.0, + "identifiableShortCircuit": { + "ipMin": 10.0, + "ipMax": 120.0 + }, + "substationProperties": { + "Country": "FR" + } + }, + { + "id": "VLHV1", + "substationId": "P1", + "nominalV": 380.0, + "country": "FR", + "substationProperties": { + "Country": "FR" + } + }, + { + "id": "VLNEW2", + "properties": { + "Country": "FR" + }, + "substationId": "P1", + "nominalV": 225.0, + "country": "FR", + "substationProperties": { + "Country": "FR" + } + } + ], + "country": "FR" + }, + { + "id": "P2", + "voltageLevels": [ + { + "id": "VLHV2", + "substationId": "P2", + "nominalV": 380.0 + }, + { + "id": "VLLOAD", + "substationId": "P2", + "nominalV": 150.0 + } + ] + }, + { + "id": "P0", + "voltageLevels": [], + "country": "FR" + }, + { + "id": "P3", + "properties": { + "Country": "FR" + }, + "voltageLevels": [ + { + "id": "VLGEN3", + "substationId": "P3", + "nominalV": 24.0, + "country": "FR", + "substationProperties": { + "Country": "FR" + } + } + ], + "country": "FR" + }, + { + "id": "P6", + "voltageLevels": [ + { + "id": "VLGEN6", + "substationId": "P6", + "nominalV": 24.0, + "country": "FR" + } + ], + "country": "FR" + }, + { + "id": "P4", + "voltageLevels": [ + { + "id": "VLGEN4", + "substationId": "P4", + "nominalV": 24.0, + "country": "FR" + } + ], + "country": "FR" + }, + { + "id": "P5", + "voltageLevels": [ + { + "id": "VLGEN5", + "substationId": "P5", + "nominalV": 24.0, + "country": "FR", + "lowVoltageLimit": 20.0, + "highVoltageLimit": 30.0, + "identifiableShortCircuit": { + "ipMin": 0.0, + "ipMax": 100.0 + } + } + ], + "country": "FR" + } + ], + "voltageLevels": [ + { + "id": "VLGEN", + "name": "VLGEN_Name", + "properties": { + "Country": "FR" + }, + "substationId": "P1", + "nominalV": 24.0, + "country": "FR", + "lowVoltageLimit": 200.0, + "highVoltageLimit": 400.0, + "identifiableShortCircuit": { + "ipMin": 10.0, + "ipMax": 120.0 + }, + "substationProperties": { + "Country": "FR" + } + }, + { + "id": "VLHV1", + "substationId": "P1", + "nominalV": 380.0, + "country": "FR", + "substationProperties": { + "Country": "FR" + } + }, + { + "id": "VLHV2", + "substationId": "P2", + "nominalV": 380.0 + }, + { + "id": "VLLOAD", + "substationId": "P2", + "nominalV": 150.0 + }, + { + "id": "VLNEW2", + "properties": { + "Country": "FR" + }, + "substationId": "P1", + "nominalV": 225.0, + "country": "FR", + "substationProperties": { + "Country": "FR" + } + }, + { + "id": "VLGEN3", + "substationId": "P3", + "nominalV": 24.0, + "country": "FR", + "substationProperties": { + "Country": "FR" + } + }, + { + "id": "VLGEN6", + "substationId": "P6", + "nominalV": 24.0, + "country": "FR" + }, + { + "id": "VL", + "name": "VL", + "nominalV": 24.0 + }, + { + "id": "VLGEN4", + "substationId": "P4", + "nominalV": 24.0, + "country": "FR" + }, + { + "id": "VLGEN5", + "substationId": "P5", + "nominalV": 24.0, + "country": "FR", + "lowVoltageLimit": 20.0, + "highVoltageLimit": 30.0, + "identifiableShortCircuit": { + "ipMin": 0.0, + "ipMax": 100.0 + } + } + ], + "lines": [ + { + "id": "NHV1_NHV2_1", + "type": "LINE", + "voltageLevelId1": "VLHV1", + "voltageLevelId2": "VLHV2", + "nominalVoltage1": 380.0, + "nominalVoltage2": 380.0, + "substationId1": "P1", + "substationId2": "P2", + "country1": "FR", + "terminal1Connected": true, + "terminal2Connected": true, + "p1": 1.1, + "q1": 2.2, + "p2": 3.33, + "q2": 4.44, + "r": 9.0, + "x": 10.0, + "substationProperties1": { + "Country": "FR" + }, + "g1": 7.0, + "b1": 5.0, + "g2": 8.0, + "b2": 6.0 + }, + { + "id": "NHV1_NHV2_2", + "type": "LINE", + "voltageLevelId1": "VLHV1", + "voltageLevelId2": "VLHV2", + "nominalVoltage1": 380.0, + "nominalVoltage2": 380.0, + "substationId1": "P1", + "substationId2": "P2", + "country1": "FR", + "terminal1Connected": true, + "terminal2Connected": true, + "r": 3.0, + "x": 33.0, + "substationProperties1": { + "Country": "FR" + }, + "g1": 0.0, + "b1": 1.93E-4, + "g2": 0.0, + "b2": 1.93E-4 + }, + { + "id": "LINE3", + "type": "LINE", + "voltageLevelId1": "VLGEN", + "voltageLevelId2": "VLGEN3", + "voltageLevelName1": "VLGEN_Name", + "nominalVoltage1": 24.0, + "nominalVoltage2": 24.0, + "substationId1": "P1", + "substationId2": "P3", + "country1": "FR", + "country2": "FR", + "terminal1Connected": true, + "terminal2Connected": true, + "p1": 200.0, + "p2": 100.0, + "r": 3.0, + "x": 33.0, + "branchObservability": { + "qualityP1": { + "standardDeviation": 23.31, + "isRedundant": true + }, + "qualityQ1": { + "standardDeviation": 23.25, + "isRedundant": true + }, + "qualityP2": { + "standardDeviation": 23.31, + "isRedundant": true + }, + "qualityQ2": { + "standardDeviation": 23.25, + "isRedundant": true + }, + "observable": true + }, + "substationProperties1": { + "Country": "FR" + }, + "voltageLevelProperties1": { + "Country": "FR" + }, + "substationProperties2": { + "Country": "FR" + }, + "operatingStatus": "PLANNED_OUTAGE", + "measurementP1": { + "value": 11.0, + "validity": true + }, + "measurementQ1": { + "value": 24.0, + "validity": false + }, + "measurementQ2": { + "value": 45.0, + "validity": true + }, + "g1": 0.0, + "b1": 1.93E-4, + "g2": 0.0, + "b2": 1.93E-4 + }, + { + "id": "LINE4", + "type": "LINE", + "voltageLevelId1": "VLGEN6", + "voltageLevelId2": "VLGEN3", + "nominalVoltage1": 24.0, + "nominalVoltage2": 24.0, + "substationId1": "P6", + "substationId2": "P3", + "country1": "FR", + "country2": "FR", + "terminal1Connected": true, + "terminal2Connected": true, + "r": 3.0, + "x": 33.0, + "substationProperties2": { + "Country": "FR" + }, + "g1": 0.0, + "b1": 1.93E-4, + "g2": 0.0, + "b2": 1.93E-4 + } + ], + "hvdcLines": [ + { + "id": "HVDC1", + "name": "HVDC1", + "voltageLevelId1": "VLGEN", + "voltageLevelId2": "VLNEW2", + "convertersMode": "SIDE_1_INVERTER_SIDE_2_RECTIFIER", + "converterStationId1": "LCC1", + "converterStationId2": "LCC2", + "r": 1.0, + "country1": "FR", + "country2": "FR", + "activePowerSetpoint": 500.0, + "maxP": 100.0, + "substationProperties1": { + "Country": "FR" + }, + "voltageLevelProperties1": { + "Country": "FR" + }, + "substationProperties2": { + "Country": "FR" + }, + "voltageLevelProperties2": { + "Country": "FR" + } + }, + { + "id": "HVDC3", + "name": "HVDC3", + "voltageLevelId1": "VLNEW2", + "voltageLevelId2": "VLNEW2", + "convertersMode": "SIDE_1_INVERTER_SIDE_2_RECTIFIER", + "converterStationId1": "VSC3", + "converterStationId2": "VSC4", + "r": 1.0, + "country1": "FR", + "country2": "FR", + "activePowerSetpoint": 500.0, + "maxP": 100.0, + "substationProperties1": { + "Country": "FR" + }, + "voltageLevelProperties1": { + "Country": "FR" + }, + "substationProperties2": { + "Country": "FR" + }, + "voltageLevelProperties2": { + "Country": "FR" + } + }, + { + "id": "HVDC4", + "name": "HVDC4", + "voltageLevelId1": "VLNEW2", + "voltageLevelId2": "VLNEW2", + "convertersMode": "SIDE_1_INVERTER_SIDE_2_RECTIFIER", + "converterStationId1": "VSC5", + "converterStationId2": "VSC6", + "r": 1.0, + "country1": "FR", + "country2": "FR", + "activePowerSetpoint": 500.0, + "maxP": 100.0, + "substationProperties1": { + "Country": "FR" + }, + "voltageLevelProperties1": { + "Country": "FR" + }, + "substationProperties2": { + "Country": "FR" + }, + "voltageLevelProperties2": { + "Country": "FR" + } + }, + { + "id": "HVDC2", + "name": "HVDC2", + "voltageLevelId1": "VLGEN", + "voltageLevelId2": "VLNEW2", + "convertersMode": "SIDE_1_INVERTER_SIDE_2_RECTIFIER", + "converterStationId1": "LCC1", + "converterStationId2": "LCC2", + "r": 1.0, + "country1": "FR", + "country2": "FR", + "activePowerSetpoint": 500.0, + "maxP": 100.0, + "hvdcAngleDroopActivePowerControl": { + "droop": 180.0, + "isEnabled": true, + "p0": 190.0 + }, + "hvdcOperatorActivePowerRange": { + "oprFromCS1toCS2": 1000.0, + "oprFromCS2toCS1": 900.0 + }, + "substationProperties1": { + "Country": "FR" + }, + "voltageLevelProperties1": { + "Country": "FR" + }, + "substationProperties2": { + "Country": "FR" + }, + "voltageLevelProperties2": { + "Country": "FR" + } + }, + { + "id": "HVDC5", + "name": "HVDC5", + "voltageLevelId1": "VLNEW2", + "voltageLevelId2": "VLGEN3", + "convertersMode": "SIDE_1_INVERTER_SIDE_2_RECTIFIER", + "converterStationId1": "VSC1", + "converterStationId2": "VSC2", + "r": 1.0, + "country1": "FR", + "country2": "FR", + "activePowerSetpoint": 500.0, + "maxP": 100.0, + "substationProperties1": { + "Country": "FR" + }, + "voltageLevelProperties1": { + "Country": "FR" + }, + "substationProperties2": { + "Country": "FR" + } + } + ], + "loads": [ + { + "id": "LOAD", + "properties": { + "Country": "FR" + }, + "type": "UNDEFINED", + "voltageLevelId": "VLLOAD", + "nominalVoltage": 150.0, + "terminalConnected": true, + "p0": 600.0, + "q0": 200.0, + "connectablePosition": { + "connectionDirection": "TOP", + "connectionPosition": 0, + "connectionName": "feederName" + } + }, + { + "id": "LOAD_WITH_NULL_NAME", + "type": "UNDEFINED", + "voltageLevelId": "VLNEW2", + "country": "FR", + "nominalVoltage": 225.0, + "terminalConnected": true, + "p0": 600.0, + "q0": 200.0, + "connectablePosition": { + "connectionDirection": null + }, + "measurementP": { + "value": 87.0, + "validity": false + }, + "measurementQ": { + "value": 74.0, + "validity": false + }, + "injectionObservability": { + "qualityP": { + "standardDeviation": 22.31, + "isRedundant": true + }, + "qualityQ": { + "standardDeviation": 22.01, + "isRedundant": true + }, + "qualityV": { + "standardDeviation": 2.64, + "isRedundant": true + }, + "observable": true + }, + "substationProperties": { + "Country": "FR" + }, + "voltageLevelProperties": { + "Country": "FR" + } + }, + { + "id": "LOAD_ID", + "name": "LOAD_NAME", + "type": "UNDEFINED", + "voltageLevelId": "VLNEW2", + "country": "FR", + "nominalVoltage": 225.0, + "terminalConnected": true, + "p0": 600.0, + "q0": 200.0, + "connectablePosition": { + "connectionDirection": null + }, + "measurementP": { + "value": 17.0, + "validity": true + }, + "measurementQ": { + "value": 91.0, + "validity": true + }, + "substationProperties": { + "Country": "FR" + }, + "voltageLevelProperties": { + "Country": "FR" + } + } + ], + "twoWindingsTransformers": [ + { + "id": "NGEN_NHV1", + "type": "TWO_WINDINGS_TRANSFORMER", + "voltageLevelId1": "VLGEN", + "voltageLevelId2": "VLHV1", + "voltageLevelName1": "VLGEN_Name", + "nominalVoltage1": 24.0, + "nominalVoltage2": 380.0, + "substationId1": "P1", + "substationId2": "P1", + "country1": "FR", + "country2": "FR", + "terminal1Connected": true, + "terminal2Connected": true, + "p1": 11.1, + "q1": 12.2, + "p2": 13.33, + "q2": 14.44, + "r": 0.26658461538461536, + "x": 11.104492831516762, + "substationProperties1": { + "Country": "FR" + }, + "voltageLevelProperties1": { + "Country": "FR" + }, + "substationProperties2": { + "Country": "FR" + }, + "operatingStatus": "PLANNED_OUTAGE", + "country": "FR", + "phaseTapChanger": { + "lowTapPosition": 0, + "tapPosition": 1, + "highTapPosition": 1, + "isRegulating": true, + "targetDeadband": 0.0, + "regulationMode": "CURRENT_LIMITER", + "regulationValue": 10.0, + "regulatingTerminalConnectableId": "NGEN_NHV1", + "regulatingTerminalConnectableType": "TWO_WINDINGS_TRANSFORMER", + "regulatingTerminalVlId": "VLGEN", + "steps": [ + { + "index": 0, + "rho": 0.8500000238418579, + "r": 0.0, + "x": 0.0, + "g": 0.0, + "b": 0.0, + "alpha": 1.0 + }, + { + "index": 1, + "rho": 0.8999999761581421, + "r": 0.0, + "x": 0.0, + "g": 0.0, + "b": 0.0, + "alpha": 1.0 + } + ] + }, + "g": 0.0, + "b": 0.0, + "ratedU1": 24.0, + "ratedU2": 400.0, + "connectablePosition1": { + "connectionDirection": "TOP", + "connectionPosition": 0, + "connectionName": "feederName1" + }, + "connectablePosition2": { + "connectionDirection": "BOTTOM", + "connectionPosition": 0, + "connectionName": "feederName2" + } + }, + { + "id": "NHV2_NLOAD", + "type": "TWO_WINDINGS_TRANSFORMER", + "voltageLevelId1": "VLHV2", + "voltageLevelId2": "VLLOAD", + "nominalVoltage1": 380.0, + "nominalVoltage2": 150.0, + "substationId1": "P2", + "substationId2": "P2", + "terminal1Connected": true, + "terminal2Connected": true, + "p1": 5.5, + "q1": 6.6, + "p2": 7.77, + "q2": 8.88, + "r": 0.04724999999999999, + "x": 4.049724365620455, + "operatingStatus": "PLANNED_OUTAGE", + "ratioTapChanger": { + "lowTapPosition": 0, + "tapPosition": 2, + "highTapPosition": 2, + "isRegulating": true, + "hasLoadTapChangingCapabilities": true, + "targetV": 158.0, + "targetDeadband": 0.0, + "regulatingTerminalConnectableId": "NHV2_NLOAD", + "regulatingTerminalConnectableType": "TWO_WINDINGS_TRANSFORMER", + "regulatingTerminalVlId": "VLLOAD", + "steps": [ + { + "index": 0, + "rho": 0.8505666905244191, + "r": 0.0, + "x": 0.0, + "g": 0.0, + "b": 0.0 + }, + { + "index": 1, + "rho": 1.0006666666666666, + "r": 0.0, + "x": 0.0, + "g": 0.0, + "b": 0.0 + }, + { + "index": 2, + "rho": 1.150766642808914, + "r": 0.0, + "x": 0.0, + "g": 0.0, + "b": 0.0 + } + ] + }, + "g": 0.0, + "b": 0.0, + "ratedU1": 400.0, + "ratedU2": 158.0, + "connectablePosition1": { + "connectionDirection": "TOP", + "connectionPosition": 0, + "connectionName": "feederName1" + }, + "connectablePosition2": { + "connectionDirection": "BOTTOM", + "connectionPosition": 0, + "connectionName": "feederName2" + } + }, + { + "id": "NGEN_NHV2", + "type": "TWO_WINDINGS_TRANSFORMER", + "voltageLevelId1": "VLGEN", + "voltageLevelId2": "VLHV1", + "voltageLevelName1": "VLGEN_Name", + "nominalVoltage1": 24.0, + "nominalVoltage2": 380.0, + "substationId1": "P1", + "substationId2": "P1", + "country1": "FR", + "country2": "FR", + "terminal1Connected": true, + "terminal2Connected": true, + "r": 47.0, + "x": 23.0, + "branchObservability": { + "qualityP1": { + "standardDeviation": 23.31, + "isRedundant": true + }, + "qualityQ1": { + "standardDeviation": 23.25, + "isRedundant": true + }, + "qualityP2": { + "standardDeviation": 23.31, + "isRedundant": true + }, + "qualityQ2": { + "standardDeviation": 23.25, + "isRedundant": true + }, + "observable": true + }, + "substationProperties1": { + "Country": "FR" + }, + "voltageLevelProperties1": { + "Country": "FR" + }, + "substationProperties2": { + "Country": "FR" + }, + "measurementP1": { + "value": 27.0, + "validity": true + }, + "measurementQ1": { + "value": 13.0, + "validity": true + }, + "measurementP2": { + "value": 68.0, + "validity": false + }, + "measurementQ2": { + "value": 53.0, + "validity": false + }, + "country": "FR", + "g": 27.0, + "b": 17.0, + "ratedU1": 400.0, + "ratedU2": 158.0, + "connectablePosition1": { + "connectionDirection": null + }, + "connectablePosition2": { + "connectionDirection": null + }, + "measurementRatioTap": { + "value": 11, + "validity": true + }, + "measurementPhaseTap": { + "value": 7, + "validity": false + }, + "toBeEstimated": { + "ratioTapChangerStatus": false, + "phaseTapChangerStatus": true + } + } + ], + "threeWindingsTransformers": [ + { + "id": "TWT", + "name": "TWT", + "voltageLevelId1": "VLHV1", + "nominalV1": 380.0, + "voltageLevelId2": "VLNEW2", + "nominalV2": 225.0, + "voltageLevelId3": "VLGEN", + "nominalV3": 24.0, + "country": "FR", + "terminal1Connected": true, + "terminal2Connected": true, + "terminal3Connected": true, + "p1": 375.0, + "q1": 48.0, + "p2": 225.0, + "q2": 28.0, + "p3": 200.0, + "q3": 18.0, + "permanentLimit1": 25.0, + "permanentLimit3": 54.0, + "phaseTapChanger1": { + "lowTapPosition": 0, + "tapPosition": 1, + "highTapPosition": 2, + "isRegulating": true, + "targetDeadband": 22.0, + "regulationMode": "CURRENT_LIMITER", + "regulationValue": 25.0, + "regulatingTerminalConnectableId": "TWT", + "regulatingTerminalConnectableType": "THREE_WINDINGS_TRANSFORMER", + "regulatingTerminalVlId": "VLHV1", + "steps": [ + { + "index": 0, + "rho": 0.99, + "r": 1.0, + "x": 4.0, + "g": 0.5, + "b": 1.5, + "alpha": -10.0 + }, + { + "index": 1, + "rho": 1.0, + "r": 1.1, + "x": 4.1, + "g": 0.6, + "b": 1.6, + "alpha": 0.0 + }, + { + "index": 2, + "rho": 1.01, + "r": 1.2, + "x": 4.2, + "g": 0.7, + "b": 1.7, + "alpha": 10.0 + } + ] + }, + "ratioTapChanger3": { + "lowTapPosition": 0, + "tapPosition": 2, + "highTapPosition": 2, + "isRegulating": false, + "hasLoadTapChangingCapabilities": false, + "targetV": 220.0, + "targetDeadband": 22.0, + "regulatingTerminalConnectableId": "TWT", + "regulatingTerminalConnectableType": "THREE_WINDINGS_TRANSFORMER", + "regulatingTerminalVlId": "VLHV1", + "steps": [ + { + "index": 0, + "rho": 0.99, + "r": 1.0, + "x": 4.0, + "g": 0.5, + "b": 1.5 + }, + { + "index": 1, + "rho": 1.0, + "r": 1.1, + "x": 4.1, + "g": 0.6, + "b": 1.6 + }, + { + "index": 2, + "rho": 1.01, + "r": 1.2, + "x": 4.2, + "g": 0.7, + "b": 1.7 + } + ] + }, + "hasLoadTapChanging3Capabilities": false, + "targetV3": 220.0, + "regulationModeName1": "CURRENT_LIMITER", + "isRegulatingRatio3": false, + "isRegulatingPhase1": true, + "regulatingValue1": 25.0, + "measurementP1": { + "value": 3.0, + "validity": false + }, + "measurementQ1": { + "value": 13.0, + "validity": true + }, + "measurementP2": { + "value": 23.0, + "validity": false + }, + "measurementQ2": { + "value": 33.0, + "validity": false + }, + "measurementP3": { + "value": 43.0, + "validity": true + }, + "measurementQ3": { + "value": 53.0, + "validity": true + }, + "measurementRatioTap1": { + "value": 14, + "validity": true + }, + "measurementPhaseTap2": { + "value": 4, + "validity": false + }, + "measurementRatioTap3": { + "value": 12, + "validity": false + }, + "measurementPhaseTap3": { + "value": 17, + "validity": true + }, + "substationProperties1": { + "Country": "FR" + }, + "substationProperties2": { + "Country": "FR" + }, + "voltageLevelProperties2": { + "Country": "FR" + }, + "substationProperties3": { + "Country": "FR" + }, + "voltageLevelProperties3": { + "Country": "FR" + } + }, + { + "id": "TWT21", + "name": "TWT21", + "voltageLevelId1": "VLHV1", + "nominalV1": 380.0, + "voltageLevelId2": "VLNEW2", + "nominalV2": 225.0, + "voltageLevelId3": "VLGEN", + "nominalV3": 24.0, + "country": "FR", + "terminal1Connected": true, + "terminal2Connected": true, + "terminal3Connected": true, + "p1": 375.0, + "q1": 48.0, + "p2": 225.0, + "q2": 28.0, + "p3": 200.0, + "q3": 18.0, + "permanentLimit1": 54.0, + "permanentLimit2": 25.0, + "ratioTapChanger1": { + "lowTapPosition": 0, + "tapPosition": 2, + "highTapPosition": 2, + "isRegulating": false, + "hasLoadTapChangingCapabilities": false, + "targetV": 220.0, + "targetDeadband": 22.0, + "regulatingTerminalConnectableId": "TWT21", + "regulatingTerminalConnectableType": "THREE_WINDINGS_TRANSFORMER", + "regulatingTerminalVlId": "VLHV1", + "steps": [ + { + "index": 0, + "rho": 0.99, + "r": 1.0, + "x": 4.0, + "g": 0.5, + "b": 1.5 + }, + { + "index": 1, + "rho": 1.0, + "r": 1.1, + "x": 4.1, + "g": 0.6, + "b": 1.6 + }, + { + "index": 2, + "rho": 1.01, + "r": 1.2, + "x": 4.2, + "g": 0.7, + "b": 1.7 + } + ] + }, + "phaseTapChanger2": { + "lowTapPosition": 0, + "tapPosition": 1, + "highTapPosition": 2, + "isRegulating": true, + "targetDeadband": 22.0, + "regulationMode": "CURRENT_LIMITER", + "regulationValue": 25.0, + "regulatingTerminalConnectableId": "TWT21", + "regulatingTerminalConnectableType": "THREE_WINDINGS_TRANSFORMER", + "regulatingTerminalVlId": "VLHV1", + "steps": [ + { + "index": 0, + "rho": 0.99, + "r": 1.0, + "x": 4.0, + "g": 0.5, + "b": 1.5, + "alpha": -10.0 + }, + { + "index": 1, + "rho": 1.0, + "r": 1.1, + "x": 4.1, + "g": 0.6, + "b": 1.6, + "alpha": 0.0 + }, + { + "index": 2, + "rho": 1.01, + "r": 1.2, + "x": 4.2, + "g": 0.7, + "b": 1.7, + "alpha": 10.0 + } + ] + }, + "hasLoadTapChanging1Capabilities": false, + "targetV1": 220.0, + "regulationModeName2": "CURRENT_LIMITER", + "isRegulatingRatio1": false, + "isRegulatingPhase2": true, + "regulatingValue2": 25.0, + "measurementP1": { + "value": 3.0, + "validity": false + }, + "measurementQ1": { + "value": 13.0, + "validity": true + }, + "measurementP2": { + "value": 23.0, + "validity": false + }, + "measurementQ2": { + "value": 33.0, + "validity": false + }, + "measurementP3": { + "value": 43.0, + "validity": true + }, + "measurementQ3": { + "value": 53.0, + "validity": true + }, + "measurementRatioTap1": { + "value": 14, + "validity": true + }, + "measurementPhaseTap2": { + "value": 4, + "validity": false + }, + "measurementRatioTap3": { + "value": 12, + "validity": false + }, + "measurementPhaseTap3": { + "value": 17, + "validity": true + }, + "substationProperties1": { + "Country": "FR" + }, + "substationProperties2": { + "Country": "FR" + }, + "voltageLevelProperties2": { + "Country": "FR" + }, + "substationProperties3": { + "Country": "FR" + }, + "voltageLevelProperties3": { + "Country": "FR" + } + }, + { + "id": "TWT32", + "name": "TWT32", + "voltageLevelId1": "VLHV1", + "nominalV1": 380.0, + "voltageLevelId2": "VLNEW2", + "nominalV2": 225.0, + "voltageLevelId3": "VLGEN", + "nominalV3": 24.0, + "country": "FR", + "terminal1Connected": true, + "terminal2Connected": true, + "terminal3Connected": true, + "p1": 375.0, + "q1": 48.0, + "p2": 225.0, + "q2": 28.0, + "p3": 200.0, + "q3": 18.0, + "permanentLimit2": 54.0, + "permanentLimit3": 25.0, + "ratioTapChanger2": { + "lowTapPosition": 0, + "tapPosition": 2, + "highTapPosition": 2, + "isRegulating": false, + "hasLoadTapChangingCapabilities": false, + "targetV": 220.0, + "targetDeadband": 22.0, + "regulatingTerminalConnectableId": "TWT32", + "regulatingTerminalConnectableType": "THREE_WINDINGS_TRANSFORMER", + "regulatingTerminalVlId": "VLHV1", + "steps": [ + { + "index": 0, + "rho": 0.99, + "r": 1.0, + "x": 4.0, + "g": 0.5, + "b": 1.5 + }, + { + "index": 1, + "rho": 1.0, + "r": 1.1, + "x": 4.1, + "g": 0.6, + "b": 1.6 + }, + { + "index": 2, + "rho": 1.01, + "r": 1.2, + "x": 4.2, + "g": 0.7, + "b": 1.7 + } + ] + }, + "phaseTapChanger3": { + "lowTapPosition": 0, + "tapPosition": 1, + "highTapPosition": 2, + "isRegulating": true, + "targetDeadband": 22.0, + "regulationMode": "CURRENT_LIMITER", + "regulationValue": 25.0, + "regulatingTerminalConnectableId": "TWT32", + "regulatingTerminalConnectableType": "THREE_WINDINGS_TRANSFORMER", + "regulatingTerminalVlId": "VLHV1", + "steps": [ + { + "index": 0, + "rho": 0.99, + "r": 1.0, + "x": 4.0, + "g": 0.5, + "b": 1.5, + "alpha": -10.0 + }, + { + "index": 1, + "rho": 1.0, + "r": 1.1, + "x": 4.1, + "g": 0.6, + "b": 1.6, + "alpha": 0.0 + }, + { + "index": 2, + "rho": 1.01, + "r": 1.2, + "x": 4.2, + "g": 0.7, + "b": 1.7, + "alpha": 10.0 + } + ] + }, + "hasLoadTapChanging2Capabilities": false, + "targetV2": 220.0, + "regulationModeName3": "CURRENT_LIMITER", + "isRegulatingRatio2": false, + "isRegulatingPhase3": true, + "regulatingValue3": 25.0, + "measurementP1": { + "value": 3.0, + "validity": false + }, + "measurementQ1": { + "value": 13.0, + "validity": true + }, + "measurementP2": { + "value": 23.0, + "validity": false + }, + "measurementQ2": { + "value": 33.0, + "validity": false + }, + "measurementP3": { + "value": 43.0, + "validity": true + }, + "measurementQ3": { + "value": 53.0, + "validity": true + }, + "measurementRatioTap1": { + "value": 14, + "validity": true + }, + "measurementPhaseTap2": { + "value": 4, + "validity": false + }, + "measurementRatioTap3": { + "value": 12, + "validity": false + }, + "measurementPhaseTap3": { + "value": 17, + "validity": true + }, + "substationProperties1": { + "Country": "FR" + }, + "substationProperties2": { + "Country": "FR" + }, + "voltageLevelProperties2": { + "Country": "FR" + }, + "substationProperties3": { + "Country": "FR" + }, + "voltageLevelProperties3": { + "Country": "FR" + } + } + ], + "generators": [ + { + "id": "GEN", + "voltageLevelId": "VLGEN", + "nominalVoltage": 24.0, + "country": "FR", + "terminalConnected": true, + "p": 25.0, + "q": 32.0, + "targetP": 28.0, + "targetQ": 301.0, + "targetV": 24.5, + "minP": -9999.99, + "maxP": 9999.99, + "energySource": "OTHER", + "ratedS": 27.0, + "voltageRegulatorOn": true, + "generatorStartup": { + "plannedActivePowerSetPoint": 0.3, + "marginalCost": 3.0, + "plannedOutageRate": 0.4, + "forcedOutageRate": 2.0 + }, + "minMaxReactiveLimits": { + "minQ": -500.0, + "maxQ": 500.0 + }, + "coordinatedReactiveControl": { + "qPercent": 10.0 + }, + "activePowerControl": { + "participate": true, + "droop": 4.0, + "maxTargetP": 8000.0 + }, + "connectablePosition": { + "connectionDirection": "TOP", + "connectionPosition": 0, + "connectionName": "feederName" + }, + "measurementP": { + "value": 50.0, + "validity": true + }, + "measurementQ": { + "value": 5.0, + "validity": true + }, + "isCondenser": false, + "substationId": "P1", + "substationName": "P1_Name", + "substationProperties": { + "Country": "FR" + }, + "voltageLevelName": "VLGEN_Name", + "lowVoltageLimit": 200.0, + "highVoltageLimit": 400.0, + "voltageLevelShortCircuit": { + "ipMin": 10.0, + "ipMax": 120.0 + }, + "voltageLevelProperties": { + "Country": "FR" + }, + "injectionObservability": { + "qualityP": { + "standardDeviation": 19.65, + "isRedundant": true + }, + "qualityQ": { + "standardDeviation": 12.76, + "isRedundant": true + }, + "qualityV": { + "standardDeviation": 2.93, + "isRedundant": true + }, + "observable": true + } + }, + { + "id": "GEN2", + "voltageLevelId": "VLGEN", + "nominalVoltage": 24.0, + "country": "FR", + "terminalConnected": true, + "targetP": 607.0, + "targetQ": 301.0, + "targetV": 24.5, + "minP": -9999.99, + "maxP": 9999.99, + "energySource": "OTHER", + "voltageRegulatorOn": true, + "reactiveCapabilityCurvePoints": [ + { + "p": 0.0, + "minQ": 6.0, + "maxQ": 7.0 + }, + { + "p": 1.0, + "minQ": 4.0, + "maxQ": 5.0 + }, + { + "p": 3.0, + "minQ": 4.0, + "maxQ": 5.0 + } + ], + "coordinatedReactiveControl": { + "qPercent": 10.0 + }, + "connectablePosition": { + "connectionDirection": "TOP", + "connectionPosition": 0, + "connectionName": "feederName" + }, + "measurementP": { + "value": 30.0, + "validity": true + }, + "measurementQ": { + "value": 80.0, + "validity": false + }, + "isCondenser": false, + "substationId": "P1", + "substationName": "P1_Name", + "substationProperties": { + "Country": "FR" + }, + "voltageLevelName": "VLGEN_Name", + "lowVoltageLimit": 200.0, + "highVoltageLimit": 400.0, + "voltageLevelShortCircuit": { + "ipMin": 10.0, + "ipMax": 120.0 + }, + "voltageLevelProperties": { + "Country": "FR" + } + } + ], + "batteries": [ + { + "id": "BATTERY1", + "name": "BATTERY1", + "voltageLevelId": "VLNEW2", + "targetP": 1.0, + "targetQ": 1.0, + "minP": 50.0, + "maxP": 70.0, + "minMaxReactiveLimits": { + "minQ": -500.0, + "maxQ": 500.0 + }, + "connectablePosition": { + "connectionDirection": "TOP", + "connectionPosition": 0, + "connectionName": "feederName" + }, + "terminalConnected": false, + "nominalVoltage": 225.0, + "country": "FR", + "measurementP": { + "value": 12.0, + "validity": false + }, + "measurementQ": { + "value": 44.0, + "validity": true + }, + "injectionObservability": { + "qualityP": { + "standardDeviation": 19.65, + "isRedundant": true + }, + "qualityQ": { + "standardDeviation": 12.76, + "isRedundant": true + }, + "qualityV": { + "standardDeviation": 2.93, + "isRedundant": true + }, + "observable": true + }, + "substationProperties": { + "Country": "FR" + }, + "voltageLevelProperties": { + "Country": "FR" + } + }, + { + "id": "BATTERY2", + "name": "BATTERY2", + "voltageLevelId": "VLGEN3", + "targetP": 1.0, + "targetQ": 1.0, + "minP": 50.0, + "maxP": 70.0, + "reactiveCapabilityCurvePoints": [ + { + "p": 0.0, + "minQ": 6.0, + "maxQ": 7.0 + }, + { + "p": 1.0, + "minQ": 4.0, + "maxQ": 5.0 + }, + { + "p": 3.0, + "minQ": 4.0, + "maxQ": 5.0 + } + ], + "activePowerControl": { + "participate": true, + "droop": 3.0 + }, + "connectablePosition": { + "connectionDirection": "TOP", + "connectionPosition": 0, + "connectionName": "feederName" + }, + "terminalConnected": false, + "nominalVoltage": 24.0, + "country": "FR", + "measurementP": { + "value": 34.0, + "validity": true + }, + "measurementQ": { + "value": 84.0, + "validity": true + }, + "substationProperties": { + "Country": "FR" + } + } + ], + "danglingLines": [ + { + "id": "DL1", + "name": "DL1", + "voltageLevelId": "VLGEN", + "nominalV": 24.0, + "country": "FR", + "terminalConnected": true, + "pairingKey": "xnode1", + "p": 45.0, + "q": 75.0, + "p0": 50.0, + "q0": 30.0, + "measurementP": { + "value": 66.0, + "validity": true + }, + "measurementQ": { + "value": 77.0, + "validity": false + }, + "injectionObservability": { + "qualityP": { + "standardDeviation": 19.65, + "isRedundant": true + }, + "qualityQ": { + "standardDeviation": 12.76, + "isRedundant": true + }, + "qualityV": { + "standardDeviation": 2.93, + "isRedundant": true + }, + "observable": true + }, + "substationProperties": { + "Country": "FR" + }, + "voltageLevelProperties": { + "Country": "FR" + } + }, + { + "id": "DL2", + "name": "DL2", + "voltageLevelId": "VLGEN3", + "nominalV": 24.0, + "country": "FR", + "terminalConnected": true, + "pairingKey": "xnode1", + "p": 45.0, + "q": 75.0, + "p0": 50.0, + "q0": 30.0, + "substationProperties": { + "Country": "FR" + } + } + ], + "tieLines": [ + { + "id": "TL1", + "voltageLevelId1": "VLGEN", + "voltageLevelName1": "VLGEN_Name", + "nominalVoltage1": 24.0, + "voltageLevelId2": "VLGEN3", + "nominalVoltage2": 24.0, + "country1": "FR", + "country2": "FR", + "terminal1Connected": true, + "terminal2Connected": true, + "p1": 45.0, + "q1": 75.0, + "p2": 45.0, + "q2": 75.0, + "r": 1.9999999999999996, + "x": 3.999999999999999, + "g1": 4.000000000000001, + "b1": 3.0000000000000004, + "g2": 4.000000000000001, + "b2": 3.0000000000000004, + "substationProperties1": { + "Country": "FR" + }, + "voltageLevelProperties1": { + "Country": "FR" + }, + "substationProperties2": { + "Country": "FR" + } + } + ], + "lccConverterStations": [ + { + "id": "LCC1", + "name": "LCC1", + "powerFactor": 0.5, + "lossFactor": 1.0, + "voltageLevelId": "VLGEN", + "nominalV": 24.0, + "country": "FR", + "terminalConnected": true, + "hvdcLineId": "HVDC1", + "substationProperties": { + "Country": "FR" + }, + "voltageLevelProperties": { + "Country": "FR" + } + }, + { + "id": "LCC2", + "name": "LCC2", + "powerFactor": 0.5, + "lossFactor": 1.0, + "voltageLevelId": "VLNEW2", + "nominalV": 225.0, + "country": "FR", + "terminalConnected": true, + "hvdcLineId": "HVDC1", + "p": 110.0, + "q": 310.0, + "measurementP": { + "value": 5.0, + "validity": true + }, + "measurementQ": { + "value": 55.0, + "validity": true + }, + "injectionObservability": { + "qualityP": { + "standardDeviation": 19.65, + "isRedundant": true + }, + "qualityQ": { + "standardDeviation": 12.76, + "isRedundant": true + }, + "qualityV": { + "standardDeviation": 2.93, + "isRedundant": true + }, + "observable": true + }, + "substationProperties": { + "Country": "FR" + }, + "voltageLevelProperties": { + "Country": "FR" + } + } + ], + "shuntCompensators": [ + { + "id": "SHUNT1", + "name": "SHUNT1", + "voltageLevelId": "VLNEW2", + "nominalVoltage": 225.0, + "country": "FR", + "terminalConnected": true, + "q": 90.0, + "sectionCount": 4, + "maxSusceptance": 40.0, + "maxQAtNominalV": 2025000.0, + "maximumSectionCount": 8, + "connectablePosition": { + "connectionDirection": "TOP", + "connectionPosition": 0, + "connectionName": "feederName" + }, + "targetV": 225.0, + "measurementQ": { + "value": 45.0, + "validity": false + }, + "injectionObservability": { + "qualityP": { + "standardDeviation": 19.65, + "isRedundant": true + }, + "qualityQ": { + "standardDeviation": 12.76, + "isRedundant": true + }, + "qualityV": { + "standardDeviation": 2.93, + "isRedundant": true + }, + "observable": true + }, + "substationProperties": { + "Country": "FR" + }, + "voltageLevelProperties": { + "Country": "FR" + } + }, + { + "id": "SHUNT2", + "name": "SHUNT2", + "voltageLevelId": "VLGEN3", + "nominalVoltage": 24.0, + "country": "FR", + "terminalConnected": true, + "sectionCount": 2, + "maxSusceptance": 3.0, + "maxQAtNominalV": 1728.0, + "maximumSectionCount": 3, + "connectablePosition": { + "connectionDirection": "TOP", + "connectionPosition": 0, + "connectionName": "feederName" + }, + "targetV": 225.0, + "substationProperties": { + "Country": "FR" + } + }, + { + "id": "SHUNT_VLNB", + "name": "SHUNT_VLNB", + "voltageLevelId": "VLGEN4", + "nominalVoltage": 24.0, + "country": "FR", + "terminalConnected": true, + "sectionCount": 2, + "maxSusceptance": 3.0, + "maxQAtNominalV": 1728.0, + "maximumSectionCount": 3, + "connectablePosition": { + "connectionDirection": null + }, + "targetV": 225.0, + "measurementQ": { + "value": 69.0, + "validity": true + } + }, + { + "id": "SHUNT_NON_LINEAR", + "name": "SHUNT_NON_LINEAR", + "voltageLevelId": "VLGEN4", + "nominalVoltage": 24.0, + "country": "FR", + "terminalConnected": false, + "sectionCount": 2, + "maximumSectionCount": 2, + "connectablePosition": { + "connectionDirection": null + }, + "targetV": 225.0 + } + ], + "staticVarCompensators": [ + { + "id": "SVC1", + "name": "SVC1", + "voltageLevelId": "VLGEN", + "nominalV": 24.0, + "country": "FR", + "terminalConnected": true, + "regulationMode": "VOLTAGE", + "p": 120.0, + "q": 43.0, + "voltageSetpoint": 200.0, + "reactivePowerSetpoint": 100.0, + "measurementQ": { + "value": 58.0, + "validity": false + }, + "injectionObservability": { + "qualityP": { + "standardDeviation": 19.65, + "isRedundant": true + }, + "qualityQ": { + "standardDeviation": 12.76, + "isRedundant": true + }, + "qualityV": { + "standardDeviation": 2.93, + "isRedundant": true + }, + "observable": true + }, + "substationProperties": { + "Country": "FR" + }, + "voltageLevelProperties": { + "Country": "FR" + } + }, + { + "id": "SVC2", + "name": "SVC2", + "voltageLevelId": "VLNEW2", + "nominalV": 225.0, + "country": "FR", + "terminalConnected": true, + "regulationMode": "VOLTAGE", + "voltageSetpoint": 200.0, + "reactivePowerSetpoint": 100.0, + "substationProperties": { + "Country": "FR" + }, + "voltageLevelProperties": { + "Country": "FR" + } + } + ], + "vscConverterStations": [ + { + "id": "VSC1", + "name": "VSC1", + "lossFactor": 1.0, + "voltageSetpoint": 150.0, + "reactivePowerSetpoint": 40.0, + "voltageRegulatorOn": true, + "voltageLevelId": "VLNEW2", + "nominalV": 225.0, + "country": "FR", + "terminalConnected": true, + "hvdcLineId": "HVDC5", + "p": 10.0, + "q": 30.0, + "substationProperties": { + "Country": "FR" + }, + "voltageLevelProperties": { + "Country": "FR" + } + }, + { + "id": "VSC3", + "name": "VSC3", + "lossFactor": 1.0, + "reactivePowerSetpoint": 40.0, + "voltageRegulatorOn": false, + "voltageLevelId": "VLNEW2", + "nominalV": 225.0, + "country": "FR", + "terminalConnected": true, + "hvdcLineId": "HVDC3", + "p": 10.0, + "q": 30.0, + "substationProperties": { + "Country": "FR" + }, + "voltageLevelProperties": { + "Country": "FR" + } + }, + { + "id": "VSC4", + "name": "VSC4", + "lossFactor": 1.0, + "reactivePowerSetpoint": 40.0, + "voltageRegulatorOn": false, + "voltageLevelId": "VLNEW2", + "nominalV": 225.0, + "country": "FR", + "terminalConnected": true, + "hvdcLineId": "HVDC3", + "p": 10.0, + "q": 30.0, + "measurementP": { + "value": 16.0, + "validity": false + }, + "measurementQ": { + "value": 63.0, + "validity": false + }, + "injectionObservability": { + "qualityP": { + "standardDeviation": 19.65, + "isRedundant": true + }, + "qualityQ": { + "standardDeviation": 12.76, + "isRedundant": true + }, + "qualityV": { + "standardDeviation": 2.93, + "isRedundant": true + }, + "observable": true + }, + "substationProperties": { + "Country": "FR" + }, + "voltageLevelProperties": { + "Country": "FR" + } + }, + { + "id": "VSC5", + "name": "VSC5", + "lossFactor": 1.0, + "voltageSetpoint": 150.0, + "voltageRegulatorOn": true, + "voltageLevelId": "VLNEW2", + "nominalV": 225.0, + "country": "FR", + "terminalConnected": true, + "hvdcLineId": "HVDC4", + "p": 10.0, + "q": 30.0, + "measurementP": { + "value": 88.0, + "validity": true + }, + "measurementQ": { + "value": 33.0, + "validity": true + }, + "substationProperties": { + "Country": "FR" + }, + "voltageLevelProperties": { + "Country": "FR" + } + }, + { + "id": "VSC6", + "name": "VSC6", + "lossFactor": 1.0, + "voltageSetpoint": 150.0, + "voltageRegulatorOn": true, + "voltageLevelId": "VLNEW2", + "nominalV": 225.0, + "country": "FR", + "terminalConnected": true, + "hvdcLineId": "HVDC4", + "p": 10.0, + "q": 30.0, + "substationProperties": { + "Country": "FR" + }, + "voltageLevelProperties": { + "Country": "FR" + } + }, + { + "id": "VSC2", + "name": "VSC2", + "lossFactor": 1.0, + "voltageSetpoint": 150.0, + "reactivePowerSetpoint": 40.0, + "voltageRegulatorOn": true, + "voltageLevelId": "VLGEN3", + "nominalV": 24.0, + "country": "FR", + "terminalConnected": true, + "hvdcLineId": "HVDC5", + "substationProperties": { + "Country": "FR" + } + } + ], + "buses": [ + { + "id": "VLGEN_0", + "v": "NaN", + "angle": "NaN", + "synchronousComponentNum": 0, + "connectedComponentNum": 0, + "voltageLevelId": "VLGEN", + "nominalVoltage": 24.0, + "country": "FR", + "substationProperties": { + "Country": "FR" + }, + "voltageLevelProperties": { + "Country": "FR" + } + }, + { + "id": "VLHV1_0", + "v": "NaN", + "angle": "NaN", + "synchronousComponentNum": 0, + "connectedComponentNum": 0, + "voltageLevelId": "VLHV1", + "nominalVoltage": 380.0, + "country": "FR", + "substationProperties": { + "Country": "FR" + } + }, + { + "id": "VLHV2_0", + "v": "NaN", + "angle": "NaN", + "synchronousComponentNum": 0, + "connectedComponentNum": 0, + "voltageLevelId": "VLHV2", + "nominalVoltage": 380.0 + }, + { + "id": "VLLOAD_0", + "v": "NaN", + "angle": "NaN", + "synchronousComponentNum": 0, + "connectedComponentNum": 0, + "voltageLevelId": "VLLOAD", + "nominalVoltage": 150.0 + }, + { + "id": "VLNEW2_0", + "v": "NaN", + "angle": "NaN", + "synchronousComponentNum": 0, + "connectedComponentNum": 0, + "voltageLevelId": "VLNEW2", + "nominalVoltage": 225.0, + "country": "FR", + "substationProperties": { + "Country": "FR" + }, + "voltageLevelProperties": { + "Country": "FR" + } + }, + { + "id": "VLGEN3_0", + "v": "NaN", + "angle": "NaN", + "synchronousComponentNum": 0, + "connectedComponentNum": 0, + "voltageLevelId": "VLGEN3", + "nominalVoltage": 24.0, + "country": "FR", + "substationProperties": { + "Country": "FR" + } + }, + { + "id": "VLGEN6_0", + "v": "NaN", + "angle": "NaN", + "synchronousComponentNum": 0, + "connectedComponentNum": 0, + "voltageLevelId": "VLGEN6", + "nominalVoltage": 24.0, + "country": "FR" + }, + { + "id": "VLGEN4_0", + "v": "NaN", + "angle": "NaN", + "synchronousComponentNum": 1, + "connectedComponentNum": 1, + "voltageLevelId": "VLGEN4", + "nominalVoltage": 24.0, + "country": "FR" + } + ], + "busbarSections": [ + { + "id": "NGEN4", + "name": "NGEN4", + "voltageLevelId": "VLGEN4", + "measurementV": { + "value": 385.0, + "validity": true + }, + "measurementAngle": { + "value": 0.5, + "validity": false + } + }, + { + "id": "NGEN5", + "name": "NGEN5", + "voltageLevelId": "VLGEN5" + }, + { + "id": "NGEN5_2_1", + "name": "NGEN5_2_1", + "voltageLevelId": "VLGEN5" + }, + { + "id": "NGEN5_2_2", + "name": "NGEN5_2_2", + "voltageLevelId": "VLGEN5" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/generators-tab-data-without-optionals.json b/src/test/resources/generators-tab-data-without-optionals.json new file mode 100644 index 00000000..4d0a2d1d --- /dev/null +++ b/src/test/resources/generators-tab-data-without-optionals.json @@ -0,0 +1,144 @@ +[ + { + "id": "GEN", + "voltageLevelId": "VLGEN", + "nominalVoltage": 24.0, + "country": "FR", + "terminalConnected": true, + "p": 25.0, + "q": 32.0, + "targetP": 28.0, + "targetQ": 301.0, + "targetV": 24.5, + "minP": -9999.99, + "maxP": 9999.99, + "energySource": "OTHER", + "ratedS": 27.0, + "voltageRegulatorOn": true, + "generatorStartup": { + "plannedActivePowerSetPoint": 0.3, + "marginalCost": 3.0, + "plannedOutageRate": 0.4, + "forcedOutageRate": 2.0 + }, + "minMaxReactiveLimits": { + "minQ": -500.0, + "maxQ": 500.0 + }, + "coordinatedReactiveControl": { + "qPercent": 10.0 + }, + "activePowerControl": { + "participate": true, + "droop": 4.0, + "maxTargetP": 8000.0 + }, + "connectablePosition": { + "connectionDirection": "TOP", + "connectionPosition": 0, + "connectionName": "feederName" + }, + "measurementP": { + "value": 50.0, + "validity": true + }, + "measurementQ": { + "value": 5.0, + "validity": true + }, + "isCondenser": false, + "substationId": "P1", + "substationName": "P1_Name", + "substationProperties": { + "Country": "FR" + }, + "voltageLevelName": "VLGEN_Name", + "lowVoltageLimit": 200.0, + "highVoltageLimit": 400.0, + "voltageLevelShortCircuit": { + "ipMin": 10.0, + "ipMax": 120.0 + }, + "voltageLevelProperties": { + "Country": "FR" + }, + "injectionObservability": { + "qualityP": { + "standardDeviation": 19.65, + "isRedundant": true + }, + "qualityQ": { + "standardDeviation": 12.76, + "isRedundant": true + }, + "qualityV": { + "standardDeviation": 2.93, + "isRedundant": true + }, + "observable": true + } + }, + { + "id": "GEN2", + "voltageLevelId": "VLGEN", + "nominalVoltage": 24.0, + "country": "FR", + "terminalConnected": true, + "targetP": 607.0, + "targetQ": 301.0, + "targetV": 24.5, + "minP": -9999.99, + "maxP": 9999.99, + "energySource": "OTHER", + "voltageRegulatorOn": true, + "reactiveCapabilityCurvePoints": [ + { + "p": 0.0, + "minQ": 6.0, + "maxQ": 7.0 + }, + { + "p": 1.0, + "minQ": 4.0, + "maxQ": 5.0 + }, + { + "p": 3.0, + "minQ": 4.0, + "maxQ": 5.0 + } + ], + "coordinatedReactiveControl": { + "qPercent": 10.0 + }, + "connectablePosition": { + "connectionDirection": "TOP", + "connectionPosition": 0, + "connectionName": "feederName" + }, + "measurementP": { + "value": 30.0, + "validity": true + }, + "measurementQ": { + "value": 80.0, + "validity": false + }, + "isCondenser": false, + "substationId": "P1", + "substationName": "P1_Name", + "substationProperties": { + "Country": "FR" + }, + "voltageLevelName": "VLGEN_Name", + "lowVoltageLimit": 200.0, + "highVoltageLimit": 400.0, + "voltageLevelShortCircuit": { + "ipMin": 10.0, + "ipMax": 120.0 + }, + "voltageLevelProperties": { + "Country": "FR" + } + } +] \ No newline at end of file From fb1c0476d6673dd70582b82b5b709eb8d1d552a8 Mon Sep 17 00:00:00 2001 From: Joris Mancini Date: Tue, 2 Sep 2025 16:27:37 +0200 Subject: [PATCH 2/5] fix: transform all request in post Signed-off-by: Joris Mancini --- .../network/map/NetworkMapController.java | 6 +- .../network/map/NetworkMapService.java | 41 +++++++------ .../map/ListHandlingControllerTest.java | 5 +- .../network/map/NetworkMapControllerTest.java | 61 ++++++++++++++----- 4 files changed, 75 insertions(+), 38 deletions(-) diff --git a/src/main/java/org/gridsuite/network/map/NetworkMapController.java b/src/main/java/org/gridsuite/network/map/NetworkMapController.java index b797ba67..3d912bd5 100644 --- a/src/main/java/org/gridsuite/network/map/NetworkMapController.java +++ b/src/main/java/org/gridsuite/network/map/NetworkMapController.java @@ -49,14 +49,14 @@ public List getElementsIds(@Parameter(description = "Network UUID") @Pat return networkMapService.getElementsIds(networkUuid, variantId, substationsIds.orElseGet(List::of), elementType, nominalVoltages); } - @GetMapping(value = "/networks/{networkUuid}/all", produces = APPLICATION_JSON_VALUE) + @PostMapping(value = "/networks/{networkUuid}/all", produces = APPLICATION_JSON_VALUE) @Operation(summary = "Get all equipments descriptions") @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "all equipments descriptions")}) public AllElementsInfos getAll(@Parameter(description = "Network UUID") @PathVariable("networkUuid") UUID networkUuid, @Parameter(description = "Variant Id") @RequestParam(name = "variantId", required = false) String variantId, @Parameter(description = "Substations id") @RequestParam(name = "substationId", defaultValue = "") List substationsIds, - @Parameter(description = "Info type parameters") InfoTypeParameters infoTypeParameters) { - return networkMapService.getAllElementsInfos(networkUuid, variantId, substationsIds, infoTypeParameters); + @RequestBody Map> additionalParametersByType) { + return networkMapService.getAllElementsInfos(networkUuid, variantId, substationsIds, additionalParametersByType); } @PostMapping(value = "/networks/{networkUuid}/elements", produces = APPLICATION_JSON_VALUE) diff --git a/src/main/java/org/gridsuite/network/map/NetworkMapService.java b/src/main/java/org/gridsuite/network/map/NetworkMapService.java index 6b756007..27d710d1 100644 --- a/src/main/java/org/gridsuite/network/map/NetworkMapService.java +++ b/src/main/java/org/gridsuite/network/map/NetworkMapService.java @@ -61,29 +61,34 @@ private List getSubstationsIds(UUID networkUuid, String variantId, List< .map(Substation::getId).toList(); } - public AllElementsInfos getAllElementsInfos(UUID networkUuid, String variantId, @NonNull List substationsId, InfoTypeParameters infoTypeParameters) { + public AllElementsInfos getAllElementsInfos(UUID networkUuid, String variantId, @NonNull List substationsId, Map> additionalParametersByType) { Network network = getNetwork(networkUuid, PreloadingStrategy.ALL_COLLECTIONS_NEEDED_FOR_BUS_VIEW, variantId); + return AllElementsInfos.builder() - .substations(getSubstationsInfos(network, substationsId, infoTypeParameters, null)) - .voltageLevels(getVoltageLevelsInfos(network, substationsId, infoTypeParameters, null)) - .hvdcLines(getHvdcLinesInfos(network, substationsId, infoTypeParameters, null)) - .lines(getElementsInfos(network, substationsId, ElementType.LINE, infoTypeParameters, null)) - .loads(getElementsInfos(network, substationsId, ElementType.LOAD, infoTypeParameters, null)) - .generators(getElementsInfos(network, substationsId, ElementType.GENERATOR, infoTypeParameters, null)) - .twoWindingsTransformers(getElementsInfos(network, substationsId, ElementType.TWO_WINDINGS_TRANSFORMER, infoTypeParameters, null)) - .threeWindingsTransformers(getElementsInfos(network, substationsId, ElementType.THREE_WINDINGS_TRANSFORMER, infoTypeParameters, null)) - .batteries(getElementsInfos(network, substationsId, ElementType.BATTERY, infoTypeParameters, null)) - .danglingLines(getElementsInfos(network, substationsId, ElementType.DANGLING_LINE, infoTypeParameters, null)) - .tieLines(getTieLinesInfos(network, substationsId, infoTypeParameters, null)) - .lccConverterStations(getElementsInfos(network, substationsId, ElementType.LCC_CONVERTER_STATION, infoTypeParameters, null)) - .shuntCompensators(getElementsInfos(network, substationsId, ElementType.SHUNT_COMPENSATOR, infoTypeParameters, null)) - .staticVarCompensators(getElementsInfos(network, substationsId, ElementType.STATIC_VAR_COMPENSATOR, infoTypeParameters, null)) - .vscConverterStations(getElementsInfos(network, substationsId, ElementType.VSC_CONVERTER_STATION, infoTypeParameters, null)) - .buses(getBusesInfos(network, substationsId, infoTypeParameters)) - .busbarSections(getElementsInfos(network, substationsId, ElementType.BUSBAR_SECTION, infoTypeParameters, null)) + .substations(getSubstationsInfos(network, substationsId, getInfoTypeParameters(additionalParametersByType, ElementType.SUBSTATION), null)) + .voltageLevels(getVoltageLevelsInfos(network, substationsId, getInfoTypeParameters(additionalParametersByType, ElementType.VOLTAGE_LEVEL), null)) + .hvdcLines(getHvdcLinesInfos(network, substationsId, getInfoTypeParameters(additionalParametersByType, ElementType.HVDC_LINE), null)) + .lines(getElementsInfos(network, substationsId, ElementType.LINE, getInfoTypeParameters(additionalParametersByType, ElementType.LINE), null)) + .loads(getElementsInfos(network, substationsId, ElementType.LOAD, getInfoTypeParameters(additionalParametersByType, ElementType.LOAD), null)) + .generators(getElementsInfos(network, substationsId, ElementType.GENERATOR, getInfoTypeParameters(additionalParametersByType, ElementType.GENERATOR), null)) + .twoWindingsTransformers(getElementsInfos(network, substationsId, ElementType.TWO_WINDINGS_TRANSFORMER, getInfoTypeParameters(additionalParametersByType, ElementType.TWO_WINDINGS_TRANSFORMER), null)) + .threeWindingsTransformers(getElementsInfos(network, substationsId, ElementType.THREE_WINDINGS_TRANSFORMER, getInfoTypeParameters(additionalParametersByType, ElementType.THREE_WINDINGS_TRANSFORMER), null)) + .batteries(getElementsInfos(network, substationsId, ElementType.BATTERY, getInfoTypeParameters(additionalParametersByType, ElementType.BATTERY), null)) + .danglingLines(getElementsInfos(network, substationsId, ElementType.DANGLING_LINE, getInfoTypeParameters(additionalParametersByType, ElementType.DANGLING_LINE), null)) + .tieLines(getTieLinesInfos(network, substationsId, getInfoTypeParameters(additionalParametersByType, ElementType.TIE_LINE), null)) + .lccConverterStations(getElementsInfos(network, substationsId, ElementType.LCC_CONVERTER_STATION, getInfoTypeParameters(additionalParametersByType, ElementType.LCC_CONVERTER_STATION), null)) + .shuntCompensators(getElementsInfos(network, substationsId, ElementType.SHUNT_COMPENSATOR, getInfoTypeParameters(additionalParametersByType, ElementType.SHUNT_COMPENSATOR), null)) + .staticVarCompensators(getElementsInfos(network, substationsId, ElementType.STATIC_VAR_COMPENSATOR, getInfoTypeParameters(additionalParametersByType, ElementType.STATIC_VAR_COMPENSATOR), null)) + .vscConverterStations(getElementsInfos(network, substationsId, ElementType.VSC_CONVERTER_STATION, getInfoTypeParameters(additionalParametersByType, ElementType.VSC_CONVERTER_STATION), null)) + .buses(getBusesInfos(network, substationsId, getInfoTypeParameters(additionalParametersByType, ElementType.BUS))) + .busbarSections(getElementsInfos(network, substationsId, ElementType.BUSBAR_SECTION, getInfoTypeParameters(additionalParametersByType, ElementType.BUSBAR_SECTION), null)) .build(); } + private static InfoTypeParameters getInfoTypeParameters(Map> additionalParametersByType, ElementType elementType) { + return new InfoTypeParameters(ElementInfos.InfoType.TAB, additionalParametersByType.get(String.valueOf(elementType))); + } + private List getVoltageLevelsIds(UUID networkUuid, String variantId, @NonNull List substationsIds, List nominalVoltages) { Network network = getNetwork(networkUuid, getPreloadingStrategy(substationsIds), variantId); return getVoltageLevelStream(network, substationsIds, nominalVoltages).map(VoltageLevel::getId).toList(); diff --git a/src/test/java/org/gridsuite/network/map/ListHandlingControllerTest.java b/src/test/java/org/gridsuite/network/map/ListHandlingControllerTest.java index 83d89aa5..ddf9e2c7 100644 --- a/src/test/java/org/gridsuite/network/map/ListHandlingControllerTest.java +++ b/src/test/java/org/gridsuite/network/map/ListHandlingControllerTest.java @@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder; @@ -78,9 +79,9 @@ void getVoltageLevelEquipmentsSubstationsIds(final Optional parameter) t @ParameterizedTest @MethodSource("testParameterList") void getAllSubstationsIds(final Optional parameter) throws Exception { - mvc.perform(requestWithOptionalSubstationId(get("/v1/networks/{networkUuid}/all", NETWORK_ID), parameter)) + mvc.perform(requestWithOptionalSubstationId(post("/v1/networks/{networkUuid}/all", NETWORK_ID).contentType(MediaType.APPLICATION_JSON).content("{}"), parameter)) .andExpect(status().is2xxSuccessful()); - verify(networkMapService).getAllElementsInfos(eq(NETWORK_ID), isNull(), eq(Collections.emptyList()), eq(new InfoTypeParameters(null, Map.of()))); + verify(networkMapService).getAllElementsInfos(eq(NETWORK_ID), isNull(), eq(Collections.emptyList()), eq(Map.of())); } /** Case of {@code substationsIds} for {@link NetworkMapController#getElementsInfos(UUID, String, List, ElementType, InfoTypeParameters, Optional)} */ diff --git a/src/test/java/org/gridsuite/network/map/NetworkMapControllerTest.java b/src/test/java/org/gridsuite/network/map/NetworkMapControllerTest.java index 2ecc53d7..05703dbb 100644 --- a/src/test/java/org/gridsuite/network/map/NetworkMapControllerTest.java +++ b/src/test/java/org/gridsuite/network/map/NetworkMapControllerTest.java @@ -37,6 +37,7 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.List; +import java.util.Map; import java.util.UUID; import java.util.function.Function; @@ -1515,26 +1516,56 @@ private void notFoundTestForElementsIds(UUID networkUuid, String variantId, Elem .andExpect(status().isNotFound()); } - private void succeedingTestForEquipmentsInfos(UUID networkUuid, String variantId, String equipmentPath, List substationsIds, String expectedJson, boolean withOptionalLoading) throws Exception { + private void succeedingTestForAllEquipmentsInfos(UUID networkUuid, String variantId, List substationsIds, String expectedJson, boolean withOptionalLoading) throws Exception { LinkedMultiValueMap queryParams = new LinkedMultiValueMap<>(); queryParams.add(QUERY_PARAM_VARIANT_ID, variantId); if (substationsIds != null) { queryParams.addAll(QUERY_PARAM_SUBSTATION_ID, substationsIds); } queryParams.add(QUERY_PARAM_INFO_TYPE, InfoType.TAB.toString()); + Map> body; if (withOptionalLoading) { - queryParams.add(String.format("optionalParameters[%s]", QUERY_PARAM_LOAD_OPERATIONAL_LIMIT_GROUPS), String.valueOf(true)); - queryParams.add(String.format("optionalParameters[%s]", QUERY_PARAM_LOAD_REGULATING_TERMINALS), String.valueOf(true)); + body = Map.of( + String.valueOf(ElementType.LINE), Map.of(QUERY_PARAM_LOAD_OPERATIONAL_LIMIT_GROUPS, String.valueOf(true)), + String.valueOf(ElementType.TWO_WINDINGS_TRANSFORMER), Map.of(QUERY_PARAM_LOAD_OPERATIONAL_LIMIT_GROUPS, String.valueOf(true)), + String.valueOf(ElementType.GENERATOR), Map.of(QUERY_PARAM_LOAD_REGULATING_TERMINALS, String.valueOf(true)) + ); + } else { + body = Map.of(); } - MvcResult mvcResult = mvc.perform(get("/v1/networks/{networkUuid}/{equipmentPath}", networkUuid, equipmentPath).queryParams(queryParams)) + MvcResult mvcResult = mvc.perform(post("/v1/networks/{networkUuid}/all", networkUuid).queryParams(queryParams).contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(body))) .andExpect(status().isOk()) .andReturn(); JSONAssert.assertEquals(expectedJson, mvcResult.getResponse().getContentAsString(), JSONCompareMode.NON_EXTENSIBLE); } + private void succeedingTestForAllEquipmentsInfos(UUID networkUuid, String variantId, List substationsIds, String expectedJson) throws Exception { + succeedingTestForAllEquipmentsInfos(networkUuid, variantId, substationsIds, expectedJson, true); + } + + private void notFoundTestForAllEquipmentsInfos(UUID networkUuid, String variantId, List substationsIds) throws Exception { + LinkedMultiValueMap queryParams = new LinkedMultiValueMap<>(); + queryParams.add(QUERY_PARAM_VARIANT_ID, variantId); + if (!substationsIds.isEmpty()) { + queryParams.addAll(QUERY_PARAM_SUBSTATION_ID, substationsIds); + } + mvc.perform(post("/v1/networks/{networkUuid}/all", networkUuid).queryParams(queryParams).contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(Map.of()))) + .andExpect(status().isNotFound()); + } + private void succeedingTestForEquipmentsInfos(UUID networkUuid, String variantId, String equipmentPath, List substationsIds, String expectedJson) throws Exception { - succeedingTestForEquipmentsInfos(networkUuid, variantId, equipmentPath, substationsIds, expectedJson, true); + LinkedMultiValueMap queryParams = new LinkedMultiValueMap<>(); + queryParams.add(QUERY_PARAM_VARIANT_ID, variantId); + if (substationsIds != null) { + queryParams.addAll(QUERY_PARAM_SUBSTATION_ID, substationsIds); + } + queryParams.add(QUERY_PARAM_INFO_TYPE, InfoType.TAB.toString()); + MvcResult mvcResult = mvc.perform(get("/v1/networks/{networkUuid}/{equipmentPath}", networkUuid, equipmentPath).queryParams(queryParams)) + .andExpect(status().isOk()) + .andReturn(); + + JSONAssert.assertEquals(expectedJson, mvcResult.getResponse().getContentAsString(), JSONCompareMode.NON_EXTENSIBLE); } private void notFoundTestForEquipmentsInfos(UUID networkUuid, String variantId, String infosPath, List substationsIds) throws Exception { @@ -1844,24 +1875,24 @@ void shouldReturnNotFoundInsteadOfThreeWindingsTransformersIds() throws Exceptio @Test void shouldReturnAllData() throws Exception { - succeedingTestForEquipmentsInfos(NETWORK_UUID, null, "all", null, resourceToString("/all-data.json")); - succeedingTestForEquipmentsInfos(NETWORK_UUID, null, "all", List.of("P3"), resourceToString("/partial-all-data.json")); - succeedingTestForEquipmentsInfos(NETWORK_UUID, VARIANT_ID, "all", null, resourceToString("/all-data-in-variant.json")); - succeedingTestForEquipmentsInfos(NETWORK_UUID, VARIANT_ID, "all", List.of("P3"), resourceToString("/partial-all-data-in-variant.json")); - succeedingTestForEquipmentsInfos(NETWORK_UUID, null, "all", List.of("P3", "P6"), resourceToString("/partial-all-map-data-no-redundant-lines.json")); + succeedingTestForAllEquipmentsInfos(NETWORK_UUID, null, null, resourceToString("/all-data.json")); + succeedingTestForAllEquipmentsInfos(NETWORK_UUID, null, List.of("P3"), resourceToString("/partial-all-data.json")); + succeedingTestForAllEquipmentsInfos(NETWORK_UUID, VARIANT_ID, null, resourceToString("/all-data-in-variant.json")); + succeedingTestForAllEquipmentsInfos(NETWORK_UUID, VARIANT_ID, List.of("P3"), resourceToString("/partial-all-data-in-variant.json")); + succeedingTestForAllEquipmentsInfos(NETWORK_UUID, null, List.of("P3", "P6"), resourceToString("/partial-all-map-data-no-redundant-lines.json")); } @Test void shouldReturnAllDataWithoutOptionals() throws Exception { - succeedingTestForEquipmentsInfos(NETWORK_UUID, null, "all", null, resourceToString("/all-data-without-optionals.json"), false); + succeedingTestForAllEquipmentsInfos(NETWORK_UUID, null, null, resourceToString("/all-data-without-optionals.json"), false); } @Test void shouldReturnNotFoundInsteadOfAllData() throws Exception { - notFoundTestForEquipmentsInfos(NOT_FOUND_NETWORK_ID, null, "all", List.of()); - notFoundTestForEquipmentsInfos(NETWORK_UUID, VARIANT_ID_NOT_FOUND, "all", List.of()); - notFoundTestForEquipmentsInfos(NOT_FOUND_NETWORK_ID, null, "all", List.of("P1")); - notFoundTestForEquipmentsInfos(NETWORK_UUID, VARIANT_ID_NOT_FOUND, "all", List.of("P1")); + notFoundTestForAllEquipmentsInfos(NOT_FOUND_NETWORK_ID, null, List.of()); + notFoundTestForAllEquipmentsInfos(NETWORK_UUID, VARIANT_ID_NOT_FOUND, List.of()); + notFoundTestForAllEquipmentsInfos(NOT_FOUND_NETWORK_ID, null, List.of("P1")); + notFoundTestForAllEquipmentsInfos(NETWORK_UUID, VARIANT_ID_NOT_FOUND, List.of("P1")); } @Test From 33e22d1f31fbca561576373815b450ba45a8d867 Mon Sep 17 00:00:00 2001 From: Joris Mancini Date: Wed, 3 Sep 2025 12:10:08 +0200 Subject: [PATCH 3/5] fix: tests with branches Signed-off-by: Joris Mancini --- .../network/map/NetworkMapControllerTest.java | 1 + .../resources/all-data-without-optionals.json | 232 ++++++++++++++++++ 2 files changed, 233 insertions(+) diff --git a/src/test/java/org/gridsuite/network/map/NetworkMapControllerTest.java b/src/test/java/org/gridsuite/network/map/NetworkMapControllerTest.java index 05703dbb..d006799e 100644 --- a/src/test/java/org/gridsuite/network/map/NetworkMapControllerTest.java +++ b/src/test/java/org/gridsuite/network/map/NetworkMapControllerTest.java @@ -1526,6 +1526,7 @@ private void succeedingTestForAllEquipmentsInfos(UUID networkUuid, String varian Map> body; if (withOptionalLoading) { body = Map.of( + String.valueOf(ElementType.BRANCH), Map.of(QUERY_PARAM_LOAD_OPERATIONAL_LIMIT_GROUPS, String.valueOf(true)), String.valueOf(ElementType.LINE), Map.of(QUERY_PARAM_LOAD_OPERATIONAL_LIMIT_GROUPS, String.valueOf(true)), String.valueOf(ElementType.TWO_WINDINGS_TRANSFORMER), Map.of(QUERY_PARAM_LOAD_OPERATIONAL_LIMIT_GROUPS, String.valueOf(true)), String.valueOf(ElementType.GENERATOR), Map.of(QUERY_PARAM_LOAD_REGULATING_TERMINALS, String.valueOf(true)) diff --git a/src/test/resources/all-data-without-optionals.json b/src/test/resources/all-data-without-optionals.json index 4a5842f4..a59a3209 100644 --- a/src/test/resources/all-data-without-optionals.json +++ b/src/test/resources/all-data-without-optionals.json @@ -2142,5 +2142,237 @@ "name": "NGEN5_2_2", "voltageLevelId": "VLGEN5" } + ], + "branches": [ + { + "id": "NHV1_NHV2_1", + "type": "LINE", + "voltageLevelId1": "VLHV1", + "voltageLevelId2": "VLHV2", + "nominalVoltage1": 380.0, + "nominalVoltage2": 380.0, + "substationId1": "P1", + "substationId2": "P2", + "country1": "FR", + "terminal1Connected": true, + "terminal2Connected": true, + "p1": 1.1, + "q1": 2.2, + "p2": 3.33, + "q2": 4.44, + "r": 9.0, + "x": 10.0, + "substationProperties1": { + "Country": "FR" + } + }, + { + "id": "NHV1_NHV2_2", + "type": "LINE", + "voltageLevelId1": "VLHV1", + "voltageLevelId2": "VLHV2", + "nominalVoltage1": 380.0, + "nominalVoltage2": 380.0, + "substationId1": "P1", + "substationId2": "P2", + "country1": "FR", + "terminal1Connected": true, + "terminal2Connected": true, + "r": 3.0, + "x": 33.0, + "substationProperties1": { + "Country": "FR" + } + }, + { + "id": "LINE3", + "type": "LINE", + "voltageLevelId1": "VLGEN", + "voltageLevelId2": "VLGEN3", + "voltageLevelName1": "VLGEN_Name", + "nominalVoltage1": 24.0, + "nominalVoltage2": 24.0, + "substationId1": "P1", + "substationId2": "P3", + "country1": "FR", + "country2": "FR", + "terminal1Connected": true, + "terminal2Connected": true, + "p1": 200.0, + "p2": 100.0, + "r": 3.0, + "x": 33.0, + "branchObservability": { + "qualityP1": { + "standardDeviation": 23.31, + "isRedundant": true + }, + "qualityQ1": { + "standardDeviation": 23.25, + "isRedundant": true + }, + "qualityP2": { + "standardDeviation": 23.31, + "isRedundant": true + }, + "qualityQ2": { + "standardDeviation": 23.25, + "isRedundant": true + }, + "observable": true + }, + "substationProperties1": { + "Country": "FR" + }, + "voltageLevelProperties1": { + "Country": "FR" + }, + "substationProperties2": { + "Country": "FR" + }, + "operatingStatus": "PLANNED_OUTAGE", + "measurementP1": { + "value": 11.0, + "validity": true + }, + "measurementQ1": { + "value": 24.0, + "validity": false + }, + "measurementQ2": { + "value": 45.0, + "validity": true + } + }, + { + "id": "LINE4", + "type": "LINE", + "voltageLevelId1": "VLGEN6", + "voltageLevelId2": "VLGEN3", + "nominalVoltage1": 24.0, + "nominalVoltage2": 24.0, + "substationId1": "P6", + "substationId2": "P3", + "country1": "FR", + "country2": "FR", + "terminal1Connected": true, + "terminal2Connected": true, + "r": 3.0, + "x": 33.0, + "substationProperties2": { + "Country": "FR" + } + }, + { + "id": "NGEN_NHV1", + "type": "TWO_WINDINGS_TRANSFORMER", + "voltageLevelId1": "VLGEN", + "voltageLevelId2": "VLHV1", + "voltageLevelName1": "VLGEN_Name", + "nominalVoltage1": 24.0, + "nominalVoltage2": 380.0, + "substationId1": "P1", + "substationId2": "P1", + "country1": "FR", + "country2": "FR", + "terminal1Connected": true, + "terminal2Connected": true, + "p1": 11.1, + "q1": 12.2, + "p2": 13.33, + "q2": 14.44, + "r": 0.26658461538461536, + "x": 11.104492831516762, + "substationProperties1": { + "Country": "FR" + }, + "voltageLevelProperties1": { + "Country": "FR" + }, + "substationProperties2": { + "Country": "FR" + }, + "operatingStatus": "PLANNED_OUTAGE" + }, + { + "id": "NHV2_NLOAD", + "type": "TWO_WINDINGS_TRANSFORMER", + "voltageLevelId1": "VLHV2", + "voltageLevelId2": "VLLOAD", + "nominalVoltage1": 380.0, + "nominalVoltage2": 150.0, + "substationId1": "P2", + "substationId2": "P2", + "terminal1Connected": true, + "terminal2Connected": true, + "p1": 5.5, + "q1": 6.6, + "p2": 7.77, + "q2": 8.88, + "r": 0.04724999999999999, + "x": 4.049724365620455, + "operatingStatus": "PLANNED_OUTAGE" + }, + { + "id": "NGEN_NHV2", + "type": "TWO_WINDINGS_TRANSFORMER", + "voltageLevelId1": "VLGEN", + "voltageLevelId2": "VLHV1", + "voltageLevelName1": "VLGEN_Name", + "nominalVoltage1": 24.0, + "nominalVoltage2": 380.0, + "substationId1": "P1", + "substationId2": "P1", + "country1": "FR", + "country2": "FR", + "terminal1Connected": true, + "terminal2Connected": true, + "r": 47.0, + "x": 23.0, + "branchObservability": { + "qualityP1": { + "standardDeviation": 23.31, + "isRedundant": true + }, + "qualityQ1": { + "standardDeviation": 23.25, + "isRedundant": true + }, + "qualityP2": { + "standardDeviation": 23.31, + "isRedundant": true + }, + "qualityQ2": { + "standardDeviation": 23.25, + "isRedundant": true + }, + "observable": true + }, + "substationProperties1": { + "Country": "FR" + }, + "voltageLevelProperties1": { + "Country": "FR" + }, + "substationProperties2": { + "Country": "FR" + }, + "measurementP1": { + "value": 27.0, + "validity": true + }, + "measurementQ1": { + "value": 13.0, + "validity": true + }, + "measurementP2": { + "value": 68.0, + "validity": false + }, + "measurementQ2": { + "value": 53.0, + "validity": false + } + } ] } \ No newline at end of file From c08a6e752d6a95b956ae2a6dbe7db35f93b73382 Mon Sep 17 00:00:00 2001 From: Joris Mancini Date: Wed, 3 Sep 2025 12:18:10 +0200 Subject: [PATCH 4/5] fix: tests and sonar Signed-off-by: Joris Mancini --- .../network/map/dto/mapper/BranchInfosMapper.java | 4 ++-- .../network/map/dto/mapper/GeneratorInfosMapper.java | 4 ++-- .../network/map/dto/mapper/LineInfosMapper.java | 4 ++-- .../dto/mapper/TwoWindingsTransformerInfosMapper.java | 4 ++-- .../network/map/NetworkMapControllerTest.java | 10 ---------- 5 files changed, 8 insertions(+), 18 deletions(-) diff --git a/src/main/java/org/gridsuite/network/map/dto/mapper/BranchInfosMapper.java b/src/main/java/org/gridsuite/network/map/dto/mapper/BranchInfosMapper.java index 1d07eb05..b8ca5096 100644 --- a/src/main/java/org/gridsuite/network/map/dto/mapper/BranchInfosMapper.java +++ b/src/main/java/org/gridsuite/network/map/dto/mapper/BranchInfosMapper.java @@ -40,7 +40,7 @@ public static ElementInfos toData(@NonNull final Identifiable identifiable, final Branch branch = (Branch) identifiable; final Double dcPowerFactor = Optional.ofNullable(infoTypeParameters.getOptionalParameters().get(QUERY_PARAM_DC_POWERFACTOR)) .map(Double::valueOf).orElse(null); - final Boolean loadOperationalLimitGroups = Optional.ofNullable(infoTypeParameters.getOptionalParameters().get(QUERY_PARAM_LOAD_OPERATIONAL_LIMIT_GROUPS)) + final boolean loadOperationalLimitGroups = Optional.ofNullable(infoTypeParameters.getOptionalParameters().get(QUERY_PARAM_LOAD_OPERATIONAL_LIMIT_GROUPS)) .map(Boolean::valueOf).orElse(false); return switch (infoTypeParameters.getInfoType()) { case TAB -> toTabInfos(branch, dcPowerFactor, loadOperationalLimitGroups); @@ -52,7 +52,7 @@ public static ElementInfos toData(@NonNull final Identifiable identifiable, @NonNull final B builder, @NonNull final Branch branch, @Nullable final Double dcPowerFactor, - @NonNull final Boolean loadOperationalLimitGroups + @NonNull final boolean loadOperationalLimitGroups ) { /* even if x & r properties are in branch properties doc, it is not in branch getter but each impls... */ //TODO https://github.com/powsybl/powsybl-core/issues/3521 tagged for release 09/2025 diff --git a/src/main/java/org/gridsuite/network/map/dto/mapper/GeneratorInfosMapper.java b/src/main/java/org/gridsuite/network/map/dto/mapper/GeneratorInfosMapper.java index b6e5c0c2..bcf75f58 100644 --- a/src/main/java/org/gridsuite/network/map/dto/mapper/GeneratorInfosMapper.java +++ b/src/main/java/org/gridsuite/network/map/dto/mapper/GeneratorInfosMapper.java @@ -43,7 +43,7 @@ private GeneratorInfosMapper() { } public static ElementInfos toData(Identifiable identifiable, InfoTypeParameters infoTypeParameters) { - Boolean loadRegulatingTerminals = Optional.ofNullable(infoTypeParameters.getOptionalParameters().get(QUERY_PARAM_LOAD_REGULATING_TERMINALS)) + boolean loadRegulatingTerminals = Optional.ofNullable(infoTypeParameters.getOptionalParameters().get(QUERY_PARAM_LOAD_REGULATING_TERMINALS)) .map(Boolean::valueOf).orElse(false); return switch (infoTypeParameters.getInfoType()) { case TAB -> toTabInfos(identifiable, loadRegulatingTerminals); @@ -63,7 +63,7 @@ private static List getReactiveCapabilityCurvePo .collect(Collectors.toList()); } - private static GeneratorTabInfos toTabInfos(Identifiable identifiable, Boolean loadRegulatingTerminals) { + private static GeneratorTabInfos toTabInfos(Identifiable identifiable, boolean loadRegulatingTerminals) { Generator generator = (Generator) identifiable; Terminal terminal = generator.getTerminal(); GeneratorTabInfos.GeneratorTabInfosBuilder builder = GeneratorTabInfos.builder() diff --git a/src/main/java/org/gridsuite/network/map/dto/mapper/LineInfosMapper.java b/src/main/java/org/gridsuite/network/map/dto/mapper/LineInfosMapper.java index 2bc1ae9b..38935896 100644 --- a/src/main/java/org/gridsuite/network/map/dto/mapper/LineInfosMapper.java +++ b/src/main/java/org/gridsuite/network/map/dto/mapper/LineInfosMapper.java @@ -33,7 +33,7 @@ private LineInfosMapper() { public static ElementInfos toData(Identifiable identifiable, InfoTypeParameters infoTypeParameters) { String dcPowerFactorStr = infoTypeParameters.getOptionalParameters().getOrDefault(QUERY_PARAM_DC_POWERFACTOR, null); Double dcPowerFactor = dcPowerFactorStr == null ? null : Double.valueOf(dcPowerFactorStr); - Boolean loadOperationalLimitGroups = Optional.ofNullable(infoTypeParameters.getOptionalParameters().get(QUERY_PARAM_LOAD_OPERATIONAL_LIMIT_GROUPS)) + boolean loadOperationalLimitGroups = Optional.ofNullable(infoTypeParameters.getOptionalParameters().get(QUERY_PARAM_LOAD_OPERATIONAL_LIMIT_GROUPS)) .map(Boolean::valueOf).orElse(false); return switch (infoTypeParameters.getInfoType()) { case TAB -> toTabInfos(identifiable, dcPowerFactor, loadOperationalLimitGroups); @@ -136,7 +136,7 @@ private static LineMapInfos toMapInfos(Identifiable identifiable, Double dcPo return builder.build(); } - private static LineTabInfos toTabInfos(Identifiable identifiable, Double dcPowerFactor, Boolean loadOperationalLimitGroups) { + private static LineTabInfos toTabInfos(Identifiable identifiable, Double dcPowerFactor, boolean loadOperationalLimitGroups) { final Line line = (Line) identifiable; return toTabBuilder((LineTabInfosBuilder) LineTabInfos.builder(), line, dcPowerFactor, loadOperationalLimitGroups) .g1(line.getG1()) diff --git a/src/main/java/org/gridsuite/network/map/dto/mapper/TwoWindingsTransformerInfosMapper.java b/src/main/java/org/gridsuite/network/map/dto/mapper/TwoWindingsTransformerInfosMapper.java index b4039e56..6b1da2a8 100644 --- a/src/main/java/org/gridsuite/network/map/dto/mapper/TwoWindingsTransformerInfosMapper.java +++ b/src/main/java/org/gridsuite/network/map/dto/mapper/TwoWindingsTransformerInfosMapper.java @@ -42,7 +42,7 @@ private TwoWindingsTransformerInfosMapper() { public static ElementInfos toData(Identifiable identifiable, InfoTypeParameters infoTypeParameters) { String dcPowerFactorStr = infoTypeParameters.getOptionalParameters().getOrDefault(QUERY_PARAM_DC_POWERFACTOR, null); Double dcPowerFactor = dcPowerFactorStr == null ? null : Double.valueOf(dcPowerFactorStr); - Boolean loadOperationalLimitGroups = Optional.ofNullable(infoTypeParameters.getOptionalParameters().get(QUERY_PARAM_LOAD_OPERATIONAL_LIMIT_GROUPS)) + boolean loadOperationalLimitGroups = Optional.ofNullable(infoTypeParameters.getOptionalParameters().get(QUERY_PARAM_LOAD_OPERATIONAL_LIMIT_GROUPS)) .map(Boolean::valueOf).orElse(false); return switch (infoTypeParameters.getInfoType()) { case LIST -> ElementInfosMapper.toListInfos(identifiable); @@ -108,7 +108,7 @@ private static TwoWindingsTransformerFormInfos toFormInfos(Identifiable ident return builder.build(); } - private static TwoWindingsTransformerTabInfos toTabInfos(Identifiable identifiable, Double dcPowerFactor, Boolean loadOperationalLimitGroups) { + private static TwoWindingsTransformerTabInfos toTabInfos(Identifiable identifiable, Double dcPowerFactor, boolean loadOperationalLimitGroups) { final TwoWindingsTransformer twoWT = (TwoWindingsTransformer) identifiable; return toTabBuilder((TwoWindingsTransformerTabInfosBuilder) TwoWindingsTransformerTabInfos.builder(), twoWT, dcPowerFactor, loadOperationalLimitGroups) .country(ElementUtils.mapCountry(ElementUtils.findFirstSubstation(List.of(twoWT.getTerminal1(), twoWT.getTerminal2())))) diff --git a/src/test/java/org/gridsuite/network/map/NetworkMapControllerTest.java b/src/test/java/org/gridsuite/network/map/NetworkMapControllerTest.java index d006799e..9e9c2117 100644 --- a/src/test/java/org/gridsuite/network/map/NetworkMapControllerTest.java +++ b/src/test/java/org/gridsuite/network/map/NetworkMapControllerTest.java @@ -1569,16 +1569,6 @@ private void succeedingTestForEquipmentsInfos(UUID networkUuid, String variantId JSONAssert.assertEquals(expectedJson, mvcResult.getResponse().getContentAsString(), JSONCompareMode.NON_EXTENSIBLE); } - private void notFoundTestForEquipmentsInfos(UUID networkUuid, String variantId, String infosPath, List substationsIds) throws Exception { - LinkedMultiValueMap queryParams = new LinkedMultiValueMap<>(); - queryParams.add(QUERY_PARAM_VARIANT_ID, variantId); - if (!substationsIds.isEmpty()) { - queryParams.addAll(QUERY_PARAM_SUBSTATION_ID, substationsIds); - } - mvc.perform(get("/v1/networks/{networkUuid}/{infosPath}", networkUuid, infosPath).queryParams(queryParams)) - .andExpect(status().isNotFound()); - } - private void shouldNotExistBranchOr3WTVoltageLevelId(UUID networkUuid, String variantId, ThreeSides side, String equipmentId) throws Exception { mvc.perform(get("/v1/networks/{networkUuid}/branch-or-3wt/{equipmentId}/voltage-level-id", networkUuid, equipmentId) .queryParam(QUERY_PARAM_VARIANT_ID, variantId) From 65c25fc7435473c2d07f04ab34b3114adafe6d05 Mon Sep 17 00:00:00 2001 From: Joris Mancini Date: Fri, 5 Sep 2025 17:09:36 +0200 Subject: [PATCH 5/5] feat: add selected operational limits group by default Signed-off-by: Joris Mancini --- .../dto/definition/branch/BranchTabInfos.java | 10 +- .../map/dto/mapper/BranchInfosMapper.java | 16 +- ...ansformers-tab-data-without-optionals.json | 53 +++ .../2-windings-transformers-tab-data.json | 57 +++- src/test/resources/all-data-in-variant.json | 310 ++++++++++++++++-- .../resources/all-data-without-optionals.json | 290 ++++++++++++++++ src/test/resources/all-data.json | 310 ++++++++++++++++-- .../partial-all-data-in-variant.json | 72 +++- src/test/resources/partial-all-data.json | 72 +++- ...rtial-all-map-data-no-redundant-lines.json | 72 +++- 10 files changed, 1200 insertions(+), 62 deletions(-) diff --git a/src/main/java/org/gridsuite/network/map/dto/definition/branch/BranchTabInfos.java b/src/main/java/org/gridsuite/network/map/dto/definition/branch/BranchTabInfos.java index 827e8d79..4eaa7c4b 100644 --- a/src/main/java/org/gridsuite/network/map/dto/definition/branch/BranchTabInfos.java +++ b/src/main/java/org/gridsuite/network/map/dto/definition/branch/BranchTabInfos.java @@ -82,8 +82,11 @@ public class BranchTabInfos extends ElementInfosWithProperties { @JsonInclude(Include.NON_EMPTY) private List operationalLimitsGroup1Names; + @JsonInclude(Include.NON_EMPTY) + private CurrentLimitsData selectedOperationalLimitsGroup1; + @JsonInclude(Include.NON_NULL) - private String selectedOperationalLimitsGroup1; + private String selectedOperationalLimitsGroup1Name; @JsonInclude(Include.NON_EMPTY) private Map operationalLimitsGroup2; @@ -91,8 +94,11 @@ public class BranchTabInfos extends ElementInfosWithProperties { @JsonInclude(Include.NON_EMPTY) private List operationalLimitsGroup2Names; + @JsonInclude(Include.NON_EMPTY) + private CurrentLimitsData selectedOperationalLimitsGroup2; + @JsonInclude(Include.NON_NULL) - private String selectedOperationalLimitsGroup2; + private String selectedOperationalLimitsGroup2Name; @JsonInclude(Include.NON_ABSENT) private Optional branchObservability; diff --git a/src/main/java/org/gridsuite/network/map/dto/mapper/BranchInfosMapper.java b/src/main/java/org/gridsuite/network/map/dto/mapper/BranchInfosMapper.java index b8ca5096..29c080c9 100644 --- a/src/main/java/org/gridsuite/network/map/dto/mapper/BranchInfosMapper.java +++ b/src/main/java/org/gridsuite/network/map/dto/mapper/BranchInfosMapper.java @@ -72,15 +72,23 @@ public static ElementInfos toData(@NonNull final Identifiable identifiable, // common properties final Terminal terminal1 = branch.getTerminal1(); final Terminal terminal2 = branch.getTerminal2(); + + branch.getSelectedOperationalLimitsGroup1() + .flatMap(OperationalLimitsGroup::getCurrentLimits) + .map(cl -> builder.selectedOperationalLimitsGroup1(toMapDataCurrentLimits(cl, null, null))); + branch.getSelectedOperationalLimitsGroupId1().map(name -> builder.selectedOperationalLimitsGroup1Name(name)); + branch.getSelectedOperationalLimitsGroup2() + .flatMap(OperationalLimitsGroup::getCurrentLimits) + .map(cl -> builder.selectedOperationalLimitsGroup2(toMapDataCurrentLimits(cl, null, null))); + branch.getSelectedOperationalLimitsGroupId2().map(name -> builder.selectedOperationalLimitsGroup2Name(name)); + if (loadOperationalLimitGroups) { final Map mapOperationalLimitsGroup1 = buildCurrentLimitsMap(branch.getOperationalLimitsGroups1()); builder.operationalLimitsGroup1(mapOperationalLimitsGroup1) - .operationalLimitsGroup1Names(List.copyOf(mapOperationalLimitsGroup1.keySet())) - .selectedOperationalLimitsGroup1(branch.getSelectedOperationalLimitsGroupId1().orElse(null)); + .operationalLimitsGroup1Names(List.copyOf(mapOperationalLimitsGroup1.keySet())); final Map mapOperationalLimitsGroup2 = buildCurrentLimitsMap(branch.getOperationalLimitsGroups2()); builder.operationalLimitsGroup2(mapOperationalLimitsGroup2) - .operationalLimitsGroup2Names(List.copyOf(mapOperationalLimitsGroup2.keySet())) - .selectedOperationalLimitsGroup2(branch.getSelectedOperationalLimitsGroupId2().orElse(null)); + .operationalLimitsGroup2Names(List.copyOf(mapOperationalLimitsGroup2.keySet())); } //noinspection unchecked return (B) builder diff --git a/src/test/resources/2-windings-transformers-tab-data-without-optionals.json b/src/test/resources/2-windings-transformers-tab-data-without-optionals.json index 352fcce7..b941441a 100644 --- a/src/test/resources/2-windings-transformers-tab-data-without-optionals.json +++ b/src/test/resources/2-windings-transformers-tab-data-without-optionals.json @@ -19,6 +19,35 @@ "q2": 14.44, "r": 0.26658461538461536, "x": 11.104492831516762, + "selectedOperationalLimitsGroup1": { + "permanentLimit": 750.4, + "temporaryLimits": [ + { + "name": "IT5", + "value": 300.0, + "acceptableDuration": 2087 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "limit set 1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 780.6, + "temporaryLimits": [ + { + "name": "IT20", + "value": 1200.0, + "acceptableDuration": 961 + }, + { + "name": "N/A", + "value": 2.147483647E9, + "acceptableDuration": 664 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "limit set 1", "substationProperties1": { "Country": "FR" }, @@ -164,6 +193,30 @@ "terminal2Connected": true, "r": 47.0, "x": 23.0, + "selectedOperationalLimitsGroup1": { + "permanentLimit": 300.4, + "temporaryLimits": [ + { + "name": "IT20", + "value": 400.0, + "acceptableDuration": 87 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "DEFAULT", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 280.6, + "temporaryLimits": [ + { + "name": "N/A", + "value": 98.0, + "acceptableDuration": 34 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "DEFAULT", "branchObservability": { "qualityP1": { "standardDeviation": 23.31, diff --git a/src/test/resources/2-windings-transformers-tab-data.json b/src/test/resources/2-windings-transformers-tab-data.json index 32ae7041..271a129a 100644 --- a/src/test/resources/2-windings-transformers-tab-data.json +++ b/src/test/resources/2-windings-transformers-tab-data.json @@ -35,7 +35,18 @@ "operationalLimitsGroup1Names": [ "limit set 1" ], - "selectedOperationalLimitsGroup1": "limit set 1", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 750.4, + "temporaryLimits": [ + { + "name": "IT5", + "value": 300.0, + "acceptableDuration": 2087 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "limit set 1", "operationalLimitsGroup2": { "limit set 1": { "permanentLimit": 780.6, @@ -57,7 +68,23 @@ "operationalLimitsGroup2Names": [ "limit set 1" ], - "selectedOperationalLimitsGroup2": "limit set 1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 780.6, + "temporaryLimits": [ + { + "name": "IT20", + "value": 1200.0, + "acceptableDuration": 961 + }, + { + "name": "N/A", + "value": 2.147483647E9, + "acceptableDuration": 664 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "limit set 1", "substationProperties1": { "Country": "FR" }, @@ -219,7 +246,18 @@ "operationalLimitsGroup1Names": [ "DEFAULT" ], - "selectedOperationalLimitsGroup1": "DEFAULT", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 300.4, + "temporaryLimits": [ + { + "name": "IT20", + "value": 400.0, + "acceptableDuration": 87 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "DEFAULT", "operationalLimitsGroup2": { "DEFAULT": { "permanentLimit": 280.6, @@ -236,7 +274,18 @@ "operationalLimitsGroup2Names": [ "DEFAULT" ], - "selectedOperationalLimitsGroup2": "DEFAULT", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 280.6, + "temporaryLimits": [ + { + "name": "N/A", + "value": 98.0, + "acceptableDuration": 34 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "DEFAULT", "branchObservability": { "qualityP1": { "standardDeviation": 23.31, diff --git a/src/test/resources/all-data-in-variant.json b/src/test/resources/all-data-in-variant.json index 97b24cf9..e732bc20 100644 --- a/src/test/resources/all-data-in-variant.json +++ b/src/test/resources/all-data-in-variant.json @@ -256,7 +256,18 @@ "operationalLimitsGroup1Names": [ "limit set 1" ], - "selectedOperationalLimitsGroup1": "limit set 1", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 700.4, + "temporaryLimits": [ + { + "name": "IT5", + "value": 250.0, + "acceptableDuration": 300 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "limit set 1", "operationalLimitsGroup2": { "limit set 1": { "permanentLimit": 800.8, @@ -278,7 +289,23 @@ "operationalLimitsGroup2Names": [ "limit set 1" ], - "selectedOperationalLimitsGroup2": "limit set 1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 800.8, + "temporaryLimits": [ + { + "name": "IT20", + "value": 300.0, + "acceptableDuration": 1200 + }, + { + "name": "IT10", + "value": 200.0, + "acceptableDuration": 600 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "limit set 1", "substationProperties1": { "Country": "FR" }, @@ -334,7 +361,23 @@ "group2", "group1" ], - "selectedOperationalLimitsGroup1": "group1", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "group1", "operationalLimitsGroup2": { "group4": { "permanentLimit": 320.0, @@ -363,7 +406,18 @@ "group4", "group3" ], - "selectedOperationalLimitsGroup2": "group4", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 320.0, + "temporaryLimits": [ + { + "name": "temporary1", + "value": 130.0, + "acceptableDuration": 200 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "group4", "substationProperties1": { "Country": "FR" }, @@ -411,7 +465,23 @@ "operationalLimitsGroup1Names": [ "group1" ], - "selectedOperationalLimitsGroup1": "group1", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "group1", "branchObservability": { "qualityP1": { "standardDeviation": 23.31, @@ -494,7 +564,23 @@ "operationalLimitsGroup2Names": [ "group1" ], - "selectedOperationalLimitsGroup2": "group1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "group1", "substationProperties2": { "Country": "FR" }, @@ -768,7 +854,18 @@ "operationalLimitsGroup1Names": [ "limit set 1" ], - "selectedOperationalLimitsGroup1": "limit set 1", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 750.4, + "temporaryLimits": [ + { + "name": "IT5", + "value": 300.0, + "acceptableDuration": 2087 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "limit set 1", "operationalLimitsGroup2": { "limit set 1": { "permanentLimit": 780.6, @@ -790,7 +887,23 @@ "operationalLimitsGroup2Names": [ "limit set 1" ], - "selectedOperationalLimitsGroup2": "limit set 1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 780.6, + "temporaryLimits": [ + { + "name": "IT20", + "value": 1200.0, + "acceptableDuration": 961 + }, + { + "name": "N/A", + "value": 2.147483647E9, + "acceptableDuration": 664 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "limit set 1", "substationProperties1": { "Country": "FR" }, @@ -952,7 +1065,18 @@ "operationalLimitsGroup1Names": [ "DEFAULT" ], - "selectedOperationalLimitsGroup1": "DEFAULT", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 300.4, + "temporaryLimits": [ + { + "name": "IT20", + "value": 400.0, + "acceptableDuration": 87 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "DEFAULT", "operationalLimitsGroup2": { "DEFAULT": { "permanentLimit": 280.6, @@ -969,7 +1093,18 @@ "operationalLimitsGroup2Names": [ "DEFAULT" ], - "selectedOperationalLimitsGroup2": "DEFAULT", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 280.6, + "temporaryLimits": [ + { + "name": "N/A", + "value": 98.0, + "acceptableDuration": 34 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "DEFAULT", "branchObservability": { "qualityP1": { "standardDeviation": 23.31, @@ -2412,7 +2547,18 @@ "operationalLimitsGroup1Names": [ "limit set 1" ], - "selectedOperationalLimitsGroup1": "limit set 1", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 700.4, + "temporaryLimits": [ + { + "name": "IT5", + "value": 250.0, + "acceptableDuration": 300 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "limit set 1", "operationalLimitsGroup2": { "limit set 1": { "permanentLimit": 800.8, @@ -2434,7 +2580,23 @@ "operationalLimitsGroup2Names": [ "limit set 1" ], - "selectedOperationalLimitsGroup2": "limit set 1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 800.8, + "temporaryLimits": [ + { + "name": "IT20", + "value": 300.0, + "acceptableDuration": 1200 + }, + { + "name": "IT10", + "value": 200.0, + "acceptableDuration": 600 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "limit set 1", "substationProperties1": { "Country": "FR" } @@ -2486,7 +2648,23 @@ "group2", "group1" ], - "selectedOperationalLimitsGroup1": "group1", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "group1", "operationalLimitsGroup2": { "group4": { "permanentLimit": 320.0, @@ -2515,7 +2693,18 @@ "group4", "group3" ], - "selectedOperationalLimitsGroup2": "group4", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 320.0, + "temporaryLimits": [ + { + "name": "temporary1", + "value": 130.0, + "acceptableDuration": 200 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "group4", "substationProperties1": { "Country": "FR" } @@ -2559,7 +2748,23 @@ "operationalLimitsGroup1Names": [ "group1" ], - "selectedOperationalLimitsGroup1": "group1", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "group1", "branchObservability": { "qualityP1": { "standardDeviation": 23.31, @@ -2638,7 +2843,23 @@ "operationalLimitsGroup2Names": [ "group1" ], - "selectedOperationalLimitsGroup2": "group1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "group1", "substationProperties2": { "Country": "FR" } @@ -2679,7 +2900,18 @@ "operationalLimitsGroup1Names": [ "limit set 1" ], - "selectedOperationalLimitsGroup1": "limit set 1", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 750.4, + "temporaryLimits": [ + { + "name": "IT5", + "value": 300.0, + "acceptableDuration": 2087 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "limit set 1", "operationalLimitsGroup2": { "limit set 1": { "permanentLimit": 780.6, @@ -2701,7 +2933,23 @@ "operationalLimitsGroup2Names": [ "limit set 1" ], - "selectedOperationalLimitsGroup2": "limit set 1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 780.6, + "temporaryLimits": [ + { + "name": "IT20", + "value": 1200.0, + "acceptableDuration": 961 + }, + { + "name": "N/A", + "value": 2.147483647E9, + "acceptableDuration": 664 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "limit set 1", "substationProperties1": { "Country": "FR" }, @@ -2764,7 +3012,18 @@ "operationalLimitsGroup1Names": [ "DEFAULT" ], - "selectedOperationalLimitsGroup1": "DEFAULT", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 300.4, + "temporaryLimits": [ + { + "name": "IT20", + "value": 400.0, + "acceptableDuration": 87 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "DEFAULT", "operationalLimitsGroup2": { "DEFAULT": { "permanentLimit": 280.6, @@ -2781,7 +3040,18 @@ "operationalLimitsGroup2Names": [ "DEFAULT" ], - "selectedOperationalLimitsGroup2": "DEFAULT", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 280.6, + "temporaryLimits": [ + { + "name": "N/A", + "value": 98.0, + "acceptableDuration": 34 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "DEFAULT", "branchObservability": { "qualityP1": { "standardDeviation": 23.31, diff --git a/src/test/resources/all-data-without-optionals.json b/src/test/resources/all-data-without-optionals.json index a59a3209..fba77e8b 100644 --- a/src/test/resources/all-data-without-optionals.json +++ b/src/test/resources/all-data-without-optionals.json @@ -240,6 +240,35 @@ "q2": 4.44, "r": 9.0, "x": 10.0, + "selectedOperationalLimitsGroup1": { + "permanentLimit": 700.4, + "temporaryLimits": [ + { + "name": "IT5", + "value": 250.0, + "acceptableDuration": 300 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "limit set 1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 800.8, + "temporaryLimits": [ + { + "name": "IT20", + "value": 300.0, + "acceptableDuration": 1200 + }, + { + "name": "IT10", + "value": 200.0, + "acceptableDuration": 600 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "limit set 1", "substationProperties1": { "Country": "FR" }, @@ -262,6 +291,35 @@ "terminal2Connected": true, "r": 3.0, "x": 33.0, + "selectedOperationalLimitsGroup1": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "group1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 320.0, + "temporaryLimits": [ + { + "name": "temporary1", + "value": 130.0, + "acceptableDuration": 200 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "group4", "substationProperties1": { "Country": "FR" }, @@ -288,6 +346,23 @@ "p2": 100.0, "r": 3.0, "x": 33.0, + "selectedOperationalLimitsGroup1": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "group1", "branchObservability": { "qualityP1": { "standardDeviation": 23.31, @@ -349,6 +424,23 @@ "terminal2Connected": true, "r": 3.0, "x": 33.0, + "selectedOperationalLimitsGroup2": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "group1", "substationProperties2": { "Country": "FR" }, @@ -606,6 +698,35 @@ "q2": 14.44, "r": 0.26658461538461536, "x": 11.104492831516762, + "selectedOperationalLimitsGroup1": { + "permanentLimit": 750.4, + "temporaryLimits": [ + { + "name": "IT5", + "value": 300.0, + "acceptableDuration": 2087 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "limit set 1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 780.6, + "temporaryLimits": [ + { + "name": "IT20", + "value": 1200.0, + "acceptableDuration": 961 + }, + { + "name": "N/A", + "value": 2.147483647E9, + "acceptableDuration": 664 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "limit set 1", "substationProperties1": { "Country": "FR" }, @@ -751,6 +872,30 @@ "terminal2Connected": true, "r": 47.0, "x": 23.0, + "selectedOperationalLimitsGroup1": { + "permanentLimit": 300.4, + "temporaryLimits": [ + { + "name": "IT20", + "value": 400.0, + "acceptableDuration": 87 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "DEFAULT", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 280.6, + "temporaryLimits": [ + { + "name": "N/A", + "value": 98.0, + "acceptableDuration": 34 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "DEFAULT", "branchObservability": { "qualityP1": { "standardDeviation": 23.31, @@ -2162,6 +2307,35 @@ "q2": 4.44, "r": 9.0, "x": 10.0, + "selectedOperationalLimitsGroup1": { + "permanentLimit": 700.4, + "temporaryLimits": [ + { + "name": "IT5", + "value": 250.0, + "acceptableDuration": 300 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "limit set 1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 800.8, + "temporaryLimits": [ + { + "name": "IT20", + "value": 300.0, + "acceptableDuration": 1200 + }, + { + "name": "IT10", + "value": 200.0, + "acceptableDuration": 600 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "limit set 1", "substationProperties1": { "Country": "FR" } @@ -2180,6 +2354,35 @@ "terminal2Connected": true, "r": 3.0, "x": 33.0, + "selectedOperationalLimitsGroup1": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "group1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 320.0, + "temporaryLimits": [ + { + "name": "temporary1", + "value": 130.0, + "acceptableDuration": 200 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "group4", "substationProperties1": { "Country": "FR" } @@ -2202,6 +2405,23 @@ "p2": 100.0, "r": 3.0, "x": 33.0, + "selectedOperationalLimitsGroup1": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "group1", "branchObservability": { "qualityP1": { "standardDeviation": 23.31, @@ -2259,6 +2479,23 @@ "terminal2Connected": true, "r": 3.0, "x": 33.0, + "selectedOperationalLimitsGroup2": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "group1", "substationProperties2": { "Country": "FR" } @@ -2283,6 +2520,35 @@ "q2": 14.44, "r": 0.26658461538461536, "x": 11.104492831516762, + "selectedOperationalLimitsGroup1": { + "permanentLimit": 750.4, + "temporaryLimits": [ + { + "name": "IT5", + "value": 300.0, + "acceptableDuration": 2087 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "limit set 1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 780.6, + "temporaryLimits": [ + { + "name": "IT20", + "value": 1200.0, + "acceptableDuration": 961 + }, + { + "name": "N/A", + "value": 2.147483647E9, + "acceptableDuration": 664 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "limit set 1", "substationProperties1": { "Country": "FR" }, @@ -2329,6 +2595,30 @@ "terminal2Connected": true, "r": 47.0, "x": 23.0, + "selectedOperationalLimitsGroup1": { + "permanentLimit": 300.4, + "temporaryLimits": [ + { + "name": "IT20", + "value": 400.0, + "acceptableDuration": 87 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "DEFAULT", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 280.6, + "temporaryLimits": [ + { + "name": "N/A", + "value": 98.0, + "acceptableDuration": 34 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "DEFAULT", "branchObservability": { "qualityP1": { "standardDeviation": 23.31, diff --git a/src/test/resources/all-data.json b/src/test/resources/all-data.json index dc639143..194766cc 100644 --- a/src/test/resources/all-data.json +++ b/src/test/resources/all-data.json @@ -256,7 +256,18 @@ "operationalLimitsGroup1Names": [ "limit set 1" ], - "selectedOperationalLimitsGroup1": "limit set 1", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 700.4, + "temporaryLimits": [ + { + "name": "IT5", + "value": 250.0, + "acceptableDuration": 300 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "limit set 1", "operationalLimitsGroup2": { "limit set 1": { "permanentLimit": 800.8, @@ -278,7 +289,23 @@ "operationalLimitsGroup2Names": [ "limit set 1" ], - "selectedOperationalLimitsGroup2": "limit set 1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 800.8, + "temporaryLimits": [ + { + "name": "IT20", + "value": 300.0, + "acceptableDuration": 1200 + }, + { + "name": "IT10", + "value": 200.0, + "acceptableDuration": 600 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "limit set 1", "substationProperties1": { "Country": "FR" }, @@ -334,7 +361,23 @@ "group2", "group1" ], - "selectedOperationalLimitsGroup1": "group1", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "group1", "operationalLimitsGroup2": { "group4": { "permanentLimit": 320.0, @@ -363,7 +406,18 @@ "group4", "group3" ], - "selectedOperationalLimitsGroup2": "group4", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 320.0, + "temporaryLimits": [ + { + "name": "temporary1", + "value": 130.0, + "acceptableDuration": 200 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "group4", "substationProperties1": { "Country": "FR" }, @@ -411,7 +465,23 @@ "operationalLimitsGroup1Names": [ "group1" ], - "selectedOperationalLimitsGroup1": "group1", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "group1", "branchObservability": { "qualityP1": { "standardDeviation": 23.31, @@ -494,7 +564,23 @@ "operationalLimitsGroup2Names": [ "group1" ], - "selectedOperationalLimitsGroup2": "group1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "group1", "substationProperties2": { "Country": "FR" }, @@ -768,7 +854,18 @@ "operationalLimitsGroup1Names": [ "limit set 1" ], - "selectedOperationalLimitsGroup1": "limit set 1", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 750.4, + "temporaryLimits": [ + { + "name": "IT5", + "value": 300.0, + "acceptableDuration": 2087 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "limit set 1", "operationalLimitsGroup2": { "limit set 1": { "permanentLimit": 780.6, @@ -790,7 +887,23 @@ "operationalLimitsGroup2Names": [ "limit set 1" ], - "selectedOperationalLimitsGroup2": "limit set 1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 780.6, + "temporaryLimits": [ + { + "name": "IT20", + "value": 1200.0, + "acceptableDuration": 961 + }, + { + "name": "N/A", + "value": 2.147483647E9, + "acceptableDuration": 664 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "limit set 1", "substationProperties1": { "Country": "FR" }, @@ -952,7 +1065,18 @@ "operationalLimitsGroup1Names": [ "DEFAULT" ], - "selectedOperationalLimitsGroup1": "DEFAULT", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 300.4, + "temporaryLimits": [ + { + "name": "IT20", + "value": 400.0, + "acceptableDuration": 87 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "DEFAULT", "operationalLimitsGroup2": { "DEFAULT": { "permanentLimit": 280.6, @@ -969,7 +1093,18 @@ "operationalLimitsGroup2Names": [ "DEFAULT" ], - "selectedOperationalLimitsGroup2": "DEFAULT", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 280.6, + "temporaryLimits": [ + { + "name": "N/A", + "value": 98.0, + "acceptableDuration": 34 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "DEFAULT", "branchObservability": { "qualityP1": { "standardDeviation": 23.31, @@ -2400,7 +2535,18 @@ "operationalLimitsGroup1Names": [ "limit set 1" ], - "selectedOperationalLimitsGroup1": "limit set 1", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 700.4, + "temporaryLimits": [ + { + "name": "IT5", + "value": 250.0, + "acceptableDuration": 300 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "limit set 1", "operationalLimitsGroup2": { "limit set 1": { "permanentLimit": 800.8, @@ -2422,7 +2568,23 @@ "operationalLimitsGroup2Names": [ "limit set 1" ], - "selectedOperationalLimitsGroup2": "limit set 1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 800.8, + "temporaryLimits": [ + { + "name": "IT20", + "value": 300.0, + "acceptableDuration": 1200 + }, + { + "name": "IT10", + "value": 200.0, + "acceptableDuration": 600 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "limit set 1", "substationProperties1": { "Country": "FR" } @@ -2474,7 +2636,23 @@ "group2", "group1" ], - "selectedOperationalLimitsGroup1": "group1", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "group1", "operationalLimitsGroup2": { "group4": { "permanentLimit": 320.0, @@ -2503,7 +2681,18 @@ "group4", "group3" ], - "selectedOperationalLimitsGroup2": "group4", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 320.0, + "temporaryLimits": [ + { + "name": "temporary1", + "value": 130.0, + "acceptableDuration": 200 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "group4", "substationProperties1": { "Country": "FR" } @@ -2547,7 +2736,23 @@ "operationalLimitsGroup1Names": [ "group1" ], - "selectedOperationalLimitsGroup1": "group1", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "group1", "branchObservability": { "qualityP1": { "standardDeviation": 23.31, @@ -2626,7 +2831,23 @@ "operationalLimitsGroup2Names": [ "group1" ], - "selectedOperationalLimitsGroup2": "group1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "group1", "substationProperties2": { "Country": "FR" } @@ -2667,7 +2888,18 @@ "operationalLimitsGroup1Names": [ "limit set 1" ], - "selectedOperationalLimitsGroup1": "limit set 1", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 750.4, + "temporaryLimits": [ + { + "name": "IT5", + "value": 300.0, + "acceptableDuration": 2087 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "limit set 1", "operationalLimitsGroup2": { "limit set 1": { "permanentLimit": 780.6, @@ -2689,7 +2921,23 @@ "operationalLimitsGroup2Names": [ "limit set 1" ], - "selectedOperationalLimitsGroup2": "limit set 1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 780.6, + "temporaryLimits": [ + { + "name": "IT20", + "value": 1200.0, + "acceptableDuration": 961 + }, + { + "name": "N/A", + "value": 2.147483647E9, + "acceptableDuration": 664 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "limit set 1", "substationProperties1": { "Country": "FR" }, @@ -2752,7 +3000,18 @@ "operationalLimitsGroup1Names": [ "DEFAULT" ], - "selectedOperationalLimitsGroup1": "DEFAULT", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 300.4, + "temporaryLimits": [ + { + "name": "IT20", + "value": 400.0, + "acceptableDuration": 87 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "DEFAULT", "operationalLimitsGroup2": { "DEFAULT": { "permanentLimit": 280.6, @@ -2769,7 +3028,18 @@ "operationalLimitsGroup2Names": [ "DEFAULT" ], - "selectedOperationalLimitsGroup2": "DEFAULT", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 280.6, + "temporaryLimits": [ + { + "name": "N/A", + "value": 98.0, + "acceptableDuration": 34 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "DEFAULT", "branchObservability": { "qualityP1": { "standardDeviation": 23.31, diff --git a/src/test/resources/partial-all-data-in-variant.json b/src/test/resources/partial-all-data-in-variant.json index 0b2ecdb9..1b491e7a 100644 --- a/src/test/resources/partial-all-data-in-variant.json +++ b/src/test/resources/partial-all-data-in-variant.json @@ -67,7 +67,23 @@ "operationalLimitsGroup2Names": [ "group1" ], - "selectedOperationalLimitsGroup2": "group1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "group1", "substationProperties2": { "Country": "FR" }, @@ -115,7 +131,23 @@ "operationalLimitsGroup1Names": [ "group1" ], - "selectedOperationalLimitsGroup1": "group1", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "group1", "branchObservability": { "qualityP1": { "standardDeviation": 23.31, @@ -412,7 +444,23 @@ "operationalLimitsGroup2Names": [ "group1" ], - "selectedOperationalLimitsGroup2": "group1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "group1", "substationProperties2": { "Country": "FR" } @@ -456,7 +504,23 @@ "operationalLimitsGroup1Names": [ "group1" ], - "selectedOperationalLimitsGroup1": "group1", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "group1", "branchObservability": { "qualityP1": { "standardDeviation": 23.31, diff --git a/src/test/resources/partial-all-data.json b/src/test/resources/partial-all-data.json index f5e22b49..c09b27ba 100644 --- a/src/test/resources/partial-all-data.json +++ b/src/test/resources/partial-all-data.json @@ -70,7 +70,23 @@ "operationalLimitsGroup1Names": [ "group1" ], - "selectedOperationalLimitsGroup1": "group1", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "group1", "branchObservability": { "qualityP1": { "standardDeviation": 23.31, @@ -153,7 +169,23 @@ "operationalLimitsGroup2Names": [ "group1" ], - "selectedOperationalLimitsGroup2": "group1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "group1", "substationProperties2": { "Country": "FR" }, @@ -393,7 +425,23 @@ "operationalLimitsGroup1Names": [ "group1" ], - "selectedOperationalLimitsGroup1": "group1", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "group1", "branchObservability": { "qualityP1": { "standardDeviation": 23.31, @@ -472,7 +520,23 @@ "operationalLimitsGroup2Names": [ "group1" ], - "selectedOperationalLimitsGroup2": "group1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "group1", "substationProperties2": { "Country": "FR" } diff --git a/src/test/resources/partial-all-map-data-no-redundant-lines.json b/src/test/resources/partial-all-map-data-no-redundant-lines.json index 7840cdc6..7f14440a 100644 --- a/src/test/resources/partial-all-map-data-no-redundant-lines.json +++ b/src/test/resources/partial-all-map-data-no-redundant-lines.json @@ -85,7 +85,23 @@ "operationalLimitsGroup2Names": [ "group1" ], - "selectedOperationalLimitsGroup2": "group1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "group1", "substationProperties2": { "Country": "FR" }, @@ -133,7 +149,23 @@ "operationalLimitsGroup1Names": [ "group1" ], - "selectedOperationalLimitsGroup1": "group1", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "group1", "branchObservability": { "qualityP1": { "standardDeviation": 23.31, @@ -440,7 +472,23 @@ "operationalLimitsGroup2Names": [ "group1" ], - "selectedOperationalLimitsGroup2": "group1", + "selectedOperationalLimitsGroup2": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup2Name": "group1", "substationProperties2": { "Country": "FR" } @@ -484,7 +532,23 @@ "operationalLimitsGroup1Names": [ "group1" ], - "selectedOperationalLimitsGroup1": "group1", + "selectedOperationalLimitsGroup1": { + "permanentLimit": 220.0, + "temporaryLimits": [ + { + "name": "temporary2", + "value": 70.0, + "acceptableDuration": 150 + }, + { + "name": "temporary1", + "value": 50.0, + "acceptableDuration": 100 + } + ], + "applicability": null + }, + "selectedOperationalLimitsGroup1Name": "group1", "branchObservability": { "qualityP1": { "standardDeviation": 23.31,