-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add OmegaRefGenerator model for GeneratorPQ model * Dedicated OmegaRefGeneratorGroovyExtension.groovy * Rename config file Signed-off-by: BAUDRIER Dimitri <dimitri.baudrier@rte-france.com> Co-authored-by: Florian Dupuy <florian.dupuy@rte-france.com>
- Loading branch information
Showing
18 changed files
with
252 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...roovy/com/powsybl/dynawaltz/dsl/models/generators/OmegaRefGeneratorGroovyExtension.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright (c) 2022, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
* SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
package com.powsybl.dynawaltz.dsl.models.generators | ||
|
||
import com.google.auto.service.AutoService | ||
import com.powsybl.dynamicsimulation.DynamicModel | ||
import com.powsybl.dynamicsimulation.groovy.DynamicModelGroovyExtension | ||
import com.powsybl.dynawaltz.dsl.AbstractDynamicModelBuilder | ||
import com.powsybl.dynawaltz.dsl.AbstractPowsyblDynawoGroovyExtension | ||
import com.powsybl.dynawaltz.models.generators.OmegaRefGenerator | ||
|
||
/** | ||
* @author Florian Dupuy <florian.dupuy at rte-france.com> | ||
* @author Dimitri Baudrier <dimitri.baudrier at rte-france.com> | ||
*/ | ||
@AutoService(DynamicModelGroovyExtension.class) | ||
class OmegaRefGeneratorGroovyExtension extends AbstractPowsyblDynawoGroovyExtension<DynamicModel> implements DynamicModelGroovyExtension { | ||
|
||
private static final String CONNECTED_TO_OMEGA_REF_GENERATORS = "connectedToOmegaRefGenerators" | ||
|
||
OmegaRefGeneratorGroovyExtension() { | ||
ConfigSlurper config = new ConfigSlurper() | ||
modelTags = config.parse(this.getClass().getClassLoader().getResource(MODELS_CONFIG)).get(CONNECTED_TO_OMEGA_REF_GENERATORS).keySet() as List | ||
} | ||
|
||
@Override | ||
protected GeneratorConnectedToOmegaRefBuilder createBuilder(String currentTag) { | ||
new GeneratorConnectedToOmegaRefBuilder(currentTag) | ||
} | ||
|
||
static class GeneratorConnectedToOmegaRefBuilder extends AbstractDynamicModelBuilder { | ||
|
||
String tag | ||
|
||
GeneratorConnectedToOmegaRefBuilder(String tag) { | ||
this.tag = tag | ||
} | ||
|
||
@Override | ||
OmegaRefGenerator build() { | ||
checkData() | ||
new OmegaRefGenerator(dynamicModelId, staticId, parameterSetId, tag) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/OmegaRefGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* Copyright (c) 2022, RTE (http://www.rte-france.com/) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
* SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
package com.powsybl.dynawaltz.models.generators; | ||
|
||
/** | ||
* @author Dimitri Baudrier <dimitri.baudrier at rte-france.com> | ||
*/ | ||
public class OmegaRefGenerator extends AbstractGeneratorModel implements OmegaRefGeneratorModel { | ||
|
||
private final String generatorLib; | ||
|
||
public OmegaRefGenerator(String dynamicModelId, String staticId, String parameterSetId, String generatorLib) { | ||
super(dynamicModelId, staticId, parameterSetId, | ||
"generator_terminal", | ||
"generator_switchOffSignal1", | ||
"generator_switchOffSignal2", | ||
"generator_switchOffSignal3", | ||
"generator_running"); | ||
this.generatorLib = generatorLib; | ||
} | ||
|
||
@Override | ||
public String getOmegaRefPuVarName() { | ||
return "generator_omegaRefPu"; | ||
} | ||
|
||
@Override | ||
public String getLib() { | ||
return generatorLib; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/OmegaRefGeneratorModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* Copyright (c) 2022, RTE (http://www.rte-france.com/) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
* SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
package com.powsybl.dynawaltz.models.generators; | ||
|
||
/** | ||
* @author Dimitri Baudrier <dimitri.baudrier at rte-france.com> | ||
*/ | ||
public interface OmegaRefGeneratorModel extends GeneratorModel { | ||
String getOmegaRefPuVarName(); | ||
} |
Oops, something went wrong.