浏览代码

minor cleanup - main.cpp: tests are commented out to be illustrative how things could work

jos.itemis@gmail.com 14 年之前
父节点
当前提交
99d3897a2a

+ 2 - 6
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/CustomRepositoryH.xpt

@@ -60,14 +60,10 @@ public:
 
 	«DRName()»() : 
 «FOREACH this.declaredVariables() AS variable SEPARATOR ','-»
-    «((VariableDefinition)variable).name»(0)«
-    ENDFOREACH»
+ «((VariableDefinition)variable).name»(0)«
+ENDFOREACH»
 	{};
 	virtual ~«DRName()»() {};
-
-//	void init_data(uint32_t _var1, uint32_t _counter, float _sub_counter)
-//	{ var1 = _var1; counter = _counter; sub_counter = _sub_counter; }
-
 	
 «FOREACH this.declaredVariables() AS variable»
     «((VariableDefinition)variable).type» get_«((VariableDefinition)variable).name»()

+ 11 - 10
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/TestMain.xpt

@@ -37,20 +37,18 @@ int main()
 	char* stateName[6] = {"State1", "State2", "State3", "State4", "State5", "State6"};
 	«StName()» machine;
 
-	/* initialize data repository */
-//	machine.init_data(1,0,0.0);
-
-	/* initialize the initial states */
+	// initialize the initial states 
 	machine.init();
-
-	/* create one event and enqueue it */
+	
+	/* Example code 
+	// create one event and enqueue it 
 	Event e = createEvent<Event1>();
 	machine.queueEvent(e);
 
-	/* run the cycle */
+	// run the cycle 
 	machine.runCycle();
 
-	/* check the state */
+	// check the state 
 	std::cout << stateName[machine.getState(0)] << "\n";
 	assert( strcmp(stateName[machine.getState(0)], "State3") == 0);
 
@@ -62,7 +60,7 @@ int main()
 	std::cout << stateName[machine.getState(0)] << "\n";
 	assert( strcmp(stateName[machine.getState(0)], "State1") == 0);
 
-	/* does event queuing work? */
+	// does event queuing work?
 	e = createEvent<Event1>();
 	machine.queueEvent(e);
 	e = createEvent<Event3>();
@@ -73,7 +71,7 @@ int main()
 	std::cout << stateName[machine.getState(0)] << "\n";
 	assert( strcmp(stateName[machine.getState(0)], "State3") == 0);
 
-	/* run second cycle */
+	// run second cycle
 	machine.runCycle();
 
 	std::cout << stateName[machine.getState(0)] << "\n";
@@ -103,7 +101,10 @@ int main()
 	std::cout << stateName[machine.getState(0)] << "\n";
 	assert( strcmp(stateName[machine.getState(0)], "State1") == 0);
 
+	*/
+	
 	return(0);
+	
 }
 
 «ENDFILE»