Переглянути джерело

Added support for step comments.

markus.muehlbrandt@itemis.de 13 роки тому
батько
коміт
7551402acd

+ 9 - 0
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/CustomCycleBasedStatemachine.xpt

@@ -37,18 +37,23 @@ Contributors:
 «ENDDEFINE»
 
 «DEFINE ActionCode FOR ScheduleTimeEvent-»
+«getComment()-»
 getTimerHandler().setTimer(«timeEvent.getName()», «timeValue.toCode()», cycleStartTime);
 «ENDDEFINE»
 
 «DEFINE ActionCode FOR UnscheduleTimeEvent-»
+«getComment()-»
 getTimerHandler().resetTimer(«timeEvent.getName()»);
 «ENDDEFINE»
 
 «DEFINE ActionCode FOR Execution-»
+	«getComment()-»
 	«statement.toCode()»
 «ENDDEFINE»
 
 «DEFINE ActionCode FOR Call-»
+
+«getComment()-»
 «this.step.functionName()»();
 «ENDDEFINE»
 
@@ -66,6 +71,7 @@ getTimerHandler().resetTimer(
 
 «DEFINE ActionCode FOR CheckRef -»
 «IF this.check != null -»
+«getComment()-»
 «this.check.functionName()»() «
 ELSE -»
 true 
@@ -77,6 +83,7 @@ true
 «ENDDEFINE»
 
 «DEFINE ActionCode FOR If-»
+«getComment()-»
 if («EXPAND ActionCode FOR this.check») { 
 	«EXPAND ActionCode FOR this.thenStep-»
 }
@@ -88,10 +95,12 @@ else {
 «ENDDEFINE»
 
 «DEFINE ActionCode FOR EnterState-»
+	«getComment()-»
 	activeStates.add(State.«state.getName()»);
 «ENDDEFINE»
 
 «DEFINE ActionCode FOR ExitState-»
+	«getComment()-»
 	activeStates.remove(State.«state.getName()»);
 «ENDDEFINE»
 

+ 6 - 0
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/templates/Naming.ext

@@ -193,3 +193,9 @@ String getLicenseHeader(GeneratorEntry entry) :
 		entry.getFeatureConfiguration(getLicenseFeature()).getParameterValue(getLicenseText()).getStringValue()
 	else 
 		null;
+		
+String getComment(Step this) :
+	if comment!=null then
+		"//"+comment
+	else
+		null;