From 74e5c8b31ae91d6eac0f9ad48c5ec0a95df4b869 Mon Sep 17 00:00:00 2001 From: Slimane AMAR Date: Thu, 3 Oct 2024 17:27:39 +0200 Subject: [PATCH] Review remarks Signed-off-by: Slimane AMAR --- .../network/store/iidm/impl/BusTopologyPointImpl.java | 2 +- .../powsybl/network/store/iidm/impl/TerminalImpl.java | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/network-store-iidm-impl/src/main/java/com/powsybl/network/store/iidm/impl/BusTopologyPointImpl.java b/network-store-iidm-impl/src/main/java/com/powsybl/network/store/iidm/impl/BusTopologyPointImpl.java index aa20a713d..2a1fd934d 100644 --- a/network-store-iidm-impl/src/main/java/com/powsybl/network/store/iidm/impl/BusTopologyPointImpl.java +++ b/network-store-iidm-impl/src/main/java/com/powsybl/network/store/iidm/impl/BusTopologyPointImpl.java @@ -50,7 +50,7 @@ public boolean isConnected() { @Override public String toString() { - return "NodeTopologyPoint(" + + return "BusTopologyPoint(" + "voltageLevelId='" + voltageLevelId + '\'' + ", connectableBusId='" + connectableBusId + '\'' + ", connected=" + connected + diff --git a/network-store-iidm-impl/src/main/java/com/powsybl/network/store/iidm/impl/TerminalImpl.java b/network-store-iidm-impl/src/main/java/com/powsybl/network/store/iidm/impl/TerminalImpl.java index 95b40ab52..0e4f32b5f 100644 --- a/network-store-iidm-impl/src/main/java/com/powsybl/network/store/iidm/impl/TerminalImpl.java +++ b/network-store-iidm-impl/src/main/java/com/powsybl/network/store/iidm/impl/TerminalImpl.java @@ -47,7 +47,7 @@ public TerminalImpl(NetworkObjectIndex index, Connectable connectable, Functi public void moveConnectable(int node, String voltageLevelId) { TopologyPoint oldTopologyPoint = TerminalImpl.this.getTopologyPoint(); super.moveConnectable(node, voltageLevelId); - index.notifyUpdate(connectable, "moveConnectable", oldTopologyPoint, TerminalImpl.this.getTopologyPoint()); + index.notifyUpdate(connectable, "terminal" + getSide(), oldTopologyPoint, TerminalImpl.this.getTopologyPoint()); } }; busBreakerView = new TerminalBusBreakerViewImpl<>(index, connectable, attributesGetter) { @@ -55,7 +55,7 @@ public void moveConnectable(int node, String voltageLevelId) { public void moveConnectable(String busId, boolean connected) { TopologyPoint oldTopologyPoint = TerminalImpl.this.getTopologyPoint(); super.moveConnectable(busId, connected); - index.notifyUpdate(connectable, "moveConnectable", oldTopologyPoint, TerminalImpl.this.getTopologyPoint()); + index.notifyUpdate(connectable, "terminal" + getSide(), oldTopologyPoint, TerminalImpl.this.getTopologyPoint()); } }; busView = new TerminalBusViewImpl<>(index, connectable, attributesGetter); @@ -584,8 +584,11 @@ public String getVoltageLevelId() { @Override public ThreeSides getSide() { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'getSide'"); + int index = connectable.getTerminals().indexOf(this); + if (index < 0) { + throw new IllegalStateException(); + } + return ThreeSides.valueOf(index + 1); } public void addNewRegulatingPoint(RegulatingPoint regulatingPoint) {