From 4eb617bfbdaca8dd1950a97d3b03b4d95c62c3ec Mon Sep 17 00:00:00 2001 From: HARPER Jon Date: Wed, 2 Nov 2022 14:46:46 +0100 Subject: [PATCH] removal of references to fields q0 and p0 Signed-off-by: anas-drissi --- .../network/store/iidm/impl/BatteryImpl.java | 2 +- .../store/iidm/impl/CreateNetworksUtil.java | 4 ++-- .../NetworkStorageTestCaseFactory.java | 4 ++-- .../store/integration/NetworkStoreIT.java | 16 ++++++++-------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/network-store-iidm-impl/src/main/java/com/powsybl/network/store/iidm/impl/BatteryImpl.java b/network-store-iidm-impl/src/main/java/com/powsybl/network/store/iidm/impl/BatteryImpl.java index a10b6cd5c..4e7b50691 100644 --- a/network-store-iidm-impl/src/main/java/com/powsybl/network/store/iidm/impl/BatteryImpl.java +++ b/network-store-iidm-impl/src/main/java/com/powsybl/network/store/iidm/impl/BatteryImpl.java @@ -96,7 +96,7 @@ public double getMaxP() { public Battery setMaxP(double maxP) { var resource = checkResource(); ValidationUtil.checkMaxP(this, maxP); - ValidationUtil.checkActivePowerLimits(this, getMinP(), maxP, getP0()); + ValidationUtil.checkActivePowerLimits(this, getMinP(), maxP, getTargetP()); double oldValue = resource.getAttributes().getMaxP(); resource.getAttributes().setMaxP(maxP); updateResource(); diff --git a/network-store-iidm-impl/src/test/java/com/powsybl/network/store/iidm/impl/CreateNetworksUtil.java b/network-store-iidm-impl/src/test/java/com/powsybl/network/store/iidm/impl/CreateNetworksUtil.java index 3bff1e4f2..f83c34492 100644 --- a/network-store-iidm-impl/src/test/java/com/powsybl/network/store/iidm/impl/CreateNetworksUtil.java +++ b/network-store-iidm-impl/src/test/java/com/powsybl/network/store/iidm/impl/CreateNetworksUtil.java @@ -223,8 +223,8 @@ private static Network createNetwokWithMultipleEquipments(TopologyKind topologyK invalidNode = initAdder(adder, topologyKind, invalidNode); Battery battery = ((BatteryAdder) adder) .setId("battery") - .setP0(50) - .setQ0(10) + .setTargetP(50) + .setTargetQ(10) .setMinP(40) .setMaxP(70) .add(); diff --git a/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStorageTestCaseFactory.java b/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStorageTestCaseFactory.java index 2224aab56..90658cde0 100644 --- a/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStorageTestCaseFactory.java +++ b/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStorageTestCaseFactory.java @@ -505,8 +505,8 @@ public static Network create(NetworkFactory networkFactory) { Battery battery = vl1.newBattery() .setId("battery") .setNode(4) - .setP0(50) - .setQ0(10) + .setTargetP(50) + .setTargetQ(10) .setMinP(40) .setMaxP(70) .add(); diff --git a/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStoreIT.java b/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStoreIT.java index 0f7473bbc..e15f6cf79 100644 --- a/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStoreIT.java +++ b/network-store-integration-test/src/test/java/com/powsybl/network/store/integration/NetworkStoreIT.java @@ -923,8 +923,8 @@ public void batteryTest() { .setId("battery") .setConnectableBus("b1") .setBus("b1") - .setP0(50) - .setQ0(10) + .setTargetP(50) + .setTargetQ(10) .setMinP(40) .setMaxP(70) .add(); @@ -932,18 +932,18 @@ public void batteryTest() { verify(mockedListener, times(1)).onCreation(battery); assertTrue(battery.isFictitious()); - assertEquals(50, battery.getP0(), 0.1); - assertEquals(10, battery.getQ0(), 0.1); + assertEquals(50, battery.getTargetP(), 0.1); + assertEquals(10, battery.getTargetQ(), 0.1); assertEquals(40, battery.getMinP(), 0.1); assertEquals(70, battery.getMaxP(), 0.1); battery.setFictitious(false); - battery.setP0(65); - battery.setQ0(20); + battery.setTargetP(65); + battery.setTargetQ(20); assertFalse(battery.isFictitious()); - assertEquals(65, battery.getP0(), 0.1); - assertEquals(20, battery.getQ0(), 0.1); + assertEquals(65, battery.getTargetP(), 0.1); + assertEquals(20, battery.getTargetQ(), 0.1); verify(mockedListener, times(1)).onUpdate(battery, "targetP", INITIAL_VARIANT_ID, 50d, 65d); verify(mockedListener, times(1)).onUpdate(battery, "targetQ", INITIAL_VARIANT_ID, 10d, 20d);