Kaynağa Gözat

Cleanup the code, add definitions for internal types, state entry and exit storage code

jos.itemis@gmail.com 14 yıl önce
ebeveyn
işleme
1d2db2c034

+ 5 - 1
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/CustomRepositoryH.xpt

@@ -58,7 +58,11 @@ class 
 
 public:
 
-	«DRName()»() {};
+	«DRName()»() : 
+«FOREACH this.declaredVariables() AS variable SEPARATOR ','-»
+    «((VariableDefinition)variable).name»(0)«
+    ENDFOREACH»
+	{};
 	virtual ~«DRName()»() {};
 
 //	void init_data(uint32_t _var1, uint32_t _counter, float _sub_counter)

+ 2 - 4
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/CustomStatemachineCPP.xpt

@@ -61,13 +61,11 @@ else {
 «ENDDEFINE»
 
 «DEFINE ActionCode FOR EnterState»
-// dummy Enter
-// states = newstates
+state[0] = _«this.state.simpleName»;
 «ENDDEFINE»
 
 «DEFINE ActionCode FOR ExitState»
-// dummy Exit
-// oldstates = states
+state[0] = last_state;
 «ENDDEFINE»
 
 «DEFINE ConditionMethodsImplement FOR ExecutionState»

+ 4 - 1
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/templates/definitionH.xpt

@@ -27,7 +27,10 @@ typedef int int32_t;
 typedef short int16_t;
 
 typedef int32_t integer; 
-
+typedef bool boolean;
+typedef float real;
+//typedef string char*;
+ 
 #endif /* DEFINITION_H_ */
 «ENDFILE»