Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.gridsuite.network.map.dto.InfoTypeParameters;
import org.gridsuite.network.map.dto.definition.hvdc.HvdcShuntCompensatorsInfos;
import org.gridsuite.network.map.dto.definition.topology.BusBarSectionsInfos;
import org.gridsuite.network.map.dto.definition.topology.FeederBaysBusBarSectionsInfos;
import org.gridsuite.network.map.dto.definition.topology.FeederBayInfos;
import org.gridsuite.network.map.dto.definition.topology.SwitchInfos;
import org.gridsuite.network.map.services.NetworkMapService;
import org.springframework.context.annotation.ComponentScan;
Expand Down Expand Up @@ -95,12 +95,12 @@ public List<ElementInfos> getVoltageLevelBusesOrBusBarSections(@Parameter(descri
return networkMapService.getVoltageLevelBusesOrBusbarSections(networkUuid, voltageLevelId, variantId);
}

@GetMapping(value = "/networks/{networkUuid}/voltage-levels/{voltageLevelId}/feeder-bays-and-bus-bar-sections", produces = APPLICATION_JSON_VALUE)
@GetMapping(value = "/networks/{networkUuid}/voltage-levels/{voltageLevelId}/feeder-bays", produces = APPLICATION_JSON_VALUE)
@Operation(summary = "get feeder bays and bus bar sections information")
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = " feeder bays and bus bar sections information retrieved")})
public FeederBaysBusBarSectionsInfos getFeederBaysInfos(@Parameter(description = "Network UUID") @PathVariable("networkUuid") UUID networkUuid,
@Parameter(description = "Voltage level id") @PathVariable("voltageLevelId") String voltageLevelId,
@Parameter(description = "Variant Id") @RequestParam(name = "variantId", required = false) String variantId) {
public Map<String, List<FeederBayInfos>> getFeederBaysInfos(@Parameter(description = "Network UUID") @PathVariable("networkUuid") UUID networkUuid,
@Parameter(description = "Voltage level id") @PathVariable("voltageLevelId") String voltageLevelId,
@Parameter(description = "Variant Id") @RequestParam(name = "variantId", required = false) String variantId) {
return networkMapService.getFeederBaysInfos(networkUuid, voltageLevelId, variantId);
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.gridsuite.network.map.dto.InfoTypeParameters;
import org.gridsuite.network.map.dto.definition.hvdc.HvdcShuntCompensatorsInfos;
import org.gridsuite.network.map.dto.definition.topology.BusBarSectionsInfos;
import org.gridsuite.network.map.dto.definition.topology.FeederBaysBusBarSectionsInfos;
import org.gridsuite.network.map.dto.definition.topology.FeederBayInfos;
import org.gridsuite.network.map.dto.definition.topology.SwitchInfos;
import org.gridsuite.network.map.dto.mapper.ElementInfosMapper;
import org.gridsuite.network.map.dto.mapper.HvdcInfosMapper;
Expand Down Expand Up @@ -137,13 +137,10 @@ public BusBarSectionsInfos getBusBarSectionsInfos(UUID networkUuid, String volta
return TopologyUtils.getBusBarSectionsInfos(voltageLevel);
}

public FeederBaysBusBarSectionsInfos getFeederBaysInfos(UUID networkUuid, String voltageLevelId, String variantId) {
public Map<String, List<FeederBayInfos>> getFeederBaysInfos(UUID networkUuid, String voltageLevelId, String variantId) {
Network network = getNetwork(networkUuid, PreloadingStrategy.NONE, variantId);
VoltageLevel voltageLevel = network.getVoltageLevel(voltageLevelId);
FeederBaysBusBarSectionsInfos.FeederBaysBusBarSectionsInfosBuilder<?, ?> builder = FeederBaysBusBarSectionsInfos.builder();
builder.feederBaysInfos(TopologyUtils.getFeederBaysInfos(voltageLevel));
builder.busBarSectionsInfos(TopologyUtils.getBusBarSectionsInfos(voltageLevel));
return builder.build();
return TopologyUtils.getFeederBaysInfos(voltageLevel);
}

public List<SwitchInfos> getSwitchInfos(UUID networkUuid, String voltageLevelId, String variantId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1446,8 +1446,8 @@ private static String resourceToString(String resource) throws IOException {
return new String(ByteStreams.toByteArray(NetworkMapControllerTest.class.getResourceAsStream(resource)), StandardCharsets.UTF_8);
}

private void succeedingTestGettingFeederBaysAndBusBarSectionsInfos(UUID networkUuid, String variantId, String voltageLevelId, String expectedJson) throws Exception {
MvcResult res = mvc.perform(get("/v1/networks/{networkUuid}/voltage-levels/{voltageLevelId}/feeder-bays-and-bus-bar-sections", networkUuid, voltageLevelId)
private void succeedingTestGettingFeederBaysInfos(UUID networkUuid, String variantId, String voltageLevelId, String expectedJson) throws Exception {
MvcResult res = mvc.perform(get("/v1/networks/{networkUuid}/voltage-levels/{voltageLevelId}/feeder-bays", networkUuid, voltageLevelId)
.queryParam(QUERY_PARAM_VARIANT_ID, variantId))
.andExpect(status().isOk())
.andReturn();
Expand Down Expand Up @@ -2376,7 +2376,7 @@ void shouldReturnVoltageLevelBusbarSectionsFormInfos() throws Exception {

@Test
void shouldReturnVoltageLevelFeederBaysFormInfos() throws Exception {
succeedingTestGettingFeederBaysAndBusBarSectionsInfos(NETWORK_UUID, null, "VLGEN4", resourceToString("/feeder-bays-data.json"));
succeedingTestGettingFeederBaysInfos(NETWORK_UUID, null, "VLGEN4", resourceToString("/feeder-bays-data.json"));
}

@Test
Expand Down
68 changes: 28 additions & 40 deletions src/test/resources/feeder-bays-data.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,31 @@
{
"feederBaysInfos": {
"SHUNT_VLNB": [
{
"busbarSectionId": "NGEN4",
"connectablePositionInfos": {
"connectionDirection": null
},
"connectionSide": null
}
],
"LINE7": [
{
"busbarSectionId": "NGEN4",
"connectablePositionInfos": {
"connectionDirection": "BOTTOM",
"connectionPosition": 5,
"connectionName": "LINE7_Side_VLGEN4"
},
"connectionSide": "ONE"
}
],
"SHUNT_NON_LINEAR": [
{
"busbarSectionId": "NGEN4",
"connectablePositionInfos": {
"connectionDirection": null
},
"connectionSide": null
}
]
},
"busBarSectionsInfos": {
"topologyKind": "NODE_BREAKER",
"isSymmetrical": true,
"isBusbarSectionPositionFound": true,
"busBarSections": {
"1": [
"NGEN4"
]
"SHUNT_VLNB": [
{
"busbarSectionId": "NGEN4",
"connectablePositionInfos": {
"connectionDirection": null
},
"connectionSide": null
}
}
],
"LINE7": [
{
"busbarSectionId": "NGEN4",
"connectablePositionInfos": {
"connectionDirection": "BOTTOM",
"connectionPosition": 5,
"connectionName": "LINE7_Side_VLGEN4"
},
"connectionSide": "ONE"
}
],
"SHUNT_NON_LINEAR": [
{
"busbarSectionId": "NGEN4",
"connectablePositionInfos": {
"connectionDirection": null
},
"connectionSide": null
}
]
}