Skip to content

Commit

Permalink
Fix regression
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Ivar Hatledal committed Sep 26, 2019
1 parent e50c99d commit df87c44
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public enum Fmi2Causality {
* be "fixed" or "tunable". initial must be "approx", "calculated" or not
* present (meaning calculated).
*/
calculated_parameter,
calculatedParameter,

/**
* The variable value can be provided from another model or slave. It is not
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@ class JaxbScalarVariable internal constructor(
override val description: String?
get() = v.description
override val causality: Causality?
get() = v.causality?.let { Causality.valueOf(it.name.toUpperCase()) }
get() = v.causality?.let {
var causalityString = it.name
val upperCaseIndex = causalityString.indexOfFirst { it.isUpperCase() }
if (upperCaseIndex != -1) {
causalityString = causalityString.substring(0, upperCaseIndex) + "_" + causalityString.substring(upperCaseIndex, causalityString.length)
}
Causality.valueOf(causalityString.toUpperCase())
}
override val variability: Variability?
get() = v.variability?.let { Variability.valueOf(it.name.toUpperCase()) }
override val initial: Initial?
Expand Down

0 comments on commit df87c44

Please sign in to comment.