Browse Source

added test that causes compilation problems.

Claudio Gomes 2 years ago
parent
commit
fb570cca04

+ 4 - 0
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.cg.cpp.tests/src/be/uantwerpen/ansymo/semanticadaptation/cg/cpp/tests/CgCppBasicTest.xtend

@@ -62,6 +62,10 @@ class CgCppBasicTest extends AbstractSemanticAdaptationTest {
 		__parseAndGenerateWithNoErrors('window_sa_canonical_new.BASE.sa', 'test_input/single_folder_spec/window/', 'powerwindow');
 	}
 	
+	@Test def empty_ctrl_rules() {
+		__parseAndGenerateWithNoErrors('plantmr.sa', 'test_input/single_folder_spec/emptyctrlrules/', 'PlantMR');
+	}
+	
 	@Test def getSetState_sa() {
 		__parseAndGenerateWithNoErrors('GetSetState.sa', 'test_input/single_folder_spec/getsetstate/', "getSetState");
 	}

BIN
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.cg.cpp.tests/test_input/single_folder_spec/emptyctrlrules/EMAPlantNoLoad_FixedEuler_1Em6.fmu


+ 15 - 0
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.cg.cpp.tests/test_input/single_folder_spec/emptyctrlrules/plantmr.sa

@@ -0,0 +1,15 @@
+semantic adaptation reactive moore PlantMultiRate
+at "./PlantMultiRate.fmu"
+
+	for inner fmu Plant plant
+		at "./EMAPlantNoLoad_FixedEuler_1Em6.fmu"
+		with input ports 
+			Real torque "torque_input@expseu_", 
+			Real psu "psu_vol_input_v@expseu_", 
+			Real v "V_IN@expseu_", 
+			Real x "X_IN@expseu_" 
+		with output ports 
+			Real w "ang_vel_out_rpm@expseu_", 
+			Real f "F_OUT@expseu_"
+
+param RATE := 1; 

+ 3 - 1
DSL_SemanticAdaptation/be.uantwerpen.ansymo.semanticadaptation.cg.cpp/src/be/uantwerpen/ansymo/semanticadaptation/cg/cpp/generation/CppGenerator.xtend

@@ -156,7 +156,9 @@ class CppGenerator {
 			val inRuleBlock = adap.in;
 			val outRuleBlock = adap.out;
 			val crtlRuleBlock = adap.control;
-
+			
+			
+			
 			// Get the control vars, in vars, and out vars				
 			var inVars = if(inRuleBlock !== null) compileRuleBlockVars(inRuleBlock.globalInVars, params);
 			var outVars = if(outRuleBlock !== null) compileRuleBlockVars(outRuleBlock.globalOutVars, params);