From 7270e115c455ebda942d4b84a688da44a08077d4 Mon Sep 17 00:00:00 2001 From: lisrte Date: Tue, 10 Sep 2024 15:44:54 +0200 Subject: [PATCH] Fix code smell Signed-off-by: lisrte --- .../dynawo/models/generators/SynchronousGenerator.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/SynchronousGenerator.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/SynchronousGenerator.java index b1f37580c..de910226b 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/SynchronousGenerator.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/SynchronousGenerator.java @@ -22,6 +22,8 @@ */ public class SynchronousGenerator extends BaseGenerator implements FrequencySynchronizedModel { + private static final String OMEGA_PU_VAR_NAME = "generator_omegaPu"; + private final EnumGeneratorComponent generatorComponent; protected SynchronousGenerator(String dynamicModelId, Generator generator, String parameterSetId, String generatorLib, EnumGeneratorComponent generatorComponent) { @@ -34,14 +36,10 @@ public String getTerminalVarName() { return generatorComponent.getTerminalVarName(); } - private String getOmegaPuVarName() { - return "generator_omegaPu"; - } - @Override public List getOmegaRefVarConnections() { return Arrays.asList( - new VarConnection("omega_grp_@INDEX@", getOmegaPuVarName()), + new VarConnection("omega_grp_@INDEX@", OMEGA_PU_VAR_NAME), new VarConnection("omegaRef_grp_@INDEX@", getOmegaRefPuVarName()), new VarConnection("running_grp_@INDEX@", getRunningVarName()) );