-
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.
Merge branch 'main' into rename_model_model
Signed-off-by: lisrte <laurent.issertial@rte-france.com>
- Loading branch information
Showing
121 changed files
with
1,596 additions
and
650 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
...vy/com/powsybl/dynawaltz/dsl/models/generators/GridFormingConverterGroovyExtension.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) 2023, 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.AbstractEquipmentGroovyExtension | ||
import com.powsybl.dynawaltz.dsl.EquipmentConfig | ||
import com.powsybl.dynawaltz.models.generators.GridFormingConverter | ||
import com.powsybl.iidm.network.Network | ||
|
||
/** | ||
* @author Laurent Issertial <laurent.issertial at rte-france.com> | ||
*/ | ||
@AutoService(DynamicModelGroovyExtension.class) | ||
class GridFormingConverterGroovyExtension extends AbstractEquipmentGroovyExtension<DynamicModel> implements DynamicModelGroovyExtension { | ||
|
||
private static final String GRID_FORMING_CONVERTER = "gridFormingConverter" | ||
|
||
GridFormingConverterGroovyExtension() { | ||
super(GRID_FORMING_CONVERTER) | ||
} | ||
|
||
@Override | ||
protected GridFormingConverterBuilder createBuilder(Network network, EquipmentConfig equipmentConfig) { | ||
new GridFormingConverterBuilder(network, equipmentConfig) | ||
} | ||
|
||
static class GridFormingConverterBuilder extends AbstractGeneratorBuilder { | ||
|
||
EquipmentConfig equipmentConfig | ||
|
||
GridFormingConverterBuilder(Network network, EquipmentConfig equipmentConfig) { | ||
super(network) | ||
this.equipmentConfig = equipmentConfig | ||
} | ||
|
||
@Override | ||
GridFormingConverter build() { | ||
checkData() | ||
new GridFormingConverter(dynamicModelId, generator, parameterSetId, equipmentConfig.lib) | ||
} | ||
} | ||
} |
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
55 changes: 55 additions & 0 deletions
55
...src/main/groovy/com/powsybl/dynawaltz/dsl/models/generators/WeccGenGroovyExtension.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,55 @@ | ||
/** | ||
* Copyright (c) 2023, 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.AbstractEquipmentGroovyExtension | ||
import com.powsybl.dynawaltz.dsl.EquipmentConfig | ||
import com.powsybl.dynawaltz.models.generators.SynchronizedWeccGen | ||
import com.powsybl.dynawaltz.models.generators.WeccGen | ||
import com.powsybl.iidm.network.Network | ||
|
||
/** | ||
* @author Laurent Issertial <laurent.issertial at rte-france.com> | ||
*/ | ||
@AutoService(DynamicModelGroovyExtension.class) | ||
class WeccGenGroovyExtension extends AbstractEquipmentGroovyExtension<DynamicModel> implements DynamicModelGroovyExtension { | ||
|
||
private static final String WECC = "wecc" | ||
|
||
WeccGenGroovyExtension() { | ||
super(WECC) | ||
} | ||
|
||
@Override | ||
protected WeccGenBuilder createBuilder(Network network, EquipmentConfig equipmentConfig) { | ||
new WeccGenBuilder(network, equipmentConfig) | ||
} | ||
|
||
static class WeccGenBuilder extends AbstractGeneratorBuilder { | ||
|
||
EquipmentConfig equipmentConfig | ||
|
||
WeccGenBuilder(Network network, EquipmentConfig equipmentConfig) { | ||
super(network) | ||
this.equipmentConfig = equipmentConfig | ||
} | ||
|
||
@Override | ||
WeccGen build() { | ||
checkData() | ||
if (equipmentConfig.isSynchronized()) { | ||
new SynchronizedWeccGen(dynamicModelId, generator, parameterSetId, equipmentConfig.lib, equipmentConfig.prefix) | ||
} else { | ||
new WeccGen(dynamicModelId, generator, parameterSetId, equipmentConfig.lib, equipmentConfig.prefix) | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.