Skip to content
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

implement getV and getAngle for busbarsection [WIP] #217

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ public <E extends Extension<BusbarSection>> Collection<E> 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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <jon.harper at rte-france.com>
*/
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);
}

}