-
Notifications
You must be signed in to change notification settings - Fork 0
get all voltage level connections #277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
EtienneLt
wants to merge
22
commits into
main
Choose a base branch
from
get-all-voltage-levels-connections
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
98d2a6e
get all voltage level connections
EtienneLt 397e97c
Merge branch 'main' into get-all-voltage-levels-connections
EtienneLt 884a664
fix
EtienneLt 732185b
refactor
EtienneLt 46700f8
refactor everything
EtienneLt 6b9b5a4
fix
EtienneLt 6d0e15e
fix
EtienneLt 01cbb74
fix
EtienneLt 80a13c0
Merge branch 'main' into get-all-voltage-levels-connections
EtienneLt 7774634
fix
EtienneLt 0305db9
remove error from merge
EtienneLt 84cff31
checkstyle
EtienneLt a971d0c
Merge branch 'main' into get-all-voltage-levels-connections
EtienneLt 1e5770b
add tests
EtienneLt f63c963
add side for branches
EtienneLt 7e6fd6b
add side
ghazwarhili c966b59
rename side to connectionSide
ghazwarhili c2a535e
fix naming
ghazwarhili 12d9d9f
renaming
ghazwarhili fed0ec8
fix for BusbarSectionFinderTraverser
ghazwarhili 34b31cc
code review remarks part 1
ghazwarhili 5a615ba
code review remarks part 2
ghazwarhili File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
...ain/java/org/gridsuite/network/map/dto/definition/extension/ConnectablePositionInfos.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/main/java/org/gridsuite/network/map/dto/definition/voltagelevel/FeederBayInfos.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* Copyright (c) 2025, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
package org.gridsuite.network.map.dto.definition.voltagelevel; | ||
|
||
import com.powsybl.iidm.network.ThreeSides; | ||
import org.gridsuite.network.map.dto.definition.extension.ConnectablePositionInfos; | ||
|
||
/** | ||
* @author Etienne Lesot <etienne.lesot at rte-france.com> | ||
*/ | ||
public record FeederBayInfos(String busbarSectionId, ConnectablePositionInfos connectablePositionInfos, ThreeSides connectionSide) { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -7,12 +7,14 @@ | |||||
package org.gridsuite.network.map.dto.utils; | ||||||
|
||||||
import com.powsybl.iidm.network.*; | ||||||
import com.powsybl.iidm.network.extensions.ConnectablePosition; | ||||||
import com.powsybl.math.graph.TraversalType; | ||||||
import lombok.NonNull; | ||||||
import org.gridsuite.network.map.dto.common.ReactiveCapabilityCurveMapData; | ||||||
import org.gridsuite.network.map.dto.common.TapChangerData; | ||||||
import org.gridsuite.network.map.dto.common.TapChangerStepData; | ||||||
import org.gridsuite.network.map.dto.definition.extension.BusbarSectionFinderTraverser; | ||||||
import org.springframework.lang.NonNull; | ||||||
import org.gridsuite.network.map.dto.definition.extension.ConnectablePositionInfos; | ||||||
|
||||||
import java.util.Collection; | ||||||
import java.util.List; | ||||||
|
@@ -39,6 +41,39 @@ public static void setIfNotNan(@NonNull final DoubleConsumer setter, final doubl | |||||
} | ||||||
} | ||||||
|
||||||
private static ConnectablePosition.Feeder getFeederInfos(Identifiable<?> identifiable, int index) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code should use ThreeSides
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the index we can handle injections and branches, but the ThreeSides type cannot manage that |
||||||
var connectablePosition = identifiable.getExtension(ConnectablePosition.class); | ||||||
if (connectablePosition == null) { | ||||||
return null; | ||||||
} | ||||||
|
||||||
switch (index) { | ||||||
case 0: | ||||||
return connectablePosition.getFeeder(); | ||||||
case 1: | ||||||
return connectablePosition.getFeeder1(); | ||||||
case 2: | ||||||
return connectablePosition.getFeeder2(); | ||||||
default: | ||||||
throw new IllegalArgumentException("Invalid feeder index: " + index); | ||||||
} | ||||||
} | ||||||
|
||||||
public static ConnectablePositionInfos getConnectablePosition(Identifiable<?> identifiable, int index) { | ||||||
ConnectablePosition.Feeder feeder = getFeederInfos(identifiable, index); | ||||||
return buildConnectablePositionInfos(feeder); | ||||||
} | ||||||
|
||||||
public static ConnectablePositionInfos buildConnectablePositionInfos(ConnectablePosition.Feeder feeder) { | ||||||
ConnectablePositionInfos.ConnectablePositionInfosBuilder builder = ConnectablePositionInfos.builder(); | ||||||
if (feeder != null) { | ||||||
builder.connectionDirection(feeder.getDirection() == null ? null : feeder.getDirection()) | ||||||
.connectionPosition(feeder.getOrder().orElse(null)) | ||||||
.connectionName(feeder.getName().orElse(null)); | ||||||
} | ||||||
return builder.build(); | ||||||
} | ||||||
|
||||||
public static String getBusOrBusbarSection(Terminal terminal) { | ||||||
if (terminal.getVoltageLevel().getTopologyKind().equals(TopologyKind.BUS_BREAKER)) { | ||||||
if (terminal.isConnected()) { | ||||||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something like this to be more succinct ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done