-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Description
Describe the current behavior
VoltageLevel s1vl1 = s1.newVoltageLevel()
.setTopologyKind(TopologyKind.NODE_BREAKER)
s1vl1.newLoad().setId("load1").setP0(10.).setQ0(1.).add();errors with
Exception in thread "main" com.powsybl.iidm.network.ValidationException: Load 'load1': connectable bus is not set
at com.powsybl.iidm.network.impl.TerminalBuilder.build(TerminalBuilder.java:65)
at com.powsybl.iidm.network.impl.AbstractInjectionAdder.checkAndGetTerminal(AbstractInjectionAdder.java:55)
at com.powsybl.iidm.network.impl.LoadAdderImpl.add(LoadAdderImpl.java:71)
at com.powsybl.iidm.network.impl.LoadAdderImpl.add(LoadAdderImpl.java:16)
should be
Load 'load1': node is not set
In this line we use node == null to differentiate between busterminal and nodeterminal but we should use the voltage level topology instead
powsybl-core/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/TerminalBuilder.java
Line 65 in 49bcb76
| throw new ValidationException(validable, "connectable bus is not set"); |
NOTE: if you use the wrong node/connectablebus, you do get an exception just after:
com.powsybl.iidm.network.ValidationException: Load 'load1': voltage level S1VL1 has a node/breaker topology, a node connection should be specified instead of a bus connection
at com.powsybl.iidm.network.impl.NodeBreakerVoltageLevel.checkTerminal(NodeBreakerVoltageLevel.java:1109)
at com.powsybl.iidm.network.impl.NodeBreakerVoltageLevel.attach(NodeBreakerVoltageLevel.java:1125)
at com.powsybl.iidm.network.impl.LoadAdderImpl.add(LoadAdderImpl.java:80)
at com.powsybl.iidm.network.impl.LoadAdderImpl.add(LoadAdderImpl.java:16)
Describe the expected behavior
get the correct exception the first time
Describe the motivation
simplicity
Extra Information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels