From 4c6ec60d1a4e8b8d981a6c7adcba65289c4e79ef Mon Sep 17 00:00:00 2001 From: lisrte Date: Thu, 26 Sep 2024 10:06:56 +0200 Subject: [PATCH] Rename to OutputType.FSV to FINAL_STATE Signed-off-by: lisrte --- .../dynawo/dsl/DynawoOutputVariableGroovyExtension.groovy | 2 +- .../com/powsybl/dynawo/dsl/OutputVariablesSupplierTest.java | 2 +- .../main/java/com/powsybl/dynawo/DynawoSimulationContext.java | 2 +- .../outputvariables/OutputVariablesJsonDeserializer.java | 2 +- .../main/java/com/powsybl/dynawo/xml/OutputVariablesXml.java | 2 +- .../suppliers/DynawoOutputVariablesJsonDeserializerTest.java | 4 ++-- .../src/test/java/com/powsybl/dynawo/xml/DynawoTestUtil.java | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dynawo-dsl/src/main/groovy/com/powsybl/dynawo/dsl/DynawoOutputVariableGroovyExtension.groovy b/dynawo-dsl/src/main/groovy/com/powsybl/dynawo/dsl/DynawoOutputVariableGroovyExtension.groovy index 12356d72b..e7b769313 100644 --- a/dynawo-dsl/src/main/groovy/com/powsybl/dynawo/dsl/DynawoOutputVariableGroovyExtension.groovy +++ b/dynawo-dsl/src/main/groovy/com/powsybl/dynawo/dsl/DynawoOutputVariableGroovyExtension.groovy @@ -37,6 +37,6 @@ class DynawoOutputVariableGroovyExtension implements OutputVariableGroovyExtensi variablesBuilder.add(consumer) } binding.curve = c -> closure(c, OutputVariable.OutputType.CURVE) - binding.fsv = c -> closure(c, OutputVariable.OutputType.FSV) + binding.fsv = c -> closure(c, OutputVariable.OutputType.FINAL_STATE) } } diff --git a/dynawo-dsl/src/test/java/com/powsybl/dynawo/dsl/OutputVariablesSupplierTest.java b/dynawo-dsl/src/test/java/com/powsybl/dynawo/dsl/OutputVariablesSupplierTest.java index da51e7783..f599cdd9f 100644 --- a/dynawo-dsl/src/test/java/com/powsybl/dynawo/dsl/OutputVariablesSupplierTest.java +++ b/dynawo-dsl/src/test/java/com/powsybl/dynawo/dsl/OutputVariablesSupplierTest.java @@ -75,7 +75,7 @@ private void validateOutputVariable(OutputVariable outputVariable) { assertEquals(OutputVariable.OutputType.CURVE, outputVariable.getOutputType()); assertTrue(Arrays.asList("NGEN_Upu_value", "NHV1_Upu_value", "NHV2_Upu_value", "NLOAD_Upu_value").contains(outputVariable.getVariableName())); } else if (network.getIdentifiable(outputVariable.getModelId()) instanceof Generator) { - assertEquals(OutputVariable.OutputType.FSV, outputVariable.getOutputType()); + assertEquals(OutputVariable.OutputType.FINAL_STATE, outputVariable.getOutputType()); assertTrue(Arrays.asList("generator_omegaPu", "generator_PGen", "generator_UStatorPU", "voltageRegulator_UcEfdP", "voltageRegulator_EfdPu").contains(outputVariable.getVariableName())); } else if (network.getIdentifiable(outputVariable.getModelId()) instanceof Load) { assertEquals(OutputVariable.OutputType.CURVE, outputVariable.getOutputType()); diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationContext.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationContext.java index 7d9e77c18..116e34051 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationContext.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/DynawoSimulationContext.java @@ -277,7 +277,7 @@ public boolean withCurveVariables() { } public boolean withFsvVariables() { - return outputVariables.containsKey(OutputVariable.OutputType.FSV); + return outputVariables.containsKey(OutputVariable.OutputType.FINAL_STATE); } public List getDynamicModelsParameters() { diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/suppliers/outputvariables/OutputVariablesJsonDeserializer.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/suppliers/outputvariables/OutputVariablesJsonDeserializer.java index 3e33d6593..55c16e04d 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/suppliers/outputvariables/OutputVariablesJsonDeserializer.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/suppliers/outputvariables/OutputVariablesJsonDeserializer.java @@ -43,7 +43,7 @@ public List deserialize(JsonParser parser, DeserializationContex JsonUtil.parseObjectArray(parser, modelConfigList::add, p -> parseOutputVariablesBuilder(p, OutputVariable.OutputType.CURVE)); return true; } else if (name.equals("fsv")) { - JsonUtil.parseObjectArray(parser, modelConfigList::add, p -> parseOutputVariablesBuilder(p, OutputVariable.OutputType.FSV)); + JsonUtil.parseObjectArray(parser, modelConfigList::add, p -> parseOutputVariablesBuilder(p, OutputVariable.OutputType.FINAL_STATE)); return true; } return false; diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/xml/OutputVariablesXml.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/xml/OutputVariablesXml.java index 0f46c8f12..569ebe6f1 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/xml/OutputVariablesXml.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/xml/OutputVariablesXml.java @@ -38,7 +38,7 @@ public static void writeCurve(Path workingDir, DynawoSimulationContext context) } public static void writeFsv(Path workingDir, DynawoSimulationContext context) throws IOException { - new OutputVariablesXml(FSV_FILENAME, "finalStateValuesInput", "finalStateValue", OutputVariable.OutputType.FSV) + new OutputVariablesXml(FSV_FILENAME, "finalStateValuesInput", "finalStateValue", OutputVariable.OutputType.FINAL_STATE) .createXmlFileFromContext(workingDir, context); } diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/suppliers/DynawoOutputVariablesJsonDeserializerTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/suppliers/DynawoOutputVariablesJsonDeserializerTest.java index ea6351563..c1dd51ce7 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/suppliers/DynawoOutputVariablesJsonDeserializerTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/suppliers/DynawoOutputVariablesJsonDeserializerTest.java @@ -39,8 +39,8 @@ private static List getExpectedOutputVariables() { new DynawoOutputVariablesBuilder().staticId("BUS").variables("Upu_value").add(variables::add); new DynawoOutputVariablesBuilder().dynamicModelId("BBM_GEN2").variables("generator_omegaPu", "generator_PGen", "generator_UStatorPU").add(variables::add); new DynawoOutputVariablesBuilder().staticId("LOAD").variables("load_PPu", "load_QPu").outputType(OutputVariable.OutputType.CURVE).add(variables::add); - new DynawoOutputVariablesBuilder().dynamicModelId("BBM_GEN").variables("generator_PGen").outputType(OutputVariable.OutputType.FSV).add(variables::add); - new DynawoOutputVariablesBuilder().staticId("LOAD").variables("load_QPu").outputType(OutputVariable.OutputType.FSV).add(variables::add); + new DynawoOutputVariablesBuilder().dynamicModelId("BBM_GEN").variables("generator_PGen").outputType(OutputVariable.OutputType.FINAL_STATE).add(variables::add); + new DynawoOutputVariablesBuilder().staticId("LOAD").variables("load_QPu").outputType(OutputVariable.OutputType.FINAL_STATE).add(variables::add); return variables; } } diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynawoTestUtil.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynawoTestUtil.java index 7f3d3fe85..30e53581c 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynawoTestUtil.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/xml/DynawoTestUtil.java @@ -59,7 +59,7 @@ void setup() { network.getLoadStream().forEach(b -> new DynawoOutputVariablesBuilder() .staticId(b.getId()) .variables("load_PPu", "load_QPu") - .outputType(OutputVariable.OutputType.FSV) + .outputType(OutputVariable.OutputType.FINAL_STATE) .add(outputVariables::add)); network.getBusBreakerView().getBusStream().forEach(b -> new DynawoOutputVariablesBuilder()