in code/library/src/main/kotlin/org/fbme/lib/iec61499/parser/BasicFBTypeConverter.kt [45:64]
override fun extractDeclarationBody(identifier: Identifier?): StateDeclaration {
checkNotNull(element)
val state = factory.createStateDeclaration(identifier)
val ecActionElements = element.getChildren("ECAction")
for (ecActionElement in ecActionElements) {
val action = factory.createStateAction()
val algorithmName = ecActionElement.getAttributeValue("Algorithm")
val eventName = ecActionElement.getAttributeValue("Output")
if (algorithmName != null && algorithmName.isNotEmpty()) {
action.algorithm.setTargetName(algorithmName)
}
if (eventName != null && eventName.isNotEmpty()) {
action.event.setFQName(eventName)
}
state.actions.add(action)
}
state.x = element.getAttributeValue("x").toFloat().toInt()
state.y = element.getAttributeValue("y").toFloat().toInt()
return state
}