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);