From 0c143d0609d3a3e5d5334334161b2df057c8b270 Mon Sep 17 00:00:00 2001 From: Didier Vidal Date: Thu, 5 Dec 2024 11:34:58 +0100 Subject: [PATCH] fix serialization of new parameter Signed-off-by: Didier Vidal --- .../openloadflow/OpenLoadFlowParameters.java | 24 +++++++++---------- .../sensi/AcSensitivityAnalysis.java | 2 +- .../ac/GeneratorRemoteControlTest.java | 2 +- src/test/resources/debug-parameters.json | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/powsybl/openloadflow/OpenLoadFlowParameters.java b/src/main/java/com/powsybl/openloadflow/OpenLoadFlowParameters.java index ad0794c2cc..4d3fe874f6 100644 --- a/src/main/java/com/powsybl/openloadflow/OpenLoadFlowParameters.java +++ b/src/main/java/com/powsybl/openloadflow/OpenLoadFlowParameters.java @@ -605,7 +605,7 @@ public enum ReactiveRangeCheckMode { private double areaInterchangePMaxMismatch = AREA_INTERCHANGE_P_MAX_MISMATCH_DEFAULT_VALUE; - private boolean remoteVoltageControlIgnoreQpercent = REMOTE_VOLTAGE_CONTROL_IGNORE_QPERCENT_DEFAULT_VALUE; + private boolean remoteVoltageControlIgnoreQPercent = REMOTE_VOLTAGE_CONTROL_IGNORE_QPERCENT_DEFAULT_VALUE; public static double checkParameterValue(double parameterValue, boolean condition, String parameterName) { if (!condition) { @@ -1332,12 +1332,12 @@ public OpenLoadFlowParameters setAreaInterchangePMaxMismatch(double areaIntercha return this; } - public boolean isRemoteVoltageControlIgnoreQpercent() { - return remoteVoltageControlIgnoreQpercent; + public boolean isRemoteVoltageControlIgnoreQPercent() { + return remoteVoltageControlIgnoreQPercent; } - public OpenLoadFlowParameters setRemoteVoltageControlIgnoreQpercent(boolean remoteVoltageControlIgnoreQpercent) { - this.remoteVoltageControlIgnoreQpercent = remoteVoltageControlIgnoreQpercent; + public OpenLoadFlowParameters setRemoteVoltageControlIgnoreQPercent(boolean remoteVoltageControlIgnoreQPercent) { + this.remoteVoltageControlIgnoreQPercent = remoteVoltageControlIgnoreQPercent; return this; } @@ -1420,7 +1420,7 @@ public static OpenLoadFlowParameters load(PlatformConfig platformConfig) { .setAreaInterchangeControl(config.getBooleanProperty(AREA_INTERCHANGE_CONTROL_PARAM_NAME, AREA_INTERCHANGE_CONTROL_DEFAULT_VALUE)) .setAreaInterchangeControlAreaType(config.getStringProperty(AREA_INTERCHANGE_CONTROL_AREA_TYPE_PARAM_NAME, LfNetworkParameters.AREA_INTERCHANGE_CONTROL_AREA_TYPE_DEFAULT_VALUE)) .setAreaInterchangePMaxMismatch(config.getDoubleProperty(AREA_INTERCHANGE_P_MAX_MISMATCH_PARAM_NAME, AREA_INTERCHANGE_P_MAX_MISMATCH_DEFAULT_VALUE)) - .setRemoteVoltageControlIgnoreQpercent(config.getBooleanProperty(REMOTE_VOLTAGE_CONTROL_IGNORE_QPERCENT_PARAM_NAME, REMOTE_VOLTAGE_CONTROL_IGNORE_QPERCENT_DEFAULT_VALUE))); + .setRemoteVoltageControlIgnoreQPercent(config.getBooleanProperty(REMOTE_VOLTAGE_CONTROL_IGNORE_QPERCENT_PARAM_NAME, REMOTE_VOLTAGE_CONTROL_IGNORE_QPERCENT_DEFAULT_VALUE))); return parameters; } @@ -1582,7 +1582,7 @@ public OpenLoadFlowParameters update(Map properties) { Optional.ofNullable(properties.get(AREA_INTERCHANGE_P_MAX_MISMATCH_PARAM_NAME)) .ifPresent(prop -> this.setAreaInterchangePMaxMismatch(Double.parseDouble(prop))); Optional.ofNullable(properties.get(REMOTE_VOLTAGE_CONTROL_IGNORE_QPERCENT_PARAM_NAME)) - .ifPresent(prop -> this.setRemoteVoltageControlIgnoreQpercent(Boolean.parseBoolean(prop))); + .ifPresent(prop -> this.setRemoteVoltageControlIgnoreQPercent(Boolean.parseBoolean(prop))); return this; } @@ -1659,7 +1659,7 @@ public Map toMap() { map.put(AREA_INTERCHANGE_CONTROL_PARAM_NAME, areaInterchangeControl); map.put(AREA_INTERCHANGE_CONTROL_AREA_TYPE_PARAM_NAME, areaInterchangeControlAreaType); map.put(AREA_INTERCHANGE_P_MAX_MISMATCH_PARAM_NAME, areaInterchangePMaxMismatch); - map.put(REMOTE_VOLTAGE_CONTROL_IGNORE_QPERCENT_PARAM_NAME, remoteVoltageControlIgnoreQpercent); + map.put(REMOTE_VOLTAGE_CONTROL_IGNORE_QPERCENT_PARAM_NAME, remoteVoltageControlIgnoreQPercent); return map; } @@ -1817,7 +1817,7 @@ static LfNetworkParameters getNetworkParameters(LoadFlowParameters parameters, O .setFictitiousGeneratorVoltageControlCheckMode(parametersExt.getFictitiousGeneratorVoltageControlCheckMode()) .setAreaInterchangeControl(parametersExt.isAreaInterchangeControl()) .setAreaInterchangeControlAreaType(parametersExt.getAreaInterchangeControlAreaType()) - .setRemoteVoltageControlIgnoreQPercent(parametersExt.isRemoteVoltageControlIgnoreQpercent()); + .setRemoteVoltageControlIgnoreQPercent(parametersExt.isRemoteVoltageControlIgnoreQPercent()); } public static AcLoadFlowParameters createAcParameters(Network network, LoadFlowParameters parameters, OpenLoadFlowParameters parametersExt, @@ -1917,7 +1917,7 @@ public static DcLoadFlowParameters createDcParameters(LoadFlowParameters paramet .setReferenceBusSelector(ReferenceBusSelector.fromMode(parametersExt.getReferenceBusSelectionMode())) .setAreaInterchangeControl(parametersExt.isAreaInterchangeControl()) .setAreaInterchangeControlAreaType(parametersExt.getAreaInterchangeControlAreaType()) - .setRemoteVoltageControlIgnoreQPercent(parametersExt.isRemoteVoltageControlIgnoreQpercent()); + .setRemoteVoltageControlIgnoreQPercent(parametersExt.isRemoteVoltageControlIgnoreQPercent()); var equationSystemCreationParameters = new DcEquationSystemCreationParameters() .setUpdateFlows(true) @@ -2046,7 +2046,7 @@ public static boolean equals(LoadFlowParameters parameters1, LoadFlowParameters extension1.isAreaInterchangeControl() == extension2.isAreaInterchangeControl() && Objects.equals(extension1.getAreaInterchangeControlAreaType(), extension2.getAreaInterchangeControlAreaType()) && extension1.getAreaInterchangePMaxMismatch() == extension2.getAreaInterchangePMaxMismatch() && - extension1.isRemoteVoltageControlIgnoreQpercent() == extension2.isRemoteVoltageControlIgnoreQpercent(); + extension1.isRemoteVoltageControlIgnoreQPercent() == extension2.isRemoteVoltageControlIgnoreQPercent(); } public static LoadFlowParameters clone(LoadFlowParameters parameters) { @@ -2143,7 +2143,7 @@ public static LoadFlowParameters clone(LoadFlowParameters parameters) { .setAreaInterchangeControl(extension.isAreaInterchangeControl()) .setAreaInterchangeControlAreaType(extension.getAreaInterchangeControlAreaType()) .setAreaInterchangePMaxMismatch(extension.getAreaInterchangePMaxMismatch()) - .setRemoteVoltageControlIgnoreQpercent(extension.isRemoteVoltageControlIgnoreQpercent()); + .setRemoteVoltageControlIgnoreQPercent(extension.isRemoteVoltageControlIgnoreQPercent()); if (extension2 != null) { parameters2.addExtension(OpenLoadFlowParameters.class, extension2); diff --git a/src/main/java/com/powsybl/openloadflow/sensi/AcSensitivityAnalysis.java b/src/main/java/com/powsybl/openloadflow/sensi/AcSensitivityAnalysis.java index 99138bdc10..64f7cba855 100644 --- a/src/main/java/com/powsybl/openloadflow/sensi/AcSensitivityAnalysis.java +++ b/src/main/java/com/powsybl/openloadflow/sensi/AcSensitivityAnalysis.java @@ -226,7 +226,7 @@ public void analyse(Network network, List contingencies, .setReferenceBusSelector(ReferenceBusSelector.DEFAULT_SELECTOR) // not supported yet .setAreaInterchangeControl(lfParametersExt.isAreaInterchangeControl()) .setAreaInterchangeControlAreaType(lfParametersExt.getAreaInterchangeControlAreaType()) - .setRemoteVoltageControlIgnoreQPercent(lfParametersExt.isRemoteVoltageControlIgnoreQpercent()); + .setRemoteVoltageControlIgnoreQPercent(lfParametersExt.isRemoteVoltageControlIgnoreQPercent()); // create networks including all necessary switches try (LfNetworkList lfNetworks = Networks.load(network, lfNetworkParameters, topoConfig, reportNode)) { diff --git a/src/test/java/com/powsybl/openloadflow/ac/GeneratorRemoteControlTest.java b/src/test/java/com/powsybl/openloadflow/ac/GeneratorRemoteControlTest.java index 140b652b1d..eea62e4937 100644 --- a/src/test/java/com/powsybl/openloadflow/ac/GeneratorRemoteControlTest.java +++ b/src/test/java/com/powsybl/openloadflow/ac/GeneratorRemoteControlTest.java @@ -195,7 +195,7 @@ void testWith3GeneratorsAndCoordinatedReactiveControlExtensions() { assertReactivePowerEquals(-63.07, g2.getTerminal()); assertReactivePowerEquals(-21.023, g3.getTerminal()); - parametersExt.setRemoteVoltageControlIgnoreQpercent(true); + parametersExt.setRemoteVoltageControlIgnoreQPercent(true); g1.newMinMaxReactiveLimits().setMaxQ(100).setMinQ(-100).add(); g2.newMinMaxReactiveLimits().setMaxQ(100).setMinQ(-100).add(); g3.newMinMaxReactiveLimits().setMaxQ(200).setMinQ(-200).add(); diff --git a/src/test/resources/debug-parameters.json b/src/test/resources/debug-parameters.json index b5a9092630..05c273e11f 100644 --- a/src/test/resources/debug-parameters.json +++ b/src/test/resources/debug-parameters.json @@ -91,7 +91,7 @@ "areaInterchangeControl" : false, "areaInterchangeControlAreaType" : "ControlArea", "areaInterchangePMaxMismatch" : 2.0, - "remoteVoltageControlIgnoreQpercent" : false + "remoteVoltageControlIgnoreQPercent" : false } } },