Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename models prefix to internalModelPrefix #288

Merged
merged 3 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ class EquipmentConfig {
static final String AUXILIARY_PROPERTY = "AUXILIARY"

final String lib
final String prefix
final String internalModelPrefix
final List<String> properties

EquipmentConfig(String lib, String prefix, String... properties) {
EquipmentConfig(String lib, String internalModelPrefix, String... properties) {
this.lib = lib
this.prefix = prefix
this.internalModelPrefix = internalModelPrefix
this.properties = properties ? properties.collect{it.toUpperCase()} as List<String> : [] as List<String>
}

EquipmentConfig(String lib) {
this.lib = lib
this.prefix = ""
this.internalModelPrefix = ""
this.properties = []
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import org.apache.groovy.json.internal.LazyMap
class ModelsSlurper {

private static final String MODEL_LIB = "lib"
private static final String MODEL_PREFIX = "prefix"
private static final String MODEL_PREFIX = "internalModelPrefix"
private static final String MODEL_PROPERTIES = "properties"

private final slurper = new JsonSlurper()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ class WeccGenGroovyExtension extends AbstractEquipmentGroovyExtension<DynamicMod
WeccGen build() {
if (isInstantiable()) {
if (equipmentConfig.isSynchronized()) {
new SynchronizedWeccGen(dynamicModelId, equipment, parameterSetId, equipmentConfig.lib, equipmentConfig.prefix)
new SynchronizedWeccGen(dynamicModelId, equipment, parameterSetId, equipmentConfig.lib, equipmentConfig.internalModelPrefix)
} else {
new WeccGen(dynamicModelId, equipment, parameterSetId, equipmentConfig.lib, equipmentConfig.prefix)
new WeccGen(dynamicModelId, equipment, parameterSetId, equipmentConfig.lib, equipmentConfig.internalModelPrefix)
}
} else {
null
Expand Down
12 changes: 6 additions & 6 deletions dynawaltz-dsl/src/main/resources/models.json
Original file line number Diff line number Diff line change
Expand Up @@ -234,36 +234,36 @@
"wecc": [
{
"lib": "WTG4AWeccCurrentSource",
"prefix": "WTG4A",
"internalModelPrefix": "WTG4A",
"properties": [
"Synchronized"
]
},
{
"lib": "WTG4BWeccCurrentSource",
"prefix": "WTG4B",
"internalModelPrefix": "WTG4B",
"properties": [
"Synchronized"
]
},
{
"lib": "WT4AWeccCurrentSource",
"prefix": "WT4A"
"internalModelPrefix": "WT4A"
},
{
"lib": "WT4BWeccCurrentSource",
"prefix": "WT4B"
"internalModelPrefix": "WT4B"
},
{
"lib": "PhotovoltaicsWeccCurrentSource",
"prefix": "WTG4A",
"internalModelPrefix": "WTG4A",
"properties": [
"Synchronized"
]
},
{
"lib": "PhotovoltaicsWeccVoltageSource",
"prefix": "photovoltaics",
"internalModelPrefix": "photovoltaics",
"properties": [
"Synchronized"
]
Expand Down