Browse Source

multirate case seems to be working (merge complete I think)

Claudio Gomes 2 years ago
parent
commit
f97e715122

+ 0 - 8
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.cg.cpp/src/be/uantwerpen/ansymo/semanticadaptation/cg/cpp/generation/ControlConditionSwitch.xtend

@@ -107,14 +107,6 @@ class ControlConditionSwitch extends RulesConditionSwitch {
 		return retVal;
 	}
 
-	override ReturnInformation caseStepSize(StepSize object) {
-		var retVal = new ReturnInformation();
-		retVal.code = '''H''';
-		retVal.type = SVType.Real;
-		retVal.forceType = true;
-		return retVal;
-	}
-
 	override ReturnInformation caseCurrentTime(CurrentTime object) {
 		var retVal = new ReturnInformation();
 		retVal.code = '''t''';

+ 18 - 1
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.cg.cpp/src/be/uantwerpen/ansymo/semanticadaptation/cg/cpp/generation/RulesConditionSwitch.xtend

@@ -23,6 +23,8 @@ import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.Variable
 import java.util.LinkedHashMap
 import java.util.List
 import org.eclipse.emf.common.util.EList
+import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.StepSize
+import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.PassedTime
 
 class RulesConditionSwitch extends BasicConditionSwitch {
 	// Global params
@@ -393,5 +395,20 @@ class RulesConditionSwitch extends BasicConditionSwitch {
 		retVal.appendCode('''«left.code»; «forLoopIterVar»<«right.code»; «forLoopIterVar»++''')
 		return retVal;
 	}
-
+	
+	override ReturnInformation caseStepSize(StepSize object) {
+		var retVal = new ReturnInformation();
+		retVal.code = '''H''';
+		retVal.type = SVType.Real;
+		retVal.forceType = true;
+		return retVal;
+	}
+	
+	override ReturnInformation casePassedTime(PassedTime object) {
+		var retVal = new ReturnInformation();
+		retVal.code = '''dt''';
+		return retVal;
+	}
+	
+	
 }