-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement getV and getAngle for busbarsection
Signed-off-by: HARPER Jon <[email protected]>
- Loading branch information
Showing
2 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...-store-iidm-impl/src/test/java/com/powsybl/network/store/iidm/impl/BusbarSectionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
|
||
} |