Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Schuetz2013-07-03 18:57:07 +0000
committerThomas Schuetz2013-07-03 19:22:04 +0000
commit91db51acfec684d1619ee9f5c1e47afc7913df37 (patch)
treeac7665d5afbf060c176af940ea3374d4700b818e /examples/org.eclipse.etrice.tutorials.c
parent5eb30b1b55ead6c2c1e03522a93c4678fc0bc25a (diff)
downloadorg.eclipse.etrice-91db51acfec684d1619ee9f5c1e47afc7913df37.tar.gz
org.eclipse.etrice-91db51acfec684d1619ee9f5c1e47afc7913df37.tar.xz
org.eclipse.etrice-91db51acfec684d1619ee9f5c1e47afc7913df37.zip
Revert "[tutorials.c] new structure for tutorials"
Diffstat (limited to 'examples/org.eclipse.etrice.tutorials.c')
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/.cproject6
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/.gitignore1
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/gen_HelloWorld.launch15
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.etmap17
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.etphys45
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.room12
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/diagrams/RoomModel1.ActorClass1.behavior25
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/model/trafficlight/test.room25
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/src-gen/readme.txt4
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/PTrafficLight.c133
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/PTrafficLight.h62
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficController.c460
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficController.h68
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficLight.c515
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficLight.h70
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficlightExampleApplication.c40
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficlightExampleApplication.h44
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/tmp/msc.seq117
18 files changed, 1447 insertions, 212 deletions
diff --git a/examples/org.eclipse.etrice.tutorials.c/.cproject b/examples/org.eclipse.etrice.tutorials.c/.cproject
index 456190980..e044f2e17 100644
--- a/examples/org.eclipse.etrice.tutorials.c/.cproject
+++ b/examples/org.eclipse.etrice.tutorials.c/.cproject
@@ -35,13 +35,12 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.c/src-gen}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/common}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/src/config}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src-gen}&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.533629505" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.319733671" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug">
<option id="gnu.c.link.option.paths.819761090" name="Library search path (-L)" superClass="gnu.c.link.option.paths" valueType="libPaths">
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/MinGWDebug}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.runtime.c/DebugMinGW}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/org.eclipse.etrice.modellib.c/MinGWDebug}&quot;"/>
</option>
<option id="gnu.c.link.option.libs.1013803342" name="Libraries (-l)" superClass="gnu.c.link.option.libs" valueType="libs">
@@ -57,9 +56,6 @@
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug.1214027870" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug"/>
</toolChain>
</folderInfo>
- <sourceEntries>
- <entry excluding="src-gen-info" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
- </sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
diff --git a/examples/org.eclipse.etrice.tutorials.c/.gitignore b/examples/org.eclipse.etrice.tutorials.c/.gitignore
index 48fcd90c3..80b5900bc 100644
--- a/examples/org.eclipse.etrice.tutorials.c/.gitignore
+++ b/examples/org.eclipse.etrice.tutorials.c/.gitignore
@@ -3,4 +3,3 @@ PosixRelease
MinGWDebug
MinGWRelease
src-gen-info
-src-gen
diff --git a/examples/org.eclipse.etrice.tutorials.c/gen_HelloWorld.launch b/examples/org.eclipse.etrice.tutorials.c/gen_HelloWorld.launch
deleted file mode 100644
index e05fe2f20..000000000
--- a/examples/org.eclipse.etrice.tutorials.c/gen_HelloWorld.launch
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.etrice.generator.launch.c.launchConfigurationType">
-<booleanAttribute key="Debug" value="false"/>
-<booleanAttribute key="GenDocumentation" value="false"/>
-<booleanAttribute key="GenInstanceDiagram" value="false"/>
-<stringAttribute key="GenModelPath" value=""/>
-<booleanAttribute key="Lib" value="false"/>
-<booleanAttribute key="MSC" value="true"/>
-<listAttribute key="ModelFiles">
-<listEntry value="${workspace_loc:/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.etmap}"/>
-</listAttribute>
-<booleanAttribute key="SaveGenModel" value="false"/>
-<booleanAttribute key="Verbose" value="false"/>
-<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${workspace}"/>
-</launchConfiguration>
diff --git a/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.etmap b/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.etmap
index 5051878e7..55feae91f 100644
--- a/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.etmap
+++ b/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.etmap
@@ -1,10 +1,11 @@
MappingModel MappingModel1 {
- import RoomModel1.* from "HelloWorld.room"
- import PhysicalModel1.* from "HelloWorld.etphys"
- Mapping LogSys1 -> PhysSys1 {
- SubSystemMapping subSysRef1 -> nodeRef1 {
- ThreadMapping defaultThread -> PhysicalThread1
- }
- }
-
+ import RoomModel1.* from "HelloWorld.room"
+ import PhysicalModel1.* from "HelloWorld.etphys"
+
+ Mapping LogSys1 -> PhysSys1 {
+ SubSystemMapping SubSysRef1 -> nodeRef1 {
+ ThreadMapping defaultThread -> PhysicalThread1
+ }
+ }
+
} \ No newline at end of file
diff --git a/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.etphys b/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.etphys
index c6f363643..a9e276189 100644
--- a/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.etphys
+++ b/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.etphys
@@ -1,25 +1,24 @@
PhysicalModel PhysicalModel1 {
-
+
PhysicalSystem PhysSys1 {
- NodeRef nodeRef1 : NodeClass1
- }
-
- NodeClass NodeClass1 {
- runtime = RuntimeClass1
- priomin = -10
- priomax = 10
-
- DefaultThread PhysicalThread1 {
- execmode = blocked
- prio = 0
- stacksize = 1024
- msgblocksize = 32
- msgpoolsize = 10
- }
- }
-
- RuntimeClass RuntimeClass1 {
- model = multiThreaded
- }
-
-} \ No newline at end of file
+ NodeRef nodeRef1 : NodeClass1
+ }
+
+ NodeClass NodeClass1 {
+ runtime = RuntimeClass1
+ priomin = -10
+ priomax = 10
+ DefaultThread PhysicalThread1 {
+ execmode = blocked
+ prio = 0
+ stacksize = 1024
+ msgblocksize = 32
+ msgpoolsize = 10
+ }
+ }
+
+ RuntimeClass RuntimeClass1 {
+ model = multiThreaded
+ }
+
+}
diff --git a/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.room b/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.room
index 3e5ff393c..da396e27f 100644
--- a/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.room
+++ b/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.room
@@ -1,12 +1,14 @@
RoomModel RoomModel1 {
+
LogicalSystem LogSys1 {
- SubSystemRef subSysRef1:SubSysClass1
+ SubSystemRef SubSysRef1: SubSysClass1
}
+
SubSystemClass SubSysClass1 {
- ActorRef actorRef1:ActorClass1
+ ActorRef ActorRef1: ActorClass1
LogicalThread defaultThread
}
- ActorClass ActorClass1 {
- }
-
+
+ ActorClass ActorClass1 { }
+
} \ No newline at end of file
diff --git a/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/diagrams/RoomModel1.ActorClass1.behavior b/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/diagrams/RoomModel1.ActorClass1.behavior
deleted file mode 100644
index 3c14d00ef..000000000
--- a/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/diagrams/RoomModel1.ActorClass1.behavior
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.behavior" name="Behavior of ActorClass1" pictogramLinks="//@link //@children.0/@link" verticalGridUnit="10" version="0.10.0">
- <graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
- <link>
- <businessObjects href="../HelloWorld.room#ActorClass:ActorClass1"/>
- </link>
- <children xsi:type="pi:ContainerShape" visible="true" active="true">
- <properties key="obj-type" value="sg"/>
- <graphicsAlgorithm xsi:type="al:Rectangle" lineWidth="1" filled="false" lineVisible="false" transparency="0.0" width="880" height="580" x="40" y="40">
- <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" background="//@colors.1" foreground="//@colors.2" lineWidth="4" transparency="0.5" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
- <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" foreground="//@colors.2" lineWidth="4" filled="false" transparency="0.0" width="800" height="500" x="40" y="40" cornerHeight="20" cornerWidth="20"/>
- </graphicsAlgorithm>
- <link>
- <businessObjects href="../HelloWorld.room#StateGraph:ActorClass1$sg"/>
- </link>
- <children visible="true">
- <graphicsAlgorithm xsi:type="al:Text" background="//@colors.2" foreground="//@colors.2" lineWidth="1" filled="false" transparency="0.0" width="800" height="80" y="40" font="//@fonts.1" horizontalAlignment="ALIGNMENT_RIGHT" verticalAlignment="ALIGNMENT_TOP" value="/"/>
- </children>
- </children>
- <colors red="227" green="238" blue="249"/>
- <colors red="255" green="255" blue="255"/>
- <colors/>
- <fonts name="Arial" size="8"/>
- <fonts name="Arial" size="9" bold="true"/>
-</pi:Diagram>
diff --git a/examples/org.eclipse.etrice.tutorials.c/model/trafficlight/test.room b/examples/org.eclipse.etrice.tutorials.c/model/trafficlight/test.room
index 679327c0e..d541b8011 100644
--- a/examples/org.eclipse.etrice.tutorials.c/model/trafficlight/test.room
+++ b/examples/org.eclipse.etrice.tutorials.c/model/trafficlight/test.room
@@ -1,17 +1,16 @@
RoomModel wer {
-
- LogicalSystem LogSysName {
- SubSystemRef SubSysRefName: SubSysClassName
- }
-
- SubSystemClass SubSysClassName {
- ActorRef ActorRefName: ActorClassName
- LogicalThread dflt_thread
- }
-
- ActorClass ActorClassName { }
-
-}
+ LogicalSystem LogSysName {
+ SubSystemRef SubSysRefName:SubSysClassName
+
+ }
+ SubSystemClass SubSysClassName {
+ ActorRef ActorRefName:ActorClassName
+
+ }
+ ActorClass ActorClassName {
+ }
+
+ }
\ No newline at end of file
diff --git a/examples/org.eclipse.etrice.tutorials.c/src-gen/readme.txt b/examples/org.eclipse.etrice.tutorials.c/src-gen/readme.txt
new file mode 100644
index 000000000..c3b99d458
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.c/src-gen/readme.txt
@@ -0,0 +1,4 @@
+This directory is an eTrice code generation target.
+It will be erased every time the generator is executed.
+
+DO NOT PLACE OTHER FILES HERE!
diff --git a/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/PTrafficLight.c b/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/PTrafficLight.c
new file mode 100644
index 000000000..a75a969f6
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/PTrafficLight.c
@@ -0,0 +1,133 @@
+/**
+ * @author generated by eTrice
+ *
+ * Source File of ProtocolClass PTrafficLight
+ *
+ */
+
+#include "PTrafficLight.h"
+#include "debugging/etMSCLogger.h"
+
+
+/*--------------------- port methods */
+
+void PTrafficLightPort_greenForCarDone(const PTrafficLightPort* self) {
+ ET_MSC_LOGGER_SYNC_ENTRY("PTrafficLightPort", "greenForCarDone")
+ etPort_sendMessage(self, PTrafficLight_OUT_greenForCarDone, 0, NULL);
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+void PTrafficLightReplPort_greenForCarDone_broadcast(const PTrafficLightReplPort* self) {
+ int i;
+ ET_MSC_LOGGER_SYNC_ENTRY("PTrafficLightReplPort", "greenForCarDone")
+ for (i=0; i<((etReplPort*)self)->size; ++i) {
+ etPort_sendMessage(((etPort*)&((etReplPort*)self)->ports[i]), PTrafficLight_OUT_greenForCarDone, 0, NULL);
+ }
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+void PTrafficLightReplPort_greenForCarDone(const PTrafficLightReplPort* self, int idx) {
+ ET_MSC_LOGGER_SYNC_ENTRY("PTrafficLightReplPort", "greenForCarDone")
+ if (0<=idx && idx<((etReplPort*)self)->size) {
+ etPort_sendMessage(((etPort*)&((etReplPort*)self)->ports[idx]), PTrafficLight_OUT_greenForCarDone, 0, NULL);
+ }
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+
+void PTrafficLightPort_greenForPedDone(const PTrafficLightPort* self) {
+ ET_MSC_LOGGER_SYNC_ENTRY("PTrafficLightPort", "greenForPedDone")
+ etPort_sendMessage(self, PTrafficLight_OUT_greenForPedDone, 0, NULL);
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+void PTrafficLightReplPort_greenForPedDone_broadcast(const PTrafficLightReplPort* self) {
+ int i;
+ ET_MSC_LOGGER_SYNC_ENTRY("PTrafficLightReplPort", "greenForPedDone")
+ for (i=0; i<((etReplPort*)self)->size; ++i) {
+ etPort_sendMessage(((etPort*)&((etReplPort*)self)->ports[i]), PTrafficLight_OUT_greenForPedDone, 0, NULL);
+ }
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+void PTrafficLightReplPort_greenForPedDone(const PTrafficLightReplPort* self, int idx) {
+ ET_MSC_LOGGER_SYNC_ENTRY("PTrafficLightReplPort", "greenForPedDone")
+ if (0<=idx && idx<((etReplPort*)self)->size) {
+ etPort_sendMessage(((etPort*)&((etReplPort*)self)->ports[idx]), PTrafficLight_OUT_greenForPedDone, 0, NULL);
+ }
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+etInt32 PTrafficLightReplPort_getReplication(const PTrafficLightReplPort* self) {
+ return ((etReplPort*)self)->size;
+}
+
+
+
+void PTrafficLightConjPort_greenForCar(const PTrafficLightConjPort* self) {
+ ET_MSC_LOGGER_SYNC_ENTRY("PTrafficLightConjPort", "greenForCar")
+ etPort_sendMessage(self, PTrafficLight_IN_greenForCar, 0, NULL);
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+void PTrafficLightConjReplPort_greenForCar_broadcast(const PTrafficLightConjReplPort* self) {
+ int i;
+ ET_MSC_LOGGER_SYNC_ENTRY("PTrafficLightConjReplPort", "greenForCar")
+ for (i=0; i<((etReplPort*)self)->size; ++i) {
+ etPort_sendMessage(((etPort*)&((etReplPort*)self)->ports[i]), PTrafficLight_IN_greenForCar, 0, NULL);
+ }
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+void PTrafficLightConjReplPort_greenForCar(const PTrafficLightConjReplPort* self, int idx) {
+ ET_MSC_LOGGER_SYNC_ENTRY("PTrafficLightConjReplPort", "greenForCar")
+ if (0<=idx && idx<((etReplPort*)self)->size) {
+ etPort_sendMessage(((etPort*)&((etReplPort*)self)->ports[idx]), PTrafficLight_IN_greenForCar, 0, NULL);
+ }
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+
+void PTrafficLightConjPort_greenForPed(const PTrafficLightConjPort* self) {
+ ET_MSC_LOGGER_SYNC_ENTRY("PTrafficLightConjPort", "greenForPed")
+ etPort_sendMessage(self, PTrafficLight_IN_greenForPed, 0, NULL);
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+void PTrafficLightConjReplPort_greenForPed_broadcast(const PTrafficLightConjReplPort* self) {
+ int i;
+ ET_MSC_LOGGER_SYNC_ENTRY("PTrafficLightConjReplPort", "greenForPed")
+ for (i=0; i<((etReplPort*)self)->size; ++i) {
+ etPort_sendMessage(((etPort*)&((etReplPort*)self)->ports[i]), PTrafficLight_IN_greenForPed, 0, NULL);
+ }
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+void PTrafficLightConjReplPort_greenForPed(const PTrafficLightConjReplPort* self, int idx) {
+ ET_MSC_LOGGER_SYNC_ENTRY("PTrafficLightConjReplPort", "greenForPed")
+ if (0<=idx && idx<((etReplPort*)self)->size) {
+ etPort_sendMessage(((etPort*)&((etReplPort*)self)->ports[idx]), PTrafficLight_IN_greenForPed, 0, NULL);
+ }
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+etInt32 PTrafficLightConjReplPort_getReplication(const PTrafficLightConjReplPort* self) {
+ return ((etReplPort*)self)->size;
+}
+
+
+
+/*--------------------- debug helpers */
+
+/* message names as strings for debugging (generate MSC) */
+static const char* const PTrafficLight_messageStrings[] = {"MIN", "greenForCarDone","greenForPedDone","greenForCar", "greenForPed", "MAX"};
+
+const char* PTrafficLight_getMessageString(int msg_id) {
+ if (msg_id<PTrafficLight_MSG_MIN || msg_id>PTrafficLight_MSG_MAX+1){
+ /* id out of range */
+ return "Message ID out of range";
+ }
+ else{
+ return PTrafficLight_messageStrings[msg_id];
+ }
+}
diff --git a/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/PTrafficLight.h b/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/PTrafficLight.h
new file mode 100644
index 000000000..72c855040
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/PTrafficLight.h
@@ -0,0 +1,62 @@
+/**
+ * @author generated by eTrice
+ *
+ * Header File of ProtocolClass PTrafficLight
+ *
+ */
+
+#ifndef _TRAFFICLIGHT_EXAMPLE_PTRAFFICLIGHT_H_
+#define _TRAFFICLIGHT_EXAMPLE_PTRAFFICLIGHT_H_
+
+#include "etDatatypes.h"
+#include "modelbase/etPort.h"
+
+
+
+
+/* message IDs */
+enum PTrafficLight_msg_ids {
+ PTrafficLight_MSG_MIN = 0,
+ PTrafficLight_OUT_greenForCarDone = 1,
+ PTrafficLight_OUT_greenForPedDone = 2,
+ PTrafficLight_IN_greenForCar = 3,
+ PTrafficLight_IN_greenForPed = 4,
+ PTrafficLight_MSG_MAX = 5
+};
+
+/*--------------------- port structs and methods */
+typedef etPort PTrafficLightPort;
+typedef etReplPort PTrafficLightReplPort;
+
+
+void PTrafficLightPort_greenForCarDone(const PTrafficLightPort* self);
+void PTrafficLightReplPort_greenForCarDone_broadcast(const PTrafficLightReplPort* self);
+void PTrafficLightReplPort_greenForCarDone(const PTrafficLightReplPort* self, int idx);
+void PTrafficLightPort_greenForPedDone(const PTrafficLightPort* self);
+void PTrafficLightReplPort_greenForPedDone_broadcast(const PTrafficLightReplPort* self);
+void PTrafficLightReplPort_greenForPedDone(const PTrafficLightReplPort* self, int idx);
+
+
+etInt32 PTrafficLightReplPort_getReplication(const PTrafficLightReplPort* self);
+typedef etPort PTrafficLightConjPort;
+typedef etReplPort PTrafficLightConjReplPort;
+
+
+void PTrafficLightConjPort_greenForCar(const PTrafficLightConjPort* self);
+void PTrafficLightConjReplPort_greenForCar_broadcast(const PTrafficLightConjReplPort* self);
+void PTrafficLightConjReplPort_greenForCar(const PTrafficLightConjReplPort* self, int idx);
+void PTrafficLightConjPort_greenForPed(const PTrafficLightConjPort* self);
+void PTrafficLightConjReplPort_greenForPed_broadcast(const PTrafficLightConjReplPort* self);
+void PTrafficLightConjReplPort_greenForPed(const PTrafficLightConjReplPort* self, int idx);
+
+
+etInt32 PTrafficLightConjReplPort_getReplication(const PTrafficLightConjReplPort* self);
+
+/*--------------------- debug helpers */
+
+/* get message string for message id */
+const char* PTrafficLight_getMessageString(int msg_id);
+
+
+#endif /* _TRAFFICLIGHT_EXAMPLE_PTRAFFICLIGHT_H_ */
+
diff --git a/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficController.c b/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficController.c
new file mode 100644
index 000000000..3a7506ae2
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficController.c
@@ -0,0 +1,460 @@
+/**
+ * @author generated by eTrice
+ *
+ * Source File of ActorClass TrafficController
+ *
+ */
+
+#include "TrafficController.h"
+
+#include "modelbase/etActor.h"
+#include "debugging/etLogger.h"
+#include "debugging/etMSCLogger.h"
+#include "etUnit/etUnit.h"
+#include "osal/etMemory.h"
+
+#include "room/basic/service/timing/PTimer.h"
+#include "trafficlight/example/PTrafficLight.h"
+
+
+/* interface item IDs */
+enum interface_items {
+ IFITEM_light1 = 1,
+ IFITEM_light2 = 2,
+ IFITEM_timeout = 3
+};
+
+/* state IDs */
+enum state_ids {
+ NO_STATE = 0,
+ STATE_TOP = 1,
+ STATE_Idle = 2,
+ STATE_Light1GreenForCars = 3,
+ STATE_SwitchToLight1GreenForCars = 4,
+ STATE_state0 = 5,
+ STATE_state1 = 6,
+ STATE_SwitchToLight2GreenForCars = 7,
+ STATE_state2 = 8,
+ STATE_state3 = 9,
+ STATE_Light2GreenForCars = 10,
+ STATE_MAX = 11
+};
+
+/* transition chains */
+enum chain_ids {
+ CHAIN_TRANS_INITIAL_TO__Idle = 1,
+ CHAIN_TRANS_tr0_FROM_Idle_TO_SwitchToLight1GreenForCars_BY_timeouttimeout = 2,
+ CHAIN_TRANS_tr1_FROM_SwitchToLight1GreenForCars_TO_state0_BY_greenForCarDonelight1 = 3,
+ CHAIN_TRANS_tr2_FROM_SwitchToLight1GreenForCars_TO_state1_BY_greenForPedDonelight2 = 4,
+ CHAIN_TRANS_tr3_FROM_state1_TO_Light1GreenForCars_BY_greenForCarDonelight1 = 5,
+ CHAIN_TRANS_tr4_FROM_state0_TO_Light1GreenForCars_BY_greenForPedDonelight2 = 6,
+ CHAIN_TRANS_tr5_FROM_Light1GreenForCars_TO_SwitchToLight2GreenForCars_BY_timeouttimeout = 7,
+ CHAIN_TRANS_tr6_FROM_SwitchToLight2GreenForCars_TO_state2_BY_greenForPedDonelight1 = 8,
+ CHAIN_TRANS_tr7_FROM_SwitchToLight2GreenForCars_TO_state3_BY_greenForCarDonelight2 = 9,
+ CHAIN_TRANS_tr8_FROM_state2_TO_Light2GreenForCars_BY_greenForCarDonelight2 = 10,
+ CHAIN_TRANS_tr9_FROM_state3_TO_Light2GreenForCars_BY_greenForPedDonelight1 = 11,
+ CHAIN_TRANS_tr10_FROM_Light2GreenForCars_TO_SwitchToLight1GreenForCars_BY_timeouttimeout = 12
+};
+
+/* triggers */
+enum triggers {
+ POLLING = 0,
+ TRIG_light1__greenForCarDone = IFITEM_light1 + EVT_SHIFT*PTrafficLight_OUT_greenForCarDone,
+ TRIG_light2__greenForCarDone = IFITEM_light2 + EVT_SHIFT*PTrafficLight_OUT_greenForCarDone,
+ TRIG_timeout__timeout = IFITEM_timeout + EVT_SHIFT*PTimer_OUT_timeout,
+ TRIG_light2__greenForPedDone = IFITEM_light2 + EVT_SHIFT*PTrafficLight_OUT_greenForPedDone,
+ TRIG_light1__greenForPedDone = IFITEM_light1 + EVT_SHIFT*PTrafficLight_OUT_greenForPedDone
+};
+
+
+static void setState(TrafficController* self, etInt16 new_state) {
+ self->state = new_state;
+}
+
+static etInt16 getState(TrafficController* self) {
+ return self->state;
+}
+
+/* Entry and Exit Codes */
+static void entry_Idle(TrafficController* self) {
+ PTimerConjPort_startTimeout(&self->constData->timeout, 3000) /* ORIG: timeout.startTimeout(3000) */;
+}
+static void entry_Light1GreenForCars(TrafficController* self) {
+ PTimerConjPort_startTimeout(&self->constData->timeout, 10000) /* ORIG: timeout.startTimeout(10000) */;
+}
+static void entry_SwitchToLight1GreenForCars(TrafficController* self) {
+ PTrafficLightConjPort_greenForCar(&self->constData->light1) /* ORIG: light1.greenForCar() */;
+ PTrafficLightConjPort_greenForPed(&self->constData->light2) /* ORIG: light2.greenForPed() */;
+}
+static void entry_SwitchToLight2GreenForCars(TrafficController* self) {
+ PTrafficLightConjPort_greenForPed(&self->constData->light1) /* ORIG: light1.greenForPed() */;
+ PTrafficLightConjPort_greenForCar(&self->constData->light2) /* ORIG: light2.greenForCar() */;
+}
+static void entry_Light2GreenForCars(TrafficController* self) {
+ PTimerConjPort_startTimeout(&self->constData->timeout, 10000) /* ORIG: timeout.startTimeout(10000) */;
+}
+
+/* Action Codes */
+
+/**
+ * calls exit codes while exiting from the current state to one of its
+ * parent states while remembering the history
+ * @param current - the current state
+ * @param to - the final parent state
+ */
+static void exitTo(TrafficController* self, etInt16 current, etInt16 to) {
+ while (current!=to) {
+ switch (current) {
+ case STATE_Idle:
+ self->history[STATE_TOP] = STATE_Idle;
+ current = STATE_TOP;
+ break;
+ case STATE_Light1GreenForCars:
+ self->history[STATE_TOP] = STATE_Light1GreenForCars;
+ current = STATE_TOP;
+ break;
+ case STATE_SwitchToLight1GreenForCars:
+ self->history[STATE_TOP] = STATE_SwitchToLight1GreenForCars;
+ current = STATE_TOP;
+ break;
+ case STATE_state0:
+ self->history[STATE_TOP] = STATE_state0;
+ current = STATE_TOP;
+ break;
+ case STATE_state1:
+ self->history[STATE_TOP] = STATE_state1;
+ current = STATE_TOP;
+ break;
+ case STATE_SwitchToLight2GreenForCars:
+ self->history[STATE_TOP] = STATE_SwitchToLight2GreenForCars;
+ current = STATE_TOP;
+ break;
+ case STATE_state2:
+ self->history[STATE_TOP] = STATE_state2;
+ current = STATE_TOP;
+ break;
+ case STATE_state3:
+ self->history[STATE_TOP] = STATE_state3;
+ current = STATE_TOP;
+ break;
+ case STATE_Light2GreenForCars:
+ self->history[STATE_TOP] = STATE_Light2GreenForCars;
+ current = STATE_TOP;
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ }
+}
+
+/**
+ * calls action, entry and exit codes along a transition chain. The generic data are cast to typed data
+ * matching the trigger of this chain. The ID of the final state is returned
+ * @param chain - the chain ID
+ * @param generic_data - the generic data pointer
+ * @return the +/- ID of the final state either with a positive sign, that indicates to execute the state's entry code, or a negative sign vice versa
+ */
+static etInt16 executeTransitionChain(TrafficController* self, int chain, const InterfaceItemBase* ifitem, void* generic_data) {
+ switch (chain) {
+ case CHAIN_TRANS_INITIAL_TO__Idle:
+ {
+ return STATE_Idle;
+ }
+ case CHAIN_TRANS_tr0_FROM_Idle_TO_SwitchToLight1GreenForCars_BY_timeouttimeout:
+ {
+ return STATE_SwitchToLight1GreenForCars;
+ }
+ case CHAIN_TRANS_tr1_FROM_SwitchToLight1GreenForCars_TO_state0_BY_greenForCarDonelight1:
+ {
+ return STATE_state0;
+ }
+ case CHAIN_TRANS_tr2_FROM_SwitchToLight1GreenForCars_TO_state1_BY_greenForPedDonelight2:
+ {
+ return STATE_state1;
+ }
+ case CHAIN_TRANS_tr3_FROM_state1_TO_Light1GreenForCars_BY_greenForCarDonelight1:
+ {
+ return STATE_Light1GreenForCars;
+ }
+ case CHAIN_TRANS_tr4_FROM_state0_TO_Light1GreenForCars_BY_greenForPedDonelight2:
+ {
+ return STATE_Light1GreenForCars;
+ }
+ case CHAIN_TRANS_tr5_FROM_Light1GreenForCars_TO_SwitchToLight2GreenForCars_BY_timeouttimeout:
+ {
+ return STATE_SwitchToLight2GreenForCars;
+ }
+ case CHAIN_TRANS_tr6_FROM_SwitchToLight2GreenForCars_TO_state2_BY_greenForPedDonelight1:
+ {
+ return STATE_state2;
+ }
+ case CHAIN_TRANS_tr7_FROM_SwitchToLight2GreenForCars_TO_state3_BY_greenForCarDonelight2:
+ {
+ return STATE_state3;
+ }
+ case CHAIN_TRANS_tr8_FROM_state2_TO_Light2GreenForCars_BY_greenForCarDonelight2:
+ {
+ return STATE_Light2GreenForCars;
+ }
+ case CHAIN_TRANS_tr9_FROM_state3_TO_Light2GreenForCars_BY_greenForPedDonelight1:
+ {
+ return STATE_Light2GreenForCars;
+ }
+ case CHAIN_TRANS_tr10_FROM_Light2GreenForCars_TO_SwitchToLight1GreenForCars_BY_timeouttimeout:
+ {
+ return STATE_SwitchToLight1GreenForCars;
+ }
+ default:
+ /* should not occur */
+ break;
+ }
+ return NO_STATE;
+}
+
+/**
+ * calls entry codes while entering a state's history. The ID of the final leaf state is returned
+ * @param state - the state which is entered
+ * @return - the ID of the final leaf state
+ */
+static etInt16 enterHistory(TrafficController* self, etInt16 state) {
+ boolean skip_entry = FALSE;
+ if (state >= STATE_MAX) {
+ state = (etInt16) (state - STATE_MAX);
+ skip_entry = TRUE;
+ }
+ while (TRUE) {
+ switch (state) {
+ case STATE_Idle:
+ if (!(skip_entry)) entry_Idle(self);
+ /* in leaf state: return state id */
+ return STATE_Idle;
+ case STATE_Light1GreenForCars:
+ if (!(skip_entry)) entry_Light1GreenForCars(self);
+ /* in leaf state: return state id */
+ return STATE_Light1GreenForCars;
+ case STATE_SwitchToLight1GreenForCars:
+ if (!(skip_entry)) entry_SwitchToLight1GreenForCars(self);
+ /* in leaf state: return state id */
+ return STATE_SwitchToLight1GreenForCars;
+ case STATE_state0:
+ /* in leaf state: return state id */
+ return STATE_state0;
+ case STATE_state1:
+ /* in leaf state: return state id */
+ return STATE_state1;
+ case STATE_SwitchToLight2GreenForCars:
+ if (!(skip_entry)) entry_SwitchToLight2GreenForCars(self);
+ /* in leaf state: return state id */
+ return STATE_SwitchToLight2GreenForCars;
+ case STATE_state2:
+ /* in leaf state: return state id */
+ return STATE_state2;
+ case STATE_state3:
+ /* in leaf state: return state id */
+ return STATE_state3;
+ case STATE_Light2GreenForCars:
+ if (!(skip_entry)) entry_Light2GreenForCars(self);
+ /* in leaf state: return state id */
+ return STATE_Light2GreenForCars;
+ case STATE_TOP:
+ state = self->history[STATE_TOP];
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ skip_entry = FALSE;
+ }
+ /* return NO_STATE; // required by CDT but detected as unreachable by JDT because of while (true) */
+}
+
+static void TrafficController_executeInitTransition(TrafficController* self) {
+ int chain = CHAIN_TRANS_INITIAL_TO__Idle;
+ etInt16 next = executeTransitionChain(self, chain, NULL, NULL);
+ next = enterHistory(self, next);
+ setState(self, next);
+}
+
+/* receiveEvent contains the main implementation of the FSM */
+static void TrafficController_receiveEvent(TrafficController* self, InterfaceItemBase* ifitem, int evt, void* generic_data) {
+ int trigger = ifitem->localId + EVT_SHIFT*evt;
+ int chain = NOT_CAUGHT;
+ etInt16 catching_state = NO_STATE;
+
+ if (!handleSystemEvent(ifitem, evt, generic_data)) {
+ switch (getState(self)) {
+ case STATE_Idle:
+ switch(trigger) {
+ case TRIG_timeout__timeout:
+ {
+ chain = CHAIN_TRANS_tr0_FROM_Idle_TO_SwitchToLight1GreenForCars_BY_timeouttimeout;
+ catching_state = STATE_TOP;
+ }
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ break;
+ case STATE_Light1GreenForCars:
+ switch(trigger) {
+ case TRIG_timeout__timeout:
+ {
+ chain = CHAIN_TRANS_tr5_FROM_Light1GreenForCars_TO_SwitchToLight2GreenForCars_BY_timeouttimeout;
+ catching_state = STATE_TOP;
+ }
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ break;
+ case STATE_SwitchToLight1GreenForCars:
+ switch(trigger) {
+ case TRIG_light1__greenForCarDone:
+ {
+ chain = CHAIN_TRANS_tr1_FROM_SwitchToLight1GreenForCars_TO_state0_BY_greenForCarDonelight1;
+ catching_state = STATE_TOP;
+ }
+ break;
+ case TRIG_light2__greenForPedDone:
+ {
+ chain = CHAIN_TRANS_tr2_FROM_SwitchToLight1GreenForCars_TO_state1_BY_greenForPedDonelight2;
+ catching_state = STATE_TOP;
+ }
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ break;
+ case STATE_state0:
+ switch(trigger) {
+ case TRIG_light2__greenForPedDone:
+ {
+ chain = CHAIN_TRANS_tr4_FROM_state0_TO_Light1GreenForCars_BY_greenForPedDonelight2;
+ catching_state = STATE_TOP;
+ }
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ break;
+ case STATE_state1:
+ switch(trigger) {
+ case TRIG_light1__greenForCarDone:
+ {
+ chain = CHAIN_TRANS_tr3_FROM_state1_TO_Light1GreenForCars_BY_greenForCarDonelight1;
+ catching_state = STATE_TOP;
+ }
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ break;
+ case STATE_SwitchToLight2GreenForCars:
+ switch(trigger) {
+ case TRIG_light1__greenForPedDone:
+ {
+ chain = CHAIN_TRANS_tr6_FROM_SwitchToLight2GreenForCars_TO_state2_BY_greenForPedDonelight1;
+ catching_state = STATE_TOP;
+ }
+ break;
+ case TRIG_light2__greenForCarDone:
+ {
+ chain = CHAIN_TRANS_tr7_FROM_SwitchToLight2GreenForCars_TO_state3_BY_greenForCarDonelight2;
+ catching_state = STATE_TOP;
+ }
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ break;
+ case STATE_state2:
+ switch(trigger) {
+ case TRIG_light2__greenForCarDone:
+ {
+ chain = CHAIN_TRANS_tr8_FROM_state2_TO_Light2GreenForCars_BY_greenForCarDonelight2;
+ catching_state = STATE_TOP;
+ }
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ break;
+ case STATE_state3:
+ switch(trigger) {
+ case TRIG_light1__greenForPedDone:
+ {
+ chain = CHAIN_TRANS_tr9_FROM_state3_TO_Light2GreenForCars_BY_greenForPedDonelight1;
+ catching_state = STATE_TOP;
+ }
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ break;
+ case STATE_Light2GreenForCars:
+ switch(trigger) {
+ case TRIG_timeout__timeout:
+ {
+ chain = CHAIN_TRANS_tr10_FROM_Light2GreenForCars_TO_SwitchToLight1GreenForCars_BY_timeouttimeout;
+ catching_state = STATE_TOP;
+ }
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ }
+ if (chain != NOT_CAUGHT) {
+ exitTo(self, getState(self), catching_state);
+ {
+ etInt16 next = executeTransitionChain(self, chain, ifitem, generic_data);
+ next = enterHistory(self, next);
+ setState(self, next);
+ }
+ }
+}
+
+void TrafficController_init(TrafficController* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("TrafficController", "init")
+ self->state = STATE_TOP;
+ {
+ int i;
+ for (i=0; i<TRAFFICCONTROLLER_HISTORY_SIZE; ++i)
+ self->history[i] = NO_STATE;
+ }
+ TrafficController_executeInitTransition(self);
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+
+void TrafficController_receiveMessage(void* self, void* ifitem, const etMessage* msg){
+ ET_MSC_LOGGER_SYNC_ENTRY("TrafficController", "_receiveMessage")
+
+ TrafficController_receiveEvent(self, (etPort*)ifitem, msg->evtID, (void*)(((char*)msg)+MEM_CEIL(sizeof(etMessage))));
+
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+
+/*--------------------- operations ---------------------*/
+void TrafficController_ctor(TrafficController* self) {
+ etInitSockets();
+}
+void TrafficController_dtor(TrafficController* self) {
+ etCleanupSockets();
+}
+
diff --git a/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficController.h b/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficController.h
new file mode 100644
index 000000000..852dbfb1e
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficController.h
@@ -0,0 +1,68 @@
+/**
+ * @author generated by eTrice
+ *
+ * Header File of ActorClass TrafficController
+ *
+ */
+
+#ifndef _TRAFFICLIGHT_EXAMPLE_TRAFFICCONTROLLER_H_
+#define _TRAFFICLIGHT_EXAMPLE_TRAFFICCONTROLLER_H_
+
+#include "etDatatypes.h"
+#include "messaging/etMessage.h"
+
+#include "room/basic/service/timing/PTimer.h"
+#include "trafficlight/example/PTrafficLight.h"
+
+/*--------------------- begin user code ---------------------*/
+#include "platform/etTcpSockets.h"
+/*--------------------- end user code ---------------------*/
+
+typedef struct TrafficController TrafficController;
+
+/* const part of ActorClass (ROM) */
+typedef struct TrafficController_const {
+ /* simple ports */
+ const PTrafficLightConjPort light1;
+ const PTrafficLightConjPort light2;
+
+ /* data receive ports */
+
+ /* saps */
+ const PTimerConjPort timeout;
+
+ /* replicated ports */
+
+ /* services */
+} TrafficController_const;
+
+
+/* constant for state machine data */
+#define TRAFFICCONTROLLER_HISTORY_SIZE 2
+
+/* variable part of ActorClass (RAM) */
+struct TrafficController {
+ const TrafficController_const* const constData;
+
+ /* data send ports */
+
+ /*--------------------- attributes ---------------------*/
+
+
+ /* state machine variables */
+ etInt16 state;
+ etInt16 history[TRAFFICCONTROLLER_HISTORY_SIZE];
+};
+
+void TrafficController_init(TrafficController* self);
+
+void TrafficController_receiveMessage(void* self, void* ifitem, const etMessage* msg);
+
+
+/*--------------------- operations ---------------------*/
+void TrafficController_ctor(TrafficController* self);
+void TrafficController_dtor(TrafficController* self);
+
+
+#endif /* _TRAFFICLIGHT_EXAMPLE_TRAFFICCONTROLLER_H_ */
+
diff --git a/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficLight.c b/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficLight.c
new file mode 100644
index 000000000..4e40db6f2
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficLight.c
@@ -0,0 +1,515 @@
+/**
+ * @author generated by eTrice
+ *
+ * Source File of ActorClass TrafficLight
+ *
+ */
+
+#include "TrafficLight.h"
+
+#include "modelbase/etActor.h"
+#include "debugging/etLogger.h"
+#include "debugging/etMSCLogger.h"
+#include "etUnit/etUnit.h"
+#include "osal/etMemory.h"
+
+#include "room/basic/service/tcp/PTcpControl.h"
+#include "room/basic/service/tcp/PTcpPayload.h"
+#include "room/basic/service/timing/PTimer.h"
+#include "trafficlight/example/PTrafficLight.h"
+
+
+/* interface item IDs */
+enum interface_items {
+ IFITEM_controller = 1,
+ IFITEM_tcpCtrl = 2,
+ IFITEM_tcpPayload = 3,
+ IFITEM_timeout = 4,
+ IFITEM_blinkerTimeout = 5
+};
+
+/* state IDs */
+enum state_ids {
+ NO_STATE = 0,
+ STATE_TOP = 1,
+ STATE_Off_Blinking = 2,
+ STATE_OpenSocket = 3,
+ STATE_CarYellow = 4,
+ STATE_PedRed = 5,
+ STATE_CarGreen = 6,
+ STATE_Off_Blinking_On = 7,
+ STATE_Off_Blinking_Off = 8,
+ STATE_CarYellow2 = 9,
+ STATE_CarRed = 10,
+ STATE_PedGreen = 11,
+ STATE_MAX = 12
+};
+
+/* transition chains */
+enum chain_ids {
+ CHAIN_TRANS_INITIAL_TO__OpenSocket = 1,
+ CHAIN_TRANS_tr0_FROM_OpenSocket_TO_Off_Blinking_tp0_BY_establishedtcpCtrl = 2,
+ CHAIN_TRANS_tr2_FROM_Off_Blinking_TO_PedRed_BY_greenForCarcontroller = 3,
+ CHAIN_TRANS_tr3_FROM_PedRed_TO_CarYellow_BY_timeouttimeout = 4,
+ CHAIN_TRANS_tr1_FROM_CarYellow_TO_CarGreen_BY_timeouttimeout = 5,
+ CHAIN_TRANS_tr4_FROM_Off_Blinking_TO_CarYellow2_BY_greenForPedcontroller = 6,
+ CHAIN_TRANS_tr5_FROM_CarYellow2_TO_CarRed_BY_timeouttimeout = 7,
+ CHAIN_TRANS_tr6_FROM_CarRed_TO_PedGreen_BY_timeouttimeout = 8,
+ CHAIN_TRANS_tr7_FROM_PedGreen_TO_PedRed_BY_greenForCarcontroller = 9,
+ CHAIN_TRANS_tr8_FROM_CarGreen_TO_CarYellow2_BY_greenForPedcontroller = 10,
+ CHAIN_Off_Blinking_TRANS_tr1_FROM_On_TO_Off_BY_timeoutblinkerTimeout = 11,
+ CHAIN_Off_Blinking_TRANS_tr2_FROM_Off_TO_On_BY_timeoutblinkerTimeout = 12
+};
+
+/* triggers */
+enum triggers {
+ POLLING = 0,
+ TRIG_controller__greenForCar = IFITEM_controller + EVT_SHIFT*PTrafficLight_IN_greenForCar,
+ TRIG_timeout__timeout = IFITEM_timeout + EVT_SHIFT*PTimer_OUT_timeout,
+ TRIG_blinkerTimeout__timeout = IFITEM_blinkerTimeout + EVT_SHIFT*PTimer_OUT_timeout,
+ TRIG_controller__greenForPed = IFITEM_controller + EVT_SHIFT*PTrafficLight_IN_greenForPed,
+ TRIG_tcpCtrl__established = IFITEM_tcpCtrl + EVT_SHIFT*PTcpControl_OUT_established
+};
+
+
+static void setState(TrafficLight* self, etInt16 new_state) {
+ self->state = new_state;
+}
+
+static etInt16 getState(TrafficLight* self) {
+ return self->state;
+}
+
+/* Entry and Exit Codes */
+static void entry_OpenSocket(TrafficLight* self) {
+ PTcpControlConjPort_open(&self->constData->tcpCtrl, &(self->ipConfig /* ORIG: ipConfig */)) /* ORIG: tcpCtrl.open(&(ipConfig)) */;
+}
+static void entry_CarYellow(TrafficLight* self) {
+ TrafficLight_sendString(self, "carLights=yellow\n") /* ORIG: sendString("carLights=yellow\n") */;
+ PTimerConjPort_startTimeout(&self->constData->timeout, 1000) /* ORIG: timeout.startTimeout(1000) */;
+}
+static void entry_PedRed(TrafficLight* self) {
+ TrafficLight_sendString(self, "pedLights=red\n") /* ORIG: sendString("pedLights=red\n") */;
+ TrafficLight_sendString(self, "carLights=red\n") /* ORIG: sendString("carLights=red\n") */;
+ PTimerConjPort_startTimeout(&self->constData->timeout, 1000) /* ORIG: timeout.startTimeout(1000) */;
+}
+static void entry_CarGreen(TrafficLight* self) {
+ TrafficLight_sendString(self, "carLights=green\n") /* ORIG: sendString("carLights=green\n") */;
+ PTrafficLightPort_greenForCarDone(&self->constData->controller) /* ORIG: controller.greenForCarDone() */;
+}
+static void entry_Off_Blinking_On(TrafficLight* self) {
+ TrafficLight_sendString(self, "carLights=red\n") /* ORIG: sendString("carLights=red\n") */;
+ TrafficLight_sendString(self, "pedLights=red\n") /* ORIG: sendString("pedLights=red\n") */;
+ PTimerConjPort_startTimeout(&self->constData->blinkerTimeout, 500) /* ORIG: blinkerTimeout.startTimeout(500) */;
+}
+static void exit_Off_Blinking_On(TrafficLight* self) {
+ TrafficLight_sendString(self, "carLights=off\n") /* ORIG: sendString("carLights=off\n") */;
+ TrafficLight_sendString(self, "pedLights=off\n") /* ORIG: sendString("pedLights=off\n") */;
+}
+static void entry_Off_Blinking_Off(TrafficLight* self) {
+ PTimerConjPort_startTimeout(&self->constData->blinkerTimeout, 500) /* ORIG: blinkerTimeout.startTimeout(500) */;
+}
+static void entry_CarYellow2(TrafficLight* self) {
+ TrafficLight_sendString(self, "carLights=yellow\n") /* ORIG: sendString("carLights=yellow\n") */;
+ PTimerConjPort_startTimeout(&self->constData->timeout, 1000) /* ORIG: timeout.startTimeout(1000) */;
+}
+static void entry_CarRed(TrafficLight* self) {
+ TrafficLight_sendString(self, "carLights=red\n") /* ORIG: sendString("carLights=red\n") */;
+ PTimerConjPort_startTimeout(&self->constData->timeout, 1000) /* ORIG: timeout.startTimeout(1000) */;
+}
+static void entry_PedGreen(TrafficLight* self) {
+ TrafficLight_sendString(self, "pedLights=green\n") /* ORIG: sendString("pedLights=green\n") */;
+ PTrafficLightPort_greenForPedDone(&self->constData->controller) /* ORIG: controller.greenForPedDone() */;
+}
+
+/* Action Codes */
+
+/**
+ * calls exit codes while exiting from the current state to one of its
+ * parent states while remembering the history
+ * @param current - the current state
+ * @param to - the final parent state
+ */
+static void exitTo(TrafficLight* self, etInt16 current, etInt16 to) {
+ while (current!=to) {
+ switch (current) {
+ case STATE_OpenSocket:
+ self->history[STATE_TOP] = STATE_OpenSocket;
+ current = STATE_TOP;
+ break;
+ case STATE_CarYellow:
+ self->history[STATE_TOP] = STATE_CarYellow;
+ current = STATE_TOP;
+ break;
+ case STATE_PedRed:
+ self->history[STATE_TOP] = STATE_PedRed;
+ current = STATE_TOP;
+ break;
+ case STATE_CarGreen:
+ self->history[STATE_TOP] = STATE_CarGreen;
+ current = STATE_TOP;
+ break;
+ case STATE_Off_Blinking:
+ self->history[STATE_TOP] = STATE_Off_Blinking;
+ current = STATE_TOP;
+ break;
+ case STATE_Off_Blinking_On:
+ exit_Off_Blinking_On(self);
+ self->history[STATE_Off_Blinking] = STATE_Off_Blinking_On;
+ current = STATE_Off_Blinking;
+ break;
+ case STATE_Off_Blinking_Off:
+ self->history[STATE_Off_Blinking] = STATE_Off_Blinking_Off;
+ current = STATE_Off_Blinking;
+ break;
+ case STATE_CarYellow2:
+ self->history[STATE_TOP] = STATE_CarYellow2;
+ current = STATE_TOP;
+ break;
+ case STATE_CarRed:
+ self->history[STATE_TOP] = STATE_CarRed;
+ current = STATE_TOP;
+ break;
+ case STATE_PedGreen:
+ self->history[STATE_TOP] = STATE_PedGreen;
+ current = STATE_TOP;
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ }
+}
+
+/**
+ * calls action, entry and exit codes along a transition chain. The generic data are cast to typed data
+ * matching the trigger of this chain. The ID of the final state is returned
+ * @param chain - the chain ID
+ * @param generic_data - the generic data pointer
+ * @return the +/- ID of the final state either with a positive sign, that indicates to execute the state's entry code, or a negative sign vice versa
+ */
+static etInt16 executeTransitionChain(TrafficLight* self, int chain, const InterfaceItemBase* ifitem, void* generic_data) {
+ switch (chain) {
+ case CHAIN_TRANS_INITIAL_TO__OpenSocket:
+ {
+ return STATE_OpenSocket;
+ }
+ case CHAIN_TRANS_tr0_FROM_OpenSocket_TO_Off_Blinking_tp0_BY_establishedtcpCtrl:
+ {
+ return STATE_Off_Blinking_On;
+ }
+ case CHAIN_TRANS_tr2_FROM_Off_Blinking_TO_PedRed_BY_greenForCarcontroller:
+ {
+ return STATE_PedRed;
+ }
+ case CHAIN_TRANS_tr3_FROM_PedRed_TO_CarYellow_BY_timeouttimeout:
+ {
+ return STATE_CarYellow;
+ }
+ case CHAIN_TRANS_tr1_FROM_CarYellow_TO_CarGreen_BY_timeouttimeout:
+ {
+ return STATE_CarGreen;
+ }
+ case CHAIN_TRANS_tr4_FROM_Off_Blinking_TO_CarYellow2_BY_greenForPedcontroller:
+ {
+ return STATE_CarYellow2;
+ }
+ case CHAIN_TRANS_tr5_FROM_CarYellow2_TO_CarRed_BY_timeouttimeout:
+ {
+ return STATE_CarRed;
+ }
+ case CHAIN_TRANS_tr6_FROM_CarRed_TO_PedGreen_BY_timeouttimeout:
+ {
+ return STATE_PedGreen;
+ }
+ case CHAIN_TRANS_tr7_FROM_PedGreen_TO_PedRed_BY_greenForCarcontroller:
+ {
+ return STATE_PedRed;
+ }
+ case CHAIN_TRANS_tr8_FROM_CarGreen_TO_CarYellow2_BY_greenForPedcontroller:
+ {
+ return STATE_CarYellow2;
+ }
+ case CHAIN_Off_Blinking_TRANS_tr1_FROM_On_TO_Off_BY_timeoutblinkerTimeout:
+ {
+ return STATE_Off_Blinking_Off;
+ }
+ case CHAIN_Off_Blinking_TRANS_tr2_FROM_Off_TO_On_BY_timeoutblinkerTimeout:
+ {
+ return STATE_Off_Blinking_On;
+ }
+ default:
+ /* should not occur */
+ break;
+ }
+ return NO_STATE;
+}
+
+/**
+ * calls entry codes while entering a state's history. The ID of the final leaf state is returned
+ * @param state - the state which is entered
+ * @return - the ID of the final leaf state
+ */
+static etInt16 enterHistory(TrafficLight* self, etInt16 state) {
+ boolean skip_entry = FALSE;
+ if (state >= STATE_MAX) {
+ state = (etInt16) (state - STATE_MAX);
+ skip_entry = TRUE;
+ }
+ while (TRUE) {
+ switch (state) {
+ case STATE_OpenSocket:
+ if (!(skip_entry)) entry_OpenSocket(self);
+ /* in leaf state: return state id */
+ return STATE_OpenSocket;
+ case STATE_CarYellow:
+ if (!(skip_entry)) entry_CarYellow(self);
+ /* in leaf state: return state id */
+ return STATE_CarYellow;
+ case STATE_PedRed:
+ if (!(skip_entry)) entry_PedRed(self);
+ /* in leaf state: return state id */
+ return STATE_PedRed;
+ case STATE_CarGreen:
+ if (!(skip_entry)) entry_CarGreen(self);
+ /* in leaf state: return state id */
+ return STATE_CarGreen;
+ case STATE_Off_Blinking:
+ /* state has a sub graph */
+ /* without init transition */
+ state = self->history[STATE_Off_Blinking];
+ break;
+ case STATE_Off_Blinking_On:
+ if (!(skip_entry)) entry_Off_Blinking_On(self);
+ /* in leaf state: return state id */
+ return STATE_Off_Blinking_On;
+ case STATE_Off_Blinking_Off:
+ if (!(skip_entry)) entry_Off_Blinking_Off(self);
+ /* in leaf state: return state id */
+ return STATE_Off_Blinking_Off;
+ case STATE_CarYellow2:
+ if (!(skip_entry)) entry_CarYellow2(self);
+ /* in leaf state: return state id */
+ return STATE_CarYellow2;
+ case STATE_CarRed:
+ if (!(skip_entry)) entry_CarRed(self);
+ /* in leaf state: return state id */
+ return STATE_CarRed;
+ case STATE_PedGreen:
+ if (!(skip_entry)) entry_PedGreen(self);
+ /* in leaf state: return state id */
+ return STATE_PedGreen;
+ case STATE_TOP:
+ state = self->history[STATE_TOP];
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ skip_entry = FALSE;
+ }
+ /* return NO_STATE; // required by CDT but detected as unreachable by JDT because of while (true) */
+}
+
+static void TrafficLight_executeInitTransition(TrafficLight* self) {
+ int chain = CHAIN_TRANS_INITIAL_TO__OpenSocket;
+ etInt16 next = executeTransitionChain(self, chain, NULL, NULL);
+ next = enterHistory(self, next);
+ setState(self, next);
+}
+
+/* receiveEvent contains the main implementation of the FSM */
+static void TrafficLight_receiveEvent(TrafficLight* self, InterfaceItemBase* ifitem, int evt, void* generic_data) {
+ int trigger = ifitem->localId + EVT_SHIFT*evt;
+ int chain = NOT_CAUGHT;
+ etInt16 catching_state = NO_STATE;
+
+ if (!handleSystemEvent(ifitem, evt, generic_data)) {
+ switch (getState(self)) {
+ case STATE_OpenSocket:
+ switch(trigger) {
+ case TRIG_tcpCtrl__established:
+ {
+ chain = CHAIN_TRANS_tr0_FROM_OpenSocket_TO_Off_Blinking_tp0_BY_establishedtcpCtrl;
+ catching_state = STATE_TOP;
+ }
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ break;
+ case STATE_CarYellow:
+ switch(trigger) {
+ case TRIG_timeout__timeout:
+ {
+ chain = CHAIN_TRANS_tr1_FROM_CarYellow_TO_CarGreen_BY_timeouttimeout;
+ catching_state = STATE_TOP;
+ }
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ break;
+ case STATE_PedRed:
+ switch(trigger) {
+ case TRIG_timeout__timeout:
+ {
+ chain = CHAIN_TRANS_tr3_FROM_PedRed_TO_CarYellow_BY_timeouttimeout;
+ catching_state = STATE_TOP;
+ }
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ break;
+ case STATE_CarGreen:
+ switch(trigger) {
+ case TRIG_controller__greenForPed:
+ {
+ chain = CHAIN_TRANS_tr8_FROM_CarGreen_TO_CarYellow2_BY_greenForPedcontroller;
+ catching_state = STATE_TOP;
+ }
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ break;
+ case STATE_Off_Blinking_On:
+ switch(trigger) {
+ case TRIG_blinkerTimeout__timeout:
+ {
+ chain = CHAIN_Off_Blinking_TRANS_tr1_FROM_On_TO_Off_BY_timeoutblinkerTimeout;
+ catching_state = STATE_Off_Blinking;
+ }
+ break;
+ case TRIG_controller__greenForCar:
+ {
+ chain = CHAIN_TRANS_tr2_FROM_Off_Blinking_TO_PedRed_BY_greenForCarcontroller;
+ catching_state = STATE_TOP;
+ }
+ break;
+ case TRIG_controller__greenForPed:
+ {
+ chain = CHAIN_TRANS_tr4_FROM_Off_Blinking_TO_CarYellow2_BY_greenForPedcontroller;
+ catching_state = STATE_TOP;
+ }
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ break;
+ case STATE_Off_Blinking_Off:
+ switch(trigger) {
+ case TRIG_blinkerTimeout__timeout:
+ {
+ chain = CHAIN_Off_Blinking_TRANS_tr2_FROM_Off_TO_On_BY_timeoutblinkerTimeout;
+ catching_state = STATE_Off_Blinking;
+ }
+ break;
+ case TRIG_controller__greenForCar:
+ {
+ chain = CHAIN_TRANS_tr2_FROM_Off_Blinking_TO_PedRed_BY_greenForCarcontroller;
+ catching_state = STATE_TOP;
+ }
+ break;
+ case TRIG_controller__greenForPed:
+ {
+ chain = CHAIN_TRANS_tr4_FROM_Off_Blinking_TO_CarYellow2_BY_greenForPedcontroller;
+ catching_state = STATE_TOP;
+ }
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ break;
+ case STATE_CarYellow2:
+ switch(trigger) {
+ case TRIG_timeout__timeout:
+ {
+ chain = CHAIN_TRANS_tr5_FROM_CarYellow2_TO_CarRed_BY_timeouttimeout;
+ catching_state = STATE_TOP;
+ }
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ break;
+ case STATE_CarRed:
+ switch(trigger) {
+ case TRIG_timeout__timeout:
+ {
+ chain = CHAIN_TRANS_tr6_FROM_CarRed_TO_PedGreen_BY_timeouttimeout;
+ catching_state = STATE_TOP;
+ }
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ break;
+ case STATE_PedGreen:
+ switch(trigger) {
+ case TRIG_controller__greenForCar:
+ {
+ chain = CHAIN_TRANS_tr7_FROM_PedGreen_TO_PedRed_BY_greenForCarcontroller;
+ catching_state = STATE_TOP;
+ }
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ break;
+ default:
+ /* should not occur */
+ break;
+ }
+ }
+ if (chain != NOT_CAUGHT) {
+ exitTo(self, getState(self), catching_state);
+ {
+ etInt16 next = executeTransitionChain(self, chain, ifitem, generic_data);
+ next = enterHistory(self, next);
+ setState(self, next);
+ }
+ }
+}
+
+void TrafficLight_init(TrafficLight* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("TrafficLight", "init")
+ self->state = STATE_TOP;
+ {
+ int i;
+ for (i=0; i<TRAFFICLIGHT_HISTORY_SIZE; ++i)
+ self->history[i] = NO_STATE;
+ }
+ TrafficLight_executeInitTransition(self);
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+
+void TrafficLight_receiveMessage(void* self, void* ifitem, const etMessage* msg){
+ ET_MSC_LOGGER_SYNC_ENTRY("TrafficLight", "_receiveMessage")
+
+ TrafficLight_receiveEvent(self, (etPort*)ifitem, msg->evtID, (void*)(((char*)msg)+MEM_CEIL(sizeof(etMessage))));
+
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+
+/*--------------------- operations ---------------------*/
+void TrafficLight_sendString(TrafficLight* self, charPtr text) {
+
+ static DTcpPayload pl;
+ strcpy(pl.data, text);
+ pl.length = strlen(text);
+ PTcpPayloadConjPort_send(&self->constData->tcpPayload, &pl) /* ORIG: tcpPayload.send(&pl) */;
+}
+
diff --git a/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficLight.h b/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficLight.h
new file mode 100644
index 000000000..36f4114bf
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficLight.h
@@ -0,0 +1,70 @@
+/**
+ * @author generated by eTrice
+ *
+ * Header File of ActorClass TrafficLight
+ *
+ */
+
+#ifndef _TRAFFICLIGHT_EXAMPLE_TRAFFICLIGHT_H_
+#define _TRAFFICLIGHT_EXAMPLE_TRAFFICLIGHT_H_
+
+#include "etDatatypes.h"
+#include "messaging/etMessage.h"
+
+#include "room/basic/service/tcp/DTcpControl.h"
+#include "room/basic/service/tcp/PTcpControl.h"
+#include "room/basic/service/tcp/PTcpPayload.h"
+#include "room/basic/service/timing/PTimer.h"
+#include "trafficlight/example/PTrafficLight.h"
+
+
+typedef struct TrafficLight TrafficLight;
+
+/* const part of ActorClass (ROM) */
+typedef struct TrafficLight_const {
+ /* simple ports */
+ const PTrafficLightPort controller;
+ const PTcpControlConjPort tcpCtrl;
+ const PTcpPayloadConjPort tcpPayload;
+
+ /* data receive ports */
+
+ /* saps */
+ const PTimerConjPort timeout;
+ const PTimerConjPort blinkerTimeout;
+
+ /* replicated ports */
+
+ /* services */
+} TrafficLight_const;
+
+
+/* constant for state machine data */
+#define TRAFFICLIGHT_HISTORY_SIZE 3
+
+/* variable part of ActorClass (RAM) */
+struct TrafficLight {
+ const TrafficLight_const* const constData;
+
+ /* data send ports */
+
+ /*--------------------- attributes ---------------------*/
+ DTcpControl ipConfig;
+
+
+ /* state machine variables */
+ etInt16 state;
+ etInt16 history[TRAFFICLIGHT_HISTORY_SIZE];
+};
+
+void TrafficLight_init(TrafficLight* self);
+
+void TrafficLight_receiveMessage(void* self, void* ifitem, const etMessage* msg);
+
+
+/*--------------------- operations ---------------------*/
+void TrafficLight_sendString(TrafficLight* self, charPtr text);
+
+
+#endif /* _TRAFFICLIGHT_EXAMPLE_TRAFFICLIGHT_H_ */
+
diff --git a/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficlightExampleApplication.c b/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficlightExampleApplication.c
new file mode 100644
index 000000000..043106785
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficlightExampleApplication.c
@@ -0,0 +1,40 @@
+/**
+ * @author generated by eTrice
+ *
+ * Source File of ActorClass TrafficlightExampleApplication
+ *
+ */
+
+#include "TrafficlightExampleApplication.h"
+
+#include "modelbase/etActor.h"
+#include "debugging/etLogger.h"
+#include "debugging/etMSCLogger.h"
+#include "etUnit/etUnit.h"
+#include "osal/etMemory.h"
+
+#include "room/basic/service/tcp/PTcpControl.h"
+#include "room/basic/service/tcp/PTcpPayload.h"
+#include "room/basic/service/timing/PTimer.h"
+#include "trafficlight/example/PTrafficLight.h"
+
+
+/* interface item IDs */
+/* empty enum not generated */
+
+
+void TrafficlightExampleApplication_init(TrafficlightExampleApplication* self){
+ ET_MSC_LOGGER_SYNC_ENTRY("TrafficlightExampleApplication", "init")
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+
+void TrafficlightExampleApplication_receiveMessage(void* self, void* ifitem, const etMessage* msg){
+ ET_MSC_LOGGER_SYNC_ENTRY("TrafficlightExampleApplication", "_receiveMessage")
+
+ ET_MSC_LOGGER_SYNC_EXIT
+}
+
+
+/*--------------------- operations ---------------------*/
+
diff --git a/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficlightExampleApplication.h b/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficlightExampleApplication.h
new file mode 100644
index 000000000..0fdf71576
--- /dev/null
+++ b/examples/org.eclipse.etrice.tutorials.c/src-gen/trafficlight/example/TrafficlightExampleApplication.h
@@ -0,0 +1,44 @@
+/**
+ * @author generated by eTrice
+ *
+ * Header File of ActorClass TrafficlightExampleApplication
+ *
+ */
+
+#ifndef _TRAFFICLIGHT_EXAMPLE_TRAFFICLIGHTEXAMPLEAPPLICATION_H_
+#define _TRAFFICLIGHT_EXAMPLE_TRAFFICLIGHTEXAMPLEAPPLICATION_H_
+
+#include "etDatatypes.h"
+#include "messaging/etMessage.h"
+
+#include "room/basic/service/tcp/PTcpControl.h"
+#include "room/basic/service/tcp/PTcpPayload.h"
+#include "room/basic/service/timing/PTimer.h"
+#include "trafficlight/example/PTrafficLight.h"
+
+
+typedef struct TrafficlightExampleApplication TrafficlightExampleApplication;
+
+/* const part of ActorClass (ROM) */
+/* this actor class has no ports and thus no constant data */
+
+
+/* variable part of ActorClass (RAM) */
+struct TrafficlightExampleApplication {
+ /* This actor class has no data at all.
+ But the private actor instance data is passed to all life cycle functions.
+ By introducing the dummy data we keep this case simple
+ */
+ int dummy;
+};
+
+void TrafficlightExampleApplication_init(TrafficlightExampleApplication* self);
+
+void TrafficlightExampleApplication_receiveMessage(void* self, void* ifitem, const etMessage* msg);
+
+
+/*--------------------- operations ---------------------*/
+
+
+#endif /* _TRAFFICLIGHT_EXAMPLE_TRAFFICLIGHTEXAMPLEAPPLICATION_H_ */
+
diff --git a/examples/org.eclipse.etrice.tutorials.c/tmp/msc.seq b/examples/org.eclipse.etrice.tutorials.c/tmp/msc.seq
deleted file mode 100644
index eb26caea0..000000000
--- a/examples/org.eclipse.etrice.tutorials.c/tmp/msc.seq
+++ /dev/null
@@ -1,117 +0,0 @@
-main ==> nodeRef1_SubSysRef1 init(thread=6928)
-nodeRef1_SubSysRef1 ==> nodeRef1_SubSysRef1 constructActorInstances(thread=6928)
-nodeRef1_SubSysRef1 <== nodeRef1_SubSysRef1
-nodeRef1_SubSysRef1 ==> nodeRef1_SubSysRef1 initMessageServices(thread=6928)
-nodeRef1_SubSysRef1 ==> etMessageService init(thread=6928)
-etMessageService ==> etMessageQueue init(thread=6928)
-etMessageService <== etMessageQueue
-etMessageService ==> etMessageQueue init(thread=6928)
-etMessageService <== etMessageQueue
-etMessageService ==> etMessageService initMessagePool(thread=6928)
-etMessageService ==> etMessageQueue push(thread=6928)
-etMessageService <== etMessageQueue
-etMessageService ==> etMessageQueue push(thread=6928)
-etMessageService <== etMessageQueue
-etMessageService ==> etMessageQueue push(thread=6928)
-etMessageService <== etMessageQueue
-etMessageService ==> etMessageQueue push(thread=6928)
-etMessageService <== etMessageQueue
-etMessageService ==> etMessageQueue push(thread=6928)
-etMessageService <== etMessageQueue
-etMessageService ==> etMessageQueue push(thread=6928)
-etMessageService <== etMessageQueue
-etMessageService ==> etMessageQueue push(thread=6928)
-etMessageService <== etMessageQueue
-etMessageService ==> etMessageQueue push(thread=6928)
-etMessageService <== etMessageQueue
-etMessageService ==> etMessageQueue push(thread=6928)
-etMessageService <== etMessageQueue
-etMessageService ==> etMessageQueue push(thread=6928)
-etMessageService <== etMessageQueue
-etMessageService ==> etMessageQueue resetLowWaterMark(thread=6928)
-etMessageService <== etMessageQueue
-etMessageService <== etMessageService
-etMessageService ==> etMutex construct(thread=6928)
-etMessageService <== etMutex
-etMessageService ==> etMutex construct(thread=6928)
-etMessageService <== etMutex
-etMessageService ==> etSema construct(thread=6928)
-etMessageService <== etSema
-etMessageService ==> etThread construct(thread=6928)
-etMessageService <== etThread
-nodeRef1_SubSysRef1 <== etMessageService
-nodeRef1_SubSysRef1 <== nodeRef1_SubSysRef1
-nodeRef1_SubSysRef1 ==> nodeRef1_SubSysRef1 initActorInstances(thread=6928)
-nodeRef1_SubSysRef1 ==> ActorClass1 init(thread=6928)
-nodeRef1_SubSysRef1 <== ActorClass1
-nodeRef1_SubSysRef1 <== nodeRef1_SubSysRef1
-main <== nodeRef1_SubSysRef1
-main ==> nodeRef1_SubSysRef1 start(thread=6928)
-nodeRef1_SubSysRef1 ==> nodeRef1_SubSysRef1 startMessageServices(thread=6928)
-nodeRef1_SubSysRef1 ==> etMessageService start(thread=6928)
-etMessageService ==> etThread start(thread=6928)
-etMessageService <== etThread
-nodeRef1_SubSysRef1 <== etMessageService
-nodeRef1_SubSysRef1 <== nodeRef1_SubSysRef1
-main <== nodeRef1_SubSysRef1
-main ==> nodeRef1_SubSysRef1 run(thread=6928)
-nodeRef1_SubSysRef1 ==> etThread execute(thread=7712)
-etThread ==> etMessageService deliverAllMessages(thread=7712)
-etMessageService ==> etMessageQueue isNotEmpty(thread=7712)
-etMessageService <== etMessageQueue
-etMessageService ==> etSema waitForWakeup(thread=7712)
-main <== nodeRef1_SubSysRef1
-main ==> nodeRef1_SubSysRef1 stop(thread=6928)
-nodeRef1_SubSysRef1 ==> nodeRef1_SubSysRef1 stopMessageServices(thread=6928)
-nodeRef1_SubSysRef1 ==> etMessageService stop(thread=6928)
-etMessageService ==> etSystemProtocolConjPort terminate(thread=6928)
-etSystemProtocolConjPort ==> etPort sendMessage(thread=6928)
-etPort ==> etMessageService getMessageBuffer(thread=6928)
-etMessageService ==> etMutex enter(thread=6928)
-etMessageService <== etMutex
-etMessageService ==> etMessageQueue pop(thread=6928)
-etMessageService <== etMessageQueue
-etMessageService ==> etMutex leave(thread=6928)
-etMessageService <== etMutex
-etPort <== etMessageService
-etPort ==> etMessageService pushMessage(thread=6928)
-etMessageService ==> etMutex enter(thread=6928)
-etMessageService <== etMutex
-etMessageService ==> etMessageQueue push(thread=6928)
-etMessageService <== etMessageQueue
-etMessageService ==> etSema wakeup(thread=6928)
-etMessageService <== etSema
-etMessageService ==> etMutex leave(thread=6928)
-etMessageService <== etMutex
-etPort <== etMessageService
-etSystemProtocolConjPort <== etPort
-etMessageService <== etSystemProtocolConjPort
-nodeRef1_SubSysRef1 <== etMessageService
-etMessageService <== etSema
-nodeRef1_SubSysRef1 <== nodeRef1_SubSysRef1
-etMessageService ==> etMessageQueue isNotEmpty(thread=7712)
-main <== nodeRef1_SubSysRef1
-etMessageService <== etMessageQueue
-main ==> nodeRef1_SubSysRef1 destroy(thread=6928)
-etMessageService ==> etMessageService popMessage(thread=7712)
-nodeRef1_SubSysRef1 ==> nodeRef1_SubSysRef1 destroyMessageServices(thread=6928)
-etMessageService ==> etMutex enter(thread=7712)
-nodeRef1_SubSysRef1 ==> etMessageService destroy(thread=6928)
-etMessageService <== etMutex
-etMessageService ==> etMutex destruct(thread=6928)
-etMessageService ==> etMessageQueue pop(thread=7712)
-etMessageService <== etMutex
-etMessageService <== etMessageQueue
-etMessageService ==> etMutex destruct(thread=6928)
-etMessageService ==> etMutex leave(thread=7712)
-etMessageService <== etMutex
-etMessageService <== etMutex
-etMessageService ==> etSema destruct(thread=6928)
-etMessageService <== etMessageService
-etMessageService <== etSema
-etMessageService ==> MsgDispatcher_PhysicalThread1 receiveMessage(thread=7712)
-nodeRef1_SubSysRef1 <== etMessageService
-MsgDispatcher_PhysicalThread1 ==> etMessageService returnMessageBuffer(thread=7712)
-nodeRef1_SubSysRef1 <== nodeRef1_SubSysRef1
-etMessageService ==> etMutex enter(thread=7712)
-main <== nodeRef1_SubSysRef1

Back to the top