-
Notifications
You must be signed in to change notification settings - Fork 45
Add method to get the terminal of a 3-winding transformer from one of its voltage level ids #3355
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
|
boolean side2 = getLeg2().getTerminal().getVoltageLevel().getId().equals(voltageLevelId); | ||
boolean side3 = getLeg3().getTerminal().getVoltageLevel().getId().equals(voltageLevelId); | ||
if (side1 && side2 && side3) { | ||
throw new PowsyblException("the three terminals are connected to the same voltage level " + voltageLevelId); |
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.
throw new PowsyblException("the three terminals are connected to the same voltage level " + voltageLevelId); | |
throw new PowsyblException("The three terminals are connected to the same voltage level " + voltageLevelId); |
if (side1 && side2 && side3) { | ||
throw new PowsyblException("the three terminals are connected to the same voltage level " + voltageLevelId); | ||
} else if (side1 && side2 || side3 && side1 || side2 && side3) { | ||
throw new PowsyblException("two of the three terminals are connected to the same voltage level " + voltageLevelId); |
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.
throw new PowsyblException("two of the three terminals are connected to the same voltage level " + voltageLevelId); | |
throw new PowsyblException("Two of the three terminals are connected to the same voltage level " + voltageLevelId); |
.add() | ||
.add(); | ||
message = assertThrows(PowsyblException.class, () -> transformer4.getTerminal("vl1")).getMessage(); | ||
assertEquals("the three terminals are connected to the same voltage level vl1", message); |
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.
assertEquals("the three terminals are connected to the same voltage level vl1", message); | |
assertEquals("The three terminals are connected to the same voltage level vl1", message); |
assertEquals(transformer.getTerminal("vl1").getBusBreakerView().getConnectableBus(), | ||
transformer.getLeg1().getTerminal().getBusBreakerView().getConnectableBus()); | ||
String message = assertThrows(PowsyblException.class, () -> transformer.getTerminal("vl2")).getMessage(); | ||
assertEquals("two of the three terminals are connected to the same voltage level vl2", message); |
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.
assertEquals("two of the three terminals are connected to the same voltage level vl2", message); | |
assertEquals("Two of the three terminals are connected to the same voltage level vl2", message); |
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
No
What kind of change does this PR introduce?
Feature
What is the new behavior (if this is a feature change)?
Enable to get the terminal of a leg basing on only the voltageLevel's Id
Does this PR introduce a breaking change or deprecate an API?
Migration steps:
Custom IIDM implementation maintainers should implement the following method in their
ThreeWindingsTransformer
's implementations: