diff --git a/network-store-iidm-impl/src/main/java/com/powsybl/network/store/iidm/impl/BusbarSectionImpl.java b/network-store-iidm-impl/src/main/java/com/powsybl/network/store/iidm/impl/BusbarSectionImpl.java index ddc4fc1a8..789e5ac78 100644 --- a/network-store-iidm-impl/src/main/java/com/powsybl/network/store/iidm/impl/BusbarSectionImpl.java +++ b/network-store-iidm-impl/src/main/java/com/powsybl/network/store/iidm/impl/BusbarSectionImpl.java @@ -114,12 +114,12 @@ public > Collection getExtensions() { @Override public double getV() { - throw new UnsupportedOperationException("TODO"); + return terminal.getBusBreakerView().getBus().getV(); } @Override public double getAngle() { - throw new UnsupportedOperationException("TODO"); + return terminal.getBusBreakerView().getBus().getAngle(); } @Override diff --git a/network-store-iidm-impl/src/test/java/com/powsybl/network/store/iidm/impl/BusbarSectionTest.java b/network-store-iidm-impl/src/test/java/com/powsybl/network/store/iidm/impl/BusbarSectionTest.java new file mode 100644 index 000000000..0f84bbec1 --- /dev/null +++ b/network-store-iidm-impl/src/test/java/com/powsybl/network/store/iidm/impl/BusbarSectionTest.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2021, 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 com.powsybl.network.store.iidm.impl; + +import com.powsybl.iidm.network.*; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +/** + * @author Jon Harper + */ +public class BusbarSectionTest { + + @Test + public void testVAngle() { + Network network = CreateNetworksUtil.createNodeBreakerNetworkWithLine(); + BusbarSection bbs = network.getBusbarSection("BBS1"); + assertTrue(Double.isNaN(bbs.getV())); + assertTrue(Double.isNaN(bbs.getAngle())); + var bus = bbs.getTerminal().getBusBreakerView().getBus(); + bus.setV(1.0d); + bus.setAngle(2.0d); + assertEquals(1.0d, bbs.getV(), 0.0); + assertEquals(2.0d, bbs.getAngle(), 0.0); + } + +}