Explorar o código

Use naming extensions

René Beckmann %!s(int64=8) %!d(string=hai) anos
pai
achega
94f564ed8b

+ 6 - 0
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/Naming.xtend

@@ -271,4 +271,10 @@ class Naming {
 	def dispatch access(EObject it) '''#error cannot access elements of type «getClass().name»'''
 
 	def valueAccess(Event it) '''«scHandle»->«scope.instance».«name.asIdentifier.value»'''
+	
+	def maxOrthogonalStates(ExecutionFlow it) '''«type.toUpperCase»_MAX_ORTHOGONAL_STATES'''
+	
+	def maxHistoryStates(ExecutionFlow it) '''«type.toUpperCase»_MAX_HISTORY_STATES'''
+	
+	def maxParallelTimeEvents(ExecutionFlow it) '''«type.toUpperCase»_MAX_PARALLEL_TIME_EVENTS'''
 }

+ 4 - 4
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/StatemachineHeader.xtend

@@ -210,14 +210,14 @@ class StatemachineHeader implements IContentTemplate {
 
 	def statemachineTypeDecl(ExecutionFlow it) '''
 		/*! Define dimension of the state configuration vector for orthogonal states. */
-		#define «type.toUpperCase»_MAX_ORTHOGONAL_STATES «stateVector.size»
+		#define «maxOrthogonalStates» «stateVector.size»
 		«IF hasHistory»
-			/*! Define dimension of the state configuration vector for history states. */
-		#define «type.toUpperCase»_MAX_HISTORY_STATES «historyVector.size»«ENDIF»
+		/*! Define dimension of the state configuration vector for history states. */
+		#define «maxHistoryStates» «historyVector.size»«ENDIF»
 		
 		«IF timed»
 		/*! Define maximum number of time events that can be active at once */
-		#define «type.toUpperCase»_MAX_ACTIVE_TIME_EVENTS «(it.sourceElement as Statechart).maxNumberOfParallelTimeEvents»
+		#define «maxParallelTimeEvents» «(it.sourceElement as Statechart).maxNumberOfParallelTimeEvents»
 		«ENDIF»
 		
 		/*! Define indices of states in the StateConfVector */